diff --git a/assets/index.a403ea04.js b/assets/index.20493566.js similarity index 94% rename from assets/index.a403ea04.js rename to assets/index.20493566.js index 9157d1e..2c33202 100644 --- a/assets/index.a403ea04.js +++ b/assets/index.20493566.js @@ -24,21 +24,21 @@ var i,r,n,o,a,l=s("2fLxs");function h(t){return(h="function"==typeof Symbol&&"sy // may be undefined if not provided. All assertion methods provide // both the actual and expected values to the assertion error for // display purposes. -function D(t){if(t.message instanceof Error)throw t.message;throw new b(t)}function T(t,e,i,r){if(!i){var n=!1;if(0===e)n=!0,r="No value argument passed to `assert.ok()`";else if(r instanceof Error)throw r;var o=new b({actual:i,expected:!0,message:r,operator:"==",stackStartFn:t});throw o.generatedMessage=n,o}}// Pure assertion tests whether a value is truthy, as determined +function T(t){if(t.message instanceof Error)throw t.message;throw new b(t)}function D(t,e,i,r){if(!i){var n=!1;if(0===e)n=!0,r="No value argument passed to `assert.ok()`";else if(r instanceof Error)throw r;var o=new b({actual:i,expected:!0,message:r,operator:"==",stackStartFn:t});throw o.generatedMessage=n,o}}// Pure assertion tests whether a value is truthy, as determined // by !!value. -function R(){for(var t=arguments.length,e=Array(t),i=0;i1?i-1:0),n=1;n1?i-1:0),n=1;n1?i-1:0),n=1;n1?i-1:0),n=1;n=0||_.indexOf("description")>=0))return d(i);// Some type of object without properties can be shortcutted. -if(0===_.length){if(O(i)){var k=i.name?": "+i.name:"";return e.stylize("[Function"+k+"]","special")}if(x(i))return e.stylize(RegExp.prototype.toString.call(i),"regexp");if(w(i))return e.stylize(Date.prototype.toString.call(i),"date");if(S(i))return d(i)}var P="",A=!1,D=["{","}"];return(p(i)&&(A=!0,D=["[","]"]),O(i)&&(P=" [Function"+(i.name?": "+i.name:"")+"]"),x(i)&&(P=" "+RegExp.prototype.toString.call(i)),w(i)&&(P=" "+Date.prototype.toUTCString.call(i)),S(i)&&(P=" "+d(i)),0!==_.length||A&&0!=i.length)?r<0?x(i)?e.stylize(RegExp.prototype.toString.call(i),"regexp"):e.stylize("[Object]","special"):(e.seen.push(i),l=A?function(t,e,i,r,n){for(var o=[],a=0,s=e.length;a=0&&a++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?o[0]+(""===n?"":n+"\n ")+" "+l.join(",\n ")+" "+o[1]:o[0]+n+" "+l.join(", ")+" "+o[1]):D[0]+P+D[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,i,r,n,o){var a,s,l;if((l=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),E(r,n)||(a="["+n+"]"),!s&&(0>t.seen.indexOf(l.value)?(s=m(i)?u(t,l.value,null):u(t,l.value,i-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").slice(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),v(a)){if(o&&n.match(/^\d+$/))return s;(a=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function p(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function y(t){return"string"==typeof t}function v(t){return void 0===t}function x(t){return _(t)&&"[object RegExp]"===M(t)}function _(t){return"object"==typeof t&&null!==t}function w(t){return _(t)&&"[object Date]"===M(t)}function S(t){return _(t)&&("[object Error]"===M(t)||t instanceof Error)}function O(t){return"function"==typeof t}function M(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}t.exports.debuglog=function(e){if(!o[e=e.toUpperCase()]){if(a.test(e)){var r=i.pid;o[e]=function(){var i=t.exports.format.apply(t.exports,arguments);console.error("%s %d: %s",e,r,i)}}else o[e]=function(){}}return o[e]},t.exports.inspect=l,// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +if(0===_.length){if(O(i)){var k=i.name?": "+i.name:"";return e.stylize("[Function"+k+"]","special")}if(x(i))return e.stylize(RegExp.prototype.toString.call(i),"regexp");if(w(i))return e.stylize(Date.prototype.toString.call(i),"date");if(S(i))return d(i)}var P="",A=!1,T=["{","}"];return(p(i)&&(A=!0,T=["[","]"]),O(i)&&(P=" [Function"+(i.name?": "+i.name:"")+"]"),x(i)&&(P=" "+RegExp.prototype.toString.call(i)),w(i)&&(P=" "+Date.prototype.toUTCString.call(i)),S(i)&&(P=" "+d(i)),0!==_.length||A&&0!=i.length)?r<0?x(i)?e.stylize(RegExp.prototype.toString.call(i),"regexp"):e.stylize("[Object]","special"):(e.seen.push(i),l=A?function(t,e,i,r,n){for(var o=[],a=0,s=e.length;a=0&&a++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?o[0]+(""===n?"":n+"\n ")+" "+l.join(",\n ")+" "+o[1]:o[0]+n+" "+l.join(", ")+" "+o[1]):T[0]+P+T[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,i,r,n,o){var a,s,l;if((l=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),E(r,n)||(a="["+n+"]"),!s&&(0>t.seen.indexOf(l.value)?(s=m(i)?u(t,l.value,null):u(t,l.value,i-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").slice(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),v(a)){if(o&&n.match(/^\d+$/))return s;(a=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function p(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function y(t){return"string"==typeof t}function v(t){return void 0===t}function x(t){return _(t)&&"[object RegExp]"===M(t)}function _(t){return"object"==typeof t&&null!==t}function w(t){return _(t)&&"[object Date]"===M(t)}function S(t){return _(t)&&("[object Error]"===M(t)||t instanceof Error)}function O(t){return"function"==typeof t}function M(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}t.exports.debuglog=function(e){if(!o[e=e.toUpperCase()]){if(a.test(e)){var r=i.pid;o[e]=function(){var i=t.exports.format.apply(t.exports,arguments);console.error("%s %d: %s",e,r,i)}}else o[e]=function(){}}return o[e]},t.exports.inspect=l,// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},// Don't use 'blue' not visible on cmd.exe l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",// "name": intentionally not styling regexp:"red"},// NOTE: These type checking functions intentionally don't use `instanceof` @@ -134,7 +134,7 @@ t.exports.log=function(){var e,i;console.log("%s - %s",(i=[k((e=new Date).getHou * prototype. * @param {function} superCtor Constructor function to inherit prototype from. */t.exports.inherits=s("9TvxW"),t.exports._extend=function(t,e){// Don't do anything if add isn't an object -if(!e||!_(e))return t;for(var i=Object.keys(e),r=i.length;r--;)t[i[r]]=e[i[r]];return t};var A="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function D(t,e){// `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). +if(!e||!_(e))return t;for(var i=Object.keys(e),r=i.length;r--;)t[i[r]]=e[i[r]];return t};var A="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function T(t,e){// `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). // Because `null` is a special error value in callbacks which means "no error // occurred", we error-wrap so the callback consumer can distinguish between // "the promise rejected with null" or "the promise fulfilled with undefined". @@ -143,10 +143,10 @@ if(!t){var i=Error("Promise was rejected with a falsy value");i.reason=t,t=i}ret // and that the callback throwing will reject the promise. function e(){for(var e=[],r=0;r=0&&"[object Array]"!==r(t)&&"[object Function]"===r(t.callee)},a=function(){return n(arguments)}();n.isLegacyArguments=o,t.exports=a?n:o}),l("goA1T",function(t,e){var i=s("grYrm");t.exports=function(){return i()&&!!Symbol.toStringTag}}),l("grYrm",function(t,e){/* eslint complexity: [2, 18], max-statements: [2, 33] */t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(e in t[e]=42,t)return!1;// eslint-disable-line no-restricted-syntax, no-unreachable-loop +var M="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function k(t){return"[object SharedArrayBuffer]"===c(t)}function P(t){return void 0!==M&&(void 0===k.working&&(k.working=k(new M)),k.working?k(t):t instanceof M)}function E(t){return m(t,u)}function A(t){return m(t,d)}function T(t){return m(t,f)}function D(t){return l&&m(t,p)}function R(t){return h&&m(t,g)}t.exports.isSharedArrayBuffer=P,t.exports.isAsyncFunction=function(t){return"[object AsyncFunction]"===c(t)},t.exports.isMapIterator=function(t){return"[object Map Iterator]"===c(t)},t.exports.isSetIterator=function(t){return"[object Set Iterator]"===c(t)},t.exports.isGeneratorObject=function(t){return"[object Generator]"===c(t)},t.exports.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===c(t)},t.exports.isNumberObject=E,t.exports.isStringObject=A,t.exports.isBooleanObject=T,t.exports.isBigIntObject=D,t.exports.isSymbolObject=R,t.exports.isBoxedPrimitive=function(t){return E(t)||A(t)||T(t)||D(t)||R(t)},t.exports.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(w(t)||P(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t.exports,e,{enumerable:!1,value:function(){throw Error(e+" is not supported in userland")}})})}),l("avzh7",function(t,e){var i=s("goA1T")(),r=s("3e3ab")("Object.prototype.toString"),n=function(t){return(!i||!t||"object"!=typeof t||!(Symbol.toStringTag in t))&&"[object Arguments]"===r(t)},o=function(t){return!!n(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==r(t)&&"[object Function]"===r(t.callee)},a=function(){return n(arguments)}();n.isLegacyArguments=o,t.exports=a?n:o}),l("goA1T",function(t,e){var i=s("grYrm");t.exports=function(){return i()&&!!Symbol.toStringTag}}),l("grYrm",function(t,e){/* eslint complexity: [2, 18], max-statements: [2, 33] */t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(e in t[e]=42,t)return!1;// eslint-disable-line no-restricted-syntax, no-unreachable-loop if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}}),l("3e3ab",function(t,e){var i=s("2VTxt"),r=s("70X2U"),n=r(i("String.prototype.indexOf"));t.exports=function(t,e){var o=i(t,!!e);return"function"==typeof o&&n(t,".prototype.")>-1?r(o):o}}),l("2VTxt",function(t,e){var i=SyntaxError,r=Function,n=TypeError,o=function(t){try{return r('"use strict"; return ('+t+").constructor;")()}catch(t){}},a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch(t){a=null;// this is IE 8, which has a broken gOPD }var l=function(){throw new n},h=a?function(){try{return(// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties arguments.callee,l)}catch(t){try{// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') @@ -203,16 +203,16 @@ if(0===O){// We have to get the result again. The lines were all removed before. var k=h.split("\n");// Only remove lines in case it makes sense to collapse those. // TODO: Accept env to always show the full error. if(k.length>30)for(k[26]="".concat(v,"...").concat(w);k.length>27;)k.pop();return"".concat(S.notIdentical,"\n\n").concat(k.join("\n"),"\n")}d>3&&(s="\n".concat(v,"...").concat(w).concat(s),l=!0),""!==n&&(s="\n ".concat(n).concat(s),n="");var P=0,E=S[r]+"\n".concat(x,"+ actual").concat(w," ").concat(_,"- expected").concat(w),A=" ".concat(v,"...").concat(w," Lines skipped");for(d=0;d1&&d>2&&(D>4?(o+="\n".concat(v,"...").concat(w),l=!0):D>3&&(o+="\n ".concat(u[d-2]),P++),o+="\n ".concat(u[d-1]),P++),// Mark the current line as the last diverging one. +var T=d-a;if(c.length1&&d>2&&(T>4?(o+="\n".concat(v,"...").concat(w),l=!0):T>3&&(o+="\n ".concat(u[d-2]),P++),o+="\n ".concat(u[d-1]),P++),// Mark the current line as the last diverging one. a=d,// Add the expected line to the cache. -n+="\n".concat(_,"-").concat(w," ").concat(u[d]),P++;else if(u.length1&&d>2&&(D>4?(o+="\n".concat(v,"...").concat(w),l=!0):D>3&&(o+="\n ".concat(c[d-2]),P++),o+="\n ".concat(c[d-1]),P++),// Mark the current line as the last diverging one. +n+="\n".concat(_,"-").concat(w," ").concat(u[d]),P++;else if(u.length1&&d>2&&(T>4?(o+="\n".concat(v,"...").concat(w),l=!0):T>3&&(o+="\n ".concat(c[d-2]),P++),o+="\n ".concat(c[d-1]),P++),// Mark the current line as the last diverging one. a=d,// Add the actual line to the result. -o+="\n".concat(x,"+").concat(w," ").concat(c[d]),P++;else{var T=u[d],R=c[d],C=R!==T&&(!y(R,",")||R.slice(0,-1)!==T);C&&y(T,",")&&T.slice(0,-1)===R&&(C=!1,R+=","),C?(D>1&&d>2&&(D>4?(o+="\n".concat(v,"...").concat(w),l=!0):D>3&&(o+="\n ".concat(c[d-2]),P++),o+="\n ".concat(c[d-1]),P++),// Mark the current line as the last diverging one. +o+="\n".concat(x,"+").concat(w," ").concat(c[d]),P++;else{var D=u[d],R=c[d],I=R!==D&&(!y(R,",")||R.slice(0,-1)!==D);I&&y(D,",")&&D.slice(0,-1)===R&&(I=!1,R+=","),I?(T>1&&d>2&&(T>4?(o+="\n".concat(v,"...").concat(w),l=!0):T>3&&(o+="\n ".concat(c[d-2]),P++),o+="\n ".concat(c[d-1]),P++),// Mark the current line as the last diverging one. a=d,// Add the actual line to the result and cache the expected diverging // line so consecutive diverging lines show up as +++--- and not +-+-+-. -o+="\n".concat(x,"+").concat(w," ").concat(R),n+="\n".concat(_,"-").concat(w," ").concat(T),P+=2):(// Add all cached information to the result before adding other things +o+="\n".concat(x,"+").concat(w," ").concat(R),n+="\n".concat(_,"-").concat(w," ").concat(D),P+=2):(// Add all cached information to the result before adding other things // and reset the cache. -o+=n,n="",(1===D||0===d)&&(o+="\n ".concat(R),P++))}// Inspected object to big (Show ~20 rows max) +o+=n,n="",(1===T||0===d)&&(o+="\n ".concat(R),P++))}// Inspected object to big (Show ~20 rows max) if(P>20&&d=0&&"[object Function]"===i.call(t.callee)),r}}),l("2QCzs",function(t,e){var i;if(!Object.keys){// modified from https://github.com/es-shims/es5-shim -var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=s("alwvH"),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),h=a.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(t){var e=t.constructor;return e&&e.prototype===t},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){/* global window */if("undefined"==typeof window)return!1;for(var t in window)try{if(!d["$"+t]&&r.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{u(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),p=function(t){/* global window */if("undefined"==typeof window||!f)return u(t);try{return u(t)}catch(t){return!1}};i=function(t){var e=null!==t&&"object"==typeof t,i="[object Function]"===n.call(t),a=o(t),s=e&&"[object String]"===n.call(t),u=[];if(!e&&!i&&!a)throw TypeError("Object.keys called on a non-object");var d=h&&i;if(s&&t.length>0&&!r.call(t,0))for(var f=0;f0)for(var g=0;gt.length)&&(e=t.length);for(var i=0,r=Array(e);i10)return!0;for(var e=0;e57)return!0}// The maximum size for an array is 2 ** 32 -1. -return 10===t.length&&t>=4294967296}function C(t){return Object.keys(t).filter(R).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}// Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js +var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=s("alwvH"),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),h=a.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(t){var e=t.constructor;return e&&e.prototype===t},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){/* global window */if("undefined"==typeof window)return!1;for(var t in window)try{if(!d["$"+t]&&r.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{u(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),p=function(t){/* global window */if("undefined"==typeof window||!f)return u(t);try{return u(t)}catch(t){return!1}};i=function(t){var e=null!==t&&"object"==typeof t,i="[object Function]"===n.call(t),a=o(t),s=e&&"[object String]"===n.call(t),u=[];if(!e&&!i&&!a)throw TypeError("Object.keys called on a non-object");var d=h&&i;if(s&&t.length>0&&!r.call(t,0))for(var f=0;f0)for(var g=0;gt.length)&&(e=t.length);for(var i=0,r=Array(e);i10)return!0;for(var e=0;e57)return!0}// The maximum size for an array is 2 ** 32 -1. +return 10===t.length&&t>=4294967296}function I(t){return Object.keys(t).filter(R).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}// Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js // original notice: /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */function I(t,e){if(t===e)return 0;for(var i=t.length,r=e.length,n=0,o=Math.min(i,r);n=4294967296}function C(t){return Object.keys(t).filter(R function F(t,e,i,r){// All identical values are equivalent, as determined by ===. if(t===e)return 0!==t||!i||h(t,e);// Check more closely if val1 and val2 are equal. if(i){if("object"!==n(t))return"number"==typeof t&&u(t)&&u(e);if("object"!==n(e)||null===t||null===e||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==n(t))return(null===e||"object"!==n(e))&&t==e;if(null===e||"object"!==n(e))return!1}var a=g(t);if(a!==g(e))return!1;if(Array.isArray(t)){// Check for sparse arrays and general fast path -if(t.length!==e.length)return!1;var s=C(t,j),l=C(e,j);return s.length===l.length&&N(t,e,i,r,1,s)}// [browserify] This triggers on certain types in IE (Map/Set) so we don't +if(t.length!==e.length)return!1;var s=I(t,j),l=I(e,j);return s.length===l.length&&N(t,e,i,r,1,s)}// [browserify] This triggers on certain types in IE (Map/Set) so we don't // wan't to early return out of the rest of the checks. However we can check // if the second value is one of these values and the first isn't. if("[object Object]"===a&&(!x(t)&&x(e)||!w(t)&&w(e)))return!1;if(v(t)){if(!v(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(_(t)){if(!_(e)||(o?t.source!==e.source||t.flags!==e.flags:RegExp.prototype.toString.call(t)!==RegExp.prototype.toString.call(e)))return!1}else if(S(t)||t instanceof Error)// Do not compare the stack as it might differ even though the error itself // is otherwise identical. -{if(t.message!==e.message||t.name!==e.name)return!1}else if(y(t)){if(!i&&(D(t)||T(t))){if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var i=0;iMath.max(Math.min(t,i),e);function f(t){return d(u(2.55*t),0,255)}function p(t){return d(u(255*t),0,255)}function g(t){return d(u(t/2.55)/100,0,1)}function m(t){return d(u(100*t),0,100)}let b={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},y=[..."0123456789ABCDEF"],v=t=>y[15&t],x=t=>y[(240&t)>>4]+y[15&t],_=t=>(240&t)>>4==(15&t),w=t=>_(t.r)&&_(t.g)&&_(t.b)&&_(t.a),S=(t,e)=>t<255?e(t):"",O=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function M(t,e,i){let r=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-r*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function k(t,e,i){let r=(r,n=(r+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[r(5),r(3),r(1)]}function P(t,e,i){let r;let n=M(t,1,.5);for(e+i>1&&(r=1/(e+i),e*=r,i*=r),r=0;r<3;r++)n[r]*=1-e-i,n[r]+=e;return n}function E(t){let e,i,r;let n=t.r/255,o=t.g/255,a=t.b/255,s=Math.max(n,o,a),l=Math.min(n,o,a),h=(s+l)/2;return s!==l&&(r=s-l,i=h>.5?r/(2-s-l):r/(s+l),e=60*(e=n===s?(o-a)/r+(ot<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,j=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function F(t,e,i){if(t){let r=E(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*i,0===e?360:1)),r=A(M,r,void 0,void 0),t.r=r[0],t.g=r[1],t.b=r[2]}}function L(t,e){return t?Object.assign(e||{},t):t}function N(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=p(t[3]))):(e=L(t,{r:0,g:0,b:0,a:1})).a=p(e.a),e}class B{get valid(){return this._valid}get rgb(){var t=L(this._rgb);return t&&(t.a=g(t.a)),t}set rgb(t){this._rgb=N(t)}rgbString(){var t;return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${g(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0}hexString(){var t,e;return this._valid?(e=w(t=this._rgb)?v:x,t?"#"+e(t.r)+e(t.g)+e(t.b)+S(t.a,e):void 0):void 0}hslString(){return this._valid?function(t){if(!t)return;let e=E(t),i=e[0],r=m(e[1]),n=m(e[2]);return t.a<255?`hsla(${i}, ${r}%, ${n}%, ${g(t.a)})`:`hsl(${i}, ${r}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){let i;let r=this.rgb,n=t.rgb,o=e===i?.5:e,a=2*o-1,s=r.a-n.a,l=((a*s==-1?a:(a+s)/(1+a*s))+1)/2;i=1-l,r.r=255&l*r.r+i*n.r+.5,r.g=255&l*r.g+i*n.g+.5,r.b=255&l*r.b+i*n.b+.5,r.a=o*r.a+(1-o)*n.a,this.rgb=r}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){let r=j(g(t.r)),n=j(g(t.g)),o=j(g(t.b));return{r:p(I(r+i*(j(g(e.r))-r))),g:p(I(n+i*(j(g(e.g))-n))),b:p(I(o+i*(j(g(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new B(this.rgb)}alpha(t){return this._rgb.a=p(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=u(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return F(this._rgb,2,t),this}darken(t){return F(this._rgb,2,-t),this}saturate(t){return F(this._rgb,1,t),this}desaturate(t){return F(this._rgb,1,-t),this}rotate(t){var e,i;return(i=E(e=this._rgb))[0]=D(i[0]+t),i=A(M,i,void 0,void 0),e.r=i[0],e.g=i[1],e.b=i[2],this}constructor(e){let i;if(e instanceof B)return e;let r=typeof e;if("object"===r)i=N(e);else if("string"===r){var n,o;o=e.length,"#"===e[0]&&(4===o||5===o?n={r:255&17*b[e[1]],g:255&17*b[e[2]],b:255&17*b[e[3]],a:5===o?17*b[e[4]]:255}:(7===o||9===o)&&(n={r:b[e[1]]<<4|b[e[2]],g:b[e[3]]<<4|b[e[4]],b:b[e[5]]<<4|b[e[6]],a:9===o?b[e[7]]<<4|b[e[8]]:255})),i=n||function(e){t||((t=function(){let t,e,i,r,n;let o={},a=Object.keys(R),s=Object.keys(T);for(t=0;t>16&255,i>>8&255,255&i]}return o}()).transparent=[0,0,0,0]);let i=t[e.toLowerCase()];return i&&{r:i[0],g:i[1],b:i[2],a:4===i.length?i[3]:255}}(e)||("r"===e.charAt(0)?function(t){let e,i,r;let n=C.exec(t),o=255;if(n){if(n[7]!==e){let t=+n[7];o=n[8]?f(t):d(255*t,0,255)}return e=+n[1],i=+n[3],r=+n[5],{r:e=255&(n[2]?f(e):d(e,0,255)),g:i=255&(n[4]?f(i):d(i,0,255)),b:r=255&(n[6]?f(r):d(r,0,255)),a:o}}}(e):function(t){let e;let i=O.exec(t),r=255;if(!i)return;i[5]!==e&&(r=i[6]?f(+i[5]):p(+i[5]));let n=D(+i[2]),o=+i[3]/100,a=+i[4]/100;return{r:(e="hwb"===i[1]?A(P,n,o,a):"hsv"===i[1]?A(k,n,o,a):A(M,n,o,a))[0],g:e[1],b:e[2],a:r}}(e))}this._rgb=i,this._valid=!!i}}/** + */function u(t){return t+.5|0}let d=(t,e,i)=>Math.max(Math.min(t,i),e);function f(t){return d(u(2.55*t),0,255)}function p(t){return d(u(255*t),0,255)}function g(t){return d(u(t/2.55)/100,0,1)}function m(t){return d(u(100*t),0,100)}let b={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},y=[..."0123456789ABCDEF"],v=t=>y[15&t],x=t=>y[(240&t)>>4]+y[15&t],_=t=>(240&t)>>4==(15&t),w=t=>_(t.r)&&_(t.g)&&_(t.b)&&_(t.a),S=(t,e)=>t<255?e(t):"",O=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function M(t,e,i){let r=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-r*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function k(t,e,i){let r=(r,n=(r+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[r(5),r(3),r(1)]}function P(t,e,i){let r;let n=M(t,1,.5);for(e+i>1&&(r=1/(e+i),e*=r,i*=r),r=0;r<3;r++)n[r]*=1-e-i,n[r]+=e;return n}function E(t){let e,i,r;let n=t.r/255,o=t.g/255,a=t.b/255,s=Math.max(n,o,a),l=Math.min(n,o,a),h=(s+l)/2;return s!==l&&(r=s-l,i=h>.5?r/(2-s-l):r/(s+l),e=60*(e=n===s?(o-a)/r+(ot<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,j=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function F(t,e,i){if(t){let r=E(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*i,0===e?360:1)),r=A(M,r,void 0,void 0),t.r=r[0],t.g=r[1],t.b=r[2]}}function L(t,e){return t?Object.assign(e||{},t):t}function N(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=p(t[3]))):(e=L(t,{r:0,g:0,b:0,a:1})).a=p(e.a),e}class B{get valid(){return this._valid}get rgb(){var t=L(this._rgb);return t&&(t.a=g(t.a)),t}set rgb(t){this._rgb=N(t)}rgbString(){var t;return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${g(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0}hexString(){var t,e;return this._valid?(e=w(t=this._rgb)?v:x,t?"#"+e(t.r)+e(t.g)+e(t.b)+S(t.a,e):void 0):void 0}hslString(){return this._valid?function(t){if(!t)return;let e=E(t),i=e[0],r=m(e[1]),n=m(e[2]);return t.a<255?`hsla(${i}, ${r}%, ${n}%, ${g(t.a)})`:`hsl(${i}, ${r}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){let i;let r=this.rgb,n=t.rgb,o=e===i?.5:e,a=2*o-1,s=r.a-n.a,l=((a*s==-1?a:(a+s)/(1+a*s))+1)/2;i=1-l,r.r=255&l*r.r+i*n.r+.5,r.g=255&l*r.g+i*n.g+.5,r.b=255&l*r.b+i*n.b+.5,r.a=o*r.a+(1-o)*n.a,this.rgb=r}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){let r=j(g(t.r)),n=j(g(t.g)),o=j(g(t.b));return{r:p(C(r+i*(j(g(e.r))-r))),g:p(C(n+i*(j(g(e.g))-n))),b:p(C(o+i*(j(g(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new B(this.rgb)}alpha(t){return this._rgb.a=p(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=u(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return F(this._rgb,2,t),this}darken(t){return F(this._rgb,2,-t),this}saturate(t){return F(this._rgb,1,t),this}desaturate(t){return F(this._rgb,1,-t),this}rotate(t){var e,i;return(i=E(e=this._rgb))[0]=T(i[0]+t),i=A(M,i,void 0,void 0),e.r=i[0],e.g=i[1],e.b=i[2],this}constructor(e){let i;if(e instanceof B)return e;let r=typeof e;if("object"===r)i=N(e);else if("string"===r){var n,o;o=e.length,"#"===e[0]&&(4===o||5===o?n={r:255&17*b[e[1]],g:255&17*b[e[2]],b:255&17*b[e[3]],a:5===o?17*b[e[4]]:255}:(7===o||9===o)&&(n={r:b[e[1]]<<4|b[e[2]],g:b[e[3]]<<4|b[e[4]],b:b[e[5]]<<4|b[e[6]],a:9===o?b[e[7]]<<4|b[e[8]]:255})),i=n||function(e){t||((t=function(){let t,e,i,r,n;let o={},a=Object.keys(R),s=Object.keys(D);for(t=0;t>16&255,i>>8&255,255&i]}return o}()).transparent=[0,0,0,0]);let i=t[e.toLowerCase()];return i&&{r:i[0],g:i[1],b:i[2],a:4===i.length?i[3]:255}}(e)||("r"===e.charAt(0)?function(t){let e,i,r;let n=I.exec(t),o=255;if(n){if(n[7]!==e){let t=+n[7];o=n[8]?f(t):d(255*t,0,255)}return e=+n[1],i=+n[3],r=+n[5],{r:e=255&(n[2]?f(e):d(e,0,255)),g:i=255&(n[4]?f(i):d(i,0,255)),b:r=255&(n[6]?f(r):d(r,0,255)),a:o}}}(e):function(t){let e;let i=O.exec(t),r=255;if(!i)return;i[5]!==e&&(r=i[6]?f(+i[5]):p(+i[5]));let n=T(+i[2]),o=+i[3]/100,a=+i[4]/100;return{r:(e="hwb"===i[1]?A(P,n,o,a):"hsv"===i[1]?A(k,n,o,a):A(M,n,o,a))[0],g:e[1],b:e[2],a:r}}(e))}this._rgb=i,this._valid=!!i}}/** * @namespace Chart.helpers *//** * An empty function that can be used, for example, for optional callback. @@ -404,9 +404,9 @@ function tP(t,e){let i=e.x-t.x,r=e.y-t.y,n=Math.atan2(r,i);return n<-.5*tu&&(n+= */function tA(t,e){return(t-e+tf)%td-tu}/** * Normalize angle to be between 0 and 2*PI * @private - */function tD(t){return(t%td+td)%td}/** + */function tT(t){return(t%td+td)%td}/** * @private - */function tT(t,e,i,r){let n=tD(t),o=tD(e),a=tD(i),s=tD(o-n),l=tD(a-n),h=tD(n-o),c=tD(n-a);return n===o||n===a||r&&o===a||s>l&&hl&&h=Math.min(e,i)-r&&t<=Math.max(e,i)+r}function tI(t,e,i){let r;i=i||(i=>t[i]1;)i(r=o+n>>1)?o=r:n=r;return{lo:o,hi:n}}/** + */function tI(t,e,i,r=1e-6){return t>=Math.min(e,i)-r&&t<=Math.max(e,i)+r}function tC(t,e,i){let r;i=i||(i=>t[i]1;)i(r=o+n>>1)?o=r:n=r;return{lo:o,hi:n}}/** * Binary search * @param table - the table search. must be sorted! * @param key - property name for the value in each entry * @param value - value to find * @param last - lookup last index * @private - */let tj=(t,e,i,r)=>tI(t,i,r?r=>{let n=t[r][e];return nt[r][e]tI(t,i,r=>t[r][e]>=i),tL=["push","pop","shift","splice","unshift"];function tN(t,e){let i=t._chartjs;if(!i)return;let r=i.listeners,n=r.indexOf(e);-1!==n&&r.splice(n,1),r.length>0||(tL.forEach(e=>{delete t[e]}),delete t._chartjs)}/** + */let tj=(t,e,i,r)=>tC(t,i,r?r=>{let n=t[r][e];return nt[r][e]tC(t,i,r=>t[r][e]>=i),tL=["push","pop","shift","splice","unshift"];function tN(t,e){let i=t._chartjs;if(!i)return;let r=i.listeners,n=r.indexOf(e);-1!==n&&r.splice(n,1),r.length>0||(tL.forEach(e=>{delete t[e]}),delete t._chartjs)}/** * @param items */function tB(t){let e=new Set(t);return e.size===t.length?t:Array.from(e)}/** * Request animation polyfill @@ -556,16 +556,16 @@ t.lineTo(i+a.topLeft,r)}let ef=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ep=/^(norm * A trap for the delete operator. */deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),/** * A trap for getting property values. - */get:(i,r)=>eE(i,r,()=>(function(t,e,i,r){let n;for(let o of e)if(void 0!==(n=eR(ek(o,t),i)))return eP(t,n)?eD(i,r,t,n):n})(r,e,t,i)),/** + */get:(i,r)=>eE(i,r,()=>(function(t,e,i,r){let n;for(let o of e)if(void 0!==(n=eR(ek(o,t),i)))return eP(t,n)?eT(i,r,t,n):n})(r,e,t,i)),/** * A trap for Object.getOwnPropertyDescriptor. * Also used by Object.hasOwnProperty. */getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),/** * A trap for Object.getPrototypeOf. */getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),/** * A trap for the in operator. - */has:(t,e)=>eC(t).includes(e),/** + */has:(t,e)=>eI(t).includes(e),/** * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols. - */ownKeys:t=>eC(t),/** + */ownKeys:t=>eI(t),/** * A trap for setting property values. */set(t,e,i){let r=t._storage||(t._storage=n());return t[e]=r[e]=i,delete t._keys,!0}})}/** * Returns an Proxy for resolving option values with context. @@ -578,8 +578,8 @@ t.lineTo(i+a.topLeft,r)}let ef=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ep=/^(norm * A trap for the delete operator. */deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),/** * A trap for getting property values. - */get:(t,e,i)=>eE(t,e,()=>(function(t,e,i){let{_proxy:r,_context:n,_subProxy:o,_descriptors:a}=t,s=r[e];return th(s)&&a.isScriptable(e)&&(s=function(t,e,i,r){let{_proxy:n,_context:o,_subProxy:a,_stack:s}=i;if(s.has(t))throw Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t);let l=e(o,a||r);return s.delete(t),eP(t,l)&&(l=eD(n._scopes,n,t,l)),l}(e,s,t,i)),H(s)&&s.length&&(s=function(t,e,i,r){let{_proxy:n,_context:o,_subProxy:a,_descriptors:s}=i;if(void 0!==o.index&&r(t))return e[o.index%e.length];if(U(e[0])){// Array of objects, return array or resolvers - let i=e,r=n._scopes.filter(t=>t!==i);for(let l of(e=[],i)){let i=eD(r,n,t,l);e.push(eO(i,o,a&&a[t],s))}}return e}(e,s,t,a.isIndexable)),eP(e,s)&&(s=eO(s,n,o&&o[e],a)),s})(t,e,i)),/** + */get:(t,e,i)=>eE(t,e,()=>(function(t,e,i){let{_proxy:r,_context:n,_subProxy:o,_descriptors:a}=t,s=r[e];return th(s)&&a.isScriptable(e)&&(s=function(t,e,i,r){let{_proxy:n,_context:o,_subProxy:a,_stack:s}=i;if(s.has(t))throw Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t);let l=e(o,a||r);return s.delete(t),eP(t,l)&&(l=eT(n._scopes,n,t,l)),l}(e,s,t,i)),H(s)&&s.length&&(s=function(t,e,i,r){let{_proxy:n,_context:o,_subProxy:a,_descriptors:s}=i;if(void 0!==o.index&&r(t))return e[o.index%e.length];if(U(e[0])){// Array of objects, return array or resolvers + let i=e,r=n._scopes.filter(t=>t!==i);for(let l of(e=[],i)){let i=eT(r,n,t,l);e.push(eO(i,o,a&&a[t],s))}}return e}(e,s,t,a.isIndexable)),eP(e,s)&&(s=eO(s,n,o&&o[e],a)),s})(t,e,i)),/** * A trap for Object.getOwnPropertyDescriptor. * Also used by Object.hasOwnProperty. */getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),/** @@ -593,9 +593,9 @@ t.lineTo(i+a.topLeft,r)}let ef=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ep=/^(norm */set:(e,i,r)=>(t[i]=r,delete e[i],!0)})}/** * @private */function eM(t,e={scriptable:!0,indexable:!0}){let{_scriptable:i=e.scriptable,_indexable:r=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:r,isScriptable:th(i)?i:()=>i,isIndexable:th(r)?r:()=>r}}let ek=(t,e)=>t?t+ts(e):e,eP=(t,e)=>U(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function eE(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];let r=i();return(// cache the resolved value -t[e]=r,r)}let eA=(t,e)=>!0===t?e:"string"==typeof t?ta(e,t):void 0;function eD(t,e,i,r){var n;let o=e._rootScopes,a=th(n=e._fallback)?n(i,r):n,s=[...t,...o],l=new Set;l.add(r);let h=eT(l,s,i,a||i,r);return null!==h&&(void 0===a||a===i||null!==(h=eT(l,s,a,h,r)))&&eS(Array.from(l),[""],o,a,()=>(function(t,e,i){let r=t._getTarget();e in r||(r[e]={});let n=r[e];return H(n)&&U(i)?i:n||{}})(e,i,r))}function eT(t,e,i,r,n){for(;i;)i=function(t,e,i,r,n){for(let a of e){let e=eA(i,a);if(e){var o;t.add(e);let a=th(o=e._fallback)?o(i,n):o;if(void 0!==a&&a!==i&&a!==r)// The fallback will resume to that new scope. +t[e]=r,r)}let eA=(t,e)=>!0===t?e:"string"==typeof t?ta(e,t):void 0;function eT(t,e,i,r){var n;let o=e._rootScopes,a=th(n=e._fallback)?n(i,r):n,s=[...t,...o],l=new Set;l.add(r);let h=eD(l,s,i,a||i,r);return null!==h&&(void 0===a||a===i||null!==(h=eD(l,s,a,h,r)))&&eS(Array.from(l),[""],o,a,()=>(function(t,e,i){let r=t._getTarget();e in r||(r[e]={});let n=r[e];return H(n)&&U(i)?i:n||{}})(e,i,r))}function eD(t,e,i,r,n){for(;i;)i=function(t,e,i,r,n){for(let a of e){let e=eA(i,a);if(e){var o;t.add(e);let a=th(o=e._fallback)?o(i,n):o;if(void 0!==a&&a!==i&&a!==r)// The fallback will resume to that new scope. return a}else if(!1===e&&void 0!==r&&i!==r)// For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations` -return null}return!1}(t,e,i,r,n);return i}function eR(t,e){for(let i of e){if(!i)continue;let e=i[t];if(void 0!==e)return e}}function eC(t){let e=t._keys;return e||(e=t._keys=function(t){let e=new Set;for(let i of t)for(let t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function eI(t,e,i,r){let n,o,a;let{iScale:s}=t,{key:l="r"}=this._parsing,h=Array(r);for(n=0;ne"x"===t?"y":"x";function eN(t,e,i){return Math.max(Math.min(t,i),e)}/** +return null}return!1}(t,e,i,r,n);return i}function eR(t,e){for(let i of e){if(!i)continue;let e=i[t];if(void 0!==e)return e}}function eI(t){let e=t._keys;return e||(e=t._keys=function(t){let e=new Set;for(let i of t)for(let t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function eC(t,e,i,r){let n,o,a;let{iScale:s}=t,{key:l="r"}=this._parsing,h=Array(r);for(n=0;ne"x"===t?"y":"x";function eN(t,e,i){return Math.max(Math.min(t,i),e)}/** * Note: typedefs are auto-exported, so use a made-up `dom` namespace where * necessary to avoid duplicates with `export * from './helpers`; see * https://github.com/microsoft/TypeScript/issues/46011 @@ -641,7 +641,7 @@ return null}return!1}(t,e,i,r,n);return i}function eR(t,e){for(let i of e){if(!i * @private */function eJ(t,e,i,r){return{x:t.x+i*(e.x-t.x),y:"middle"===r?i<.5?t.y:e.y:"after"===r?i<1?t.y:e.y:i>0?e.y:t.y}}/** * @private - */function eQ(t,e,i,r){let n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=eK(t,n,i),s=eK(n,o,i),l=eK(o,e,i),h=eK(a,s,i),c=eK(s,l,i);return eK(h,c,i)}function e0(t,e,i){var r;return t?(r=i,{x:t=>e+e+r-t,setWidth(t){r=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function e1(t,e){let i,r;("ltr"===e||"rtl"===e)&&(r=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=r)}function e2(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function e5(t){return"angle"===t?{between:tT,compare:tA,normalize:tD}:{between:tC,compare:(t,e)=>t-e,normalize:t=>t}}function e3({start:t,end:e,count:i,loop:r,style:n}){return{start:t%i,end:e%i,loop:r&&(e-t+1)%i==0,style:n}}function e6(t,e,i){let r,n,o;if(!i)return[t];let{property:a,start:s,end:l}=i,h=e.length,{compare:c,between:u,normalize:d}=e5(a),{start:f,end:p,loop:g,style:m}=function(t,e,i){let r;let{property:n,start:o,end:a}=i,{between:s,normalize:l}=e5(n),h=e.length,{start:c,end:u,loop:d}=t;if(d){for(c+=h,u+=h,r=0;ru(s,o,r)&&0!==c(s,o),_=()=>0===c(l,r)||u(l,o,r),w=()=>y||x(),S=()=>!y||_();for(let t=f,i=f;t<=p;++t)(n=e[t%h]).skip||(r=d(n[a]))===o||(y=u(r,s,l),null===v&&w()&&(v=0===c(r,s)?t:i),null!==v&&S()&&(b.push(e3({start:v,end:t,loop:g,count:h,style:m})),v=null),i=t,o=r);return null!==v&&b.push(e3({start:v,end:p,loop:g,count:h,style:m})),b}function e8(t,e){let i=[],r=t.segments;for(let n=0;nr({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=tz.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{let n;if(!i.running||!i.items.length)return;let o=i.items,a=o.length-1,s=!1;for(;a>=0;--a)(n=o[a])._active?(n._total>i.duration&&(i.duration=n._total),n.tick(t),s=!0):(o[a]=o[o.length-1],o.pop());s&&(r.draw(),this._notify(r,i,t,"progress")),o.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!!e&&!!e.running&&!!e.items.length}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}};let it="transparent",ie={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){let r=tJ(t||it),n=r.valid&&tJ(e||it);return n&&n.valid?n.mix(r,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class ii{active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let r=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=e_([t.to,e,r,t.from]),this._from=e_([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e;let i=t-this._start,r=this._duration,n=this._prop,o=this._from,a=this._loop,s=this._to;if(this._active=o!==s&&(a||i1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[n]=this._fn(o,s,e)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let t=0;t{let n=t[r];if(!U(n))return;let o={};for(let t of e)o[t]=n[t];(H(n.properties)&&n.properties||[r]).forEach(t=>{t!==r&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){let i=e.options,r=function(t,e){if(!e)return;let i=t.options;if(!i){t.options=e;return}return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}(t,i);if(!r)return[];let n=this._createAnimations(r,i);return i.$shared&&(function(t,e){let i=[],r=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),n}_createAnimations(t,e){let i;let r=this._properties,n=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),s=Date.now();for(i=a.length-1;i>=0;--i){let l=a[i];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}let h=e[l],c=o[l],u=r.get(l);if(c){if(u&&c.active()){c.update(u,h,s);continue}c.cancel()}if(!u||!u.duration){t[l]=h;continue}o[l]=c=new ii(u,t,l,h),n.push(c)}return n}update(t,e){if(0===this._properties.size){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return e7.add(this._chart,i),!0}constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}}function io(t,e){let i=t&&t.options||{},r=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:r?o:n,end:r?n:o}}function ia(t,e){let i,r;let n=[],o=t._getSortedDatasetMetas(e);for(i=0,r=o.length;i0||!i&&e<0)return n.index}return null}function ic(t,e){let i;let{chart:r,_cachedMeta:n}=t,o=r._stacks||(r._stacks={}),{iScale:a,vScale:s,index:l}=n,h=a.axis,c=s.axis,u=`${a.id}.${s.id}.${n.stack||n.type}`,d=e.length;for(let t=0;ti[t].axis===e).shift()}function id(t,e){let i=t.controller.index,r=t.vScale&&t.vScale.axis;if(r)for(let n of e=e||t._parsed){let t=n._stacks;if(!t||void 0===t[r]||void 0===t[r][i])return;delete t[r][i],void 0!==t[r]._visualValues&&void 0!==t[r]._visualValues[i]&&delete t[r]._visualValues[i]}}let ip=t=>"reset"===t||"none"===t,ig=(t,e)=>e?t:Object.assign({},t),im=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:ia(i,!0),values:null};class ib{initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=il(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&id(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(t,e,i,r)=>"x"===t?e:"r"===t?r:i,n=e.xAxisID=Y(i.xAxisID,iu(t,"x")),o=e.yAxisID=Y(i.yAxisID,iu(t,"y")),a=e.rAxisID=Y(i.rAxisID,iu(t,"r")),s=e.indexAxis,l=e.iAxisID=r(s,n,o,a),h=e.vAxisID=r(s,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&tN(this._data,this),t._stacked&&id(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(U(e))this._data=function(t){let e,i,r;let n=Object.keys(t),o=Array(n.length);for(e=0,i=n.length;e{let i="_onData"+ts(e),r=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){let n=r.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),n}})})}(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),r=!1;this._dataCheck();let n=e._stacked;e._stacked=il(e.vScale,e),e.stack!==i.stack&&(r=!0,id(e),e.stack=i.stack),this._resyncElements(t),(r||n!==e._stacked)&&ic(this,e._parsed)}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let i,r,n;let{_cachedMeta:o,_data:a}=this,{iScale:s,_stacked:l}=o,h=s.axis,c=0===t&&e===a.length||o._sorted,u=t>0&&o._parsed[t-1];if(!1===this._parsing)o._parsed=a,o._sorted=!0,n=a;else{n=H(a[t])?this.parseArrayData(o,a,t,e):U(a[t])?this.parseObjectData(o,a,t,e):this.parsePrimitiveData(o,a,t,e);let s=()=>null===r[h]||u&&r[h]e||d=0;--i)if(!f()){this.updateRangeFromParsed(c,t,r,h);break}}return c}getAllParsedValues(t){let e,i,r;let n=this._cachedMeta._parsed,o=[];for(e=0,i=n.length;e=0&&tthis.getContext(i,r,e),c);return f.$shared&&(f.$shared=s,n[o]=Object.freeze(ig(f,s))),f}_resolveAnimations(t,e,i){let r;let n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,s=o[a];if(s)return s;if(!1!==n.options.animation){let n=this.chart.config,o=n.datasetAnimationScopeKeys(this._type,e),a=n.getOptionScopes(this.getDataset(),o);r=n.createResolver(a,this.getContext(t,i,e))}let l=new ir(n,r&&r.animations);return r&&r._cacheable&&(o[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ip(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==r;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,r){ip(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!ip(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;let n=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];let r=i.length,n=e.length,o=Math.min(n,r);o&&this.parse(0,o),n>r?this._insertElements(r,n-r,t):n{for(t.length+=e,r=t.length-1;r>=a;r--)t[r]=t[r-e]};for(s(o),r=t;rMath.abs(s)&&(l=s,h=a),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:o,min:a,max:s}}(t,e,i,r):e[i.axis]=i.parse(t,r),e}function iv(t,e,i,r){let n,o,a,s;let l=t.iScale,h=t.vScale,c=l.getLabels(),u=l===h,d=[];for(n=i,o=i+r;nt.x,o="left",a="right"):(n=t.baset.controller.options.grouped),n=i.options.stacked,o=[],a=t=>{let i=t.controller.getParsed(e),r=i&&i[t.vScale.axis];if(W(r)||isNaN(r))return!0};for(let i of r)if(!(void 0!==e&&a(i))&&((!1===n||-1===o.indexOf(i.stack)||void 0===n&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){let r=this._getStacks(t,i),n=void 0!==e?r.indexOf(e):-1;return -1===n?r.length-1:n}_getRuler(){let t,e;let i=this.options,r=this._cachedMeta,n=r.iScale,o=[];for(t=0,e=r.data.length;tt-e))}return t._cache.$bar}(o,t.type),s=o._length,l=()=>{32767!==r&&-32768!==r&&(tl(n)&&(s=Math.min(s,Math.abs(r-n)||s)),n=r)};for(e=0,i=a.length;e=l?1:-1))*s,d===l&&(m-=i/2);let t=r.getPixelForDecimal(0),a=r.getPixelForDecimal(1);e=(m=Math.max(Math.min(m,Math.max(t,a)),Math.min(t,a)))+i,n&&!u&&(h._stacks[r.axis]._visualValues[o]=r.getValueForPixel(e)-r.getValueForPixel(m))}if(m===r.getPixelForValue(l)){let t=tx(i)*r.getLineWidthForValue(l)/2;m+=t,i-=t}return{size:i,base:m,head:e,center:e+i/2}}_calculateBarIndexPixels(t,e){let i,r;let n=e.scale,o=this.options,a=o.skipNull,s=Y(o.maxBarThickness,1/0);if(e.grouped){let n=a?this._getStackCount(t):e.stackCount,l="flex"===o.barThickness?function(t,e,i,r){let n=e.pixels,o=n[t],a=t>0?n[t-1]:null,s=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:n}=e,o=this.getParsed(t),a=r.getLabelForValue(o.x),s=n.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+a+", "+s+(l?", "+l:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){let n="reset"===r,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:s,includeOptions:l}=this._getSharedOptions(e,r),h=o.axis,c=a.axis;for(let u=e;u+i[t];if(U(i[t])){let{key:t="value"}=this._parsing;a=e=>+ta(i[e],t)}for(n=t,o=t+e;ntT(e,t,s,!0)?1:Math.max(r,r*i,n,n*i),f=(e,r,n)=>tT(e,t,s,!0)?-1:Math.min(r,r*i,n,n*i),p=d(0,l,c),g=d(tm,h,u),m=f(tu,l,c),b=f(tu+tm,h,u);r=(p-m)/2,n=(g-b)/2,o=-(p+m)/2,a=-(g+b)/2}return{ratioX:r,ratioY:n,offsetX:o,offsetY:a}}(c,h,s),g=(i.width-o)/u,m=(i.height-o)/d,b=G(this.options.radius,Math.max(Math.min(g,m)/2,0)),y=Math.max(b*s,0),v=(b-y)/this._getVisibleDatasetWeightTotal();this.offsetX=f*b,this.offsetY=p*b,r.total=this.calculateTotal(),this.outerRadius=b-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){let i=this.options,r=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===r._parsed[t]||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*n/td)}updateElements(t,e,i,r){let n;let o="reset"===r,a=this.chart,s=a.chartArea,l=a.options,h=l.animation,c=(s.left+s.right)/2,u=(s.top+s.bottom)/2,d=o&&h.animateScale,f=d?0:this.innerRadius,p=d?0:this.outerRadius,{sharedOptions:g,includeOptions:m}=this._getSharedOptions(e,r),b=this._getRotation();for(n=0;n0&&!isNaN(t)?td*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,r=i.data.labels||[],n=t5(e._parsed[t],i.options.locale);return{label:r[t]||"",value:n}}getMaxBorderWidth(t){let e,i,r,n,o,a=0,s=this.chart;if(!t){for(e=0,i=s.data.datasets.length;e"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),c(iM,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((e,n)=>{let o=t.getDatasetMeta(0),a=o.controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ik extends ib{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:r=[],_dataset:n}=e,o=this.chart._animationsDisabled,{start:a,count:s}=t$(e,r,o);this._drawStart=a,this._drawCount=s,tq(e)&&(a=0,s=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=r;let l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(r,a,s,t)}updateElements(t,e,i,r){let n="reset"===r,{iScale:o,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:c}=this._getSharedOptions(e,r),u=o.axis,d=a.axis,{spanGaps:f,segment:p}=this.options,g=tS(f)?f:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||n||"none"===r,b=e+i,y=t.length,v=e>0&&this.getParsed(e-1);for(let i=0;i=b){y.skip=!0;continue}let x=this.getParsed(i),_=W(x[d]),w=y[u]=o.getPixelForValue(x[u],i),S=y[d]=n||_?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,x,s):x[d],i);y.skip=isNaN(w)||isNaN(S)||_,y.stop=i>0&&Math.abs(x[u]-v[u])>g,p&&(y.parsed=x,y.raw=l.data[i]),c&&(y.options=h||this.resolveDataElementOptions(i,f.active?"active":r)),m||this.updateElement(f,i,y,r),v=x}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;let n=r[0].size(this.resolveDataElementOptions(0)),o=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,n,o)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}c(ik,"id","line"),c(ik,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),c(ik,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class iP extends ib{getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,r=i.data.labels||[],n=t5(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:n}}parseObjectData(t,e,i,r){return eI.bind(this)(t,e,i,r)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{let r=this.getParsed(i).r;!isNaN(r)&&this.chart.getDataVisibility(i)&&(re.max&&(e.max=r))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(r/2,0),o=Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0),a=(n-o)/t.getVisibleDatasetCount();this.outerRadius=n-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,r){let n;let o="reset"===r,a=this.chart,s=a.options,l=s.animation,h=this._cachedMeta.rScale,c=h.xCenter,u=h.yCenter,d=h.getIndexAngle(0)-.5*tu,f=d,p=360/this.countVisibleElements();for(n=0;n{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?tM(this.resolveDataElementOptions(t,e).angle||i):0}constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}}c(iP,"id","polarArea"),c(iP,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),c(iP,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((e,n)=>{let o=t.getDatasetMeta(0),a=o.controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class iE extends iM{}c(iE,"id","pie"),c(iE,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class iA extends ib{getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return eI.bind(this)(t,e,i,r)}update(t){let e=this._cachedMeta,i=e.dataset,r=e.data||[],n=e.iScale.getLabels();if(i.points=r,"resize"!==t){let e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);let o={_loop:!0,_fullLoop:n.length===r.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){let n=this._cachedMeta.rScale,o="reset"===r;for(let a=e;a0&&this.getParsed(e-1);for(let h=e;h0&&Math.abs(i[d]-y[d])>m,g&&(p.parsed=i,p.raw=l.data[h]),u&&(p.options=c||this.resolveDataElementOptions(h,e.active?"active":r)),b||this.updateElement(e,h,p,r),y=i}this.updateSharedOptions(c,r,h)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}let i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;let n=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,n,o)/2}}c(iD,"id","scatter"),c(iD,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),c(iD,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var iT=/*#__PURE__*/Object.freeze({__proto__:null,BarController:iS,BubbleController:iO,DoughnutController:iM,LineController:ik,PieController:iE,PolarAreaController:iP,RadarController:iA,ScatterController:iD});/** + */function eQ(t,e,i,r){let n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=eK(t,n,i),s=eK(n,o,i),l=eK(o,e,i),h=eK(a,s,i),c=eK(s,l,i);return eK(h,c,i)}function e0(t,e,i){var r;return t?(r=i,{x:t=>e+e+r-t,setWidth(t){r=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function e1(t,e){let i,r;("ltr"===e||"rtl"===e)&&(r=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=r)}function e2(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function e5(t){return"angle"===t?{between:tD,compare:tA,normalize:tT}:{between:tI,compare:(t,e)=>t-e,normalize:t=>t}}function e3({start:t,end:e,count:i,loop:r,style:n}){return{start:t%i,end:e%i,loop:r&&(e-t+1)%i==0,style:n}}function e6(t,e,i){let r,n,o;if(!i)return[t];let{property:a,start:s,end:l}=i,h=e.length,{compare:c,between:u,normalize:d}=e5(a),{start:f,end:p,loop:g,style:m}=function(t,e,i){let r;let{property:n,start:o,end:a}=i,{between:s,normalize:l}=e5(n),h=e.length,{start:c,end:u,loop:d}=t;if(d){for(c+=h,u+=h,r=0;ru(s,o,r)&&0!==c(s,o),_=()=>0===c(l,r)||u(l,o,r),w=()=>y||x(),S=()=>!y||_();for(let t=f,i=f;t<=p;++t)(n=e[t%h]).skip||(r=d(n[a]))===o||(y=u(r,s,l),null===v&&w()&&(v=0===c(r,s)?t:i),null!==v&&S()&&(b.push(e3({start:v,end:t,loop:g,count:h,style:m})),v=null),i=t,o=r);return null!==v&&b.push(e3({start:v,end:p,loop:g,count:h,style:m})),b}function e8(t,e){let i=[],r=t.segments;for(let n=0;nr({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=tz.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{let n;if(!i.running||!i.items.length)return;let o=i.items,a=o.length-1,s=!1;for(;a>=0;--a)(n=o[a])._active?(n._total>i.duration&&(i.duration=n._total),n.tick(t),s=!0):(o[a]=o[o.length-1],o.pop());s&&(r.draw(),this._notify(r,i,t,"progress")),o.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!!e&&!!e.running&&!!e.items.length}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}};let it="transparent",ie={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){let r=tJ(t||it),n=r.valid&&tJ(e||it);return n&&n.valid?n.mix(r,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class ii{active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let r=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=e_([t.to,e,r,t.from]),this._from=e_([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e;let i=t-this._start,r=this._duration,n=this._prop,o=this._from,a=this._loop,s=this._to;if(this._active=o!==s&&(a||i1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[n]=this._fn(o,s,e)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let t=0;t{let n=t[r];if(!U(n))return;let o={};for(let t of e)o[t]=n[t];(H(n.properties)&&n.properties||[r]).forEach(t=>{t!==r&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){let i=e.options,r=function(t,e){if(!e)return;let i=t.options;if(!i){t.options=e;return}return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}(t,i);if(!r)return[];let n=this._createAnimations(r,i);return i.$shared&&(function(t,e){let i=[],r=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),n}_createAnimations(t,e){let i;let r=this._properties,n=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),s=Date.now();for(i=a.length-1;i>=0;--i){let l=a[i];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}let h=e[l],c=o[l],u=r.get(l);if(c){if(u&&c.active()){c.update(u,h,s);continue}c.cancel()}if(!u||!u.duration){t[l]=h;continue}o[l]=c=new ii(u,t,l,h),n.push(c)}return n}update(t,e){if(0===this._properties.size){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return e7.add(this._chart,i),!0}constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}}function io(t,e){let i=t&&t.options||{},r=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:r?o:n,end:r?n:o}}function ia(t,e){let i,r;let n=[],o=t._getSortedDatasetMetas(e);for(i=0,r=o.length;i0||!i&&e<0)return n.index}return null}function ic(t,e){let i;let{chart:r,_cachedMeta:n}=t,o=r._stacks||(r._stacks={}),{iScale:a,vScale:s,index:l}=n,h=a.axis,c=s.axis,u=`${a.id}.${s.id}.${n.stack||n.type}`,d=e.length;for(let t=0;ti[t].axis===e).shift()}function id(t,e){let i=t.controller.index,r=t.vScale&&t.vScale.axis;if(r)for(let n of e=e||t._parsed){let t=n._stacks;if(!t||void 0===t[r]||void 0===t[r][i])return;delete t[r][i],void 0!==t[r]._visualValues&&void 0!==t[r]._visualValues[i]&&delete t[r]._visualValues[i]}}let ip=t=>"reset"===t||"none"===t,ig=(t,e)=>e?t:Object.assign({},t),im=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:ia(i,!0),values:null};class ib{initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=il(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&id(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(t,e,i,r)=>"x"===t?e:"r"===t?r:i,n=e.xAxisID=Y(i.xAxisID,iu(t,"x")),o=e.yAxisID=Y(i.yAxisID,iu(t,"y")),a=e.rAxisID=Y(i.rAxisID,iu(t,"r")),s=e.indexAxis,l=e.iAxisID=r(s,n,o,a),h=e.vAxisID=r(s,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&tN(this._data,this),t._stacked&&id(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(U(e))this._data=function(t){let e,i,r;let n=Object.keys(t),o=Array(n.length);for(e=0,i=n.length;e{let i="_onData"+ts(e),r=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){let n=r.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),n}})})}(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),r=!1;this._dataCheck();let n=e._stacked;e._stacked=il(e.vScale,e),e.stack!==i.stack&&(r=!0,id(e),e.stack=i.stack),this._resyncElements(t),(r||n!==e._stacked)&&ic(this,e._parsed)}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let i,r,n;let{_cachedMeta:o,_data:a}=this,{iScale:s,_stacked:l}=o,h=s.axis,c=0===t&&e===a.length||o._sorted,u=t>0&&o._parsed[t-1];if(!1===this._parsing)o._parsed=a,o._sorted=!0,n=a;else{n=H(a[t])?this.parseArrayData(o,a,t,e):U(a[t])?this.parseObjectData(o,a,t,e):this.parsePrimitiveData(o,a,t,e);let s=()=>null===r[h]||u&&r[h]e||d=0;--i)if(!f()){this.updateRangeFromParsed(c,t,r,h);break}}return c}getAllParsedValues(t){let e,i,r;let n=this._cachedMeta._parsed,o=[];for(e=0,i=n.length;e=0&&tthis.getContext(i,r,e),c);return f.$shared&&(f.$shared=s,n[o]=Object.freeze(ig(f,s))),f}_resolveAnimations(t,e,i){let r;let n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,s=o[a];if(s)return s;if(!1!==n.options.animation){let n=this.chart.config,o=n.datasetAnimationScopeKeys(this._type,e),a=n.getOptionScopes(this.getDataset(),o);r=n.createResolver(a,this.getContext(t,i,e))}let l=new ir(n,r&&r.animations);return r&&r._cacheable&&(o[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ip(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==r;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,r){ip(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!ip(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;let n=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];let r=i.length,n=e.length,o=Math.min(n,r);o&&this.parse(0,o),n>r?this._insertElements(r,n-r,t):n{for(t.length+=e,r=t.length-1;r>=a;r--)t[r]=t[r-e]};for(s(o),r=t;rMath.abs(s)&&(l=s,h=a),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:o,min:a,max:s}}(t,e,i,r):e[i.axis]=i.parse(t,r),e}function iv(t,e,i,r){let n,o,a,s;let l=t.iScale,h=t.vScale,c=l.getLabels(),u=l===h,d=[];for(n=i,o=i+r;nt.x,o="left",a="right"):(n=t.baset.controller.options.grouped),n=i.options.stacked,o=[],a=t=>{let i=t.controller.getParsed(e),r=i&&i[t.vScale.axis];if(W(r)||isNaN(r))return!0};for(let i of r)if(!(void 0!==e&&a(i))&&((!1===n||-1===o.indexOf(i.stack)||void 0===n&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){let r=this._getStacks(t,i),n=void 0!==e?r.indexOf(e):-1;return -1===n?r.length-1:n}_getRuler(){let t,e;let i=this.options,r=this._cachedMeta,n=r.iScale,o=[];for(t=0,e=r.data.length;tt-e))}return t._cache.$bar}(o,t.type),s=o._length,l=()=>{32767!==r&&-32768!==r&&(tl(n)&&(s=Math.min(s,Math.abs(r-n)||s)),n=r)};for(e=0,i=a.length;e=l?1:-1))*s,d===l&&(m-=i/2);let t=r.getPixelForDecimal(0),a=r.getPixelForDecimal(1);e=(m=Math.max(Math.min(m,Math.max(t,a)),Math.min(t,a)))+i,n&&!u&&(h._stacks[r.axis]._visualValues[o]=r.getValueForPixel(e)-r.getValueForPixel(m))}if(m===r.getPixelForValue(l)){let t=tx(i)*r.getLineWidthForValue(l)/2;m+=t,i-=t}return{size:i,base:m,head:e,center:e+i/2}}_calculateBarIndexPixels(t,e){let i,r;let n=e.scale,o=this.options,a=o.skipNull,s=Y(o.maxBarThickness,1/0);if(e.grouped){let n=a?this._getStackCount(t):e.stackCount,l="flex"===o.barThickness?function(t,e,i,r){let n=e.pixels,o=n[t],a=t>0?n[t-1]:null,s=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:n}=e,o=this.getParsed(t),a=r.getLabelForValue(o.x),s=n.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+a+", "+s+(l?", "+l:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){let n="reset"===r,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:s,includeOptions:l}=this._getSharedOptions(e,r),h=o.axis,c=a.axis;for(let u=e;u+i[t];if(U(i[t])){let{key:t="value"}=this._parsing;a=e=>+ta(i[e],t)}for(n=t,o=t+e;ntD(e,t,s,!0)?1:Math.max(r,r*i,n,n*i),f=(e,r,n)=>tD(e,t,s,!0)?-1:Math.min(r,r*i,n,n*i),p=d(0,l,c),g=d(tm,h,u),m=f(tu,l,c),b=f(tu+tm,h,u);r=(p-m)/2,n=(g-b)/2,o=-(p+m)/2,a=-(g+b)/2}return{ratioX:r,ratioY:n,offsetX:o,offsetY:a}}(c,h,s),g=(i.width-o)/u,m=(i.height-o)/d,b=G(this.options.radius,Math.max(Math.min(g,m)/2,0)),y=Math.max(b*s,0),v=(b-y)/this._getVisibleDatasetWeightTotal();this.offsetX=f*b,this.offsetY=p*b,r.total=this.calculateTotal(),this.outerRadius=b-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){let i=this.options,r=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===r._parsed[t]||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*n/td)}updateElements(t,e,i,r){let n;let o="reset"===r,a=this.chart,s=a.chartArea,l=a.options,h=l.animation,c=(s.left+s.right)/2,u=(s.top+s.bottom)/2,d=o&&h.animateScale,f=d?0:this.innerRadius,p=d?0:this.outerRadius,{sharedOptions:g,includeOptions:m}=this._getSharedOptions(e,r),b=this._getRotation();for(n=0;n0&&!isNaN(t)?td*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,r=i.data.labels||[],n=t5(e._parsed[t],i.options.locale);return{label:r[t]||"",value:n}}getMaxBorderWidth(t){let e,i,r,n,o,a=0,s=this.chart;if(!t){for(e=0,i=s.data.datasets.length;e"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),c(iM,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((e,n)=>{let o=t.getDatasetMeta(0),a=o.controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ik extends ib{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:r=[],_dataset:n}=e,o=this.chart._animationsDisabled,{start:a,count:s}=t$(e,r,o);this._drawStart=a,this._drawCount=s,tq(e)&&(a=0,s=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=r;let l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(r,a,s,t)}updateElements(t,e,i,r){let n="reset"===r,{iScale:o,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:c}=this._getSharedOptions(e,r),u=o.axis,d=a.axis,{spanGaps:f,segment:p}=this.options,g=tS(f)?f:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||n||"none"===r,b=e+i,y=t.length,v=e>0&&this.getParsed(e-1);for(let i=0;i=b){y.skip=!0;continue}let x=this.getParsed(i),_=W(x[d]),w=y[u]=o.getPixelForValue(x[u],i),S=y[d]=n||_?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,x,s):x[d],i);y.skip=isNaN(w)||isNaN(S)||_,y.stop=i>0&&Math.abs(x[u]-v[u])>g,p&&(y.parsed=x,y.raw=l.data[i]),c&&(y.options=h||this.resolveDataElementOptions(i,f.active?"active":r)),m||this.updateElement(f,i,y,r),v=x}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;let n=r[0].size(this.resolveDataElementOptions(0)),o=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,n,o)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}c(ik,"id","line"),c(ik,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),c(ik,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class iP extends ib{getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,r=i.data.labels||[],n=t5(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:n}}parseObjectData(t,e,i,r){return eC.bind(this)(t,e,i,r)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{let r=this.getParsed(i).r;!isNaN(r)&&this.chart.getDataVisibility(i)&&(re.max&&(e.max=r))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(r/2,0),o=Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0),a=(n-o)/t.getVisibleDatasetCount();this.outerRadius=n-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,r){let n;let o="reset"===r,a=this.chart,s=a.options,l=s.animation,h=this._cachedMeta.rScale,c=h.xCenter,u=h.yCenter,d=h.getIndexAngle(0)-.5*tu,f=d,p=360/this.countVisibleElements();for(n=0;n{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?tM(this.resolveDataElementOptions(t,e).angle||i):0}constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}}c(iP,"id","polarArea"),c(iP,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),c(iP,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((e,n)=>{let o=t.getDatasetMeta(0),a=o.controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class iE extends iM{}c(iE,"id","pie"),c(iE,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class iA extends ib{getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return eC.bind(this)(t,e,i,r)}update(t){let e=this._cachedMeta,i=e.dataset,r=e.data||[],n=e.iScale.getLabels();if(i.points=r,"resize"!==t){let e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);let o={_loop:!0,_fullLoop:n.length===r.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){let n=this._cachedMeta.rScale,o="reset"===r;for(let a=e;a0&&this.getParsed(e-1);for(let h=e;h0&&Math.abs(i[d]-y[d])>m,g&&(p.parsed=i,p.raw=l.data[h]),u&&(p.options=c||this.resolveDataElementOptions(h,e.active?"active":r)),b||this.updateElement(e,h,p,r),y=i}this.updateSharedOptions(c,r,h)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}let i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;let n=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,n,o)/2}}c(iT,"id","scatter"),c(iT,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),c(iT,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var iD=/*#__PURE__*/Object.freeze({__proto__:null,BarController:iS,BubbleController:iO,DoughnutController:iM,LineController:ik,PieController:iE,PolarAreaController:iP,RadarController:iA,ScatterController:iT});/** * @namespace Chart._adapters * @since 2.8.0 * @private @@ -650,7 +650,7 @@ return null}return!1}(t,e,i,r,n);return i}function eR(t,e){for(let i of e){if(!i * @namespace Chart._adapters._date * @memberof Chart._adapters * @private - */class iC{/** + */class iI{/** * Override default date adapter methods. * Accepts type parameter to define options type. * @example @@ -659,8 +659,8 @@ return null}return!1}(t,e,i,r,n);return i}function eR(t,e){for(let i of e){if(!i * console.log(this.options.myAdapterOption); * } * }) - */static override(t){Object.assign(iC.prototype,t)}// eslint-disable-next-line @typescript-eslint/no-empty-function -init(){}formats(){return iR()}parse(){return iR()}format(){return iR()}add(){return iR()}diff(){return iR()}startOf(){return iR()}endOf(){return iR()}constructor(t){c(this,"options",void 0),this.options=t||{}}}var iI={_date:iC};function ij(t,e,i,r,n){let o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t{t[a](e[i],n)&&(o.push({element:t,datasetIndex:r,index:l}),s=s||t.inRange(e.x,e.y,n))}),r&&!s)?[]:o}var iB={modes:{index(t,e,i,r){let n=eq(e,t),o=i.axis||"x",a=i.includeInvisible||!1,s=i.intersect?iF(t,n,o,r,a):iL(t,n,o,!1,r,a),l=[];return s.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{let e=s[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,r){let n=eq(e,t),o=i.axis||"xy",a=i.includeInvisible||!1,s=i.intersect?iF(t,n,o,r,a):iL(t,n,o,!1,r,a);if(s.length>0){let e=s[0].datasetIndex,i=t.getDatasetMeta(e).data;s=[];for(let t=0;tt.pos===e)}function iW(t,e){return t.filter(t=>-1===iz.indexOf(t.pos)&&t.box.axis===e)}function iH(t,e){return t.sort((t,i)=>{let r=e?i:t,n=e?t:i;return r.weight===n.weight?r.index-n.index:r.weight-n.weight})}function iU(t,e,i,r){return Math.max(t[i],e[i])+Math.max(t[r],e[r])}function i$(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function iq(t,e,i,r){let n,o,a,s,l,h;let c=[];for(n=0,o=t.length,l=0;n{r[t]=Math.max(e[t],i[t])}),r}(t?["left","right"]:["top","bottom"])}(a.horizontal,e));let{same:o,other:u}=function(t,e,i,r){let{pos:n,box:o}=i,a=t.maxPadding;if(!U(n)){i.size&&(t[n]-=i.size);let e=r[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&i$(a,o.getPadding());let s=Math.max(0,e.outerWidth-iU(a,t,"left","right")),l=Math.max(0,e.outerHeight-iU(a,t,"top","bottom")),h=s!==t.w,c=l!==t.h;return t.w=s,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}(e,i,a,r);l|=o&&c.length,h=h||u,s.fullSize||c.push(a)}return l&&iq(c,e,i,r)||h}function iY(t,e,i,r,n){t.top=i,t.left=e,t.right=e+r,t.bottom=i+n,t.width=r,t.height=n}function iX(t,e,i,r){let n=i.padding,{x:o,y:a}=e;for(let s of t){let t=s.box,l=r[s.stack]||{count:1,placed:0,weight:1},h=s.stackWeight/l.weight||1;if(s.horizontal){let r=e.w*h,o=l.size||t.height;tl(l.start)&&(a=l.start),t.fullSize?iY(t,n.left,a,i.outerWidth-n.right-n.left,o):iY(t,e.left+l.placed,a,r,o),l.start=a,l.placed+=r,a=t.bottom}else{let r=e.h*h,a=l.size||t.width;tl(l.start)&&(o=l.start),t.fullSize?iY(t,o,n.top,a,i.outerHeight-n.bottom-n.top):iY(t,o,e.top+l.placed,a,r),l.start=o,l.placed+=r,o=t.right}}e.x=o,e.y=a}var iG={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){let i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,r){if(!t)return;let n=ev(t.options.layout.padding),o=Math.max(e-n.width,0),a=Math.max(i-n.height,0),s=function(t){let e=function(t){let e,i,r,n,o,a;let s=[];for(e=0,i=(t||[]).length;et.box.fullSize),!0),r=iH(iV(e,"left"),!0),n=iH(iV(e,"right")),o=iH(iV(e,"top"),!0),a=iH(iV(e,"bottom")),s=iW(e,"x"),l=iW(e,"y");return{fullSize:i,leftAndTop:r.concat(o),rightAndBottom:n.concat(l).concat(a).concat(s),chartArea:iV(e,"chartArea"),vertical:r.concat(n).concat(l),horizontal:o.concat(a).concat(s)}}(t.boxes),l=s.vertical,h=s.horizontal;K(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});let c=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),d=Object.assign({},n);i$(d,ev(r));let f=Object.assign({maxPadding:d,w:o,h:a,x:n.left,y:n.top},n),p=function(t,e){let i,r,n;let o=function(t){let e={};for(let i of t){let{stack:t,pos:r,stackWeight:n}=i;if(!t||!iz.includes(r))continue;let o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:a,hBoxMaxHeight:s}=e;for(i=0,r=t.length;i{let i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class iZ{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class iK extends iZ{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}let iJ="$chartjs",iQ={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},i0=t=>null===t||""===t,i1=!!eG&&{passive:!0};function i2(t,e,i){t.canvas.removeEventListener(e,i,i1)}function i5(t,e){for(let i of t)if(i===e||i.contains(e))return!0}function i3(t,e,i){let r=t.canvas,n=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||i5(i.addedNodes,r))&&!i5(i.removedNodes,r);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function i6(t,e,i){let r=t.canvas,n=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||i5(i.removedNodes,r))&&!i5(i.addedNodes,r);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}let i8=new Map,i4=0;function i9(){let t=window.devicePixelRatio;t!==i4&&(i4=t,i8.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function i7(t,e,i){let r=t.canvas,n=r&&ez(r);if(!n)return;let o=tV((t,e)=>{let r=n.clientWidth;i(t,e),r{let e=t[0],i=e.contentRect.width,r=e.contentRect.height;(0!==i||0!==r)&&o(i,r)});return a.observe(n),i8.size||window.addEventListener("resize",i9),i8.set(t,o),a}function rt(t,e,i){i&&i.disconnect(),"resize"===e&&(i8.delete(t),i8.size||window.removeEventListener("resize",i9))}function re(t,e,i){let r=t.canvas,n=tV(e=>{null!==t.ctx&&i(function(t,e){let i=iQ[t.type]||t.type,{x:r,y:n}=eq(t,e);return{type:i,chart:e,native:t,x:void 0!==r?r:null,y:void 0!==n?n:null}}(e,t))},t);return!function(t,e,i){t.addEventListener(e,i,i1)}(r,e,n),n}class ri extends iZ{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(!function(t,e){let i=t.style,r=t.getAttribute("height"),n=t.getAttribute("width");if(t[iJ]={initial:{height:r,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",i0(n)){let e=eZ(t,"width");void 0!==e&&(t.width=e)}if(i0(r)){if(""===t.style.height)t.height=t.width/(e||2);else{let e=eZ(t,"height");void 0!==e&&(t.height=e)}}}(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[iJ])return!1;let i=e[iJ].initial;["height","width"].forEach(t=>{let r=i[t];W(r)?e.removeAttribute(t):e.setAttribute(t,r)});let r=i.style||{};return Object.keys(r).forEach(t=>{e.style[t]=r[t]}),e.width=e.width,delete e[iJ],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let r=t.$proxies||(t.$proxies={}),n={attach:i3,detach:i6,resize:i7}[e]||re;r[e]=n(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;let n={attach:rt,detach:rt,resize:rt}[e]||i2;n(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return(// eslint-disable-next-line complexity + */static override(t){Object.assign(iI.prototype,t)}// eslint-disable-next-line @typescript-eslint/no-empty-function +init(){}formats(){return iR()}parse(){return iR()}format(){return iR()}add(){return iR()}diff(){return iR()}startOf(){return iR()}endOf(){return iR()}constructor(t){c(this,"options",void 0),this.options=t||{}}}var iC={_date:iI};function ij(t,e,i,r,n){let o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t{t[a](e[i],n)&&(o.push({element:t,datasetIndex:r,index:l}),s=s||t.inRange(e.x,e.y,n))}),r&&!s)?[]:o}var iB={modes:{index(t,e,i,r){let n=eq(e,t),o=i.axis||"x",a=i.includeInvisible||!1,s=i.intersect?iF(t,n,o,r,a):iL(t,n,o,!1,r,a),l=[];return s.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{let e=s[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,r){let n=eq(e,t),o=i.axis||"xy",a=i.includeInvisible||!1,s=i.intersect?iF(t,n,o,r,a):iL(t,n,o,!1,r,a);if(s.length>0){let e=s[0].datasetIndex,i=t.getDatasetMeta(e).data;s=[];for(let t=0;tt.pos===e)}function iW(t,e){return t.filter(t=>-1===iz.indexOf(t.pos)&&t.box.axis===e)}function iH(t,e){return t.sort((t,i)=>{let r=e?i:t,n=e?t:i;return r.weight===n.weight?r.index-n.index:r.weight-n.weight})}function iU(t,e,i,r){return Math.max(t[i],e[i])+Math.max(t[r],e[r])}function i$(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function iq(t,e,i,r){let n,o,a,s,l,h;let c=[];for(n=0,o=t.length,l=0;n{r[t]=Math.max(e[t],i[t])}),r}(t?["left","right"]:["top","bottom"])}(a.horizontal,e));let{same:o,other:u}=function(t,e,i,r){let{pos:n,box:o}=i,a=t.maxPadding;if(!U(n)){i.size&&(t[n]-=i.size);let e=r[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&i$(a,o.getPadding());let s=Math.max(0,e.outerWidth-iU(a,t,"left","right")),l=Math.max(0,e.outerHeight-iU(a,t,"top","bottom")),h=s!==t.w,c=l!==t.h;return t.w=s,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}(e,i,a,r);l|=o&&c.length,h=h||u,s.fullSize||c.push(a)}return l&&iq(c,e,i,r)||h}function iY(t,e,i,r,n){t.top=i,t.left=e,t.right=e+r,t.bottom=i+n,t.width=r,t.height=n}function iX(t,e,i,r){let n=i.padding,{x:o,y:a}=e;for(let s of t){let t=s.box,l=r[s.stack]||{count:1,placed:0,weight:1},h=s.stackWeight/l.weight||1;if(s.horizontal){let r=e.w*h,o=l.size||t.height;tl(l.start)&&(a=l.start),t.fullSize?iY(t,n.left,a,i.outerWidth-n.right-n.left,o):iY(t,e.left+l.placed,a,r,o),l.start=a,l.placed+=r,a=t.bottom}else{let r=e.h*h,a=l.size||t.width;tl(l.start)&&(o=l.start),t.fullSize?iY(t,o,n.top,a,i.outerHeight-n.bottom-n.top):iY(t,o,e.top+l.placed,a,r),l.start=o,l.placed+=r,o=t.right}}e.x=o,e.y=a}var iG={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){let i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,r){if(!t)return;let n=ev(t.options.layout.padding),o=Math.max(e-n.width,0),a=Math.max(i-n.height,0),s=function(t){let e=function(t){let e,i,r,n,o,a;let s=[];for(e=0,i=(t||[]).length;et.box.fullSize),!0),r=iH(iV(e,"left"),!0),n=iH(iV(e,"right")),o=iH(iV(e,"top"),!0),a=iH(iV(e,"bottom")),s=iW(e,"x"),l=iW(e,"y");return{fullSize:i,leftAndTop:r.concat(o),rightAndBottom:n.concat(l).concat(a).concat(s),chartArea:iV(e,"chartArea"),vertical:r.concat(n).concat(l),horizontal:o.concat(a).concat(s)}}(t.boxes),l=s.vertical,h=s.horizontal;K(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});let c=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),d=Object.assign({},n);i$(d,ev(r));let f=Object.assign({maxPadding:d,w:o,h:a,x:n.left,y:n.top},n),p=function(t,e){let i,r,n;let o=function(t){let e={};for(let i of t){let{stack:t,pos:r,stackWeight:n}=i;if(!t||!iz.includes(r))continue;let o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:a,hBoxMaxHeight:s}=e;for(i=0,r=t.length;i{let i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class iZ{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class iK extends iZ{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}let iJ="$chartjs",iQ={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},i0=t=>null===t||""===t,i1=!!eG&&{passive:!0};function i2(t,e,i){t.canvas.removeEventListener(e,i,i1)}function i5(t,e){for(let i of t)if(i===e||i.contains(e))return!0}function i3(t,e,i){let r=t.canvas,n=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||i5(i.addedNodes,r))&&!i5(i.removedNodes,r);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function i6(t,e,i){let r=t.canvas,n=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||i5(i.removedNodes,r))&&!i5(i.addedNodes,r);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}let i8=new Map,i4=0;function i9(){let t=window.devicePixelRatio;t!==i4&&(i4=t,i8.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function i7(t,e,i){let r=t.canvas,n=r&&ez(r);if(!n)return;let o=tV((t,e)=>{let r=n.clientWidth;i(t,e),r{let e=t[0],i=e.contentRect.width,r=e.contentRect.height;(0!==i||0!==r)&&o(i,r)});return a.observe(n),i8.size||window.addEventListener("resize",i9),i8.set(t,o),a}function rt(t,e,i){i&&i.disconnect(),"resize"===e&&(i8.delete(t),i8.size||window.removeEventListener("resize",i9))}function re(t,e,i){let r=t.canvas,n=tV(e=>{null!==t.ctx&&i(function(t,e){let i=iQ[t.type]||t.type,{x:r,y:n}=eq(t,e);return{type:i,chart:e,native:t,x:void 0!==r?r:null,y:void 0!==n?n:null}}(e,t))},t);return!function(t,e,i){t.addEventListener(e,i,i1)}(r,e,n),n}class ri extends iZ{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(!function(t,e){let i=t.style,r=t.getAttribute("height"),n=t.getAttribute("width");if(t[iJ]={initial:{height:r,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",i0(n)){let e=eZ(t,"width");void 0!==e&&(t.width=e)}if(i0(r)){if(""===t.style.height)t.height=t.width/(e||2);else{let e=eZ(t,"height");void 0!==e&&(t.height=e)}}}(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[iJ])return!1;let i=e[iJ].initial;["height","width"].forEach(t=>{let r=i[t];W(r)?e.removeAttribute(t):e.setAttribute(t,r)});let r=i.style||{};return Object.keys(r).forEach(t=>{e.style[t]=r[t]}),e.width=e.width,delete e[iJ],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let r=t.$proxies||(t.$proxies={}),n={attach:i3,detach:i6,resize:i7}[e]||re;r[e]=n(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;let n={attach:rt,detach:rt,resize:rt}[e]||i2;n(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return(// eslint-disable-next-line complexity function(t,e,i,r){let n=eW(t),o=eU(n,"margin"),a=eV(n.maxWidth,t,"clientWidth")||tp,s=eV(n.maxHeight,t,"clientHeight")||tp,l=function(t,e,i){let r,n;if(void 0===e||void 0===i){let o=ez(t);if(o){let t=o.getBoundingClientRect(),a=eW(o),s=eU(a,"border","width"),l=eU(a,"padding");// this is the border box of the container e=t.width-l.width-s.width,i=t.height-l.height-s.height,r=eV(a.maxWidth,o,"clientWidth"),n=eV(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:r||tp,maxHeight:n||tp}}(t,e,i),{width:h,height:c}=l;if("content-box"===n.boxSizing){let t=eU(n,"border","width"),e=eU(n,"padding");h-=e.width+t.width,c-=e.height+t.height}h=Math.max(0,h-o.width),c=Math.max(0,r?h/r:c-o.height),h=eY(Math.min(h,a,l.maxWidth)),c=eY(Math.min(c,s,l.maxHeight)),h&&!c&&// If the canvas has width, but no height, default to aspectRatio of 2 (canvas default) (c=eY(h/2));let u=void 0!==e||void 0!==i;return u&&r&&l.height&&c>l.height&&(h=eY(Math.floor((c=l.height)*r))),{width:h,height:c}}(t,e,i,r))}isAttached(t){let e=ez(t);return!!(e&&e.isConnected)}}class rr{tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return tS(this.x)&&tS(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let r={};return t.forEach(t=>{r[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),r}constructor(){c(this,"x",void 0),c(this,"y",void 0),c(this,"active",!1),c(this,"options",void 0),c(this,"$animations",void 0)}}function rn(t,e,i,r,n){let o,a,s;let l=Y(r,0),h=Math.min(Y(n,t.length),t.length),c=0;for(i=Math.ceil(i),n&&(i=(o=n-r)/Math.floor(o/i)),s=l;s<0;)s=Math.round(l+ ++c*i);for(a=Math.max(l,0);a"left"===t?"right":"right"===t?"left":t,ra=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,rs=(t,e)=>Math.min(e||t,t);function rl(t,e){let i=[],r=t.length/e,n=t.length,o=0;for(;or?r:i,r=n&&i>r?i:r,{min:q(i,q(r,i)),max:q(r,q(i,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){let e=this._labelItems||(this._labelItems=this._computeLabelItems(t));return e}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Z(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:r,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=/** @@ -671,7 +671,7 @@ e=t.width-l.width-s.width,i=t.height-l.height-s.height,r=eV(a.maxWidth,o,"client */function(t,e,i){let{min:r,max:n}=t,o=G(e,(n-r)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(r,-Math.abs(o)),max:a(n,o)}}(this,n,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=an)return function(t,e,i,r){let n,o=0,a=i[0];for(n=0,r=Math.ceil(r);nt-e).pop(),i}(r);for(let t=0,e=o.length-1;tn)return e}return Math.max(n,1)}(o,e,n);if(a>0){let t,i;let r=a>1?Math.round((l-s)/(a-1)):null;for(rn(e,h,c,W(r)?0:s-r,s),t=0,i=a-1;t=s||o<=1||!this.isHorizontal()){this.labelRotation=a;return}let h=this._getLabelSizes(),c=h.widest.width,u=h.highest.height,d=tR(this.chart.width-c,0,this.maxWidth);c+6>(t=r.offset?this.maxWidth/o:d/(o-1))&&(t=d/(o-(r.offset?.5:1)),e=this.maxHeight-rh(r.grid)-n.padding-rc(r.title,this.chart.options.font),i=Math.sqrt(c*c+u*u),l=Math.max(a,Math.min(s,l=Math.min(Math.asin(tR((h.highest.height+6)/t,-1,1)),Math.asin(tR(e/i,-1,1))-Math.asin(tR(u/i,-1,1)))*(180/tu)))),this.labelRotation=l}afterCalculateLabelRotation(){Z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Z(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let o=rc(r,e.options.font);if(a?(t.width=this.maxWidth,t.height=rh(n)+o):(t.height=this.maxHeight,t.width=rh(n)+o),i.display&&this.ticks.length){let{first:e,last:r,widest:n,highest:o}=this._getLabelSizes(),s=2*i.padding,l=tM(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(a){let e=i.mirror?0:c*n.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+s)}else{let e=i.mirror?0:h*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+s)}this._calculatePadding(e,r,c,h)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){let{ticks:{align:n,padding:o},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){let a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1),c=0,u=0;s?l?(c=r*t.width,u=i*e.height):(c=i*t.height,u=r*e.width):"start"===n?u=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,u=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((u-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,r=t.height/2;"start"===n?(i=0,r=t.height):"end"===n&&(i=e.height,r=0),this.paddingTop=i+o,this.paddingBottom=r+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Z(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{let i;let r=t.gc,n=r.length/2;if(n>e){for(i=0;i({width:m[t]||0,height:b[t]||0});return{first:S(0),last:S(e-1),widest:S(_),highest:S(w),widths:m,heights:b}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return tR(this._alignToPixels?ei(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&ta*r?a/i:s/r:s*r0}_computeGridLineItems(t){let e,i,r,n,o,a,s,l,h,c,u,d;let f=this.axis,p=this.chart,g=this.options,{grid:m,position:b,border:y}=g,v=m.offset,x=this.isHorizontal(),_=this.ticks,w=_.length+(v?1:0),S=rh(m),O=[],M=y.setContext(this.getContext()),k=M.display?M.width:0,P=k/2,E=function(t){return ei(p,t,k)};if("top"===b)e=E(this.bottom),a=this.bottom-S,l=e-P,c=E(t.top)+P,d=t.bottom;else if("bottom"===b)e=E(this.top),c=t.top,d=E(t.bottom)-P,a=e+P,l=this.top+S;else if("left"===b)e=E(this.right),o=this.right-S,s=e-P,h=E(t.left)+P,u=t.right;else if("right"===b)e=E(this.left),h=t.left,u=E(t.right)-P,o=e+P,s=this.left+S;else if("x"===f){if("center"===b)e=E((t.top+t.bottom)/2+.5);else if(U(b)){let t=Object.keys(b)[0],i=b[t];e=E(this.chart.scales[t].getPixelForValue(i))}c=t.top,d=t.bottom,l=(a=e+P)+S}else if("y"===f){if("center"===b)e=E((t.left+t.right)/2);else if(U(b)){let t=Object.keys(b)[0],i=b[t];e=E(this.chart.scales[t].getPixelForValue(i))}s=(o=e-P)-S,h=t.left,u=t.right}let A=Y(g.ticks.maxTicksLimit,w),D=Math.max(1,Math.ceil(w/A));for(i=0;is+1e-6)))return l}(this,i,v))&&(n=ei(p,r,g),x?o=s=h=u=n:a=l=c=d=n,O.push({tx1:o,ty1:a,tx2:s,ty2:l,x1:h,y1:c,x2:u,y2:d,width:g,color:b,borderDash:_,borderDashOffset:w,tickWidth:S,tickColor:M,tickBorderDash:k,tickBorderDashOffset:P}))}return this._ticksLength=w,this._borderValue=e,O}_computeLabelItems(t){let e,i,r,n,o,a,s,l,h,c,u;let d=this.axis,f=this.options,{position:p,ticks:g}=f,m=this.isHorizontal(),b=this.ticks,{align:y,crossAlign:v,padding:x,mirror:_}=g,w=rh(f.grid),S=w+x,O=_?-x:S,M=-tM(this.labelRotation),k=[],P="middle";if("top"===p)o=this.bottom-O,a=this._getXAxisLabelAlignment();else if("bottom"===p)o=this.top+O,a=this._getXAxisLabelAlignment();else if("left"===p){let t=this._getYAxisLabelAlignment(w);a=t.textAlign,n=t.x}else if("right"===p){let t=this._getYAxisLabelAlignment(w);a=t.textAlign,n=t.x}else if("x"===d){if("center"===p)o=(t.top+t.bottom)/2+S;else if(U(p)){let t=Object.keys(p)[0],e=p[t];o=this.chart.scales[t].getPixelForValue(e)+S}a=this._getXAxisLabelAlignment()}else if("y"===d){if("center"===p)n=(t.left+t.right)/2-S;else if(U(p)){let t=Object.keys(p)[0],e=p[t];n=this.chart.scales[t].getPixelForValue(e)}a=this._getYAxisLabelAlignment(w).textAlign}"y"===d&&("start"===y?P="top":"end"===y&&(P="bottom"));let E=this._getLabelSizes();for(e=0,i=b.length;ee.value===t);if(r>=0){let t=e.setContext(this.getContext(r));return t.lineWidth}return 0}drawGrid(t){let e,i;let r=this.options.grid,n=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),a=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(r.display)for(e=0,i=o.length;e{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){let e,i;let r=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",o=[];for(e=0,i=r.length;e{let r=i.split("."),n=r.pop(),o=[t].concat(r).join("."),a=e[i].split("."),s=a.pop(),l=a.join(".");et.route(o,n,l,s)})}(e,t.defaultRoutes),t.descriptors&&et.describe(e,t.descriptors)}(t,o,e),this.override&&et.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in et[r]&&(delete et[r][i],this.override&&delete t8[i])}constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}}var rf=/* #__PURE__ */new class{add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{let r=i||this._getRegistryForType(e);i||r.isForType(e)||r===this.plugins&&e.id?this._exec(t,r,e):K(e,e=>{let r=i||this._getRegistryForType(e);this._exec(t,r,e)})})}_exec(t,e,i){let r=ts(t);Z(i["before"+r],[],i),e[t](i),Z(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}constructor(){this._init=[]}}function rg(t,e){let i=et.datasets[t]||{},r=(e.datasets||{})[t]||{};return r.indexAxis||e.indexAxis||i.indexAxis||"x"}function rm(t){if("x"===t||"y"===t||"r"===t)return t}function rb(t,...e){if(rm(t))return t;for(let r of e){var i;let e=r.axis||("top"===(i=r.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&rm(t[0].toLowerCase());if(e)return e}throw Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function ry(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function rv(t){let e=t.options||(t.options={});e.plugins=Y(e.plugins,{}),e.scales=function(t,e){let i=t8[t.type]||{scales:{}},r=e.scales||{},n=rg(t.type,e),o=Object.create(null);return Object.keys(r).forEach(e=>{let a=r[e];if(!U(a))return console.error(`Invalid scale configuration for scale: ${e}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);let s=rb(e,a,function(t,e){if(e.data&&e.data.datasets){let i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return ry(t,"x",i[0])||ry(t,"y",i[0])}return{}}(e,t),et.scales[a.type]),l=s===n?"_index_":"_value_",h=i.scales||{};o[e]=tr(Object.create(null),[{axis:s},a,h[s],h[l]])}),t.data.datasets.forEach(i=>{let n=i.type||t.type,a=i.indexAxis||rg(n,e),s=t8[n]||{},l=s.scales||{};Object.keys(l).forEach(t=>{let e;let n=(e=t,"_index_"===t?e=a:"_value_"===t&&(e="x"===a?"y":"x"),e),s=i[n+"AxisID"]||n;o[s]=o[s]||Object.create(null),tr(o[s],[{axis:n},r[s],l[t]])})}),Object.keys(o).forEach(t=>{let e=o[t];tr(e,[et.scales[e.type],et.scale])}),o}(t,e)}function rx(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}let r_=new Map,rw=new Set;function rS(t,e){let i=r_.get(t);return i||(i=e(),r_.set(t,i),rw.add(i)),i}let rO=(t,e,i)=>{let r=ta(e,i);void 0!==r&&t.add(r)};class rM{get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=rx(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),rv(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return rS(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return rS(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return rS(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return rS(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){let{options:r,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;let s=new Set;e.forEach(e=>{t&&(s.add(t),e.forEach(e=>rO(s,t,e))),e.forEach(t=>rO(s,r,t)),e.forEach(t=>rO(s,t8[n]||{},t)),e.forEach(t=>rO(s,et,t)),e.forEach(t=>rO(s,t4,t))});let l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),rw.has(e)&&o.set(e,l),l}chartOptionScopes(){let{options:t,type:e}=this;return[t,t8[e]||{},et.datasets[e]||{},{type:e},et,t4]}resolveNamedOptions(t,e,i,r=[""]){let n={$shared:!0},{resolver:o,subPrefixes:a}=rk(this._resolverCache,t,r),s=o;if(function(t,e){let{isScriptable:i,isIndexable:r}=eM(t);for(let n of e){let e=i(n),o=r(n),a=(o||e)&&t[n];if(e&&(th(a)||rP(a))||o&&H(a))return!0}return!1}(o,e)){n.$shared=!1,i=th(i)?i():i;let e=this.createResolver(t,i,a);s=eO(o,i,e)}for(let t of e)n[t]=s[t];return n}createResolver(t,e,i=[""],r){let{resolver:n}=rk(this._resolverCache,t,i);return U(e)?eO(n,e,void 0,r):n}constructor(t){var e;this._config=((e=(e=t)||{}).data=rx(e.data),rv(e),e),this._scopeCache=new Map,this._resolverCache=new Map}}function rk(t,e,i){let r=t.get(e);r||(r=new Map,t.set(e,r));let n=i.join(),o=r.get(n);if(!o){let t=eS(e,i);o={resolver:t,subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},r.set(n,o)}return o}let rP=t=>U(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||th(t[i]),!1),rE=["top","bottom","left","right","chartArea"];function rA(t,e){return"top"===t||"bottom"===t||-1===rE.indexOf(t)&&"x"===e}function rD(t,e){return function(i,r){return i[t]===r[t]?i[e]-r[e]:i[t]-r[t]}}function rT(t){let e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Z(i&&i.onComplete,[t],e)}function rR(t){let e=t.chart,i=e.options.animation;Z(i&&i.onProgress,[t],e)}function rC(t){return eB()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}let rI={},rj=t=>{let e=rC(t);return Object.values(rI).filter(t=>t.canvas===e).pop()};function rF(t,e,i){return t.options.clip?t[i]:e[i]}class rL{static register(...t){rf.add(...t),rN()}static unregister(...t){rf.remove(...t),rN()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:n}=this;return W(t)?e&&n?n:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return rf}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():eX(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return er(this.canvas,this.ctx),this}stop(){return e7.stop(this),this}resize(t,e){e7.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,r=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,eX(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Z(i.onResize,[this,o],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){let t=this.options,e=t.scales||{};K(e,(t,e)=>{t.id=e})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{}),n=[];e&&(n=n.concat(Object.keys(e).map(t=>{let i=e[t],r=rb(t,i),n="r"===r,o="x"===r;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}}))),K(n,e=>{let n=e.options,o=n.id,a=rb(o,n),s=Y(n.type,e.dtype);(void 0===n.position||rA(n.position,a)!==rA(e.dposition))&&(n.position=e.dposition),r[o]=!0;let l=null;if(o in i&&i[o].type===s)l=i[o];else{let t=rf.getScale(s);i[(l=new t({id:o,type:s,ctx:this.ctx,chart:this})).id]=l}l.init(n,t)}),K(r,(t,e)=>{t||delete i[e]}),K(i,t=>{iG.configure(this,t,t.options),iG.addBox(this,t)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){let t,e;let i=[],r=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=r.length;t{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;let n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(rD("z","_idx"));let{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){K(this.scales,t=>{iG.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);tc(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:r,count:n}of e){let e="_removeElements"===i?-n:n;!function(t,e,i){let r=Object.keys(t);for(let n of r){let r=+n;if(r>=e){let o=t[n];delete t[n],(i>0||r>e)&&(t[r+i]=o)}}}(t,r,e)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),r=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;iG.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],K(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,r=!i.disabled,n=function(t,e){let{xScale:i,yScale:r}=t;return i&&r?{left:rF(i,e,"left"),right:rF(i,e,"right"),top:rF(r,e,"top"),bottom:rF(r,e,"bottom")}:e}(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(r&&es(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),r&&el(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ea(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){let n=iB.modes[e];return"function"==typeof n?n(this,t,i,r):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,r=i.filter(t=>t&&t._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=ew(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let r=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,r);tl(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update(e=>e.datasetIndex===t?r:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),e7.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,r),t[i]=r},r=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};K(this.options.events,t=>i(t,r))}bindResponsiveEvents(){let t;this._responsiveListeners||(this._responsiveListeners={});let e=this._responsiveListeners,i=this.platform,r=(t,r)=>{i.addEventListener(this,t,r),e[t]=r},n=(t,r)=>{e[t]&&(i.removeEventListener(this,t,r),delete e[t])},o=(t,e)=>{this.canvas&&this.resize(t,e)},a=()=>{n("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",t)};t=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),r("attach",a)},i.isAttached(this.canvas)?a():t()}unbindEvents(){K(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},K(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let r,n,o;let a=i?"set":"remove";for("dataset"===e&&this.getDatasetMeta(t[0].datasetIndex).controller["_"+a+"DatasetHoverStyle"](),n=0,o=t.length;n{let i=this.getDatasetMeta(t);if(!i)throw Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),r=!J(i,e);r&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){let r=this.options.hover,n=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,r))return;let n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){var r;let{_active:n=[],options:o}=this,a=this._getActiveElements(t,n,i,e),s="mouseup"===t.type||"click"===t.type||"contextmenu"===t.type,l=(r=this._lastEvent,i&&"mouseout"!==t.type?s?r:t:null);i&&(this._lastEvent=null,Z(o.onHover,[t,a,this],this),s&&Z(o.onClick,[t,a,this],this));let h=!J(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,r){if("mouseout"===t.type)return[];if(!i)return e;let n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,r)}constructor(t,e){var i,r;let n;let o=this.config=new rM(e),a=rC(t),s=rj(a);if(s)throw Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");let l=o.createResolver(o.chartOptionScopes(),this.getContext());this.platform=new(o.platform||(!eB()||"undefined"!=typeof OffscreenCanvas&&a instanceof OffscreenCanvas?iK:ri)),this.platform.updateConfig(o);let h=this.platform.acquireContext(a,l.aspectRatio),c=h&&h.canvas,u=c&&c.height,d=c&&c.width;if(this.id=V(),this.ctx=h,this.canvas=c,this.width=d,this.height=u,this._options=l,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 rp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(i=t=>this.update(t),r=l.resizeDelay||0,function(...t){return r?(clearTimeout(n),n=setTimeout(i,r,t)):i.apply(this,t),r}),this._dataChanges=[],rI[this.id]=this,!h||!c){console.error("Failed to create chart: can't acquire context from the given item");return}e7.listen(this,"complete",rT),e7.listen(this,"progress",rR),this._initialize(),this.attached&&this.update()}}function rN(){return K(rL.instances,t=>t._plugins.invalidate())}/** + */function(t){let e;let i=[],r=Math.sqrt(t);for(e=1;et-e).pop(),i}(r);for(let t=0,e=o.length-1;tn)return e}return Math.max(n,1)}(o,e,n);if(a>0){let t,i;let r=a>1?Math.round((l-s)/(a-1)):null;for(rn(e,h,c,W(r)?0:s-r,s),t=0,i=a-1;t=s||o<=1||!this.isHorizontal()){this.labelRotation=a;return}let h=this._getLabelSizes(),c=h.widest.width,u=h.highest.height,d=tR(this.chart.width-c,0,this.maxWidth);c+6>(t=r.offset?this.maxWidth/o:d/(o-1))&&(t=d/(o-(r.offset?.5:1)),e=this.maxHeight-rh(r.grid)-n.padding-rc(r.title,this.chart.options.font),i=Math.sqrt(c*c+u*u),l=Math.max(a,Math.min(s,l=Math.min(Math.asin(tR((h.highest.height+6)/t,-1,1)),Math.asin(tR(e/i,-1,1))-Math.asin(tR(u/i,-1,1)))*(180/tu)))),this.labelRotation=l}afterCalculateLabelRotation(){Z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Z(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let o=rc(r,e.options.font);if(a?(t.width=this.maxWidth,t.height=rh(n)+o):(t.height=this.maxHeight,t.width=rh(n)+o),i.display&&this.ticks.length){let{first:e,last:r,widest:n,highest:o}=this._getLabelSizes(),s=2*i.padding,l=tM(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(a){let e=i.mirror?0:c*n.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+s)}else{let e=i.mirror?0:h*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+s)}this._calculatePadding(e,r,c,h)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){let{ticks:{align:n,padding:o},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){let a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1),c=0,u=0;s?l?(c=r*t.width,u=i*e.height):(c=i*t.height,u=r*e.width):"start"===n?u=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,u=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((u-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,r=t.height/2;"start"===n?(i=0,r=t.height):"end"===n&&(i=e.height,r=0),this.paddingTop=i+o,this.paddingBottom=r+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Z(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{let i;let r=t.gc,n=r.length/2;if(n>e){for(i=0;i({width:m[t]||0,height:b[t]||0});return{first:S(0),last:S(e-1),widest:S(_),highest:S(w),widths:m,heights:b}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return tR(this._alignToPixels?ei(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&ta*r?a/i:s/r:s*r0}_computeGridLineItems(t){let e,i,r,n,o,a,s,l,h,c,u,d;let f=this.axis,p=this.chart,g=this.options,{grid:m,position:b,border:y}=g,v=m.offset,x=this.isHorizontal(),_=this.ticks,w=_.length+(v?1:0),S=rh(m),O=[],M=y.setContext(this.getContext()),k=M.display?M.width:0,P=k/2,E=function(t){return ei(p,t,k)};if("top"===b)e=E(this.bottom),a=this.bottom-S,l=e-P,c=E(t.top)+P,d=t.bottom;else if("bottom"===b)e=E(this.top),c=t.top,d=E(t.bottom)-P,a=e+P,l=this.top+S;else if("left"===b)e=E(this.right),o=this.right-S,s=e-P,h=E(t.left)+P,u=t.right;else if("right"===b)e=E(this.left),h=t.left,u=E(t.right)-P,o=e+P,s=this.left+S;else if("x"===f){if("center"===b)e=E((t.top+t.bottom)/2+.5);else if(U(b)){let t=Object.keys(b)[0],i=b[t];e=E(this.chart.scales[t].getPixelForValue(i))}c=t.top,d=t.bottom,l=(a=e+P)+S}else if("y"===f){if("center"===b)e=E((t.left+t.right)/2);else if(U(b)){let t=Object.keys(b)[0],i=b[t];e=E(this.chart.scales[t].getPixelForValue(i))}s=(o=e-P)-S,h=t.left,u=t.right}let A=Y(g.ticks.maxTicksLimit,w),T=Math.max(1,Math.ceil(w/A));for(i=0;is+1e-6)))return l}(this,i,v))&&(n=ei(p,r,g),x?o=s=h=u=n:a=l=c=d=n,O.push({tx1:o,ty1:a,tx2:s,ty2:l,x1:h,y1:c,x2:u,y2:d,width:g,color:b,borderDash:_,borderDashOffset:w,tickWidth:S,tickColor:M,tickBorderDash:k,tickBorderDashOffset:P}))}return this._ticksLength=w,this._borderValue=e,O}_computeLabelItems(t){let e,i,r,n,o,a,s,l,h,c,u;let d=this.axis,f=this.options,{position:p,ticks:g}=f,m=this.isHorizontal(),b=this.ticks,{align:y,crossAlign:v,padding:x,mirror:_}=g,w=rh(f.grid),S=w+x,O=_?-x:S,M=-tM(this.labelRotation),k=[],P="middle";if("top"===p)o=this.bottom-O,a=this._getXAxisLabelAlignment();else if("bottom"===p)o=this.top+O,a=this._getXAxisLabelAlignment();else if("left"===p){let t=this._getYAxisLabelAlignment(w);a=t.textAlign,n=t.x}else if("right"===p){let t=this._getYAxisLabelAlignment(w);a=t.textAlign,n=t.x}else if("x"===d){if("center"===p)o=(t.top+t.bottom)/2+S;else if(U(p)){let t=Object.keys(p)[0],e=p[t];o=this.chart.scales[t].getPixelForValue(e)+S}a=this._getXAxisLabelAlignment()}else if("y"===d){if("center"===p)n=(t.left+t.right)/2-S;else if(U(p)){let t=Object.keys(p)[0],e=p[t];n=this.chart.scales[t].getPixelForValue(e)}a=this._getYAxisLabelAlignment(w).textAlign}"y"===d&&("start"===y?P="top":"end"===y&&(P="bottom"));let E=this._getLabelSizes();for(e=0,i=b.length;ee.value===t);if(r>=0){let t=e.setContext(this.getContext(r));return t.lineWidth}return 0}drawGrid(t){let e,i;let r=this.options.grid,n=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),a=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(r.display)for(e=0,i=o.length;e{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){let e,i;let r=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",o=[];for(e=0,i=r.length;e{let r=i.split("."),n=r.pop(),o=[t].concat(r).join("."),a=e[i].split("."),s=a.pop(),l=a.join(".");et.route(o,n,l,s)})}(e,t.defaultRoutes),t.descriptors&&et.describe(e,t.descriptors)}(t,o,e),this.override&&et.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in et[r]&&(delete et[r][i],this.override&&delete t8[i])}constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}}var rf=/* #__PURE__ */new class{add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{let r=i||this._getRegistryForType(e);i||r.isForType(e)||r===this.plugins&&e.id?this._exec(t,r,e):K(e,e=>{let r=i||this._getRegistryForType(e);this._exec(t,r,e)})})}_exec(t,e,i){let r=ts(t);Z(i["before"+r],[],i),e[t](i),Z(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}constructor(){this._init=[]}}function rg(t,e){let i=et.datasets[t]||{},r=(e.datasets||{})[t]||{};return r.indexAxis||e.indexAxis||i.indexAxis||"x"}function rm(t){if("x"===t||"y"===t||"r"===t)return t}function rb(t,...e){if(rm(t))return t;for(let r of e){var i;let e=r.axis||("top"===(i=r.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&rm(t[0].toLowerCase());if(e)return e}throw Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function ry(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function rv(t){let e=t.options||(t.options={});e.plugins=Y(e.plugins,{}),e.scales=function(t,e){let i=t8[t.type]||{scales:{}},r=e.scales||{},n=rg(t.type,e),o=Object.create(null);return Object.keys(r).forEach(e=>{let a=r[e];if(!U(a))return console.error(`Invalid scale configuration for scale: ${e}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);let s=rb(e,a,function(t,e){if(e.data&&e.data.datasets){let i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return ry(t,"x",i[0])||ry(t,"y",i[0])}return{}}(e,t),et.scales[a.type]),l=s===n?"_index_":"_value_",h=i.scales||{};o[e]=tr(Object.create(null),[{axis:s},a,h[s],h[l]])}),t.data.datasets.forEach(i=>{let n=i.type||t.type,a=i.indexAxis||rg(n,e),s=t8[n]||{},l=s.scales||{};Object.keys(l).forEach(t=>{let e;let n=(e=t,"_index_"===t?e=a:"_value_"===t&&(e="x"===a?"y":"x"),e),s=i[n+"AxisID"]||n;o[s]=o[s]||Object.create(null),tr(o[s],[{axis:n},r[s],l[t]])})}),Object.keys(o).forEach(t=>{let e=o[t];tr(e,[et.scales[e.type],et.scale])}),o}(t,e)}function rx(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}let r_=new Map,rw=new Set;function rS(t,e){let i=r_.get(t);return i||(i=e(),r_.set(t,i),rw.add(i)),i}let rO=(t,e,i)=>{let r=ta(e,i);void 0!==r&&t.add(r)};class rM{get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=rx(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),rv(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return rS(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return rS(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return rS(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return rS(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){let{options:r,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;let s=new Set;e.forEach(e=>{t&&(s.add(t),e.forEach(e=>rO(s,t,e))),e.forEach(t=>rO(s,r,t)),e.forEach(t=>rO(s,t8[n]||{},t)),e.forEach(t=>rO(s,et,t)),e.forEach(t=>rO(s,t4,t))});let l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),rw.has(e)&&o.set(e,l),l}chartOptionScopes(){let{options:t,type:e}=this;return[t,t8[e]||{},et.datasets[e]||{},{type:e},et,t4]}resolveNamedOptions(t,e,i,r=[""]){let n={$shared:!0},{resolver:o,subPrefixes:a}=rk(this._resolverCache,t,r),s=o;if(function(t,e){let{isScriptable:i,isIndexable:r}=eM(t);for(let n of e){let e=i(n),o=r(n),a=(o||e)&&t[n];if(e&&(th(a)||rP(a))||o&&H(a))return!0}return!1}(o,e)){n.$shared=!1,i=th(i)?i():i;let e=this.createResolver(t,i,a);s=eO(o,i,e)}for(let t of e)n[t]=s[t];return n}createResolver(t,e,i=[""],r){let{resolver:n}=rk(this._resolverCache,t,i);return U(e)?eO(n,e,void 0,r):n}constructor(t){var e;this._config=((e=(e=t)||{}).data=rx(e.data),rv(e),e),this._scopeCache=new Map,this._resolverCache=new Map}}function rk(t,e,i){let r=t.get(e);r||(r=new Map,t.set(e,r));let n=i.join(),o=r.get(n);if(!o){let t=eS(e,i);o={resolver:t,subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},r.set(n,o)}return o}let rP=t=>U(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||th(t[i]),!1),rE=["top","bottom","left","right","chartArea"];function rA(t,e){return"top"===t||"bottom"===t||-1===rE.indexOf(t)&&"x"===e}function rT(t,e){return function(i,r){return i[t]===r[t]?i[e]-r[e]:i[t]-r[t]}}function rD(t){let e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Z(i&&i.onComplete,[t],e)}function rR(t){let e=t.chart,i=e.options.animation;Z(i&&i.onProgress,[t],e)}function rI(t){return eB()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}let rC={},rj=t=>{let e=rI(t);return Object.values(rC).filter(t=>t.canvas===e).pop()};function rF(t,e,i){return t.options.clip?t[i]:e[i]}class rL{static register(...t){rf.add(...t),rN()}static unregister(...t){rf.remove(...t),rN()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:n}=this;return W(t)?e&&n?n:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return rf}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():eX(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return er(this.canvas,this.ctx),this}stop(){return e7.stop(this),this}resize(t,e){e7.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,r=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,eX(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Z(i.onResize,[this,o],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){let t=this.options,e=t.scales||{};K(e,(t,e)=>{t.id=e})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{}),n=[];e&&(n=n.concat(Object.keys(e).map(t=>{let i=e[t],r=rb(t,i),n="r"===r,o="x"===r;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}}))),K(n,e=>{let n=e.options,o=n.id,a=rb(o,n),s=Y(n.type,e.dtype);(void 0===n.position||rA(n.position,a)!==rA(e.dposition))&&(n.position=e.dposition),r[o]=!0;let l=null;if(o in i&&i[o].type===s)l=i[o];else{let t=rf.getScale(s);i[(l=new t({id:o,type:s,ctx:this.ctx,chart:this})).id]=l}l.init(n,t)}),K(r,(t,e)=>{t||delete i[e]}),K(i,t=>{iG.configure(this,t,t.options),iG.addBox(this,t)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){let t,e;let i=[],r=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=r.length;t{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;let n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(rT("z","_idx"));let{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){K(this.scales,t=>{iG.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);tc(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:r,count:n}of e){let e="_removeElements"===i?-n:n;!function(t,e,i){let r=Object.keys(t);for(let n of r){let r=+n;if(r>=e){let o=t[n];delete t[n],(i>0||r>e)&&(t[r+i]=o)}}}(t,r,e)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),r=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;iG.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],K(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,r=!i.disabled,n=function(t,e){let{xScale:i,yScale:r}=t;return i&&r?{left:rF(i,e,"left"),right:rF(i,e,"right"),top:rF(r,e,"top"),bottom:rF(r,e,"bottom")}:e}(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(r&&es(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),r&&el(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ea(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){let n=iB.modes[e];return"function"==typeof n?n(this,t,i,r):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,r=i.filter(t=>t&&t._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=ew(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let r=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,r);tl(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update(e=>e.datasetIndex===t?r:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),e7.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,r),t[i]=r},r=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};K(this.options.events,t=>i(t,r))}bindResponsiveEvents(){let t;this._responsiveListeners||(this._responsiveListeners={});let e=this._responsiveListeners,i=this.platform,r=(t,r)=>{i.addEventListener(this,t,r),e[t]=r},n=(t,r)=>{e[t]&&(i.removeEventListener(this,t,r),delete e[t])},o=(t,e)=>{this.canvas&&this.resize(t,e)},a=()=>{n("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",t)};t=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),r("attach",a)},i.isAttached(this.canvas)?a():t()}unbindEvents(){K(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},K(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let r,n,o;let a=i?"set":"remove";for("dataset"===e&&this.getDatasetMeta(t[0].datasetIndex).controller["_"+a+"DatasetHoverStyle"](),n=0,o=t.length;n{let i=this.getDatasetMeta(t);if(!i)throw Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),r=!J(i,e);r&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){let r=this.options.hover,n=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,r))return;let n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){var r;let{_active:n=[],options:o}=this,a=this._getActiveElements(t,n,i,e),s="mouseup"===t.type||"click"===t.type||"contextmenu"===t.type,l=(r=this._lastEvent,i&&"mouseout"!==t.type?s?r:t:null);i&&(this._lastEvent=null,Z(o.onHover,[t,a,this],this),s&&Z(o.onClick,[t,a,this],this));let h=!J(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,r){if("mouseout"===t.type)return[];if(!i)return e;let n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,r)}constructor(t,e){var i,r;let n;let o=this.config=new rM(e),a=rI(t),s=rj(a);if(s)throw Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");let l=o.createResolver(o.chartOptionScopes(),this.getContext());this.platform=new(o.platform||(!eB()||"undefined"!=typeof OffscreenCanvas&&a instanceof OffscreenCanvas?iK:ri)),this.platform.updateConfig(o);let h=this.platform.acquireContext(a,l.aspectRatio),c=h&&h.canvas,u=c&&c.height,d=c&&c.width;if(this.id=V(),this.ctx=h,this.canvas=c,this.width=d,this.height=u,this._options=l,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 rp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(i=t=>this.update(t),r=l.resizeDelay||0,function(...t){return r?(clearTimeout(n),n=setTimeout(i,r,t)):i.apply(this,t),r}),this._dataChanges=[],rC[this.id]=this,!h||!c){console.error("Failed to create chart: can't acquire context from the given item");return}e7.listen(this,"complete",rD),e7.listen(this,"progress",rR),this._initialize(),this.attached&&this.update()}}function rN(){return K(rL.instances,t=>t._plugins.invalidate())}/** * Convert (r, 𝜃) to (x, y) */function rB(t,e,i,r){return{x:i+t*Math.cos(e),y:r+t*Math.sin(e)}}/** * Path the arc, respecting border radius by separating into left and right halves. @@ -688,15 +688,15 @@ e=t.width-l.width-s.width,i=t.height-l.height-s.height,r=eV(a.maxWidth,o,"client * 6<---b<---5 Inner */function rz(t,e,i,r,n,o){let{x:a,y:s,startAngle:l,pixelMargin:h,innerRadius:c}=e,u=Math.max(e.outerRadius+r+i-h,0),d=c>0?c+r+i+h:0,f=0,p=n-l;if(r){let t=u>0?u-r:0,e=((c>0?c-r:0)+t)/2;f=(p-(0!==e?p*e/(e+r):p))/2}let g=Math.max(.001,p*u-i/tu)/u,m=(p-g)/2,b=l+m+f,y=n-m-f,{outerStart:v,outerEnd:x,innerStart:_,innerEnd:w}=/** * Parse border radius from the provided options - */function(t,e,i,r){let n=em(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(i-e)/2,a=Math.min(o,r*e/2),s=t=>{let e=(i-Math.min(o,t))*r/2;return tR(t,0,Math.min(o,e))};return{outerStart:s(n.outerStart),outerEnd:s(n.outerEnd),innerStart:tR(n.innerStart,0,a),innerEnd:tR(n.innerEnd,0,a)}}(e,d,u,y-b),S=u-v,O=u-x,M=b+v/S,k=y-x/O,P=d+_,E=d+w,A=b+_/P,D=y-w/E;if(t.beginPath(),o){// The first arc segments from point 1 to point a to point 2 + */function(t,e,i,r){let n=em(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(i-e)/2,a=Math.min(o,r*e/2),s=t=>{let e=(i-Math.min(o,t))*r/2;return tR(t,0,Math.min(o,e))};return{outerStart:s(n.outerStart),outerEnd:s(n.outerEnd),innerStart:tR(n.innerStart,0,a),innerEnd:tR(n.innerEnd,0,a)}}(e,d,u,y-b),S=u-v,O=u-x,M=b+v/S,k=y-x/O,P=d+_,E=d+w,A=b+_/P,T=y-w/E;if(t.beginPath(),o){// The first arc segments from point 1 to point a to point 2 let e=(M+k)/2;// The corner segment from point 2 to point 3 if(t.arc(a,s,u,M,e),t.arc(a,s,u,e,k),x>0){let e=rB(O,k,a,s);t.arc(e.x,e.y,x,k,y+tm)}// The line from point 3 to point 4 let i=rB(E,y,a,s);// The corner segment from point 4 to point 5 -if(t.lineTo(i.x,i.y),w>0){let e=rB(E,D,a,s);t.arc(e.x,e.y,w,y+tm,D+Math.PI)}// The inner arc from point 5 to point b to point 6 +if(t.lineTo(i.x,i.y),w>0){let e=rB(E,T,a,s);t.arc(e.x,e.y,w,y+tm,T+Math.PI)}// The inner arc from point 5 to point b to point 6 let r=(y-w/d+(b+_/d))/2;// The corner segment from point 6 to point 7 if(t.arc(a,s,d,y-w/d,r,!0),t.arc(a,s,d,r,b+_/d,!0),_>0){let e=rB(P,A,a,s);t.arc(e.x,e.y,_,A+Math.PI,b-tm)}// The line from point 7 to point 8 let n=rB(S,b,a,s);// The corner segment from point 8 to point 1 -if(t.lineTo(n.x,n.y),v>0){let e=rB(S,M,a,s);t.arc(e.x,e.y,v,b-tm,M)}}else{t.moveTo(a,s);let e=Math.cos(M)*u+a,i=Math.sin(M)*u+s;t.lineTo(e,i);let r=Math.cos(k)*u+a,n=Math.sin(k)*u+s;t.lineTo(r,n)}t.closePath()}c(rL,"defaults",et),c(rL,"instances",rI),c(rL,"overrides",t8),c(rL,"registry",rf),c(rL,"version","4.4.0"),c(rL,"getChart",rj);class rV extends rr{inRange(t,e,i){let r=this.getProps(["x","y"],i),{angle:n,distance:o}=tP(r,{x:t,y:e}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=(this.options.spacing+this.options.borderWidth)/2,d=Y(c,s-a),f=d>=td||tT(n,a,s),p=tC(o,l+u,h+u);return f&&p}getCenterPoint(t){let{x:e,y:i,startAngle:r,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:s,spacing:l}=this.options,h=(r+n)/2,c=(o+a+l+s)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,r=(e.offset||0)/4,n=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>td?Math.floor(i/td):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*r,Math.sin(a)*r);let s=1-Math.sin(Math.min(tu,i||0)),l=r*s;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,r,n){let{fullCircles:o,startAngle:a,circumference:s}=e,l=e.endAngle;if(o){rz(t,e,i,r,l,n);for(let e=0;e0){let e=rB(S,M,a,s);t.arc(e.x,e.y,v,b-tm,M)}}else{t.moveTo(a,s);let e=Math.cos(M)*u+a,i=Math.sin(M)*u+s;t.lineTo(e,i);let r=Math.cos(k)*u+a,n=Math.sin(k)*u+s;t.lineTo(r,n)}t.closePath()}c(rL,"defaults",et),c(rL,"instances",rC),c(rL,"overrides",t8),c(rL,"registry",rf),c(rL,"version","4.4.0"),c(rL,"getChart",rj);class rV extends rr{inRange(t,e,i){let r=this.getProps(["x","y"],i),{angle:n,distance:o}=tP(r,{x:t,y:e}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=(this.options.spacing+this.options.borderWidth)/2,d=Y(c,s-a),f=d>=td||tD(n,a,s),p=tI(o,l+u,h+u);return f&&p}getCenterPoint(t){let{x:e,y:i,startAngle:r,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:s,spacing:l}=this.options,h=(r+n)/2,c=(o+a+l+s)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,r=(e.offset||0)/4,n=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>td?Math.floor(i/td):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*r,Math.sin(a)*r);let s=1-Math.sin(Math.min(tu,i||0)),l=r*s;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,r,n){let{fullCircles:o,startAngle:a,circumference:s}=e,l=e.endAngle;if(o){rz(t,e,i,r,l,n);for(let e=0;en?(h=n/l,t.arc(o,a,l,i+h,r-h,!0)):t.arc(o,a,n,i+tm,r-tm),t.closePath(),t.clip()}(t,e,p),o||(rz(t,e,i,r,p,n),t.stroke())}(t,this,l,n,o),t.restore()}constructor(t){super(),c(this,"circumference",void 0),c(this,"endAngle",void 0),c(this,"fullCircles",void 0),c(this,"innerRadius",void 0),c(this,"outerRadius",void 0),c(this,"pixelMargin",void 0),c(this,"startAngle",void 0),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,t&&Object.assign(this,t)}}function rW(t,e,i=e){t.lineCap=Y(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Y(i.borderDash,e.borderDash)),t.lineDashOffset=Y(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Y(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Y(i.borderWidth,e.borderWidth),t.strokeStyle=Y(i.borderColor,e.borderColor)}function rH(t,e,i){t.lineTo(i.x,i.y)}function rU(t,e,i={}){let r=t.length,{start:n=0,end:o=r-1}=i,{start:a,end:s}=e,l=Math.max(n,a),h=Math.min(o,s);return{count:r,start:l,loop:e.loop,ilen:hs&&o>s)?r+h-l:h-l}}function r$(t,e,i,r){let n,o,a;let{points:s,options:l}=e,{count:h,start:c,loop:u,ilen:d}=rU(s,i,r),f=l.stepped?eh:l.tension||"monotone"===l.cubicInterpolationMode?ec:rH,{move:p=!0,reverse:g}=r||{};for(n=0;n<=d;++n)(o=s[(c+(g?d-n:n))%h]).skip||(p?(t.moveTo(o.x,o.y),p=!1):f(t,a,o,g,l.stepped),a=o);return u&&f(t,a,o=s[(c+(g?d:0))%h],g,l.stepped),!!u}function rq(t,e,i,r){let n,o,a,s,l,h;let c=e.points,{count:u,start:d,ilen:f}=rU(c,i,r),{move:p=!0,reverse:g}=r||{},m=0,b=0,y=t=>(d+(g?f-t:t))%u,v=()=>{s!==l&&(t.lineTo(m,l),t.lineTo(m,s),t.lineTo(m,h))};for(p&&(o=c[y(0)],t.moveTo(o.x,o.y)),n=0;n<=f;++n){if((o=c[y(n)]).skip)continue;let e=o.x,i=o.y,r=0|e;r===a?(il&&(l=i),m=(b*m+e)/++b):(v(),t.lineTo(e,i),a=r,b=0,s=l=i),h=i}v()}function rY(t){let e=t.options,i=e.borderDash&&e.borderDash.length,r=!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i;return r?rq:r$}c(rV,"id","arc"),c(rV,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),c(rV,"defaultRoutes",{backgroundColor:"backgroundColor"}),c(rV,"descriptors",{_scriptable:!0,_indexable:t=>"borderDash"!==t});let rX="function"==typeof Path2D;class rG extends rr{updateControlPoints(t,e){let i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){let r=i.spanGaps?this._loop:this._fullLoop;!/** * @private @@ -714,25 +714,25 @@ s[i]=0!==t?(h[o]-n[o])/t:0}l[i]=r?h?tx(s[i-1])!==tx(s[i])?0:(s[i-1]+s[i])/2:s[i- let n=t.skip?e:t,o=i.skip?e:i,a=tE(e,n),s=tE(o,e),l=a/(a+s),h=s/(a+s);// If all points are the same, s01 & s02 will be inf l=isNaN(l)?0:l,h=isNaN(h)?0:h;let c=r*l,u=r*h;// scaling factor for triangle Ta return{previous:{x:e.x-c*(o.x-n.x),y:e.y-c*(o.y-n.y)},next:{x:e.x+u*(o.x-n.x),y:e.y+u*(o.y-n.y)}}}(i,s=t[o],t[Math.min(o+1,a-(r?0:1))%a],e.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,i=s}e.capBezierPoints&&function(t,e){let i,r,n,o,a;let s=ea(t[0],e);for(i=0,r=t.length;in&&t[o%e].skip;)o--;return{start:n,end:o%=e}}(i,n,o,r);if(!0===r)return e4(t,[{start:a,end:s,loop:o}],i,e);let l=s"borderDash"!==t&&"fill"!==t});class rK extends rr{inRange(t,e,i){let r=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)t.replace("rgb(","rgba(").replace(")",", 0.5)"));function r4(t){return r6[t%r6.length]}function r9(t){return r8[t%r8.length]}function r7(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function nt(t){if(t._decimated){let e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function ne(t){t.data.datasets.forEach(t=>{nt(t)})}function ni(t,e,i,r){if(r)return;let n=e[t],o=i[t];return"angle"===t&&(n=tD(n),o=tD(o)),{property:t,start:n,end:o}}function nr(t,e,i){for(;e>t;e--){let t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function nn(t,e,i,r){return t&&e?r(t[i],e[i]):t?t[i]:e?e[i]:0}function no(t,e){let i=[],r=!1;return H(t)?(r=!0,i=t):i=function(t,e){let{x:i=null,y:r=null}=t||{},n=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=nr(t,e,n);let a=n[t],s=n[e];null!==r?(o.push({x:a.x,y:r}),o.push({x:s.x,y:r})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:s.y}))}),o}(t,e),i.length?new rG({points:i,options:{tension:0},_loop:r,_fullLoop:r}):null}function na(t){return t&&!1!==t.fill}class ns{pathSegment(t,e,i){let{x:r,y:n,radius:o}=this;return e=e||{start:0,end:td},t.arc(r,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){let{x:e,y:i,radius:r}=this,n=t.angle;return{x:e+Math.cos(n)*r,y:i+Math.sin(n)*r,angle:n}}constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}}function nl(t,e,i){let r=function(t){let{chart:e,fill:i,line:r}=t;if($(i))return function(t,e){let i=t.getDatasetMeta(e),r=i&&t.isDatasetVisible(e);return r?i.dataset:null}(e,i);if("stack"===i)return function(t){let{scale:e,index:i,line:r}=t,n=[],o=r.segments,a=r.points,s=function(t,e){let i=[],r=t.getMatchingVisibleMetas("line");for(let t=0;t{let{boxHeight:i=e,boxWidth:r=e}=t;return t.usePointStyle&&(i=Math.min(i,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:i,itemHeight:Math.max(e,i)}},nf=(t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class np extends rr{update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=Z(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let t,e;let{options:i,ctx:r}=this;if(!i.display){this.width=this.height=0;return}let n=i.labels,o=ex(n.font),a=o.size,s=this._computeTitleHeight(),{boxWidth:l,itemHeight:h}=nd(n,a);r.font=o.string,this.isHorizontal()?(t=this.maxWidth,e=this._fitRows(s,a,l,h)+10):(e=this.maxHeight,t=this._fitCols(s,o,l,h)+10),this.width=Math.min(t,i.maxWidth||this.maxWidth),this.height=Math.min(e,i.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){let{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],h=r+a,c=t;n.textAlign="left",n.textBaseline="middle";let u=-1,d=-h;return this.legendItems.forEach((t,f)=>{let p=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+p+2*a>o)&&(c+=h,l[l.length-(f>0?0:1)]=0,d+=h,u++),s[f]={left:0,top:d,row:u,width:p,height:r},l[l.length-1]+=p+a}),c}_fitCols(t,e,i,r){let{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t,c=a,u=0,d=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{let{itemWidth:g,itemHeight:m}=function(t,e,i,r,n){var o;let a,s;let l=((a=r.text)&&"string"!=typeof a&&(a=a.reduce((t,e)=>t.length>e.length?t:e)),t+e.size/2+i.measureText(a).width),h=(o=e.lineHeight,s=n,"string"!=typeof r.text&&(s=ng(r,o)),s);return{itemWidth:l,itemHeight:h}}(i,e,n,t,r);o>0&&d+m+2*a>h&&(c+=u+a,l.push({width:u,height:d}),f+=u+a,p++,u=d=0),s[o]={left:f,top:d,col:p,width:g,height:m},u=Math.max(u,g),d+=m+a}),c+=u,l.push({width:u,height:d}),c}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:n}}=this,o=e0(n,this.left,this.width);if(this.isHorizontal()){let n=0,a=tH(i,this.left+r,this.right-this.lineWidths[n]);for(let s of e)n!==s.row&&(n=s.row,a=tH(i,this.left+r,this.right-this.lineWidths[n])),s.top+=this.top+t+r,s.left=o.leftForLtr(o.x(a),s.width),a+=s.width+r}else{let n=0,a=tH(i,this.top+t+r,this.bottom-this.columnSizes[n].height);for(let s of e)s.col!==n&&(n=s.col,a=tH(i,this.top+t+r,this.bottom-this.columnSizes[n].height)),s.top=a,s.left+=this.left+r,s.left=o.leftForLtr(o.x(s.left),s.width),a+=s.height+r}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){let t=this.ctx;es(t,this),this._draw(),el(t)}}_draw(){let t;let{options:e,columnSizes:i,lineWidths:r,ctx:n}=this,{align:o,labels:a}=e,s=et.color,l=e0(e.rtl,this.left,this.width),h=ex(a.font),{padding:c}=a,u=h.size,d=u/2;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=h.string;let{boxWidth:f,boxHeight:p,itemHeight:g}=nd(a,u),m=function(t,e,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;n.save();let r=Y(i.lineWidth,1);if(n.fillStyle=Y(i.fillStyle,s),n.lineCap=Y(i.lineCap,"butt"),n.lineDashOffset=Y(i.lineDashOffset,0),n.lineJoin=Y(i.lineJoin,"miter"),n.lineWidth=r,n.strokeStyle=Y(i.strokeStyle,s),n.setLineDash(Y(i.lineDash,[])),a.usePointStyle){let o={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:r},s=l.xPlus(t,f/2);eo(n,o,s,e+d,a.pointStyleWidth&&f)}else{let o=e+Math.max((u-p)/2,0),a=l.leftForLtr(t,f),s=ey(i.borderRadius);n.beginPath(),Object.values(s).some(t=>0!==t)?ed(n,{x:a,y:o,w:f,h:p,radius:s}):n.rect(a,o,f,p),n.fill(),0!==r&&n.stroke()}n.restore()},b=function(t,e,i){eu(n,i.text,t,e+g/2,h,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})},y=this.isHorizontal(),v=this._computeTitleHeight();t=y?{x:tH(o,this.left+c,this.right-r[0]),y:this.top+c+v,line:0}:{x:this.left+c,y:tH(o,this.top+v+c,this.bottom-i[0].height),line:0},e1(this.ctx,e.textDirection);let x=g+c;this.legendItems.forEach((s,u)=>{n.strokeStyle=s.fontColor,n.fillStyle=s.fontColor;let p=n.measureText(s.text).width,g=l.textAlign(s.textAlign||(s.textAlign=a.textAlign)),_=f+d+p,w=t.x,S=t.y;l.setWidth(this.width),y?u>0&&w+_+c>this.right&&(S=t.y+=x,t.line++,w=t.x=tH(o,this.left+c,this.right-r[t.line])):u>0&&S+x>this.bottom&&(w=t.x=w+i[t.line].width+c,t.line++,S=t.y=tH(o,this.top+v+c,this.bottom-i[t.line].height));let O=l.x(w);if(m(O,S,s),w=tU(g,w+f+d,y?w+_:this.right,e.rtl),b(l.x(w),S,s),y)t.x+=_+c;else if("string"!=typeof s.text){let e=h.lineHeight;t.y+=ng(s,e)+c}else t.y+=x}),e2(this.ctx,e.textDirection)}drawTitle(){let t;let e=this.options,i=e.title,r=ex(i.font),n=ev(i.padding);if(!i.display)return;let o=e0(e.rtl,this.left,this.width),a=this.ctx,s=i.position,l=r.size/2,h=n.top+l,c=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),t=this.top+h,c=tH(e.align,c,this.right-u);else{let i=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);t=h+tH(e.align,this.top,this.bottom-i-e.labels.padding-this._computeTitleHeight())}let d=tH(s,c,c+u);a.textAlign=o.textAlign(tW(s)),a.textBaseline="middle",a.strokeStyle=i.color,a.fillStyle=i.color,a.font=r.string,eu(a,i.text,d,t,r)}_computeTitleHeight(){let t=this.options.title,e=ex(t.font),i=ev(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,n;if(tC(t,this.left,this.right)&&tC(e,this.top,this.bottom)){for(i=0,n=this.legendHitBoxes;i-1?t.split("\n"):t}function n_(t,e){let i=t.chart.ctx,{body:r,footer:n,title:o}=t,{boxWidth:a,boxHeight:s}=e,l=ex(e.bodyFont),h=ex(e.titleFont),c=ex(e.footerFont),u=o.length,d=n.length,f=r.length,p=ev(e.padding),g=p.height,m=0,b=r.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(g+=u*h.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){let t=e.displayColors?Math.max(s,l.lineHeight):l.lineHeight;g+=f*t+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*c.lineHeight+(d-1)*e.footerSpacing);let y=0,v=function(t){m=Math.max(m,i.measureText(t).width+y)};return i.save(),i.font=h.string,K(t.title,v),i.font=l.string,K(t.beforeBody.concat(t.afterBody),v),y=e.displayColors?a+2+e.boxPadding:0,K(r,t=>{K(t.before,v),K(t.lines,v),K(t.after,v)}),y=0,i.font=c.string,K(t.footer,v),i.restore(),{width:m+=p.width,height:g}}function nw(t,e,i){let r=i.yAlign||e.yAlign||function(t,e){let{y:i,height:r}=e;return it.height-r/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||function(t,e,i,r){let{x:n,width:o}=i,{width:a,chartArea:{left:s,right:l}}=t,h="center";return"center"===r?h=n<=(s+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(t,e,i,r){let{x:n,width:o}=r,a=i.caretSize+i.caretPadding;if("left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0)return!0}(h,t,e,i)&&(h="center"),h}(t,e,i,r),yAlign:r}}function nS(t,e,i,r){let{caretSize:n,caretPadding:o,cornerRadius:a}=t,{xAlign:s,yAlign:l}=i,h=n+o,{topLeft:c,topRight:u,bottomLeft:d,bottomRight:f}=ey(a),p=function(t,e){let{x:i,width:r}=t;return"right"===e?i-=r:"center"===e&&(i-=r/2),i}(e,s),g=function(t,e,i){let{y:r,height:n}=t;return"top"===e?r+=i:"bottom"===e?r-=n+i:r-=n/2,r}(e,l,h);return"center"===l?"left"===s?p+=h:"right"===s&&(p-=h):"left"===s?p-=Math.max(c,d)+n:"right"===s&&(p+=Math.max(u,f)+n),{x:tR(p,0,r.width-e.width),y:tR(g,0,r.height-e.height)}}function nO(t,e,i){let r=ev(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-r.right:t.x+r.left}function nM(t,e){let i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}let nk={beforeTitle:z,title(t){if(t.length>0){let e=t[0],i=e.chart.data.labels,r=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex{let e={before:[],lines:[],after:[]},n=nM(i,t);nv(e.before,nx(nP(n,"beforeLabel",this,t))),nv(e.lines,nP(n,"label",this,t)),nv(e.after,nx(nP(n,"afterLabel",this,t))),r.push(e)}),r}getAfterBody(t,e){return nv([],nx(nP(e.callbacks,"afterBody",this,t)))}getFooter(t,e){let{callbacks:i}=e,r=nP(i,"beforeFooter",this,t),n=nP(i,"footer",this,t),o=nP(i,"afterFooter",this,t),a=[];return a=nv(a,nx(r)),a=nv(a,nx(n)),a=nv(a,nx(o))}_createItems(t){let e,i;let r=this._active,n=this.chart.data,o=[],a=[],s=[],l=[];for(e=0,i=r.length;et.filter(e,i,r,n))),t.itemSort&&(l=l.sort((e,i)=>t.itemSort(e,i,n))),K(l,e=>{let i=nM(t.callbacks,e);o.push(nP(i,"labelColor",this,e)),a.push(nP(i,"labelPointStyle",this,e)),s.push(nP(i,"labelTextColor",this,e))}),this.labelColors=o,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){let i;let r=this.options.setContext(this.getContext()),n=this._active,o=[];if(n.length){let t=ny[r.position].call(this,n,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);let e=this._size=n_(this,r),a=Object.assign({},t,e),s=nw(this.chart,r,a),l=nS(r,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){let n=this.getCaretPosition(t,i,r);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){let r,n,o,a,s,l;let{xAlign:h,yAlign:c}=this,{caretSize:u,cornerRadius:d}=i,{topLeft:f,topRight:p,bottomLeft:g,bottomRight:m}=ey(d),{x:b,y:y}=t,{width:v,height:x}=e;return"center"===c?(s=y+x/2,"left"===h?(n=(r=b)-u,a=s+u,l=s-u):(n=(r=b+v)+u,a=s-u,l=s+u),o=r):(n="left"===h?b+Math.max(f,g)+u:"right"===h?b+v-Math.max(p,m)-u:this.caretX,"top"===c?(s=(a=y)-u,r=n-u,o=n+u):(s=(a=y+x)+u,r=n+u,o=n-u),l=a),{x1:r,x2:n,x3:o,y1:a,y2:s,y3:l}}drawTitle(t,e,i){let r,n,o;let a=this.title,s=a.length;if(s){let l=e0(i.rtl,this.x,this.width);for(o=0,t.x=nO(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=ex(i.titleFont),n=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string;o0!==t)?(t.beginPath(),t.fillStyle=n.multiKeyBackground,ed(t,{x:e,y:f,w:l,h:s,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ed(t,{x:i,y:f+1,w:l-2,h:s-2,radius:a}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,f,l,s),t.strokeRect(e,f,l,s),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,s-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let r,n,o,a,s,l,h;let{body:c}=this,{bodySpacing:u,bodyAlign:d,displayColors:f,boxHeight:p,boxWidth:g,boxPadding:m}=i,b=ex(i.bodyFont),y=b.lineHeight,v=0,x=e0(i.rtl,this.x,this.width),_=function(i){e.fillText(i,x.x(t.x+v),t.y+y/2),t.y+=y+u},w=x.textAlign(d);for(e.textAlign=d,e.textBaseline="middle",e.font=b.string,t.x=nO(this,w,i),e.fillStyle=i.bodyColor,K(this.beforeBody,_),v=f&&"right"!==w?"center"===d?g/2+m:g+2+m:0,a=0,l=c.length;a0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,r=i&&i.x,n=i&&i.y;if(r||n){let i=ny[t.position].call(this,this._active,this._eventPosition);if(!i)return;let o=this._size=n_(this,t),a=Object.assign({},i,this._size),s=nw(e,t,a),l=nS(t,a,s,e);(r._to!==l.x||n._to!==l.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let r={width:this.width,height:this.height},n={x:this.x,y:this.y};i=.001>Math.abs(i)?0:i;let o=ev(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,r,e),e1(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),e2(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,r=t.map(({datasetIndex:t,index:e})=>{let i=this.chart.getDatasetMeta(t);if(!i)throw Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),n=!J(i,r),o=this._positionChanged(r,e);(n||o)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),a=this._positionChanged(o,t),s=e||!J(o,n)||a;return s&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}_getActiveElements(t,e,i,r){let n=this.options;if("mouseout"===t.type)return[];if(!r)return e;let o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){let{caretX:i,caretY:r,options:n}=this,o=ny[n.position].call(this,t,e);return!1!==o&&(i!==o.x||r!==o.y)}constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}}c(nE,"positioners",ny);var nA=/*#__PURE__*/Object.freeze({__proto__:null,Colors:{id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){let r;if(!i.enabled)return;let{data:{datasets:n},options:o}=t.config,{elements:a}=o;if(!i.forceOverride&&(r7(n)||o&&(o.borderColor||o.backgroundColor)||a&&r7(a)))return;let s=(r=0,(e,i)=>{var n,o,a;let s=t.getDatasetMeta(i).controller;s instanceof iM?(n=r,e.backgroundColor=e.data.map(()=>r4(n++)),r=n):s instanceof iP?(o=r,e.backgroundColor=e.data.map(()=>r9(o++)),r=o):s&&(a=r,e.borderColor=r4(a),e.backgroundColor=r9(a),r=++a)});n.forEach(s)}},Decimation:{id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled){ne(t);return}let r=t.width;t.data.datasets.forEach((e,n)=>{let o;let{_data:a,indexAxis:s}=e,l=t.getDatasetMeta(n),h=a||e.data;if("y"===e_([s,t.options.indexAxis])||!l.controller.supportsDecimation)return;let c=t.scales[l.xAxisID];if("linear"!==c.type&&"time"!==c.type||t.options.parsing)return;let{start:u,count:d}=function(t,e){let i;let r=e.length,n=0,{iScale:o}=t,{min:a,max:s,minDefined:l,maxDefined:h}=o.getUserBounds();return l&&(n=tR(tj(e,o.axis,a).lo,0,r-1)),i=h?tR(tj(e,o.axis,s).hi+1,n,r)-n:r-n,{start:n,count:i}}(l,h),f=i.threshold||4*r;if(d<=f){nt(e);return}switch(W(a)&&(e._data=h,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":o=function(t,e,i,r,n){let o,a,s,l,h;let c=n.samples||r;if(c>=i)return t.slice(e,e+i);let u=[],d=(i-2)/(c-2),f=0,p=e+i-1,g=e;for(o=0,u[f++]=t[g];os&&(s=l,a=t[r],h=r);u[f++]=a,g=h}return u[f++]=t[p],u}(h,u,d,r,i);break;case"min-max":o=function(t,e,i,r){let n,o,a,s,l,h,c,u,d,f,p=0,g=0,m=[],b=t[e].x,y=t[e+i-1].x,v=y-b;for(n=e;nf&&(f=s,c=n),p=(g*p+o.x)/++g;else{let i=n-1;if(!W(h)&&!W(c)){let e=Math.min(h,c),r=Math.max(h,c);e!==u&&e!==i&&m.push({...t[e],x:p}),r!==u&&r!==i&&m.push({...t[r],x:p})}n>0&&i!==u&&m.push(t[i]),m.push(o),l=e,g=0,d=f=s,h=c=u=n}}return m}(h,u,d,r);break;default:throw Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=o})},destroy(t){ne(t)}},Filler:{id:"filler",afterDatasetsUpdate(t,e,i){let r,n,o,a;let s=(t.data.datasets||[]).length,l=[];for(n=0;n=i)&&n):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}(o,n,s),chart:t,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=a,l.push(a);for(n=0;n=0;--e){let i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),r&&i.fill&&nl(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;let r=t.getSortedVisibleDatasetMetas();for(let e=r.length-1;e>=0;--e){let i=r[e].$filler;na(i)&&nl(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){let r=e.meta.$filler;na(r)&&"beforeDatasetDraw"===i.drawTime&&nl(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Legend:{id:"legend",_element:np,start(t,e,i){let r=t.legend=new np({ctx:t.ctx,options:i,chart:t});iG.configure(t,r,i),iG.addBox(t,r)},stop(t){iG.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){let r=t.legend;iG.configure(t,r,i),r.options=i},afterUpdate(t){let e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){let r=e.datasetIndex,n=i.chart;n.isDatasetVisible(r)?(n.hide(r),e.hidden=!0):(n.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){let e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:r,textAlign:n,color:o,useBorderRadius:a,borderRadius:s}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{let l=t.controller.getStyle(i?0:void 0),h=ev(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:a&&(s||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}},SubTitle:{id:"subtitle",start(t,e,i){let r=new nm({ctx:t.ctx,options:i,chart:t});iG.configure(t,r,i),iG.addBox(t,r),nb.set(t,r)},stop(t){iG.removeBox(t,nb.get(t)),nb.delete(t)},beforeUpdate(t,e,i){let r=nb.get(t);iG.configure(t,r,i),r.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Title:{id:"title",_element:nm,start(t,e,i){!function(t,e){let i=new nm({ctx:t.ctx,options:e,chart:t});iG.configure(t,i,e),iG.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){let e=t.titleBlock;iG.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){let r=t.titleBlock;iG.configure(t,r,i),r.options=i},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}},Tooltip:{id:"tooltip",_element:nE,positioners:ny,afterInit(t,e,i){i&&(t.tooltip=new nE({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){let e=t.tooltip;if(e&&e._willRender()){let i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){let i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:nk},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]}});let nD=(t,e,i,r)=>("string"==typeof e?(i=t.push(e)-1,r.unshift({index:i,label:e})):isNaN(e)&&(i=null),i),nT=(t,e)=>null===t?null:tR(Math.round(t),0,e);function nR(t){let e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}}function nI(t,e,{horizontal:i,minRotation:r}){let n=tM(r),o=.75*e*(""+t).length;return Math.min(e/((i?Math.sin(n):Math.cos(n))||.001),o)}c(nC,"id","category"),c(nC,"defaults",{ticks:{callback:nR}});class nj extends ru{parse(t,e){return W(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:r,max:n}=this,o=t=>r=e?r:t,a=t=>n=i?n:t;if(t){let t=tx(r),e=tx(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(r===n){let e=0===n?1:Math.abs(.05*n);a(n+e),t||o(r-e)}this.min=r,this.max=n}getTickLimit(){let t;let e=this.options.ticks,{maxTicksLimit:i,stepSize:r}=e;return r?(t=Math.ceil(this.max/r)-Math.floor(this.min/r)+1)>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3):(t=this.computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},n=this._range||this,o=function(t,e){let i,r,n,o;let a=[],{bounds:s,step:l,min:h,max:c,precision:u,count:d,maxTicks:f,maxDigits:p,includeBounds:g}=t,m=l||1,b=f-1,{min:y,max:v}=e,x=!W(h),_=!W(c),w=!W(d),S=(v-y)/(p+1),O=tw((v-y)/b/m)*m;if(O<1e-14&&!x&&!_)return[{value:y},{value:v}];(o=Math.ceil(v/O)-Math.floor(y/O))>b&&(O=tw(o*O/b/m)*m),W(u)||(O=Math.ceil(O*(i=Math.pow(10,u)))/i),"ticks"===s?(r=Math.floor(y/O)*O,n=Math.ceil(v/O)*O):(r=y,n=v),x&&_&&l&&function(t,e){let i=Math.round(t);return i-e<=t&&i+e>=t}((c-h)/l,O/1e3)?(o=Math.round(Math.min((c-h)/O,f)),O=(c-h)/o,r=h,n=c):w?(r=x?h:r,O=((n=_?c:n)-r)/(o=d-1)):o=t_(o=(n-r)/O,Math.round(o),O/1e3)?Math.round(o):Math.ceil(o);let M=Math.max(tk(O),tk(r));r=Math.round(r*(i=Math.pow(10,W(u)?M:u)))/i,n=Math.round(n*i)/i;let k=0;for(x&&(g&&r!==h?(a.push({value:h}),rc)break;a.push({value:t})}return _&&g&&n!==c?a.length&&t_(a[a.length-1].value,c,nI(c,S,t))?a[a.length-1].value=c:a.push({value:c}):_&&n!==c||a.push({value:n}),a}(r,n);return"ticks"===t.bounds&&tO(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return t5(t,this.chart.options.locale,this.options.ticks.format)}constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}}class nF extends nj{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?t:0,this.max=$(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=tM(this.options.ticks.minRotation),r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/((t?Math.sin(i):Math.cos(i))||.001)))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}c(nF,"id","linear"),c(nF,"defaults",{ticks:{callback:t6.formatters.numeric}});let nL=t=>Math.floor(tv(t)),nN=(t,e)=>Math.pow(10,nL(t)+e);function nB(t){let e=t/Math.pow(10,nL(t));return 1===e}function nz(t,e,i){let r=Math.pow(10,i);return Math.ceil(e/r)-Math.floor(t/r)}class nV extends ru{parse(t,e){let i=nj.prototype.parse.apply(this,[t,e]);if(0===i){this._zero=!0;return}return $(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?Math.max(0,t):null,this.max=$(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!$(this._userMin)&&(this.min=t===nN(this.min,0)?nN(this.min,-1):nN(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,r=this.max,n=e=>i=t?i:e,o=t=>r=e?r:t;i===r&&(i<=0?(n(1),o(10)):(n(nN(i,-1)),o(nN(r,1)))),i<=0&&n(nN(r,-1)),r<=0&&o(nN(i,1)),this.min=i,this.max=r}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=function(t,{min:e,max:i}){e=q(t.min,e);let r=[],n=nL(e),o=function(t,e){let i=e-t,r=nL(i);for(;nz(t,e,r)>10;)r++;for(;10>nz(t,e,r);)r--;return Math.min(r,nL(t))}(e,i),a=o<0?Math.pow(10,Math.abs(o)):1,s=Math.pow(10,o),l=n>o?Math.pow(10,n):0,h=Math.round((e-l)*a)/a,c=Math.floor((e-l)/s/10)*s*10,u=Math.floor((h-c)/Math.pow(10,o)),d=q(t.min,Math.round((l+c+u*Math.pow(10,o))*a)/a);for(;d=10?u=u<15?15:20:u++,u>=20&&(u=2,a=++o>=0?1:a),d=Math.round((l+c+u*Math.pow(10,o))*a)/a;let f=q(t.max,d);return r.push({value:f,major:nB(f),significand:u}),r}(e,this);return"ticks"===t.bounds&&tO(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return void 0===t?"0":t5(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=tv(t),this._valueRange=tv(this.max)-tv(t)}getPixelForValue(t){return((void 0===t||0===t)&&(t=this.min),null===t||isNaN(t))?NaN:this.getPixelForDecimal(t===this.min?0:(tv(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}}function nW(t){let e=t.ticks;if(e.display&&t.display){let t=ev(e.backdropPadding);return Y(e.font&&e.font.size,et.font.size)+t.height}return 0}function nH(t,e,i,r,n){return t===r||t===n?{start:e-i/2,end:e+i/2}:tn?{start:e-i,end:e}:{start:e,end:e+i}}function nU(t,e,i,r){let{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,td);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let o=1;o{let i=Z(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){let t=this.options;t.display&&t.pointLabels.display?function(t){let e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),r=[],n=[],o=t._pointLabels.length,a=t.options.pointLabels,s=a.centerPointLabels?tu/o:0;for(let c=0;ct.replace("rgb(","rgba(").replace(")",", 0.5)"));function r4(t){return r6[t%r6.length]}function r9(t){return r8[t%r8.length]}function r7(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function nt(t){if(t._decimated){let e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function ne(t){t.data.datasets.forEach(t=>{nt(t)})}function ni(t,e,i,r){if(r)return;let n=e[t],o=i[t];return"angle"===t&&(n=tT(n),o=tT(o)),{property:t,start:n,end:o}}function nr(t,e,i){for(;e>t;e--){let t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function nn(t,e,i,r){return t&&e?r(t[i],e[i]):t?t[i]:e?e[i]:0}function no(t,e){let i=[],r=!1;return H(t)?(r=!0,i=t):i=function(t,e){let{x:i=null,y:r=null}=t||{},n=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=nr(t,e,n);let a=n[t],s=n[e];null!==r?(o.push({x:a.x,y:r}),o.push({x:s.x,y:r})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:s.y}))}),o}(t,e),i.length?new rG({points:i,options:{tension:0},_loop:r,_fullLoop:r}):null}function na(t){return t&&!1!==t.fill}class ns{pathSegment(t,e,i){let{x:r,y:n,radius:o}=this;return e=e||{start:0,end:td},t.arc(r,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){let{x:e,y:i,radius:r}=this,n=t.angle;return{x:e+Math.cos(n)*r,y:i+Math.sin(n)*r,angle:n}}constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}}function nl(t,e,i){let r=function(t){let{chart:e,fill:i,line:r}=t;if($(i))return function(t,e){let i=t.getDatasetMeta(e),r=i&&t.isDatasetVisible(e);return r?i.dataset:null}(e,i);if("stack"===i)return function(t){let{scale:e,index:i,line:r}=t,n=[],o=r.segments,a=r.points,s=function(t,e){let i=[],r=t.getMatchingVisibleMetas("line");for(let t=0;t{let{boxHeight:i=e,boxWidth:r=e}=t;return t.usePointStyle&&(i=Math.min(i,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:i,itemHeight:Math.max(e,i)}},nf=(t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class np extends rr{update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=Z(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let t,e;let{options:i,ctx:r}=this;if(!i.display){this.width=this.height=0;return}let n=i.labels,o=ex(n.font),a=o.size,s=this._computeTitleHeight(),{boxWidth:l,itemHeight:h}=nd(n,a);r.font=o.string,this.isHorizontal()?(t=this.maxWidth,e=this._fitRows(s,a,l,h)+10):(e=this.maxHeight,t=this._fitCols(s,o,l,h)+10),this.width=Math.min(t,i.maxWidth||this.maxWidth),this.height=Math.min(e,i.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){let{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],h=r+a,c=t;n.textAlign="left",n.textBaseline="middle";let u=-1,d=-h;return this.legendItems.forEach((t,f)=>{let p=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+p+2*a>o)&&(c+=h,l[l.length-(f>0?0:1)]=0,d+=h,u++),s[f]={left:0,top:d,row:u,width:p,height:r},l[l.length-1]+=p+a}),c}_fitCols(t,e,i,r){let{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t,c=a,u=0,d=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{let{itemWidth:g,itemHeight:m}=function(t,e,i,r,n){var o;let a,s;let l=((a=r.text)&&"string"!=typeof a&&(a=a.reduce((t,e)=>t.length>e.length?t:e)),t+e.size/2+i.measureText(a).width),h=(o=e.lineHeight,s=n,"string"!=typeof r.text&&(s=ng(r,o)),s);return{itemWidth:l,itemHeight:h}}(i,e,n,t,r);o>0&&d+m+2*a>h&&(c+=u+a,l.push({width:u,height:d}),f+=u+a,p++,u=d=0),s[o]={left:f,top:d,col:p,width:g,height:m},u=Math.max(u,g),d+=m+a}),c+=u,l.push({width:u,height:d}),c}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:n}}=this,o=e0(n,this.left,this.width);if(this.isHorizontal()){let n=0,a=tH(i,this.left+r,this.right-this.lineWidths[n]);for(let s of e)n!==s.row&&(n=s.row,a=tH(i,this.left+r,this.right-this.lineWidths[n])),s.top+=this.top+t+r,s.left=o.leftForLtr(o.x(a),s.width),a+=s.width+r}else{let n=0,a=tH(i,this.top+t+r,this.bottom-this.columnSizes[n].height);for(let s of e)s.col!==n&&(n=s.col,a=tH(i,this.top+t+r,this.bottom-this.columnSizes[n].height)),s.top=a,s.left+=this.left+r,s.left=o.leftForLtr(o.x(s.left),s.width),a+=s.height+r}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){let t=this.ctx;es(t,this),this._draw(),el(t)}}_draw(){let t;let{options:e,columnSizes:i,lineWidths:r,ctx:n}=this,{align:o,labels:a}=e,s=et.color,l=e0(e.rtl,this.left,this.width),h=ex(a.font),{padding:c}=a,u=h.size,d=u/2;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=h.string;let{boxWidth:f,boxHeight:p,itemHeight:g}=nd(a,u),m=function(t,e,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;n.save();let r=Y(i.lineWidth,1);if(n.fillStyle=Y(i.fillStyle,s),n.lineCap=Y(i.lineCap,"butt"),n.lineDashOffset=Y(i.lineDashOffset,0),n.lineJoin=Y(i.lineJoin,"miter"),n.lineWidth=r,n.strokeStyle=Y(i.strokeStyle,s),n.setLineDash(Y(i.lineDash,[])),a.usePointStyle){let o={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:r},s=l.xPlus(t,f/2);eo(n,o,s,e+d,a.pointStyleWidth&&f)}else{let o=e+Math.max((u-p)/2,0),a=l.leftForLtr(t,f),s=ey(i.borderRadius);n.beginPath(),Object.values(s).some(t=>0!==t)?ed(n,{x:a,y:o,w:f,h:p,radius:s}):n.rect(a,o,f,p),n.fill(),0!==r&&n.stroke()}n.restore()},b=function(t,e,i){eu(n,i.text,t,e+g/2,h,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})},y=this.isHorizontal(),v=this._computeTitleHeight();t=y?{x:tH(o,this.left+c,this.right-r[0]),y:this.top+c+v,line:0}:{x:this.left+c,y:tH(o,this.top+v+c,this.bottom-i[0].height),line:0},e1(this.ctx,e.textDirection);let x=g+c;this.legendItems.forEach((s,u)=>{n.strokeStyle=s.fontColor,n.fillStyle=s.fontColor;let p=n.measureText(s.text).width,g=l.textAlign(s.textAlign||(s.textAlign=a.textAlign)),_=f+d+p,w=t.x,S=t.y;l.setWidth(this.width),y?u>0&&w+_+c>this.right&&(S=t.y+=x,t.line++,w=t.x=tH(o,this.left+c,this.right-r[t.line])):u>0&&S+x>this.bottom&&(w=t.x=w+i[t.line].width+c,t.line++,S=t.y=tH(o,this.top+v+c,this.bottom-i[t.line].height));let O=l.x(w);if(m(O,S,s),w=tU(g,w+f+d,y?w+_:this.right,e.rtl),b(l.x(w),S,s),y)t.x+=_+c;else if("string"!=typeof s.text){let e=h.lineHeight;t.y+=ng(s,e)+c}else t.y+=x}),e2(this.ctx,e.textDirection)}drawTitle(){let t;let e=this.options,i=e.title,r=ex(i.font),n=ev(i.padding);if(!i.display)return;let o=e0(e.rtl,this.left,this.width),a=this.ctx,s=i.position,l=r.size/2,h=n.top+l,c=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),t=this.top+h,c=tH(e.align,c,this.right-u);else{let i=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);t=h+tH(e.align,this.top,this.bottom-i-e.labels.padding-this._computeTitleHeight())}let d=tH(s,c,c+u);a.textAlign=o.textAlign(tW(s)),a.textBaseline="middle",a.strokeStyle=i.color,a.fillStyle=i.color,a.font=r.string,eu(a,i.text,d,t,r)}_computeTitleHeight(){let t=this.options.title,e=ex(t.font),i=ev(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,n;if(tI(t,this.left,this.right)&&tI(e,this.top,this.bottom)){for(i=0,n=this.legendHitBoxes;i-1?t.split("\n"):t}function n_(t,e){let i=t.chart.ctx,{body:r,footer:n,title:o}=t,{boxWidth:a,boxHeight:s}=e,l=ex(e.bodyFont),h=ex(e.titleFont),c=ex(e.footerFont),u=o.length,d=n.length,f=r.length,p=ev(e.padding),g=p.height,m=0,b=r.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(g+=u*h.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){let t=e.displayColors?Math.max(s,l.lineHeight):l.lineHeight;g+=f*t+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*c.lineHeight+(d-1)*e.footerSpacing);let y=0,v=function(t){m=Math.max(m,i.measureText(t).width+y)};return i.save(),i.font=h.string,K(t.title,v),i.font=l.string,K(t.beforeBody.concat(t.afterBody),v),y=e.displayColors?a+2+e.boxPadding:0,K(r,t=>{K(t.before,v),K(t.lines,v),K(t.after,v)}),y=0,i.font=c.string,K(t.footer,v),i.restore(),{width:m+=p.width,height:g}}function nw(t,e,i){let r=i.yAlign||e.yAlign||function(t,e){let{y:i,height:r}=e;return it.height-r/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||function(t,e,i,r){let{x:n,width:o}=i,{width:a,chartArea:{left:s,right:l}}=t,h="center";return"center"===r?h=n<=(s+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(t,e,i,r){let{x:n,width:o}=r,a=i.caretSize+i.caretPadding;if("left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0)return!0}(h,t,e,i)&&(h="center"),h}(t,e,i,r),yAlign:r}}function nS(t,e,i,r){let{caretSize:n,caretPadding:o,cornerRadius:a}=t,{xAlign:s,yAlign:l}=i,h=n+o,{topLeft:c,topRight:u,bottomLeft:d,bottomRight:f}=ey(a),p=function(t,e){let{x:i,width:r}=t;return"right"===e?i-=r:"center"===e&&(i-=r/2),i}(e,s),g=function(t,e,i){let{y:r,height:n}=t;return"top"===e?r+=i:"bottom"===e?r-=n+i:r-=n/2,r}(e,l,h);return"center"===l?"left"===s?p+=h:"right"===s&&(p-=h):"left"===s?p-=Math.max(c,d)+n:"right"===s&&(p+=Math.max(u,f)+n),{x:tR(p,0,r.width-e.width),y:tR(g,0,r.height-e.height)}}function nO(t,e,i){let r=ev(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-r.right:t.x+r.left}function nM(t,e){let i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}let nk={beforeTitle:z,title(t){if(t.length>0){let e=t[0],i=e.chart.data.labels,r=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex{let e={before:[],lines:[],after:[]},n=nM(i,t);nv(e.before,nx(nP(n,"beforeLabel",this,t))),nv(e.lines,nP(n,"label",this,t)),nv(e.after,nx(nP(n,"afterLabel",this,t))),r.push(e)}),r}getAfterBody(t,e){return nv([],nx(nP(e.callbacks,"afterBody",this,t)))}getFooter(t,e){let{callbacks:i}=e,r=nP(i,"beforeFooter",this,t),n=nP(i,"footer",this,t),o=nP(i,"afterFooter",this,t),a=[];return a=nv(a,nx(r)),a=nv(a,nx(n)),a=nv(a,nx(o))}_createItems(t){let e,i;let r=this._active,n=this.chart.data,o=[],a=[],s=[],l=[];for(e=0,i=r.length;et.filter(e,i,r,n))),t.itemSort&&(l=l.sort((e,i)=>t.itemSort(e,i,n))),K(l,e=>{let i=nM(t.callbacks,e);o.push(nP(i,"labelColor",this,e)),a.push(nP(i,"labelPointStyle",this,e)),s.push(nP(i,"labelTextColor",this,e))}),this.labelColors=o,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){let i;let r=this.options.setContext(this.getContext()),n=this._active,o=[];if(n.length){let t=ny[r.position].call(this,n,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);let e=this._size=n_(this,r),a=Object.assign({},t,e),s=nw(this.chart,r,a),l=nS(r,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){let n=this.getCaretPosition(t,i,r);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){let r,n,o,a,s,l;let{xAlign:h,yAlign:c}=this,{caretSize:u,cornerRadius:d}=i,{topLeft:f,topRight:p,bottomLeft:g,bottomRight:m}=ey(d),{x:b,y:y}=t,{width:v,height:x}=e;return"center"===c?(s=y+x/2,"left"===h?(n=(r=b)-u,a=s+u,l=s-u):(n=(r=b+v)+u,a=s-u,l=s+u),o=r):(n="left"===h?b+Math.max(f,g)+u:"right"===h?b+v-Math.max(p,m)-u:this.caretX,"top"===c?(s=(a=y)-u,r=n-u,o=n+u):(s=(a=y+x)+u,r=n+u,o=n-u),l=a),{x1:r,x2:n,x3:o,y1:a,y2:s,y3:l}}drawTitle(t,e,i){let r,n,o;let a=this.title,s=a.length;if(s){let l=e0(i.rtl,this.x,this.width);for(o=0,t.x=nO(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=ex(i.titleFont),n=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string;o0!==t)?(t.beginPath(),t.fillStyle=n.multiKeyBackground,ed(t,{x:e,y:f,w:l,h:s,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ed(t,{x:i,y:f+1,w:l-2,h:s-2,radius:a}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,f,l,s),t.strokeRect(e,f,l,s),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,s-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let r,n,o,a,s,l,h;let{body:c}=this,{bodySpacing:u,bodyAlign:d,displayColors:f,boxHeight:p,boxWidth:g,boxPadding:m}=i,b=ex(i.bodyFont),y=b.lineHeight,v=0,x=e0(i.rtl,this.x,this.width),_=function(i){e.fillText(i,x.x(t.x+v),t.y+y/2),t.y+=y+u},w=x.textAlign(d);for(e.textAlign=d,e.textBaseline="middle",e.font=b.string,t.x=nO(this,w,i),e.fillStyle=i.bodyColor,K(this.beforeBody,_),v=f&&"right"!==w?"center"===d?g/2+m:g+2+m:0,a=0,l=c.length;a0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,r=i&&i.x,n=i&&i.y;if(r||n){let i=ny[t.position].call(this,this._active,this._eventPosition);if(!i)return;let o=this._size=n_(this,t),a=Object.assign({},i,this._size),s=nw(e,t,a),l=nS(t,a,s,e);(r._to!==l.x||n._to!==l.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let r={width:this.width,height:this.height},n={x:this.x,y:this.y};i=.001>Math.abs(i)?0:i;let o=ev(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,r,e),e1(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),e2(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,r=t.map(({datasetIndex:t,index:e})=>{let i=this.chart.getDatasetMeta(t);if(!i)throw Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),n=!J(i,r),o=this._positionChanged(r,e);(n||o)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),a=this._positionChanged(o,t),s=e||!J(o,n)||a;return s&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}_getActiveElements(t,e,i,r){let n=this.options;if("mouseout"===t.type)return[];if(!r)return e;let o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){let{caretX:i,caretY:r,options:n}=this,o=ny[n.position].call(this,t,e);return!1!==o&&(i!==o.x||r!==o.y)}constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}}c(nE,"positioners",ny);var nA=/*#__PURE__*/Object.freeze({__proto__:null,Colors:{id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){let r;if(!i.enabled)return;let{data:{datasets:n},options:o}=t.config,{elements:a}=o;if(!i.forceOverride&&(r7(n)||o&&(o.borderColor||o.backgroundColor)||a&&r7(a)))return;let s=(r=0,(e,i)=>{var n,o,a;let s=t.getDatasetMeta(i).controller;s instanceof iM?(n=r,e.backgroundColor=e.data.map(()=>r4(n++)),r=n):s instanceof iP?(o=r,e.backgroundColor=e.data.map(()=>r9(o++)),r=o):s&&(a=r,e.borderColor=r4(a),e.backgroundColor=r9(a),r=++a)});n.forEach(s)}},Decimation:{id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled){ne(t);return}let r=t.width;t.data.datasets.forEach((e,n)=>{let o;let{_data:a,indexAxis:s}=e,l=t.getDatasetMeta(n),h=a||e.data;if("y"===e_([s,t.options.indexAxis])||!l.controller.supportsDecimation)return;let c=t.scales[l.xAxisID];if("linear"!==c.type&&"time"!==c.type||t.options.parsing)return;let{start:u,count:d}=function(t,e){let i;let r=e.length,n=0,{iScale:o}=t,{min:a,max:s,minDefined:l,maxDefined:h}=o.getUserBounds();return l&&(n=tR(tj(e,o.axis,a).lo,0,r-1)),i=h?tR(tj(e,o.axis,s).hi+1,n,r)-n:r-n,{start:n,count:i}}(l,h),f=i.threshold||4*r;if(d<=f){nt(e);return}switch(W(a)&&(e._data=h,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":o=function(t,e,i,r,n){let o,a,s,l,h;let c=n.samples||r;if(c>=i)return t.slice(e,e+i);let u=[],d=(i-2)/(c-2),f=0,p=e+i-1,g=e;for(o=0,u[f++]=t[g];os&&(s=l,a=t[r],h=r);u[f++]=a,g=h}return u[f++]=t[p],u}(h,u,d,r,i);break;case"min-max":o=function(t,e,i,r){let n,o,a,s,l,h,c,u,d,f,p=0,g=0,m=[],b=t[e].x,y=t[e+i-1].x,v=y-b;for(n=e;nf&&(f=s,c=n),p=(g*p+o.x)/++g;else{let i=n-1;if(!W(h)&&!W(c)){let e=Math.min(h,c),r=Math.max(h,c);e!==u&&e!==i&&m.push({...t[e],x:p}),r!==u&&r!==i&&m.push({...t[r],x:p})}n>0&&i!==u&&m.push(t[i]),m.push(o),l=e,g=0,d=f=s,h=c=u=n}}return m}(h,u,d,r);break;default:throw Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=o})},destroy(t){ne(t)}},Filler:{id:"filler",afterDatasetsUpdate(t,e,i){let r,n,o,a;let s=(t.data.datasets||[]).length,l=[];for(n=0;n=i)&&n):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}(o,n,s),chart:t,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=a,l.push(a);for(n=0;n=0;--e){let i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),r&&i.fill&&nl(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;let r=t.getSortedVisibleDatasetMetas();for(let e=r.length-1;e>=0;--e){let i=r[e].$filler;na(i)&&nl(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){let r=e.meta.$filler;na(r)&&"beforeDatasetDraw"===i.drawTime&&nl(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Legend:{id:"legend",_element:np,start(t,e,i){let r=t.legend=new np({ctx:t.ctx,options:i,chart:t});iG.configure(t,r,i),iG.addBox(t,r)},stop(t){iG.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){let r=t.legend;iG.configure(t,r,i),r.options=i},afterUpdate(t){let e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){let r=e.datasetIndex,n=i.chart;n.isDatasetVisible(r)?(n.hide(r),e.hidden=!0):(n.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){let e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:r,textAlign:n,color:o,useBorderRadius:a,borderRadius:s}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{let l=t.controller.getStyle(i?0:void 0),h=ev(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:a&&(s||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}},SubTitle:{id:"subtitle",start(t,e,i){let r=new nm({ctx:t.ctx,options:i,chart:t});iG.configure(t,r,i),iG.addBox(t,r),nb.set(t,r)},stop(t){iG.removeBox(t,nb.get(t)),nb.delete(t)},beforeUpdate(t,e,i){let r=nb.get(t);iG.configure(t,r,i),r.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Title:{id:"title",_element:nm,start(t,e,i){!function(t,e){let i=new nm({ctx:t.ctx,options:e,chart:t});iG.configure(t,i,e),iG.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){let e=t.titleBlock;iG.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){let r=t.titleBlock;iG.configure(t,r,i),r.options=i},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}},Tooltip:{id:"tooltip",_element:nE,positioners:ny,afterInit(t,e,i){i&&(t.tooltip=new nE({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){let e=t.tooltip;if(e&&e._willRender()){let i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){let i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:nk},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]}});let nT=(t,e,i,r)=>("string"==typeof e?(i=t.push(e)-1,r.unshift({index:i,label:e})):isNaN(e)&&(i=null),i),nD=(t,e)=>null===t?null:tR(Math.round(t),0,e);function nR(t){let e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}}function nC(t,e,{horizontal:i,minRotation:r}){let n=tM(r),o=.75*e*(""+t).length;return Math.min(e/((i?Math.sin(n):Math.cos(n))||.001),o)}c(nI,"id","category"),c(nI,"defaults",{ticks:{callback:nR}});class nj extends ru{parse(t,e){return W(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:r,max:n}=this,o=t=>r=e?r:t,a=t=>n=i?n:t;if(t){let t=tx(r),e=tx(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(r===n){let e=0===n?1:Math.abs(.05*n);a(n+e),t||o(r-e)}this.min=r,this.max=n}getTickLimit(){let t;let e=this.options.ticks,{maxTicksLimit:i,stepSize:r}=e;return r?(t=Math.ceil(this.max/r)-Math.floor(this.min/r)+1)>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3):(t=this.computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},n=this._range||this,o=function(t,e){let i,r,n,o;let a=[],{bounds:s,step:l,min:h,max:c,precision:u,count:d,maxTicks:f,maxDigits:p,includeBounds:g}=t,m=l||1,b=f-1,{min:y,max:v}=e,x=!W(h),_=!W(c),w=!W(d),S=(v-y)/(p+1),O=tw((v-y)/b/m)*m;if(O<1e-14&&!x&&!_)return[{value:y},{value:v}];(o=Math.ceil(v/O)-Math.floor(y/O))>b&&(O=tw(o*O/b/m)*m),W(u)||(O=Math.ceil(O*(i=Math.pow(10,u)))/i),"ticks"===s?(r=Math.floor(y/O)*O,n=Math.ceil(v/O)*O):(r=y,n=v),x&&_&&l&&function(t,e){let i=Math.round(t);return i-e<=t&&i+e>=t}((c-h)/l,O/1e3)?(o=Math.round(Math.min((c-h)/O,f)),O=(c-h)/o,r=h,n=c):w?(r=x?h:r,O=((n=_?c:n)-r)/(o=d-1)):o=t_(o=(n-r)/O,Math.round(o),O/1e3)?Math.round(o):Math.ceil(o);let M=Math.max(tk(O),tk(r));r=Math.round(r*(i=Math.pow(10,W(u)?M:u)))/i,n=Math.round(n*i)/i;let k=0;for(x&&(g&&r!==h?(a.push({value:h}),rc)break;a.push({value:t})}return _&&g&&n!==c?a.length&&t_(a[a.length-1].value,c,nC(c,S,t))?a[a.length-1].value=c:a.push({value:c}):_&&n!==c||a.push({value:n}),a}(r,n);return"ticks"===t.bounds&&tO(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return t5(t,this.chart.options.locale,this.options.ticks.format)}constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}}class nF extends nj{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?t:0,this.max=$(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=tM(this.options.ticks.minRotation),r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/((t?Math.sin(i):Math.cos(i))||.001)))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}c(nF,"id","linear"),c(nF,"defaults",{ticks:{callback:t6.formatters.numeric}});let nL=t=>Math.floor(tv(t)),nN=(t,e)=>Math.pow(10,nL(t)+e);function nB(t){let e=t/Math.pow(10,nL(t));return 1===e}function nz(t,e,i){let r=Math.pow(10,i);return Math.ceil(e/r)-Math.floor(t/r)}class nV extends ru{parse(t,e){let i=nj.prototype.parse.apply(this,[t,e]);if(0===i){this._zero=!0;return}return $(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?Math.max(0,t):null,this.max=$(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!$(this._userMin)&&(this.min=t===nN(this.min,0)?nN(this.min,-1):nN(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,r=this.max,n=e=>i=t?i:e,o=t=>r=e?r:t;i===r&&(i<=0?(n(1),o(10)):(n(nN(i,-1)),o(nN(r,1)))),i<=0&&n(nN(r,-1)),r<=0&&o(nN(i,1)),this.min=i,this.max=r}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=function(t,{min:e,max:i}){e=q(t.min,e);let r=[],n=nL(e),o=function(t,e){let i=e-t,r=nL(i);for(;nz(t,e,r)>10;)r++;for(;10>nz(t,e,r);)r--;return Math.min(r,nL(t))}(e,i),a=o<0?Math.pow(10,Math.abs(o)):1,s=Math.pow(10,o),l=n>o?Math.pow(10,n):0,h=Math.round((e-l)*a)/a,c=Math.floor((e-l)/s/10)*s*10,u=Math.floor((h-c)/Math.pow(10,o)),d=q(t.min,Math.round((l+c+u*Math.pow(10,o))*a)/a);for(;d=10?u=u<15?15:20:u++,u>=20&&(u=2,a=++o>=0?1:a),d=Math.round((l+c+u*Math.pow(10,o))*a)/a;let f=q(t.max,d);return r.push({value:f,major:nB(f),significand:u}),r}(e,this);return"ticks"===t.bounds&&tO(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return void 0===t?"0":t5(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=tv(t),this._valueRange=tv(this.max)-tv(t)}getPixelForValue(t){return((void 0===t||0===t)&&(t=this.min),null===t||isNaN(t))?NaN:this.getPixelForDecimal(t===this.min?0:(tv(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}}function nW(t){let e=t.ticks;if(e.display&&t.display){let t=ev(e.backdropPadding);return Y(e.font&&e.font.size,et.font.size)+t.height}return 0}function nH(t,e,i,r,n){return t===r||t===n?{start:e-i/2,end:e+i/2}:tn?{start:e-i,end:e}:{start:e,end:e+i}}function nU(t,e,i,r){let{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,td);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let o=1;o{let i=Z(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){let t=this.options;t.display&&t.pointLabels.display?function(t){let e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),r=[],n=[],o=t._pointLabels.length,a=t.options.pointLabels,s=a.centerPointLabels?tu/o:0;for(let c=0;ci.length){for(n=0;ne.r&&(s=(r.end-e.r)/o,t.r=Math.max(t.r,e.r+s)),n.starte.b&&(l=(n.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}(i,e,p,m,b)}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){let r;let n=[],o=t._pointLabels.length,a=t.options,{centerPointLabels:s,display:l}=a.pointLabels,h={extra:nW(a)/2,additionalAngle:s?tu/o:0};for(let a=0;a270||f<90)&&(r-=n),r),g=0===f||180===f?"center":f<180?"left":"right",m=(o=d.x,a=u.w,"right"===g?o-=a:"center"===g&&(o-=a/2),o);return{visible:!0,x:d.x,y:p,textAlign:g,left:m,top:p,right:m+u.w,bottom:p+u.h}}(t,a,h);n.push(o),"auto"===l&&(o.visible=function(t,e){if(!e)return!0;let{left:i,top:r,right:n,bottom:o}=t,a=ea({x:i,y:r},e)||ea({x:i,y:o},e)||ea({x:n,y:r},e)||ea({x:n,y:o},e);return!a}(o,r),o.visible&&(r=o))}return n}(t,r,n)}(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){let e=td/(this._pointLabels.length||1),i=this.options.startAngle||0;return tD(t*e+tM(i))}getDistanceFromCenterForValue(t){if(W(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(W(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t=0;n--){let e=t._pointLabelItems[n];if(!e.visible)continue;let o=r.setContext(t.getPointLabelContext(n));!function(t,e,i){let{left:r,top:n,right:o,bottom:a}=i,{backdropColor:s}=e;if(!W(s)){let i=ey(e.borderRadius),l=ev(e.backdropPadding);t.fillStyle=s;let h=r-l.left,c=n-l.top,u=o-r+l.width,d=a-n+l.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),ed(t,{x:h,y:c,w:u,h:d,radius:i}),t.fill()):t.fillRect(h,c,u,d)}}(i,o,e);let a=ex(o.font),{x:s,y:l,textAlign:h}=e;eu(i,t._pointLabels[n],s,l+a.lineHeight/2,a,{color:o.color,textAlign:h,textBaseline:"middle"})}}(this,l),a.display&&this.ticks.forEach((t,i)=>{if(0!==i){e=this.getDistanceFromCenterForValue(t.value);let r=this.getContext(i),n=a.setContext(r),o=s.setContext(r);!function(t,e,i,r,n){let o=t.ctx,a=e.circular,{color:s,lineWidth:l}=e;(a||r)&&s&&l&&!(i<0)&&(o.save(),o.strokeStyle=s,o.lineWidth=l,o.setLineDash(n.dash),o.lineDashOffset=n.dashOffset,o.beginPath(),nU(t,i,a,r),o.closePath(),o.stroke(),o.restore())}(this,n,e,l,o)}}),o.display){for(r.save(),t=l-1;t>=0;t--){let a=o.setContext(this.getPointLabelContext(t)),{color:s,lineWidth:l}=a;l&&s&&(r.lineWidth=l,r.strokeStyle=s,r.setLineDash(a.borderDash),r.lineDashOffset=a.borderDashOffset,e=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),i=this.getPointPosition(t,e),r.beginPath(),r.moveTo(this.xCenter,this.yCenter),r.lineTo(i.x,i.y),r.stroke())}r.restore()}}drawBorder(){}drawLabels(){let t,e;let i=this.ctx,r=this.options,n=r.ticks;if(!n.display)return;let o=this.getIndexAngle(0);i.save(),i.translate(this.xCenter,this.yCenter),i.rotate(o),i.textAlign="center",i.textBaseline="middle",this.ticks.forEach((o,a)=>{if(0===a&&!r.reverse)return;let s=n.setContext(this.getContext(a)),l=ex(s.font);if(t=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){i.font=l.string,e=i.measureText(o.label).width,i.fillStyle=s.backdropColor;let r=ev(s.backdropPadding);i.fillRect(-e/2-r.left,-t-l.size/2-r.top,e+r.width,l.size+r.height)}eu(i,o.label,0,-t,l,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),i.restore()}drawTitle(){}constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}}c(n$,"id","radialLinear"),c(n$,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:t6.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}}),c(n$,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),c(n$,"descriptors",{angleLines:{_fallback:"grid"}});let nq={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}},nY=/* #__PURE__ */Object.keys(nq);function nX(t,e){return t-e}function nG(t,e){if(W(e))return null;let i=t._adapter,{parser:r,round:n,isoWeekday:o}=t._parseOpts,a=e;return("function"==typeof r&&(a=r(a)),$(a)||(a="string"==typeof r?i.parse(a,r):i.parse(a)),null===a)?null:(n&&(a="week"===n&&(tS(o)||!0===o)?i.startOf(a,"isoWeek",o):i.startOf(a,n)),+a)}function nZ(t,e,i,r){let n=nY.length;for(let o=nY.indexOf(t);o=e?i[r]:i[n];t[o]=!0}}else t[e]=!0}function nJ(t,e,i){let r,n;let o=[],a={},s=e.length;for(r=0;r=0&&(e[o].major=!0);return e}(t,o,a,i):o}class nQ extends ru{init(t,e={}){let i=t.time||(t.time={}),r=this._adapter=new iI._date(t.adapters.date);r.init(e),tr(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:nG(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:r,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();function s(t){o||isNaN(t.min)||(r=Math.min(r,t.min)),a||isNaN(t.max)||(n=Math.max(n,t.max))}o&&a||(s(this._getLabelBounds()),("ticks"!==t.bounds||"labels"!==t.ticks.source)&&s(this.getMinMax(!1))),r=$(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),n=$(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,n-1),this.max=Math.max(r+1,n)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let t=this.options,e=t.time,i=t.ticks,r="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);let n=this.min,o=this.max,a=/** +null==(l=s[o])||H(l)||(u=ee(t,h,c,u,l))}else u=ee(t,h,c,u,s);t.restore();let f=c.length/2;if(f>i.length){for(n=0;ne.r&&(s=(r.end-e.r)/o,t.r=Math.max(t.r,e.r+s)),n.starte.b&&(l=(n.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}(i,e,p,m,b)}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){let r;let n=[],o=t._pointLabels.length,a=t.options,{centerPointLabels:s,display:l}=a.pointLabels,h={extra:nW(a)/2,additionalAngle:s?tu/o:0};for(let a=0;a270||f<90)&&(r-=n),r),g=0===f||180===f?"center":f<180?"left":"right",m=(o=d.x,a=u.w,"right"===g?o-=a:"center"===g&&(o-=a/2),o);return{visible:!0,x:d.x,y:p,textAlign:g,left:m,top:p,right:m+u.w,bottom:p+u.h}}(t,a,h);n.push(o),"auto"===l&&(o.visible=function(t,e){if(!e)return!0;let{left:i,top:r,right:n,bottom:o}=t,a=ea({x:i,y:r},e)||ea({x:i,y:o},e)||ea({x:n,y:r},e)||ea({x:n,y:o},e);return!a}(o,r),o.visible&&(r=o))}return n}(t,r,n)}(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){let e=td/(this._pointLabels.length||1),i=this.options.startAngle||0;return tT(t*e+tM(i))}getDistanceFromCenterForValue(t){if(W(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(W(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t=0;n--){let e=t._pointLabelItems[n];if(!e.visible)continue;let o=r.setContext(t.getPointLabelContext(n));!function(t,e,i){let{left:r,top:n,right:o,bottom:a}=i,{backdropColor:s}=e;if(!W(s)){let i=ey(e.borderRadius),l=ev(e.backdropPadding);t.fillStyle=s;let h=r-l.left,c=n-l.top,u=o-r+l.width,d=a-n+l.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),ed(t,{x:h,y:c,w:u,h:d,radius:i}),t.fill()):t.fillRect(h,c,u,d)}}(i,o,e);let a=ex(o.font),{x:s,y:l,textAlign:h}=e;eu(i,t._pointLabels[n],s,l+a.lineHeight/2,a,{color:o.color,textAlign:h,textBaseline:"middle"})}}(this,l),a.display&&this.ticks.forEach((t,i)=>{if(0!==i){e=this.getDistanceFromCenterForValue(t.value);let r=this.getContext(i),n=a.setContext(r),o=s.setContext(r);!function(t,e,i,r,n){let o=t.ctx,a=e.circular,{color:s,lineWidth:l}=e;(a||r)&&s&&l&&!(i<0)&&(o.save(),o.strokeStyle=s,o.lineWidth=l,o.setLineDash(n.dash),o.lineDashOffset=n.dashOffset,o.beginPath(),nU(t,i,a,r),o.closePath(),o.stroke(),o.restore())}(this,n,e,l,o)}}),o.display){for(r.save(),t=l-1;t>=0;t--){let a=o.setContext(this.getPointLabelContext(t)),{color:s,lineWidth:l}=a;l&&s&&(r.lineWidth=l,r.strokeStyle=s,r.setLineDash(a.borderDash),r.lineDashOffset=a.borderDashOffset,e=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),i=this.getPointPosition(t,e),r.beginPath(),r.moveTo(this.xCenter,this.yCenter),r.lineTo(i.x,i.y),r.stroke())}r.restore()}}drawBorder(){}drawLabels(){let t,e;let i=this.ctx,r=this.options,n=r.ticks;if(!n.display)return;let o=this.getIndexAngle(0);i.save(),i.translate(this.xCenter,this.yCenter),i.rotate(o),i.textAlign="center",i.textBaseline="middle",this.ticks.forEach((o,a)=>{if(0===a&&!r.reverse)return;let s=n.setContext(this.getContext(a)),l=ex(s.font);if(t=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){i.font=l.string,e=i.measureText(o.label).width,i.fillStyle=s.backdropColor;let r=ev(s.backdropPadding);i.fillRect(-e/2-r.left,-t-l.size/2-r.top,e+r.width,l.size+r.height)}eu(i,o.label,0,-t,l,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),i.restore()}drawTitle(){}constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}}c(n$,"id","radialLinear"),c(n$,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:t6.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}}),c(n$,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),c(n$,"descriptors",{angleLines:{_fallback:"grid"}});let nq={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}},nY=/* #__PURE__ */Object.keys(nq);function nX(t,e){return t-e}function nG(t,e){if(W(e))return null;let i=t._adapter,{parser:r,round:n,isoWeekday:o}=t._parseOpts,a=e;return("function"==typeof r&&(a=r(a)),$(a)||(a="string"==typeof r?i.parse(a,r):i.parse(a)),null===a)?null:(n&&(a="week"===n&&(tS(o)||!0===o)?i.startOf(a,"isoWeek",o):i.startOf(a,n)),+a)}function nZ(t,e,i,r){let n=nY.length;for(let o=nY.indexOf(t);o=e?i[r]:i[n];t[o]=!0}}else t[e]=!0}function nJ(t,e,i){let r,n;let o=[],a={},s=e.length;for(r=0;r=0&&(e[o].major=!0);return e}(t,o,a,i):o}class nQ extends ru{init(t,e={}){let i=t.time||(t.time={}),r=this._adapter=new iC._date(t.adapters.date);r.init(e),tr(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:nG(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:r,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();function s(t){o||isNaN(t.min)||(r=Math.min(r,t.min)),a||isNaN(t.max)||(n=Math.max(n,t.max))}o&&a||(s(this._getLabelBounds()),("ticks"!==t.bounds||"labels"!==t.ticks.source)&&s(this.getMinMax(!1))),r=$(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),n=$(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,n-1),this.max=Math.max(r+1,n)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let t=this.options,e=t.time,i=t.ticks,r="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);let n=this.min,o=this.max,a=/** * Return subset of `values` between `min` and `max` inclusive. * Values are assumed to be in sorted order. * @param values - sorted array of values * @param min - min value * @param max - max value - */function(t,e,i){let r=0,n=t.length;for(;rr&&t[n-1]>i;)n--;return r>0||n=nY.indexOf(i);o--){let i=nY[o];if(nq[i].common&&t._adapter.diff(n,r,i)>=e-1)return i}return nY[i?nY.indexOf(i):0]}(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=nY.indexOf(t)+1,i=nY.length;e+t.value))}initOffsets(t=[]){let e,i,r=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),r=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);let o=t.length<3?.5:.25;r=tR(r,0,o),n=tR(n,0,o),this._offsets={start:r,end:n,factor:1/(r+1+n)}}_generate(){let t,e;let i=this._adapter,r=this.min,n=this.max,o=this.options,a=o.time,s=a.unit||nZ(a.minUnit,r,n,this._getLabelCapacity(r)),l=Y(o.ticks.stepSize,1),h="week"===s&&a.isoWeekday,c=tS(h)||!0===h,u={},d=r;if(c&&(d=+i.startOf(d,"isoWeek",h)),d=+i.startOf(d,c?"day":s),i.diff(n,r,s)>1e5*l)throw Error(r+" and "+n+" are too far apart with stepSize of "+l+" "+s);let f="data"===o.ticks.source&&this.getDataTimestamps();for(t=d,e=0;t+t)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){let i=this.options,r=i.time.displayFormats,n=this._unit,o=e||r[n];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,r){let n=this.options,o=n.ticks.callback;if(o)return Z(o,[t,e,i],this);let a=n.time.displayFormats,s=this._unit,l=this._majorUnit,h=s&&a[s],c=l&&a[l],u=i[e],d=l&&c&&u&&u.major;return this._adapter.format(t,r||(d?c:h))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,e=r.length;t=t[s].pos&&e<=t[l].pos&&({lo:s,hi:l}=tj(t,"pos",e)),{pos:r,time:o}=t[s],{pos:n,time:a}=t[l]):(e>=t[s].time&&e<=t[l].time&&({lo:s,hi:l}=tj(t,"time",e)),{time:r,pos:o}=t[s],{time:n,pos:a}=t[l]);let h=n-r;return h?o+(a-o)*(e-r)/h:o}c(nQ,"id","time"),c(nQ,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});class n1 extends nQ{initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=n0(e,this.min),this._tableRange=n0(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let e,i,r;let{min:n,max:o}=this,a=[],s=[];for(e=0,i=t.length;e=n&&r<=o&&a.push(r);if(a.length<2)return[{time:n,pos:0},{time:o,pos:1}];for(e=0,i=a.length;et-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t}getDecimalForValue(t){return(n0(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return n0(this._table,i*this._tableRange+this._minPos,!0)}constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}}c(n1,"id","timeseries"),c(n1,"defaults",nQ.defaults);var n2=/*#__PURE__*/Object.freeze({__proto__:null,CategoryScale:nC,LinearScale:nF,LogarithmicScale:nV,RadialLinearScale:n$,TimeScale:nQ,TimeSeriesScale:n1});/**! + */function(t,e,i){let r=0,n=t.length;for(;rr&&t[n-1]>i;)n--;return r>0||n=nY.indexOf(i);o--){let i=nY[o];if(nq[i].common&&t._adapter.diff(n,r,i)>=e-1)return i}return nY[i?nY.indexOf(i):0]}(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=nY.indexOf(t)+1,i=nY.length;e+t.value))}initOffsets(t=[]){let e,i,r=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),r=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);let o=t.length<3?.5:.25;r=tR(r,0,o),n=tR(n,0,o),this._offsets={start:r,end:n,factor:1/(r+1+n)}}_generate(){let t,e;let i=this._adapter,r=this.min,n=this.max,o=this.options,a=o.time,s=a.unit||nZ(a.minUnit,r,n,this._getLabelCapacity(r)),l=Y(o.ticks.stepSize,1),h="week"===s&&a.isoWeekday,c=tS(h)||!0===h,u={},d=r;if(c&&(d=+i.startOf(d,"isoWeek",h)),d=+i.startOf(d,c?"day":s),i.diff(n,r,s)>1e5*l)throw Error(r+" and "+n+" are too far apart with stepSize of "+l+" "+s);let f="data"===o.ticks.source&&this.getDataTimestamps();for(t=d,e=0;t+t)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){let i=this.options,r=i.time.displayFormats,n=this._unit,o=e||r[n];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,r){let n=this.options,o=n.ticks.callback;if(o)return Z(o,[t,e,i],this);let a=n.time.displayFormats,s=this._unit,l=this._majorUnit,h=s&&a[s],c=l&&a[l],u=i[e],d=l&&c&&u&&u.major;return this._adapter.format(t,r||(d?c:h))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,e=r.length;t=t[s].pos&&e<=t[l].pos&&({lo:s,hi:l}=tj(t,"pos",e)),{pos:r,time:o}=t[s],{pos:n,time:a}=t[l]):(e>=t[s].time&&e<=t[l].time&&({lo:s,hi:l}=tj(t,"time",e)),{time:r,pos:o}=t[s],{time:n,pos:a}=t[l]);let h=n-r;return h?o+(a-o)*(e-r)/h:o}c(nQ,"id","time"),c(nQ,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});class n1 extends nQ{initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=n0(e,this.min),this._tableRange=n0(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let e,i,r;let{min:n,max:o}=this,a=[],s=[];for(e=0,i=t.length;e=n&&r<=o&&a.push(r);if(a.length<2)return[{time:n,pos:0},{time:o,pos:1}];for(e=0,i=a.length;et-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t}getDecimalForValue(t){return(n0(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return n0(this._table,i*this._tableRange+this._minPos,!0)}constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}}c(n1,"id","timeseries"),c(n1,"defaults",nQ.defaults);var n2=/*#__PURE__*/Object.freeze({__proto__:null,CategoryScale:nI,LinearScale:nF,LogarithmicScale:nV,RadialLinearScale:n$,TimeScale:nQ,TimeSeriesScale:n1});/**! * Sortable 1.15.1 * @author RubaXa * @author owenm * @license MIT - */function n5(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)}return i}function n3(t){for(var e=1;e"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){}return!1}}function ol(/**HTMLElement*/t,/**String*/e,/**HTMLElement*/i,r){if(t){var n;i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&os(t,e):os(t,e))||r&&t===i)return t;if(t===i)break;/* jshint boss:true */}while(t=(n=t).host&&n!==document&&n.host.nodeType?n.host:n.parentNode)}return null}var oh=/\s+/g;function oc(t,e,i){if(t&&e){if(t.classList)t.classList[i?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(oh," ").replace(" "+e+" "," ");t.className=(r+(i?" "+e:"")).replace(oh," ")}}}function ou(t,e,i){var r=t&&t.style;if(r){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in r||-1!==e.indexOf("webkit")||(e="-webkit-"+e),r[e]=i+("string"==typeof i?"":"px")}}function od(t,e){var i="";if("string"==typeof t)i=t;else do{var r=ou(t,"transform");r&&"none"!==r&&(i=r+" "+i);/* jshint boss:true */}while(!e&&(t=t.parentNode))var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;/*jshint -W056 */return n&&new n(i)}function of(t,e,i){if(t){var r=t.getElementsByTagName(e),n=0,o=r.length;if(i)for(;n"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){}return!1}}function ol(/**HTMLElement*/t,/**String*/e,/**HTMLElement*/i,r){if(t){var n;i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&os(t,e):os(t,e))||r&&t===i)return t;if(t===i)break;/* jshint boss:true */}while(t=(n=t).host&&n!==document&&n.host.nodeType?n.host:n.parentNode)}return null}var oh=/\s+/g;function oc(t,e,i){if(t&&e){if(t.classList)t.classList[i?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(oh," ").replace(" "+e+" "," ");t.className=(r+(i?" "+e:"")).replace(oh," ")}}}function ou(t,e,i){var r=t&&t.style;if(r){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in r||-1!==e.indexOf("webkit")||(e="-webkit-"+e),r[e]=i+("string"==typeof i?"":"px")}}function od(t,e){var i="";if("string"==typeof t)i=t;else do{var r=ou(t,"transform");r&&"none"!==r&&(i=r+" "+i);/* jshint boss:true */}while(!e&&(t=t.parentNode))var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;/*jshint -W056 */return n&&new n(i)}function of(t,e,i){if(t){var r=t.getElementsByTagName(e),n=0,o=r.length;if(i)for(;n2&&void 0!==arguments[2]?arguments[2]:{},r=i.evt,n=function(t,e){if(null==t)return{};var i,r,n=function(t,e){if(null==t)return{};var i,r,n={},o=Object.keys(t);for(r=0;r=0||(n[i]=t[i]);return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}(i,oT);oD.pluginEvent.bind(am)(t,e,n3({dragEl:oj,parentEl:oF,ghostEl:oL,rootEl:oN,nextEl:oB,lastDownEl:oz,cloneEl:oV,cloneHidden:oW,dragStarted:o1,putSortable:oX,activeSortable:am.active,originalEvent:r,oldIndex:oH,oldDraggableIndex:o$,newIndex:oU,newDraggableIndex:oq,hideGhostForTarget:ad,unhideGhostForTarget:af,cloneNowHidden:function(){oW=!0},cloneNowShown:function(){oW=!1},dispatchSortableEvent:function(t){oC({sortable:e,name:t,originalEvent:r})}},n))};function oC(t){!function(t){var e=t.sortable,i=t.rootEl,r=t.name,n=t.targetEl,o=t.cloneEl,a=t.toEl,s=t.fromEl,l=t.oldIndex,h=t.newIndex,c=t.oldDraggableIndex,u=t.newDraggableIndex,d=t.originalEvent,f=t.putSortable,p=t.extraEventProperties;if(e=e||i&&i[oP]){var g,m=e.options,b="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||n9||n7?(g=document.createEvent("Event")).initEvent(r,!0,!0):g=new CustomEvent(r,{bubbles:!0,cancelable:!0}),g.to=a||i,g.from=s||i,g.item=n||i,g.clone=o,g.oldIndex=l,g.newIndex=h,g.oldDraggableIndex=c,g.newDraggableIndex=u,g.originalEvent=d,g.pullMode=f?f.lastPutMode:void 0;var y=n3(n3({},p),oD.getEventProperties(r,e));for(var v in y)g[v]=y[v];i&&i.dispatchEvent(g),m[b]&&m[b].call(e,g)}}(n3({putSortable:oX,cloneEl:oV,targetEl:oj,rootEl:oN,oldIndex:oH,oldDraggableIndex:o$,newIndex:oU,newDraggableIndex:oq},t))}var oI,oj,oF,oL,oN,oB,oz,oV,oW,oH,oU,o$,oq,oY,oX,oG,oZ,oK,oJ,oQ,o0,o1,o2,o5,o3,o6,o8=!1,o4=!1,o9=[],o7=!1,at=!1,ae=[],ai=!1,ar=[],an="undefined"!=typeof document,ao=n7||n9?"cssFloat":"float",aa=an&&!or&&!oi&&"draggable"in document.createElement("div"),as=function(){if(an){// false when <= IE11 +t[n.pluginName]&&n.optionListeners&&"function"==typeof n.optionListeners[e]&&(r=n.optionListeners[e].call(t[n.pluginName],i))}),r}},oD=["evt"],oR=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=i.evt,n=function(t,e){if(null==t)return{};var i,r,n=function(t,e){if(null==t)return{};var i,r,n={},o=Object.keys(t);for(r=0;r=0||(n[i]=t[i]);return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}(i,oD);oT.pluginEvent.bind(am)(t,e,n3({dragEl:oj,parentEl:oF,ghostEl:oL,rootEl:oN,nextEl:oB,lastDownEl:oz,cloneEl:oV,cloneHidden:oW,dragStarted:o1,putSortable:oX,activeSortable:am.active,originalEvent:r,oldIndex:oH,oldDraggableIndex:o$,newIndex:oU,newDraggableIndex:oq,hideGhostForTarget:ad,unhideGhostForTarget:af,cloneNowHidden:function(){oW=!0},cloneNowShown:function(){oW=!1},dispatchSortableEvent:function(t){oI({sortable:e,name:t,originalEvent:r})}},n))};function oI(t){!function(t){var e=t.sortable,i=t.rootEl,r=t.name,n=t.targetEl,o=t.cloneEl,a=t.toEl,s=t.fromEl,l=t.oldIndex,h=t.newIndex,c=t.oldDraggableIndex,u=t.newDraggableIndex,d=t.originalEvent,f=t.putSortable,p=t.extraEventProperties;if(e=e||i&&i[oP]){var g,m=e.options,b="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||n9||n7?(g=document.createEvent("Event")).initEvent(r,!0,!0):g=new CustomEvent(r,{bubbles:!0,cancelable:!0}),g.to=a||i,g.from=s||i,g.item=n||i,g.clone=o,g.oldIndex=l,g.newIndex=h,g.oldDraggableIndex=c,g.newDraggableIndex=u,g.originalEvent=d,g.pullMode=f?f.lastPutMode:void 0;var y=n3(n3({},p),oT.getEventProperties(r,e));for(var v in y)g[v]=y[v];i&&i.dispatchEvent(g),m[b]&&m[b].call(e,g)}}(n3({putSortable:oX,cloneEl:oV,targetEl:oj,rootEl:oN,oldIndex:oH,oldDraggableIndex:o$,newIndex:oU,newDraggableIndex:oq},t))}var oC,oj,oF,oL,oN,oB,oz,oV,oW,oH,oU,o$,oq,oY,oX,oG,oZ,oK,oJ,oQ,o0,o1,o2,o5,o3,o6,o8=!1,o4=!1,o9=[],o7=!1,at=!1,ae=[],ai=!1,ar=[],an="undefined"!=typeof document,ao=n7||n9?"cssFloat":"float",aa=an&&!or&&!oi&&"draggable"in document.createElement("div"),as=function(){if(an){// false when <= IE11 if(n9)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),al=function(t,e){var i=ou(t),r=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),n=oy(t,0,e),o=oy(t,1,e),a=n&&ou(n),s=o&&ou(o),l=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+og(n).width,h=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+og(o).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(n&&a.float&&"none"!==a.float){var c="left"===a.float?"left":"right";return o&&("both"===s.clear||s.clear===c)?"vertical":"horizontal"}return n&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||l>=r&&"none"===i[ao]||o&&"none"===i[ao]&&l+h>r)?"vertical":"horizontal"},ah=function(t,e,i){var r=i?t.left:t.top,n=i?t.right:t.bottom,o=i?t.width:t.height,a=i?e.left:e.top,s=i?e.right:e.bottom,l=i?e.width:e.height;return r===a||n===s||r+o/2===a+l/2},/** * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold. * @param {Number} x X position @@ -797,7 +797,7 @@ t[oP]=this;var i,r,n={group:null,sort:!0,disabled:!1,store:null,handle:null,drag invertSwap:!1,// invert always invertedSwapThreshold:null,// will be set to same as swapThreshold if default removeCloneOnHide:!0,direction:function(){return al(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==am.supportPointer&&"PointerEvent"in window&&!oe,emptyInsertThreshold:5};// Set default options -for(var o in oD.initializePlugins(this,t,n),n)o in e||(e[o]=n[o]);// Bind all private methods +for(var o in oT.initializePlugins(this,t,n),n)o in e||(e[o]=n[o]);// Bind all private methods for(var a in au(e),this)"_"===a.charAt(0)&&"function"==typeof this[a]&&(this[a]=this[a].bind(this));// Setup drag mode this.nativeDraggable=!e.forceFallback&&aa,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?oo(t,"pointerdown",this._onTapStart):(oo(t,"mousedown",this._onTapStart),oo(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(oo(t,"dragover",this),oo(t,"dragenter",this)),o9.push(this.el),// Restore sorting e.store&&e.store.get&&this.sort(e.store.get(this)||[]),// Add animation state manager @@ -812,22 +812,22 @@ l.top-=d.f,l.left-=d.e),a.toRect=l,a.thisAnimationDuration&&oS(h,l)&&!oS(s,l)&&/ (u.top-l.top)/(u.left-l.left)==(s.top-l.top)/(s.left-l.left)&&(i=e.options,r=Math.sqrt(Math.pow(h.top-u.top,2)+Math.pow(h.left-u.left,2))/Math.sqrt(Math.pow(h.top-c.top,2)+Math.pow(h.left-c.left,2))*i.animation),oS(l,s)||(a.prevFromRect=s,a.prevToRect=l,r||(r=e.options.animation),e.animate(a,u,l,r)),r&&(n=!0,o=Math.max(o,r),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout(function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null},r),a.thisAnimationDuration=r)}),clearTimeout(i),n?i=setTimeout(function(){"function"==typeof t&&t()},o):"function"==typeof t&&t(),r=[]},animate:function(t,e,i,r){if(r){ou(t,"transition",""),ou(t,"transform","");var n=od(this.el),o=n&&n.a,a=n&&n.d,s=(e.left-i.left)/(o||1),l=(e.top-i.top)/(a||1);t.animatingX=!!s,t.animatingY=!!l,ou(t,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=t.offsetWidth,ou(t,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),ou(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){ou(t,"transition",""),ou(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},r)}}}))}function ab(t,e,i,r,n,o,a,s){var l,h,c=t[oP],u=c.options.onMove;return!window.CustomEvent||n9||n7?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=i,l.draggedRect=r,l.related=n||e,l.relatedRect=o||og(e),l.willInsertAfter=s,l.originalEvent=a,t.dispatchEvent(l),u&&(h=u.call(c,l,a)),h}function ay(t){t.draggable=!1}function av(){ai=!1}function ax(t){return setTimeout(t,0)}function a_(t){return clearTimeout(t)}am.prototype=/** @lends Sortable.prototype */{constructor:am,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(o2=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,oj):this.options.direction},_onTapStart:function(/** Event|TouchEvent */t){if(t.cancelable){var e=this,i=this.el,r=this.options,n=r.preventOnFilter,o=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,s=(a||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,h=r.filter;// Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group. if(function(t){ar.length=0;for(var e=t.getElementsByTagName("input"),i=e.length;i--;){var r=e[i];r.checked&&ar.push(r)}}(i),!(oj||/mousedown|pointerdown/.test(o)&&0!==t.button||r.disabled||l.isContentEditable||!this.nativeDraggable&&oe&&s&&"SELECT"===s.tagName.toUpperCase()||(s=ol(s,r.draggable,i,!1))&&s.animated)&&oz!==s){// Check filter if(// Get the index of the dragged element within its parent -oH=ox(s),o$=ox(s,r.draggable),"function"==typeof h){if(h.call(this,t,s,this)){oC({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:i,fromEl:i}),oR("filter",e,{evt:t}),n&&t.cancelable&&t.preventDefault();return;// cancel dnd -}}else if(h&&(h=h.split(",").some(function(r){if(r=ol(l,r.trim(),i,!1))return oC({sortable:e,rootEl:r,name:"filter",targetEl:s,fromEl:i,toEl:i}),oR("filter",e,{evt:t}),!0}))){n&&t.cancelable&&t.preventDefault();return;// cancel dnd +oH=ox(s),o$=ox(s,r.draggable),"function"==typeof h){if(h.call(this,t,s,this)){oI({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:i,fromEl:i}),oR("filter",e,{evt:t}),n&&t.cancelable&&t.preventDefault();return;// cancel dnd +}}else if(h&&(h=h.split(",").some(function(r){if(r=ol(l,r.trim(),i,!1))return oI({sortable:e,rootEl:r,name:"filter",targetEl:s,fromEl:i,toEl:i}),oR("filter",e,{evt:t}),!0}))){n&&t.cancelable&&t.preventDefault();return;// cancel dnd }(!r.handle||ol(l,r.handle,i,!1))&&// Prepare `dragstart` this._prepareDragStart(t,a,s)}}},_prepareDragStart:function(/** Event */t,/** Touch */e,/** HTMLElement */i){var r,n=this,o=n.el,a=n.options,s=o.ownerDocument;if(i&&!oj&&i.parentNode===o){var l=og(i);// Delay is impossible for native DnD in Edge or IE if(oN=o,oF=(oj=i).parentNode,oB=oj.nextSibling,oz=i,oY=a.group,am.dragged=oj,oQ=(oG={target:oj,clientX:(e||t).clientX,clientY:(e||t).clientY}).clientX-l.left,o0=oG.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,oj.style["will-change"]="all",r=function(){if(oR("delayEnded",n,{evt:t}),am.eventCanceled){n._onDrop();return}// Delayed drag has been triggered // we can re-enable the events: touchmove/mousemove n._disableDelayedDragEvents(),!ot&&n.nativeDraggable&&(oj.draggable=!0),// Bind the events: dragstart/dragend n._triggerDragStart(t,e),// Drag start event -oC({sortable:n,name:"choose",originalEvent:t}),// Chosen item +oI({sortable:n,name:"choose",originalEvent:t}),// Chosen item oc(oj,a.chosenClass,!0)},// Disable "draggable" a.ignore.split(",").forEach(function(t){of(oj,t.trim(),ay)}),oo(s,"dragover",ap),oo(s,"mousemove",ap),oo(s,"touchmove",ap),oo(s,"mouseup",n._onDrop),oo(s,"touchend",n._onDrop),oo(s,"touchcancel",n._onDrop),ot&&this.nativeDraggable&&(this.options.touchStartThreshold=4,oj.draggable=!0),oR("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(n7||n9))r();else{if(am.eventCanceled){this._onDrop();return}// If the user moves the pointer or let go the click or touch // before the delay has been reached: // disable the delayed drag oo(s,"mouseup",n._disableDelayedDrag),oo(s,"touchend",n._disableDelayedDrag),oo(s,"touchcancel",n._disableDelayedDrag),oo(s,"mousemove",n._delayedDragTouchMoveHandler),oo(s,"touchmove",n._delayedDragTouchMoveHandler),a.supportPointer&&oo(s,"pointermove",n._delayedDragTouchMoveHandler),n._dragStartTimer=setTimeout(r,a.delay)}}},_delayedDragTouchMoveHandler:function(/** TouchEvent|PointerEvent **/t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){oj&&ay(oj),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;oa(t,"mouseup",this._disableDelayedDrag),oa(t,"touchend",this._disableDelayedDrag),oa(t,"touchcancel",this._disableDelayedDrag),oa(t,"mousemove",this._delayedDragTouchMoveHandler),oa(t,"touchmove",this._delayedDragTouchMoveHandler),oa(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(/** Event */t,/** Touch */e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?oo(document,"pointermove",this._onTouchMove):e?oo(document,"touchmove",this._onTouchMove):oo(document,"mousemove",this._onTouchMove):(oo(oj,"dragend",this),oo(oN,"dragstart",this._onDragStart));try{document.selection?ax(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(o8=!1,oN&&oj){oR("dragStarted",this,{evt:e}),this.nativeDraggable&&oo(document,"dragover",ag);var i=this.options;// Apply effect t||oc(oj,i.dragClass,!1),oc(oj,i.ghostClass,!0),am.active=this,t&&this._appendGhost(),// Drag start event -oC({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(oZ){this._lastX=oZ.clientX,this._lastY=oZ.clientY,ad();for(var t=document.elementFromPoint(oZ.clientX,oZ.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(oZ.clientX,oZ.clientY))!==e;)e=t;if(oj.parentNode[oP]._isOutsideThisEl(t),e)do{if(e[oP]&&e[oP]._onDragOver({clientX:oZ.clientX,clientY:oZ.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break;t=e;// store last element +oI({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(oZ){this._lastX=oZ.clientX,this._lastY=oZ.clientY,ad();for(var t=document.elementFromPoint(oZ.clientX,oZ.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(oZ.clientX,oZ.clientY))!==e;)e=t;if(oj.parentNode[oP]._isOutsideThisEl(t),e)do{if(e[oP]&&e[oP]._onDragOver({clientX:oZ.clientX,clientY:oZ.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break;t=e;// store last element }while(e=e.parentNode)af()}},_onTouchMove:function(/**TouchEvent*/t){if(oG){var e=this.options,i=e.fallbackTolerance,r=e.fallbackOffset,n=t.touches?t.touches[0]:t,o=oL&&od(oL,!0),a=oL&&o&&o.a,s=oL&&o&&o.d,l=oi&&o6&&o_(o6),h=(n.clientX-oG.clientX+r.x)/(a||1)+(l?l[0]-ae[0]:0)/(a||1),c=(n.clientY-oG.clientY+r.y)/(s||1)+(l?l[1]-ae[1]:0)/(s||1);// only set the status to dragging, when we are actually dragging if(!am.active&&!o8){if(i&&Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))v.right+10||t.clientY>y.bottom&&t.clientX>y.left:t.clientY>v.bottom+10||t.clientX>y.right&&t.clientY>y.top)&&!g.animated)){// Insert to end of list // If already at end of list: Do not insert if(g===oj)return L(!1);if(g&&o===t.target&&(a=g),a&&(i=og(a)),!1!==ab(oN,o,oj,e,a,i,t,!!a))return F(),g&&g.nextSibling?o.insertBefore(oj,g.nextSibling):o.appendChild(oj),oF=o,N(),L(!0)}else if(g&&(x=n,_=og(oy(this.el,0,this.options,!0)),w=om(this.el),x?t.clientXc+h*o/2:lu-o3)return-o5}else // Regular if(l>c+h*(1-n)/2&&lu-h*o/2)?l>c+h/2?1:-1:0}(t,a,i,n,P?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,at,o2===a))){// Check if target is beside dragEl in respective direction (ignoring hidden elements) -var T=ox(oj);do T-=M,S=oF.children[T];while(S&&("none"===ou(S,"display")||S===oL))}// If dragEl is already beside target: Do not insert -if(0===M||S===a)return L(!1);o2=a,o5=M;var R=a.nextElementSibling,C=!1,I=ab(oN,o,oj,e,a,i,t,C=1===M);if(!1!==I)return(1===I||-1===I)&&(C=1===I),ai=!0,setTimeout(av,30),F(),C&&!R?o.appendChild(oj):a.parentNode.insertBefore(oj,C?R:a),A&&oM(A,0,D-A.scrollTop),oF=oj.parentNode,void 0===O||at||(o3=Math.abs(O-og(a)[E])),N(),L(!0)}if(o.contains(oj))return L(!1)}return!1}function j(s,l){oR(s,f,n3({evt:t,isOwner:c,axis:n?"vertical":"horizontal",revert:r,dragRect:e,targetRect:i,canSort:u,fromSortable:d,target:a,completed:L,onMove:function(i,r){return ab(oN,o,oj,e,i,og(i),t,r)},changed:N},l))}// Capture animation state +var D=ox(oj);do D-=M,S=oF.children[D];while(S&&("none"===ou(S,"display")||S===oL))}// If dragEl is already beside target: Do not insert +if(0===M||S===a)return L(!1);o2=a,o5=M;var R=a.nextElementSibling,I=!1,C=ab(oN,o,oj,e,a,i,t,I=1===M);if(!1!==C)return(1===C||-1===C)&&(I=1===C),ai=!0,setTimeout(av,30),F(),I&&!R?o.appendChild(oj):a.parentNode.insertBefore(oj,I?R:a),A&&oM(A,0,T-A.scrollTop),oF=oj.parentNode,void 0===O||at||(o3=Math.abs(O-og(a)[E])),N(),L(!0)}if(o.contains(oj))return L(!1)}return!1}function j(s,l){oR(s,f,n3({evt:t,isOwner:c,axis:n?"vertical":"horizontal",revert:r,dragRect:e,targetRect:i,canSort:u,fromSortable:d,target:a,completed:L,onMove:function(i,r){return ab(oN,o,oj,e,i,og(i),t,r)},changed:N},l))}// Capture animation state function F(){j("dragOverAnimationCapture"),f.captureAnimationState(),f!==d&&d.captureAnimationState()}// Return invocation when dragEl is inserted (or completed) function L(e){return j("dragOverCompleted",{insertion:e}),e&&(c?h._hideClone():h._showClone(f),f!==d&&(// Set ghost class to new sortable's ghost class oc(oj,oX?oX.options.ghostClass:h.options.ghostClass,!1),oc(oj,s.ghostClass,!0)),oX!==f&&f!==am.active?oX=f:f===am.active&&oX&&(oX=null),d===f&&(f._ignoreWhileAnimating=a),f.animateAll(function(){j("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(a!==oj||oj.animated)&&(a!==o||a.animated)||(o2=null),s.dragoverBubble||t.rootEl||a===document||(oj.parentNode[oP]._isOutsideThisEl(t.target),// Do not detect for empty insert if already inserted e||ap(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),p=!0}// Call when dragEl has been inserted -function N(){oU=ox(oj),oq=ox(oj,s.draggable),oC({sortable:f,name:"change",toEl:o,newIndex:oU,newDraggableIndex:oq,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){oa(document,"mousemove",this._onTouchMove),oa(document,"touchmove",this._onTouchMove),oa(document,"pointermove",this._onTouchMove),oa(document,"dragover",ap),oa(document,"mousemove",ap),oa(document,"touchmove",ap)},_offUpEvents:function(){var t=this.el.ownerDocument;oa(t,"mouseup",this._onDrop),oa(t,"touchend",this._onDrop),oa(t,"pointerup",this._onDrop),oa(t,"touchcancel",this._onDrop),oa(document,"selectstart",this)},_onDrop:function(/**Event*/t){var e=this.el,i=this.options;if(// Get the index of the dragged element within its parent +function N(){oU=ox(oj),oq=ox(oj,s.draggable),oI({sortable:f,name:"change",toEl:o,newIndex:oU,newDraggableIndex:oq,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){oa(document,"mousemove",this._onTouchMove),oa(document,"touchmove",this._onTouchMove),oa(document,"pointermove",this._onTouchMove),oa(document,"dragover",ap),oa(document,"mousemove",ap),oa(document,"touchmove",ap)},_offUpEvents:function(){var t=this.el.ownerDocument;oa(t,"mouseup",this._onDrop),oa(t,"touchend",this._onDrop),oa(t,"pointerup",this._onDrop),oa(t,"touchcancel",this._onDrop),oa(document,"selectstart",this)},_onDrop:function(/**Event*/t){var e=this.el,i=this.options;if(// Get the index of the dragged element within its parent oU=ox(oj),oq=ox(oj,i.draggable),oR("drop",this,{evt:t}),oF=oj&&oj.parentNode,// Get again after plugin event oU=ox(oj),oq=ox(oj,i.draggable),am.eventCanceled){this._nulling();return}o8=!1,at=!1,o7=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),a_(this.cloneId),a_(this._dragStartId),this.nativeDraggable&&(oa(document,"drop",this),oa(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),oe&&ou(document.body,"user-select",""),ou(oj,"transform",""),t&&(o1&&(t.cancelable&&t.preventDefault(),i.dropBubble||t.stopPropagation()),oL&&oL.parentNode&&oL.parentNode.removeChild(oL),(oN===oF||oX&&"clone"!==oX.lastPutMode)&&oV&&oV.parentNode&&oV.parentNode.removeChild(oV),oj&&(this.nativeDraggable&&oa(oj,"dragend",this),ay(oj),oj.style["will-change"]="",o1&&!o8&&oc(oj,oX?oX.options.ghostClass:this.options.ghostClass,!1),oc(oj,this.options.chosenClass,!1),// Drag stop event -oC({sortable:this,name:"unchoose",toEl:oF,newIndex:null,newDraggableIndex:null,originalEvent:t}),oN!==oF?(oU>=0&&(// Add event -oC({rootEl:oF,name:"add",toEl:oF,fromEl:oN,originalEvent:t}),// Remove event -oC({sortable:this,name:"remove",toEl:oF,originalEvent:t}),// drag from one list and drop into another -oC({rootEl:oF,name:"sort",toEl:oF,fromEl:oN,originalEvent:t}),oC({sortable:this,name:"sort",toEl:oF,originalEvent:t})),oX&&oX.save()):oU!==oH&&oU>=0&&(// drag & drop within the same list -oC({sortable:this,name:"update",toEl:oF,originalEvent:t}),oC({sortable:this,name:"sort",toEl:oF,originalEvent:t})),am.active&&((null==oU||-1===oU)&&(oU=oH,oq=o$),oC({sortable:this,name:"end",toEl:oF,originalEvent:t}),// Save sorting +oI({sortable:this,name:"unchoose",toEl:oF,newIndex:null,newDraggableIndex:null,originalEvent:t}),oN!==oF?(oU>=0&&(// Add event +oI({rootEl:oF,name:"add",toEl:oF,fromEl:oN,originalEvent:t}),// Remove event +oI({sortable:this,name:"remove",toEl:oF,originalEvent:t}),// drag from one list and drop into another +oI({rootEl:oF,name:"sort",toEl:oF,fromEl:oN,originalEvent:t}),oI({sortable:this,name:"sort",toEl:oF,originalEvent:t})),oX&&oX.save()):oU!==oH&&oU>=0&&(// drag & drop within the same list +oI({sortable:this,name:"update",toEl:oF,originalEvent:t}),oI({sortable:this,name:"sort",toEl:oF,originalEvent:t})),am.active&&((null==oU||-1===oU)&&(oU=oH,oq=o$),oI({sortable:this,name:"end",toEl:oF,originalEvent:t}),// Save sorting this.save()))),this._nulling()},_nulling:function(){oR("nulling",this),oN=oj=oF=oL=oB=oV=oz=oW=oG=oZ=o1=oU=oq=oH=o$=o2=o5=oX=oY=am.dragged=am.ghost=am.clone=am.active=null,ar.forEach(function(t){t.checked=!0}),ar.length=oK=oJ=0},handleEvent:function(/**Event*/t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":oj&&(this._onDragOver(t),t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault());break;case"selectstart":t.preventDefault()}},/** * Serializes the item into an array of string. * @returns {String[]} @@ -884,7 +884,7 @@ this.save()))),this._nulling()},_nulling:function(){oR("nulling",this),oN=oj=oF= * @param {string} name * @param {*} [value] * @returns {*} - */option:function(t,e){var i=this.options;if(void 0===e)return i[t];var r=oD.modifyOption(this,t,e);void 0!==r?i[t]=r:i[t]=e,"group"===t&&au(i)},/** + */option:function(t,e){var i=this.options;if(void 0===e)return i[t];var r=oT.modifyOption(this,t,e);void 0!==r?i[t]=r:i[t]=e,"group"===t&&au(i)},/** * Destroy */destroy:function(){oR("destroy",this);var t=this.el;t[oP]=null,oa(t,"mousedown",this._onTapStart),oa(t,"touchstart",this._onTapStart),oa(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(oa(t,"dragover",this),oa(t,"dragenter",this)),// Remove draggable attributes Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),o9.splice(o9.indexOf(this.el),1),this.el=null},_hideClone:function(){oW||(oR("hideClone",this),am.eventCanceled||(ou(oV,"display","none"),this.options.removeCloneOnHide&&oV.parentNode&&oV.parentNode.removeChild(oV),oW=!0))},_showClone:function(t){if("clone"!==t.lastPutMode){this._hideClone();return}if(oW){if(oR("showClone",this),am.eventCanceled)return;oj.parentNode!=oN||this.options.group.revertClone?oB?oN.insertBefore(oV,oB):oN.appendChild(oV):oN.insertBefore(oV,oj),this.options.group.revertClone&&this.animate(oj,oV),ou(oV,"display",""),oW=!1}}},an&&oo(document,"touchmove",function(t){(am.active||o8)&&t.cancelable&&t.preventDefault()}),// Export utils @@ -895,28 +895,28 @@ am.utils={on:oo,off:oa,css:ou,find:of,is:function(t,e){return!!ol(t,e,t,!1)},ext */am.get=function(t){return t[oP]},/** * Mount a plugin to Sortable * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted - */am.mount=function(){for(var t=arguments.length,e=Array(t),i=0;i{requestAnimationFrame(t)})}function aL(t,e,i,r){let n=t.length,o=r(t,e),a=Array(n),s=i/2,l=i/6,h=e+s;for(let e=0;e{requestAnimationFrame(t)})}function aL(t,e,i,r){let n=t.length,o=r(t,e),a=Array(n),s=i/2,l=i/6,h=e+s;for(let e=0;ee[t])}static arrayToElementObject(t,e){let i={};for(let r=0;r{let r=this.stockArrayToStocks(e),n=this.evaluateFlowPerStock(r,t,i),o=this.stocksToStockArray(n);return o}}step(t,e,i,r){var n;let o=this.stocksToStockArray(t),a="number"==typeof e?aN(o,e,i,r,n):function(t,e,i,r,n,o){let a=[...e];return aN(t,i,r,(t,e)=>e===i?a:n(t,e),o)}(o,e,i,r,n,void 0);return this.stockArrayToStocks(a)}constructor(t,e,i,r){this.stockIds=t,this.flowIds=e,this.variableIds=i,this.parameterIds=r}}aB.elementIds=["stocks","parameters","variables","flows"];let az=["capacityOfNewlyProducedPhones","capacityOfRecycledMaterials","capacityOfRefurbishedPhones","capacityOfRepairedPhones","phonesInUse","supplyOfBrokenPhones","supplyOfDisposedPhones","supplyOfHibernatingPhones","supplyOfNewlyProducedPhones","supplyOfRecycledMaterials","supplyOfRefurbishedPhones","supplyOfRepairedPhones"],aV=["abandon","acquireNewlyProduced","acquireRefurbished","acquireRepaired","acquireUsed","capacityOfNewlyProducedPhonesAdjustment","capacityOfRecycledMaterialsAdjustment","capacityOfRefurbishedPhonesAdjustment","disposeBroken","disposeHibernating","goBroken","landfill","produceFromNaturalResources","produceFromRecycledMaterials","recycle","refurbish","repair","repairShopCapcityAdjustment"],aW=["demandForNaturalResources","demandForNewlyProducedPhones","demandForPhones","demandForRecycledMaterials","demandForRefurbishedPhones","demandForRefurbishment","demandForRepairedPhones","demandForReusedPhones","inflowIncentiveSumForPhonesInUse","phoneGoal","phonesInUseExcess","recycleDemand","repairDemand","resourceDemand","supplyOfBrokenPhonesForDisposal","supplyOfBrokenPhonesForRepair","supplyOfDisposedPhonesForLandfilling","supplyOfDisposedPhonesForRecycling"],aH=["abandonExcessRate","abandonRate","acquireRate","breakRate","capacityAdjustmentRate","disposeIncentive","disposeRate","durability","landfillIncentive","landfillRate","naturalResourcesIncentive","newPhoneProductionRate","newlyProducedPhoneIncentive","numberOfUsers","phonesPerUserGoal","recycleRate","recyclingIncentive","refurbishmentIncentive","refurbishmentRate","repairIncentive","repairRate","reuseIncentive"];class aU extends aB{// eslint-disable-next-line class-methods-use-this -evaluate(t,e,i){let{capacityOfNewlyProducedPhones:r,capacityOfRecycledMaterials:n,capacityOfRefurbishedPhones:o,capacityOfRepairedPhones:a,phonesInUse:s,supplyOfBrokenPhones:l,supplyOfDisposedPhones:h,supplyOfHibernatingPhones:c,supplyOfNewlyProducedPhones:u,supplyOfRecycledMaterials:d,supplyOfRefurbishedPhones:f,supplyOfRepairedPhones:p}=t,{abandonExcessRate:g,abandonRate:m,acquireRate:b,breakRate:y,capacityAdjustmentRate:v,disposeIncentive:x,disposeRate:_,durability:w,landfillIncentive:S,landfillRate:O,naturalResourcesIncentive:M,newPhoneProductionRate:k,newlyProducedPhoneIncentive:P,numberOfUsers:E,phonesPerUserGoal:A,recycleRate:D,recyclingIncentive:T,refurbishmentIncentive:R,refurbishmentRate:C,repairIncentive:I,repairRate:j,reuseIncentive:F}=e,L=E*A,N=Math.max(s-L,0),B=F+I+R+P,z=Math.max(0,L-s),V=P/B*z,W=R/B*z,H=I/B*z,U=F/B*z,$=Math.max(r-u,0),q=T/(M+T)*$,Y=x/(I+x)*l,X=S/(T+S)*h,G=M/(M+T)*$,Z=T/(T+S)*h,K=Math.max(n-d,0),J=Math.max(o-f,0),Q=Math.max(a-p,0);return{t:i,stocks:t,parameters:e,variables:{demandForNaturalResources:G,demandForNewlyProducedPhones:V,demandForPhones:z,demandForRecycledMaterials:q,demandForRefurbishedPhones:W,demandForRefurbishment:J,demandForRepairedPhones:H,demandForReusedPhones:U,inflowIncentiveSumForPhonesInUse:B,phoneGoal:L,phonesInUseExcess:N,recycleDemand:K,repairDemand:Q,resourceDemand:$,supplyOfBrokenPhonesForDisposal:Y,supplyOfBrokenPhonesForRepair:I/(I+x)*l,supplyOfDisposedPhonesForLandfilling:X,supplyOfDisposedPhonesForRecycling:Z},flows:{abandon:m*s+g*N,acquireNewlyProduced:b*Math.min(u,V),acquireRefurbished:b*Math.min(W,f),acquireRepaired:b*Math.min(H,p),acquireUsed:b*Math.min(c,U),capacityOfNewlyProducedPhonesAdjustment:v*(V-r),capacityOfRecycledMaterialsAdjustment:v*(q-n),capacityOfRefurbishedPhonesAdjustment:v*(W-o),disposeBroken:_*Y,disposeHibernating:_*c,goBroken:y/w*s,landfill:O*X,produceFromNaturalResources:k*G,produceFromRecycledMaterials:k*Math.min(q,d),recycle:D*Math.min(Z,K),refurbish:C*Math.min(c,J),repair:j*Math.min(l,Q),repairShopCapcityAdjustment:v*(H-a)}}}// eslint-disable-next-line class-methods-use-this -accumulateFlowsPerStock(t){let{abandon:e,acquireNewlyProduced:i,acquireRefurbished:r,acquireRepaired:n,acquireUsed:o,capacityOfNewlyProducedPhonesAdjustment:a,capacityOfRecycledMaterialsAdjustment:s,capacityOfRefurbishedPhonesAdjustment:l,disposeBroken:h,disposeHibernating:c,goBroken:u,landfill:d,produceFromNaturalResources:f,produceFromRecycledMaterials:p,recycle:g,refurbish:m,repair:b,repairShopCapcityAdjustment:y}=t;return{capacityOfNewlyProducedPhones:a,capacityOfRecycledMaterials:s,capacityOfRefurbishedPhones:l,capacityOfRepairedPhones:y,phonesInUse:i+r+n+o-(e+u),supplyOfBrokenPhones:u-(h+b),supplyOfDisposedPhones:h+c-(d+g),supplyOfHibernatingPhones:e-(o+c+m),supplyOfNewlyProducedPhones:f+p-i,supplyOfRecycledMaterials:g-p,supplyOfRefurbishedPhones:m-r,supplyOfRepairedPhones:b-n}}constructor(){super(az,aV,aW,aH)}}aU.initialStocks={capacityOfNewlyProducedPhones:0,capacityOfRecycledMaterials:0,capacityOfRefurbishedPhones:0,capacityOfRepairedPhones:0,phonesInUse:0,supplyOfBrokenPhones:0,supplyOfDisposedPhones:0,supplyOfHibernatingPhones:0,supplyOfNewlyProducedPhones:0,supplyOfRecycledMaterials:0,supplyOfRefurbishedPhones:0,supplyOfRepairedPhones:0},aU.defaultParameters={abandonExcessRate:.5,abandonRate:.1,acquireRate:1,breakRate:.1,capacityAdjustmentRate:.1,disposeIncentive:.5,disposeRate:.5,durability:1,landfillIncentive:.5,landfillRate:1,naturalResourcesIncentive:.5,newPhoneProductionRate:.5,newlyProducedPhoneIncentive:.82,numberOfUsers:1e6,phonesPerUserGoal:1,recycleRate:1,recyclingIncentive:.89,refurbishmentIncentive:.5,refurbishmentRate:1,repairIncentive:.5,repairRate:1,reuseIncentive:.86};var a$=class{evaluateFlowPerStockWithCache(t,e){return null!==this.flowPerStockCache&&this.flowPerStockCache.t===e?[...this.flowPerStockCache.value]:this.flowEvaluator(t,e)}step(){let{stocks:t,parameters:e,t:i}=this.record,r=this.model.step(t,i,this.h,this.flowEvaluatorWithCache),n=this.model.evaluate(r,e,i+this.h);return this.flowPerStockCache={t:n.t,value:this.model.stocksToStockArray(this.model.accumulateFlowsPerStock(n.flows))},this.record=n,n}constructor(t,e,i,r,n){this.model=t,this.parameters=i,this.flowPerStockCache=null,this.record=this.model.evaluate(e,i,r),this.h=n,this.flowEvaluator=this.model.createFlowEvaluator(i),this.flowEvaluatorWithCache=this.evaluateFlowPerStockWithCache.bind(this)}},aq={},aY={};aY=/** +var a=ow(o,!0);aA&&(!aP||r!==aO||n!==aM)&&(aP&&aD(),// Detect for pointer elem change, emulating native DnD behaviour +aP=setInterval(function(){var o=ow(document.elementFromPoint(r,n),!0);o!==a&&(a=o,aT()),aR(t,i.options,o,e)},10),aO=r,aM=n)}else{// if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll +if(!this.options.bubbleScroll||ow(o,!0)===op()){aT();return}aR(t,this.options,ow(o,!1),!1)}}},n8(t,{pluginName:"scroll",initializeByDefault:!0})}),am.mount(aj,aC);class aB{static elementObjectToArray(t,e){return t.map(t=>e[t])}static arrayToElementObject(t,e){let i={};for(let r=0;r{let r=this.stockArrayToStocks(e),n=this.evaluateFlowPerStock(r,t,i),o=this.stocksToStockArray(n);return o}}step(t,e,i,r){var n;let o=this.stocksToStockArray(t),a="number"==typeof e?aN(o,e,i,r,n):function(t,e,i,r,n,o){let a=[...e];return aN(t,i,r,(t,e)=>e===i?a:n(t,e),o)}(o,e,i,r,n,void 0);return this.stockArrayToStocks(a)}constructor(t,e,i,r){this.stockIds=t,this.flowIds=e,this.variableIds=i,this.parameterIds=r}}aB.elementIds=["stocks","parameters","variables","flows"];let az=["capacityOfNewlyProducedPhones","capacityOfRecycledMaterials","capacityOfRefurbishedPhones","capacityOfRepairedPhones","phonesInUse","supplyOfBrokenPhones","supplyOfDisposedPhones","supplyOfHibernatingPhones","supplyOfNewlyProducedPhones","supplyOfRecycledMaterials","supplyOfRefurbishedPhones","supplyOfRepairedPhones"],aV=["abandon","acquireNewlyProduced","acquireRefurbished","acquireRepaired","acquireUsed","capacityOfNewlyProducedPhonesAdjustment","capacityOfRecycledMaterialsAdjustment","capacityOfRefurbishedPhonesAdjustment","disposeBroken","disposeHibernating","goBroken","landfill","produceFromNaturalResources","produceFromRecycledMaterials","recycle","refurbish","repair","repairShopCapcityAdjustment"],aW=["demandForNaturalResources","demandForNewlyProducedPhones","demandForPhones","demandForRecycledMaterials","demandForRecycling","demandForRefurbishedPhones","demandForRefurbishment","demandForRepair","demandForRepairedPhones","demandForResources","demandForReusedPhones","inflowIncentiveSumForPhonesInUse","phoneGoal","phonesInUseExcess","supplyOfBrokenPhonesForDisposal","supplyOfBrokenPhonesForRepair","supplyOfDisposedPhonesForLandfilling","supplyOfDisposedPhonesForRecycling","supplyOfHibernatingPhonesForDisposal","supplyOfHibernatingPhonesForRefurbishment","supplyOfHibernatingPhonesForReuse"],aH=["abandonExcessRate","abandonRate","acquireRate","breakRate","capacityAdjustmentRate","disposeIncentive","disposeRate","landfillIncentive","landfillRate","naturalResourcesIncentive","newPhoneProductionRate","newlyProducedPhoneIncentive","numberOfUsers","phonesPerUserGoal","recycleRate","recyclingIncentive","refurbishmentIncentive","refurbishmentRate","repairIncentive","repairRate","reuseIncentive"];class aU extends aB{// eslint-disable-next-line class-methods-use-this +evaluate(t,e,i){let{capacityOfNewlyProducedPhones:r,capacityOfRecycledMaterials:n,capacityOfRefurbishedPhones:o,capacityOfRepairedPhones:a,phonesInUse:s,supplyOfBrokenPhones:l,supplyOfDisposedPhones:h,supplyOfHibernatingPhones:c,supplyOfNewlyProducedPhones:u,supplyOfRecycledMaterials:d,supplyOfRefurbishedPhones:f,supplyOfRepairedPhones:p}=t,{abandonExcessRate:g,abandonRate:m,acquireRate:b,breakRate:y,capacityAdjustmentRate:v,disposeIncentive:x,disposeRate:_,landfillIncentive:w,landfillRate:S,naturalResourcesIncentive:O,newPhoneProductionRate:M,newlyProducedPhoneIncentive:k,numberOfUsers:P,phonesPerUserGoal:E,recycleRate:A,recyclingIncentive:T,refurbishmentIncentive:D,refurbishmentRate:R,repairIncentive:I,repairRate:C,reuseIncentive:j}=e,F=P*E,L=Math.max(s-F,0),N=m*s+g*L,B=j+I+D+k,z=y*s,V=Math.max(0,F-s+z+N),W=k/B*V,H=b*Math.min(u,W),U=D/B*V,$=b*Math.min(U,f),q=I/B*V,Y=b*Math.min(q,p),X=j/(j+D+x)*c,G=j/B*V,Z=Math.max(r-u+H,0),K=T/(O+T)*Z,J=x/(I+x)*l,Q=x/(j+D+x)*c,tt=w/(T+w)*h,te=O/(O+T)*Z,ti=M*Math.min(K,d),tr=T/(T+w)*h,tn=Math.max(n-d+ti,0),to=D/(j+D+x)*c,ta=Math.max(o-f+$,0),ts=Math.max(a-p+Y,0);return{t:i,stocks:t,parameters:e,variables:{demandForNaturalResources:te,demandForNewlyProducedPhones:W,demandForPhones:V,demandForRecycledMaterials:K,demandForRecycling:tn,demandForRefurbishedPhones:U,demandForRefurbishment:ta,demandForRepair:ts,demandForRepairedPhones:q,demandForResources:Z,demandForReusedPhones:G,inflowIncentiveSumForPhonesInUse:B,phoneGoal:F,phonesInUseExcess:L,supplyOfBrokenPhonesForDisposal:J,supplyOfBrokenPhonesForRepair:I/(I+x)*l,supplyOfDisposedPhonesForLandfilling:tt,supplyOfDisposedPhonesForRecycling:tr,supplyOfHibernatingPhonesForDisposal:Q,supplyOfHibernatingPhonesForRefurbishment:to,supplyOfHibernatingPhonesForReuse:X},flows:{abandon:N,acquireNewlyProduced:H,acquireRefurbished:$,acquireRepaired:Y,acquireUsed:b*Math.min(X,G),capacityOfNewlyProducedPhonesAdjustment:v*(W-r),capacityOfRecycledMaterialsAdjustment:v*(K-n),capacityOfRefurbishedPhonesAdjustment:v*(U-o),disposeBroken:_*J,disposeHibernating:_*Q,goBroken:z,landfill:S*tt,produceFromNaturalResources:M*te,produceFromRecycledMaterials:ti,recycle:A*Math.min(tr,tn),refurbish:R*Math.min(to,ta),repair:C*Math.min(l,ts),repairShopCapcityAdjustment:v*(q-a)}}}// eslint-disable-next-line class-methods-use-this +accumulateFlowsPerStock(t){let{abandon:e,acquireNewlyProduced:i,acquireRefurbished:r,acquireRepaired:n,acquireUsed:o,capacityOfNewlyProducedPhonesAdjustment:a,capacityOfRecycledMaterialsAdjustment:s,capacityOfRefurbishedPhonesAdjustment:l,disposeBroken:h,disposeHibernating:c,goBroken:u,landfill:d,produceFromNaturalResources:f,produceFromRecycledMaterials:p,recycle:g,refurbish:m,repair:b,repairShopCapcityAdjustment:y}=t;return{capacityOfNewlyProducedPhones:a,capacityOfRecycledMaterials:s,capacityOfRefurbishedPhones:l,capacityOfRepairedPhones:y,phonesInUse:i+r+n+o-(e+u),supplyOfBrokenPhones:u-(h+b),supplyOfDisposedPhones:h+c-(d+g),supplyOfHibernatingPhones:e-(o+c+m),supplyOfNewlyProducedPhones:f+p-i,supplyOfRecycledMaterials:g-p,supplyOfRefurbishedPhones:m-r,supplyOfRepairedPhones:b-n}}constructor(){super(az,aV,aW,aH)}}aU.initialStocks={capacityOfNewlyProducedPhones:0,capacityOfRecycledMaterials:0,capacityOfRefurbishedPhones:0,capacityOfRepairedPhones:0,phonesInUse:0,supplyOfBrokenPhones:0,supplyOfDisposedPhones:0,supplyOfHibernatingPhones:0,supplyOfNewlyProducedPhones:0,supplyOfRecycledMaterials:0,supplyOfRefurbishedPhones:0,supplyOfRepairedPhones:0},aU.defaultParameters={abandonExcessRate:.5,abandonRate:.1,acquireRate:1,breakRate:.1,capacityAdjustmentRate:.1,disposeIncentive:.5,disposeRate:.5,landfillIncentive:.5,landfillRate:1,naturalResourcesIncentive:.5,newPhoneProductionRate:.5,newlyProducedPhoneIncentive:.82,numberOfUsers:1e6,phonesPerUserGoal:1,recycleRate:1,recyclingIncentive:.89,refurbishmentIncentive:.5,refurbishmentRate:1,repairIncentive:.5,repairRate:1,reuseIncentive:.86};var a$=class{evaluateFlowPerStockWithCache(t,e){return null!==this.flowPerStockCache&&this.flowPerStockCache.t===e?[...this.flowPerStockCache.value]:this.flowEvaluator(t,e)}step(){let{stocks:t,parameters:e,t:i}=this.record,r=this.model.step(t,i,this.h,this.flowEvaluatorWithCache),n=this.model.evaluate(r,e,i+this.h);return this.flowPerStockCache={t:n.t,value:this.model.stocksToStockArray(this.model.accumulateFlowsPerStock(n.flows))},this.record=n,n}constructor(t,e,i,r,n){this.model=t,this.parameters=i,this.flowPerStockCache=null,this.record=this.model.evaluate(e,i,r),this.h=n,this.flowEvaluator=this.model.createFlowEvaluator(i),this.flowEvaluatorWithCache=this.evaluateFlowPerStockWithCache.bind(this)}},aq={},aY={};aY=/** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * @@ -1057,7 +1057,7 @@ if("string"==typeof e)return e;if(a5(e))return a2(e,t)+"";if(a3(e))return ss?ss. * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a word is found, else `false`. - */function(t){return sp.test(t)};var sg={},sm="\ud800-\udfff",sb="\\u2700-\\u27bf",sy="a-z\\xdf-\\xf6\\xf8-\\xff",sv="A-Z\\xc0-\\xd6\\xd8-\\xde",sx="\\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",s_="['’]",sw="["+sx+"]",sS="["+sy+"]",sO="[^"+sm+sx+"\\d+"+sb+sy+sv+"]",sM="(?:\ud83c[\udde6-\uddff]){2}",sk="[\ud800-\udbff][\udc00-\udfff]",sP="["+sv+"]",sE="(?:"+sS+"|"+sO+")",sA="(?:"+s_+"(?:d|ll|m|re|s|t|ve))?",sD="(?:"+s_+"(?:D|LL|M|RE|S|T|VE))?",sT="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\ud83c[\udffb-\udfff])?",sR="[\\ufe0e\\ufe0f]?",sC="(?:\\u200d(?:"+["[^"+sm+"]",sM,sk].join("|")+")"+sR+sT+")*",sI="(?:"+["["+sb+"]",sM,sk].join("|")+")"+(sR+sT+sC),sj=RegExp([sP+"?"+sS+"+"+sA+"(?="+[sw,sP,"$"].join("|")+")","(?:"+sP+"|"+sO+")+"+sD+"(?="+[sw,sP+sE,"$"].join("|")+")",sP+"?"+sE+"+"+sA,sP+"+"+sD,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",sI].join("|"),"g");sg=/** + */function(t){return sp.test(t)};var sg={},sm="\ud800-\udfff",sb="\\u2700-\\u27bf",sy="a-z\\xdf-\\xf6\\xf8-\\xff",sv="A-Z\\xc0-\\xd6\\xd8-\\xde",sx="\\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",s_="['’]",sw="["+sx+"]",sS="["+sy+"]",sO="[^"+sm+sx+"\\d+"+sb+sy+sv+"]",sM="(?:\ud83c[\udde6-\uddff]){2}",sk="[\ud800-\udbff][\udc00-\udfff]",sP="["+sv+"]",sE="(?:"+sS+"|"+sO+")",sA="(?:"+s_+"(?:d|ll|m|re|s|t|ve))?",sT="(?:"+s_+"(?:D|LL|M|RE|S|T|VE))?",sD="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\ud83c[\udffb-\udfff])?",sR="[\\ufe0e\\ufe0f]?",sI="(?:\\u200d(?:"+["[^"+sm+"]",sM,sk].join("|")+")"+sR+sD+")*",sC="(?:"+["["+sb+"]",sM,sk].join("|")+")"+(sR+sD+sI),sj=RegExp([sP+"?"+sS+"+"+sA+"(?="+[sw,sP,"$"].join("|")+")","(?:"+sP+"|"+sO+")+"+sT+"(?="+[sw,sP+sE,"$"].join("|")+")",sP+"?"+sE+"+"+sA,sP+"+"+sT,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",sC].join("|"),"g");sg=/** * Splits a Unicode `string` into an array of its words. * * @private @@ -1088,14 +1088,14 @@ if("string"==typeof e)return e;if(a5(e))return a2(e,t)+"";if(a3(e))return ss?ss. * @param {boolean} clearStyles * If true removes the style elements from the file * @return {Promise} - */async function sL(t,e=!0){var i;let r=await fetch(t);if(r.status<200||r.status>=300)throw Error(`Server returned status ${r.status} (${r.statusText}) loading ${new URL(t).href}.`);let n=await r.text(),o=document.createElement("div");o.innerHTML=n;let a=o.querySelector("svg");if(null===a)throw Error(`No SVG element found in ${new URL(t).href}.`);return e&&(null===(i=a.querySelectorAll("style"))||void 0===i||i.forEach(t=>t.remove())),a}function sN(t,e,i){let r=t.querySelector(e);if(null===r)throw Error(`No element found matching selector ${e}.`);if(!(r instanceof i))throw Error(`Element matching selector ${e} has the wrong type.`);return r}i=function(t,e,i){return t+(i?"-":"")+e.toLowerCase()},aq=function(t){return aY(sc(aX(t).replace(sF,"")),i,"")};var sB={};sB=s("c93e5").getBundleURL("c39XQ")+"model.f8e270f6.svg";let sz=new URL(sB),sV=["abandon","acquireNewlyProduced","acquireRefurbished","acquireRepaired","acquireUsed","disposeBroken","disposeHibernating","goBroken","landfill","produceFromNaturalResources","produceFromRecycledMaterials","recycle","refurbish","repair"],sW={abandon:1,acquireNewlyProduced:-1,acquireRefurbished:-1,acquireRepaired:-1,acquireUsed:-1,disposeBroken:-1,disposeHibernating:-1,goBroken:-1,landfill:-1,produceFromNaturalResources:-1,produceFromRecycledMaterials:-1,recycle:-1,refurbish:-1,repair:-1};class sH{updateSvgFlows(t,e){let{flows:i}=e,r=5/e.parameters.numberOfUsers;sV.forEach(e=>{var o;let a=i[e],s=sW[e],l=`${/*@__PURE__*/n(aq)(e)}-flow`,h=sN(this.svg,`#${l}`,SVGPathElement),c=parseFloat(null!==(o=h.getAttribute("stroke-dashoffset"))&&void 0!==o?o:"0"),u=(Number.isNaN(c)?0:c)+Math.max(-6,Math.min(s*(t*a)*r,2));h.setAttribute("stroke-dashoffset",`${u}`),h.setAttribute("stroke-dasharray","0 20")})}updateSvgStocks(t,e){let{stocks:i}=e,r=5e4/e.parameters.numberOfUsers;this.model.stockIds.forEach(t=>{let e=/*@__PURE__*/n(aq)(t),o=this.svg.getElementById(e);if(null===o)throw Error(`SVG element with id ${e} for stock ${t} not found.`);if(!(o instanceof SVGCircleElement))throw Error(`Stock element for stock ${t} with id ${e} is not an SVG circle element.`);let a=i[t];o.setAttribute("r",`${Math.sqrt(a*r/Math.PI)}`)})}updateSvg(t,e){this.updateSvgFlows(t,e),this.updateSvgStocks(t,e)}update(t,e){this.updateSvg(t,e)}static prepareSvg(t,e){let i=t=>e.ownerDocument.createElementNS("http://www.w3.org/2000/svg",t);e.classList.add("model-visualization"),e.querySelectorAll("circle, rect, path, text").forEach(t=>{t.removeAttribute("style")});let r=[...e.children],o=i("g");o.classList.add("labels");let a=i("g");a.classList.add("supplies");let s=i("g");s.classList.add("capacities");let l=i("g");l.classList.add("flows"),e.append(s,l,a,o),e.querySelectorAll("text").forEach(t=>{let e=t.cloneNode(!0);e.classList.add("label"),o.append(e)}),e.querySelectorAll("rect").forEach(t=>{let e=t.cloneNode(!1);e.classList.add("capacity"),s.append(e)}),t.stockIds.filter(t=>t.startsWith("supplyOf")).forEach(t=>{let i=/*@__PURE__*/n(aq)(t.replace(/^supplyOf/,"")),r=sN(e,`#${i}`,SVGGeometryElement),o=r.cloneNode(!1);o.id=`supply-of-${r.id}`,o.classList.add("stock","supply"),a.append(o)});let h=sN(e,"#phones-in-use",SVGGeometryElement),c=h.cloneNode(!1);a.append(c),t.stockIds.filter(t=>t.startsWith("capacityOf")).forEach(t=>{let i=/*@__PURE__*/n(aq)(t.replace(/^capacityOf/,"")),r=sN(e,`#${i}`,SVGGeometryElement),o=r.cloneNode(!1);o.id=`capacity-of-${i}`,o.classList.add("stock","capacity"),s.append(o)}),sV.forEach(t=>{let i=/*@__PURE__*/n(aq)(t),r=sN(e,`#${i}`,SVGGeometryElement),o=r.cloneNode(!1);o.id=`${i}-edge`,o.removeAttribute("style"),o.classList.add("flow","edge"),l.append(o);let a=r.cloneNode(!1);a.id=`${i}-flow`,a.removeAttribute("style"),a.classList.add("flow","anim-edge"),l.append(a)}),r.forEach(t=>t.remove())}static async create(t){let e=await sL(sz);return this.prepareSvg(t,e),new sH(t,e)}constructor(t,e){this.model=t,this.svg=e,this.element=document.createElement("div"),this.element.append(this.svg)}}async function sU(){return new Promise(t=>{let e=document.readyState;("complete"===e||"interactive"===e)&&setTimeout(t,0),document.addEventListener("DOMContentLoaded",()=>t())})}class s${constructor(t){this.i18nKey=t}}class sq extends s${applyTo(t){return this.callable(t),t}constructor(t,e){super(t),this.callable=e}}class sY extends sq{static createFunction(t,e){t.forEach(t=>{if(!("string"==typeof t&&t.trim()===t&&null!==t.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)))throw Error(`Parameter name '${t}' can not be used as a variable`)});// eslint-disable-next-line @typescript-eslint/no-implied-eval -let i=Function(e).toString(),r=Function(`{ ${t.join(", ")} }`,`(${i})(); return { ${t.join(", ")} }`);return t=>{let e=r(t);return Object.assign(t,e),t}}constructor(t,e,i){super(t,sY.createFunction(e,i)),this.script=i}}async function sX(){let t=new aU,e=new a$(t,{...aU.initialStocks},{...aU.defaultParameters},0,.01),i=sN(document,"#parameter-transforms .available",HTMLElement),r=sN(document,"#parameter-transforms .active",HTMLElement),n=new Map;function o(){let i={...aU.defaultParameters};[...r.children].forEach(e=>{(0,h.strict)(e instanceof HTMLElement);let r=e.getAttribute("data-id");(0,h.strict)(null!==r);let o=n.get(r);(0,h.strict)(void 0!==o);let a={...i};o.applyTo(i);let s=function(e,i){let r={};return t.parameterIds.forEach(t=>{e[t]!==i[t]&&(r[t]=i[t])}),r}(a,i);e.title=`${o.script} + */async function sL(t,e=!0){var i;let r=await fetch(t);if(r.status<200||r.status>=300)throw Error(`Server returned status ${r.status} (${r.statusText}) loading ${new URL(t).href}.`);let n=await r.text(),o=document.createElement("div");o.innerHTML=n;let a=o.querySelector("svg");if(null===a)throw Error(`No SVG element found in ${new URL(t).href}.`);return e&&(null===(i=a.querySelectorAll("style"))||void 0===i||i.forEach(t=>t.remove())),a}function sN(t,e,i){let r=t.querySelector(e);if(null===r)throw Error(`No element found matching selector ${e}.`);if(!(r instanceof i))throw Error(`Element matching selector ${e} has the wrong type.`);return r}i=function(t,e,i){return t+(i?"-":"")+e.toLowerCase()},aq=function(t){return aY(sc(aX(t).replace(sF,"")),i,"")};var sB={};sB=s("c93e5").getBundleURL("c39XQ")+"model.f8e270f6.svg";let sz=new URL(sB),sV=["abandon","acquireNewlyProduced","acquireRefurbished","acquireRepaired","acquireUsed","disposeBroken","disposeHibernating","goBroken","landfill","produceFromNaturalResources","produceFromRecycledMaterials","recycle","refurbish","repair"],sW={abandon:1,acquireNewlyProduced:-1,acquireRefurbished:-1,acquireRepaired:-1,acquireUsed:-1,disposeBroken:-1,disposeHibernating:-1,goBroken:-1,landfill:-1,produceFromNaturalResources:-1,produceFromRecycledMaterials:-1,recycle:-1,refurbish:-1,repair:-1},sH=10*Math.sqrt(300),sU=300+sH;console.log(300,sH,sU);class s${updateSvgFlows(t,e,i){let{flows:r}=i,o=e*(3e4/i.parameters.numberOfUsers)/sU;sV.forEach(e=>{var i;let a=r[e],s=sW[e],l=`${/*@__PURE__*/n(aq)(e)}-flow`,h=sN(this.svg,`#${l}`,SVGPathElement),c=parseFloat(null!==(i=h.getAttribute("stroke-dashoffset"))&&void 0!==i?i:"0"),u=(Number.isNaN(c)?0:c)+Math.max(-9,Math.min(s*(t*a)*o,3));h.setAttribute("stroke-dashoffset",`${u}`),h.setAttribute("stroke-dasharray","0 30")})}updateSvgStocks(t,e,i){let{stocks:r}=i,o=3e4/i.parameters.numberOfUsers;this.model.stockIds.forEach(t=>{let e=/*@__PURE__*/n(aq)(t),i=this.svg.getElementById(e);if(null===i)throw Error(`SVG element with id ${e} for stock ${t} not found.`);if(!(i instanceof SVGCircleElement))throw Error(`Stock element for stock ${t} with id ${e} is not an SVG circle element.`);let a=r[t];i.setAttribute("r",`${Math.sqrt(a*o/Math.PI)}`)})}updateSvg(t,e,i){this.updateSvgFlows(t,e,i),this.updateSvgStocks(t,e,i)}update(t,e,i){this.updateSvg(t,e,i)}static prepareSvg(t,e){let i=t=>e.ownerDocument.createElementNS("http://www.w3.org/2000/svg",t);e.classList.add("model-visualization"),e.querySelectorAll("circle, rect, path, text").forEach(t=>{t.removeAttribute("style")});let r=[...e.children],o=i("g");o.classList.add("labels");let a=i("g");a.classList.add("supplies");let s=i("g");s.classList.add("capacities");let l=i("g");l.classList.add("flows"),e.append(s,l,a,o),e.querySelectorAll("text").forEach(t=>{let e=t.cloneNode(!0);e.classList.add("label"),o.append(e)}),e.querySelectorAll("rect").forEach(t=>{let e=t.cloneNode(!1);e.classList.add("capacity"),s.append(e)}),t.stockIds.filter(t=>t.startsWith("supplyOf")).forEach(t=>{let i=/*@__PURE__*/n(aq)(t.replace(/^supplyOf/,"")),r=sN(e,`#${i}`,SVGGeometryElement),o=r.cloneNode(!1);o.id=`supply-of-${r.id}`,o.classList.add("stock","supply"),a.append(o)});let h=sN(e,"#phones-in-use",SVGGeometryElement),c=h.cloneNode(!1);a.append(c),t.stockIds.filter(t=>t.startsWith("capacityOf")).forEach(t=>{let i=/*@__PURE__*/n(aq)(t.replace(/^capacityOf/,"")),r=sN(e,`#${i}`,SVGGeometryElement),o=r.cloneNode(!1);o.id=`capacity-of-${i}`,o.classList.add("stock","capacity"),s.append(o)}),sV.forEach(t=>{let i=/*@__PURE__*/n(aq)(t),r=sN(e,`#${i}`,SVGGeometryElement),o=r.cloneNode(!1);o.id=`${i}-edge`,o.removeAttribute("style"),o.classList.add("flow","edge"),l.append(o);let a=r.cloneNode(!1);a.id=`${i}-flow`,a.removeAttribute("style"),a.classList.add("flow","anim-edge"),l.append(a)}),r.forEach(t=>t.remove())}static async create(t){let e=await sL(sz);return this.prepareSvg(t,e),new s$(t,e)}constructor(t,e){this.model=t,this.svg=e,this.element=document.createElement("div"),this.element.append(this.svg)}}async function sq(){return new Promise(t=>{let e=document.readyState;("complete"===e||"interactive"===e)&&setTimeout(t,0),document.addEventListener("DOMContentLoaded",()=>t())})}class sY{constructor(t){this.i18nKey=t}}class sX extends sY{applyTo(t){return this.callable(t),t}constructor(t,e){super(t),this.callable=e}}class sG extends sX{static createFunction(t,e){t.forEach(t=>{if(!("string"==typeof t&&t.trim()===t&&null!==t.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)))throw Error(`Parameter name '${t}' can not be used as a variable`)});// eslint-disable-next-line @typescript-eslint/no-implied-eval +let i=Function(e).toString(),r=Function(`{ ${t.join(", ")} }`,`(${i})(); return { ${t.join(", ")} }`);return t=>{let e=r(t);return Object.assign(t,e),t}}constructor(t,e,i){super(t,sG.createFunction(e,i)),this.script=i}}let sZ={abandonExcessRate:.5,abandonRate:.02,acquireRate:1,breakRate:.01,capacityAdjustmentRate:.05,disposeIncentive:1.5,disposeRate:.5,landfillIncentive:1,landfillRate:1,naturalResourcesIncentive:1.5,newPhoneProductionRate:1,newlyProducedPhoneIncentive:2,numberOfUsers:1e6,phonesPerUserGoal:1.2,recycleRate:1,recyclingIncentive:.25,refurbishmentIncentive:.25,refurbishmentRate:1,repairIncentive:.5,repairRate:1,reuseIncentive:.25};async function sK(){let t=new aU,e=new a$(t,{...aU.initialStocks},{...sZ},0,.1),i=sN(document,"#parameter-transforms .available",HTMLElement),r=sN(document,"#parameter-transforms .active",HTMLElement),n=new Map;function o(){let i={...sZ};[...r.children].forEach(e=>{(0,h.strict)(e instanceof HTMLElement);let r=e.getAttribute("data-id");(0,h.strict)(null!==r);let o=n.get(r);(0,h.strict)(void 0!==o);let a={...i};o.applyTo(i);let s=function(e,i){let r={};return t.parameterIds.forEach(t=>{e[t]!==i[t]&&(r[t]=i[t])}),r}(a,i);e.title=`${o.script} ${JSON.stringify(s,null,2)} -${JSON.stringify(i,null,2)}`}),Object.assign(e.parameters,i)}am.create(i,{group:{name:"sharedParameterTransforms",pull:"clone",put:!1}}),am.create(r,{group:{name:"sharedParameterTransforms"},removeOnSpill:!0,onSort:()=>o(),onSpill:t=>{t.item.remove(),o()}});let a={create:(e,r)=>{if(n.has(e))throw Error(`Parameter transform with id '${e}' already exists`);n.set(e,new sY("none",t.parameterIds,r));let o=document.createElement("div");o.innerHTML=`
${e}
`;let a=o.firstChild;(0,h.strict)(null!==a),i.append(a)},destroy:t=>{n.delete(t)}};sN(document,"#add-parameter-transform",HTMLElement).addEventListener("click",()=>{let t=sN(document,"#parameter-transform-id",HTMLInputElement),e=t.value,i=sN(document,"#parameter-transform-script",HTMLTextAreaElement),r=i.value;a.create(e,r)});let s=0,l=sN(document,"#circularity-index",HTMLElement),c=0,u=sN(document,"#user-satisfaction",HTMLElement),d=await sH.create(t);function f(t){return aU.elementIds.map(e=>Object.entries(t[e]).map(([t,e])=>({id:t,value:e}))).reduce((t,e)=>[...t,...e],[])}document.body.prepend(d.element);let p=f(e.record),g=document.getElementById("chart");(0,h.strict)(null!==g,"chart element not found");let m=new rL(g,{type:"bar",data:{labels:p.map(t=>t.id),datasets:[{label:"Values",data:p.map(t=>t.value)}]},options:{animation:!1}});function b(t){// TODO: pass deltaMs to modelSimulator.step() -let i=e.step();!function(t){let{phonesInUse:e}=t.stocks,{produceFromNaturalResources:i,acquireNewlyProduced:r,acquireUsed:n,acquireRepaired:o,acquireRefurbished:a,disposeHibernating:h,disposeBroken:d,landfill:f}=t.flows,{phoneGoal:p}=t.variables;s+=(Math.min(1-Math.min(1,i/(r+n+o+a)),1-Math.min(1,f/(h+d)))-s)*.5,l.innerText=`${(100*s).toFixed(2)}%`,c+=((et.value),m.update(),d.update(t,i)}let y=!1,v=document.getElementById("run");async function x(){y=!0;let t=null;for(;v.checked;){// eslint-disable-next-line no-await-in-loop -let e=await aF(),i=null===t?0:e-t;b(i),t=e}y=!1}return(0,h.strict)(null!==v,"run checkbox not found"),v.addEventListener("input",()=>{y||x().catch(t=>{throw t})}),b(0),{model:t,modelSimulator:e,parameterTransforms:a}}window.circularEconomy=sU().then(sX)}();//# sourceMappingURL=index.a403ea04.js.map +${JSON.stringify(i,null,2)}`}),Object.assign(e.parameters,i)}am.create(i,{group:{name:"sharedParameterTransforms",pull:"clone",put:!1}}),am.create(r,{group:{name:"sharedParameterTransforms"},removeOnSpill:!0,onSort:()=>o(),onSpill:t=>{t.item.remove(),o()}});let a={create:(e,r)=>{if(n.has(e))throw Error(`Parameter transform with id '${e}' already exists`);n.set(e,new sG("none",t.parameterIds,r));let o=document.createElement("div");o.innerHTML=`
${e}
`;let a=o.firstChild;(0,h.strict)(null!==a),i.append(a)},destroy:t=>{n.delete(t)}};sN(document,"#add-parameter-transform",HTMLElement).addEventListener("click",()=>{let t=sN(document,"#parameter-transform-id",HTMLInputElement),e=t.value,i=sN(document,"#parameter-transform-script",HTMLTextAreaElement),r=i.value;a.create(e,r)});let s=sN(document,"#sliders",HTMLElement);t.parameterIds.filter(t=>"numberOfUsers"!==t).forEach(t=>{let e=document.createElement("div"),i=document.createElement("input");function r(){sZ[t]=Number.parseFloat(i.value),e.innerText=`${t} = ${sZ[t]}`,o()}i.type="range",i.min="0",i.max="4",i.step="0.001",i.value=`${sZ[t]}`,r(),i.addEventListener("input",r);let n=document.createElement("div");n.append(e,i),s.append(n)});let l=0,c=sN(document,"#circularity-index",HTMLElement),u=0,d=sN(document,"#user-satisfaction",HTMLElement),f=await s$.create(t);function p(t){return aU.elementIds.map(e=>Object.entries(t[e]).map(([t,e])=>({id:t,value:e}))).reduce((t,e)=>[...t,...e],[])}document.body.prepend(f.element);let g=p(e.record),m=document.getElementById("chart");(0,h.strict)(null!==m,"chart element not found");let b=new rL(m,{type:"bar",data:{labels:g.map(t=>t.id),datasets:[{label:"Values",data:g.map(t=>t.value)}]},options:{animation:!1}});function y(t){// TODO: pass deltaMs to modelSimulator.step() +let i=e.step();!function(t){let{phonesInUse:e}=t.stocks,{produceFromNaturalResources:i,acquireNewlyProduced:r,acquireUsed:n,acquireRepaired:o,acquireRefurbished:a,disposeHibernating:s,disposeBroken:h,landfill:f}=t.flows,{phoneGoal:p}=t.variables;l+=(Math.min(1-Math.min(1,i/(r+n+o+a)),1-Math.min(1,f/(s+h)))-l)*.5,c.innerText=`${(100*l).toFixed(1)}%`,u+=((et.value),b.update(),f.update(t,e.h,i)}let v=!1,x=document.getElementById("run");async function _(){v=!0;let t=null;for(;x.checked;){// eslint-disable-next-line no-await-in-loop +let e=await aF(),i=null===t?0:e-t;y(i),t=e}v=!1}return(0,h.strict)(null!==x,"run checkbox not found"),x.addEventListener("input",()=>{v||_().catch(t=>{throw t})}),y(0),{model:t,modelSimulator:e,parameterTransforms:a}}window.circularEconomy=sq().then(sK)}();//# sourceMappingURL=index.20493566.js.map -//# sourceMappingURL=index.a403ea04.js.map +//# sourceMappingURL=index.20493566.js.map diff --git a/assets/index.7e1ba3ae.js.map b/assets/index.20493566.js.map similarity index 52% rename from assets/index.7e1ba3ae.js.map rename to assets/index.20493566.js.map index 6997aea..a24ec55 100644 --- a/assets/index.7e1ba3ae.js.map +++ b/assets/index.20493566.js.map @@ -1 +1 @@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AI,CAAC,YAAY,CAAG,CACtB,CAwHF,CAvJe,GAMC,UAAA,CAAa,CACzB,SACA,aACA,YACA,QACD,CDvCH,MAAM,GAAW,CACf,gCACA,8BACA,8BACA,2BACA,cACA,uBACA,yBACA,4BACA,8BACA,4BACA,4BACA,yBACD,CAEK,GAAU,CACd,UACA,uBACA,qBACA,kBACA,cACA,0CACA,wCACA,wCACA,gBACA,qBACA,WACA,WACA,8BACA,+BACA,UACA,YACA,SACA,8BACD,CAEK,GAAc,CAClB,4BACA,+BACA,kBACA,6BACA,6BACA,yBACA,0BACA,wBACA,mCACA,YACA,oBACA,gBACA,eACA,iBACA,kCACA,gCACA,uCACA,qCACD,CAEK,GAAe,CACnB,oBACA,cACA,cACA,YACA,yBACA,mBACA,cACA,aACA,oBACA,eACA,4BACA,yBACA,8BACA,gBACA,oBACA,cACA,qBACA,yBACA,oBACA,kBACA,aACA,iBACD,AAwBD,OAAM,WAA6B,GAkDjC,kDAAkD;AAC3C,SAAS,CAAc,CAAE,CAAsB,CAAE,CAAS,CAAU,CACzE,GAAM,CAAA,8BACJ,CAA6B,CAAA,4BAC7B,CAA2B,CAAA,4BAC3B,CAA2B,CAAA,yBAC3B,CAAwB,CAAA,YACxB,CAAW,CAAA,qBACX,CAAoB,CAAA,uBACpB,CAAsB,CAAA,0BACtB,CAAyB,CAAA,4BACzB,CAA2B,CAAA,0BAC3B,CAAyB,CAAA,0BACzB,CAAyB,CAAA,uBACzB,CAAsB,CACvB,CAAG,EACE,CAAA,kBACJ,CAAiB,CAAA,YACjB,CAAW,CAAA,YACX,CAAW,CAAA,UACX,CAAS,CAAA,uBACT,CAAsB,CAAA,iBACtB,CAAgB,CAAA,YAChB,CAAW,CAAA,WACX,CAAU,CAAA,kBACV,CAAiB,CAAA,aACjB,CAAY,CAAA,0BACZ,CAAyB,CAAA,uBACzB,CAAsB,CAAA,4BACtB,CAA2B,CAAA,cAC3B,CAAa,CAAA,kBACb,CAAiB,CAAA,YACjB,CAAW,CAAA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CxB,EAAwB,SAAS,CAAG,CAAC,EAAG,AAAA,CAAA,AAAmB,IAAnB,CAAmB,EAAK,OAAO,CACrE,GACA,CAAC,CAAC,CAMJ,GACE,AAAC,CAAA,AAJD,CAAA,EAAc,EACV,EAAc,EACd,EAAY,CAHlB,EAK4B,CAAA,EA3CJ,GA4CxB,EAAwB,SAAS,CAAG,CAAC,EAAG,AAAA,CAAA,AAAmB,IAAnB,CAAmB,EAAK,OAAO,CACrE,GACA,CAAC,CAAC,AACN,EAMgB,GAEd,IAAM,EAAc,EAAc,EAClC,6BAA4B;AAC5B,EAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAG,EAAY,GAAG,CAAC,AAAC,GAAQ,EAAI,KAAK,EAEhE,EAAM,MAAM,GAEZ,EAAc,MAAM,CAAC,EAAS,EAChC,CAEA,IAAI,EAAU,CAAA,EACR,EAAc,SAAS,cAAc,CAAC,OAG5C,eAAe,IACb,EAAU,CAAA,EACV,IAAI,EAAyC,KAE7C,KAAO,EAAY,OAAO,EAAE,CAC1B,4CAA4C;AAC5C,IAAM,EAAgB,MAAM,AAAA,KACtB,EAAU,AAAe,OAAf,EAAsB,EAAI,EAAgB,EAC1D,EAAe,GACf,EAAa,CACf,CACA,EAAU,CAAA,CACZ,OAdA,AAAA,CAAA,EAAA,EAAA,MAAK,AAAL,EAAO,AAAgB,OAAhB,EAAsB,0BAgB7B,EAAY,gBAAgB,CAAC,QAAS,KAC/B,GACH,IAAiB,KAAK,CAAC,AAAC,IACtB,MAAM,CACR,EACJ,GAEA,EAAe,GAEgC,CAC7C,MAAA,EACA,eAAA,EACA,oBAAA,CACF,CAGF,CAQA,OAAO,eAAe,CAAG,AAAA,KAAgB,IAAI,CAAC,G,4D","sources":["","node_modules/assert/build/assert.js","node_modules/process/browser.js","node_modules/assert/build/internal/errors.js","node_modules/util/util.js","node_modules/util/support/types.js","node_modules/is-arguments/index.js","node_modules/has-tostringtag/shams.js","node_modules/has-symbols/shams.js","node_modules/call-bind/callBound.js","node_modules/get-intrinsic/index.js","node_modules/has-symbols/index.js","node_modules/has-proto/index.js","node_modules/function-bind/index.js","node_modules/function-bind/implementation.js","node_modules/hasown/index.js","node_modules/call-bind/index.js","node_modules/set-function-length/index.js","node_modules/define-data-property/index.js","node_modules/has-property-descriptors/index.js","node_modules/gopd/index.js","node_modules/is-generator-function/index.js","node_modules/which-typed-array/index.js","node_modules/for-each/index.js","node_modules/is-callable/index.js","node_modules/available-typed-arrays/index.js","node_modules/is-typed-array/index.js","node_modules/util/support/isBufferBrowser.js","node_modules/inherits/inherits_browser.js","node_modules/assert/build/internal/assert/assertion_error.js","node_modules/object.assign/polyfill.js","node_modules/object.assign/implementation.js","node_modules/object-keys/index.js","node_modules/object-keys/isArguments.js","node_modules/object-keys/implementation.js","node_modules/object-is/polyfill.js","node_modules/object-is/implementation.js","node_modules/assert/build/internal/util/comparisons.js","node_modules/object-is/index.js","node_modules/define-properties/index.js","node_modules/object-is/shim.js","node_modules/is-nan/index.js","node_modules/is-nan/implementation.js","node_modules/is-nan/polyfill.js","node_modules/is-nan/shim.js","src/ts/index.ts","node_modules/chart.js/auto/auto.js","node_modules/chart.js/dist/chart.js","node_modules/chart.js/src/core/core.animator.js","node_modules/chart.js/src/core/core.animation.js","node_modules/chart.js/src/core/core.animations.js","node_modules/chart.js/src/core/core.datasetController.js","node_modules/chart.js/src/controllers/controller.bar.js","node_modules/chart.js/src/controllers/controller.bubble.js","node_modules/chart.js/src/controllers/controller.doughnut.js","node_modules/chart.js/src/controllers/controller.line.js","node_modules/chart.js/src/controllers/controller.polarArea.js","node_modules/chart.js/src/controllers/controller.pie.js","node_modules/chart.js/src/controllers/controller.radar.js","node_modules/chart.js/src/controllers/controller.scatter.js","node_modules/chart.js/src/core/core.adapters.ts","node_modules/chart.js/src/core/core.interaction.js","node_modules/chart.js/src/core/core.layouts.js","node_modules/chart.js/src/platform/platform.base.js","node_modules/chart.js/src/platform/platform.basic.js","node_modules/chart.js/src/platform/platform.dom.js","node_modules/chart.js/src/platform/index.js","node_modules/chart.js/src/core/core.element.ts","node_modules/chart.js/src/core/core.scale.autoskip.js","node_modules/chart.js/src/core/core.scale.js","node_modules/chart.js/src/core/core.typedRegistry.js","node_modules/chart.js/src/core/core.registry.js","node_modules/chart.js/src/core/core.plugins.js","node_modules/chart.js/src/core/core.config.js","node_modules/chart.js/src/core/core.controller.js","node_modules/chart.js/src/elements/element.arc.ts","node_modules/chart.js/src/elements/element.line.js","node_modules/chart.js/src/elements/element.point.ts","node_modules/chart.js/src/elements/element.bar.js","node_modules/chart.js/src/plugins/plugin.colors.ts","node_modules/chart.js/src/plugins/plugin.decimation.js","node_modules/chart.js/src/plugins/plugin.filler/filler.segment.js","node_modules/chart.js/src/plugins/plugin.filler/filler.helper.js","node_modules/chart.js/src/plugins/plugin.filler/filler.options.js","node_modules/chart.js/src/plugins/plugin.filler/filler.target.stack.js","node_modules/chart.js/src/plugins/plugin.filler/simpleArc.js","node_modules/chart.js/src/plugins/plugin.filler/filler.target.js","node_modules/chart.js/src/plugins/plugin.filler/filler.drawing.js","node_modules/chart.js/src/plugins/plugin.filler/index.js","node_modules/chart.js/src/plugins/plugin.legend.js","node_modules/chart.js/src/plugins/plugin.title.js","node_modules/chart.js/src/plugins/plugin.subtitle.js","node_modules/chart.js/src/plugins/plugin.tooltip.js","node_modules/chart.js/src/scales/scale.category.js","node_modules/chart.js/src/scales/scale.linearbase.js","node_modules/chart.js/src/scales/scale.linear.js","node_modules/chart.js/src/scales/scale.logarithmic.js","node_modules/chart.js/src/scales/scale.radialLinear.js","node_modules/chart.js/src/scales/scale.time.js","node_modules/chart.js/src/scales/scale.timeseries.js","node_modules/chart.js/src/index.ts","node_modules/@swc/helpers/esm/_define_property.js","node_modules/chart.js/dist/chunks/helpers.segment.js","node_modules/chart.js/src/helpers/helpers.core.ts","node_modules/chart.js/src/helpers/helpers.math.ts","node_modules/chart.js/src/helpers/helpers.collection.ts","node_modules/chart.js/src/helpers/helpers.extras.ts","node_modules/chart.js/src/helpers/helpers.easing.ts","node_modules/chart.js/src/helpers/helpers.color.ts","node_modules/chart.js/src/core/core.animations.defaults.js","node_modules/chart.js/src/core/core.layouts.defaults.js","node_modules/chart.js/src/helpers/helpers.intl.ts","node_modules/chart.js/src/core/core.ticks.js","node_modules/chart.js/src/core/core.scale.defaults.js","node_modules/chart.js/src/core/core.defaults.js","node_modules/chart.js/src/helpers/helpers.canvas.ts","node_modules/chart.js/src/helpers/helpers.options.ts","node_modules/chart.js/src/helpers/helpers.config.ts","node_modules/chart.js/src/helpers/helpers.curve.ts","node_modules/chart.js/src/helpers/helpers.dom.ts","node_modules/chart.js/src/helpers/helpers.interpolation.ts","node_modules/chart.js/src/helpers/helpers.rtl.ts","node_modules/chart.js/src/helpers/helpers.segment.js","node_modules/@kurkle/color/dist/color.esm.js","node_modules/sortablejs/modular/sortable.esm.js","src/ts/util/animation-frame.ts","src/ts/circular-economy-model.ts","src/ts/model.ts","src/ts/box-model/box-model.ts","src/ts/box-model/engine.ts","src/ts/box-model/ode.ts","src/ts/model-simulator.ts","src/ts/visualization.ts","node_modules/lodash/kebabCase.js","node_modules/lodash/_createCompounder.js","node_modules/lodash/_arrayReduce.js","node_modules/lodash/deburr.js","node_modules/lodash/_deburrLetter.js","node_modules/lodash/_basePropertyOf.js","node_modules/lodash/toString.js","node_modules/lodash/_baseToString.js","node_modules/lodash/_Symbol.js","node_modules/lodash/_root.js","node_modules/lodash/_freeGlobal.js","node_modules/lodash/_arrayMap.js","node_modules/lodash/isArray.js","node_modules/lodash/isSymbol.js","node_modules/lodash/_baseGetTag.js","node_modules/lodash/_getRawTag.js","node_modules/lodash/_objectToString.js","node_modules/lodash/isObjectLike.js","node_modules/lodash/words.js","node_modules/lodash/_asciiWords.js","node_modules/lodash/_hasUnicodeWord.js","node_modules/lodash/_unicodeWords.js","src/ts/util/load-svg.ts","src/ts/util/guarded-query-selectors.ts","node_modules/@parcel/runtime-js/lib/runtime-1f561a508aa967b2.js","src/ts/util/document-ready.ts","src/ts/parameter-transform/scripted-parameter-transform.ts","src/ts/util/is-var-name.ts","src/ts/parameter-transform/function-parameter-transform.ts","src/ts/parameter-transform/parameter-transform.ts"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec7f3\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec7f3\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"GE7rZ\", function(module, exports) {\n// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar $bYqme = parcelRequire(\"bYqme\");\n\"use strict\";\nfunction $08030b30a83dd10b$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $08030b30a83dd10b$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $08030b30a83dd10b$var$_typeof(o);\n}\nfunction $08030b30a83dd10b$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, $08030b30a83dd10b$var$_toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction $08030b30a83dd10b$var$_createClass(Constructor, protoProps, staticProps) {\n if (protoProps) $08030b30a83dd10b$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $08030b30a83dd10b$var$_defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction $08030b30a83dd10b$var$_toPropertyKey(arg) {\n var key = $08030b30a83dd10b$var$_toPrimitive(arg, \"string\");\n return $08030b30a83dd10b$var$_typeof(key) === \"symbol\" ? key : String(key);\n}\nfunction $08030b30a83dd10b$var$_toPrimitive(input, hint) {\n if ($08030b30a83dd10b$var$_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if ($08030b30a83dd10b$var$_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction $08030b30a83dd10b$var$_classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\n\nvar $idZmf = parcelRequire(\"idZmf\");\nvar $08030b30a83dd10b$var$_require$codes = $idZmf.codes, $08030b30a83dd10b$var$ERR_AMBIGUOUS_ARGUMENT = $08030b30a83dd10b$var$_require$codes.ERR_AMBIGUOUS_ARGUMENT, $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE = $08030b30a83dd10b$var$_require$codes.ERR_INVALID_ARG_TYPE, $08030b30a83dd10b$var$ERR_INVALID_ARG_VALUE = $08030b30a83dd10b$var$_require$codes.ERR_INVALID_ARG_VALUE, $08030b30a83dd10b$var$ERR_INVALID_RETURN_VALUE = $08030b30a83dd10b$var$_require$codes.ERR_INVALID_RETURN_VALUE, $08030b30a83dd10b$var$ERR_MISSING_ARGS = $08030b30a83dd10b$var$_require$codes.ERR_MISSING_ARGS;\n\nvar $dfdGN = parcelRequire(\"dfdGN\");\n\nvar $5d0kT = parcelRequire(\"5d0kT\");\nvar $08030b30a83dd10b$var$inspect = $5d0kT.inspect;\n\nvar $5d0kT = parcelRequire(\"5d0kT\");\nvar $08030b30a83dd10b$require$_require$types = $5d0kT.types;\nvar $08030b30a83dd10b$var$isPromise = $08030b30a83dd10b$require$_require$types.isPromise, $08030b30a83dd10b$var$isRegExp = $08030b30a83dd10b$require$_require$types.isRegExp;\n\nvar $08030b30a83dd10b$var$objectAssign = (parcelRequire(\"5AA81\"))();\n\nvar $08030b30a83dd10b$var$objectIs = (parcelRequire(\"2bLwM\"))();\n\nvar $08030b30a83dd10b$var$RegExpPrototypeTest = (parcelRequire(\"9rEHq\"))(\"RegExp.prototype.test\");\nvar $08030b30a83dd10b$var$errorCache = new Map();\nvar $08030b30a83dd10b$var$isDeepEqual;\nvar $08030b30a83dd10b$var$isDeepStrictEqual;\nvar $08030b30a83dd10b$var$parseExpressionAt;\nvar $08030b30a83dd10b$var$findNodeAround;\nvar $08030b30a83dd10b$var$decoder;\n\nfunction $08030b30a83dd10b$var$lazyLoadComparison() {\n var comparison = (parcelRequire(\"gz1S4\"));\n $08030b30a83dd10b$var$isDeepEqual = comparison.isDeepEqual;\n $08030b30a83dd10b$var$isDeepStrictEqual = comparison.isDeepStrictEqual;\n}\n// Escape control characters but not \\n and \\t to keep the line breaks and\n// indentation intact.\n// eslint-disable-next-line no-control-regex\nvar $08030b30a83dd10b$var$escapeSequencesRegExp = /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/g;\nvar $08030b30a83dd10b$var$meta = [\n \"\\\\u0000\",\n \"\\\\u0001\",\n \"\\\\u0002\",\n \"\\\\u0003\",\n \"\\\\u0004\",\n \"\\\\u0005\",\n \"\\\\u0006\",\n \"\\\\u0007\",\n \"\\\\b\",\n \"\",\n \"\",\n \"\\\\u000b\",\n \"\\\\f\",\n \"\",\n \"\\\\u000e\",\n \"\\\\u000f\",\n \"\\\\u0010\",\n \"\\\\u0011\",\n \"\\\\u0012\",\n \"\\\\u0013\",\n \"\\\\u0014\",\n \"\\\\u0015\",\n \"\\\\u0016\",\n \"\\\\u0017\",\n \"\\\\u0018\",\n \"\\\\u0019\",\n \"\\\\u001a\",\n \"\\\\u001b\",\n \"\\\\u001c\",\n \"\\\\u001d\",\n \"\\\\u001e\",\n \"\\\\u001f\"\n];\nvar $08030b30a83dd10b$var$escapeFn = function escapeFn(str) {\n return $08030b30a83dd10b$var$meta[str.charCodeAt(0)];\n};\nvar $08030b30a83dd10b$var$warned = false;\n// The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\nvar $08030b30a83dd10b$var$assert = module.exports = $08030b30a83dd10b$var$ok;\nvar $08030b30a83dd10b$var$NO_EXCEPTION_SENTINEL = {};\n// All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\nfunction $08030b30a83dd10b$var$innerFail(obj) {\n if (obj.message instanceof Error) throw obj.message;\n throw new $dfdGN(obj);\n}\nfunction $08030b30a83dd10b$var$fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length;\n var internalMessage;\n if (argsLen === 0) internalMessage = \"Failed\";\n else if (argsLen === 1) {\n message = actual;\n actual = undefined;\n } else {\n if ($08030b30a83dd10b$var$warned === false) {\n $08030b30a83dd10b$var$warned = true;\n var warn = $bYqme.emitWarning ? $bYqme.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n if (argsLen === 2) operator = \"!=\";\n }\n if (message instanceof Error) throw message;\n var errArgs = {\n actual: actual,\n expected: expected,\n operator: operator === undefined ? \"fail\" : operator,\n stackStartFn: stackStartFn || $08030b30a83dd10b$var$fail\n };\n if (message !== undefined) errArgs.message = message;\n var err = new $dfdGN(errArgs);\n if (internalMessage) {\n err.message = internalMessage;\n err.generatedMessage = true;\n }\n throw err;\n}\n$08030b30a83dd10b$var$assert.fail = $08030b30a83dd10b$var$fail;\n// The AssertionError is defined in internal/error.\n$08030b30a83dd10b$var$assert.AssertionError = $dfdGN;\nfunction $08030b30a83dd10b$var$innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = false;\n if (argLen === 0) {\n generatedMessage = true;\n message = \"No value argument passed to `assert.ok()`\";\n } else if (message instanceof Error) throw message;\n var err = new $dfdGN({\n actual: value,\n expected: true,\n message: message,\n operator: \"==\",\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\n// Pure assertion tests whether a value is truthy, as determined\n// by !!value.\nfunction $08030b30a83dd10b$var$ok() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];\n $08030b30a83dd10b$var$innerOk.apply(void 0, [\n $08030b30a83dd10b$var$ok,\n args.length\n ].concat(args));\n}\n$08030b30a83dd10b$var$assert.ok = $08030b30a83dd10b$var$ok;\n// The equality assertion tests shallow, coercive equality with ==.\n/* eslint-disable no-restricted-properties */ $08030b30a83dd10b$var$assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n // eslint-disable-next-line eqeqeq\n if (actual != expected) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"==\",\n stackStartFn: equal\n });\n};\n// The non-equality assertion tests for whether two objects are not\n// equal with !=.\n$08030b30a83dd10b$var$assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n // eslint-disable-next-line eqeqeq\n if (actual == expected) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n};\n// The equivalence assertion tests a deep equality relation.\n$08030b30a83dd10b$var$assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($08030b30a83dd10b$var$isDeepEqual === undefined) $08030b30a83dd10b$var$lazyLoadComparison();\n if (!$08030b30a83dd10b$var$isDeepEqual(actual, expected)) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n};\n// The non-equivalence assertion tests for any deep inequality.\n$08030b30a83dd10b$var$assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($08030b30a83dd10b$var$isDeepEqual === undefined) $08030b30a83dd10b$var$lazyLoadComparison();\n if ($08030b30a83dd10b$var$isDeepEqual(actual, expected)) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n};\n/* eslint-enable */ $08030b30a83dd10b$var$assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($08030b30a83dd10b$var$isDeepEqual === undefined) $08030b30a83dd10b$var$lazyLoadComparison();\n if (!$08030b30a83dd10b$var$isDeepStrictEqual(actual, expected)) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n};\n$08030b30a83dd10b$var$assert.notDeepStrictEqual = $08030b30a83dd10b$var$notDeepStrictEqual;\nfunction $08030b30a83dd10b$var$notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($08030b30a83dd10b$var$isDeepEqual === undefined) $08030b30a83dd10b$var$lazyLoadComparison();\n if ($08030b30a83dd10b$var$isDeepStrictEqual(actual, expected)) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: $08030b30a83dd10b$var$notDeepStrictEqual\n });\n}\n$08030b30a83dd10b$var$assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!$08030b30a83dd10b$var$objectIs(actual, expected)) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n};\n$08030b30a83dd10b$var$assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($08030b30a83dd10b$var$objectIs(actual, expected)) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n};\nvar $08030b30a83dd10b$var$Comparison = /*#__PURE__*/ $08030b30a83dd10b$var$_createClass(function Comparison(obj, keys, actual) {\n var _this = this;\n $08030b30a83dd10b$var$_classCallCheck(this, Comparison);\n keys.forEach(function(key) {\n if (key in obj) {\n if (actual !== undefined && typeof actual[key] === \"string\" && $08030b30a83dd10b$var$isRegExp(obj[key]) && $08030b30a83dd10b$var$RegExpPrototypeTest(obj[key], actual[key])) _this[key] = actual[key];\n else _this[key] = obj[key];\n }\n });\n});\nfunction $08030b30a83dd10b$var$compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !$08030b30a83dd10b$var$isDeepStrictEqual(actual[key], expected[key])) {\n if (!message) {\n // Create placeholder objects to create a nice output.\n var a = new $08030b30a83dd10b$var$Comparison(actual, keys);\n var b = new $08030b30a83dd10b$var$Comparison(expected, keys, actual);\n var err = new $dfdGN({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n err.actual = actual;\n err.expected = expected;\n err.operator = fn.name;\n throw err;\n }\n $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n}\nfunction $08030b30a83dd10b$var$expectedException(actual, expected, msg, fn) {\n if (typeof expected !== \"function\") {\n if ($08030b30a83dd10b$var$isRegExp(expected)) return $08030b30a83dd10b$var$RegExpPrototypeTest(expected, actual);\n // assert.doesNotThrow does not accept objects.\n if (arguments.length === 2) throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE(\"expected\", [\n \"Function\",\n \"RegExp\"\n ], expected);\n // Handle primitives properly.\n if ($08030b30a83dd10b$var$_typeof(actual) !== \"object\" || actual === null) {\n var err = new $dfdGN({\n actual: actual,\n expected: expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n err.operator = fn.name;\n throw err;\n }\n var keys = Object.keys(expected);\n // Special handle errors to make sure the name and the message are compared\n // as well.\n if (expected instanceof Error) keys.push(\"name\", \"message\");\n else if (keys.length === 0) throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n if ($08030b30a83dd10b$var$isDeepEqual === undefined) $08030b30a83dd10b$var$lazyLoadComparison();\n keys.forEach(function(key) {\n if (typeof actual[key] === \"string\" && $08030b30a83dd10b$var$isRegExp(expected[key]) && $08030b30a83dd10b$var$RegExpPrototypeTest(expected[key], actual[key])) return;\n $08030b30a83dd10b$var$compareExceptionKey(actual, expected, key, msg, keys, fn);\n });\n return true;\n }\n // Guard instanceof against arrow functions as they don't have a prototype.\n if (expected.prototype !== undefined && actual instanceof expected) return true;\n if (Error.isPrototypeOf(expected)) return false;\n return expected.call({}, actual) === true;\n}\nfunction $08030b30a83dd10b$var$getActual(fn) {\n if (typeof fn !== \"function\") throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return $08030b30a83dd10b$var$NO_EXCEPTION_SENTINEL;\n}\nfunction $08030b30a83dd10b$var$checkIsPromise(obj) {\n // Accept native ES6 promises and promises that are implemented in a similar\n // way. Do not accept thenables that use a function as `obj` and that have no\n // `catch` handler.\n // TODO: thenables are checked up until they have the correct methods,\n // but according to documentation, the `then` method should receive\n // the `fulfill` and `reject` arguments as well or it may be never resolved.\n return $08030b30a83dd10b$var$isPromise(obj) || obj !== null && $08030b30a83dd10b$var$_typeof(obj) === \"object\" && typeof obj.then === \"function\" && typeof obj.catch === \"function\";\n}\nfunction $08030b30a83dd10b$var$waitForActual(promiseFn) {\n return Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn === \"function\") {\n // Return a rejected promise if `promiseFn` throws synchronously.\n resultPromise = promiseFn();\n // Fail in case no promise is returned.\n if (!$08030b30a83dd10b$var$checkIsPromise(resultPromise)) throw new $08030b30a83dd10b$var$ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if ($08030b30a83dd10b$var$checkIsPromise(promiseFn)) resultPromise = promiseFn;\n else throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE(\"promiseFn\", [\n \"Function\",\n \"Promise\"\n ], promiseFn);\n return Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return $08030b30a83dd10b$var$NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n}\nfunction $08030b30a83dd10b$var$expectsError(stackStartFn, actual, error, message) {\n if (typeof error === \"string\") {\n if (arguments.length === 4) throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE(\"error\", [\n \"Object\",\n \"Error\",\n \"Function\",\n \"RegExp\"\n ], error);\n if ($08030b30a83dd10b$var$_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error) throw new $08030b30a83dd10b$var$ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error) throw new $08030b30a83dd10b$var$ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error;\n error = undefined;\n } else if (error != null && $08030b30a83dd10b$var$_typeof(error) !== \"object\" && typeof error !== \"function\") throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE(\"error\", [\n \"Object\",\n \"Error\",\n \"Function\",\n \"RegExp\"\n ], error);\n if (actual === $08030b30a83dd10b$var$NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n if (error && error.name) details += \" (\".concat(error.name, \")\");\n details += message ? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" ? \"rejection\" : \"exception\";\n $08030b30a83dd10b$var$innerFail({\n actual: undefined,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn: stackStartFn\n });\n }\n if (error && !$08030b30a83dd10b$var$expectedException(actual, error, message, stackStartFn)) throw actual;\n}\nfunction $08030b30a83dd10b$var$expectsNoError(stackStartFn, actual, error, message) {\n if (actual === $08030b30a83dd10b$var$NO_EXCEPTION_SENTINEL) return;\n if (typeof error === \"string\") {\n message = error;\n error = undefined;\n }\n if (!error || $08030b30a83dd10b$var$expectedException(actual, error)) {\n var details = message ? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"doesNotReject\" ? \"rejection\" : \"exception\";\n $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, \"\\n\") + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn: stackStartFn\n });\n }\n throw actual;\n}\n$08030b30a83dd10b$var$assert.throws = function throws(promiseFn) {\n for(var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++)args[_key2 - 1] = arguments[_key2];\n $08030b30a83dd10b$var$expectsError.apply(void 0, [\n throws,\n $08030b30a83dd10b$var$getActual(promiseFn)\n ].concat(args));\n};\n$08030b30a83dd10b$var$assert.rejects = function rejects(promiseFn) {\n for(var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++)args[_key3 - 1] = arguments[_key3];\n return $08030b30a83dd10b$var$waitForActual(promiseFn).then(function(result) {\n return $08030b30a83dd10b$var$expectsError.apply(void 0, [\n rejects,\n result\n ].concat(args));\n });\n};\n$08030b30a83dd10b$var$assert.doesNotThrow = function doesNotThrow(fn) {\n for(var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++)args[_key4 - 1] = arguments[_key4];\n $08030b30a83dd10b$var$expectsNoError.apply(void 0, [\n doesNotThrow,\n $08030b30a83dd10b$var$getActual(fn)\n ].concat(args));\n};\n$08030b30a83dd10b$var$assert.doesNotReject = function doesNotReject(fn) {\n for(var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++)args[_key5 - 1] = arguments[_key5];\n return $08030b30a83dd10b$var$waitForActual(fn).then(function(result) {\n return $08030b30a83dd10b$var$expectsNoError.apply(void 0, [\n doesNotReject,\n result\n ].concat(args));\n });\n};\n$08030b30a83dd10b$var$assert.ifError = function ifError(err) {\n if (err !== null && err !== undefined) {\n var message = \"ifError got unwanted exception: \";\n if ($08030b30a83dd10b$var$_typeof(err) === \"object\" && typeof err.message === \"string\") {\n if (err.message.length === 0 && err.constructor) message += err.constructor.name;\n else message += err.message;\n } else message += $08030b30a83dd10b$var$inspect(err);\n var newErr = new $dfdGN({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message: message,\n stackStartFn: ifError\n });\n // Make sure we actually have a stack trace!\n var origStack = err.stack;\n if (typeof origStack === \"string\") {\n // This will remove any duplicated frames from the error frames taken\n // from within `ifError` and add the original error frames to the newly\n // created ones.\n var tmp2 = origStack.split(\"\\n\");\n tmp2.shift();\n // Filter all frames existing in err.stack.\n var tmp1 = newErr.stack.split(\"\\n\");\n for(var i = 0; i < tmp2.length; i++){\n // Find the first occurrence of the frame.\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n // Only keep new frames.\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(\"\\n\"), \"\\n\").concat(tmp2.join(\"\\n\"));\n }\n throw newErr;\n }\n};\n// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a871df3dfb8ea663ef5e1f8f62701ec51384ecb\nfunction $08030b30a83dd10b$var$internalMatch(string, regexp, message, fn, fnName) {\n if (!$08030b30a83dd10b$var$isRegExp(regexp)) throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE(\"regexp\", \"RegExp\", regexp);\n var match = fnName === \"match\";\n if (typeof string !== \"string\" || $08030b30a83dd10b$var$RegExpPrototypeTest(regexp, string) !== match) {\n if (message instanceof Error) throw message;\n var generatedMessage = !message;\n // 'The input was expected to not match the regular expression ' +\n message = message || (typeof string !== \"string\" ? 'The \"string\" argument must be of type string. Received type ' + \"\".concat($08030b30a83dd10b$var$_typeof(string), \" (\").concat($08030b30a83dd10b$var$inspect(string), \")\") : (match ? \"The input did not match the regular expression \" : \"The input was expected to not match the regular expression \") + \"\".concat($08030b30a83dd10b$var$inspect(regexp), \". Input:\\n\\n\").concat($08030b30a83dd10b$var$inspect(string), \"\\n\"));\n var err = new $dfdGN({\n actual: string,\n expected: regexp,\n message: message,\n operator: fnName,\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\n$08030b30a83dd10b$var$assert.match = function match(string, regexp, message) {\n $08030b30a83dd10b$var$internalMatch(string, regexp, message, match, \"match\");\n};\n$08030b30a83dd10b$var$assert.doesNotMatch = function doesNotMatch(string, regexp, message) {\n $08030b30a83dd10b$var$internalMatch(string, regexp, message, doesNotMatch, \"doesNotMatch\");\n};\n// Expose a strict only variant of assert\nfunction $08030b30a83dd10b$var$strict() {\n for(var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++)args[_key6] = arguments[_key6];\n $08030b30a83dd10b$var$innerOk.apply(void 0, [\n $08030b30a83dd10b$var$strict,\n args.length\n ].concat(args));\n}\n$08030b30a83dd10b$var$assert.strict = $08030b30a83dd10b$var$objectAssign($08030b30a83dd10b$var$strict, $08030b30a83dd10b$var$assert, {\n equal: $08030b30a83dd10b$var$assert.strictEqual,\n deepEqual: $08030b30a83dd10b$var$assert.deepStrictEqual,\n notEqual: $08030b30a83dd10b$var$assert.notStrictEqual,\n notDeepEqual: $08030b30a83dd10b$var$assert.notDeepStrictEqual\n});\n$08030b30a83dd10b$var$assert.strict.strict = $08030b30a83dd10b$var$assert.strict;\n\n});\nparcelRegister(\"bYqme\", function(module, exports) {\n// shim for using process in browser\nvar $8b79be5a44896e9e$var$process = module.exports = {};\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\nvar $8b79be5a44896e9e$var$cachedSetTimeout;\nvar $8b79be5a44896e9e$var$cachedClearTimeout;\nfunction $8b79be5a44896e9e$var$defaultSetTimout() {\n throw new Error(\"setTimeout has not been defined\");\n}\nfunction $8b79be5a44896e9e$var$defaultClearTimeout() {\n throw new Error(\"clearTimeout has not been defined\");\n}\n(function() {\n try {\n if (typeof setTimeout === \"function\") $8b79be5a44896e9e$var$cachedSetTimeout = setTimeout;\n else $8b79be5a44896e9e$var$cachedSetTimeout = $8b79be5a44896e9e$var$defaultSetTimout;\n } catch (e) {\n $8b79be5a44896e9e$var$cachedSetTimeout = $8b79be5a44896e9e$var$defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === \"function\") $8b79be5a44896e9e$var$cachedClearTimeout = clearTimeout;\n else $8b79be5a44896e9e$var$cachedClearTimeout = $8b79be5a44896e9e$var$defaultClearTimeout;\n } catch (e) {\n $8b79be5a44896e9e$var$cachedClearTimeout = $8b79be5a44896e9e$var$defaultClearTimeout;\n }\n})();\nfunction $8b79be5a44896e9e$var$runTimeout(fun) {\n if ($8b79be5a44896e9e$var$cachedSetTimeout === setTimeout) //normal enviroments in sane situations\n return setTimeout(fun, 0);\n // if setTimeout wasn't available but was latter defined\n if (($8b79be5a44896e9e$var$cachedSetTimeout === $8b79be5a44896e9e$var$defaultSetTimout || !$8b79be5a44896e9e$var$cachedSetTimeout) && setTimeout) {\n $8b79be5a44896e9e$var$cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return $8b79be5a44896e9e$var$cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return $8b79be5a44896e9e$var$cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return $8b79be5a44896e9e$var$cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\nfunction $8b79be5a44896e9e$var$runClearTimeout(marker) {\n if ($8b79be5a44896e9e$var$cachedClearTimeout === clearTimeout) //normal enviroments in sane situations\n return clearTimeout(marker);\n // if clearTimeout wasn't available but was latter defined\n if (($8b79be5a44896e9e$var$cachedClearTimeout === $8b79be5a44896e9e$var$defaultClearTimeout || !$8b79be5a44896e9e$var$cachedClearTimeout) && clearTimeout) {\n $8b79be5a44896e9e$var$cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return $8b79be5a44896e9e$var$cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return $8b79be5a44896e9e$var$cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return $8b79be5a44896e9e$var$cachedClearTimeout.call(this, marker);\n }\n }\n}\nvar $8b79be5a44896e9e$var$queue = [];\nvar $8b79be5a44896e9e$var$draining = false;\nvar $8b79be5a44896e9e$var$currentQueue;\nvar $8b79be5a44896e9e$var$queueIndex = -1;\nfunction $8b79be5a44896e9e$var$cleanUpNextTick() {\n if (!$8b79be5a44896e9e$var$draining || !$8b79be5a44896e9e$var$currentQueue) return;\n $8b79be5a44896e9e$var$draining = false;\n if ($8b79be5a44896e9e$var$currentQueue.length) $8b79be5a44896e9e$var$queue = $8b79be5a44896e9e$var$currentQueue.concat($8b79be5a44896e9e$var$queue);\n else $8b79be5a44896e9e$var$queueIndex = -1;\n if ($8b79be5a44896e9e$var$queue.length) $8b79be5a44896e9e$var$drainQueue();\n}\nfunction $8b79be5a44896e9e$var$drainQueue() {\n if ($8b79be5a44896e9e$var$draining) return;\n var timeout = $8b79be5a44896e9e$var$runTimeout($8b79be5a44896e9e$var$cleanUpNextTick);\n $8b79be5a44896e9e$var$draining = true;\n var len = $8b79be5a44896e9e$var$queue.length;\n while(len){\n $8b79be5a44896e9e$var$currentQueue = $8b79be5a44896e9e$var$queue;\n $8b79be5a44896e9e$var$queue = [];\n while(++$8b79be5a44896e9e$var$queueIndex < len)if ($8b79be5a44896e9e$var$currentQueue) $8b79be5a44896e9e$var$currentQueue[$8b79be5a44896e9e$var$queueIndex].run();\n $8b79be5a44896e9e$var$queueIndex = -1;\n len = $8b79be5a44896e9e$var$queue.length;\n }\n $8b79be5a44896e9e$var$currentQueue = null;\n $8b79be5a44896e9e$var$draining = false;\n $8b79be5a44896e9e$var$runClearTimeout(timeout);\n}\n$8b79be5a44896e9e$var$process.nextTick = function(fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) for(var i = 1; i < arguments.length; i++)args[i - 1] = arguments[i];\n $8b79be5a44896e9e$var$queue.push(new $8b79be5a44896e9e$var$Item(fun, args));\n if ($8b79be5a44896e9e$var$queue.length === 1 && !$8b79be5a44896e9e$var$draining) $8b79be5a44896e9e$var$runTimeout($8b79be5a44896e9e$var$drainQueue);\n};\n// v8 likes predictible objects\nfunction $8b79be5a44896e9e$var$Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\n$8b79be5a44896e9e$var$Item.prototype.run = function() {\n this.fun.apply(null, this.array);\n};\n$8b79be5a44896e9e$var$process.title = \"browser\";\n$8b79be5a44896e9e$var$process.browser = true;\n$8b79be5a44896e9e$var$process.env = {};\n$8b79be5a44896e9e$var$process.argv = [];\n$8b79be5a44896e9e$var$process.version = \"\"; // empty string to avoid regexp issues\n$8b79be5a44896e9e$var$process.versions = {};\nfunction $8b79be5a44896e9e$var$noop() {}\n$8b79be5a44896e9e$var$process.on = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.addListener = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.once = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.off = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.removeListener = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.removeAllListeners = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.emit = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.prependListener = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.prependOnceListener = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.listeners = function(name) {\n return [];\n};\n$8b79be5a44896e9e$var$process.binding = function(name) {\n throw new Error(\"process.binding is not supported\");\n};\n$8b79be5a44896e9e$var$process.cwd = function() {\n return \"/\";\n};\n$8b79be5a44896e9e$var$process.chdir = function(dir) {\n throw new Error(\"process.chdir is not supported\");\n};\n$8b79be5a44896e9e$var$process.umask = function() {\n return 0;\n};\n\n});\n\nparcelRegister(\"idZmf\", function(module, exports) {\n\n$parcel$export(module.exports, \"codes\", function () { return $d44909437516936e$export$e45cb6485273080e; }, function (v) { return $d44909437516936e$export$e45cb6485273080e = v; });\n// Currently in sync with Node.js lib/internal/errors.js\n// https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f\n/* eslint node-core/documented-errors: \"error\" */ /* eslint node-core/alphabetize-errors: \"error\" */ /* eslint node-core/prefer-util-format-errors: \"error\" */ var $d44909437516936e$export$e45cb6485273080e;\n\"use strict\";\n// The whole point behind this internal module is to allow Node.js to no\n// longer be forced to treat every error message change as a semver-major\n// change. The NodeError classes here all expose a `code` property whose\n// value statically and permanently identifies the error. While the error\n// message may change, the code should not.\nfunction $d44909437516936e$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $d44909437516936e$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $d44909437516936e$var$_typeof(o);\n}\nfunction $d44909437516936e$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, $d44909437516936e$var$_toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction $d44909437516936e$var$_createClass(Constructor, protoProps, staticProps) {\n if (protoProps) $d44909437516936e$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $d44909437516936e$var$_defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction $d44909437516936e$var$_toPropertyKey(arg) {\n var key = $d44909437516936e$var$_toPrimitive(arg, \"string\");\n return $d44909437516936e$var$_typeof(key) === \"symbol\" ? key : String(key);\n}\nfunction $d44909437516936e$var$_toPrimitive(input, hint) {\n if ($d44909437516936e$var$_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if ($d44909437516936e$var$_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction $d44909437516936e$var$_classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction $d44909437516936e$var$_inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) throw new TypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) $d44909437516936e$var$_setPrototypeOf(subClass, superClass);\n}\nfunction $d44909437516936e$var$_setPrototypeOf(o, p) {\n $d44909437516936e$var$_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return $d44909437516936e$var$_setPrototypeOf(o, p);\n}\nfunction $d44909437516936e$var$_createSuper(Derived) {\n var hasNativeReflectConstruct = $d44909437516936e$var$_isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = $d44909437516936e$var$_getPrototypeOf(Derived), result;\n if (hasNativeReflectConstruct) {\n var NewTarget = $d44909437516936e$var$_getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else result = Super.apply(this, arguments);\n return $d44909437516936e$var$_possibleConstructorReturn(this, result);\n };\n}\nfunction $d44909437516936e$var$_possibleConstructorReturn(self, call) {\n if (call && ($d44909437516936e$var$_typeof(call) === \"object\" || typeof call === \"function\")) return call;\n else if (call !== void 0) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return $d44909437516936e$var$_assertThisInitialized(self);\n}\nfunction $d44909437516936e$var$_assertThisInitialized(self) {\n if (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n}\nfunction $d44909437516936e$var$_isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n}\nfunction $d44909437516936e$var$_getPrototypeOf(o) {\n $d44909437516936e$var$_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return $d44909437516936e$var$_getPrototypeOf(o);\n}\nvar $d44909437516936e$var$codes = {};\n// Lazy loaded\nvar $d44909437516936e$var$assert;\nvar $d44909437516936e$var$util;\nfunction $d44909437516936e$var$createErrorType(code, message, Base) {\n if (!Base) Base = Error;\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === \"string\") return message;\n else return message(arg1, arg2, arg3);\n }\n var NodeError = /*#__PURE__*/ function(_Base) {\n $d44909437516936e$var$_inherits(NodeError, _Base);\n var _super = $d44909437516936e$var$_createSuper(NodeError);\n function NodeError(arg1, arg2, arg3) {\n var _this;\n $d44909437516936e$var$_classCallCheck(this, NodeError);\n _this = _super.call(this, getMessage(arg1, arg2, arg3));\n _this.code = code;\n return _this;\n }\n return $d44909437516936e$var$_createClass(NodeError);\n }(Base);\n $d44909437516936e$var$codes[code] = NodeError;\n}\n// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\nfunction $d44909437516936e$var$oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function(i) {\n return String(i);\n });\n if (len > 2) return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1];\n else if (len === 2) return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n else return \"of \".concat(thing, \" \").concat(expected[0]);\n } else return \"of \".concat(thing, \" \").concat(String(expected));\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\nfunction $d44909437516936e$var$startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction $d44909437516936e$var$endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) this_len = str.length;\n return str.substring(this_len - search.length, this_len) === search;\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\nfunction $d44909437516936e$var$includes(str, search, start) {\n if (typeof start !== \"number\") start = 0;\n if (start + search.length > str.length) return false;\n else return str.indexOf(search, start) !== -1;\n}\n$d44909437516936e$var$createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError);\n\n$d44909437516936e$var$createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n if ($d44909437516936e$var$assert === undefined) $d44909437516936e$var$assert = (parcelRequire(\"GE7rZ\"));\n $d44909437516936e$var$assert(typeof name === \"string\", \"'name' must be a string\");\n // determiner: 'must be' or 'must not be'\n var determiner;\n if (typeof expected === \"string\" && $d44909437516936e$var$startsWith(expected, \"not \")) {\n determiner = \"must not be\";\n expected = expected.replace(/^not /, \"\");\n } else determiner = \"must be\";\n var msg;\n if ($d44909437516936e$var$endsWith(name, \" argument\")) // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat($d44909437516936e$var$oneOf(expected, \"type\"));\n else {\n var type = $d44909437516936e$var$includes(name, \".\") ? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat($d44909437516936e$var$oneOf(expected, \"type\"));\n }\n // TODO(BridgeAR): Improve the output by showing `null` and similar.\n msg += \". Received type \".concat($d44909437516936e$var$_typeof(actual));\n return msg;\n}, TypeError);\n\n$d44909437516936e$var$createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"is invalid\";\n if ($d44909437516936e$var$util === undefined) $d44909437516936e$var$util = (parcelRequire(\"5d0kT\"));\n var inspected = $d44909437516936e$var$util.inspect(value);\n if (inspected.length > 128) inspected = \"\".concat(inspected.slice(0, 128), \"...\");\n return \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n}, TypeError, RangeError);\n$d44909437516936e$var$createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n if (value && value.constructor && value.constructor.name) type = \"instance of \".concat(value.constructor.name);\n else type = \"type \".concat($d44909437516936e$var$_typeof(value));\n return \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n}, TypeError);\n\n$d44909437516936e$var$createErrorType(\"ERR_MISSING_ARGS\", function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];\n if ($d44909437516936e$var$assert === undefined) $d44909437516936e$var$assert = (parcelRequire(\"GE7rZ\"));\n $d44909437516936e$var$assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \";\n var len = args.length;\n args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n });\n switch(len){\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \");\n msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n}, TypeError);\n$d44909437516936e$export$e45cb6485273080e = $d44909437516936e$var$codes;\n\n});\nparcelRegister(\"5d0kT\", function(module, exports) {\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar $bYqme = parcelRequire(\"bYqme\");\nvar $3cae6d5803bad4b3$var$getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for(var i = 0; i < keys.length; i++)descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n return descriptors;\n};\nvar $3cae6d5803bad4b3$var$formatRegExp = /%[sdj%]/g;\nmodule.exports.format = function(f) {\n if (!$3cae6d5803bad4b3$var$isString(f)) {\n var objects = [];\n for(var i = 0; i < arguments.length; i++)objects.push($3cae6d5803bad4b3$var$inspect(arguments[i]));\n return objects.join(\" \");\n }\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace($3cae6d5803bad4b3$var$formatRegExp, function(x) {\n if (x === \"%%\") return \"%\";\n if (i >= len) return x;\n switch(x){\n case \"%s\":\n return String(args[i++]);\n case \"%d\":\n return Number(args[i++]);\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return \"[Circular]\";\n }\n default:\n return x;\n }\n });\n for(var x = args[i]; i < len; x = args[++i])if ($3cae6d5803bad4b3$var$isNull(x) || !$3cae6d5803bad4b3$var$isObject(x)) str += \" \" + x;\n else str += \" \" + $3cae6d5803bad4b3$var$inspect(x);\n return str;\n};\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nmodule.exports.deprecate = function(fn, msg) {\n if (typeof $bYqme !== \"undefined\" && $bYqme.noDeprecation === true) return fn;\n // Allow for deprecating things in the process of starting up.\n if (typeof $bYqme === \"undefined\") return function() {\n return module.exports.deprecate(fn, msg).apply(this, arguments);\n };\n var warned = false;\n function deprecated() {\n if (!warned) {\n if ($bYqme.throwDeprecation) throw new Error(msg);\n else if ($bYqme.traceDeprecation) console.trace(msg);\n else console.error(msg);\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n return deprecated;\n};\nvar $3cae6d5803bad4b3$var$debugs = {};\nvar $3cae6d5803bad4b3$var$debugEnvRegex = /^$/;\nvar $3cae6d5803bad4b3$var$debugEnv;\nmodule.exports.debuglog = function(set) {\n set = set.toUpperCase();\n if (!$3cae6d5803bad4b3$var$debugs[set]) {\n if ($3cae6d5803bad4b3$var$debugEnvRegex.test(set)) {\n var pid = $bYqme.pid;\n $3cae6d5803bad4b3$var$debugs[set] = function() {\n var msg = module.exports.format.apply(module.exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else $3cae6d5803bad4b3$var$debugs[set] = function() {};\n }\n return $3cae6d5803bad4b3$var$debugs[set];\n};\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */ /* legacy: obj, showHidden, depth, colors*/ function $3cae6d5803bad4b3$var$inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: $3cae6d5803bad4b3$var$stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if ($3cae6d5803bad4b3$var$isBoolean(opts)) // legacy...\n ctx.showHidden = opts;\n else if (opts) // got an \"options\" object\n module.exports._extend(ctx, opts);\n // set default options\n if ($3cae6d5803bad4b3$var$isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if ($3cae6d5803bad4b3$var$isUndefined(ctx.depth)) ctx.depth = 2;\n if ($3cae6d5803bad4b3$var$isUndefined(ctx.colors)) ctx.colors = false;\n if ($3cae6d5803bad4b3$var$isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = $3cae6d5803bad4b3$var$stylizeWithColor;\n return $3cae6d5803bad4b3$var$formatValue(ctx, obj, ctx.depth);\n}\nmodule.exports.inspect = $3cae6d5803bad4b3$var$inspect;\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\n$3cae6d5803bad4b3$var$inspect.colors = {\n \"bold\": [\n 1,\n 22\n ],\n \"italic\": [\n 3,\n 23\n ],\n \"underline\": [\n 4,\n 24\n ],\n \"inverse\": [\n 7,\n 27\n ],\n \"white\": [\n 37,\n 39\n ],\n \"grey\": [\n 90,\n 39\n ],\n \"black\": [\n 30,\n 39\n ],\n \"blue\": [\n 34,\n 39\n ],\n \"cyan\": [\n 36,\n 39\n ],\n \"green\": [\n 32,\n 39\n ],\n \"magenta\": [\n 35,\n 39\n ],\n \"red\": [\n 31,\n 39\n ],\n \"yellow\": [\n 33,\n 39\n ]\n};\n// Don't use 'blue' not visible on cmd.exe\n$3cae6d5803bad4b3$var$inspect.styles = {\n \"special\": \"cyan\",\n \"number\": \"yellow\",\n \"boolean\": \"yellow\",\n \"undefined\": \"grey\",\n \"null\": \"bold\",\n \"string\": \"green\",\n \"date\": \"magenta\",\n // \"name\": intentionally not styling\n \"regexp\": \"red\"\n};\nfunction $3cae6d5803bad4b3$var$stylizeWithColor(str, styleType) {\n var style = $3cae6d5803bad4b3$var$inspect.styles[styleType];\n if (style) return \"\\x1b[\" + $3cae6d5803bad4b3$var$inspect.colors[style][0] + \"m\" + str + \"\\x1b[\" + $3cae6d5803bad4b3$var$inspect.colors[style][1] + \"m\";\n else return str;\n}\nfunction $3cae6d5803bad4b3$var$stylizeNoColor(str, styleType) {\n return str;\n}\nfunction $3cae6d5803bad4b3$var$arrayToHash(array) {\n var hash = {};\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n return hash;\n}\nfunction $3cae6d5803bad4b3$var$formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect && value && $3cae6d5803bad4b3$var$isFunction(value.inspect) && // Filter out the util module, it's inspect function is special\n value.inspect !== module.exports.inspect && // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!$3cae6d5803bad4b3$var$isString(ret)) ret = $3cae6d5803bad4b3$var$formatValue(ctx, ret, recurseTimes);\n return ret;\n }\n // Primitive types cannot have properties\n var primitive = $3cae6d5803bad4b3$var$formatPrimitive(ctx, value);\n if (primitive) return primitive;\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = $3cae6d5803bad4b3$var$arrayToHash(keys);\n if (ctx.showHidden) keys = Object.getOwnPropertyNames(value);\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if ($3cae6d5803bad4b3$var$isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0)) return $3cae6d5803bad4b3$var$formatError(value);\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if ($3cae6d5803bad4b3$var$isFunction(value)) {\n var name = value.name ? \": \" + value.name : \"\";\n return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n }\n if ($3cae6d5803bad4b3$var$isRegExp(value)) return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n if ($3cae6d5803bad4b3$var$isDate(value)) return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n if ($3cae6d5803bad4b3$var$isError(value)) return $3cae6d5803bad4b3$var$formatError(value);\n }\n var base = \"\", array = false, braces = [\n \"{\",\n \"}\"\n ];\n // Make Array say that they are Array\n if ($3cae6d5803bad4b3$var$isArray(value)) {\n array = true;\n braces = [\n \"[\",\n \"]\"\n ];\n }\n // Make functions say that they are functions\n if ($3cae6d5803bad4b3$var$isFunction(value)) {\n var n = value.name ? \": \" + value.name : \"\";\n base = \" [Function\" + n + \"]\";\n }\n // Make RegExps say that they are RegExps\n if ($3cae6d5803bad4b3$var$isRegExp(value)) base = \" \" + RegExp.prototype.toString.call(value);\n // Make dates with properties first say the date\n if ($3cae6d5803bad4b3$var$isDate(value)) base = \" \" + Date.prototype.toUTCString.call(value);\n // Make error with message first say the error\n if ($3cae6d5803bad4b3$var$isError(value)) base = \" \" + $3cae6d5803bad4b3$var$formatError(value);\n if (keys.length === 0 && (!array || value.length == 0)) return braces[0] + base + braces[1];\n if (recurseTimes < 0) {\n if ($3cae6d5803bad4b3$var$isRegExp(value)) return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n else return ctx.stylize(\"[Object]\", \"special\");\n }\n ctx.seen.push(value);\n var output;\n if (array) output = $3cae6d5803bad4b3$var$formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n else output = keys.map(function(key) {\n return $3cae6d5803bad4b3$var$formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n ctx.seen.pop();\n return $3cae6d5803bad4b3$var$reduceToSingleString(output, base, braces);\n}\nfunction $3cae6d5803bad4b3$var$formatPrimitive(ctx, value) {\n if ($3cae6d5803bad4b3$var$isUndefined(value)) return ctx.stylize(\"undefined\", \"undefined\");\n if ($3cae6d5803bad4b3$var$isString(value)) {\n var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return ctx.stylize(simple, \"string\");\n }\n if ($3cae6d5803bad4b3$var$isNumber(value)) return ctx.stylize(\"\" + value, \"number\");\n if ($3cae6d5803bad4b3$var$isBoolean(value)) return ctx.stylize(\"\" + value, \"boolean\");\n // For some reason typeof null is \"object\", so special case here.\n if ($3cae6d5803bad4b3$var$isNull(value)) return ctx.stylize(\"null\", \"null\");\n}\nfunction $3cae6d5803bad4b3$var$formatError(value) {\n return \"[\" + Error.prototype.toString.call(value) + \"]\";\n}\nfunction $3cae6d5803bad4b3$var$formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for(var i = 0, l = value.length; i < l; ++i)if ($3cae6d5803bad4b3$var$hasOwnProperty(value, String(i))) output.push($3cae6d5803bad4b3$var$formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));\n else output.push(\"\");\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) output.push($3cae6d5803bad4b3$var$formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));\n });\n return output;\n}\nfunction $3cae6d5803bad4b3$var$formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n };\n if (desc.get) {\n if (desc.set) str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n else str = ctx.stylize(\"[Getter]\", \"special\");\n } else if (desc.set) str = ctx.stylize(\"[Setter]\", \"special\");\n if (!$3cae6d5803bad4b3$var$hasOwnProperty(visibleKeys, key)) name = \"[\" + key + \"]\";\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if ($3cae6d5803bad4b3$var$isNull(recurseTimes)) str = $3cae6d5803bad4b3$var$formatValue(ctx, desc.value, null);\n else str = $3cae6d5803bad4b3$var$formatValue(ctx, desc.value, recurseTimes - 1);\n if (str.indexOf(\"\\n\") > -1) {\n if (array) str = str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\").slice(2);\n else str = \"\\n\" + str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\");\n }\n } else str = ctx.stylize(\"[Circular]\", \"special\");\n }\n if ($3cae6d5803bad4b3$var$isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) return str;\n name = JSON.stringify(\"\" + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.slice(1, -1);\n name = ctx.stylize(name, \"name\");\n } else {\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, \"string\");\n }\n }\n return name + \": \" + str;\n}\nfunction $3cae6d5803bad4b3$var$reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf(\"\\n\") >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, \"\").length + 1;\n }, 0);\n if (length > 60) return braces[0] + (base === \"\" ? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n \") + \" \" + braces[1];\n return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n}\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nmodule.exports.types = (parcelRequire(\"i6CGe\"));\nfunction $3cae6d5803bad4b3$var$isArray(ar) {\n return Array.isArray(ar);\n}\nmodule.exports.isArray = $3cae6d5803bad4b3$var$isArray;\nfunction $3cae6d5803bad4b3$var$isBoolean(arg) {\n return typeof arg === \"boolean\";\n}\nmodule.exports.isBoolean = $3cae6d5803bad4b3$var$isBoolean;\nfunction $3cae6d5803bad4b3$var$isNull(arg) {\n return arg === null;\n}\nmodule.exports.isNull = $3cae6d5803bad4b3$var$isNull;\nfunction $3cae6d5803bad4b3$var$isNullOrUndefined(arg) {\n return arg == null;\n}\nmodule.exports.isNullOrUndefined = $3cae6d5803bad4b3$var$isNullOrUndefined;\nfunction $3cae6d5803bad4b3$var$isNumber(arg) {\n return typeof arg === \"number\";\n}\nmodule.exports.isNumber = $3cae6d5803bad4b3$var$isNumber;\nfunction $3cae6d5803bad4b3$var$isString(arg) {\n return typeof arg === \"string\";\n}\nmodule.exports.isString = $3cae6d5803bad4b3$var$isString;\nfunction $3cae6d5803bad4b3$var$isSymbol(arg) {\n return typeof arg === \"symbol\";\n}\nmodule.exports.isSymbol = $3cae6d5803bad4b3$var$isSymbol;\nfunction $3cae6d5803bad4b3$var$isUndefined(arg) {\n return arg === void 0;\n}\nmodule.exports.isUndefined = $3cae6d5803bad4b3$var$isUndefined;\nfunction $3cae6d5803bad4b3$var$isRegExp(re) {\n return $3cae6d5803bad4b3$var$isObject(re) && $3cae6d5803bad4b3$var$objectToString(re) === \"[object RegExp]\";\n}\nmodule.exports.isRegExp = $3cae6d5803bad4b3$var$isRegExp;\nmodule.exports.types.isRegExp = $3cae6d5803bad4b3$var$isRegExp;\nfunction $3cae6d5803bad4b3$var$isObject(arg) {\n return typeof arg === \"object\" && arg !== null;\n}\nmodule.exports.isObject = $3cae6d5803bad4b3$var$isObject;\nfunction $3cae6d5803bad4b3$var$isDate(d) {\n return $3cae6d5803bad4b3$var$isObject(d) && $3cae6d5803bad4b3$var$objectToString(d) === \"[object Date]\";\n}\nmodule.exports.isDate = $3cae6d5803bad4b3$var$isDate;\nmodule.exports.types.isDate = $3cae6d5803bad4b3$var$isDate;\nfunction $3cae6d5803bad4b3$var$isError(e) {\n return $3cae6d5803bad4b3$var$isObject(e) && ($3cae6d5803bad4b3$var$objectToString(e) === \"[object Error]\" || e instanceof Error);\n}\nmodule.exports.isError = $3cae6d5803bad4b3$var$isError;\nmodule.exports.types.isNativeError = $3cae6d5803bad4b3$var$isError;\nfunction $3cae6d5803bad4b3$var$isFunction(arg) {\n return typeof arg === \"function\";\n}\nmodule.exports.isFunction = $3cae6d5803bad4b3$var$isFunction;\nfunction $3cae6d5803bad4b3$var$isPrimitive(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || // ES6 symbol\n typeof arg === \"undefined\";\n}\nmodule.exports.isPrimitive = $3cae6d5803bad4b3$var$isPrimitive;\n\nmodule.exports.isBuffer = (parcelRequire(\"3YNr2\"));\nfunction $3cae6d5803bad4b3$var$objectToString(o) {\n return Object.prototype.toString.call(o);\n}\nfunction $3cae6d5803bad4b3$var$pad(n) {\n return n < 10 ? \"0\" + n.toString(10) : n.toString(10);\n}\nvar $3cae6d5803bad4b3$var$months = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n];\n// 26 Feb 16:19:34\nfunction $3cae6d5803bad4b3$var$timestamp() {\n var d = new Date();\n var time = [\n $3cae6d5803bad4b3$var$pad(d.getHours()),\n $3cae6d5803bad4b3$var$pad(d.getMinutes()),\n $3cae6d5803bad4b3$var$pad(d.getSeconds())\n ].join(\":\");\n return [\n d.getDate(),\n $3cae6d5803bad4b3$var$months[d.getMonth()],\n time\n ].join(\" \");\n}\n// log is just a thin wrapper to console.log that prepends a timestamp\nmodule.exports.log = function() {\n console.log(\"%s - %s\", $3cae6d5803bad4b3$var$timestamp(), module.exports.format.apply(module.exports, arguments));\n};\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */ module.exports.inherits = (parcelRequire(\"fgp9u\"));\nmodule.exports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !$3cae6d5803bad4b3$var$isObject(add)) return origin;\n var keys = Object.keys(add);\n var i = keys.length;\n while(i--)origin[keys[i]] = add[keys[i]];\n return origin;\n};\nfunction $3cae6d5803bad4b3$var$hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\nvar $3cae6d5803bad4b3$var$kCustomPromisifiedSymbol = typeof Symbol !== \"undefined\" ? Symbol(\"util.promisify.custom\") : undefined;\nmodule.exports.promisify = function promisify(original) {\n if (typeof original !== \"function\") throw new TypeError('The \"original\" argument must be of type Function');\n if ($3cae6d5803bad4b3$var$kCustomPromisifiedSymbol && original[$3cae6d5803bad4b3$var$kCustomPromisifiedSymbol]) {\n var fn = original[$3cae6d5803bad4b3$var$kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\") throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n Object.defineProperty(fn, $3cae6d5803bad4b3$var$kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: false,\n writable: false,\n configurable: true\n });\n return fn;\n }\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function(resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n var args = [];\n for(var i = 0; i < arguments.length; i++)args.push(arguments[i]);\n args.push(function(err, value) {\n if (err) promiseReject(err);\n else promiseResolve(value);\n });\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n if ($3cae6d5803bad4b3$var$kCustomPromisifiedSymbol) Object.defineProperty(fn, $3cae6d5803bad4b3$var$kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: false,\n writable: false,\n configurable: true\n });\n return Object.defineProperties(fn, $3cae6d5803bad4b3$var$getOwnPropertyDescriptors(original));\n};\nmodule.exports.promisify.custom = $3cae6d5803bad4b3$var$kCustomPromisifiedSymbol;\nfunction $3cae6d5803bad4b3$var$callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\nfunction $3cae6d5803bad4b3$var$callbackify(original) {\n if (typeof original !== \"function\") throw new TypeError('The \"original\" argument must be of type Function');\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for(var i = 0; i < arguments.length; i++)args.push(arguments[i]);\n var maybeCb = args.pop();\n if (typeof maybeCb !== \"function\") throw new TypeError(\"The last argument must be of type Function\");\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args).then(function(ret) {\n $bYqme.nextTick(cb.bind(null, null, ret));\n }, function(rej) {\n $bYqme.nextTick($3cae6d5803bad4b3$var$callbackifyOnRejected.bind(null, rej, cb));\n });\n }\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified, $3cae6d5803bad4b3$var$getOwnPropertyDescriptors(original));\n return callbackified;\n}\nmodule.exports.callbackify = $3cae6d5803bad4b3$var$callbackify;\n\n});\nparcelRegister(\"i6CGe\", function(module, exports) {\n// Currently in sync with Node.js lib/internal/util/types.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\"use strict\";\n\nvar $hQsBH = parcelRequire(\"hQsBH\");\n\nvar $lCUJL = parcelRequire(\"lCUJL\");\n\nvar $iVfsl = parcelRequire(\"iVfsl\");\n\nvar $6n4Tb = parcelRequire(\"6n4Tb\");\nfunction $d2e6ca9e43aacb42$var$uncurryThis(f) {\n return f.call.bind(f);\n}\nvar $d2e6ca9e43aacb42$var$BigIntSupported = typeof BigInt !== \"undefined\";\nvar $d2e6ca9e43aacb42$var$SymbolSupported = typeof Symbol !== \"undefined\";\nvar $d2e6ca9e43aacb42$var$ObjectToString = $d2e6ca9e43aacb42$var$uncurryThis(Object.prototype.toString);\nvar $d2e6ca9e43aacb42$var$numberValue = $d2e6ca9e43aacb42$var$uncurryThis(Number.prototype.valueOf);\nvar $d2e6ca9e43aacb42$var$stringValue = $d2e6ca9e43aacb42$var$uncurryThis(String.prototype.valueOf);\nvar $d2e6ca9e43aacb42$var$booleanValue = $d2e6ca9e43aacb42$var$uncurryThis(Boolean.prototype.valueOf);\nif ($d2e6ca9e43aacb42$var$BigIntSupported) var $d2e6ca9e43aacb42$var$bigIntValue = $d2e6ca9e43aacb42$var$uncurryThis(BigInt.prototype.valueOf);\nif ($d2e6ca9e43aacb42$var$SymbolSupported) var $d2e6ca9e43aacb42$var$symbolValue = $d2e6ca9e43aacb42$var$uncurryThis(Symbol.prototype.valueOf);\nfunction $d2e6ca9e43aacb42$var$checkBoxedPrimitive(value, prototypeValueOf) {\n if (typeof value !== \"object\") return false;\n try {\n prototypeValueOf(value);\n return true;\n } catch (e) {\n return false;\n }\n}\nmodule.exports.isArgumentsObject = $hQsBH;\nmodule.exports.isGeneratorFunction = $lCUJL;\nmodule.exports.isTypedArray = $6n4Tb;\n// Taken from here and modified for better browser support\n// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js\nfunction $d2e6ca9e43aacb42$var$isPromise(input) {\n return typeof Promise !== \"undefined\" && input instanceof Promise || input !== null && typeof input === \"object\" && typeof input.then === \"function\" && typeof input.catch === \"function\";\n}\nmodule.exports.isPromise = $d2e6ca9e43aacb42$var$isPromise;\nfunction $d2e6ca9e43aacb42$var$isArrayBufferView(value) {\n if (typeof ArrayBuffer !== \"undefined\" && ArrayBuffer.isView) return ArrayBuffer.isView(value);\n return $6n4Tb(value) || $d2e6ca9e43aacb42$var$isDataView(value);\n}\nmodule.exports.isArrayBufferView = $d2e6ca9e43aacb42$var$isArrayBufferView;\nfunction $d2e6ca9e43aacb42$var$isUint8Array(value) {\n return $iVfsl(value) === \"Uint8Array\";\n}\nmodule.exports.isUint8Array = $d2e6ca9e43aacb42$var$isUint8Array;\nfunction $d2e6ca9e43aacb42$var$isUint8ClampedArray(value) {\n return $iVfsl(value) === \"Uint8ClampedArray\";\n}\nmodule.exports.isUint8ClampedArray = $d2e6ca9e43aacb42$var$isUint8ClampedArray;\nfunction $d2e6ca9e43aacb42$var$isUint16Array(value) {\n return $iVfsl(value) === \"Uint16Array\";\n}\nmodule.exports.isUint16Array = $d2e6ca9e43aacb42$var$isUint16Array;\nfunction $d2e6ca9e43aacb42$var$isUint32Array(value) {\n return $iVfsl(value) === \"Uint32Array\";\n}\nmodule.exports.isUint32Array = $d2e6ca9e43aacb42$var$isUint32Array;\nfunction $d2e6ca9e43aacb42$var$isInt8Array(value) {\n return $iVfsl(value) === \"Int8Array\";\n}\nmodule.exports.isInt8Array = $d2e6ca9e43aacb42$var$isInt8Array;\nfunction $d2e6ca9e43aacb42$var$isInt16Array(value) {\n return $iVfsl(value) === \"Int16Array\";\n}\nmodule.exports.isInt16Array = $d2e6ca9e43aacb42$var$isInt16Array;\nfunction $d2e6ca9e43aacb42$var$isInt32Array(value) {\n return $iVfsl(value) === \"Int32Array\";\n}\nmodule.exports.isInt32Array = $d2e6ca9e43aacb42$var$isInt32Array;\nfunction $d2e6ca9e43aacb42$var$isFloat32Array(value) {\n return $iVfsl(value) === \"Float32Array\";\n}\nmodule.exports.isFloat32Array = $d2e6ca9e43aacb42$var$isFloat32Array;\nfunction $d2e6ca9e43aacb42$var$isFloat64Array(value) {\n return $iVfsl(value) === \"Float64Array\";\n}\nmodule.exports.isFloat64Array = $d2e6ca9e43aacb42$var$isFloat64Array;\nfunction $d2e6ca9e43aacb42$var$isBigInt64Array(value) {\n return $iVfsl(value) === \"BigInt64Array\";\n}\nmodule.exports.isBigInt64Array = $d2e6ca9e43aacb42$var$isBigInt64Array;\nfunction $d2e6ca9e43aacb42$var$isBigUint64Array(value) {\n return $iVfsl(value) === \"BigUint64Array\";\n}\nmodule.exports.isBigUint64Array = $d2e6ca9e43aacb42$var$isBigUint64Array;\nfunction $d2e6ca9e43aacb42$var$isMapToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object Map]\";\n}\n$d2e6ca9e43aacb42$var$isMapToString.working = typeof Map !== \"undefined\" && $d2e6ca9e43aacb42$var$isMapToString(new Map());\nfunction $d2e6ca9e43aacb42$var$isMap(value) {\n if (typeof Map === \"undefined\") return false;\n return $d2e6ca9e43aacb42$var$isMapToString.working ? $d2e6ca9e43aacb42$var$isMapToString(value) : value instanceof Map;\n}\nmodule.exports.isMap = $d2e6ca9e43aacb42$var$isMap;\nfunction $d2e6ca9e43aacb42$var$isSetToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object Set]\";\n}\n$d2e6ca9e43aacb42$var$isSetToString.working = typeof Set !== \"undefined\" && $d2e6ca9e43aacb42$var$isSetToString(new Set());\nfunction $d2e6ca9e43aacb42$var$isSet(value) {\n if (typeof Set === \"undefined\") return false;\n return $d2e6ca9e43aacb42$var$isSetToString.working ? $d2e6ca9e43aacb42$var$isSetToString(value) : value instanceof Set;\n}\nmodule.exports.isSet = $d2e6ca9e43aacb42$var$isSet;\nfunction $d2e6ca9e43aacb42$var$isWeakMapToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object WeakMap]\";\n}\n$d2e6ca9e43aacb42$var$isWeakMapToString.working = typeof WeakMap !== \"undefined\" && $d2e6ca9e43aacb42$var$isWeakMapToString(new WeakMap());\nfunction $d2e6ca9e43aacb42$var$isWeakMap(value) {\n if (typeof WeakMap === \"undefined\") return false;\n return $d2e6ca9e43aacb42$var$isWeakMapToString.working ? $d2e6ca9e43aacb42$var$isWeakMapToString(value) : value instanceof WeakMap;\n}\nmodule.exports.isWeakMap = $d2e6ca9e43aacb42$var$isWeakMap;\nfunction $d2e6ca9e43aacb42$var$isWeakSetToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object WeakSet]\";\n}\n$d2e6ca9e43aacb42$var$isWeakSetToString.working = typeof WeakSet !== \"undefined\" && $d2e6ca9e43aacb42$var$isWeakSetToString(new WeakSet());\nfunction $d2e6ca9e43aacb42$var$isWeakSet(value) {\n return $d2e6ca9e43aacb42$var$isWeakSetToString(value);\n}\nmodule.exports.isWeakSet = $d2e6ca9e43aacb42$var$isWeakSet;\nfunction $d2e6ca9e43aacb42$var$isArrayBufferToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object ArrayBuffer]\";\n}\n$d2e6ca9e43aacb42$var$isArrayBufferToString.working = typeof ArrayBuffer !== \"undefined\" && $d2e6ca9e43aacb42$var$isArrayBufferToString(new ArrayBuffer());\nfunction $d2e6ca9e43aacb42$var$isArrayBuffer(value) {\n if (typeof ArrayBuffer === \"undefined\") return false;\n return $d2e6ca9e43aacb42$var$isArrayBufferToString.working ? $d2e6ca9e43aacb42$var$isArrayBufferToString(value) : value instanceof ArrayBuffer;\n}\nmodule.exports.isArrayBuffer = $d2e6ca9e43aacb42$var$isArrayBuffer;\nfunction $d2e6ca9e43aacb42$var$isDataViewToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object DataView]\";\n}\n$d2e6ca9e43aacb42$var$isDataViewToString.working = typeof ArrayBuffer !== \"undefined\" && typeof DataView !== \"undefined\" && $d2e6ca9e43aacb42$var$isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1));\nfunction $d2e6ca9e43aacb42$var$isDataView(value) {\n if (typeof DataView === \"undefined\") return false;\n return $d2e6ca9e43aacb42$var$isDataViewToString.working ? $d2e6ca9e43aacb42$var$isDataViewToString(value) : value instanceof DataView;\n}\nmodule.exports.isDataView = $d2e6ca9e43aacb42$var$isDataView;\n// Store a copy of SharedArrayBuffer in case it's deleted elsewhere\nvar $d2e6ca9e43aacb42$var$SharedArrayBufferCopy = typeof SharedArrayBuffer !== \"undefined\" ? SharedArrayBuffer : undefined;\nfunction $d2e6ca9e43aacb42$var$isSharedArrayBufferToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object SharedArrayBuffer]\";\n}\nfunction $d2e6ca9e43aacb42$var$isSharedArrayBuffer(value) {\n if (typeof $d2e6ca9e43aacb42$var$SharedArrayBufferCopy === \"undefined\") return false;\n if (typeof $d2e6ca9e43aacb42$var$isSharedArrayBufferToString.working === \"undefined\") $d2e6ca9e43aacb42$var$isSharedArrayBufferToString.working = $d2e6ca9e43aacb42$var$isSharedArrayBufferToString(new $d2e6ca9e43aacb42$var$SharedArrayBufferCopy());\n return $d2e6ca9e43aacb42$var$isSharedArrayBufferToString.working ? $d2e6ca9e43aacb42$var$isSharedArrayBufferToString(value) : value instanceof $d2e6ca9e43aacb42$var$SharedArrayBufferCopy;\n}\nmodule.exports.isSharedArrayBuffer = $d2e6ca9e43aacb42$var$isSharedArrayBuffer;\nfunction $d2e6ca9e43aacb42$var$isAsyncFunction(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object AsyncFunction]\";\n}\nmodule.exports.isAsyncFunction = $d2e6ca9e43aacb42$var$isAsyncFunction;\nfunction $d2e6ca9e43aacb42$var$isMapIterator(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object Map Iterator]\";\n}\nmodule.exports.isMapIterator = $d2e6ca9e43aacb42$var$isMapIterator;\nfunction $d2e6ca9e43aacb42$var$isSetIterator(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object Set Iterator]\";\n}\nmodule.exports.isSetIterator = $d2e6ca9e43aacb42$var$isSetIterator;\nfunction $d2e6ca9e43aacb42$var$isGeneratorObject(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object Generator]\";\n}\nmodule.exports.isGeneratorObject = $d2e6ca9e43aacb42$var$isGeneratorObject;\nfunction $d2e6ca9e43aacb42$var$isWebAssemblyCompiledModule(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object WebAssembly.Module]\";\n}\nmodule.exports.isWebAssemblyCompiledModule = $d2e6ca9e43aacb42$var$isWebAssemblyCompiledModule;\nfunction $d2e6ca9e43aacb42$var$isNumberObject(value) {\n return $d2e6ca9e43aacb42$var$checkBoxedPrimitive(value, $d2e6ca9e43aacb42$var$numberValue);\n}\nmodule.exports.isNumberObject = $d2e6ca9e43aacb42$var$isNumberObject;\nfunction $d2e6ca9e43aacb42$var$isStringObject(value) {\n return $d2e6ca9e43aacb42$var$checkBoxedPrimitive(value, $d2e6ca9e43aacb42$var$stringValue);\n}\nmodule.exports.isStringObject = $d2e6ca9e43aacb42$var$isStringObject;\nfunction $d2e6ca9e43aacb42$var$isBooleanObject(value) {\n return $d2e6ca9e43aacb42$var$checkBoxedPrimitive(value, $d2e6ca9e43aacb42$var$booleanValue);\n}\nmodule.exports.isBooleanObject = $d2e6ca9e43aacb42$var$isBooleanObject;\nfunction $d2e6ca9e43aacb42$var$isBigIntObject(value) {\n return $d2e6ca9e43aacb42$var$BigIntSupported && $d2e6ca9e43aacb42$var$checkBoxedPrimitive(value, $d2e6ca9e43aacb42$var$bigIntValue);\n}\nmodule.exports.isBigIntObject = $d2e6ca9e43aacb42$var$isBigIntObject;\nfunction $d2e6ca9e43aacb42$var$isSymbolObject(value) {\n return $d2e6ca9e43aacb42$var$SymbolSupported && $d2e6ca9e43aacb42$var$checkBoxedPrimitive(value, $d2e6ca9e43aacb42$var$symbolValue);\n}\nmodule.exports.isSymbolObject = $d2e6ca9e43aacb42$var$isSymbolObject;\nfunction $d2e6ca9e43aacb42$var$isBoxedPrimitive(value) {\n return $d2e6ca9e43aacb42$var$isNumberObject(value) || $d2e6ca9e43aacb42$var$isStringObject(value) || $d2e6ca9e43aacb42$var$isBooleanObject(value) || $d2e6ca9e43aacb42$var$isBigIntObject(value) || $d2e6ca9e43aacb42$var$isSymbolObject(value);\n}\nmodule.exports.isBoxedPrimitive = $d2e6ca9e43aacb42$var$isBoxedPrimitive;\nfunction $d2e6ca9e43aacb42$var$isAnyArrayBuffer(value) {\n return typeof Uint8Array !== \"undefined\" && ($d2e6ca9e43aacb42$var$isArrayBuffer(value) || $d2e6ca9e43aacb42$var$isSharedArrayBuffer(value));\n}\nmodule.exports.isAnyArrayBuffer = $d2e6ca9e43aacb42$var$isAnyArrayBuffer;\n[\n \"isProxy\",\n \"isExternal\",\n \"isModuleNamespaceObject\"\n].forEach(function(method) {\n Object.defineProperty(module.exports, method, {\n enumerable: false,\n value: function() {\n throw new Error(method + \" is not supported in userland\");\n }\n });\n});\n\n});\nparcelRegister(\"hQsBH\", function(module, exports) {\n\"use strict\";\n\nvar $cfdd7bc16a6f0391$var$hasToStringTag = (parcelRequire(\"hlgT2\"))();\n\nvar $9rEHq = parcelRequire(\"9rEHq\");\nvar $cfdd7bc16a6f0391$var$$toString = $9rEHq(\"Object.prototype.toString\");\nvar $cfdd7bc16a6f0391$var$isStandardArguments = function isArguments(value) {\n if ($cfdd7bc16a6f0391$var$hasToStringTag && value && typeof value === \"object\" && Symbol.toStringTag in value) return false;\n return $cfdd7bc16a6f0391$var$$toString(value) === \"[object Arguments]\";\n};\nvar $cfdd7bc16a6f0391$var$isLegacyArguments = function isArguments(value) {\n if ($cfdd7bc16a6f0391$var$isStandardArguments(value)) return true;\n return value !== null && typeof value === \"object\" && typeof value.length === \"number\" && value.length >= 0 && $cfdd7bc16a6f0391$var$$toString(value) !== \"[object Array]\" && $cfdd7bc16a6f0391$var$$toString(value.callee) === \"[object Function]\";\n};\nvar $cfdd7bc16a6f0391$var$supportsStandardArguments = function() {\n return $cfdd7bc16a6f0391$var$isStandardArguments(arguments);\n}();\n$cfdd7bc16a6f0391$var$isStandardArguments.isLegacyArguments = $cfdd7bc16a6f0391$var$isLegacyArguments; // for tests\nmodule.exports = $cfdd7bc16a6f0391$var$supportsStandardArguments ? $cfdd7bc16a6f0391$var$isStandardArguments : $cfdd7bc16a6f0391$var$isLegacyArguments;\n\n});\nparcelRegister(\"hlgT2\", function(module, exports) {\n\"use strict\";\n\nvar $iswqS = parcelRequire(\"iswqS\");\nmodule.exports = function hasToStringTagShams() {\n return $iswqS() && !!Symbol.toStringTag;\n};\n\n});\nparcelRegister(\"iswqS\", function(module, exports) {\n\"use strict\";\n/* eslint complexity: [2, 18], max-statements: [2, 33] */ module.exports = function hasSymbols() {\n if (typeof Symbol !== \"function\" || typeof Object.getOwnPropertySymbols !== \"function\") return false;\n if (typeof Symbol.iterator === \"symbol\") return true;\n var obj = {};\n var sym = Symbol(\"test\");\n var symObj = Object(sym);\n if (typeof sym === \"string\") return false;\n if (Object.prototype.toString.call(sym) !== \"[object Symbol]\") return false;\n if (Object.prototype.toString.call(symObj) !== \"[object Symbol]\") return false;\n // temp disabled per https://github.com/ljharb/object.assign/issues/17\n // if (sym instanceof Symbol) { return false; }\n // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n // if (!(symObj instanceof Symbol)) { return false; }\n // if (typeof Symbol.prototype.toString !== 'function') { return false; }\n // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n var symVal = 42;\n obj[sym] = symVal;\n for(sym in obj)return false;\n // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n if (typeof Object.keys === \"function\" && Object.keys(obj).length !== 0) return false;\n if (typeof Object.getOwnPropertyNames === \"function\" && Object.getOwnPropertyNames(obj).length !== 0) return false;\n var syms = Object.getOwnPropertySymbols(obj);\n if (syms.length !== 1 || syms[0] !== sym) return false;\n if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) return false;\n if (typeof Object.getOwnPropertyDescriptor === \"function\") {\n var descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n if (descriptor.value !== symVal || descriptor.enumerable !== true) return false;\n }\n return true;\n};\n\n});\n\n\nparcelRegister(\"9rEHq\", function(module, exports) {\n\"use strict\";\n\nvar $cbV5a = parcelRequire(\"cbV5a\");\n\nvar $6gXjj = parcelRequire(\"6gXjj\");\nvar $6e0634b5d975b0a1$var$$indexOf = $6gXjj($cbV5a(\"String.prototype.indexOf\"));\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n var intrinsic = $cbV5a(name, !!allowMissing);\n if (typeof intrinsic === \"function\" && $6e0634b5d975b0a1$var$$indexOf(name, \".prototype.\") > -1) return $6gXjj(intrinsic);\n return intrinsic;\n};\n\n});\nparcelRegister(\"cbV5a\", function(module, exports) {\n\"use strict\";\nvar $8e02ca77d270b092$var$undefined1;\nvar $8e02ca77d270b092$var$$SyntaxError = SyntaxError;\nvar $8e02ca77d270b092$var$$Function = Function;\nvar $8e02ca77d270b092$var$$TypeError = TypeError;\n// eslint-disable-next-line consistent-return\nvar $8e02ca77d270b092$var$getEvalledConstructor = function(expressionSyntax) {\n try {\n return $8e02ca77d270b092$var$$Function('\"use strict\"; return (' + expressionSyntax + \").constructor;\")();\n } catch (e) {}\n};\nvar $8e02ca77d270b092$var$$gOPD = Object.getOwnPropertyDescriptor;\nif ($8e02ca77d270b092$var$$gOPD) try {\n $8e02ca77d270b092$var$$gOPD({}, \"\");\n} catch (e) {\n $8e02ca77d270b092$var$$gOPD = null; // this is IE 8, which has a broken gOPD\n}\nvar $8e02ca77d270b092$var$throwTypeError = function() {\n throw new $8e02ca77d270b092$var$$TypeError();\n};\nvar $8e02ca77d270b092$var$ThrowTypeError = $8e02ca77d270b092$var$$gOPD ? function() {\n try {\n // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n arguments.callee; // IE 8 does not throw here\n return $8e02ca77d270b092$var$throwTypeError;\n } catch (calleeThrows) {\n try {\n // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n return $8e02ca77d270b092$var$$gOPD(arguments, \"callee\").get;\n } catch (gOPDthrows) {\n return $8e02ca77d270b092$var$throwTypeError;\n }\n }\n}() : $8e02ca77d270b092$var$throwTypeError;\n\nvar $8e02ca77d270b092$var$hasSymbols = (parcelRequire(\"iAT3w\"))();\n\nvar $8e02ca77d270b092$var$hasProto = (parcelRequire(\"5I7PD\"))();\nvar $8e02ca77d270b092$var$getProto = Object.getPrototypeOf || ($8e02ca77d270b092$var$hasProto ? function(x) {\n return x.__proto__;\n} // eslint-disable-line no-proto\n : null);\nvar $8e02ca77d270b092$var$needsEval = {};\nvar $8e02ca77d270b092$var$TypedArray = typeof Uint8Array === \"undefined\" || !$8e02ca77d270b092$var$getProto ? undefined : $8e02ca77d270b092$var$getProto(Uint8Array);\nvar $8e02ca77d270b092$var$INTRINSICS = {\n \"%AggregateError%\": typeof AggregateError === \"undefined\" ? undefined : AggregateError,\n \"%Array%\": Array,\n \"%ArrayBuffer%\": typeof ArrayBuffer === \"undefined\" ? undefined : ArrayBuffer,\n \"%ArrayIteratorPrototype%\": $8e02ca77d270b092$var$hasSymbols && $8e02ca77d270b092$var$getProto ? $8e02ca77d270b092$var$getProto([][Symbol.iterator]()) : undefined,\n \"%AsyncFromSyncIteratorPrototype%\": undefined,\n \"%AsyncFunction%\": $8e02ca77d270b092$var$needsEval,\n \"%AsyncGenerator%\": $8e02ca77d270b092$var$needsEval,\n \"%AsyncGeneratorFunction%\": $8e02ca77d270b092$var$needsEval,\n \"%AsyncIteratorPrototype%\": $8e02ca77d270b092$var$needsEval,\n \"%Atomics%\": typeof Atomics === \"undefined\" ? undefined : Atomics,\n \"%BigInt%\": typeof BigInt === \"undefined\" ? undefined : BigInt,\n \"%BigInt64Array%\": typeof BigInt64Array === \"undefined\" ? undefined : BigInt64Array,\n \"%BigUint64Array%\": typeof BigUint64Array === \"undefined\" ? undefined : BigUint64Array,\n \"%Boolean%\": Boolean,\n \"%DataView%\": typeof DataView === \"undefined\" ? undefined : DataView,\n \"%Date%\": Date,\n \"%decodeURI%\": decodeURI,\n \"%decodeURIComponent%\": decodeURIComponent,\n \"%encodeURI%\": encodeURI,\n \"%encodeURIComponent%\": encodeURIComponent,\n \"%Error%\": Error,\n \"%eval%\": eval,\n \"%EvalError%\": EvalError,\n \"%Float32Array%\": typeof Float32Array === \"undefined\" ? undefined : Float32Array,\n \"%Float64Array%\": typeof Float64Array === \"undefined\" ? undefined : Float64Array,\n \"%FinalizationRegistry%\": typeof FinalizationRegistry === \"undefined\" ? undefined : FinalizationRegistry,\n \"%Function%\": $8e02ca77d270b092$var$$Function,\n \"%GeneratorFunction%\": $8e02ca77d270b092$var$needsEval,\n \"%Int8Array%\": typeof Int8Array === \"undefined\" ? undefined : Int8Array,\n \"%Int16Array%\": typeof Int16Array === \"undefined\" ? undefined : Int16Array,\n \"%Int32Array%\": typeof Int32Array === \"undefined\" ? undefined : Int32Array,\n \"%isFinite%\": isFinite,\n \"%isNaN%\": isNaN,\n \"%IteratorPrototype%\": $8e02ca77d270b092$var$hasSymbols && $8e02ca77d270b092$var$getProto ? $8e02ca77d270b092$var$getProto($8e02ca77d270b092$var$getProto([][Symbol.iterator]())) : undefined,\n \"%JSON%\": typeof JSON === \"object\" ? JSON : undefined,\n \"%Map%\": typeof Map === \"undefined\" ? undefined : Map,\n \"%MapIteratorPrototype%\": typeof Map === \"undefined\" || !$8e02ca77d270b092$var$hasSymbols || !$8e02ca77d270b092$var$getProto ? undefined : $8e02ca77d270b092$var$getProto(new Map()[Symbol.iterator]()),\n \"%Math%\": Math,\n \"%Number%\": Number,\n \"%Object%\": Object,\n \"%parseFloat%\": parseFloat,\n \"%parseInt%\": parseInt,\n \"%Promise%\": typeof Promise === \"undefined\" ? undefined : Promise,\n \"%Proxy%\": typeof Proxy === \"undefined\" ? undefined : Proxy,\n \"%RangeError%\": RangeError,\n \"%ReferenceError%\": ReferenceError,\n \"%Reflect%\": typeof Reflect === \"undefined\" ? undefined : Reflect,\n \"%RegExp%\": RegExp,\n \"%Set%\": typeof Set === \"undefined\" ? undefined : Set,\n \"%SetIteratorPrototype%\": typeof Set === \"undefined\" || !$8e02ca77d270b092$var$hasSymbols || !$8e02ca77d270b092$var$getProto ? undefined : $8e02ca77d270b092$var$getProto(new Set()[Symbol.iterator]()),\n \"%SharedArrayBuffer%\": typeof SharedArrayBuffer === \"undefined\" ? undefined : SharedArrayBuffer,\n \"%String%\": String,\n \"%StringIteratorPrototype%\": $8e02ca77d270b092$var$hasSymbols && $8e02ca77d270b092$var$getProto ? $8e02ca77d270b092$var$getProto(\"\"[Symbol.iterator]()) : undefined,\n \"%Symbol%\": $8e02ca77d270b092$var$hasSymbols ? Symbol : undefined,\n \"%SyntaxError%\": $8e02ca77d270b092$var$$SyntaxError,\n \"%ThrowTypeError%\": $8e02ca77d270b092$var$ThrowTypeError,\n \"%TypedArray%\": $8e02ca77d270b092$var$TypedArray,\n \"%TypeError%\": $8e02ca77d270b092$var$$TypeError,\n \"%Uint8Array%\": typeof Uint8Array === \"undefined\" ? undefined : Uint8Array,\n \"%Uint8ClampedArray%\": typeof Uint8ClampedArray === \"undefined\" ? undefined : Uint8ClampedArray,\n \"%Uint16Array%\": typeof Uint16Array === \"undefined\" ? undefined : Uint16Array,\n \"%Uint32Array%\": typeof Uint32Array === \"undefined\" ? undefined : Uint32Array,\n \"%URIError%\": URIError,\n \"%WeakMap%\": typeof WeakMap === \"undefined\" ? undefined : WeakMap,\n \"%WeakRef%\": typeof WeakRef === \"undefined\" ? undefined : WeakRef,\n \"%WeakSet%\": typeof WeakSet === \"undefined\" ? undefined : WeakSet\n};\nif ($8e02ca77d270b092$var$getProto) try {\n null.error; // eslint-disable-line no-unused-expressions\n} catch (e) {\n // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n var $8e02ca77d270b092$var$errorProto = $8e02ca77d270b092$var$getProto($8e02ca77d270b092$var$getProto(e));\n $8e02ca77d270b092$var$INTRINSICS[\"%Error.prototype%\"] = $8e02ca77d270b092$var$errorProto;\n}\nvar $8e02ca77d270b092$var$doEval = function doEval(name) {\n var value;\n if (name === \"%AsyncFunction%\") value = $8e02ca77d270b092$var$getEvalledConstructor(\"async function () {}\");\n else if (name === \"%GeneratorFunction%\") value = $8e02ca77d270b092$var$getEvalledConstructor(\"function* () {}\");\n else if (name === \"%AsyncGeneratorFunction%\") value = $8e02ca77d270b092$var$getEvalledConstructor(\"async function* () {}\");\n else if (name === \"%AsyncGenerator%\") {\n var fn = doEval(\"%AsyncGeneratorFunction%\");\n if (fn) value = fn.prototype;\n } else if (name === \"%AsyncIteratorPrototype%\") {\n var gen = doEval(\"%AsyncGenerator%\");\n if (gen && $8e02ca77d270b092$var$getProto) value = $8e02ca77d270b092$var$getProto(gen.prototype);\n }\n $8e02ca77d270b092$var$INTRINSICS[name] = value;\n return value;\n};\nvar $8e02ca77d270b092$var$LEGACY_ALIASES = {\n \"%ArrayBufferPrototype%\": [\n \"ArrayBuffer\",\n \"prototype\"\n ],\n \"%ArrayPrototype%\": [\n \"Array\",\n \"prototype\"\n ],\n \"%ArrayProto_entries%\": [\n \"Array\",\n \"prototype\",\n \"entries\"\n ],\n \"%ArrayProto_forEach%\": [\n \"Array\",\n \"prototype\",\n \"forEach\"\n ],\n \"%ArrayProto_keys%\": [\n \"Array\",\n \"prototype\",\n \"keys\"\n ],\n \"%ArrayProto_values%\": [\n \"Array\",\n \"prototype\",\n \"values\"\n ],\n \"%AsyncFunctionPrototype%\": [\n \"AsyncFunction\",\n \"prototype\"\n ],\n \"%AsyncGenerator%\": [\n \"AsyncGeneratorFunction\",\n \"prototype\"\n ],\n \"%AsyncGeneratorPrototype%\": [\n \"AsyncGeneratorFunction\",\n \"prototype\",\n \"prototype\"\n ],\n \"%BooleanPrototype%\": [\n \"Boolean\",\n \"prototype\"\n ],\n \"%DataViewPrototype%\": [\n \"DataView\",\n \"prototype\"\n ],\n \"%DatePrototype%\": [\n \"Date\",\n \"prototype\"\n ],\n \"%ErrorPrototype%\": [\n \"Error\",\n \"prototype\"\n ],\n \"%EvalErrorPrototype%\": [\n \"EvalError\",\n \"prototype\"\n ],\n \"%Float32ArrayPrototype%\": [\n \"Float32Array\",\n \"prototype\"\n ],\n \"%Float64ArrayPrototype%\": [\n \"Float64Array\",\n \"prototype\"\n ],\n \"%FunctionPrototype%\": [\n \"Function\",\n \"prototype\"\n ],\n \"%Generator%\": [\n \"GeneratorFunction\",\n \"prototype\"\n ],\n \"%GeneratorPrototype%\": [\n \"GeneratorFunction\",\n \"prototype\",\n \"prototype\"\n ],\n \"%Int8ArrayPrototype%\": [\n \"Int8Array\",\n \"prototype\"\n ],\n \"%Int16ArrayPrototype%\": [\n \"Int16Array\",\n \"prototype\"\n ],\n \"%Int32ArrayPrototype%\": [\n \"Int32Array\",\n \"prototype\"\n ],\n \"%JSONParse%\": [\n \"JSON\",\n \"parse\"\n ],\n \"%JSONStringify%\": [\n \"JSON\",\n \"stringify\"\n ],\n \"%MapPrototype%\": [\n \"Map\",\n \"prototype\"\n ],\n \"%NumberPrototype%\": [\n \"Number\",\n \"prototype\"\n ],\n \"%ObjectPrototype%\": [\n \"Object\",\n \"prototype\"\n ],\n \"%ObjProto_toString%\": [\n \"Object\",\n \"prototype\",\n \"toString\"\n ],\n \"%ObjProto_valueOf%\": [\n \"Object\",\n \"prototype\",\n \"valueOf\"\n ],\n \"%PromisePrototype%\": [\n \"Promise\",\n \"prototype\"\n ],\n \"%PromiseProto_then%\": [\n \"Promise\",\n \"prototype\",\n \"then\"\n ],\n \"%Promise_all%\": [\n \"Promise\",\n \"all\"\n ],\n \"%Promise_reject%\": [\n \"Promise\",\n \"reject\"\n ],\n \"%Promise_resolve%\": [\n \"Promise\",\n \"resolve\"\n ],\n \"%RangeErrorPrototype%\": [\n \"RangeError\",\n \"prototype\"\n ],\n \"%ReferenceErrorPrototype%\": [\n \"ReferenceError\",\n \"prototype\"\n ],\n \"%RegExpPrototype%\": [\n \"RegExp\",\n \"prototype\"\n ],\n \"%SetPrototype%\": [\n \"Set\",\n \"prototype\"\n ],\n \"%SharedArrayBufferPrototype%\": [\n \"SharedArrayBuffer\",\n \"prototype\"\n ],\n \"%StringPrototype%\": [\n \"String\",\n \"prototype\"\n ],\n \"%SymbolPrototype%\": [\n \"Symbol\",\n \"prototype\"\n ],\n \"%SyntaxErrorPrototype%\": [\n \"SyntaxError\",\n \"prototype\"\n ],\n \"%TypedArrayPrototype%\": [\n \"TypedArray\",\n \"prototype\"\n ],\n \"%TypeErrorPrototype%\": [\n \"TypeError\",\n \"prototype\"\n ],\n \"%Uint8ArrayPrototype%\": [\n \"Uint8Array\",\n \"prototype\"\n ],\n \"%Uint8ClampedArrayPrototype%\": [\n \"Uint8ClampedArray\",\n \"prototype\"\n ],\n \"%Uint16ArrayPrototype%\": [\n \"Uint16Array\",\n \"prototype\"\n ],\n \"%Uint32ArrayPrototype%\": [\n \"Uint32Array\",\n \"prototype\"\n ],\n \"%URIErrorPrototype%\": [\n \"URIError\",\n \"prototype\"\n ],\n \"%WeakMapPrototype%\": [\n \"WeakMap\",\n \"prototype\"\n ],\n \"%WeakSetPrototype%\": [\n \"WeakSet\",\n \"prototype\"\n ]\n};\n\nvar $eSJCt = parcelRequire(\"eSJCt\");\n\nvar $hhJZr = parcelRequire(\"hhJZr\");\nvar $8e02ca77d270b092$var$$concat = $eSJCt.call(Function.call, Array.prototype.concat);\nvar $8e02ca77d270b092$var$$spliceApply = $eSJCt.call(Function.apply, Array.prototype.splice);\nvar $8e02ca77d270b092$var$$replace = $eSJCt.call(Function.call, String.prototype.replace);\nvar $8e02ca77d270b092$var$$strSlice = $eSJCt.call(Function.call, String.prototype.slice);\nvar $8e02ca77d270b092$var$$exec = $eSJCt.call(Function.call, RegExp.prototype.exec);\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var $8e02ca77d270b092$var$rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar $8e02ca77d270b092$var$reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */ \nvar $8e02ca77d270b092$var$stringToPath = function stringToPath(string) {\n var first = $8e02ca77d270b092$var$$strSlice(string, 0, 1);\n var last = $8e02ca77d270b092$var$$strSlice(string, -1);\n if (first === \"%\" && last !== \"%\") throw new $8e02ca77d270b092$var$$SyntaxError(\"invalid intrinsic syntax, expected closing `%`\");\n else if (last === \"%\" && first !== \"%\") throw new $8e02ca77d270b092$var$$SyntaxError(\"invalid intrinsic syntax, expected opening `%`\");\n var result = [];\n $8e02ca77d270b092$var$$replace(string, $8e02ca77d270b092$var$rePropName, function(match, number, quote, subString) {\n result[result.length] = quote ? $8e02ca77d270b092$var$$replace(subString, $8e02ca77d270b092$var$reEscapeChar, \"$1\") : number || match;\n });\n return result;\n};\n/* end adaptation */ var $8e02ca77d270b092$var$getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n var intrinsicName = name;\n var alias;\n if ($hhJZr($8e02ca77d270b092$var$LEGACY_ALIASES, intrinsicName)) {\n alias = $8e02ca77d270b092$var$LEGACY_ALIASES[intrinsicName];\n intrinsicName = \"%\" + alias[0] + \"%\";\n }\n if ($hhJZr($8e02ca77d270b092$var$INTRINSICS, intrinsicName)) {\n var value = $8e02ca77d270b092$var$INTRINSICS[intrinsicName];\n if (value === $8e02ca77d270b092$var$needsEval) value = $8e02ca77d270b092$var$doEval(intrinsicName);\n if (typeof value === \"undefined\" && !allowMissing) throw new $8e02ca77d270b092$var$$TypeError(\"intrinsic \" + name + \" exists, but is not available. Please file an issue!\");\n return {\n alias: alias,\n name: intrinsicName,\n value: value\n };\n }\n throw new $8e02ca77d270b092$var$$SyntaxError(\"intrinsic \" + name + \" does not exist!\");\n};\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n if (typeof name !== \"string\" || name.length === 0) throw new $8e02ca77d270b092$var$$TypeError(\"intrinsic name must be a non-empty string\");\n if (arguments.length > 1 && typeof allowMissing !== \"boolean\") throw new $8e02ca77d270b092$var$$TypeError('\"allowMissing\" argument must be a boolean');\n if ($8e02ca77d270b092$var$$exec(/^%?[^%]*%?$/, name) === null) throw new $8e02ca77d270b092$var$$SyntaxError(\"`%` may not be present anywhere but at the beginning and end of the intrinsic name\");\n var parts = $8e02ca77d270b092$var$stringToPath(name);\n var intrinsicBaseName = parts.length > 0 ? parts[0] : \"\";\n var intrinsic = $8e02ca77d270b092$var$getBaseIntrinsic(\"%\" + intrinsicBaseName + \"%\", allowMissing);\n var intrinsicRealName = intrinsic.name;\n var value = intrinsic.value;\n var skipFurtherCaching = false;\n var alias = intrinsic.alias;\n if (alias) {\n intrinsicBaseName = alias[0];\n $8e02ca77d270b092$var$$spliceApply(parts, $8e02ca77d270b092$var$$concat([\n 0,\n 1\n ], alias));\n }\n for(var i = 1, isOwn = true; i < parts.length; i += 1){\n var part = parts[i];\n var first = $8e02ca77d270b092$var$$strSlice(part, 0, 1);\n var last = $8e02ca77d270b092$var$$strSlice(part, -1);\n if ((first === '\"' || first === \"'\" || first === \"`\" || last === '\"' || last === \"'\" || last === \"`\") && first !== last) throw new $8e02ca77d270b092$var$$SyntaxError(\"property names with quotes must have matching quotes\");\n if (part === \"constructor\" || !isOwn) skipFurtherCaching = true;\n intrinsicBaseName += \".\" + part;\n intrinsicRealName = \"%\" + intrinsicBaseName + \"%\";\n if ($hhJZr($8e02ca77d270b092$var$INTRINSICS, intrinsicRealName)) value = $8e02ca77d270b092$var$INTRINSICS[intrinsicRealName];\n else if (value != null) {\n if (!(part in value)) {\n if (!allowMissing) throw new $8e02ca77d270b092$var$$TypeError(\"base intrinsic for \" + name + \" exists, but the property is not available.\");\n return void 0;\n }\n if ($8e02ca77d270b092$var$$gOPD && i + 1 >= parts.length) {\n var desc = $8e02ca77d270b092$var$$gOPD(value, part);\n isOwn = !!desc;\n // By convention, when a data property is converted to an accessor\n // property to emulate a data property that does not suffer from\n // the override mistake, that accessor's getter is marked with\n // an `originalValue` property. Here, when we detect this, we\n // uphold the illusion by pretending to see that original data\n // property, i.e., returning the value rather than the getter\n // itself.\n if (isOwn && \"get\" in desc && !(\"originalValue\" in desc.get)) value = desc.get;\n else value = value[part];\n } else {\n isOwn = $hhJZr(value, part);\n value = value[part];\n }\n if (isOwn && !skipFurtherCaching) $8e02ca77d270b092$var$INTRINSICS[intrinsicRealName] = value;\n }\n }\n return value;\n};\n\n});\nparcelRegister(\"iAT3w\", function(module, exports) {\n\"use strict\";\nvar $d8964bbb1743abbb$var$origSymbol = typeof Symbol !== \"undefined\" && Symbol;\n\nvar $iswqS = parcelRequire(\"iswqS\");\nmodule.exports = function hasNativeSymbols() {\n if (typeof $d8964bbb1743abbb$var$origSymbol !== \"function\") return false;\n if (typeof Symbol !== \"function\") return false;\n if (typeof $d8964bbb1743abbb$var$origSymbol(\"foo\") !== \"symbol\") return false;\n if (typeof Symbol(\"bar\") !== \"symbol\") return false;\n return $iswqS();\n};\n\n});\n\nparcelRegister(\"5I7PD\", function(module, exports) {\n\"use strict\";\nvar $4287230ea792b293$var$test = {\n foo: {}\n};\nvar $4287230ea792b293$var$$Object = Object;\nmodule.exports = function hasProto() {\n return ({\n __proto__: $4287230ea792b293$var$test\n }).foo === $4287230ea792b293$var$test.foo && !(({\n __proto__: null\n }) instanceof $4287230ea792b293$var$$Object);\n};\n\n});\n\nparcelRegister(\"eSJCt\", function(module, exports) {\n\"use strict\";\n\nvar $7uTAw = parcelRequire(\"7uTAw\");\nmodule.exports = Function.prototype.bind || $7uTAw;\n\n});\nparcelRegister(\"7uTAw\", function(module, exports) {\n\"use strict\";\n/* eslint no-invalid-this: 1 */ var $5756745b39df06db$var$ERROR_MESSAGE = \"Function.prototype.bind called on incompatible \";\nvar $5756745b39df06db$var$toStr = Object.prototype.toString;\nvar $5756745b39df06db$var$max = Math.max;\nvar $5756745b39df06db$var$funcType = \"[object Function]\";\nvar $5756745b39df06db$var$concatty = function concatty(a, b) {\n var arr = [];\n for(var i = 0; i < a.length; i += 1)arr[i] = a[i];\n for(var j = 0; j < b.length; j += 1)arr[j + a.length] = b[j];\n return arr;\n};\nvar $5756745b39df06db$var$slicy = function slicy(arrLike, offset) {\n var arr = [];\n for(var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1)arr[j] = arrLike[i];\n return arr;\n};\nvar $5756745b39df06db$var$joiny = function(arr, joiner) {\n var str = \"\";\n for(var i = 0; i < arr.length; i += 1){\n str += arr[i];\n if (i + 1 < arr.length) str += joiner;\n }\n return str;\n};\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== \"function\" || $5756745b39df06db$var$toStr.apply(target) !== $5756745b39df06db$var$funcType) throw new TypeError($5756745b39df06db$var$ERROR_MESSAGE + target);\n var args = $5756745b39df06db$var$slicy(arguments, 1);\n var bound;\n var binder = function() {\n if (this instanceof bound) {\n var result = target.apply(this, $5756745b39df06db$var$concatty(args, arguments));\n if (Object(result) === result) return result;\n return this;\n }\n return target.apply(that, $5756745b39df06db$var$concatty(args, arguments));\n };\n var boundLength = $5756745b39df06db$var$max(0, target.length - args.length);\n var boundArgs = [];\n for(var i = 0; i < boundLength; i++)boundArgs[i] = \"$\" + i;\n bound = Function(\"binder\", \"return function (\" + $5756745b39df06db$var$joiny(boundArgs, \",\") + \"){ return binder.apply(this,arguments); }\")(binder);\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n return bound;\n};\n\n});\n\n\nparcelRegister(\"hhJZr\", function(module, exports) {\n\"use strict\";\nvar $c957b2d89cf0941a$var$call = Function.prototype.call;\nvar $c957b2d89cf0941a$var$$hasOwn = Object.prototype.hasOwnProperty;\n\nvar $eSJCt = parcelRequire(\"eSJCt\");\n/** @type {(o: {}, p: PropertyKey) => p is keyof o} */ module.exports = $eSJCt.call($c957b2d89cf0941a$var$call, $c957b2d89cf0941a$var$$hasOwn);\n\n});\n\n\nparcelRegister(\"6gXjj\", function(module, exports) {\n\"use strict\";\n\nvar $eSJCt = parcelRequire(\"eSJCt\");\n\nvar $cbV5a = parcelRequire(\"cbV5a\");\n\nvar $8wQgk = parcelRequire(\"8wQgk\");\nvar $49123e876306bb42$var$$TypeError = $cbV5a(\"%TypeError%\");\nvar $49123e876306bb42$var$$apply = $cbV5a(\"%Function.prototype.apply%\");\nvar $49123e876306bb42$var$$call = $cbV5a(\"%Function.prototype.call%\");\nvar $49123e876306bb42$var$$reflectApply = $cbV5a(\"%Reflect.apply%\", true) || $eSJCt.call($49123e876306bb42$var$$call, $49123e876306bb42$var$$apply);\nvar $49123e876306bb42$var$$defineProperty = $cbV5a(\"%Object.defineProperty%\", true);\nvar $49123e876306bb42$var$$max = $cbV5a(\"%Math.max%\");\nif ($49123e876306bb42$var$$defineProperty) try {\n $49123e876306bb42$var$$defineProperty({}, \"a\", {\n value: 1\n });\n} catch (e) {\n // IE 8 has a broken defineProperty\n $49123e876306bb42$var$$defineProperty = null;\n}\nmodule.exports = function callBind(originalFunction) {\n if (typeof originalFunction !== \"function\") throw new $49123e876306bb42$var$$TypeError(\"a function is required\");\n var func = $49123e876306bb42$var$$reflectApply($eSJCt, $49123e876306bb42$var$$call, arguments);\n return $8wQgk(func, 1 + $49123e876306bb42$var$$max(0, originalFunction.length - (arguments.length - 1)), true);\n};\nvar $49123e876306bb42$var$applyBind = function applyBind() {\n return $49123e876306bb42$var$$reflectApply($eSJCt, $49123e876306bb42$var$$apply, arguments);\n};\nif ($49123e876306bb42$var$$defineProperty) $49123e876306bb42$var$$defineProperty(module.exports, \"apply\", {\n value: $49123e876306bb42$var$applyBind\n});\nelse module.exports.apply = $49123e876306bb42$var$applyBind;\n\n});\nparcelRegister(\"8wQgk\", function(module, exports) {\n\"use strict\";\n\nvar $cbV5a = parcelRequire(\"cbV5a\");\n\nvar $dEYu7 = parcelRequire(\"dEYu7\");\n\nvar $6359da1a4da0c32b$var$hasDescriptors = (parcelRequire(\"gaPDk\"))();\n\nvar $lpldP = parcelRequire(\"lpldP\");\nvar $6359da1a4da0c32b$var$$TypeError = $cbV5a(\"%TypeError%\");\nvar $6359da1a4da0c32b$var$$floor = $cbV5a(\"%Math.floor%\");\nmodule.exports = function setFunctionLength(fn, length) {\n if (typeof fn !== \"function\") throw new $6359da1a4da0c32b$var$$TypeError(\"`fn` is not a function\");\n if (typeof length !== \"number\" || length < 0 || length > 0xFFFFFFFF || $6359da1a4da0c32b$var$$floor(length) !== length) throw new $6359da1a4da0c32b$var$$TypeError(\"`length` must be a positive 32-bit integer\");\n var loose = arguments.length > 2 && !!arguments[2];\n var functionLengthIsConfigurable = true;\n var functionLengthIsWritable = true;\n if (\"length\" in fn && $lpldP) {\n var desc = $lpldP(fn, \"length\");\n if (desc && !desc.configurable) functionLengthIsConfigurable = false;\n if (desc && !desc.writable) functionLengthIsWritable = false;\n }\n if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n if ($6359da1a4da0c32b$var$hasDescriptors) $dEYu7(fn, \"length\", length, true, true);\n else $dEYu7(fn, \"length\", length);\n }\n return fn;\n};\n\n});\nparcelRegister(\"dEYu7\", function(module, exports) {\n\"use strict\";\n\nvar $9f1dedcd246e3ad0$var$hasPropertyDescriptors = (parcelRequire(\"gaPDk\"))();\n\nvar $cbV5a = parcelRequire(\"cbV5a\");\nvar $9f1dedcd246e3ad0$var$$defineProperty = $9f1dedcd246e3ad0$var$hasPropertyDescriptors && $cbV5a(\"%Object.defineProperty%\", true);\nif ($9f1dedcd246e3ad0$var$$defineProperty) try {\n $9f1dedcd246e3ad0$var$$defineProperty({}, \"a\", {\n value: 1\n });\n} catch (e) {\n // IE 8 has a broken defineProperty\n $9f1dedcd246e3ad0$var$$defineProperty = false;\n}\nvar $9f1dedcd246e3ad0$var$$SyntaxError = $cbV5a(\"%SyntaxError%\");\nvar $9f1dedcd246e3ad0$var$$TypeError = $cbV5a(\"%TypeError%\");\n\nvar $lpldP = parcelRequire(\"lpldP\");\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */ module.exports = function defineDataProperty(obj, property, value) {\n if (!obj || typeof obj !== \"object\" && typeof obj !== \"function\") throw new $9f1dedcd246e3ad0$var$$TypeError(\"`obj` must be an object or a function`\");\n if (typeof property !== \"string\" && typeof property !== \"symbol\") throw new $9f1dedcd246e3ad0$var$$TypeError(\"`property` must be a string or a symbol`\");\n if (arguments.length > 3 && typeof arguments[3] !== \"boolean\" && arguments[3] !== null) throw new $9f1dedcd246e3ad0$var$$TypeError(\"`nonEnumerable`, if provided, must be a boolean or null\");\n if (arguments.length > 4 && typeof arguments[4] !== \"boolean\" && arguments[4] !== null) throw new $9f1dedcd246e3ad0$var$$TypeError(\"`nonWritable`, if provided, must be a boolean or null\");\n if (arguments.length > 5 && typeof arguments[5] !== \"boolean\" && arguments[5] !== null) throw new $9f1dedcd246e3ad0$var$$TypeError(\"`nonConfigurable`, if provided, must be a boolean or null\");\n if (arguments.length > 6 && typeof arguments[6] !== \"boolean\") throw new $9f1dedcd246e3ad0$var$$TypeError(\"`loose`, if provided, must be a boolean\");\n var nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n var nonWritable = arguments.length > 4 ? arguments[4] : null;\n var nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n var loose = arguments.length > 6 ? arguments[6] : false;\n /* @type {false | TypedPropertyDescriptor} */ var desc = !!$lpldP && $lpldP(obj, property);\n if ($9f1dedcd246e3ad0$var$$defineProperty) $9f1dedcd246e3ad0$var$$defineProperty(obj, property, {\n configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n value: value,\n writable: nonWritable === null && desc ? desc.writable : !nonWritable\n });\n else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n obj[property] = value; // eslint-disable-line no-param-reassign\n else throw new $9f1dedcd246e3ad0$var$$SyntaxError(\"This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.\");\n};\n\n});\nparcelRegister(\"gaPDk\", function(module, exports) {\n\"use strict\";\n\nvar $cbV5a = parcelRequire(\"cbV5a\");\nvar $bc65a1d1be87ac6b$var$$defineProperty = $cbV5a(\"%Object.defineProperty%\", true);\nvar $bc65a1d1be87ac6b$var$hasPropertyDescriptors = function hasPropertyDescriptors() {\n if ($bc65a1d1be87ac6b$var$$defineProperty) try {\n $bc65a1d1be87ac6b$var$$defineProperty({}, \"a\", {\n value: 1\n });\n return true;\n } catch (e) {\n // IE 8 has a broken defineProperty\n return false;\n }\n return false;\n};\n$bc65a1d1be87ac6b$var$hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n // node v0.6 has a bug where array lengths can be Set but not Defined\n if (!$bc65a1d1be87ac6b$var$hasPropertyDescriptors()) return null;\n try {\n return $bc65a1d1be87ac6b$var$$defineProperty([], \"length\", {\n value: 1\n }).length !== 1;\n } catch (e) {\n // In Firefox 4-22, defining length on an array throws an exception.\n return true;\n }\n};\nmodule.exports = $bc65a1d1be87ac6b$var$hasPropertyDescriptors;\n\n});\n\nparcelRegister(\"lpldP\", function(module, exports) {\n\"use strict\";\n\nvar $cbV5a = parcelRequire(\"cbV5a\");\nvar $f95c650c3c50a0b9$var$$gOPD = $cbV5a(\"%Object.getOwnPropertyDescriptor%\", true);\nif ($f95c650c3c50a0b9$var$$gOPD) try {\n $f95c650c3c50a0b9$var$$gOPD([], \"length\");\n} catch (e) {\n // IE 8 has a broken gOPD\n $f95c650c3c50a0b9$var$$gOPD = null;\n}\nmodule.exports = $f95c650c3c50a0b9$var$$gOPD;\n\n});\n\n\n\n\n\n\nparcelRegister(\"lCUJL\", function(module, exports) {\n\"use strict\";\nvar $fbe9286b8c5d6014$var$toStr = Object.prototype.toString;\nvar $fbe9286b8c5d6014$var$fnToStr = Function.prototype.toString;\nvar $fbe9286b8c5d6014$var$isFnRegex = /^\\s*(?:function)?\\*/;\n\nvar $fbe9286b8c5d6014$var$hasToStringTag = (parcelRequire(\"hlgT2\"))();\nvar $fbe9286b8c5d6014$var$getProto = Object.getPrototypeOf;\nvar $fbe9286b8c5d6014$var$getGeneratorFunc = function() {\n if (!$fbe9286b8c5d6014$var$hasToStringTag) return false;\n try {\n return Function(\"return function*() {}\")();\n } catch (e) {}\n};\nvar $fbe9286b8c5d6014$var$GeneratorFunction;\nmodule.exports = function isGeneratorFunction(fn) {\n if (typeof fn !== \"function\") return false;\n if ($fbe9286b8c5d6014$var$isFnRegex.test($fbe9286b8c5d6014$var$fnToStr.call(fn))) return true;\n if (!$fbe9286b8c5d6014$var$hasToStringTag) {\n var str = $fbe9286b8c5d6014$var$toStr.call(fn);\n return str === \"[object GeneratorFunction]\";\n }\n if (!$fbe9286b8c5d6014$var$getProto) return false;\n if (typeof $fbe9286b8c5d6014$var$GeneratorFunction === \"undefined\") {\n var generatorFunc = $fbe9286b8c5d6014$var$getGeneratorFunc();\n $fbe9286b8c5d6014$var$GeneratorFunction = generatorFunc ? $fbe9286b8c5d6014$var$getProto(generatorFunc) : false;\n }\n return $fbe9286b8c5d6014$var$getProto(fn) === $fbe9286b8c5d6014$var$GeneratorFunction;\n};\n\n});\n\nparcelRegister(\"iVfsl\", function(module, exports) {\n\"use strict\";\n\nvar $e6WPe = parcelRequire(\"e6WPe\");\n\nvar $i6TQG = parcelRequire(\"i6TQG\");\n\nvar $6gXjj = parcelRequire(\"6gXjj\");\n\nvar $9rEHq = parcelRequire(\"9rEHq\");\n\nvar $lpldP = parcelRequire(\"lpldP\");\nvar $dc698a21108030ad$var$$toString = $9rEHq(\"Object.prototype.toString\");\n\nvar $dc698a21108030ad$var$hasToStringTag = (parcelRequire(\"hlgT2\"))();\nvar $dc698a21108030ad$var$g = typeof globalThis === \"undefined\" ? $parcel$global : globalThis;\nvar $dc698a21108030ad$var$typedArrays = $i6TQG();\nvar $dc698a21108030ad$var$$slice = $9rEHq(\"String.prototype.slice\");\nvar $dc698a21108030ad$var$getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\nvar $dc698a21108030ad$var$$indexOf = $9rEHq(\"Array.prototype.indexOf\", true) || function indexOf(array, value) {\n for(var i = 0; i < array.length; i += 1){\n if (array[i] === value) return i;\n }\n return -1;\n};\nvar $dc698a21108030ad$var$cache = {\n __proto__: null\n};\nif ($dc698a21108030ad$var$hasToStringTag && $lpldP && $dc698a21108030ad$var$getPrototypeOf) $e6WPe($dc698a21108030ad$var$typedArrays, function(typedArray) {\n var arr = new $dc698a21108030ad$var$g[typedArray]();\n if (Symbol.toStringTag in arr) {\n var proto = $dc698a21108030ad$var$getPrototypeOf(arr);\n var descriptor = $lpldP(proto, Symbol.toStringTag);\n if (!descriptor) {\n var superProto = $dc698a21108030ad$var$getPrototypeOf(proto);\n descriptor = $lpldP(superProto, Symbol.toStringTag);\n }\n $dc698a21108030ad$var$cache[\"$\" + typedArray] = $6gXjj(descriptor.get);\n }\n});\nelse $e6WPe($dc698a21108030ad$var$typedArrays, function(typedArray) {\n var arr = new $dc698a21108030ad$var$g[typedArray]();\n var fn = arr.slice || arr.set;\n if (fn) $dc698a21108030ad$var$cache[\"$\" + typedArray] = $6gXjj(fn);\n});\nvar $dc698a21108030ad$var$tryTypedArrays = function tryAllTypedArrays(value) {\n var found = false;\n $e6WPe($dc698a21108030ad$var$cache, function(getter, typedArray) {\n if (!found) try {\n if (\"$\" + getter(value) === typedArray) found = $dc698a21108030ad$var$$slice(typedArray, 1);\n } catch (e) {}\n });\n return found;\n};\nvar $dc698a21108030ad$var$trySlices = function tryAllSlices(value) {\n var found = false;\n $e6WPe($dc698a21108030ad$var$cache, function(getter, name) {\n if (!found) try {\n getter(value);\n found = $dc698a21108030ad$var$$slice(name, 1);\n } catch (e) {}\n });\n return found;\n};\nmodule.exports = function whichTypedArray(value) {\n if (!value || typeof value !== \"object\") return false;\n if (!$dc698a21108030ad$var$hasToStringTag) {\n var tag = $dc698a21108030ad$var$$slice($dc698a21108030ad$var$$toString(value), 8, -1);\n if ($dc698a21108030ad$var$$indexOf($dc698a21108030ad$var$typedArrays, tag) > -1) return tag;\n if (tag !== \"Object\") return false;\n // node < 0.6 hits here on real Typed Arrays\n return $dc698a21108030ad$var$trySlices(value);\n }\n if (!$lpldP) return null;\n // unknown engine\n return $dc698a21108030ad$var$tryTypedArrays(value);\n};\n\n});\nparcelRegister(\"e6WPe\", function(module, exports) {\n\"use strict\";\n\nvar $liz7M = parcelRequire(\"liz7M\");\nvar $a45f41b45e745637$var$toStr = Object.prototype.toString;\nvar $a45f41b45e745637$var$hasOwnProperty = Object.prototype.hasOwnProperty;\nvar $a45f41b45e745637$var$forEachArray = function forEachArray(array, iterator, receiver) {\n for(var i = 0, len = array.length; i < len; i++)if ($a45f41b45e745637$var$hasOwnProperty.call(array, i)) {\n if (receiver == null) iterator(array[i], i, array);\n else iterator.call(receiver, array[i], i, array);\n }\n};\nvar $a45f41b45e745637$var$forEachString = function forEachString(string, iterator, receiver) {\n for(var i = 0, len = string.length; i < len; i++)// no such thing as a sparse string.\n if (receiver == null) iterator(string.charAt(i), i, string);\n else iterator.call(receiver, string.charAt(i), i, string);\n};\nvar $a45f41b45e745637$var$forEachObject = function forEachObject(object, iterator, receiver) {\n for(var k in object)if ($a45f41b45e745637$var$hasOwnProperty.call(object, k)) {\n if (receiver == null) iterator(object[k], k, object);\n else iterator.call(receiver, object[k], k, object);\n }\n};\nvar $a45f41b45e745637$var$forEach = function forEach(list, iterator, thisArg) {\n if (!$liz7M(iterator)) throw new TypeError(\"iterator must be a function\");\n var receiver;\n if (arguments.length >= 3) receiver = thisArg;\n if ($a45f41b45e745637$var$toStr.call(list) === \"[object Array]\") $a45f41b45e745637$var$forEachArray(list, iterator, receiver);\n else if (typeof list === \"string\") $a45f41b45e745637$var$forEachString(list, iterator, receiver);\n else $a45f41b45e745637$var$forEachObject(list, iterator, receiver);\n};\nmodule.exports = $a45f41b45e745637$var$forEach;\n\n});\nparcelRegister(\"liz7M\", function(module, exports) {\n\"use strict\";\nvar $f8168662f23765f9$var$fnToStr = Function.prototype.toString;\nvar $f8168662f23765f9$var$reflectApply = typeof Reflect === \"object\" && Reflect !== null && Reflect.apply;\nvar $f8168662f23765f9$var$badArrayLike;\nvar $f8168662f23765f9$var$isCallableMarker;\nif (typeof $f8168662f23765f9$var$reflectApply === \"function\" && typeof Object.defineProperty === \"function\") try {\n $f8168662f23765f9$var$badArrayLike = Object.defineProperty({}, \"length\", {\n get: function() {\n throw $f8168662f23765f9$var$isCallableMarker;\n }\n });\n $f8168662f23765f9$var$isCallableMarker = {};\n // eslint-disable-next-line no-throw-literal\n $f8168662f23765f9$var$reflectApply(function() {\n throw 42;\n }, null, $f8168662f23765f9$var$badArrayLike);\n} catch (_) {\n if (_ !== $f8168662f23765f9$var$isCallableMarker) $f8168662f23765f9$var$reflectApply = null;\n}\nelse $f8168662f23765f9$var$reflectApply = null;\nvar $f8168662f23765f9$var$constructorRegex = /^\\s*class\\b/;\nvar $f8168662f23765f9$var$isES6ClassFn = function isES6ClassFunction(value) {\n try {\n var fnStr = $f8168662f23765f9$var$fnToStr.call(value);\n return $f8168662f23765f9$var$constructorRegex.test(fnStr);\n } catch (e) {\n return false; // not a function\n }\n};\nvar $f8168662f23765f9$var$tryFunctionObject = function tryFunctionToStr(value) {\n try {\n if ($f8168662f23765f9$var$isES6ClassFn(value)) return false;\n $f8168662f23765f9$var$fnToStr.call(value);\n return true;\n } catch (e) {\n return false;\n }\n};\nvar $f8168662f23765f9$var$toStr = Object.prototype.toString;\nvar $f8168662f23765f9$var$objectClass = \"[object Object]\";\nvar $f8168662f23765f9$var$fnClass = \"[object Function]\";\nvar $f8168662f23765f9$var$genClass = \"[object GeneratorFunction]\";\nvar $f8168662f23765f9$var$ddaClass = \"[object HTMLAllCollection]\"; // IE 11\nvar $f8168662f23765f9$var$ddaClass2 = \"[object HTML document.all class]\";\nvar $f8168662f23765f9$var$ddaClass3 = \"[object HTMLCollection]\"; // IE 9-10\nvar $f8168662f23765f9$var$hasToStringTag = typeof Symbol === \"function\" && !!Symbol.toStringTag; // better: use `has-tostringtag`\nvar $f8168662f23765f9$var$isIE68 = !(0 in [\n , \n]); // eslint-disable-line no-sparse-arrays, comma-spacing\nvar $f8168662f23765f9$var$isDDA = function isDocumentDotAll() {\n return false;\n};\nif (typeof document === \"object\") {\n // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n var $f8168662f23765f9$var$all = document.all;\n if ($f8168662f23765f9$var$toStr.call($f8168662f23765f9$var$all) === $f8168662f23765f9$var$toStr.call(document.all)) $f8168662f23765f9$var$isDDA = function isDocumentDotAll(value) {\n /* globals document: false */ // in IE 6-8, typeof document.all is \"object\" and it's truthy\n if (($f8168662f23765f9$var$isIE68 || !value) && (typeof value === \"undefined\" || typeof value === \"object\")) try {\n var str = $f8168662f23765f9$var$toStr.call(value);\n return (str === $f8168662f23765f9$var$ddaClass || str === $f8168662f23765f9$var$ddaClass2 || str === $f8168662f23765f9$var$ddaClass3 // opera 12.16\n || str === $f8168662f23765f9$var$objectClass // IE 6-8\n ) && value(\"\") == null; // eslint-disable-line eqeqeq\n } catch (e) {}\n return false;\n };\n}\nmodule.exports = $f8168662f23765f9$var$reflectApply ? function isCallable(value) {\n if ($f8168662f23765f9$var$isDDA(value)) return true;\n if (!value) return false;\n if (typeof value !== \"function\" && typeof value !== \"object\") return false;\n try {\n $f8168662f23765f9$var$reflectApply(value, null, $f8168662f23765f9$var$badArrayLike);\n } catch (e) {\n if (e !== $f8168662f23765f9$var$isCallableMarker) return false;\n }\n return !$f8168662f23765f9$var$isES6ClassFn(value) && $f8168662f23765f9$var$tryFunctionObject(value);\n} : function isCallable(value) {\n if ($f8168662f23765f9$var$isDDA(value)) return true;\n if (!value) return false;\n if (typeof value !== \"function\" && typeof value !== \"object\") return false;\n if ($f8168662f23765f9$var$hasToStringTag) return $f8168662f23765f9$var$tryFunctionObject(value);\n if ($f8168662f23765f9$var$isES6ClassFn(value)) return false;\n var strClass = $f8168662f23765f9$var$toStr.call(value);\n if (strClass !== $f8168662f23765f9$var$fnClass && strClass !== $f8168662f23765f9$var$genClass && !/^\\[object HTML/.test(strClass)) return false;\n return $f8168662f23765f9$var$tryFunctionObject(value);\n};\n\n});\n\n\nparcelRegister(\"i6TQG\", function(module, exports) {\n\"use strict\";\nvar $d2f41beb2623cba4$var$possibleNames = [\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Float32Array\",\n \"Float64Array\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\"\n];\nvar $d2f41beb2623cba4$var$g = typeof globalThis === \"undefined\" ? $parcel$global : globalThis;\nmodule.exports = function availableTypedArrays() {\n var out = [];\n for(var i = 0; i < $d2f41beb2623cba4$var$possibleNames.length; i++)if (typeof $d2f41beb2623cba4$var$g[$d2f41beb2623cba4$var$possibleNames[i]] === \"function\") out[out.length] = $d2f41beb2623cba4$var$possibleNames[i];\n return out;\n};\n\n});\n\n\nparcelRegister(\"6n4Tb\", function(module, exports) {\n\"use strict\";\n\nvar $iVfsl = parcelRequire(\"iVfsl\");\nmodule.exports = function isTypedArray(value) {\n return !!$iVfsl(value);\n};\n\n});\n\n\nparcelRegister(\"3YNr2\", function(module, exports) {\nmodule.exports = function isBuffer(arg) {\n return arg && typeof arg === \"object\" && typeof arg.copy === \"function\" && typeof arg.fill === \"function\" && typeof arg.readUInt8 === \"function\";\n};\n\n});\n\nparcelRegister(\"fgp9u\", function(module, exports) {\nif (typeof Object.create === \"function\") // implementation from standard node.js 'util' module\nmodule.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n};\nelse // old school shim for old browsers\nmodule.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function() {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n};\n\n});\n\n\n\nparcelRegister(\"dfdGN\", function(module, exports) {\n// Currently in sync with Node.js lib/internal/assert/assertion_error.js\n// https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c\n\nvar $bYqme = parcelRequire(\"bYqme\");\n\"use strict\";\nfunction $9a474b7dcd09c5ab$var$ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function(r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction $9a474b7dcd09c5ab$var$_objectSpread(e) {\n for(var r = 1; r < arguments.length; r++){\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? $9a474b7dcd09c5ab$var$ownKeys(Object(t), !0).forEach(function(r) {\n $9a474b7dcd09c5ab$var$_defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : $9a474b7dcd09c5ab$var$ownKeys(Object(t)).forEach(function(r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nfunction $9a474b7dcd09c5ab$var$_defineProperty(obj, key, value) {\n key = $9a474b7dcd09c5ab$var$_toPropertyKey(key);\n if (key in obj) Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n else obj[key] = value;\n return obj;\n}\nfunction $9a474b7dcd09c5ab$var$_classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction $9a474b7dcd09c5ab$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, $9a474b7dcd09c5ab$var$_toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction $9a474b7dcd09c5ab$var$_createClass(Constructor, protoProps, staticProps) {\n if (protoProps) $9a474b7dcd09c5ab$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $9a474b7dcd09c5ab$var$_defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction $9a474b7dcd09c5ab$var$_toPropertyKey(arg) {\n var key = $9a474b7dcd09c5ab$var$_toPrimitive(arg, \"string\");\n return $9a474b7dcd09c5ab$var$_typeof(key) === \"symbol\" ? key : String(key);\n}\nfunction $9a474b7dcd09c5ab$var$_toPrimitive(input, hint) {\n if ($9a474b7dcd09c5ab$var$_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if ($9a474b7dcd09c5ab$var$_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction $9a474b7dcd09c5ab$var$_inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) throw new TypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) $9a474b7dcd09c5ab$var$_setPrototypeOf(subClass, superClass);\n}\nfunction $9a474b7dcd09c5ab$var$_createSuper(Derived) {\n var hasNativeReflectConstruct = $9a474b7dcd09c5ab$var$_isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = $9a474b7dcd09c5ab$var$_getPrototypeOf(Derived), result;\n if (hasNativeReflectConstruct) {\n var NewTarget = $9a474b7dcd09c5ab$var$_getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else result = Super.apply(this, arguments);\n return $9a474b7dcd09c5ab$var$_possibleConstructorReturn(this, result);\n };\n}\nfunction $9a474b7dcd09c5ab$var$_possibleConstructorReturn(self, call) {\n if (call && ($9a474b7dcd09c5ab$var$_typeof(call) === \"object\" || typeof call === \"function\")) return call;\n else if (call !== void 0) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return $9a474b7dcd09c5ab$var$_assertThisInitialized(self);\n}\nfunction $9a474b7dcd09c5ab$var$_assertThisInitialized(self) {\n if (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n}\nfunction $9a474b7dcd09c5ab$var$_wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n $9a474b7dcd09c5ab$var$_wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !$9a474b7dcd09c5ab$var$_isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") throw new TypeError(\"Super expression must either be null or a function\");\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return $9a474b7dcd09c5ab$var$_construct(Class, arguments, $9a474b7dcd09c5ab$var$_getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return $9a474b7dcd09c5ab$var$_setPrototypeOf(Wrapper, Class);\n };\n return $9a474b7dcd09c5ab$var$_wrapNativeSuper(Class);\n}\nfunction $9a474b7dcd09c5ab$var$_construct(Parent, args, Class) {\n if ($9a474b7dcd09c5ab$var$_isNativeReflectConstruct()) $9a474b7dcd09c5ab$var$_construct = Reflect.construct.bind();\n else $9a474b7dcd09c5ab$var$_construct = function _construct(Parent, args, Class) {\n var a = [\n null\n ];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) $9a474b7dcd09c5ab$var$_setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n return $9a474b7dcd09c5ab$var$_construct.apply(null, arguments);\n}\nfunction $9a474b7dcd09c5ab$var$_isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n}\nfunction $9a474b7dcd09c5ab$var$_isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\nfunction $9a474b7dcd09c5ab$var$_setPrototypeOf(o, p) {\n $9a474b7dcd09c5ab$var$_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return $9a474b7dcd09c5ab$var$_setPrototypeOf(o, p);\n}\nfunction $9a474b7dcd09c5ab$var$_getPrototypeOf(o) {\n $9a474b7dcd09c5ab$var$_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return $9a474b7dcd09c5ab$var$_getPrototypeOf(o);\n}\nfunction $9a474b7dcd09c5ab$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $9a474b7dcd09c5ab$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $9a474b7dcd09c5ab$var$_typeof(o);\n}\n\nvar $5d0kT = parcelRequire(\"5d0kT\");\nvar $9a474b7dcd09c5ab$var$inspect = $5d0kT.inspect;\n\nvar $idZmf = parcelRequire(\"idZmf\");\nvar $9a474b7dcd09c5ab$var$ERR_INVALID_ARG_TYPE = $idZmf.codes.ERR_INVALID_ARG_TYPE;\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction $9a474b7dcd09c5ab$var$endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) this_len = str.length;\n return str.substring(this_len - search.length, this_len) === search;\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\nfunction $9a474b7dcd09c5ab$var$repeat(str, count) {\n count = Math.floor(count);\n if (str.length == 0 || count == 0) return \"\";\n var maxCount = str.length * count;\n count = Math.floor(Math.log(count) / Math.log(2));\n while(count){\n str += str;\n count--;\n }\n str += str.substring(0, maxCount - str.length);\n return str;\n}\nvar $9a474b7dcd09c5ab$var$blue = \"\";\nvar $9a474b7dcd09c5ab$var$green = \"\";\nvar $9a474b7dcd09c5ab$var$red = \"\";\nvar $9a474b7dcd09c5ab$var$white = \"\";\nvar $9a474b7dcd09c5ab$var$kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n};\n// Comparing short primitives should just show === / !== instead of using the\n// diff.\nvar $9a474b7dcd09c5ab$var$kMaxShortLength = 10;\nfunction $9a474b7dcd09c5ab$var$copyError(source) {\n var keys = Object.keys(source);\n var target = Object.create(Object.getPrototypeOf(source));\n keys.forEach(function(key) {\n target[key] = source[key];\n });\n Object.defineProperty(target, \"message\", {\n value: source.message\n });\n return target;\n}\nfunction $9a474b7dcd09c5ab$var$inspectValue(val) {\n // The util.inspect default values could be changed. This makes sure the\n // error messages contain the necessary information nevertheless.\n return $9a474b7dcd09c5ab$var$inspect(val, {\n compact: false,\n customInspect: false,\n depth: 1000,\n maxArrayLength: Infinity,\n // Assert compares only enumerable properties (with a few exceptions).\n showHidden: false,\n // Having a long line as error is better than wrapping the line for\n // comparison for now.\n // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we\n // have meta information about the inspected properties (i.e., know where\n // in what line the property starts and ends).\n breakLength: Infinity,\n // Assert does not detect proxies currently.\n showProxy: false,\n sorted: true,\n // Inspect getters as we also check them when comparing entries.\n getters: true\n });\n}\nfunction $9a474b7dcd09c5ab$var$createErrDiff(actual, expected, operator) {\n var other = \"\";\n var res = \"\";\n var lastPos = 0;\n var end = \"\";\n var skipped = false;\n var actualInspected = $9a474b7dcd09c5ab$var$inspectValue(actual);\n var actualLines = actualInspected.split(\"\\n\");\n var expectedLines = $9a474b7dcd09c5ab$var$inspectValue(expected).split(\"\\n\");\n var i = 0;\n var indicator = \"\";\n // In case both values are objects explicitly mark them as not reference equal\n // for the `strictEqual` operator.\n if (operator === \"strictEqual\" && $9a474b7dcd09c5ab$var$_typeof(actual) === \"object\" && $9a474b7dcd09c5ab$var$_typeof(expected) === \"object\" && actual !== null && expected !== null) operator = \"strictEqualObject\";\n // If \"actual\" and \"expected\" fit on a single line and they are not strictly\n // equal, check further special handling.\n if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n // If the character length of \"actual\" and \"expected\" together is less than\n // kMaxShortLength and if neither is an object and at least one of them is\n // not `zero`, use the strict equal comparison to visualize the output.\n if (inputLength <= $9a474b7dcd09c5ab$var$kMaxShortLength) {\n if (($9a474b7dcd09c5ab$var$_typeof(actual) !== \"object\" || actual === null) && ($9a474b7dcd09c5ab$var$_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0)) // -0 === +0\n return \"\".concat($9a474b7dcd09c5ab$var$kReadableOperator[operator], \"\\n\\n\") + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], \"\\n\");\n } else if (operator !== \"strictEqualObject\") {\n // If the stderr is a tty and the input length is lower than the current\n // columns per line, add a mismatch indicator below the output. If it is\n // not a tty, use a default value of 80 characters.\n var maxLength = $bYqme.stderr && $bYqme.stderr.isTTY ? $bYqme.stderr.columns : 80;\n if (inputLength < maxLength) {\n while(actualLines[0][i] === expectedLines[0][i])i++;\n // Ignore the first characters.\n if (i > 2) {\n // Add position indicator for the first mismatch in case it is a\n // single line and the input length is less than the column length.\n indicator = \"\\n \".concat($9a474b7dcd09c5ab$var$repeat(\" \", i), \"^\");\n i = 0;\n }\n }\n }\n }\n // Remove all ending lines that match (this optimizes the output for\n // readability by reducing the number of total changed lines).\n var a = actualLines[actualLines.length - 1];\n var b = expectedLines[expectedLines.length - 1];\n while(a === b){\n if (i++ < 2) end = \"\\n \".concat(a).concat(end);\n else other = a;\n actualLines.pop();\n expectedLines.pop();\n if (actualLines.length === 0 || expectedLines.length === 0) break;\n a = actualLines[actualLines.length - 1];\n b = expectedLines[expectedLines.length - 1];\n }\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n // Strict equal with identical objects that are not identical by reference.\n // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() })\n if (maxLines === 0) {\n // We have to get the result again. The lines were all removed before.\n var _actualLines = actualInspected.split(\"\\n\");\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (_actualLines.length > 30) {\n _actualLines[26] = \"\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white);\n while(_actualLines.length > 27)_actualLines.pop();\n }\n return \"\".concat($9a474b7dcd09c5ab$var$kReadableOperator.notIdentical, \"\\n\\n\").concat(_actualLines.join(\"\\n\"), \"\\n\");\n }\n if (i > 3) {\n end = \"\\n\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white).concat(end);\n skipped = true;\n }\n if (other !== \"\") {\n end = \"\\n \".concat(other).concat(end);\n other = \"\";\n }\n var printedLines = 0;\n var msg = $9a474b7dcd09c5ab$var$kReadableOperator[operator] + \"\\n\".concat($9a474b7dcd09c5ab$var$green, \"+ actual\").concat($9a474b7dcd09c5ab$var$white, \" \").concat($9a474b7dcd09c5ab$var$red, \"- expected\").concat($9a474b7dcd09c5ab$var$white);\n var skippedMsg = \" \".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white, \" Lines skipped\");\n for(i = 0; i < maxLines; i++){\n // Only extra expected lines exist\n var cur = i - lastPos;\n if (actualLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(expectedLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(expectedLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the expected line to the cache.\n other += \"\\n\".concat($9a474b7dcd09c5ab$var$red, \"-\").concat($9a474b7dcd09c5ab$var$white, \" \").concat(expectedLines[i]);\n printedLines++;\n // Only extra actual lines exist\n } else if (expectedLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result.\n res += \"\\n\".concat($9a474b7dcd09c5ab$var$green, \"+\").concat($9a474b7dcd09c5ab$var$white, \" \").concat(actualLines[i]);\n printedLines++;\n // Lines diverge\n } else {\n var expectedLine = expectedLines[i];\n var actualLine = actualLines[i];\n // If the lines diverge, specifically check for lines that only diverge by\n // a trailing comma. In that case it is actually identical and we should\n // mark it as such.\n var divergingLines = actualLine !== expectedLine && (!$9a474b7dcd09c5ab$var$endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n // If the expected line has a trailing comma but is otherwise identical,\n // add a comma at the end of the actual line. Otherwise the output could\n // look weird as in:\n //\n // [\n // 1 // No comma at the end!\n // + 2\n // ]\n //\n if (divergingLines && $9a474b7dcd09c5ab$var$endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine) {\n divergingLines = false;\n actualLine += \",\";\n }\n if (divergingLines) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result and cache the expected diverging\n // line so consecutive diverging lines show up as +++--- and not +-+-+-.\n res += \"\\n\".concat($9a474b7dcd09c5ab$var$green, \"+\").concat($9a474b7dcd09c5ab$var$white, \" \").concat(actualLine);\n other += \"\\n\".concat($9a474b7dcd09c5ab$var$red, \"-\").concat($9a474b7dcd09c5ab$var$white, \" \").concat(expectedLine);\n printedLines += 2;\n // Lines are identical\n } else {\n // Add all cached information to the result before adding other things\n // and reset the cache.\n res += other;\n other = \"\";\n // If the last diverging line is exactly one line above or if it is the\n // very first line, add the line to the result.\n if (cur === 1 || i === 0) {\n res += \"\\n \".concat(actualLine);\n printedLines++;\n }\n }\n }\n // Inspected object to big (Show ~20 rows max)\n if (printedLines > 20 && i < maxLines - 2) return \"\".concat(msg).concat(skippedMsg, \"\\n\").concat(res, \"\\n\").concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white).concat(other, \"\\n\") + \"\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white);\n }\n return \"\".concat(msg).concat(skipped ? skippedMsg : \"\", \"\\n\").concat(res).concat(other).concat(end).concat(indicator);\n}\nvar $9a474b7dcd09c5ab$var$AssertionError = /*#__PURE__*/ function(_Error, _inspect$custom) {\n $9a474b7dcd09c5ab$var$_inherits(AssertionError, _Error);\n var _super = $9a474b7dcd09c5ab$var$_createSuper(AssertionError);\n function AssertionError(options) {\n var _this;\n $9a474b7dcd09c5ab$var$_classCallCheck(this, AssertionError);\n if ($9a474b7dcd09c5ab$var$_typeof(options) !== \"object\" || options === null) throw new $9a474b7dcd09c5ab$var$ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var message = options.message, operator = options.operator, stackStartFn = options.stackStartFn;\n var actual = options.actual, expected = options.expected;\n var limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n if (message != null) _this = _super.call(this, String(message));\n else {\n if ($bYqme.stderr && $bYqme.stderr.isTTY) {\n // Reset on each call to make sure we handle dynamically set environment\n // variables correct.\n if ($bYqme.stderr && $bYqme.stderr.getColorDepth && $bYqme.stderr.getColorDepth() !== 1) {\n $9a474b7dcd09c5ab$var$blue = \"\\x1b[34m\";\n $9a474b7dcd09c5ab$var$green = \"\\x1b[32m\";\n $9a474b7dcd09c5ab$var$white = \"\\x1b[39m\";\n $9a474b7dcd09c5ab$var$red = \"\\x1b[31m\";\n } else {\n $9a474b7dcd09c5ab$var$blue = \"\";\n $9a474b7dcd09c5ab$var$green = \"\";\n $9a474b7dcd09c5ab$var$white = \"\";\n $9a474b7dcd09c5ab$var$red = \"\";\n }\n }\n // Prevent the error stack from being visible by duplicating the error\n // in a very close way to the original in case both sides are actually\n // instances of Error.\n if ($9a474b7dcd09c5ab$var$_typeof(actual) === \"object\" && actual !== null && $9a474b7dcd09c5ab$var$_typeof(expected) === \"object\" && expected !== null && \"stack\" in actual && actual instanceof Error && \"stack\" in expected && expected instanceof Error) {\n actual = $9a474b7dcd09c5ab$var$copyError(actual);\n expected = $9a474b7dcd09c5ab$var$copyError(expected);\n }\n if (operator === \"deepStrictEqual\" || operator === \"strictEqual\") _this = _super.call(this, $9a474b7dcd09c5ab$var$createErrDiff(actual, expected, operator));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n // In case the objects are equal but the operator requires unequal, show\n // the first object and say A equals B\n var base = $9a474b7dcd09c5ab$var$kReadableOperator[operator];\n var res = $9a474b7dcd09c5ab$var$inspectValue(actual).split(\"\\n\");\n // In case \"actual\" is an object, it should not be reference equal.\n if (operator === \"notStrictEqual\" && $9a474b7dcd09c5ab$var$_typeof(actual) === \"object\" && actual !== null) base = $9a474b7dcd09c5ab$var$kReadableOperator.notStrictEqualObject;\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (res.length > 30) {\n res[26] = \"\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white);\n while(res.length > 27)res.pop();\n }\n // Only print a single input.\n if (res.length === 1) _this = _super.call(this, \"\".concat(base, \" \").concat(res[0]));\n else _this = _super.call(this, \"\".concat(base, \"\\n\\n\").concat(res.join(\"\\n\"), \"\\n\"));\n } else {\n var _res = $9a474b7dcd09c5ab$var$inspectValue(actual);\n var other = \"\";\n var knownOperators = $9a474b7dcd09c5ab$var$kReadableOperator[operator];\n if (operator === \"notDeepEqual\" || operator === \"notEqual\") {\n _res = \"\".concat($9a474b7dcd09c5ab$var$kReadableOperator[operator], \"\\n\\n\").concat(_res);\n if (_res.length > 1024) _res = \"\".concat(_res.slice(0, 1021), \"...\");\n } else {\n other = \"\".concat($9a474b7dcd09c5ab$var$inspectValue(expected));\n if (_res.length > 512) _res = \"\".concat(_res.slice(0, 509), \"...\");\n if (other.length > 512) other = \"\".concat(other.slice(0, 509), \"...\");\n if (operator === \"deepEqual\" || operator === \"equal\") _res = \"\".concat(knownOperators, \"\\n\\n\").concat(_res, \"\\n\\nshould equal\\n\\n\");\n else other = \" \".concat(operator, \" \").concat(other);\n }\n _this = _super.call(this, \"\".concat(_res).concat(other));\n }\n }\n Error.stackTraceLimit = limit;\n _this.generatedMessage = !message;\n Object.defineProperty($9a474b7dcd09c5ab$var$_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: false,\n writable: true,\n configurable: true\n });\n _this.code = \"ERR_ASSERTION\";\n _this.actual = actual;\n _this.expected = expected;\n _this.operator = operator;\n if (Error.captureStackTrace) // eslint-disable-next-line no-restricted-syntax\n Error.captureStackTrace($9a474b7dcd09c5ab$var$_assertThisInitialized(_this), stackStartFn);\n // Create error message including the error code in the name.\n _this.stack;\n // Reset the name.\n _this.name = \"AssertionError\";\n return $9a474b7dcd09c5ab$var$_possibleConstructorReturn(_this);\n }\n $9a474b7dcd09c5ab$var$_createClass(AssertionError, [\n {\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: _inspect$custom,\n value: function value(recurseTimes, ctx) {\n // This limits the `actual` and `expected` property default inspection to\n // the minimum depth. Otherwise those values would be too verbose compared\n // to the actual error message which contains a combined view of these two\n // input values.\n return $9a474b7dcd09c5ab$var$inspect(this, $9a474b7dcd09c5ab$var$_objectSpread($9a474b7dcd09c5ab$var$_objectSpread({}, ctx), {}, {\n customInspect: false,\n depth: 0\n }));\n }\n }\n ]);\n return AssertionError;\n}(/*#__PURE__*/ $9a474b7dcd09c5ab$var$_wrapNativeSuper(Error), $9a474b7dcd09c5ab$var$inspect.custom);\nmodule.exports = $9a474b7dcd09c5ab$var$AssertionError;\n\n});\n\nparcelRegister(\"5AA81\", function(module, exports) {\n\"use strict\";\n\nvar $4pa7q = parcelRequire(\"4pa7q\");\nvar $411c56e62e13ea6c$var$lacksProperEnumerationOrder = function() {\n if (!Object.assign) return false;\n /*\n\t * v8, specifically in node 4.x, has a bug with incorrect property enumeration order\n\t * note: this does not detect the bug unless there's 20 characters\n\t */ var str = \"abcdefghijklmnopqrst\";\n var letters = str.split(\"\");\n var map = {};\n for(var i = 0; i < letters.length; ++i)map[letters[i]] = letters[i];\n var obj = Object.assign({}, map);\n var actual = \"\";\n for(var k in obj)actual += k;\n return str !== actual;\n};\nvar $411c56e62e13ea6c$var$assignHasPendingExceptions = function() {\n if (!Object.assign || !Object.preventExtensions) return false;\n /*\n\t * Firefox 37 still has \"pending exception\" logic in its Object.assign implementation,\n\t * which is 72% slower than our shim, and Firefox 40's native implementation.\n\t */ var thrower = Object.preventExtensions({\n 1: 2\n });\n try {\n Object.assign(thrower, \"xy\");\n } catch (e) {\n return thrower[1] === \"y\";\n }\n return false;\n};\nmodule.exports = function getPolyfill() {\n if (!Object.assign) return $4pa7q;\n if ($411c56e62e13ea6c$var$lacksProperEnumerationOrder()) return $4pa7q;\n if ($411c56e62e13ea6c$var$assignHasPendingExceptions()) return $4pa7q;\n return Object.assign;\n};\n\n});\nparcelRegister(\"4pa7q\", function(module, exports) {\n\"use strict\";\n\nvar $dOa0R = parcelRequire(\"dOa0R\");\n\nvar $3351589ec22f2476$var$hasSymbols = (parcelRequire(\"iswqS\"))();\n\nvar $9rEHq = parcelRequire(\"9rEHq\");\nvar $3351589ec22f2476$var$toObject = Object;\nvar $3351589ec22f2476$var$$push = $9rEHq(\"Array.prototype.push\");\nvar $3351589ec22f2476$var$$propIsEnumerable = $9rEHq(\"Object.prototype.propertyIsEnumerable\");\nvar $3351589ec22f2476$var$originalGetSymbols = $3351589ec22f2476$var$hasSymbols ? Object.getOwnPropertySymbols : null;\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function assign(target, source1) {\n if (target == null) throw new TypeError(\"target must be an object\");\n var to = $3351589ec22f2476$var$toObject(target); // step 1\n if (arguments.length === 1) return to; // step 2\n for(var s = 1; s < arguments.length; ++s){\n var from = $3351589ec22f2476$var$toObject(arguments[s]); // step 3.a.i\n // step 3.a.ii:\n var keys = $dOa0R(from);\n var getSymbols = $3351589ec22f2476$var$hasSymbols && (Object.getOwnPropertySymbols || $3351589ec22f2476$var$originalGetSymbols);\n if (getSymbols) {\n var syms = getSymbols(from);\n for(var j = 0; j < syms.length; ++j){\n var key = syms[j];\n if ($3351589ec22f2476$var$$propIsEnumerable(from, key)) $3351589ec22f2476$var$$push(keys, key);\n }\n }\n // step 3.a.iii:\n for(var i = 0; i < keys.length; ++i){\n var nextKey = keys[i];\n if ($3351589ec22f2476$var$$propIsEnumerable(from, nextKey)) {\n var propValue = from[nextKey]; // step 3.a.iii.2.a\n to[nextKey] = propValue; // step 3.a.iii.2.b\n }\n }\n }\n return to; // step 4\n};\n\n});\nparcelRegister(\"dOa0R\", function(module, exports) {\n\"use strict\";\nvar $a0d7b63dfc6f5323$var$slice = Array.prototype.slice;\n\nvar $1ie2q = parcelRequire(\"1ie2q\");\nvar $a0d7b63dfc6f5323$var$origKeys = Object.keys;\n\nvar $a0d7b63dfc6f5323$var$keysShim = $a0d7b63dfc6f5323$var$origKeys ? function keys(o) {\n return $a0d7b63dfc6f5323$var$origKeys(o);\n} : (parcelRequire(\"1utM5\"));\nvar $a0d7b63dfc6f5323$var$originalKeys = Object.keys;\n$a0d7b63dfc6f5323$var$keysShim.shim = function shimObjectKeys() {\n if (Object.keys) {\n var keysWorksWithArguments = function() {\n // Safari 5.0 bug\n var args = Object.keys(arguments);\n return args && args.length === arguments.length;\n }(1, 2);\n if (!keysWorksWithArguments) Object.keys = function keys(object) {\n if ($1ie2q(object)) return $a0d7b63dfc6f5323$var$originalKeys($a0d7b63dfc6f5323$var$slice.call(object));\n return $a0d7b63dfc6f5323$var$originalKeys(object);\n };\n } else Object.keys = $a0d7b63dfc6f5323$var$keysShim;\n return Object.keys || $a0d7b63dfc6f5323$var$keysShim;\n};\nmodule.exports = $a0d7b63dfc6f5323$var$keysShim;\n\n});\nparcelRegister(\"1ie2q\", function(module, exports) {\n\"use strict\";\nvar $0f125c9239cfced8$var$toStr = Object.prototype.toString;\nmodule.exports = function isArguments(value) {\n var str = $0f125c9239cfced8$var$toStr.call(value);\n var isArgs = str === \"[object Arguments]\";\n if (!isArgs) isArgs = str !== \"[object Array]\" && value !== null && typeof value === \"object\" && typeof value.length === \"number\" && value.length >= 0 && $0f125c9239cfced8$var$toStr.call(value.callee) === \"[object Function]\";\n return isArgs;\n};\n\n});\n\nparcelRegister(\"1utM5\", function(module, exports) {\n\"use strict\";\nvar $115fb06b4e6cce1c$var$keysShim;\n\nif (!Object.keys) {\n // modified from https://github.com/es-shims/es5-shim\n var $115fb06b4e6cce1c$var$has = Object.prototype.hasOwnProperty;\n var $115fb06b4e6cce1c$var$toStr = Object.prototype.toString;\n var $115fb06b4e6cce1c$var$isArgs = (parcelRequire(\"1ie2q\")); // eslint-disable-line global-require\n var $115fb06b4e6cce1c$var$isEnumerable = Object.prototype.propertyIsEnumerable;\n var $115fb06b4e6cce1c$var$hasDontEnumBug = !$115fb06b4e6cce1c$var$isEnumerable.call({\n toString: null\n }, \"toString\");\n var $115fb06b4e6cce1c$var$hasProtoEnumBug = $115fb06b4e6cce1c$var$isEnumerable.call(function() {}, \"prototype\");\n var $115fb06b4e6cce1c$var$dontEnums = [\n \"toString\",\n \"toLocaleString\",\n \"valueOf\",\n \"hasOwnProperty\",\n \"isPrototypeOf\",\n \"propertyIsEnumerable\",\n \"constructor\"\n ];\n var $115fb06b4e6cce1c$var$equalsConstructorPrototype = function(o) {\n var ctor = o.constructor;\n return ctor && ctor.prototype === o;\n };\n var $115fb06b4e6cce1c$var$excludedKeys = {\n $applicationCache: true,\n $console: true,\n $external: true,\n $frame: true,\n $frameElement: true,\n $frames: true,\n $innerHeight: true,\n $innerWidth: true,\n $onmozfullscreenchange: true,\n $onmozfullscreenerror: true,\n $outerHeight: true,\n $outerWidth: true,\n $pageXOffset: true,\n $pageYOffset: true,\n $parent: true,\n $scrollLeft: true,\n $scrollTop: true,\n $scrollX: true,\n $scrollY: true,\n $self: true,\n $webkitIndexedDB: true,\n $webkitStorageInfo: true,\n $window: true\n };\n var $115fb06b4e6cce1c$var$hasAutomationEqualityBug = function() {\n /* global window */ if (typeof window === \"undefined\") return false;\n for(var k in window)try {\n if (!$115fb06b4e6cce1c$var$excludedKeys[\"$\" + k] && $115fb06b4e6cce1c$var$has.call(window, k) && window[k] !== null && typeof window[k] === \"object\") try {\n $115fb06b4e6cce1c$var$equalsConstructorPrototype(window[k]);\n } catch (e) {\n return true;\n }\n } catch (e) {\n return true;\n }\n return false;\n }();\n var $115fb06b4e6cce1c$var$equalsConstructorPrototypeIfNotBuggy = function(o) {\n /* global window */ if (typeof window === \"undefined\" || !$115fb06b4e6cce1c$var$hasAutomationEqualityBug) return $115fb06b4e6cce1c$var$equalsConstructorPrototype(o);\n try {\n return $115fb06b4e6cce1c$var$equalsConstructorPrototype(o);\n } catch (e) {\n return false;\n }\n };\n $115fb06b4e6cce1c$var$keysShim = function keys(object) {\n var isObject = object !== null && typeof object === \"object\";\n var isFunction = $115fb06b4e6cce1c$var$toStr.call(object) === \"[object Function]\";\n var isArguments = $115fb06b4e6cce1c$var$isArgs(object);\n var isString = isObject && $115fb06b4e6cce1c$var$toStr.call(object) === \"[object String]\";\n var theKeys = [];\n if (!isObject && !isFunction && !isArguments) throw new TypeError(\"Object.keys called on a non-object\");\n var skipProto = $115fb06b4e6cce1c$var$hasProtoEnumBug && isFunction;\n if (isString && object.length > 0 && !$115fb06b4e6cce1c$var$has.call(object, 0)) for(var i = 0; i < object.length; ++i)theKeys.push(String(i));\n if (isArguments && object.length > 0) for(var j = 0; j < object.length; ++j)theKeys.push(String(j));\n else {\n for(var name in object)if (!(skipProto && name === \"prototype\") && $115fb06b4e6cce1c$var$has.call(object, name)) theKeys.push(String(name));\n }\n if ($115fb06b4e6cce1c$var$hasDontEnumBug) {\n var skipConstructor = $115fb06b4e6cce1c$var$equalsConstructorPrototypeIfNotBuggy(object);\n for(var k = 0; k < $115fb06b4e6cce1c$var$dontEnums.length; ++k)if (!(skipConstructor && $115fb06b4e6cce1c$var$dontEnums[k] === \"constructor\") && $115fb06b4e6cce1c$var$has.call(object, $115fb06b4e6cce1c$var$dontEnums[k])) theKeys.push($115fb06b4e6cce1c$var$dontEnums[k]);\n }\n return theKeys;\n };\n}\nmodule.exports = $115fb06b4e6cce1c$var$keysShim;\n\n});\n\n\n\n\nparcelRegister(\"2bLwM\", function(module, exports) {\n\"use strict\";\n\nvar $hcnrk = parcelRequire(\"hcnrk\");\nmodule.exports = function getPolyfill() {\n return typeof Object.is === \"function\" ? Object.is : $hcnrk;\n};\n\n});\nparcelRegister(\"hcnrk\", function(module, exports) {\n\"use strict\";\nvar $c855bd4e3973b6ef$var$numberIsNaN = function(value) {\n return value !== value;\n};\nmodule.exports = function is(a, b) {\n if (a === 0 && b === 0) return 1 / a === 1 / b;\n if (a === b) return true;\n if ($c855bd4e3973b6ef$var$numberIsNaN(a) && $c855bd4e3973b6ef$var$numberIsNaN(b)) return true;\n return false;\n};\n\n});\n\n\nparcelRegister(\"gz1S4\", function(module, exports) {\n// Currently in sync with Node.js lib/internal/util/comparisons.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\"use strict\";\nfunction $c0f15dcd943db777$var$_slicedToArray(arr, i) {\n return $c0f15dcd943db777$var$_arrayWithHoles(arr) || $c0f15dcd943db777$var$_iterableToArrayLimit(arr, i) || $c0f15dcd943db777$var$_unsupportedIterableToArray(arr, i) || $c0f15dcd943db777$var$_nonIterableRest();\n}\nfunction $c0f15dcd943db777$var$_nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction $c0f15dcd943db777$var$_unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return $c0f15dcd943db777$var$_arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $c0f15dcd943db777$var$_arrayLikeToArray(o, minLen);\n}\nfunction $c0f15dcd943db777$var$_arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction $c0f15dcd943db777$var$_iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e, n, i, u, a = [], f = !0, o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for(; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally{\n try {\n if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n } finally{\n if (o) throw n;\n }\n }\n return a;\n }\n}\nfunction $c0f15dcd943db777$var$_arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction $c0f15dcd943db777$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $c0f15dcd943db777$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $c0f15dcd943db777$var$_typeof(o);\n}\nvar $c0f15dcd943db777$var$regexFlagsSupported = /a/g.flags !== undefined;\nvar $c0f15dcd943db777$var$arrayFromSet = function arrayFromSet(set) {\n var array = [];\n set.forEach(function(value) {\n return array.push(value);\n });\n return array;\n};\nvar $c0f15dcd943db777$var$arrayFromMap = function arrayFromMap(map) {\n var array = [];\n map.forEach(function(value, key) {\n return array.push([\n key,\n value\n ]);\n });\n return array;\n};\n\nvar $c0f15dcd943db777$var$objectIs = Object.is ? Object.is : (parcelRequire(\"dDNGE\"));\nvar $c0f15dcd943db777$var$objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function() {\n return [];\n};\n\nvar $c0f15dcd943db777$var$numberIsNaN = Number.isNaN ? Number.isNaN : (parcelRequire(\"3rh8v\"));\nfunction $c0f15dcd943db777$var$uncurryThis(f) {\n return f.call.bind(f);\n}\nvar $c0f15dcd943db777$var$hasOwnProperty = $c0f15dcd943db777$var$uncurryThis(Object.prototype.hasOwnProperty);\nvar $c0f15dcd943db777$var$propertyIsEnumerable = $c0f15dcd943db777$var$uncurryThis(Object.prototype.propertyIsEnumerable);\nvar $c0f15dcd943db777$var$objectToString = $c0f15dcd943db777$var$uncurryThis(Object.prototype.toString);\n\nvar $5d0kT = parcelRequire(\"5d0kT\");\nvar $c0f15dcd943db777$require$_require$types = $5d0kT.types;\nvar $c0f15dcd943db777$var$isAnyArrayBuffer = $c0f15dcd943db777$require$_require$types.isAnyArrayBuffer, $c0f15dcd943db777$var$isArrayBufferView = $c0f15dcd943db777$require$_require$types.isArrayBufferView, $c0f15dcd943db777$var$isDate = $c0f15dcd943db777$require$_require$types.isDate, $c0f15dcd943db777$var$isMap = $c0f15dcd943db777$require$_require$types.isMap, $c0f15dcd943db777$var$isRegExp = $c0f15dcd943db777$require$_require$types.isRegExp, $c0f15dcd943db777$var$isSet = $c0f15dcd943db777$require$_require$types.isSet, $c0f15dcd943db777$var$isNativeError = $c0f15dcd943db777$require$_require$types.isNativeError, $c0f15dcd943db777$var$isBoxedPrimitive = $c0f15dcd943db777$require$_require$types.isBoxedPrimitive, $c0f15dcd943db777$var$isNumberObject = $c0f15dcd943db777$require$_require$types.isNumberObject, $c0f15dcd943db777$var$isStringObject = $c0f15dcd943db777$require$_require$types.isStringObject, $c0f15dcd943db777$var$isBooleanObject = $c0f15dcd943db777$require$_require$types.isBooleanObject, $c0f15dcd943db777$var$isBigIntObject = $c0f15dcd943db777$require$_require$types.isBigIntObject, $c0f15dcd943db777$var$isSymbolObject = $c0f15dcd943db777$require$_require$types.isSymbolObject, $c0f15dcd943db777$var$isFloat32Array = $c0f15dcd943db777$require$_require$types.isFloat32Array, $c0f15dcd943db777$var$isFloat64Array = $c0f15dcd943db777$require$_require$types.isFloat64Array;\nfunction $c0f15dcd943db777$var$isNonIndex(key) {\n if (key.length === 0 || key.length > 10) return true;\n for(var i = 0; i < key.length; i++){\n var code = key.charCodeAt(i);\n if (code < 48 || code > 57) return true;\n }\n // The maximum size for an array is 2 ** 32 -1.\n return key.length === 10 && key >= Math.pow(2, 32);\n}\nfunction $c0f15dcd943db777$var$getOwnNonIndexProperties(value) {\n return Object.keys(value).filter($c0f15dcd943db777$var$isNonIndex).concat($c0f15dcd943db777$var$objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));\n}\n// Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */ function $c0f15dcd943db777$var$compare(a, b) {\n if (a === b) return 0;\n var x = a.length;\n var y = b.length;\n for(var i = 0, len = Math.min(x, y); i < len; ++i)if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n}\nvar $c0f15dcd943db777$var$ONLY_ENUMERABLE = undefined;\nvar $c0f15dcd943db777$var$kStrict = true;\nvar $c0f15dcd943db777$var$kLoose = false;\nvar $c0f15dcd943db777$var$kNoIterator = 0;\nvar $c0f15dcd943db777$var$kIsArray = 1;\nvar $c0f15dcd943db777$var$kIsSet = 2;\nvar $c0f15dcd943db777$var$kIsMap = 3;\n// Check if they have the same source and flags\nfunction $c0f15dcd943db777$var$areSimilarRegExps(a, b) {\n return $c0f15dcd943db777$var$regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);\n}\nfunction $c0f15dcd943db777$var$areSimilarFloatArrays(a, b) {\n if (a.byteLength !== b.byteLength) return false;\n for(var offset = 0; offset < a.byteLength; offset++){\n if (a[offset] !== b[offset]) return false;\n }\n return true;\n}\nfunction $c0f15dcd943db777$var$areSimilarTypedArrays(a, b) {\n if (a.byteLength !== b.byteLength) return false;\n return $c0f15dcd943db777$var$compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;\n}\nfunction $c0f15dcd943db777$var$areEqualArrayBuffers(buf1, buf2) {\n return buf1.byteLength === buf2.byteLength && $c0f15dcd943db777$var$compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;\n}\nfunction $c0f15dcd943db777$var$isEqualBoxedPrimitive(val1, val2) {\n if ($c0f15dcd943db777$var$isNumberObject(val1)) return $c0f15dcd943db777$var$isNumberObject(val2) && $c0f15dcd943db777$var$objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));\n if ($c0f15dcd943db777$var$isStringObject(val1)) return $c0f15dcd943db777$var$isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);\n if ($c0f15dcd943db777$var$isBooleanObject(val1)) return $c0f15dcd943db777$var$isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);\n if ($c0f15dcd943db777$var$isBigIntObject(val1)) return $c0f15dcd943db777$var$isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);\n return $c0f15dcd943db777$var$isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);\n}\n// Notes: Type tags are historical [[Class]] properties that can be set by\n// FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS\n// and retrieved using Object.prototype.toString.call(obj) in JS\n// See https://tc39.github.io/ecma262/#sec-object.prototype.tostring\n// for a list of tags pre-defined in the spec.\n// There are some unspecified tags in the wild too (e.g. typed array tags).\n// Since tags can be altered, they only serve fast failures\n//\n// Typed arrays and buffers are checked by comparing the content in their\n// underlying ArrayBuffer. This optimization requires that it's\n// reasonable to interpret their underlying memory in the same way,\n// which is checked by comparing their type tags.\n// (e.g. a Uint8Array and a Uint16Array with the same memory content\n// could still be different because they will be interpreted differently).\n//\n// For strict comparison, objects should have\n// a) The same built-in type tags\n// b) The same prototypes.\nfunction $c0f15dcd943db777$var$innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? $c0f15dcd943db777$var$objectIs(val1, val2) : true;\n }\n // Check more closely if val1 and val2 are equal.\n if (strict) {\n if ($c0f15dcd943db777$var$_typeof(val1) !== \"object\") return typeof val1 === \"number\" && $c0f15dcd943db777$var$numberIsNaN(val1) && $c0f15dcd943db777$var$numberIsNaN(val2);\n if ($c0f15dcd943db777$var$_typeof(val2) !== \"object\" || val1 === null || val2 === null) return false;\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) return false;\n } else {\n if (val1 === null || $c0f15dcd943db777$var$_typeof(val1) !== \"object\") {\n if (val2 === null || $c0f15dcd943db777$var$_typeof(val2) !== \"object\") // eslint-disable-next-line eqeqeq\n return val1 == val2;\n return false;\n }\n if (val2 === null || $c0f15dcd943db777$var$_typeof(val2) !== \"object\") return false;\n }\n var val1Tag = $c0f15dcd943db777$var$objectToString(val1);\n var val2Tag = $c0f15dcd943db777$var$objectToString(val2);\n if (val1Tag !== val2Tag) return false;\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) return false;\n var keys1 = $c0f15dcd943db777$var$getOwnNonIndexProperties(val1, $c0f15dcd943db777$var$ONLY_ENUMERABLE);\n var keys2 = $c0f15dcd943db777$var$getOwnNonIndexProperties(val2, $c0f15dcd943db777$var$ONLY_ENUMERABLE);\n if (keys1.length !== keys2.length) return false;\n return $c0f15dcd943db777$var$keyCheck(val1, val2, strict, memos, $c0f15dcd943db777$var$kIsArray, keys1);\n }\n // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n if (val1Tag === \"[object Object]\") {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!$c0f15dcd943db777$var$isMap(val1) && $c0f15dcd943db777$var$isMap(val2) || !$c0f15dcd943db777$var$isSet(val1) && $c0f15dcd943db777$var$isSet(val2)) return false;\n }\n if ($c0f15dcd943db777$var$isDate(val1)) {\n if (!$c0f15dcd943db777$var$isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) return false;\n } else if ($c0f15dcd943db777$var$isRegExp(val1)) {\n if (!$c0f15dcd943db777$var$isRegExp(val2) || !$c0f15dcd943db777$var$areSimilarRegExps(val1, val2)) return false;\n } else if ($c0f15dcd943db777$var$isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) return false;\n } else if ($c0f15dcd943db777$var$isArrayBufferView(val1)) {\n if (!strict && ($c0f15dcd943db777$var$isFloat32Array(val1) || $c0f15dcd943db777$var$isFloat64Array(val1))) {\n if (!$c0f15dcd943db777$var$areSimilarFloatArrays(val1, val2)) return false;\n } else if (!$c0f15dcd943db777$var$areSimilarTypedArrays(val1, val2)) return false;\n // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n var _keys = $c0f15dcd943db777$var$getOwnNonIndexProperties(val1, $c0f15dcd943db777$var$ONLY_ENUMERABLE);\n var _keys2 = $c0f15dcd943db777$var$getOwnNonIndexProperties(val2, $c0f15dcd943db777$var$ONLY_ENUMERABLE);\n if (_keys.length !== _keys2.length) return false;\n return $c0f15dcd943db777$var$keyCheck(val1, val2, strict, memos, $c0f15dcd943db777$var$kNoIterator, _keys);\n } else if ($c0f15dcd943db777$var$isSet(val1)) {\n if (!$c0f15dcd943db777$var$isSet(val2) || val1.size !== val2.size) return false;\n return $c0f15dcd943db777$var$keyCheck(val1, val2, strict, memos, $c0f15dcd943db777$var$kIsSet);\n } else if ($c0f15dcd943db777$var$isMap(val1)) {\n if (!$c0f15dcd943db777$var$isMap(val2) || val1.size !== val2.size) return false;\n return $c0f15dcd943db777$var$keyCheck(val1, val2, strict, memos, $c0f15dcd943db777$var$kIsMap);\n } else if ($c0f15dcd943db777$var$isAnyArrayBuffer(val1)) {\n if (!$c0f15dcd943db777$var$areEqualArrayBuffers(val1, val2)) return false;\n } else if ($c0f15dcd943db777$var$isBoxedPrimitive(val1) && !$c0f15dcd943db777$var$isEqualBoxedPrimitive(val1, val2)) return false;\n return $c0f15dcd943db777$var$keyCheck(val1, val2, strict, memos, $c0f15dcd943db777$var$kNoIterator);\n}\nfunction $c0f15dcd943db777$var$getEnumerables(val, keys) {\n return keys.filter(function(k) {\n return $c0f15dcd943db777$var$propertyIsEnumerable(val, k);\n });\n}\nfunction $c0f15dcd943db777$var$keyCheck(val1, val2, strict, memos, iterationType, aKeys) {\n // For all remaining Object pairs, including Array, objects and Maps,\n // equivalence is determined by having:\n // a) The same number of owned enumerable properties\n // b) The same set of keys/indexes (although not necessarily the same order)\n // c) Equivalent values for every corresponding key/index\n // d) For Sets and Maps, equal contents\n // Note: this accounts for both named and indexed properties on Arrays.\n if (arguments.length === 5) {\n aKeys = Object.keys(val1);\n var bKeys = Object.keys(val2);\n // The pair must have the same number of owned properties.\n if (aKeys.length !== bKeys.length) return false;\n }\n // Cheap key test\n var i = 0;\n for(; i < aKeys.length; i++){\n if (!$c0f15dcd943db777$var$hasOwnProperty(val2, aKeys[i])) return false;\n }\n if (strict && arguments.length === 5) {\n var symbolKeysA = $c0f15dcd943db777$var$objectGetOwnPropertySymbols(val1);\n if (symbolKeysA.length !== 0) {\n var count = 0;\n for(i = 0; i < symbolKeysA.length; i++){\n var key = symbolKeysA[i];\n if ($c0f15dcd943db777$var$propertyIsEnumerable(val1, key)) {\n if (!$c0f15dcd943db777$var$propertyIsEnumerable(val2, key)) return false;\n aKeys.push(key);\n count++;\n } else if ($c0f15dcd943db777$var$propertyIsEnumerable(val2, key)) return false;\n }\n var symbolKeysB = $c0f15dcd943db777$var$objectGetOwnPropertySymbols(val2);\n if (symbolKeysA.length !== symbolKeysB.length && $c0f15dcd943db777$var$getEnumerables(val2, symbolKeysB).length !== count) return false;\n } else {\n var _symbolKeysB = $c0f15dcd943db777$var$objectGetOwnPropertySymbols(val2);\n if (_symbolKeysB.length !== 0 && $c0f15dcd943db777$var$getEnumerables(val2, _symbolKeysB).length !== 0) return false;\n }\n }\n if (aKeys.length === 0 && (iterationType === $c0f15dcd943db777$var$kNoIterator || iterationType === $c0f15dcd943db777$var$kIsArray && val1.length === 0 || val1.size === 0)) return true;\n // Use memos to handle cycles.\n if (memos === undefined) memos = {\n val1: new Map(),\n val2: new Map(),\n position: 0\n };\n else {\n // We prevent up to two map.has(x) calls by directly retrieving the value\n // and checking for undefined. The map can only contain numbers, so it is\n // safe to check for undefined only.\n var val2MemoA = memos.val1.get(val1);\n if (val2MemoA !== undefined) {\n var val2MemoB = memos.val2.get(val2);\n if (val2MemoB !== undefined) return val2MemoA === val2MemoB;\n }\n memos.position++;\n }\n memos.val1.set(val1, memos.position);\n memos.val2.set(val2, memos.position);\n var areEq = $c0f15dcd943db777$var$objEquiv(val1, val2, strict, aKeys, memos, iterationType);\n memos.val1.delete(val1);\n memos.val2.delete(val2);\n return areEq;\n}\nfunction $c0f15dcd943db777$var$setHasEqualElement(set, val1, strict, memo) {\n // Go looking.\n var setValues = $c0f15dcd943db777$var$arrayFromSet(set);\n for(var i = 0; i < setValues.length; i++){\n var val2 = setValues[i];\n if ($c0f15dcd943db777$var$innerDeepEqual(val1, val2, strict, memo)) {\n // Remove the matching element to make sure we do not check that again.\n set.delete(val2);\n return true;\n }\n }\n return false;\n}\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using\n// Sadly it is not possible to detect corresponding values properly in case the\n// type is a string, number, bigint or boolean. The reason is that those values\n// can match lots of different string values (e.g., 1n == '+00001').\nfunction $c0f15dcd943db777$var$findLooseMatchingPrimitives(prim) {\n switch($c0f15dcd943db777$var$_typeof(prim)){\n case \"undefined\":\n return null;\n case \"object\":\n // Only pass in null as object!\n return undefined;\n case \"symbol\":\n return false;\n case \"string\":\n prim = +prim;\n // Loose equal entries exist only if the string is possible to convert to\n // a regular number and not NaN.\n // Fall through\n case \"number\":\n if ($c0f15dcd943db777$var$numberIsNaN(prim)) return false;\n }\n return true;\n}\nfunction $c0f15dcd943db777$var$setMightHaveLoosePrim(a, b, prim) {\n var altValue = $c0f15dcd943db777$var$findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n return b.has(altValue) && !a.has(altValue);\n}\nfunction $c0f15dcd943db777$var$mapMightHaveLoosePrim(a, b, prim, item, memo) {\n var altValue = $c0f15dcd943db777$var$findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n var curB = b.get(altValue);\n if (curB === undefined && !b.has(altValue) || !$c0f15dcd943db777$var$innerDeepEqual(item, curB, false, memo)) return false;\n return !a.has(altValue) && $c0f15dcd943db777$var$innerDeepEqual(item, curB, false, memo);\n}\nfunction $c0f15dcd943db777$var$setEquiv(a, b, strict, memo) {\n // This is a lazily initiated Set of entries which have to be compared\n // pairwise.\n var set = null;\n var aValues = $c0f15dcd943db777$var$arrayFromSet(a);\n for(var i = 0; i < aValues.length; i++){\n var val = aValues[i];\n // Note: Checking for the objects first improves the performance for object\n // heavy sets but it is a minor slow down for primitives. As they are fast\n // to check this improves the worst case scenario instead.\n if ($c0f15dcd943db777$var$_typeof(val) === \"object\" && val !== null) {\n if (set === null) set = new Set();\n // If the specified value doesn't exist in the second set its an not null\n // object (or non strict only: a not matching primitive) we'll need to go\n // hunting for something thats deep-(strict-)equal to it. To make this\n // O(n log n) complexity we have to copy these values in a new set first.\n set.add(val);\n } else if (!b.has(val)) {\n if (strict) return false;\n // Fast path to detect missing string, symbol, undefined and null values.\n if (!$c0f15dcd943db777$var$setMightHaveLoosePrim(a, b, val)) return false;\n if (set === null) set = new Set();\n set.add(val);\n }\n }\n if (set !== null) {\n var bValues = $c0f15dcd943db777$var$arrayFromSet(b);\n for(var _i = 0; _i < bValues.length; _i++){\n var _val = bValues[_i];\n // We have to check if a primitive value is already\n // matching and only if it's not, go hunting for it.\n if ($c0f15dcd943db777$var$_typeof(_val) === \"object\" && _val !== null) {\n if (!$c0f15dcd943db777$var$setHasEqualElement(set, _val, strict, memo)) return false;\n } else if (!strict && !a.has(_val) && !$c0f15dcd943db777$var$setHasEqualElement(set, _val, strict, memo)) return false;\n }\n return set.size === 0;\n }\n return true;\n}\nfunction $c0f15dcd943db777$var$mapHasEqualEntry(set, map, key1, item1, strict, memo) {\n // To be able to handle cases like:\n // Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']])\n // ... we need to consider *all* matching keys, not just the first we find.\n var setValues = $c0f15dcd943db777$var$arrayFromSet(set);\n for(var i = 0; i < setValues.length; i++){\n var key2 = setValues[i];\n if ($c0f15dcd943db777$var$innerDeepEqual(key1, key2, strict, memo) && $c0f15dcd943db777$var$innerDeepEqual(item1, map.get(key2), strict, memo)) {\n set.delete(key2);\n return true;\n }\n }\n return false;\n}\nfunction $c0f15dcd943db777$var$mapEquiv(a, b, strict, memo) {\n var set = null;\n var aEntries = $c0f15dcd943db777$var$arrayFromMap(a);\n for(var i = 0; i < aEntries.length; i++){\n var _aEntries$i = $c0f15dcd943db777$var$_slicedToArray(aEntries[i], 2), key = _aEntries$i[0], item1 = _aEntries$i[1];\n if ($c0f15dcd943db777$var$_typeof(key) === \"object\" && key !== null) {\n if (set === null) set = new Set();\n set.add(key);\n } else {\n // By directly retrieving the value we prevent another b.has(key) check in\n // almost all possible cases.\n var item2 = b.get(key);\n if (item2 === undefined && !b.has(key) || !$c0f15dcd943db777$var$innerDeepEqual(item1, item2, strict, memo)) {\n if (strict) return false;\n // Fast path to detect missing string, symbol, undefined and null\n // keys.\n if (!$c0f15dcd943db777$var$mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;\n if (set === null) set = new Set();\n set.add(key);\n }\n }\n }\n if (set !== null) {\n var bEntries = $c0f15dcd943db777$var$arrayFromMap(b);\n for(var _i2 = 0; _i2 < bEntries.length; _i2++){\n var _bEntries$_i = $c0f15dcd943db777$var$_slicedToArray(bEntries[_i2], 2), _key = _bEntries$_i[0], item = _bEntries$_i[1];\n if ($c0f15dcd943db777$var$_typeof(_key) === \"object\" && _key !== null) {\n if (!$c0f15dcd943db777$var$mapHasEqualEntry(set, a, _key, item, strict, memo)) return false;\n } else if (!strict && (!a.has(_key) || !$c0f15dcd943db777$var$innerDeepEqual(a.get(_key), item, false, memo)) && !$c0f15dcd943db777$var$mapHasEqualEntry(set, a, _key, item, false, memo)) return false;\n }\n return set.size === 0;\n }\n return true;\n}\nfunction $c0f15dcd943db777$var$objEquiv(a, b, strict, keys, memos, iterationType) {\n // Sets and maps don't have their entries accessible via normal object\n // properties.\n var i = 0;\n if (iterationType === $c0f15dcd943db777$var$kIsSet) {\n if (!$c0f15dcd943db777$var$setEquiv(a, b, strict, memos)) return false;\n } else if (iterationType === $c0f15dcd943db777$var$kIsMap) {\n if (!$c0f15dcd943db777$var$mapEquiv(a, b, strict, memos)) return false;\n } else if (iterationType === $c0f15dcd943db777$var$kIsArray) for(; i < a.length; i++){\n if ($c0f15dcd943db777$var$hasOwnProperty(a, i)) {\n if (!$c0f15dcd943db777$var$hasOwnProperty(b, i) || !$c0f15dcd943db777$var$innerDeepEqual(a[i], b[i], strict, memos)) return false;\n } else if ($c0f15dcd943db777$var$hasOwnProperty(b, i)) return false;\n else {\n // Array is sparse.\n var keysA = Object.keys(a);\n for(; i < keysA.length; i++){\n var key = keysA[i];\n if (!$c0f15dcd943db777$var$hasOwnProperty(b, key) || !$c0f15dcd943db777$var$innerDeepEqual(a[key], b[key], strict, memos)) return false;\n }\n if (keysA.length !== Object.keys(b).length) return false;\n return true;\n }\n }\n // The pair must have equivalent values for every corresponding key.\n // Possibly expensive deep test:\n for(i = 0; i < keys.length; i++){\n var _key2 = keys[i];\n if (!$c0f15dcd943db777$var$innerDeepEqual(a[_key2], b[_key2], strict, memos)) return false;\n }\n return true;\n}\nfunction $c0f15dcd943db777$var$isDeepEqual(val1, val2) {\n return $c0f15dcd943db777$var$innerDeepEqual(val1, val2, $c0f15dcd943db777$var$kLoose);\n}\nfunction $c0f15dcd943db777$var$isDeepStrictEqual(val1, val2) {\n return $c0f15dcd943db777$var$innerDeepEqual(val1, val2, $c0f15dcd943db777$var$kStrict);\n}\nmodule.exports = {\n isDeepEqual: $c0f15dcd943db777$var$isDeepEqual,\n isDeepStrictEqual: $c0f15dcd943db777$var$isDeepStrictEqual\n};\n\n});\nparcelRegister(\"dDNGE\", function(module, exports) {\n\"use strict\";\n\nvar $eh8QP = parcelRequire(\"eh8QP\");\n\nvar $6gXjj = parcelRequire(\"6gXjj\");\n\nvar $hcnrk = parcelRequire(\"hcnrk\");\n\nvar $2bLwM = parcelRequire(\"2bLwM\");\n\nvar $3QoWE = parcelRequire(\"3QoWE\");\nvar $9ee575a850970206$var$polyfill = $6gXjj($2bLwM(), Object);\n$eh8QP($9ee575a850970206$var$polyfill, {\n getPolyfill: $2bLwM,\n implementation: $hcnrk,\n shim: $3QoWE\n});\nmodule.exports = $9ee575a850970206$var$polyfill;\n\n});\nparcelRegister(\"eh8QP\", function(module, exports) {\n\"use strict\";\n\nvar $dOa0R = parcelRequire(\"dOa0R\");\nvar $a64984d95ac93f0f$var$hasSymbols = typeof Symbol === \"function\" && typeof Symbol(\"foo\") === \"symbol\";\nvar $a64984d95ac93f0f$var$toStr = Object.prototype.toString;\nvar $a64984d95ac93f0f$var$concat = Array.prototype.concat;\n\nvar $dEYu7 = parcelRequire(\"dEYu7\");\nvar $a64984d95ac93f0f$var$isFunction = function(fn) {\n return typeof fn === \"function\" && $a64984d95ac93f0f$var$toStr.call(fn) === \"[object Function]\";\n};\n\nvar $a64984d95ac93f0f$var$supportsDescriptors = (parcelRequire(\"gaPDk\"))();\nvar $a64984d95ac93f0f$var$defineProperty = function(object, name, value, predicate) {\n if (name in object) {\n if (predicate === true) {\n if (object[name] === value) return;\n } else if (!$a64984d95ac93f0f$var$isFunction(predicate) || !predicate()) return;\n }\n if ($a64984d95ac93f0f$var$supportsDescriptors) $dEYu7(object, name, value, true);\n else $dEYu7(object, name, value);\n};\nvar $a64984d95ac93f0f$var$defineProperties = function(object, map) {\n var predicates = arguments.length > 2 ? arguments[2] : {};\n var props = $dOa0R(map);\n if ($a64984d95ac93f0f$var$hasSymbols) props = $a64984d95ac93f0f$var$concat.call(props, Object.getOwnPropertySymbols(map));\n for(var i = 0; i < props.length; i += 1)$a64984d95ac93f0f$var$defineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n};\n$a64984d95ac93f0f$var$defineProperties.supportsDescriptors = !!$a64984d95ac93f0f$var$supportsDescriptors;\nmodule.exports = $a64984d95ac93f0f$var$defineProperties;\n\n});\n\nparcelRegister(\"3QoWE\", function(module, exports) {\n\"use strict\";\n\nvar $2bLwM = parcelRequire(\"2bLwM\");\n\nvar $eh8QP = parcelRequire(\"eh8QP\");\nmodule.exports = function shimObjectIs() {\n var polyfill = $2bLwM();\n $eh8QP(Object, {\n is: polyfill\n }, {\n is: function testObjectIs() {\n return Object.is !== polyfill;\n }\n });\n return polyfill;\n};\n\n});\n\n\nparcelRegister(\"3rh8v\", function(module, exports) {\n\"use strict\";\n\nvar $6gXjj = parcelRequire(\"6gXjj\");\n\nvar $eh8QP = parcelRequire(\"eh8QP\");\n\nvar $k6E7V = parcelRequire(\"k6E7V\");\n\nvar $8ZPJ8 = parcelRequire(\"8ZPJ8\");\n\nvar $gKbkx = parcelRequire(\"gKbkx\");\nvar $28112f95a033d6f5$var$polyfill = $6gXjj($8ZPJ8(), Number);\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ $eh8QP($28112f95a033d6f5$var$polyfill, {\n getPolyfill: $8ZPJ8,\n implementation: $k6E7V,\n shim: $gKbkx\n});\nmodule.exports = $28112f95a033d6f5$var$polyfill;\n\n});\nparcelRegister(\"k6E7V\", function(module, exports) {\n\"use strict\";\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function isNaN(value) {\n return value !== value;\n};\n\n});\n\nparcelRegister(\"8ZPJ8\", function(module, exports) {\n\"use strict\";\n\nvar $k6E7V = parcelRequire(\"k6E7V\");\nmodule.exports = function getPolyfill() {\n if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN(\"a\")) return Number.isNaN;\n return $k6E7V;\n};\n\n});\n\nparcelRegister(\"gKbkx\", function(module, exports) {\n\"use strict\";\n\nvar $eh8QP = parcelRequire(\"eh8QP\");\n\nvar $8ZPJ8 = parcelRequire(\"8ZPJ8\");\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function shimNumberIsNaN() {\n var polyfill = $8ZPJ8();\n $eh8QP(Number, {\n isNaN: polyfill\n }, {\n isNaN: function testIsNaN() {\n return Number.isNaN !== polyfill;\n }\n });\n return polyfill;\n};\n\n});\n\n\n\n\n\nvar $GE7rZ = parcelRequire(\"GE7rZ\");\n/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */ function $00f31ca755459a2b$export$1e71eb4bef00f6b0(obj, key, value) {\n if (key in obj) Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n else obj[key] = value;\n return obj;\n}\n\n\n/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */ /*!\n * @kurkle/color v0.3.2\n * https://github.com/kurkle/color#readme\n * (c) 2023 Jukka Kurkela\n * Released under the MIT License\n */ function $d892378a320191c0$export$2077e0241d6afd3c(v) {\n return v + 0.5 | 0;\n}\nconst $d892378a320191c0$export$837ba5c449269406 = (v, l, h)=>Math.max(Math.min(v, h), l);\nfunction $d892378a320191c0$export$bcc6e673dfa14d36(v) {\n return $d892378a320191c0$export$837ba5c449269406($d892378a320191c0$export$2077e0241d6afd3c(v * 2.55), 0, 255);\n}\nfunction $d892378a320191c0$export$869b26d4e1bbdb63(v) {\n return $d892378a320191c0$export$837ba5c449269406($d892378a320191c0$export$2077e0241d6afd3c(v / 2.55), 0, 100);\n}\nfunction $d892378a320191c0$export$ed9bd8dcaeba14f6(v) {\n return $d892378a320191c0$export$837ba5c449269406($d892378a320191c0$export$2077e0241d6afd3c(v * 255), 0, 255);\n}\nfunction $d892378a320191c0$export$dbf961a8d278dbef(v) {\n return $d892378a320191c0$export$837ba5c449269406($d892378a320191c0$export$2077e0241d6afd3c(v / 2.55) / 100, 0, 1);\n}\nfunction $d892378a320191c0$export$aa35ef1f24408ab9(v) {\n return $d892378a320191c0$export$837ba5c449269406($d892378a320191c0$export$2077e0241d6afd3c(v * 100), 0, 100);\n}\nconst $d892378a320191c0$var$map$1 = {\n 0: 0,\n 1: 1,\n 2: 2,\n 3: 3,\n 4: 4,\n 5: 5,\n 6: 6,\n 7: 7,\n 8: 8,\n 9: 9,\n A: 10,\n B: 11,\n C: 12,\n D: 13,\n E: 14,\n F: 15,\n a: 10,\n b: 11,\n c: 12,\n d: 13,\n e: 14,\n f: 15\n};\nconst $d892378a320191c0$var$hex = [\n ...\"0123456789ABCDEF\"\n];\nconst $d892378a320191c0$var$h1 = (b)=>$d892378a320191c0$var$hex[b & 0xF];\nconst $d892378a320191c0$var$h2 = (b)=>$d892378a320191c0$var$hex[(b & 0xF0) >> 4] + $d892378a320191c0$var$hex[b & 0xF];\nconst $d892378a320191c0$var$eq = (b)=>(b & 0xF0) >> 4 === (b & 0xF);\nconst $d892378a320191c0$var$isShort = (v)=>$d892378a320191c0$var$eq(v.r) && $d892378a320191c0$var$eq(v.g) && $d892378a320191c0$var$eq(v.b) && $d892378a320191c0$var$eq(v.a);\nfunction $d892378a320191c0$export$625a38b961e8b5e9(str) {\n var len = str.length;\n var ret;\n if (str[0] === \"#\") {\n if (len === 4 || len === 5) ret = {\n r: 255 & $d892378a320191c0$var$map$1[str[1]] * 17,\n g: 255 & $d892378a320191c0$var$map$1[str[2]] * 17,\n b: 255 & $d892378a320191c0$var$map$1[str[3]] * 17,\n a: len === 5 ? $d892378a320191c0$var$map$1[str[4]] * 17 : 255\n };\n else if (len === 7 || len === 9) ret = {\n r: $d892378a320191c0$var$map$1[str[1]] << 4 | $d892378a320191c0$var$map$1[str[2]],\n g: $d892378a320191c0$var$map$1[str[3]] << 4 | $d892378a320191c0$var$map$1[str[4]],\n b: $d892378a320191c0$var$map$1[str[5]] << 4 | $d892378a320191c0$var$map$1[str[6]],\n a: len === 9 ? $d892378a320191c0$var$map$1[str[7]] << 4 | $d892378a320191c0$var$map$1[str[8]] : 255\n };\n }\n return ret;\n}\nconst $d892378a320191c0$var$alpha = (a, f)=>a < 255 ? f(a) : \"\";\nfunction $d892378a320191c0$export$1b06654353ef9f67(v) {\n var f = $d892378a320191c0$var$isShort(v) ? $d892378a320191c0$var$h1 : $d892378a320191c0$var$h2;\n return v ? \"#\" + f(v.r) + f(v.g) + f(v.b) + $d892378a320191c0$var$alpha(v.a, f) : undefined;\n}\nconst $d892378a320191c0$var$HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction $d892378a320191c0$var$hsl2rgbn(h, s, l) {\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12)=>l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [\n f(0),\n f(8),\n f(4)\n ];\n}\nfunction $d892378a320191c0$var$hsv2rgbn(h, s, v) {\n const f = (n, k = (n + h / 60) % 6)=>v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n return [\n f(5),\n f(3),\n f(1)\n ];\n}\nfunction $d892378a320191c0$var$hwb2rgbn(h, w, b) {\n const rgb = $d892378a320191c0$var$hsl2rgbn(h, 1, 0.5);\n let i;\n if (w + b > 1) {\n i = 1 / (w + b);\n w *= i;\n b *= i;\n }\n for(i = 0; i < 3; i++){\n rgb[i] *= 1 - w - b;\n rgb[i] += w;\n }\n return rgb;\n}\nfunction $d892378a320191c0$var$hueValue(r, g, b, d, max) {\n if (r === max) return (g - b) / d + (g < b ? 6 : 0);\n if (g === max) return (b - r) / d + 2;\n return (r - g) / d + 4;\n}\nfunction $d892378a320191c0$export$b5ba70b240f8f7f(v) {\n const range = 255;\n const r = v.r / range;\n const g = v.g / range;\n const b = v.b / range;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s, d;\n if (max !== min) {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = $d892378a320191c0$var$hueValue(r, g, b, d, max);\n h = h * 60 + 0.5;\n }\n return [\n h | 0,\n s || 0,\n l\n ];\n}\nfunction $d892378a320191c0$var$calln(f, a, b, c) {\n return (Array.isArray(a) ? f(a[0], a[1], a[2]) : f(a, b, c)).map($d892378a320191c0$export$ed9bd8dcaeba14f6);\n}\nfunction $d892378a320191c0$export$4c15bd42559b811d(h, s, l) {\n return $d892378a320191c0$var$calln($d892378a320191c0$var$hsl2rgbn, h, s, l);\n}\nfunction $d892378a320191c0$export$e2710022c70fc9ee(h, w, b) {\n return $d892378a320191c0$var$calln($d892378a320191c0$var$hwb2rgbn, h, w, b);\n}\nfunction $d892378a320191c0$export$b785a357c84e4a04(h, s, v) {\n return $d892378a320191c0$var$calln($d892378a320191c0$var$hsv2rgbn, h, s, v);\n}\nfunction $d892378a320191c0$var$hue(h) {\n return (h % 360 + 360) % 360;\n}\nfunction $d892378a320191c0$export$5e91288c399be4f9(str) {\n const m = $d892378a320191c0$var$HUE_RE.exec(str);\n let a = 255;\n let v;\n if (!m) return;\n if (m[5] !== v) a = m[6] ? $d892378a320191c0$export$bcc6e673dfa14d36(+m[5]) : $d892378a320191c0$export$ed9bd8dcaeba14f6(+m[5]);\n const h = $d892378a320191c0$var$hue(+m[2]);\n const p1 = +m[3] / 100;\n const p2 = +m[4] / 100;\n if (m[1] === \"hwb\") v = $d892378a320191c0$export$e2710022c70fc9ee(h, p1, p2);\n else if (m[1] === \"hsv\") v = $d892378a320191c0$export$b785a357c84e4a04(h, p1, p2);\n else v = $d892378a320191c0$export$4c15bd42559b811d(h, p1, p2);\n return {\n r: v[0],\n g: v[1],\n b: v[2],\n a: a\n };\n}\nfunction $d892378a320191c0$export$bb628a54ab399bc9(v, deg) {\n var h = $d892378a320191c0$export$b5ba70b240f8f7f(v);\n h[0] = $d892378a320191c0$var$hue(h[0] + deg);\n h = $d892378a320191c0$export$4c15bd42559b811d(h);\n v.r = h[0];\n v.g = h[1];\n v.b = h[2];\n}\nfunction $d892378a320191c0$export$a197af1c58e6260c(v) {\n if (!v) return;\n const a = $d892378a320191c0$export$b5ba70b240f8f7f(v);\n const h = a[0];\n const s = $d892378a320191c0$export$aa35ef1f24408ab9(a[1]);\n const l = $d892378a320191c0$export$aa35ef1f24408ab9(a[2]);\n return v.a < 255 ? `hsla(${h}, ${s}%, ${l}%, ${$d892378a320191c0$export$dbf961a8d278dbef(v.a)})` : `hsl(${h}, ${s}%, ${l}%)`;\n}\nconst $d892378a320191c0$var$map = {\n x: \"dark\",\n Z: \"light\",\n Y: \"re\",\n X: \"blu\",\n W: \"gr\",\n V: \"medium\",\n U: \"slate\",\n A: \"ee\",\n T: \"ol\",\n S: \"or\",\n B: \"ra\",\n C: \"lateg\",\n D: \"ights\",\n R: \"in\",\n Q: \"turquois\",\n E: \"hi\",\n P: \"ro\",\n O: \"al\",\n N: \"le\",\n M: \"de\",\n L: \"yello\",\n F: \"en\",\n K: \"ch\",\n G: \"arks\",\n H: \"ea\",\n I: \"ightg\",\n J: \"wh\"\n};\nconst $d892378a320191c0$var$names$1 = {\n OiceXe: \"f0f8ff\",\n antiquewEte: \"faebd7\",\n aqua: \"ffff\",\n aquamarRe: \"7fffd4\",\n azuY: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"0\",\n blanKedOmond: \"ffebcd\",\n Xe: \"ff\",\n XeviTet: \"8a2be2\",\n bPwn: \"a52a2a\",\n burlywood: \"deb887\",\n caMtXe: \"5f9ea0\",\n KartYuse: \"7fff00\",\n KocTate: \"d2691e\",\n cSO: \"ff7f50\",\n cSnflowerXe: \"6495ed\",\n cSnsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"ffff\",\n xXe: \"8b\",\n xcyan: \"8b8b\",\n xgTMnPd: \"b8860b\",\n xWay: \"a9a9a9\",\n xgYF: \"6400\",\n xgYy: \"a9a9a9\",\n xkhaki: \"bdb76b\",\n xmagFta: \"8b008b\",\n xTivegYF: \"556b2f\",\n xSange: \"ff8c00\",\n xScEd: \"9932cc\",\n xYd: \"8b0000\",\n xsOmon: \"e9967a\",\n xsHgYF: \"8fbc8f\",\n xUXe: \"483d8b\",\n xUWay: \"2f4f4f\",\n xUgYy: \"2f4f4f\",\n xQe: \"ced1\",\n xviTet: \"9400d3\",\n dAppRk: \"ff1493\",\n dApskyXe: \"bfff\",\n dimWay: \"696969\",\n dimgYy: \"696969\",\n dodgerXe: \"1e90ff\",\n fiYbrick: \"b22222\",\n flSOwEte: \"fffaf0\",\n foYstWAn: \"228b22\",\n fuKsia: \"ff00ff\",\n gaRsbSo: \"dcdcdc\",\n ghostwEte: \"f8f8ff\",\n gTd: \"ffd700\",\n gTMnPd: \"daa520\",\n Way: \"808080\",\n gYF: \"8000\",\n gYFLw: \"adff2f\",\n gYy: \"808080\",\n honeyMw: \"f0fff0\",\n hotpRk: \"ff69b4\",\n RdianYd: \"cd5c5c\",\n Rdigo: \"4b0082\",\n ivSy: \"fffff0\",\n khaki: \"f0e68c\",\n lavFMr: \"e6e6fa\",\n lavFMrXsh: \"fff0f5\",\n lawngYF: \"7cfc00\",\n NmoncEffon: \"fffacd\",\n ZXe: \"add8e6\",\n ZcSO: \"f08080\",\n Zcyan: \"e0ffff\",\n ZgTMnPdLw: \"fafad2\",\n ZWay: \"d3d3d3\",\n ZgYF: \"90ee90\",\n ZgYy: \"d3d3d3\",\n ZpRk: \"ffb6c1\",\n ZsOmon: \"ffa07a\",\n ZsHgYF: \"20b2aa\",\n ZskyXe: \"87cefa\",\n ZUWay: \"778899\",\n ZUgYy: \"778899\",\n ZstAlXe: \"b0c4de\",\n ZLw: \"ffffe0\",\n lime: \"ff00\",\n limegYF: \"32cd32\",\n lRF: \"faf0e6\",\n magFta: \"ff00ff\",\n maPon: \"800000\",\n VaquamarRe: \"66cdaa\",\n VXe: \"cd\",\n VScEd: \"ba55d3\",\n VpurpN: \"9370db\",\n VsHgYF: \"3cb371\",\n VUXe: \"7b68ee\",\n VsprRggYF: \"fa9a\",\n VQe: \"48d1cc\",\n VviTetYd: \"c71585\",\n midnightXe: \"191970\",\n mRtcYam: \"f5fffa\",\n mistyPse: \"ffe4e1\",\n moccasR: \"ffe4b5\",\n navajowEte: \"ffdead\",\n navy: \"80\",\n Tdlace: \"fdf5e6\",\n Tive: \"808000\",\n TivedBb: \"6b8e23\",\n Sange: \"ffa500\",\n SangeYd: \"ff4500\",\n ScEd: \"da70d6\",\n pOegTMnPd: \"eee8aa\",\n pOegYF: \"98fb98\",\n pOeQe: \"afeeee\",\n pOeviTetYd: \"db7093\",\n papayawEp: \"ffefd5\",\n pHKpuff: \"ffdab9\",\n peru: \"cd853f\",\n pRk: \"ffc0cb\",\n plum: \"dda0dd\",\n powMrXe: \"b0e0e6\",\n purpN: \"800080\",\n YbeccapurpN: \"663399\",\n Yd: \"ff0000\",\n Psybrown: \"bc8f8f\",\n PyOXe: \"4169e1\",\n saddNbPwn: \"8b4513\",\n sOmon: \"fa8072\",\n sandybPwn: \"f4a460\",\n sHgYF: \"2e8b57\",\n sHshell: \"fff5ee\",\n siFna: \"a0522d\",\n silver: \"c0c0c0\",\n skyXe: \"87ceeb\",\n UXe: \"6a5acd\",\n UWay: \"708090\",\n UgYy: \"708090\",\n snow: \"fffafa\",\n sprRggYF: \"ff7f\",\n stAlXe: \"4682b4\",\n tan: \"d2b48c\",\n teO: \"8080\",\n tEstN: \"d8bfd8\",\n tomato: \"ff6347\",\n Qe: \"40e0d0\",\n viTet: \"ee82ee\",\n JHt: \"f5deb3\",\n wEte: \"ffffff\",\n wEtesmoke: \"f5f5f5\",\n Lw: \"ffff00\",\n LwgYF: \"9acd32\"\n};\nfunction $d892378a320191c0$var$unpack() {\n const unpacked = {};\n const keys = Object.keys($d892378a320191c0$var$names$1);\n const tkeys = Object.keys($d892378a320191c0$var$map);\n let i, j, k, ok, nk;\n for(i = 0; i < keys.length; i++){\n ok = nk = keys[i];\n for(j = 0; j < tkeys.length; j++){\n k = tkeys[j];\n nk = nk.replace(k, $d892378a320191c0$var$map[k]);\n }\n k = parseInt($d892378a320191c0$var$names$1[ok], 16);\n unpacked[nk] = [\n k >> 16 & 0xFF,\n k >> 8 & 0xFF,\n k & 0xFF\n ];\n }\n return unpacked;\n}\nlet $d892378a320191c0$var$names;\nfunction $d892378a320191c0$export$b2f06b640faad956(str) {\n if (!$d892378a320191c0$var$names) {\n $d892378a320191c0$var$names = $d892378a320191c0$var$unpack();\n $d892378a320191c0$var$names.transparent = [\n 0,\n 0,\n 0,\n 0\n ];\n }\n const a = $d892378a320191c0$var$names[str.toLowerCase()];\n return a && {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length === 4 ? a[3] : 255\n };\n}\nconst $d892378a320191c0$var$RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction $d892378a320191c0$export$91aedb20f296e541(str) {\n const m = $d892378a320191c0$var$RGB_RE.exec(str);\n let a = 255;\n let r, g, b;\n if (!m) return;\n if (m[7] !== r) {\n const v = +m[7];\n a = m[8] ? $d892378a320191c0$export$bcc6e673dfa14d36(v) : $d892378a320191c0$export$837ba5c449269406(v * 255, 0, 255);\n }\n r = +m[1];\n g = +m[3];\n b = +m[5];\n r = 255 & (m[2] ? $d892378a320191c0$export$bcc6e673dfa14d36(r) : $d892378a320191c0$export$837ba5c449269406(r, 0, 255));\n g = 255 & (m[4] ? $d892378a320191c0$export$bcc6e673dfa14d36(g) : $d892378a320191c0$export$837ba5c449269406(g, 0, 255));\n b = 255 & (m[6] ? $d892378a320191c0$export$bcc6e673dfa14d36(b) : $d892378a320191c0$export$837ba5c449269406(b, 0, 255));\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\nfunction $d892378a320191c0$export$9595423f22cf925a(v) {\n return v && (v.a < 255 ? `rgba(${v.r}, ${v.g}, ${v.b}, ${$d892378a320191c0$export$dbf961a8d278dbef(v.a)})` : `rgb(${v.r}, ${v.g}, ${v.b})`);\n}\nconst $d892378a320191c0$var$to = (v)=>v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst $d892378a320191c0$var$from = (v)=>v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction $d892378a320191c0$var$interpolate(rgb1, rgb2, t) {\n const r = $d892378a320191c0$var$from($d892378a320191c0$export$dbf961a8d278dbef(rgb1.r));\n const g = $d892378a320191c0$var$from($d892378a320191c0$export$dbf961a8d278dbef(rgb1.g));\n const b = $d892378a320191c0$var$from($d892378a320191c0$export$dbf961a8d278dbef(rgb1.b));\n return {\n r: $d892378a320191c0$export$ed9bd8dcaeba14f6($d892378a320191c0$var$to(r + t * ($d892378a320191c0$var$from($d892378a320191c0$export$dbf961a8d278dbef(rgb2.r)) - r))),\n g: $d892378a320191c0$export$ed9bd8dcaeba14f6($d892378a320191c0$var$to(g + t * ($d892378a320191c0$var$from($d892378a320191c0$export$dbf961a8d278dbef(rgb2.g)) - g))),\n b: $d892378a320191c0$export$ed9bd8dcaeba14f6($d892378a320191c0$var$to(b + t * ($d892378a320191c0$var$from($d892378a320191c0$export$dbf961a8d278dbef(rgb2.b)) - b))),\n a: rgb1.a + t * (rgb2.a - rgb1.a)\n };\n}\nfunction $d892378a320191c0$var$modHSL(v, i, ratio) {\n if (v) {\n let tmp = $d892378a320191c0$export$b5ba70b240f8f7f(v);\n tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n tmp = $d892378a320191c0$export$4c15bd42559b811d(tmp);\n v.r = tmp[0];\n v.g = tmp[1];\n v.b = tmp[2];\n }\n}\nfunction $d892378a320191c0$var$clone(v, proto) {\n return v ? Object.assign(proto || {}, v) : v;\n}\nfunction $d892378a320191c0$var$fromObject(input) {\n var v = {\n r: 0,\n g: 0,\n b: 0,\n a: 255\n };\n if (Array.isArray(input)) {\n if (input.length >= 3) {\n v = {\n r: input[0],\n g: input[1],\n b: input[2],\n a: 255\n };\n if (input.length > 3) v.a = $d892378a320191c0$export$ed9bd8dcaeba14f6(input[3]);\n }\n } else {\n v = $d892378a320191c0$var$clone(input, {\n r: 0,\n g: 0,\n b: 0,\n a: 1\n });\n v.a = $d892378a320191c0$export$ed9bd8dcaeba14f6(v.a);\n }\n return v;\n}\nfunction $d892378a320191c0$var$functionParse(str) {\n if (str.charAt(0) === \"r\") return $d892378a320191c0$export$91aedb20f296e541(str);\n return $d892378a320191c0$export$5e91288c399be4f9(str);\n}\nclass $d892378a320191c0$export$892596cec99bc70e {\n get valid() {\n return this._valid;\n }\n get rgb() {\n var v = $d892378a320191c0$var$clone(this._rgb);\n if (v) v.a = $d892378a320191c0$export$dbf961a8d278dbef(v.a);\n return v;\n }\n set rgb(obj) {\n this._rgb = $d892378a320191c0$var$fromObject(obj);\n }\n rgbString() {\n return this._valid ? $d892378a320191c0$export$9595423f22cf925a(this._rgb) : undefined;\n }\n hexString() {\n return this._valid ? $d892378a320191c0$export$1b06654353ef9f67(this._rgb) : undefined;\n }\n hslString() {\n return this._valid ? $d892378a320191c0$export$a197af1c58e6260c(this._rgb) : undefined;\n }\n mix(color, weight) {\n if (color) {\n const c1 = this.rgb;\n const c2 = color.rgb;\n let w2;\n const p = weight === w2 ? 0.5 : weight;\n const w = 2 * p - 1;\n const a = c1.a - c2.a;\n const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n w2 = 1 - w1;\n c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n c1.a = p * c1.a + (1 - p) * c2.a;\n this.rgb = c1;\n }\n return this;\n }\n interpolate(color, t) {\n if (color) this._rgb = $d892378a320191c0$var$interpolate(this._rgb, color._rgb, t);\n return this;\n }\n clone() {\n return new $d892378a320191c0$export$892596cec99bc70e(this.rgb);\n }\n alpha(a) {\n this._rgb.a = $d892378a320191c0$export$ed9bd8dcaeba14f6(a);\n return this;\n }\n clearer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 - ratio;\n return this;\n }\n greyscale() {\n const rgb = this._rgb;\n const val = $d892378a320191c0$export$2077e0241d6afd3c(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n rgb.r = rgb.g = rgb.b = val;\n return this;\n }\n opaquer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 + ratio;\n return this;\n }\n negate() {\n const v = this._rgb;\n v.r = 255 - v.r;\n v.g = 255 - v.g;\n v.b = 255 - v.b;\n return this;\n }\n lighten(ratio) {\n $d892378a320191c0$var$modHSL(this._rgb, 2, ratio);\n return this;\n }\n darken(ratio) {\n $d892378a320191c0$var$modHSL(this._rgb, 2, -ratio);\n return this;\n }\n saturate(ratio) {\n $d892378a320191c0$var$modHSL(this._rgb, 1, ratio);\n return this;\n }\n desaturate(ratio) {\n $d892378a320191c0$var$modHSL(this._rgb, 1, -ratio);\n return this;\n }\n rotate(deg) {\n $d892378a320191c0$export$bb628a54ab399bc9(this._rgb, deg);\n return this;\n }\n constructor(input){\n if (input instanceof $d892378a320191c0$export$892596cec99bc70e) return input;\n const type = typeof input;\n let v;\n if (type === \"object\") v = $d892378a320191c0$var$fromObject(input);\n else if (type === \"string\") v = $d892378a320191c0$export$625a38b961e8b5e9(input) || $d892378a320191c0$export$b2f06b640faad956(input) || $d892378a320191c0$var$functionParse(input);\n this._rgb = v;\n this._valid = !!v;\n }\n}\nfunction $d892378a320191c0$export$2e2bcd8739ae039(input) {\n return new $d892378a320191c0$export$892596cec99bc70e(input);\n}\n\n\n/**\n * @namespace Chart.helpers\n */ /**\n * An empty function that can be used, for example, for optional callback.\n */ function $c4d1694fa24f1a71$export$cf2f7c5792f80b46() {\n/* noop */ }\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */ const $c4d1694fa24f1a71$export$2219238a014317b0 = (()=>{\n let id = 0;\n return ()=>id++;\n})();\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function $c4d1694fa24f1a71$export$342063e11d6c3cad(value) {\n return value === null || typeof value === \"undefined\";\n}\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */ function $c4d1694fa24f1a71$export$8b22cf2602fb60ce(value) {\n if (Array.isArray && Array.isArray(value)) return true;\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === \"[object\" && type.slice(-6) === \"Array]\") return true;\n return false;\n}\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function $c4d1694fa24f1a71$export$23f2a1d2818174ef(value) {\n return value !== null && Object.prototype.toString.call(value) === \"[object Object]\";\n}\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */ function $c4d1694fa24f1a71$export$39b482c5e57630a8(value) {\n return (typeof value === \"number\" || value instanceof Number) && isFinite(+value);\n}\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */ function $c4d1694fa24f1a71$export$c4ce752e73470fba(value, defaultValue) {\n return $c4d1694fa24f1a71$export$39b482c5e57630a8(value) ? value : defaultValue;\n}\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */ function $c4d1694fa24f1a71$export$90a7f3efeed30595(value, defaultValue) {\n return typeof value === \"undefined\" ? defaultValue : value;\n}\nconst $c4d1694fa24f1a71$export$953cecd6e717a553 = (value, dimension)=>typeof value === \"string\" && value.endsWith(\"%\") ? parseFloat(value) / 100 : +value / dimension;\nconst $c4d1694fa24f1a71$export$7ccc53e8f1e7dfc5 = (value, dimension)=>typeof value === \"string\" && value.endsWith(\"%\") ? parseFloat(value) / 100 * dimension : +value;\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */ function $c4d1694fa24f1a71$export$3722cfe417b6ed86(fn, args, thisArg) {\n if (fn && typeof fn.call === \"function\") return fn.apply(thisArg, args);\n}\nfunction $c4d1694fa24f1a71$export$d66501df72047452(loopable, fn, thisArg, reverse) {\n let i, len, keys;\n if ($c4d1694fa24f1a71$export$8b22cf2602fb60ce(loopable)) {\n len = loopable.length;\n if (reverse) for(i = len - 1; i >= 0; i--)fn.call(thisArg, loopable[i], i);\n else for(i = 0; i < len; i++)fn.call(thisArg, loopable[i], i);\n } else if ($c4d1694fa24f1a71$export$23f2a1d2818174ef(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for(i = 0; i < len; i++)fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n}\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */ function $c4d1694fa24f1a71$export$995eb9fca571757(a0, a1) {\n let i, ilen, v0, v1;\n if (!a0 || !a1 || a0.length !== a1.length) return false;\n for(i = 0, ilen = a0.length; i < ilen; ++i){\n v0 = a0[i];\n v1 = a1[i];\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) return false;\n }\n return true;\n}\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */ function $c4d1694fa24f1a71$export$d377dcb2b61d6c4e(source) {\n if ($c4d1694fa24f1a71$export$8b22cf2602fb60ce(source)) return source.map($c4d1694fa24f1a71$export$d377dcb2b61d6c4e);\n if ($c4d1694fa24f1a71$export$23f2a1d2818174ef(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n for(; k < klen; ++k)target[keys[k]] = $c4d1694fa24f1a71$export$d377dcb2b61d6c4e(source[keys[k]]);\n return target;\n }\n return source;\n}\nfunction $c4d1694fa24f1a71$var$isValidKey(key) {\n return [\n \"__proto__\",\n \"prototype\",\n \"constructor\"\n ].indexOf(key) === -1;\n}\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */ function $c4d1694fa24f1a71$export$667d3bf0c5f83305(key, target, source, options) {\n if (!$c4d1694fa24f1a71$var$isValidKey(key)) return;\n const tval = target[key];\n const sval = source[key];\n if ($c4d1694fa24f1a71$export$23f2a1d2818174ef(tval) && $c4d1694fa24f1a71$export$23f2a1d2818174ef(sval)) // eslint-disable-next-line @typescript-eslint/no-use-before-define\n $c4d1694fa24f1a71$export$efca4cbe5dd06740(tval, sval, options);\n else target[key] = $c4d1694fa24f1a71$export$d377dcb2b61d6c4e(sval);\n}\nfunction $c4d1694fa24f1a71$export$efca4cbe5dd06740(target, source, options) {\n const sources = $c4d1694fa24f1a71$export$8b22cf2602fb60ce(source) ? source : [\n source\n ];\n const ilen = sources.length;\n if (!$c4d1694fa24f1a71$export$23f2a1d2818174ef(target)) return target;\n options = options || {};\n const merger = options.merger || $c4d1694fa24f1a71$export$667d3bf0c5f83305;\n let current;\n for(let i = 0; i < ilen; ++i){\n current = sources[i];\n if (!$c4d1694fa24f1a71$export$23f2a1d2818174ef(current)) continue;\n const keys = Object.keys(current);\n for(let k = 0, klen = keys.length; k < klen; ++k)merger(keys[k], target, current, options);\n }\n return target;\n}\nfunction $c4d1694fa24f1a71$export$555508cbc6add439(target, source) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return $c4d1694fa24f1a71$export$efca4cbe5dd06740(target, source, {\n merger: $c4d1694fa24f1a71$export$317a3d46287192d8\n });\n}\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */ function $c4d1694fa24f1a71$export$317a3d46287192d8(key, target, source) {\n if (!$c4d1694fa24f1a71$var$isValidKey(key)) return;\n const tval = target[key];\n const sval = source[key];\n if ($c4d1694fa24f1a71$export$23f2a1d2818174ef(tval) && $c4d1694fa24f1a71$export$23f2a1d2818174ef(sval)) $c4d1694fa24f1a71$export$555508cbc6add439(tval, sval);\n else if (!Object.prototype.hasOwnProperty.call(target, key)) target[key] = $c4d1694fa24f1a71$export$d377dcb2b61d6c4e(sval);\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$1ee57be6f6687d2c(scope, value, previous, current) {\n if (value !== undefined) console.warn(scope + ': \"' + previous + '\" is deprecated. Please use \"' + current + '\" instead');\n}\n// resolveObjectKey resolver cache\nconst $c4d1694fa24f1a71$var$keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n \"\": (v)=>v,\n // default resolvers\n x: (o)=>o.x,\n y: (o)=>o.y\n};\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$9d0e2d13d04f7070(key) {\n const parts = key.split(\".\");\n const keys = [];\n let tmp = \"\";\n for (const part of parts){\n tmp += part;\n if (tmp.endsWith(\"\\\\\")) tmp = tmp.slice(0, -1) + \".\";\n else {\n keys.push(tmp);\n tmp = \"\";\n }\n }\n return keys;\n}\nfunction $c4d1694fa24f1a71$var$_getKeyResolver(key) {\n const keys = $c4d1694fa24f1a71$export$9d0e2d13d04f7070(key);\n return (obj)=>{\n for (const k of keys){\n if (k === \"\") break;\n obj = obj && obj[k];\n }\n return obj;\n };\n}\nfunction $c4d1694fa24f1a71$export$2d1720544b23b823(obj, key) {\n const resolver = $c4d1694fa24f1a71$var$keyResolvers[key] || ($c4d1694fa24f1a71$var$keyResolvers[key] = $c4d1694fa24f1a71$var$_getKeyResolver(key));\n return resolver(obj);\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$a8550f7dbe79f93a(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst $c4d1694fa24f1a71$export$dda1d9f60106f0e9 = (value)=>typeof value !== \"undefined\";\nconst $c4d1694fa24f1a71$export$a93c5207d687da10 = (value)=>typeof value === \"function\";\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nconst $c4d1694fa24f1a71$export$ee7c8ad385a60b7b = (a, b)=>{\n if (a.size !== b.size) return false;\n for (const item of a){\n if (!b.has(item)) return false;\n }\n return true;\n};\n/**\n * @param e - The event\n * @private\n */ function $c4d1694fa24f1a71$export$f38c853ae54ed474(e) {\n return e.type === \"mouseup\" || e.type === \"click\" || e.type === \"contextmenu\";\n}\n/**\n * @alias Chart.helpers.math\n * @namespace\n */ const $c4d1694fa24f1a71$export$56c0d5a1e737357d = Math.PI;\nconst $c4d1694fa24f1a71$export$971d5caa766a69d7 = 2 * $c4d1694fa24f1a71$export$56c0d5a1e737357d;\nconst $c4d1694fa24f1a71$export$d29e374196577086 = $c4d1694fa24f1a71$export$971d5caa766a69d7 + $c4d1694fa24f1a71$export$56c0d5a1e737357d;\nconst $c4d1694fa24f1a71$export$2ec5befb9e6c97d4 = Number.POSITIVE_INFINITY;\nconst $c4d1694fa24f1a71$export$53c86fa97d611818 = $c4d1694fa24f1a71$export$56c0d5a1e737357d / 180;\nconst $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd = $c4d1694fa24f1a71$export$56c0d5a1e737357d / 2;\nconst $c4d1694fa24f1a71$export$39c1cc7c062529d4 = $c4d1694fa24f1a71$export$56c0d5a1e737357d / 4;\nconst $c4d1694fa24f1a71$export$7a0bdf7d4a91ea88 = $c4d1694fa24f1a71$export$56c0d5a1e737357d * 2 / 3;\nconst $c4d1694fa24f1a71$export$9f4f30ee63539e24 = Math.log10;\nconst $c4d1694fa24f1a71$export$2408f22a0fab9ae5 = Math.sign;\nfunction $c4d1694fa24f1a71$export$a05254e7c3aeba6e(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n}\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */ function $c4d1694fa24f1a71$export$a33b77bbdbb8366c(range) {\n const roundedRange = Math.round(range);\n range = $c4d1694fa24f1a71$export$a05254e7c3aeba6e(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor($c4d1694fa24f1a71$export$9f4f30ee63539e24(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */ function $c4d1694fa24f1a71$export$a07804094c3ecf2d(value) {\n const result = [];\n const sqrt = Math.sqrt(value);\n let i;\n for(i = 1; i < sqrt; i++)if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n if (sqrt === (sqrt | 0)) result.push(sqrt);\n result.sort((a, b)=>a - b).pop();\n return result;\n}\nfunction $c4d1694fa24f1a71$export$d141bba7fdc215a3(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction $c4d1694fa24f1a71$export$b9a6b53f9be3734(x, epsilon) {\n const rounded = Math.round(x);\n return rounded - epsilon <= x && rounded + epsilon >= x;\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$53a70dd1ebbae346(array, target, property) {\n let i, ilen, value;\n for(i = 0, ilen = array.length; i < ilen; i++){\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\nfunction $c4d1694fa24f1a71$export$625550452a3fa3ec(degrees) {\n return degrees * ($c4d1694fa24f1a71$export$56c0d5a1e737357d / 180);\n}\nfunction $c4d1694fa24f1a71$export$3a6d5c9ae78a2c08(radians) {\n return radians * (180 / $c4d1694fa24f1a71$export$56c0d5a1e737357d);\n}\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */ function $c4d1694fa24f1a71$export$23ebac1979863676(x) {\n if (!$c4d1694fa24f1a71$export$39b482c5e57630a8(x)) return;\n let e = 1;\n let p = 0;\n while(Math.round(x * e) / e !== x){\n e *= 10;\n p++;\n }\n return p;\n}\n// Gets the angle from vertical upright to the point about a centre.\nfunction $c4d1694fa24f1a71$export$96f57966bedc81b4(centrePoint, anglePoint) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n if (angle < -0.5 * $c4d1694fa24f1a71$export$56c0d5a1e737357d) angle += $c4d1694fa24f1a71$export$971d5caa766a69d7; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n return {\n angle: angle,\n distance: radialDistanceFromCenter\n };\n}\nfunction $c4d1694fa24f1a71$export$158acd800e1ef08b(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */ function $c4d1694fa24f1a71$export$c18d01048907ea92(a, b) {\n return (a - b + $c4d1694fa24f1a71$export$d29e374196577086) % $c4d1694fa24f1a71$export$971d5caa766a69d7 - $c4d1694fa24f1a71$export$56c0d5a1e737357d;\n}\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */ function $c4d1694fa24f1a71$export$28f7fcd39efa255(a) {\n return (a % $c4d1694fa24f1a71$export$971d5caa766a69d7 + $c4d1694fa24f1a71$export$971d5caa766a69d7) % $c4d1694fa24f1a71$export$971d5caa766a69d7;\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$ffb5f4729a158638(angle, start, end, sameAngleIsFullCircle) {\n const a = $c4d1694fa24f1a71$export$28f7fcd39efa255(angle);\n const s = $c4d1694fa24f1a71$export$28f7fcd39efa255(start);\n const e = $c4d1694fa24f1a71$export$28f7fcd39efa255(end);\n const angleToStart = $c4d1694fa24f1a71$export$28f7fcd39efa255(s - a);\n const angleToEnd = $c4d1694fa24f1a71$export$28f7fcd39efa255(e - a);\n const startToAngle = $c4d1694fa24f1a71$export$28f7fcd39efa255(a - s);\n const endToAngle = $c4d1694fa24f1a71$export$28f7fcd39efa255(a - e);\n return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle;\n}\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */ function $c4d1694fa24f1a71$export$25ce5a424b770e84(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n/**\n * @param {number} value\n * @private\n */ function $c4d1694fa24f1a71$export$71cec2538cb2c617(value) {\n return $c4d1694fa24f1a71$export$25ce5a424b770e84(value, -32768, 32767);\n}\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */ function $c4d1694fa24f1a71$export$3b513254972cfc9c(value, start, end, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\nfunction $c4d1694fa24f1a71$export$2ed0fc6709e59212(table, value, cmp) {\n cmp = cmp || ((index)=>table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid;\n while(hi - lo > 1){\n mid = lo + hi >> 1;\n if (cmp(mid)) lo = mid;\n else hi = mid;\n }\n return {\n lo: lo,\n hi: hi\n };\n}\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */ const $c4d1694fa24f1a71$export$ef35774e6d314e91 = (table, key, value, last)=>$c4d1694fa24f1a71$export$2ed0fc6709e59212(table, value, last ? (index)=>{\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n } : (index)=>table[index][key] < value);\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */ const $c4d1694fa24f1a71$export$ebd11618f299a286 = (table, key, value)=>$c4d1694fa24f1a71$export$2ed0fc6709e59212(table, value, (index)=>table[index][key] >= value);\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */ function $c4d1694fa24f1a71$export$c03999cb2f36933f(values, min, max) {\n let start = 0;\n let end = values.length;\n while(start < end && values[start] < min)start++;\n while(end > start && values[end - 1] > max)end--;\n return start > 0 || end < values.length ? values.slice(start, end) : values;\n}\nconst $c4d1694fa24f1a71$var$arrayEvents = [\n \"push\",\n \"pop\",\n \"shift\",\n \"splice\",\n \"unshift\"\n];\nfunction $c4d1694fa24f1a71$export$882b5998b3b9117c(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n Object.defineProperty(array, \"_chartjs\", {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [\n listener\n ]\n }\n });\n $c4d1694fa24f1a71$var$arrayEvents.forEach((key)=>{\n const method = \"_onData\" + $c4d1694fa24f1a71$export$a8550f7dbe79f93a(key);\n const base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value (...args) {\n const res = base.apply(this, args);\n array._chartjs.listeners.forEach((object)=>{\n if (typeof object[method] === \"function\") object[method](...args);\n });\n return res;\n }\n });\n });\n}\nfunction $c4d1694fa24f1a71$export$3b14a55fb2447963(array, listener) {\n const stub = array._chartjs;\n if (!stub) return;\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) listeners.splice(index, 1);\n if (listeners.length > 0) return;\n $c4d1694fa24f1a71$var$arrayEvents.forEach((key)=>{\n delete array[key];\n });\n delete array._chartjs;\n}\n/**\n * @param items\n */ function $c4d1694fa24f1a71$export$71511d61b312f219(items) {\n const set = new Set(items);\n if (set.size === items.length) return items;\n return Array.from(set);\n}\nfunction $c4d1694fa24f1a71$export$fef3dfd9bad05307(pixelSize, fontStyle, fontFamily) {\n return fontStyle + \" \" + pixelSize + \"px \" + fontFamily;\n}\n/**\n* Request animation polyfill\n*/ const $c4d1694fa24f1a71$export$43caf9889c228507 = function() {\n if (typeof window === \"undefined\") return function(callback) {\n return callback();\n };\n return window.requestAnimationFrame;\n}();\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */ function $c4d1694fa24f1a71$export$61196ced6d74a310(fn, thisArg) {\n let argsToUse = [];\n let ticking = false;\n return function(...args) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n $c4d1694fa24f1a71$export$43caf9889c228507.call(window, ()=>{\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n/**\n * Debounces calling `fn` for `delay` ms\n */ function $c4d1694fa24f1a71$export$4c3d22f3d993c33f(fn, delay) {\n let timeout;\n return function(...args) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else fn.apply(this, args);\n return delay;\n };\n}\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */ const $c4d1694fa24f1a71$export$3c2fa207a37baaea = (align)=>align === \"start\" ? \"left\" : align === \"end\" ? \"right\" : \"center\";\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */ const $c4d1694fa24f1a71$export$ce26c07117d59d6a = (align, start, end)=>align === \"start\" ? start : align === \"end\" ? end : (start + end) / 2;\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */ const $c4d1694fa24f1a71$export$9d398bebfec1c039 = (align, left, right, rtl)=>{\n const check = rtl ? \"left\" : \"right\";\n return align === check ? right : align === \"center\" ? (left + right) / 2 : left;\n};\n/**\n * Return start and count of visible points.\n * @private\n */ function $c4d1694fa24f1a71$export$9e5f44173e64f162(meta, points, animationsDisabled) {\n const pointCount = points.length;\n let start = 0;\n let count = pointCount;\n if (meta._sorted) {\n const { iScale: iScale, _parsed: _parsed } = meta;\n const axis = iScale.axis;\n const { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = iScale.getUserBounds();\n if (minDefined) start = $c4d1694fa24f1a71$export$25ce5a424b770e84(Math.min($c4d1694fa24f1a71$export$ef35774e6d314e91(_parsed, axis, min).lo, animationsDisabled ? pointCount : $c4d1694fa24f1a71$export$ef35774e6d314e91(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1);\n if (maxDefined) count = $c4d1694fa24f1a71$export$25ce5a424b770e84(Math.max($c4d1694fa24f1a71$export$ef35774e6d314e91(_parsed, iScale.axis, max, true).hi + 1, animationsDisabled ? 0 : $c4d1694fa24f1a71$export$ef35774e6d314e91(points, axis, iScale.getPixelForValue(max), true).hi + 1), start, pointCount) - start;\n else count = pointCount - start;\n }\n return {\n start: start,\n count: count\n };\n}\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */ function $c4d1694fa24f1a71$export$efccba1c4a2ef57b(meta) {\n const { xScale: xScale, yScale: yScale, _scaleRanges: _scaleRanges } = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\nconst $c4d1694fa24f1a71$var$atEdge = (t)=>t === 0 || t === 1;\nconst $c4d1694fa24f1a71$var$elasticIn = (t, s, p)=>-(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * $c4d1694fa24f1a71$export$971d5caa766a69d7 / p));\nconst $c4d1694fa24f1a71$var$elasticOut = (t, s, p)=>Math.pow(2, -10 * t) * Math.sin((t - s) * $c4d1694fa24f1a71$export$971d5caa766a69d7 / p) + 1;\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */ const $c4d1694fa24f1a71$export$f1e1789686576879 = {\n linear: (t)=>t,\n easeInQuad: (t)=>t * t,\n easeOutQuad: (t)=>-t * (t - 2),\n easeInOutQuad: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1),\n easeInCubic: (t)=>t * t * t,\n easeOutCubic: (t)=>(t -= 1) * t * t + 1,\n easeInOutCubic: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2),\n easeInQuart: (t)=>t * t * t * t,\n easeOutQuart: (t)=>-((t -= 1) * t * t * t - 1),\n easeInOutQuart: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2),\n easeInQuint: (t)=>t * t * t * t * t,\n easeOutQuint: (t)=>(t -= 1) * t * t * t * t + 1,\n easeInOutQuint: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2),\n easeInSine: (t)=>-Math.cos(t * $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd) + 1,\n easeOutSine: (t)=>Math.sin(t * $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd),\n easeInOutSine: (t)=>-0.5 * (Math.cos($c4d1694fa24f1a71$export$56c0d5a1e737357d * t) - 1),\n easeInExpo: (t)=>t === 0 ? 0 : Math.pow(2, 10 * (t - 1)),\n easeOutExpo: (t)=>t === 1 ? 1 : -Math.pow(2, -10 * t) + 1,\n easeInOutExpo: (t)=>$c4d1694fa24f1a71$var$atEdge(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n easeInCirc: (t)=>t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1),\n easeOutCirc: (t)=>Math.sqrt(1 - (t -= 1) * t),\n easeInOutCirc: (t)=>(t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n easeInElastic: (t)=>$c4d1694fa24f1a71$var$atEdge(t) ? t : $c4d1694fa24f1a71$var$elasticIn(t, 0.075, 0.3),\n easeOutElastic: (t)=>$c4d1694fa24f1a71$var$atEdge(t) ? t : $c4d1694fa24f1a71$var$elasticOut(t, 0.075, 0.3),\n easeInOutElastic (t) {\n const s = 0.1125;\n const p = 0.45;\n return $c4d1694fa24f1a71$var$atEdge(t) ? t : t < 0.5 ? 0.5 * $c4d1694fa24f1a71$var$elasticIn(t * 2, s, p) : 0.5 + 0.5 * $c4d1694fa24f1a71$var$elasticOut(t * 2 - 1, s, p);\n },\n easeInBack (t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n easeOutBack (t) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n easeInOutBack (t) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s));\n return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);\n },\n easeInBounce: (t)=>1 - $c4d1694fa24f1a71$export$f1e1789686576879.easeOutBounce(1 - t),\n easeOutBounce (t) {\n const m = 7.5625;\n const d = 2.75;\n if (t < 1 / d) return m * t * t;\n if (t < 2 / d) return m * (t -= 1.5 / d) * t + 0.75;\n if (t < 2.5 / d) return m * (t -= 2.25 / d) * t + 0.9375;\n return m * (t -= 2.625 / d) * t + 0.984375;\n },\n easeInOutBounce: (t)=>t < 0.5 ? $c4d1694fa24f1a71$export$f1e1789686576879.easeInBounce(t * 2) * 0.5 : $c4d1694fa24f1a71$export$f1e1789686576879.easeOutBounce(t * 2 - 1) * 0.5 + 0.5\n};\nfunction $c4d1694fa24f1a71$export$f96d196f7728bb5(value) {\n if (value && typeof value === \"object\") {\n const type = value.toString();\n return type === \"[object CanvasPattern]\" || type === \"[object CanvasGradient]\";\n }\n return false;\n}\nfunction $c4d1694fa24f1a71$export$db3b6bfb95261072(value) {\n return $c4d1694fa24f1a71$export$f96d196f7728bb5(value) ? value : new (0, $d892378a320191c0$export$892596cec99bc70e)(value);\n}\nfunction $c4d1694fa24f1a71$export$738ab4df8bf92ae9(value) {\n return $c4d1694fa24f1a71$export$f96d196f7728bb5(value) ? value : new (0, $d892378a320191c0$export$892596cec99bc70e)(value).saturate(0.5).darken(0.1).hexString();\n}\nconst $c4d1694fa24f1a71$var$numbers = [\n \"x\",\n \"y\",\n \"borderWidth\",\n \"radius\",\n \"tension\"\n];\nconst $c4d1694fa24f1a71$var$colors = [\n \"color\",\n \"borderColor\",\n \"backgroundColor\"\n];\nfunction $c4d1694fa24f1a71$var$applyAnimationsDefaults(defaults) {\n defaults.set(\"animation\", {\n delay: undefined,\n duration: 1000,\n easing: \"easeOutQuart\",\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined\n });\n defaults.describe(\"animation\", {\n _fallback: false,\n _indexable: false,\n _scriptable: (name)=>name !== \"onProgress\" && name !== \"onComplete\" && name !== \"fn\"\n });\n defaults.set(\"animations\", {\n colors: {\n type: \"color\",\n properties: $c4d1694fa24f1a71$var$colors\n },\n numbers: {\n type: \"number\",\n properties: $c4d1694fa24f1a71$var$numbers\n }\n });\n defaults.describe(\"animations\", {\n _fallback: \"animation\"\n });\n defaults.set(\"transitions\", {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: \"transparent\"\n },\n visible: {\n type: \"boolean\",\n duration: 0\n }\n }\n },\n hide: {\n animations: {\n colors: {\n to: \"transparent\"\n },\n visible: {\n type: \"boolean\",\n easing: \"linear\",\n fn: (v)=>v | 0\n }\n }\n }\n });\n}\nfunction $c4d1694fa24f1a71$var$applyLayoutsDefaults(defaults) {\n defaults.set(\"layout\", {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\nconst $c4d1694fa24f1a71$var$intlCache = new Map();\nfunction $c4d1694fa24f1a71$var$getNumberFormat(locale, options) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = $c4d1694fa24f1a71$var$intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n $c4d1694fa24f1a71$var$intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\nfunction $c4d1694fa24f1a71$export$ae1af26003f05816(num, locale, options) {\n return $c4d1694fa24f1a71$var$getNumberFormat(locale, options).format(num);\n}\nconst $c4d1694fa24f1a71$var$formatters = {\n values (value) {\n return $c4d1694fa24f1a71$export$8b22cf2602fb60ce(value) ? value : \"\" + value;\n },\n numeric (tickValue, index, ticks) {\n if (tickValue === 0) return \"0\";\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue;\n if (ticks.length > 1) {\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) notation = \"scientific\";\n delta = $c4d1694fa24f1a71$var$calculateDelta(tickValue, ticks);\n }\n const logDelta = $c4d1694fa24f1a71$export$9f4f30ee63539e24(Math.abs(delta));\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n const options = {\n notation: notation,\n minimumFractionDigits: numDecimal,\n maximumFractionDigits: numDecimal\n };\n Object.assign(options, this.options.ticks.format);\n return $c4d1694fa24f1a71$export$ae1af26003f05816(tickValue, locale, options);\n },\n logarithmic (tickValue, index, ticks) {\n if (tickValue === 0) return \"0\";\n const remain = ticks[index].significand || tickValue / Math.pow(10, Math.floor($c4d1694fa24f1a71$export$9f4f30ee63539e24(tickValue)));\n if ([\n 1,\n 2,\n 3,\n 5,\n 10,\n 15\n ].includes(remain) || index > 0.8 * ticks.length) return $c4d1694fa24f1a71$var$formatters.numeric.call(this, tickValue, index, ticks);\n return \"\";\n }\n};\nfunction $c4d1694fa24f1a71$var$calculateDelta(tickValue, ticks) {\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) delta = tickValue - Math.floor(tickValue);\n return delta;\n}\nvar $c4d1694fa24f1a71$export$91477dc880baac21 = {\n formatters: $c4d1694fa24f1a71$var$formatters\n};\nfunction $c4d1694fa24f1a71$var$applyScaleDefaults(defaults) {\n defaults.set(\"scale\", {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n bounds: \"ticks\",\n clip: true,\n grace: 0,\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options)=>options.lineWidth,\n tickColor: (_ctx, options)=>options.color,\n offset: false\n },\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n title: {\n display: false,\n text: \"\",\n padding: {\n top: 4,\n bottom: 4\n }\n },\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: \"\",\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n callback: $c4d1694fa24f1a71$export$91477dc880baac21.formatters.values,\n minor: {},\n major: {},\n align: \"center\",\n crossAlign: \"near\",\n showLabelBackdrop: false,\n backdropColor: \"rgba(255, 255, 255, 0.75)\",\n backdropPadding: 2\n }\n });\n defaults.route(\"scale.ticks\", \"color\", \"\", \"color\");\n defaults.route(\"scale.grid\", \"color\", \"\", \"borderColor\");\n defaults.route(\"scale.border\", \"color\", \"\", \"borderColor\");\n defaults.route(\"scale.title\", \"color\", \"\", \"color\");\n defaults.describe(\"scale\", {\n _fallback: false,\n _scriptable: (name)=>!name.startsWith(\"before\") && !name.startsWith(\"after\") && name !== \"callback\" && name !== \"parser\",\n _indexable: (name)=>name !== \"borderDash\" && name !== \"tickBorderDash\" && name !== \"dash\"\n });\n defaults.describe(\"scales\", {\n _fallback: \"scale\"\n });\n defaults.describe(\"scale.ticks\", {\n _scriptable: (name)=>name !== \"backdropPadding\" && name !== \"callback\",\n _indexable: (name)=>name !== \"backdropPadding\"\n });\n}\nconst $c4d1694fa24f1a71$export$6559d589eb85fbb6 = Object.create(null);\nconst $c4d1694fa24f1a71$export$2e2af4578d910ddf = Object.create(null);\nfunction $c4d1694fa24f1a71$var$getScope$1(node, key) {\n if (!key) return node;\n const keys = key.split(\".\");\n for(let i = 0, n = keys.length; i < n; ++i){\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\nfunction $c4d1694fa24f1a71$var$set(root, scope, values) {\n if (typeof scope === \"string\") return $c4d1694fa24f1a71$export$efca4cbe5dd06740($c4d1694fa24f1a71$var$getScope$1(root, scope), values);\n return $c4d1694fa24f1a71$export$efca4cbe5dd06740($c4d1694fa24f1a71$var$getScope$1(root, \"\"), scope);\n}\nclass $c4d1694fa24f1a71$var$Defaults {\n set(scope, values) {\n return $c4d1694fa24f1a71$var$set(this, scope, values);\n }\n get(scope) {\n return $c4d1694fa24f1a71$var$getScope$1(this, scope);\n }\n describe(scope, values) {\n return $c4d1694fa24f1a71$var$set($c4d1694fa24f1a71$export$2e2af4578d910ddf, scope, values);\n }\n override(scope, values) {\n return $c4d1694fa24f1a71$var$set($c4d1694fa24f1a71$export$6559d589eb85fbb6, scope, values);\n }\n route(scope, name, targetScope, targetName) {\n const scopeObject = $c4d1694fa24f1a71$var$getScope$1(this, scope);\n const targetScopeObject = $c4d1694fa24f1a71$var$getScope$1(this, targetScope);\n const privateName = \"_\" + name;\n Object.defineProperties(scopeObject, {\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n [name]: {\n enumerable: true,\n get () {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if ($c4d1694fa24f1a71$export$23f2a1d2818174ef(local)) return Object.assign({}, target, local);\n return $c4d1694fa24f1a71$export$90a7f3efeed30595(local, target);\n },\n set (value) {\n this[privateName] = value;\n }\n }\n });\n }\n apply(appliers) {\n appliers.forEach((apply)=>apply(this));\n }\n constructor(_descriptors, _appliers){\n this.animation = undefined;\n this.backgroundColor = \"rgba(0,0,0,0.1)\";\n this.borderColor = \"rgba(0,0,0,0.1)\";\n this.color = \"#666\";\n this.datasets = {};\n this.devicePixelRatio = (context)=>context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n \"mousemove\",\n \"mouseout\",\n \"click\",\n \"touchstart\",\n \"touchmove\"\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: \"normal\",\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options)=>$c4d1694fa24f1a71$export$738ab4df8bf92ae9(options.backgroundColor);\n this.hoverBorderColor = (ctx, options)=>$c4d1694fa24f1a71$export$738ab4df8bf92ae9(options.borderColor);\n this.hoverColor = (ctx, options)=>$c4d1694fa24f1a71$export$738ab4df8bf92ae9(options.color);\n this.indexAxis = \"x\";\n this.interaction = {\n mode: \"nearest\",\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n}\nvar $c4d1694fa24f1a71$export$4368d992c4eafac0 = /* #__PURE__ */ new $c4d1694fa24f1a71$var$Defaults({\n _scriptable: (name)=>!name.startsWith(\"on\"),\n _indexable: (name)=>name !== \"events\",\n hover: {\n _fallback: \"interaction\"\n },\n interaction: {\n _scriptable: false,\n _indexable: false\n }\n}, [\n $c4d1694fa24f1a71$var$applyAnimationsDefaults,\n $c4d1694fa24f1a71$var$applyLayoutsDefaults,\n $c4d1694fa24f1a71$var$applyScaleDefaults\n]);\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */ function $c4d1694fa24f1a71$export$1a8f5705751d8277(font) {\n if (!font || $c4d1694fa24f1a71$export$342063e11d6c3cad(font.size) || $c4d1694fa24f1a71$export$342063e11d6c3cad(font.family)) return null;\n return (font.style ? font.style + \" \" : \"\") + (font.weight ? font.weight + \" \" : \"\") + font.size + \"px \" + font.family;\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$e7c866399fa523f5(ctx, data, gc, longest, string) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) longest = textWidth;\n return longest;\n}\n/**\n * @private\n */ // eslint-disable-next-line complexity\nfunction $c4d1694fa24f1a71$export$faec65b429be379(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n ctx.save();\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i, j, jlen, thing, nestedThing;\n for(i = 0; i < ilen; i++){\n thing = arrayOfThings[i];\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !$c4d1694fa24f1a71$export$8b22cf2602fb60ce(thing)) longest = $c4d1694fa24f1a71$export$e7c866399fa523f5(ctx, data, gc, longest, thing);\n else if ($c4d1694fa24f1a71$export$8b22cf2602fb60ce(thing)) // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for(j = 0, jlen = thing.length; j < jlen; j++){\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !$c4d1694fa24f1a71$export$8b22cf2602fb60ce(nestedThing)) longest = $c4d1694fa24f1a71$export$e7c866399fa523f5(ctx, data, gc, longest, nestedThing);\n }\n }\n ctx.restore();\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for(i = 0; i < gcLen; i++)delete data[gc[i]];\n gc.splice(0, gcLen);\n }\n return longest;\n}\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */ function $c4d1694fa24f1a71$export$78acf4525d8a74c4(chart, pixel, width) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n/**\n * Clears the entire canvas.\n */ function $c4d1694fa24f1a71$export$c9170ad7d4cd7e57(canvas, ctx) {\n ctx = ctx || canvas.getContext(\"2d\");\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\nfunction $c4d1694fa24f1a71$export$493d36ec626b6698(ctx, options, x, y) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n $c4d1694fa24f1a71$export$24baa2b76016ce0e(ctx, options, x, y, null);\n}\n// eslint-disable-next-line complexity\nfunction $c4d1694fa24f1a71$export$24baa2b76016ce0e(ctx, options, x, y, w) {\n let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * $c4d1694fa24f1a71$export$53c86fa97d611818;\n if (style && typeof style === \"object\") {\n type = style.toString();\n if (type === \"[object HTMLImageElement]\" || type === \"[object HTMLCanvasElement]\") {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n if (isNaN(radius) || radius <= 0) return;\n ctx.beginPath();\n switch(style){\n // Default includes circle\n default:\n if (w) ctx.ellipse(x, y, w / 2, radius, 0, 0, $c4d1694fa24f1a71$export$971d5caa766a69d7);\n else ctx.arc(x, y, radius, 0, $c4d1694fa24f1a71$export$971d5caa766a69d7);\n ctx.closePath();\n break;\n case \"triangle\":\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += $c4d1694fa24f1a71$export$7a0bdf7d4a91ea88;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += $c4d1694fa24f1a71$export$7a0bdf7d4a91ea88;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case \"rectRounded\":\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + $c4d1694fa24f1a71$export$39c1cc7c062529d4) * size;\n xOffsetW = Math.cos(rad + $c4d1694fa24f1a71$export$39c1cc7c062529d4) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + $c4d1694fa24f1a71$export$39c1cc7c062529d4) * size;\n yOffsetW = Math.sin(rad + $c4d1694fa24f1a71$export$39c1cc7c062529d4) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - $c4d1694fa24f1a71$export$56c0d5a1e737357d, rad - $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd, rad + $c4d1694fa24f1a71$export$56c0d5a1e737357d);\n ctx.closePath();\n break;\n case \"rect\":\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += $c4d1694fa24f1a71$export$39c1cc7c062529d4;\n /* falls through */ case \"rectRot\":\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case \"crossRot\":\n rad += $c4d1694fa24f1a71$export$39c1cc7c062529d4;\n /* falls through */ case \"cross\":\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case \"star\":\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += $c4d1694fa24f1a71$export$39c1cc7c062529d4;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case \"line\":\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case \"dash\":\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n ctx.fill();\n if (options.borderWidth > 0) ctx.stroke();\n}\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */ function $c4d1694fa24f1a71$export$e7094788287c5e9b(point, area, margin) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;\n}\nfunction $c4d1694fa24f1a71$export$8743009a87fcb00f(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\nfunction $c4d1694fa24f1a71$export$3d8c2f653ac9d0b9(ctx) {\n ctx.restore();\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$d24c54395ce0c509(ctx, previous, target, flip, mode) {\n if (!previous) return ctx.lineTo(target.x, target.y);\n if (mode === \"middle\") {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === \"after\" !== !!flip) ctx.lineTo(previous.x, target.y);\n else ctx.lineTo(target.x, previous.y);\n ctx.lineTo(target.x, target.y);\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$6554612db691658e(ctx, previous, target, flip) {\n if (!previous) return ctx.lineTo(target.x, target.y);\n ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y);\n}\nfunction $c4d1694fa24f1a71$var$setRenderOpts(ctx, opts) {\n if (opts.translation) ctx.translate(opts.translation[0], opts.translation[1]);\n if (!$c4d1694fa24f1a71$export$342063e11d6c3cad(opts.rotation)) ctx.rotate(opts.rotation);\n if (opts.color) ctx.fillStyle = opts.color;\n if (opts.textAlign) ctx.textAlign = opts.textAlign;\n if (opts.textBaseline) ctx.textBaseline = opts.textBaseline;\n}\nfunction $c4d1694fa24f1a71$var$decorateText(ctx, x, y, line, opts) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */ const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\nfunction $c4d1694fa24f1a71$var$drawBackdrop(ctx, opts) {\n const oldColor = ctx.fillStyle;\n ctx.fillStyle = opts.color;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n/**\n * Render text onto the canvas\n */ function $c4d1694fa24f1a71$export$dc98b0b04f4c7758(ctx, text, x, y, font, opts = {}) {\n const lines = $c4d1694fa24f1a71$export$8b22cf2602fb60ce(text) ? text : [\n text\n ];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== \"\";\n let i, line;\n ctx.save();\n ctx.font = font.string;\n $c4d1694fa24f1a71$var$setRenderOpts(ctx, opts);\n for(i = 0; i < lines.length; ++i){\n line = lines[i];\n if (opts.backdrop) $c4d1694fa24f1a71$var$drawBackdrop(ctx, opts.backdrop);\n if (stroke) {\n if (opts.strokeColor) ctx.strokeStyle = opts.strokeColor;\n if (!$c4d1694fa24f1a71$export$342063e11d6c3cad(opts.strokeWidth)) ctx.lineWidth = opts.strokeWidth;\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n ctx.fillText(line, x, y, opts.maxWidth);\n $c4d1694fa24f1a71$var$decorateText(ctx, x, y, line, opts);\n y += Number(font.lineHeight);\n }\n ctx.restore();\n}\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */ function $c4d1694fa24f1a71$export$1fbe638ecf81657e(ctx, rect) {\n const { x: x, y: y, w: w, h: h, radius: radius } = rect;\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * $c4d1694fa24f1a71$export$56c0d5a1e737357d, $c4d1694fa24f1a71$export$56c0d5a1e737357d, true);\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, $c4d1694fa24f1a71$export$56c0d5a1e737357d, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd, true);\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd, 0, true);\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -$c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd, true);\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\nconst $c4d1694fa24f1a71$var$LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst $c4d1694fa24f1a71$var$FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n/**\n * @alias Chart.helpers.options\n * @namespace\n */ /**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */ function $c4d1694fa24f1a71$export$8c78c7c36408ea29(value, size) {\n const matches = (\"\" + value).match($c4d1694fa24f1a71$var$LINE_HEIGHT);\n if (!matches || matches[1] === \"normal\") return size * 1.2;\n value = +matches[2];\n switch(matches[3]){\n case \"px\":\n return value;\n case \"%\":\n value /= 100;\n break;\n }\n return size * value;\n}\nconst $c4d1694fa24f1a71$var$numberOrZero = (v)=>+v || 0;\nfunction $c4d1694fa24f1a71$export$21579262ef46735b(value, props) {\n const ret = {};\n const objProps = $c4d1694fa24f1a71$export$23f2a1d2818174ef(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = $c4d1694fa24f1a71$export$23f2a1d2818174ef(value) ? objProps ? (prop)=>$c4d1694fa24f1a71$export$90a7f3efeed30595(value[prop], value[props[prop]]) : (prop)=>value[prop] : ()=>value;\n for (const prop of keys)ret[prop] = $c4d1694fa24f1a71$var$numberOrZero(read(prop));\n return ret;\n}\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */ function $c4d1694fa24f1a71$export$d66dc83d8cfc8dd(value) {\n return $c4d1694fa24f1a71$export$21579262ef46735b(value, {\n top: \"y\",\n right: \"x\",\n bottom: \"y\",\n left: \"x\"\n });\n}\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */ function $c4d1694fa24f1a71$export$92108d983e8ee699(value) {\n return $c4d1694fa24f1a71$export$21579262ef46735b(value, [\n \"topLeft\",\n \"topRight\",\n \"bottomLeft\",\n \"bottomRight\"\n ]);\n}\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */ function $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca(value) {\n const obj = $c4d1694fa24f1a71$export$d66dc83d8cfc8dd(value);\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n return obj;\n}\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */ function $c4d1694fa24f1a71$export$34aec0b863436764(options, fallback) {\n options = options || {};\n fallback = fallback || $c4d1694fa24f1a71$export$4368d992c4eafac0.font;\n let size = $c4d1694fa24f1a71$export$90a7f3efeed30595(options.size, fallback.size);\n if (typeof size === \"string\") size = parseInt(size, 10);\n let style = $c4d1694fa24f1a71$export$90a7f3efeed30595(options.style, fallback.style);\n if (style && !(\"\" + style).match($c4d1694fa24f1a71$var$FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n const font = {\n family: $c4d1694fa24f1a71$export$90a7f3efeed30595(options.family, fallback.family),\n lineHeight: $c4d1694fa24f1a71$export$8c78c7c36408ea29($c4d1694fa24f1a71$export$90a7f3efeed30595(options.lineHeight, fallback.lineHeight), size),\n size: size,\n style: style,\n weight: $c4d1694fa24f1a71$export$90a7f3efeed30595(options.weight, fallback.weight),\n string: \"\"\n };\n font.string = $c4d1694fa24f1a71$export$1a8f5705751d8277(font);\n return font;\n}\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */ function $c4d1694fa24f1a71$export$407448d2b89b1813(inputs, context, index, info) {\n let cacheable = true;\n let i, ilen, value;\n for(i = 0, ilen = inputs.length; i < ilen; ++i){\n value = inputs[i];\n if (value === undefined) continue;\n if (context !== undefined && typeof value === \"function\") {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && $c4d1694fa24f1a71$export$8b22cf2602fb60ce(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) info.cacheable = false;\n return value;\n }\n }\n}\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */ function $c4d1694fa24f1a71$export$db202ddc8be9136(minmax, grace, beginAtZero) {\n const { min: min, max: max } = minmax;\n const change = $c4d1694fa24f1a71$export$7ccc53e8f1e7dfc5(grace, (max - min) / 2);\n const keepZero = (value, add)=>beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\nfunction $c4d1694fa24f1a71$export$35e795649ee09318(parentContext, context) {\n return Object.assign(Object.create(parentContext), context);\n}\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */ function $c4d1694fa24f1a71$export$a9c996f45e5784d0(scopes, prefixes = [\n \"\"\n], rootScopes, fallback, getTarget = ()=>scopes[0]) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === \"undefined\") fallback = $c4d1694fa24f1a71$var$_resolve(\"_fallback\", scopes);\n const cache = {\n [Symbol.toStringTag]: \"Object\",\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope)=>$c4d1694fa24f1a71$export$a9c996f45e5784d0([\n scope,\n ...scopes\n ], prefixes, finalRootScopes, fallback)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop) {\n return $c4d1694fa24f1a71$var$_cached(target, prop, ()=>$c4d1694fa24f1a71$var$_resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return $c4d1694fa24f1a71$var$getKeysFromAllScopes(target).includes(prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys (target) {\n return $c4d1694fa24f1a71$var$getKeysFromAllScopes(target);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n });\n}\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */ function $c4d1694fa24f1a71$export$c3950d9923825c02(proxy, context, subProxy, descriptorDefaults) {\n const cache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: $c4d1694fa24f1a71$export$7910e0436ed8d1de(proxy, descriptorDefaults),\n setContext: (ctx)=>$c4d1694fa24f1a71$export$c3950d9923825c02(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope)=>$c4d1694fa24f1a71$export$c3950d9923825c02(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop, receiver) {\n return $c4d1694fa24f1a71$var$_cached(target, prop, ()=>$c4d1694fa24f1a71$var$_resolveWithContext(target, prop, receiver));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? {\n enumerable: true,\n configurable: true\n } : undefined : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(proxy);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return Reflect.has(proxy, prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys () {\n return Reflect.ownKeys(proxy);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n });\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$7910e0436ed8d1de(proxy, defaults = {\n scriptable: true,\n indexable: true\n}) {\n const { _scriptable: _scriptable = defaults.scriptable, _indexable: _indexable = defaults.indexable, _allKeys: _allKeys = defaults.allKeys } = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: $c4d1694fa24f1a71$export$a93c5207d687da10(_scriptable) ? _scriptable : ()=>_scriptable,\n isIndexable: $c4d1694fa24f1a71$export$a93c5207d687da10(_indexable) ? _indexable : ()=>_indexable\n };\n}\nconst $c4d1694fa24f1a71$var$readKey = (prefix, name)=>prefix ? prefix + $c4d1694fa24f1a71$export$a8550f7dbe79f93a(name) : name;\nconst $c4d1694fa24f1a71$var$needsSubResolver = (prop, value)=>$c4d1694fa24f1a71$export$23f2a1d2818174ef(value) && prop !== \"adapters\" && (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction $c4d1694fa24f1a71$var$_cached(target, prop, resolve) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) return target[prop];\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\nfunction $c4d1694fa24f1a71$var$_resolveWithContext(target, prop, receiver) {\n const { _proxy: _proxy, _context: _context, _subProxy: _subProxy, _descriptors: descriptors } = target;\n let value = _proxy[prop]; // resolve from proxy\n // resolve with context\n if ($c4d1694fa24f1a71$export$a93c5207d687da10(value) && descriptors.isScriptable(prop)) value = $c4d1694fa24f1a71$var$_resolveScriptable(prop, value, target, receiver);\n if ($c4d1694fa24f1a71$export$8b22cf2602fb60ce(value) && value.length) value = $c4d1694fa24f1a71$var$_resolveArray(prop, value, target, descriptors.isIndexable);\n if ($c4d1694fa24f1a71$var$needsSubResolver(prop, value)) // if the resolved value is an object, create a sub resolver for it\n value = $c4d1694fa24f1a71$export$c3950d9923825c02(value, _context, _subProxy && _subProxy[prop], descriptors);\n return value;\n}\nfunction $c4d1694fa24f1a71$var$_resolveScriptable(prop, getValue, target, receiver) {\n const { _proxy: _proxy, _context: _context, _subProxy: _subProxy, _stack: _stack } = target;\n if (_stack.has(prop)) throw new Error(\"Recursion detected: \" + Array.from(_stack).join(\"->\") + \"->\" + prop);\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if ($c4d1694fa24f1a71$var$needsSubResolver(prop, value)) // When scriptable option returns an object, create a resolver on that.\n value = $c4d1694fa24f1a71$var$createSubResolver(_proxy._scopes, _proxy, prop, value);\n return value;\n}\nfunction $c4d1694fa24f1a71$var$_resolveArray(prop, value, target, isIndexable) {\n const { _proxy: _proxy, _context: _context, _subProxy: _subProxy, _descriptors: descriptors } = target;\n if (typeof _context.index !== \"undefined\" && isIndexable(prop)) return value[_context.index % value.length];\n else if ($c4d1694fa24f1a71$export$23f2a1d2818174ef(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter((s)=>s !== arr);\n value = [];\n for (const item of arr){\n const resolver = $c4d1694fa24f1a71$var$createSubResolver(scopes, _proxy, prop, item);\n value.push($c4d1694fa24f1a71$export$c3950d9923825c02(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\nfunction $c4d1694fa24f1a71$var$resolveFallback(fallback, prop, value) {\n return $c4d1694fa24f1a71$export$a93c5207d687da10(fallback) ? fallback(prop, value) : fallback;\n}\nconst $c4d1694fa24f1a71$var$getScope = (key, parent)=>key === true ? parent : typeof key === \"string\" ? $c4d1694fa24f1a71$export$2d1720544b23b823(parent, key) : undefined;\nfunction $c4d1694fa24f1a71$var$addScopes(set, parentScopes, key, parentFallback, value) {\n for (const parent of parentScopes){\n const scope = $c4d1694fa24f1a71$var$getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = $c4d1694fa24f1a71$var$resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== \"undefined\" && fallback !== key && fallback !== parentFallback) // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n } else if (scope === false && typeof parentFallback !== \"undefined\" && key !== parentFallback) // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n return false;\n}\nfunction $c4d1694fa24f1a71$var$createSubResolver(parentScopes, resolver, prop, value) {\n const rootScopes = resolver._rootScopes;\n const fallback = $c4d1694fa24f1a71$var$resolveFallback(resolver._fallback, prop, value);\n const allScopes = [\n ...parentScopes,\n ...rootScopes\n ];\n const set = new Set();\n set.add(value);\n let key = $c4d1694fa24f1a71$var$addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) return false;\n if (typeof fallback !== \"undefined\" && fallback !== prop) {\n key = $c4d1694fa24f1a71$var$addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) return false;\n }\n return $c4d1694fa24f1a71$export$a9c996f45e5784d0(Array.from(set), [\n \"\"\n ], rootScopes, fallback, ()=>$c4d1694fa24f1a71$var$subGetTarget(resolver, prop, value));\n}\nfunction $c4d1694fa24f1a71$var$addScopesFromKey(set, allScopes, key, fallback, item) {\n while(key)key = $c4d1694fa24f1a71$var$addScopes(set, allScopes, key, fallback, item);\n return key;\n}\nfunction $c4d1694fa24f1a71$var$subGetTarget(resolver, prop, value) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) parent[prop] = {};\n const target = parent[prop];\n if ($c4d1694fa24f1a71$export$8b22cf2602fb60ce(target) && $c4d1694fa24f1a71$export$23f2a1d2818174ef(value)) // For array of objects, the object is used to store updated values\n return value;\n return target || {};\n}\nfunction $c4d1694fa24f1a71$var$_resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n let value;\n for (const prefix of prefixes){\n value = $c4d1694fa24f1a71$var$_resolve($c4d1694fa24f1a71$var$readKey(prefix, prop), scopes);\n if (typeof value !== \"undefined\") return $c4d1694fa24f1a71$var$needsSubResolver(prop, value) ? $c4d1694fa24f1a71$var$createSubResolver(scopes, proxy, prop, value) : value;\n }\n}\nfunction $c4d1694fa24f1a71$var$_resolve(key, scopes) {\n for (const scope of scopes){\n if (!scope) continue;\n const value = scope[key];\n if (typeof value !== \"undefined\") return value;\n }\n}\nfunction $c4d1694fa24f1a71$var$getKeysFromAllScopes(target) {\n let keys = target._keys;\n if (!keys) keys = target._keys = $c4d1694fa24f1a71$var$resolveKeysFromAllScopes(target._scopes);\n return keys;\n}\nfunction $c4d1694fa24f1a71$var$resolveKeysFromAllScopes(scopes) {\n const set = new Set();\n for (const scope of scopes)for (const key of Object.keys(scope).filter((k)=>!k.startsWith(\"_\")))set.add(key);\n return Array.from(set);\n}\nfunction $c4d1694fa24f1a71$export$4a5767248b18ef41(meta, data, start, count) {\n const { iScale: iScale } = meta;\n const { key: key = \"r\" } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse($c4d1694fa24f1a71$export$2d1720544b23b823(item, key), index)\n };\n }\n return parsed;\n}\nconst $c4d1694fa24f1a71$var$EPSILON = Number.EPSILON || 1e-14;\nconst $c4d1694fa24f1a71$var$getPoint = (points, i)=>i < points.length && !points[i].skip && points[i];\nconst $c4d1694fa24f1a71$var$getValueAxis = (indexAxis)=>indexAxis === \"x\" ? \"y\" : \"x\";\nfunction $c4d1694fa24f1a71$export$e171bab687b50e0(firstPoint, middlePoint, afterPoint, t) {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n // This function must also respect \"skipped\" points\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = $c4d1694fa24f1a71$export$158acd800e1ef08b(current, previous);\n const d12 = $c4d1694fa24f1a71$export$158acd800e1ef08b(next, current);\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n/**\n * Adjust tangents to ensure monotonic properties\n */ function $c4d1694fa24f1a71$var$monotoneAdjust(points, deltaK, mK) {\n const pointsLen = points.length;\n let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n let pointAfter = $c4d1694fa24f1a71$var$getPoint(points, 0);\n for(let i = 0; i < pointsLen - 1; ++i){\n pointCurrent = pointAfter;\n pointAfter = $c4d1694fa24f1a71$var$getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) continue;\n if ($c4d1694fa24f1a71$export$a05254e7c3aeba6e(deltaK[i], 0, $c4d1694fa24f1a71$var$EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) continue;\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\nfunction $c4d1694fa24f1a71$var$monotoneCompute(points, mK, indexAxis = \"x\") {\n const valueAxis = $c4d1694fa24f1a71$var$getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta, pointBefore, pointCurrent;\n let pointAfter = $c4d1694fa24f1a71$var$getPoint(points, 0);\n for(let i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = $c4d1694fa24f1a71$var$getPoint(points, i + 1);\n if (!pointCurrent) continue;\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */ function $c4d1694fa24f1a71$export$527e9aa3390079e9(points, indexAxis = \"x\") {\n const valueAxis = $c4d1694fa24f1a71$var$getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK = Array(pointsLen).fill(0);\n const mK = Array(pointsLen);\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore, pointCurrent;\n let pointAfter = $c4d1694fa24f1a71$var$getPoint(points, 0);\n for(i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = $c4d1694fa24f1a71$var$getPoint(points, i + 1);\n if (!pointCurrent) continue;\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : $c4d1694fa24f1a71$export$2408f22a0fab9ae5(deltaK[i - 1]) !== $c4d1694fa24f1a71$export$2408f22a0fab9ae5(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n $c4d1694fa24f1a71$var$monotoneAdjust(points, deltaK, mK);\n $c4d1694fa24f1a71$var$monotoneCompute(points, mK, indexAxis);\n}\nfunction $c4d1694fa24f1a71$var$capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n}\nfunction $c4d1694fa24f1a71$var$capBezierPoints(points, area) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = $c4d1694fa24f1a71$export$e7094788287c5e9b(points[0], area);\n for(i = 0, ilen = points.length; i < ilen; ++i){\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && $c4d1694fa24f1a71$export$e7094788287c5e9b(points[i + 1], area);\n if (!inArea) continue;\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = $c4d1694fa24f1a71$var$capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = $c4d1694fa24f1a71$var$capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = $c4d1694fa24f1a71$var$capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = $c4d1694fa24f1a71$var$capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$ab83b03e4111b1d0(points, options, area, loop, indexAxis) {\n let i, ilen, point, controlPoints;\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) points = points.filter((pt)=>!pt.skip);\n if (options.cubicInterpolationMode === \"monotone\") $c4d1694fa24f1a71$export$527e9aa3390079e9(points, indexAxis);\n else {\n let prev = loop ? points[points.length - 1] : points[0];\n for(i = 0, ilen = points.length; i < ilen; ++i){\n point = points[i];\n controlPoints = $c4d1694fa24f1a71$export$e171bab687b50e0(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension);\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n if (options.capBezierPoints) $c4d1694fa24f1a71$var$capBezierPoints(points, area);\n}\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */ /**\n * @private\n */ function $c4d1694fa24f1a71$export$3a1a48c8f6ef640e() {\n return typeof window !== \"undefined\" && typeof document !== \"undefined\";\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$9bb611d729802a56(domNode) {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === \"[object ShadowRoot]\") parent = parent.host;\n return parent;\n}\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */ function $c4d1694fa24f1a71$var$parseMaxStyle(styleValue, node, parentProperty) {\n let valueInPixels;\n if (typeof styleValue === \"string\") {\n valueInPixels = parseInt(styleValue, 10);\n if (styleValue.indexOf(\"%\") !== -1) // percentage * size in dimension\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n } else valueInPixels = styleValue;\n return valueInPixels;\n}\nconst $c4d1694fa24f1a71$var$getComputedStyle = (element)=>element.ownerDocument.defaultView.getComputedStyle(element, null);\nfunction $c4d1694fa24f1a71$export$a17c37559e1db147(el, property) {\n return $c4d1694fa24f1a71$var$getComputedStyle(el).getPropertyValue(property);\n}\nconst $c4d1694fa24f1a71$var$positions = [\n \"top\",\n \"right\",\n \"bottom\",\n \"left\"\n];\nfunction $c4d1694fa24f1a71$var$getPositionedStyle(styles, style, suffix) {\n const result = {};\n suffix = suffix ? \"-\" + suffix : \"\";\n for(let i = 0; i < 4; i++){\n const pos = $c4d1694fa24f1a71$var$positions[i];\n result[pos] = parseFloat(styles[style + \"-\" + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\nconst $c4d1694fa24f1a71$var$useOffsetPos = (x, y, target)=>(x > 0 || y > 0) && (!target || !target.shadowRoot);\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */ function $c4d1694fa24f1a71$var$getCanvasPosition(e, canvas) {\n const touches = e.touches;\n const source = touches && touches.length ? touches[0] : e;\n const { offsetX: offsetX, offsetY: offsetY } = source;\n let box = false;\n let x, y;\n if ($c4d1694fa24f1a71$var$useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {\n x: x,\n y: y,\n box: box\n };\n}\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */ function $c4d1694fa24f1a71$export$df995fae86a55f06(event, chart) {\n if (\"native\" in event) return event;\n const { canvas: canvas, currentDevicePixelRatio: currentDevicePixelRatio } = chart;\n const style = $c4d1694fa24f1a71$var$getComputedStyle(canvas);\n const borderBox = style.boxSizing === \"border-box\";\n const paddings = $c4d1694fa24f1a71$var$getPositionedStyle(style, \"padding\");\n const borders = $c4d1694fa24f1a71$var$getPositionedStyle(style, \"border\", \"width\");\n const { x: x, y: y, box: box } = $c4d1694fa24f1a71$var$getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n let { width: width, height: height } = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\nfunction $c4d1694fa24f1a71$var$getContainerSize(canvas, width, height) {\n let maxWidth, maxHeight;\n if (width === undefined || height === undefined) {\n const container = $c4d1694fa24f1a71$export$9bb611d729802a56(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = $c4d1694fa24f1a71$var$getComputedStyle(container);\n const containerBorder = $c4d1694fa24f1a71$var$getPositionedStyle(containerStyle, \"border\", \"width\");\n const containerPadding = $c4d1694fa24f1a71$var$getPositionedStyle(containerStyle, \"padding\");\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = $c4d1694fa24f1a71$var$parseMaxStyle(containerStyle.maxWidth, container, \"clientWidth\");\n maxHeight = $c4d1694fa24f1a71$var$parseMaxStyle(containerStyle.maxHeight, container, \"clientHeight\");\n }\n }\n return {\n width: width,\n height: height,\n maxWidth: maxWidth || $c4d1694fa24f1a71$export$2ec5befb9e6c97d4,\n maxHeight: maxHeight || $c4d1694fa24f1a71$export$2ec5befb9e6c97d4\n };\n}\nconst $c4d1694fa24f1a71$var$round1 = (v)=>Math.round(v * 10) / 10;\n// eslint-disable-next-line complexity\nfunction $c4d1694fa24f1a71$export$2329c99376c9d0a4(canvas, bbWidth, bbHeight, aspectRatio) {\n const style = $c4d1694fa24f1a71$var$getComputedStyle(canvas);\n const margins = $c4d1694fa24f1a71$var$getPositionedStyle(style, \"margin\");\n const maxWidth = $c4d1694fa24f1a71$var$parseMaxStyle(style.maxWidth, canvas, \"clientWidth\") || $c4d1694fa24f1a71$export$2ec5befb9e6c97d4;\n const maxHeight = $c4d1694fa24f1a71$var$parseMaxStyle(style.maxHeight, canvas, \"clientHeight\") || $c4d1694fa24f1a71$export$2ec5befb9e6c97d4;\n const containerSize = $c4d1694fa24f1a71$var$getContainerSize(canvas, bbWidth, bbHeight);\n let { width: width, height: height } = containerSize;\n if (style.boxSizing === \"content-box\") {\n const borders = $c4d1694fa24f1a71$var$getPositionedStyle(style, \"border\", \"width\");\n const paddings = $c4d1694fa24f1a71$var$getPositionedStyle(style, \"padding\");\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = $c4d1694fa24f1a71$var$round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = $c4d1694fa24f1a71$var$round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = $c4d1694fa24f1a71$var$round1(width / 2);\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = $c4d1694fa24f1a71$var$round1(Math.floor(height * aspectRatio));\n }\n return {\n width: width,\n height: height\n };\n}\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */ function $c4d1694fa24f1a71$export$f787f51d84a910ad(chart, forceRatio, forceStyle) {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n const canvas = chart.canvas;\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */ const $c4d1694fa24f1a71$export$3466f893ebf79586 = function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive () {\n passiveSupported = true;\n return false;\n }\n };\n window.addEventListener(\"test\", null, options);\n window.removeEventListener(\"test\", null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}();\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */ function $c4d1694fa24f1a71$export$b4171a6734a65d42(element, property) {\n const value = $c4d1694fa24f1a71$export$a17c37559e1db147(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$8a5498727ef6be21(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$7a38258bbe170828(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === \"middle\" ? t < 0.5 ? p1.y : p2.y : mode === \"after\" ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y\n };\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$2f6ca3d3b1f80bf5(p1, p2, t, mode) {\n const cp1 = {\n x: p1.cp2x,\n y: p1.cp2y\n };\n const cp2 = {\n x: p2.cp1x,\n y: p2.cp1y\n };\n const a = $c4d1694fa24f1a71$export$8a5498727ef6be21(p1, cp1, t);\n const b = $c4d1694fa24f1a71$export$8a5498727ef6be21(cp1, cp2, t);\n const c = $c4d1694fa24f1a71$export$8a5498727ef6be21(cp2, p2, t);\n const d = $c4d1694fa24f1a71$export$8a5498727ef6be21(a, b, t);\n const e = $c4d1694fa24f1a71$export$8a5498727ef6be21(b, c, t);\n return $c4d1694fa24f1a71$export$8a5498727ef6be21(d, e, t);\n}\nconst $c4d1694fa24f1a71$var$getRightToLeftAdapter = function(rectX, width) {\n return {\n x (x) {\n return rectX + rectX + width - x;\n },\n setWidth (w) {\n width = w;\n },\n textAlign (align) {\n if (align === \"center\") return align;\n return align === \"right\" ? \"left\" : \"right\";\n },\n xPlus (x, value) {\n return x - value;\n },\n leftForLtr (x, itemWidth) {\n return x - itemWidth;\n }\n };\n};\nconst $c4d1694fa24f1a71$var$getLeftToRightAdapter = function() {\n return {\n x (x) {\n return x;\n },\n setWidth (w) {},\n textAlign (align) {\n return align;\n },\n xPlus (x, value) {\n return x + value;\n },\n leftForLtr (x, _itemWidth) {\n return x;\n }\n };\n};\nfunction $c4d1694fa24f1a71$export$3d12bd131bb975d1(rtl, rectX, width) {\n return rtl ? $c4d1694fa24f1a71$var$getRightToLeftAdapter(rectX, width) : $c4d1694fa24f1a71$var$getLeftToRightAdapter();\n}\nfunction $c4d1694fa24f1a71$export$91c6e00c14e7e6fd(ctx, direction) {\n let style, original;\n if (direction === \"ltr\" || direction === \"rtl\") {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue(\"direction\"),\n style.getPropertyPriority(\"direction\")\n ];\n style.setProperty(\"direction\", direction, \"important\");\n ctx.prevTextDirection = original;\n }\n}\nfunction $c4d1694fa24f1a71$export$890c4ad488842ce7(ctx, original) {\n if (original !== undefined) {\n delete ctx.prevTextDirection;\n ctx.canvas.style.setProperty(\"direction\", original[0], original[1]);\n }\n}\nfunction $c4d1694fa24f1a71$var$propertyFn(property) {\n if (property === \"angle\") return {\n between: $c4d1694fa24f1a71$export$ffb5f4729a158638,\n compare: $c4d1694fa24f1a71$export$c18d01048907ea92,\n normalize: $c4d1694fa24f1a71$export$28f7fcd39efa255\n };\n return {\n between: $c4d1694fa24f1a71$export$3b513254972cfc9c,\n compare: (a, b)=>a - b,\n normalize: (x)=>x\n };\n}\nfunction $c4d1694fa24f1a71$var$normalizeSegment({ start: start, end: end, count: count, loop: loop, style: style }) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style: style\n };\n}\nfunction $c4d1694fa24f1a71$var$getSegment(segment, points, bounds) {\n const { property: property, start: startBound, end: endBound } = bounds;\n const { between: between, normalize: normalize } = $c4d1694fa24f1a71$var$propertyFn(property);\n const count = points.length;\n let { start: start, end: end, loop: loop } = segment;\n let i, ilen;\n if (loop) {\n start += count;\n end += count;\n for(i = 0, ilen = count; i < ilen; ++i){\n if (!between(normalize(points[start % count][property]), startBound, endBound)) break;\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n if (end < start) end += count;\n return {\n start: start,\n end: end,\n loop: loop,\n style: segment.style\n };\n}\nfunction $c4d1694fa24f1a71$export$9fa96a7d116ea3ce(segment, points, bounds) {\n if (!bounds) return [\n segment\n ];\n const { property: property, start: startBound, end: endBound } = bounds;\n const count = points.length;\n const { compare: compare, between: between, normalize: normalize } = $c4d1694fa24f1a71$var$propertyFn(property);\n const { start: start, end: end, loop: loop, style: style } = $c4d1694fa24f1a71$var$getSegment(segment, points, bounds);\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n const startIsBefore = ()=>between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = ()=>compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = ()=>inside || startIsBefore();\n const shouldStop = ()=>!inside || endIsBefore();\n for(let i = start, prev = start; i <= end; ++i){\n point = points[i % count];\n if (point.skip) continue;\n value = normalize(point[property]);\n if (value === prevValue) continue;\n inside = between(value, startBound, endBound);\n if (subStart === null && shouldStart()) subStart = compare(value, startBound) === 0 ? i : prev;\n if (subStart !== null && shouldStop()) {\n result.push($c4d1694fa24f1a71$var$normalizeSegment({\n start: subStart,\n end: i,\n loop: loop,\n count: count,\n style: style\n }));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n if (subStart !== null) result.push($c4d1694fa24f1a71$var$normalizeSegment({\n start: subStart,\n end: end,\n loop: loop,\n count: count,\n style: style\n }));\n return result;\n}\nfunction $c4d1694fa24f1a71$export$306ddfe3a8403e2(line, bounds) {\n const result = [];\n const segments = line.segments;\n for(let i = 0; i < segments.length; i++){\n const sub = $c4d1694fa24f1a71$export$9fa96a7d116ea3ce(segments[i], line.points, bounds);\n if (sub.length) result.push(...sub);\n }\n return result;\n}\nfunction $c4d1694fa24f1a71$var$findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n if (loop && !spanGaps) while(start < count && !points[start].skip)start++;\n while(start < count && points[start].skip)start++;\n start %= count;\n if (loop) end += start;\n while(end > start && points[end % count].skip)end--;\n end %= count;\n return {\n start: start,\n end: end\n };\n}\nfunction $c4d1694fa24f1a71$var$solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n for(end = start + 1; end <= max; ++end){\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({\n start: start % count,\n end: (end - 1) % count,\n loop: loop\n });\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) start = end;\n }\n prev = cur;\n }\n if (last !== null) result.push({\n start: start % count,\n end: last % count,\n loop: loop\n });\n return result;\n}\nfunction $c4d1694fa24f1a71$export$1a82df3d29112e01(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n if (!count) return [];\n const loop = !!line._loop;\n const { start: start, end: end } = $c4d1694fa24f1a71$var$findStartAndEnd(points, count, loop, spanGaps);\n if (spanGaps === true) return $c4d1694fa24f1a71$var$splitByStyles(line, [\n {\n start: start,\n end: end,\n loop: loop\n }\n ], points, segmentOptions);\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return $c4d1694fa24f1a71$var$splitByStyles(line, $c4d1694fa24f1a71$var$solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\nfunction $c4d1694fa24f1a71$var$splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) return segments;\n return $c4d1694fa24f1a71$var$doSplitByStyles(line, segments, points, segmentOptions);\n}\nfunction $c4d1694fa24f1a71$var$doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = $c4d1694fa24f1a71$var$readStyle(line.options);\n const { _datasetIndex: datasetIndex, options: { spanGaps: spanGaps } } = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) return;\n s += count;\n while(points[s % count].skip)s -= dir;\n while(points[e % count].skip)e += dir;\n if (s % count !== e % count) {\n result.push({\n start: s % count,\n end: e % count,\n loop: l,\n style: st\n });\n prevStyle = st;\n start = e % count;\n }\n }\n for (const segment of segments){\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for(i = start + 1; i <= segment.end; i++){\n const pt = points[i % count];\n style = $c4d1694fa24f1a71$var$readStyle(segmentOptions.setContext($c4d1694fa24f1a71$export$35e795649ee09318(chartContext, {\n type: \"segment\",\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex: datasetIndex\n })));\n if ($c4d1694fa24f1a71$var$styleChanged(style, prevStyle)) addStyle(start, i - 1, segment.loop, prevStyle);\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) addStyle(start, i - 1, segment.loop, prevStyle);\n }\n return result;\n}\nfunction $c4d1694fa24f1a71$var$readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\nfunction $c4d1694fa24f1a71$var$styleChanged(style, prevStyle) {\n if (!prevStyle) return false;\n const cache = [];\n const replacer = function(key, value) {\n if (!$c4d1694fa24f1a71$export$f96d196f7728bb5(value)) return value;\n if (!cache.includes(value)) cache.push(value);\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n\n\n\nclass $dfc006ada1995968$var$Animator {\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n callbacks.forEach((fn)=>fn({\n chart: chart,\n initial: anims.initial,\n numSteps: numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n _refresh() {\n if (this._request) return;\n this._running = true;\n this._request = (0, $c4d1694fa24f1a71$export$43caf9889c228507).call(window, ()=>{\n this._update();\n this._request = null;\n if (this._running) this._refresh();\n });\n }\n _update(date = Date.now()) {\n let remaining = 0;\n this._charts.forEach((anims, chart)=>{\n if (!anims.running || !anims.items.length) return;\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n for(; i >= 0; --i){\n item = items[i];\n if (item._active) {\n if (item._total > anims.duration) anims.duration = item._total;\n item.tick(date);\n draw = true;\n } else {\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, \"progress\");\n }\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, \"complete\");\n anims.initial = false;\n }\n remaining += items.length;\n });\n this._lastDate = date;\n if (remaining === 0) this._running = false;\n }\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n add(chart, items) {\n if (!items || !items.length) return;\n this._getAnims(chart).items.push(...items);\n }\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) return;\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur)=>Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n running(chart) {\n if (!this._running) return false;\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) return false;\n return true;\n }\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) return;\n const items = anims.items;\n let i = items.length - 1;\n for(; i >= 0; --i)items[i].cancel();\n anims.items = [];\n this._notify(chart, anims, Date.now(), \"complete\");\n }\n remove(chart) {\n return this._charts.delete(chart);\n }\n constructor(){\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n}\nvar $dfc006ada1995968$export$a424a0aa8f687495 = /* #__PURE__ */ new $dfc006ada1995968$var$Animator();\nconst $dfc006ada1995968$var$transparent = \"transparent\";\nconst $dfc006ada1995968$var$interpolators = {\n boolean (from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n color (from, to, factor) {\n const c0 = (0, $c4d1694fa24f1a71$export$db3b6bfb95261072)(from || $dfc006ada1995968$var$transparent);\n const c1 = c0.valid && (0, $c4d1694fa24f1a71$export$db3b6bfb95261072)(to || $dfc006ada1995968$var$transparent);\n return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to;\n },\n number (from, to, factor) {\n return from + (to - from) * factor;\n }\n};\nclass $dfc006ada1995968$export$c35d437ae5945fcd {\n active() {\n return this._active;\n }\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = (0, $c4d1694fa24f1a71$export$407448d2b89b1813)([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n this._from = (0, $c4d1694fa24f1a71$export$407448d2b89b1813)([\n cfg.from,\n currentValue,\n to\n ]);\n }\n }\n cancel() {\n if (this._active) {\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n this._active = from !== to && (loop || elapsed < duration);\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n factor = elapsed / duration % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n this._target[prop] = this._fn(from, to, factor);\n }\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej)=>{\n promises.push({\n res: res,\n rej: rej\n });\n });\n }\n _notify(resolved) {\n const method = resolved ? \"res\" : \"rej\";\n const promises = this._promises || [];\n for(let i = 0; i < promises.length; i++)promises[i][method]();\n }\n constructor(cfg, target, prop, to){\n const currentValue = target[prop];\n to = (0, $c4d1694fa24f1a71$export$407448d2b89b1813)([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n const from = (0, $c4d1694fa24f1a71$export$407448d2b89b1813)([\n cfg.from,\n currentValue,\n to\n ]);\n this._active = true;\n this._fn = cfg.fn || $dfc006ada1995968$var$interpolators[cfg.type || typeof from];\n this._easing = (0, $c4d1694fa24f1a71$export$f1e1789686576879)[cfg.easing] || (0, $c4d1694fa24f1a71$export$f1e1789686576879).linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n}\nclass $dfc006ada1995968$export$8ab227dac26677d {\n configure(config) {\n if (!(0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(config)) return;\n const animationOptions = Object.keys((0, $c4d1694fa24f1a71$export$4368d992c4eafac0).animation);\n const animatedProps = this._properties;\n Object.getOwnPropertyNames(config).forEach((key)=>{\n const cfg = config[key];\n if (!(0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(cfg)) return;\n const resolved = {};\n for (const option of animationOptions)resolved[option] = cfg[option];\n ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(cfg.properties) && cfg.properties || [\n key\n ]).forEach((prop)=>{\n if (prop === key || !animatedProps.has(prop)) animatedProps.set(prop, resolved);\n });\n });\n }\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = $dfc006ada1995968$var$resolveTargetOptions(target, newOptions);\n if (!options) return [];\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) $dfc006ada1995968$var$awaitAll(target.options.$animations, newOptions).then(()=>{\n target.options = newOptions;\n }, ()=>{});\n return animations;\n }\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n for(i = props.length - 1; i >= 0; --i){\n const prop = props[i];\n if (prop.charAt(0) === \"$\") continue;\n if (prop === \"options\") {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n if (animation) {\n if (cfg && animation.active()) {\n animation.update(cfg, value, date);\n continue;\n } else animation.cancel();\n }\n if (!cfg || !cfg.duration) {\n target[prop] = value;\n continue;\n }\n running[prop] = animation = new $dfc006ada1995968$export$c35d437ae5945fcd(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n update(target, values) {\n if (this._properties.size === 0) {\n Object.assign(target, values);\n return;\n }\n const animations = this._createAnimations(target, values);\n if (animations.length) {\n $dfc006ada1995968$export$a424a0aa8f687495.add(this._chart, animations);\n return true;\n }\n }\n constructor(chart, config){\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n}\nfunction $dfc006ada1995968$var$awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for(let i = 0; i < keys.length; i++){\n const anim = animations[keys[i]];\n if (anim && anim.active()) running.push(anim.wait());\n }\n return Promise.all(running);\n}\nfunction $dfc006ada1995968$var$resolveTargetOptions(target, newOptions) {\n if (!newOptions) return;\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) target.options = options = Object.assign({}, options, {\n $shared: false,\n $animations: {}\n });\n return options;\n}\nfunction $dfc006ada1995968$var$scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\nfunction $dfc006ada1995968$var$defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) return false;\n const x = $dfc006ada1995968$var$scaleClip(xScale, allowedOverflow);\n const y = $dfc006ada1995968$var$scaleClip(yScale, allowedOverflow);\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\nfunction $dfc006ada1995968$var$toClip(value) {\n let t, r, b, l;\n if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else t = r = b = l = value;\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\nfunction $dfc006ada1995968$var$getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i)keys.push(metasets[i].index);\n return keys;\n}\nfunction $dfc006ada1995968$var$applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === \"single\";\n let i, ilen, datasetIndex, otherValue;\n if (value === null) return;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) continue;\n break;\n }\n otherValue = stack.values[datasetIndex];\n if ((0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(otherValue) && (singleMode || value === 0 || (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(value) === (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(otherValue))) value += otherValue;\n }\n return value;\n}\nfunction $dfc006ada1995968$var$convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\nfunction $dfc006ada1995968$var$isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || stacked === undefined && meta.stack !== undefined;\n}\nfunction $dfc006ada1995968$var$getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction $dfc006ada1995968$var$getUserBounds(scale) {\n const { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\nfunction $dfc006ada1995968$var$getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction $dfc006ada1995968$var$getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()){\n const value = stack[meta.index];\n if (positive && value > 0 || !positive && value < 0) return meta.index;\n }\n return null;\n}\nfunction $dfc006ada1995968$var$updateStacks(controller, parsed) {\n const { chart: chart, _cachedMeta: meta } = controller;\n const stacks = chart._stacks || (chart._stacks = {});\n const { iScale: iScale, vScale: vScale, index: datasetIndex } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = $dfc006ada1995968$var$getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n for(let i = 0; i < ilen; ++i){\n const item = parsed[i];\n const { [iAxis]: index, [vAxis]: value } = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = $dfc006ada1995968$var$getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n stack._top = $dfc006ada1995968$var$getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = $dfc006ada1995968$var$getLastIndexInStack(stack, vScale, false, meta.type);\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\nfunction $dfc006ada1995968$var$getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter((key)=>scales[key].axis === axis).shift();\n}\nfunction $dfc006ada1995968$var$createDatasetContext(parent, index) {\n return (0, $c4d1694fa24f1a71$export$35e795649ee09318)(parent, {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index: index,\n mode: \"default\",\n type: \"dataset\"\n });\n}\nfunction $dfc006ada1995968$var$createDataContext(parent, index, element) {\n return (0, $c4d1694fa24f1a71$export$35e795649ee09318)(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element: element,\n index: index,\n mode: \"default\",\n type: \"data\"\n });\n}\nfunction $dfc006ada1995968$var$clearStacks(meta, items) {\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) return;\n items = items || meta._parsed;\n for (const parsed of items){\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) return;\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) delete stacks[axis]._visualValues[datasetIndex];\n }\n}\nconst $dfc006ada1995968$var$isDirectUpdateMode = (mode)=>mode === \"reset\" || mode === \"none\";\nconst $dfc006ada1995968$var$cloneIfNotShared = (cached, shared)=>shared ? cached : Object.assign({}, cached);\nconst $dfc006ada1995968$var$createStack = (canStack, meta, chart)=>canStack && !meta.hidden && meta._stacked && {\n keys: $dfc006ada1995968$var$getSortedDatasetIndices(chart, true),\n values: null\n };\nclass $dfc006ada1995968$export$75572ec5c55b4048 {\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = $dfc006ada1995968$var$isStacked(meta.vScale, meta);\n this.addElements();\n if (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\");\n }\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) $dfc006ada1995968$var$clearStacks(this._cachedMeta);\n this.index = datasetIndex;\n }\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n const chooseId = (axis, x, y, r)=>axis === \"x\" ? x : axis === \"r\" ? r : y;\n const xid = meta.xAxisID = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(dataset.xAxisID, $dfc006ada1995968$var$getFirstScaleId(chart, \"x\"));\n const yid = meta.yAxisID = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(dataset.yAxisID, $dfc006ada1995968$var$getFirstScaleId(chart, \"y\"));\n const rid = meta.rAxisID = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(dataset.rAxisID, $dfc006ada1995968$var$getFirstScaleId(chart, \"r\"));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale ? meta.vScale : meta.iScale;\n }\n reset() {\n this._update(\"reset\");\n }\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) (0, $c4d1694fa24f1a71$export$3b14a55fb2447963)(this._data, this);\n if (meta._stacked) $dfc006ada1995968$var$clearStacks(meta);\n }\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(data)) this._data = $dfc006ada1995968$var$convertObjectDataToArray(data);\n else if (_data !== data) {\n if (_data) {\n (0, $c4d1694fa24f1a71$export$3b14a55fb2447963)(_data, this);\n const meta = this._cachedMeta;\n $dfc006ada1995968$var$clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) (0, $c4d1694fa24f1a71$export$882b5998b3b9117c)(data, this);\n this._syncList = [];\n this._data = data;\n }\n }\n addElements() {\n const meta = this._cachedMeta;\n this._dataCheck();\n if (this.datasetElementType) meta.dataset = new this.datasetElementType();\n }\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n this._dataCheck();\n const oldStacked = meta._stacked;\n meta._stacked = $dfc006ada1995968$var$isStacked(meta.vScale, meta);\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n $dfc006ada1995968$var$clearStacks(meta);\n meta.stack = dataset.stack;\n }\n this._resyncElements(resetNewElements);\n if (stackChanged || oldStacked !== meta._stacked) $dfc006ada1995968$var$updateStacks(this, meta._parsed);\n }\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n parse(start, count) {\n const { _cachedMeta: meta, _data: data } = this;\n const { iScale: iScale, _stacked: _stacked } = meta;\n const iAxis = iScale.axis;\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(data[start])) parsed = this.parseArrayData(meta, data, start, count);\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(data[start])) parsed = this.parseObjectData(meta, data, start, count);\n else parsed = this.parsePrimitiveData(meta, data, start, count);\n const isNotInOrderComparedToPrev = ()=>cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];\n for(i = 0; i < count; ++i){\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) sorted = false;\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n if (_stacked) $dfc006ada1995968$var$updateStacks(this, parsed);\n }\n parsePrimitiveData(meta, data, start, count) {\n const { iScale: iScale, vScale: vScale } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const { xScale: xScale, yScale: yScale } = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const { xScale: xScale, yScale: yScale } = meta;\n const { xAxisKey: xAxisKey = \"x\", yAxisKey: yAxisKey = \"y\" } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse((0, $c4d1694fa24f1a71$export$2d1720544b23b823)(item, xAxisKey), index),\n y: yScale.parse((0, $c4d1694fa24f1a71$export$2d1720544b23b823)(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: $dfc006ada1995968$var$getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return $dfc006ada1995968$var$applyStack(stack, value, meta.index, {\n mode: mode\n });\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = $dfc006ada1995968$var$applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = $dfc006ada1995968$var$createStack(canStack, meta, this.chart);\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n const { min: otherMin, max: otherMax } = $dfc006ada1995968$var$getUserBounds(otherScale);\n let i, parsed;\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !(0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n for(i = 0; i < ilen; ++i){\n if (_skip()) continue;\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) break;\n }\n if (sorted) for(i = ilen - 1; i >= 0; --i){\n if (_skip()) continue;\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n return range;\n }\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n for(i = 0, ilen = parsed.length; i < ilen; ++i){\n value = parsed[i][scale.axis];\n if ((0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(value)) values.push(value);\n }\n return values;\n }\n getMaxOverflow() {\n return false;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? \"\" + iScale.getLabelForValue(parsed[iScale.axis]) : \"\",\n value: vScale ? \"\" + vScale.getLabelForValue(parsed[vScale.axis]) : \"\"\n };\n }\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || \"default\");\n meta._clip = $dfc006ada1995968$var$toClip((0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(this.options.clip, $dfc006ada1995968$var$defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n update(mode) {}\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || elements.length - start;\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n if (meta.dataset) meta.dataset.draw(ctx, area, start, count);\n for(i = start; i < start + count; ++i){\n const element = elements[i];\n if (element.hidden) continue;\n if (element.active && drawActiveElementsOnTop) active.push(element);\n else element.draw(ctx, area);\n }\n for(i = 0; i < active.length; ++i)active[i].draw(ctx, area);\n }\n getStyle(index, active) {\n const mode = active ? \"active\" : \"default\";\n return index === undefined && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index || 0, mode);\n }\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context || (element.$context = $dfc006ada1995968$var$createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context || (this.$context = $dfc006ada1995968$var$createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n _resolveElementOptions(elementType, mode = \"default\", index) {\n const active = mode === \"active\";\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + \"-\" + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && (0, $c4d1694fa24f1a71$export$dda1d9f60106f0e9)(index);\n if (cached) return $dfc006ada1995968$var$cloneIfNotShared(cached, sharing);\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [\n `${elementType}Hover`,\n \"hover\",\n elementType,\n \"\"\n ] : [\n elementType,\n \"\"\n ];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys((0, $c4d1694fa24f1a71$export$4368d992c4eafac0).elements[elementType]);\n const context = ()=>this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n if (values.$shared) {\n values.$shared = sharing;\n cache[cacheKey] = Object.freeze($dfc006ada1995968$var$cloneIfNotShared(values, sharing));\n }\n return values;\n }\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) return cached;\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new $dfc006ada1995968$export$8ab227dac26677d(chart, options && options.animations);\n if (options && options._cacheable) cache[cacheKey] = Object.freeze(animations);\n return animations;\n }\n getSharedOptions(options) {\n if (!options.$shared) return;\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || $dfc006ada1995968$var$isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions;\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {\n sharedOptions: sharedOptions,\n includeOptions: includeOptions\n };\n }\n updateElement(element, index, properties, mode) {\n if ($dfc006ada1995968$var$isDirectUpdateMode(mode)) Object.assign(element, properties);\n else this._resolveAnimations(index, mode).update(element, properties);\n }\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !$dfc006ada1995968$var$isDirectUpdateMode(mode)) this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n options: !active && this.getSharedOptions(options) || options\n });\n }\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, \"active\", false);\n }\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, \"active\", true);\n }\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) this._setStyle(element, undefined, \"active\", false);\n }\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) this._setStyle(element, undefined, \"active\", true);\n }\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n for (const [method, arg1, arg2] of this._syncList)this[method](arg1, arg2);\n this._syncList = [];\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n if (count) this.parse(0, count);\n if (numData > numMeta) this._insertElements(numMeta, numData - numMeta, resetNewElements);\n else if (numData < numMeta) this._removeElements(numData, numMeta - numData);\n }\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n const move = (arr)=>{\n arr.length += count;\n for(i = arr.length - 1; i >= end; i--)arr[i] = arr[i - count];\n };\n move(data);\n for(i = start; i < end; ++i)data[i] = new this.dataElementType();\n if (this._parsing) move(meta._parsed);\n this.parse(start, count);\n if (resetNewElements) this.updateElements(data, start, count, \"reset\");\n }\n updateElements(element, start, count, mode) {}\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) $dfc006ada1995968$var$clearStacks(meta, removed);\n }\n meta.data.splice(start, count);\n }\n _sync(args) {\n if (this._parsing) this._syncList.push(args);\n else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([\n this.index,\n ...args\n ]);\n }\n _onDataPush() {\n const count = arguments.length;\n this._sync([\n \"_insertElements\",\n this.getDataset().data.length - count,\n count\n ]);\n }\n _onDataPop() {\n this._sync([\n \"_removeElements\",\n this._cachedMeta.data.length - 1,\n 1\n ]);\n }\n _onDataShift() {\n this._sync([\n \"_removeElements\",\n 0,\n 1\n ]);\n }\n _onDataSplice(start, count) {\n if (count) this._sync([\n \"_removeElements\",\n start,\n count\n ]);\n const newCount = arguments.length - 2;\n if (newCount) this._sync([\n \"_insertElements\",\n start,\n newCount\n ]);\n }\n _onDataUnshift() {\n this._sync([\n \"_insertElements\",\n 0,\n arguments.length\n ]);\n }\n constructor(chart, datasetIndex){\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n this.initialize();\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$75572ec5c55b4048, \"defaults\", {});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$75572ec5c55b4048, \"datasetElementType\", null);\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$75572ec5c55b4048, \"dataElementType\", null);\nfunction $dfc006ada1995968$var$getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n for(let i = 0, ilen = visibleMetas.length; i < ilen; i++)values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n scale._cache.$bar = (0, $c4d1694fa24f1a71$export$71511d61b312f219)(values.sort((a, b)=>a - b));\n }\n return scale._cache.$bar;\n}\nfunction $dfc006ada1995968$var$computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = $dfc006ada1995968$var$getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = ()=>{\n if (curr === 32767 || curr === -32768) return;\n if ((0, $c4d1694fa24f1a71$export$dda1d9f60106f0e9)(prev)) min = Math.min(min, Math.abs(curr - prev) || min);\n prev = curr;\n };\n for(i = 0, ilen = values.length; i < ilen; ++i){\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n prev = undefined;\n for(i = 0, ilen = scale.ticks.length; i < ilen; ++i){\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n return min;\n}\nfunction $dfc006ada1995968$var$computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n size = thickness * stackCount;\n ratio = 1;\n }\n return {\n chunk: size / stackCount,\n ratio: ratio,\n start: ruler.pixels[index] - size / 2\n };\n}\nfunction $dfc006ada1995968$var$computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n if (prev === null) prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n if (next === null) next = curr + curr - prev;\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start: start\n };\n}\nfunction $dfc006ada1995968$var$parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n item[vScale.axis] = barEnd;\n item._custom = {\n barStart: barStart,\n barEnd: barEnd,\n start: startValue,\n end: endValue,\n min: min,\n max: max\n };\n}\nfunction $dfc006ada1995968$var$parseValue(entry, item, vScale, i) {\n if ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(entry)) $dfc006ada1995968$var$parseFloatBar(entry, item, vScale, i);\n else item[vScale.axis] = vScale.parse(entry, i);\n return item;\n}\nfunction $dfc006ada1995968$var$parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n for(i = start, ilen = start + count; i < ilen; ++i){\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push($dfc006ada1995968$var$parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\nfunction $dfc006ada1995968$var$isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction $dfc006ada1995968$var$barSign(size, vScale, actualBase) {\n if (size !== 0) return (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(size);\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction $dfc006ada1995968$var$borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = \"left\";\n end = \"right\";\n } else {\n reverse = properties.base < properties.y;\n start = \"bottom\";\n end = \"top\";\n }\n if (reverse) {\n top = \"end\";\n bottom = \"start\";\n } else {\n top = \"start\";\n bottom = \"end\";\n }\n return {\n start: start,\n end: end,\n reverse: reverse,\n top: top,\n bottom: bottom\n };\n}\nfunction $dfc006ada1995968$var$setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n if (edge === true) {\n properties.borderSkipped = {\n top: true,\n right: true,\n bottom: true,\n left: true\n };\n return;\n }\n const { start: start, end: end, reverse: reverse, top: top, bottom: bottom } = $dfc006ada1995968$var$borderProps(properties);\n if (edge === \"middle\" && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) edge = top;\n else if ((stack._bottom || 0) === index) edge = bottom;\n else {\n res[$dfc006ada1995968$var$parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n res[$dfc006ada1995968$var$parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\nfunction $dfc006ada1995968$var$parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = $dfc006ada1995968$var$swap(edge, a, b);\n edge = $dfc006ada1995968$var$startEnd(edge, b, a);\n } else edge = $dfc006ada1995968$var$startEnd(edge, a, b);\n return edge;\n}\nfunction $dfc006ada1995968$var$swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction $dfc006ada1995968$var$startEnd(v, start, end) {\n return v === \"start\" ? start : v === \"end\" ? end : v;\n}\nfunction $dfc006ada1995968$var$setInflateAmount(properties, { inflateAmount: inflateAmount }, ratio) {\n properties.inflateAmount = inflateAmount === \"auto\" ? ratio === 1 ? 0.33 : 0 : inflateAmount;\n}\nclass $dfc006ada1995968$export$e97d5dc64e999004 extends $dfc006ada1995968$export$75572ec5c55b4048 {\n parsePrimitiveData(meta, data, start, count) {\n return $dfc006ada1995968$var$parseArrayOrPrimitive(meta, data, start, count);\n }\n parseArrayData(meta, data, start, count) {\n return $dfc006ada1995968$var$parseArrayOrPrimitive(meta, data, start, count);\n }\n parseObjectData(meta, data, start, count) {\n const { iScale: iScale, vScale: vScale } = meta;\n const { xAxisKey: xAxisKey = \"x\", yAxisKey: yAxisKey = \"y\" } = this._parsing;\n const iAxisKey = iScale.axis === \"x\" ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === \"x\" ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for(i = start, ilen = start + count; i < ilen; ++i){\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse((0, $c4d1694fa24f1a71$export$2d1720544b23b823)(obj, iAxisKey), i);\n parsed.push($dfc006ada1995968$var$parseValue((0, $c4d1694fa24f1a71$export$2d1720544b23b823)(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n getMaxOverflow() {\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const { iScale: iScale, vScale: vScale } = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = $dfc006ada1995968$var$isFloatBar(custom) ? \"[\" + custom.start + \", \" + custom.end + \"]\" : \"\" + vScale.getLabelForValue(parsed[vScale.axis]);\n return {\n label: \"\" + iScale.getLabelForValue(parsed[iScale.axis]),\n value: value\n };\n }\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n updateElements(bars, start, count, mode) {\n const reset = mode === \"reset\";\n const { index: index, _cachedMeta: { vScale: vScale } } = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n for(let i = start; i < start + count; i++){\n const parsed = this.getParsed(i);\n const vpixels = reset || (0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(parsed[vScale.axis]) ? {\n base: base,\n head: base\n } : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n const properties = {\n horizontal: horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || $dfc006ada1995968$var$isFloatBar(parsed._custom) || index === stack._top || index === stack._bottom,\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? \"active\" : mode);\n const options = properties.options || bars[i].options;\n $dfc006ada1995968$var$setBorderSkipped(properties, options, stack, index);\n $dfc006ada1995968$var$setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n _getStacks(last, dataIndex) {\n const { iScale: iScale } = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const skipNull = (meta)=>{\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(val) || isNaN(val)) return true;\n };\n for (const meta of metasets){\n if (dataIndex !== undefined && skipNull(meta)) continue;\n if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === undefined && meta.stack === undefined) stacks.push(meta.stack);\n if (meta.index === last) break;\n }\n if (!stacks.length) stacks.push(undefined);\n return stacks;\n }\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = name !== undefined ? stacks.indexOf(name) : -1;\n return index === -1 ? stacks.length - 1 : index;\n }\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n for(i = 0, ilen = meta.data.length; i < ilen; ++i)pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n const barThickness = opts.barThickness;\n const min = barThickness || $dfc006ada1995968$var$computeMinSampleSize(meta);\n return {\n min: min,\n pixels: pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n _calculateBarValuePixels(index) {\n const { _cachedMeta: { vScale: vScale, _stacked: _stacked, index: datasetIndex }, options: { base: baseValue, minBarLength: minBarLength } } = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = $dfc006ada1995968$var$isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n if (length !== value) {\n start = length - value;\n length = value;\n }\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n if (value !== 0 && (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(value) !== (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(custom.barEnd)) start = 0;\n start += value;\n }\n const startValue = !(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n if (this.chart.getDataVisibility(index)) head = vScale.getPixelForValue(start + length);\n else head = base;\n size = head - base;\n if (Math.abs(size) < minBarLength) {\n size = $dfc006ada1995968$var$barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) base -= size / 2;\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n if (_stacked && !floating) parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n return {\n size: size,\n base: base,\n head: head,\n center: head + size / 2\n };\n }\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === \"flex\" ? $dfc006ada1995968$var$computeFlexCategoryTraits(index, ruler, options, stackCount) : $dfc006ada1995968$var$computeFitCategoryTraits(index, ruler, options, stackCount);\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + range.chunk * stackIndex + range.chunk / 2;\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n return {\n base: center - size / 2,\n head: center + size / 2,\n center: center,\n size: size\n };\n }\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n for(; i < ilen; ++i)if (this.getParsed(i)[vScale.axis] !== null) rects[i].draw(this._ctx);\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e97d5dc64e999004, \"id\", \"bar\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e97d5dc64e999004, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"bar\",\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"base\",\n \"width\",\n \"height\"\n ]\n }\n }\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e97d5dc64e999004, \"overrides\", {\n scales: {\n _index_: {\n type: \"category\",\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: \"linear\",\n beginAtZero: true\n }\n }\n});\nclass $dfc006ada1995968$export$19b5c4773f17abe extends $dfc006ada1995968$export$75572ec5c55b4048 {\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++)parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i)max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n return max > 0 && max;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale: xScale, yScale: yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n return {\n label: labels[index] || \"\",\n value: \"(\" + x + \", \" + y + (r ? \", \" + r : \"\") + \")\"\n };\n }\n update(mode) {\n const points = this._cachedMeta.data;\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === \"reset\";\n const { iScale: iScale, vScale: vScale } = this._cachedMeta;\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n if (reset) properties.options.radius = 0;\n }\n this.updateElement(point, i, properties, mode);\n }\n }\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n if (values.$shared) values = Object.assign({}, values, {\n $shared: false\n });\n const radius = values.radius;\n if (mode !== \"active\") values.radius = 0;\n values.radius += (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(parsed && parsed._custom, radius);\n return values;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$19b5c4773f17abe, \"id\", \"bubble\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$19b5c4773f17abe, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"point\",\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"borderWidth\",\n \"radius\"\n ]\n }\n }\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$19b5c4773f17abe, \"overrides\", {\n scales: {\n x: {\n type: \"linear\"\n },\n y: {\n type: \"linear\"\n }\n }\n});\nfunction $dfc006ada1995968$var$getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n if (circumference < (0, $c4d1694fa24f1a71$export$971d5caa766a69d7)) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b)=>(0, $c4d1694fa24f1a71$export$ffb5f4729a158638)(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b)=>(0, $c4d1694fa24f1a71$export$ffb5f4729a158638)(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax((0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd), startY, endY);\n const minX = calcMin((0, $c4d1694fa24f1a71$export$56c0d5a1e737357d), startX, endX);\n const minY = calcMin((0, $c4d1694fa24f1a71$export$56c0d5a1e737357d) + (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd), startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {\n ratioX: ratioX,\n ratioY: ratioY,\n offsetX: offsetX,\n offsetY: offsetY\n };\n}\nclass $dfc006ada1995968$export$e04603e7d8b77172 extends $dfc006ada1995968$export$75572ec5c55b4048 {\n linkScales() {}\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n if (this._parsing === false) meta._parsed = data;\n else {\n let getter = (i)=>+data[i];\n if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(data[start])) {\n const { key: key = \"value\" } = this._parsing;\n getter = (i)=>+(0, $c4d1694fa24f1a71$export$2d1720544b23b823)(data[i], key);\n }\n let i, ilen;\n for(i = start, ilen = start + count; i < ilen; ++i)meta._parsed[i] = getter(i);\n }\n }\n _getRotation() {\n return (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.options.rotation - 90);\n }\n _getCircumference() {\n return (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.options.circumference);\n }\n _getRotationExtents() {\n let min = (0, $c4d1694fa24f1a71$export$971d5caa766a69d7);\n let max = -(0, $c4d1694fa24f1a71$export$971d5caa766a69d7);\n for(let i = 0; i < this.chart.data.datasets.length; ++i)if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n return {\n rotation: min,\n circumference: max - min\n };\n }\n update(mode) {\n const chart = this.chart;\n const { chartArea: chartArea } = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min((0, $c4d1694fa24f1a71$export$953cecd6e717a553)(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n const { circumference: circumference, rotation: rotation } = this._getRotationExtents();\n const { ratioX: ratioX, ratioY: ratioY, offsetX: offsetX, offsetY: offsetY } = $dfc006ada1995968$var$getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = (0, $c4d1694fa24f1a71$export$7ccc53e8f1e7dfc5)(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n meta.total = this.calculateTotal();\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) return 0;\n return this.calculateCircumference(meta._parsed[i] * circumference / (0, $c4d1694fa24f1a71$export$971d5caa766a69d7));\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === \"reset\";\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n for(i = 0; i < start; ++i)startAngle += this._circumference(i, reset);\n for(i = start; i < start + count; ++i){\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle: startAngle,\n endAngle: startAngle + circumference,\n circumference: circumference,\n outerRadius: outerRadius,\n innerRadius: innerRadius\n };\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? \"active\" : mode);\n startAngle += circumference;\n this.updateElement(arc, i, properties, mode);\n }\n }\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n for(i = 0; i < metaData.length; i++){\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) total += Math.abs(value);\n }\n return total;\n }\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) return (0, $c4d1694fa24f1a71$export$971d5caa766a69d7) * (Math.abs(value) / total);\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = (0, $c4d1694fa24f1a71$export$ae1af26003f05816)(meta._parsed[index], chart.options.locale);\n return {\n label: labels[index] || \"\",\n value: value\n };\n }\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n if (!arcs) {\n for(i = 0, ilen = chart.data.datasets.length; i < ilen; ++i)if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n if (!arcs) return 0;\n for(i = 0, ilen = arcs.length; i < ilen; ++i){\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== \"inner\") max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n return max;\n }\n getMaxOffset(arcs) {\n let max = 0;\n for(let i = 0, ilen = arcs.length; i < ilen; ++i){\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n for(let i = 0; i < datasetIndex; ++i)if (this.chart.isDatasetVisible(i)) ringWeightOffset += this._getRingWeight(i);\n return ringWeightOffset;\n }\n _getRingWeight(datasetIndex) {\n return Math.max((0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e04603e7d8b77172, \"id\", \"doughnut\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e04603e7d8b77172, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"arc\",\n animation: {\n animateRotate: true,\n animateScale: false\n },\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"circumference\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\",\n \"startAngle\",\n \"x\",\n \"y\",\n \"offset\",\n \"borderWidth\",\n \"spacing\"\n ]\n }\n },\n cutout: \"50%\",\n rotation: 0,\n circumference: 360,\n radius: \"100%\",\n spacing: 0,\n indexAxis: \"r\"\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e04603e7d8b77172, \"descriptors\", {\n _scriptable: (name)=>name !== \"spacing\",\n _indexable: (name)=>name !== \"spacing\" && !name.startsWith(\"borderDash\") && !name.startsWith(\"hoverBorderDash\")\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e04603e7d8b77172, \"overrides\", {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle: pointStyle, color: color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n});\nclass $dfc006ada1995968$export$3c9b5d28c11cbfd0 extends $dfc006ada1995968$export$75572ec5c55b4048 {\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { dataset: line, data: points = [], _dataset: _dataset } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start: start, count: count } = (0, $c4d1694fa24f1a71$export$9e5f44173e64f162)(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if ((0, $c4d1694fa24f1a71$export$efccba1c4a2ef57b)(meta)) {\n start = 0;\n count = points.length;\n }\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) options.borderWidth = 0;\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options: options\n }, mode);\n this.updateElements(points, start, count, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === \"reset\";\n const { iScale: iScale, vScale: vScale, _stacked: _stacked, _dataset: _dataset } = this._cachedMeta;\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps: spanGaps, segment: segment } = this.options;\n const maxGapLength = (0, $c4d1694fa24f1a71$export$d141bba7fdc215a3)(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === \"none\";\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = 0; i < pointsCount; ++i){\n const point = points[i];\n const properties = directUpdate ? point : {};\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n const parsed = this.getParsed(i);\n const nullData = (0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n if (!directUpdate) this.updateElement(point, i, properties, mode);\n prevParsed = parsed;\n }\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) return border;\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$3c9b5d28c11cbfd0, \"id\", \"line\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$3c9b5d28c11cbfd0, \"defaults\", {\n datasetElementType: \"line\",\n dataElementType: \"point\",\n showLine: true,\n spanGaps: false\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$3c9b5d28c11cbfd0, \"overrides\", {\n scales: {\n _index_: {\n type: \"category\"\n },\n _value_: {\n type: \"linear\"\n }\n }\n});\nclass $dfc006ada1995968$export$2a270b3a0d973c85 extends $dfc006ada1995968$export$75572ec5c55b4048 {\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = (0, $c4d1694fa24f1a71$export$ae1af26003f05816)(meta._parsed[index].r, chart.options.locale);\n return {\n label: labels[index] || \"\",\n value: value\n };\n }\n parseObjectData(meta, data, start, count) {\n return (0, $c4d1694fa24f1a71$export$4a5767248b18ef41).bind(this)(meta, data, start, count);\n }\n update(mode) {\n const arcs = this._cachedMeta.data;\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n meta.data.forEach((element, index)=>{\n const parsed = this.getParsed(index).r;\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) range.min = parsed;\n if (parsed > range.max) range.max = parsed;\n }\n });\n return range;\n }\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n this.outerRadius = outerRadius - radiusLength * this.index;\n this.innerRadius = this.outerRadius - radiusLength;\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === \"reset\";\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * (0, $c4d1694fa24f1a71$export$56c0d5a1e737357d);\n let angle = datasetStartAngle;\n let i;\n const defaultAngle = 360 / this.countVisibleElements();\n for(i = 0; i < start; ++i)angle += this._computeAngle(i, mode, defaultAngle);\n for(i = start; i < start + count; i++){\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n if (reset) {\n if (animationOpts.animateScale) outerRadius = 0;\n if (animationOpts.animateRotate) startAngle = endAngle = datasetStartAngle;\n }\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius: outerRadius,\n startAngle: startAngle,\n endAngle: endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? \"active\" : mode)\n };\n this.updateElement(arc, i, properties, mode);\n }\n }\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n meta.data.forEach((element, index)=>{\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) count++;\n });\n return count;\n }\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index) ? (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.resolveDataElementOptions(index, mode).angle || defaultAngle) : 0;\n }\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$2a270b3a0d973c85, \"id\", \"polarArea\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$2a270b3a0d973c85, \"defaults\", {\n dataElementType: \"arc\",\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\"\n ]\n }\n },\n indexAxis: \"r\",\n startAngle: 0\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$2a270b3a0d973c85, \"overrides\", {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle: pointStyle, color: color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n scales: {\n r: {\n type: \"radialLinear\",\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n});\nclass $dfc006ada1995968$export$b21a3f1286706191 extends $dfc006ada1995968$export$e04603e7d8b77172 {\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$b21a3f1286706191, \"id\", \"pie\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$b21a3f1286706191, \"defaults\", {\n cutout: 0,\n rotation: 0,\n circumference: 360,\n radius: \"100%\"\n});\nclass $dfc006ada1995968$export$48dbc6ac651bf8be extends $dfc006ada1995968$export$75572ec5c55b4048 {\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: vScale.getLabels()[index],\n value: \"\" + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n parseObjectData(meta, data, start, count) {\n return (0, $c4d1694fa24f1a71$export$4a5767248b18ef41).bind(this)(meta, data, start, count);\n }\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n line.points = points;\n if (mode !== \"resize\") {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) options.borderWidth = 0;\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options: options\n };\n this.updateElement(line, undefined, properties, mode);\n }\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === \"reset\";\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n const properties = {\n x: x,\n y: y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options: options\n };\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$48dbc6ac651bf8be, \"id\", \"radar\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$48dbc6ac651bf8be, \"defaults\", {\n datasetElementType: \"line\",\n dataElementType: \"point\",\n indexAxis: \"r\",\n showLine: true,\n elements: {\n line: {\n fill: \"start\"\n }\n }\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$48dbc6ac651bf8be, \"overrides\", {\n aspectRatio: 1,\n scales: {\n r: {\n type: \"radialLinear\"\n }\n }\n});\nclass $dfc006ada1995968$export$b2f2bae6713db87 extends $dfc006ada1995968$export$75572ec5c55b4048 {\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale: xScale, yScale: yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n return {\n label: labels[index] || \"\",\n value: \"(\" + x + \", \" + y + \")\"\n };\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { data: points = [] } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start: start, count: count } = (0, $c4d1694fa24f1a71$export$9e5f44173e64f162)(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if ((0, $c4d1694fa24f1a71$export$efccba1c4a2ef57b)(meta)) {\n start = 0;\n count = points.length;\n }\n if (this.options.showLine) {\n if (!this.datasetElementType) this.addElements();\n const { dataset: line, _dataset: _dataset } = meta;\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options: options\n }, mode);\n } else if (this.datasetElementType) {\n delete meta.dataset;\n this.datasetElementType = false;\n }\n this.updateElements(points, start, count, mode);\n }\n addElements() {\n const { showLine: showLine } = this.options;\n if (!this.datasetElementType && showLine) this.datasetElementType = this.chart.registry.getElement(\"line\");\n super.addElements();\n }\n updateElements(points, start, count, mode) {\n const reset = mode === \"reset\";\n const { iScale: iScale, vScale: vScale, _stacked: _stacked, _dataset: _dataset } = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps: spanGaps, segment: segment } = this.options;\n const maxGapLength = (0, $c4d1694fa24f1a71$export$d141bba7fdc215a3)(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === \"none\";\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = start; i < start + count; ++i){\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = (0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n if (!directUpdate) this.updateElement(point, i, properties, mode);\n prevParsed = parsed;\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n if (!this.options.showLine) {\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i)max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n return max > 0 && max;\n }\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n if (!data.length) return border;\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$b2f2bae6713db87, \"id\", \"scatter\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$b2f2bae6713db87, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"point\",\n showLine: false,\n fill: false\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$b2f2bae6713db87, \"overrides\", {\n interaction: {\n mode: \"point\"\n },\n scales: {\n x: {\n type: \"linear\"\n },\n y: {\n type: \"linear\"\n }\n }\n});\nvar $dfc006ada1995968$export$a6506504f799c5d5 = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n BarController: $dfc006ada1995968$export$e97d5dc64e999004,\n BubbleController: $dfc006ada1995968$export$19b5c4773f17abe,\n DoughnutController: $dfc006ada1995968$export$e04603e7d8b77172,\n LineController: $dfc006ada1995968$export$3c9b5d28c11cbfd0,\n PieController: $dfc006ada1995968$export$b21a3f1286706191,\n PolarAreaController: $dfc006ada1995968$export$2a270b3a0d973c85,\n RadarController: $dfc006ada1995968$export$48dbc6ac651bf8be,\n ScatterController: $dfc006ada1995968$export$b2f2bae6713db87\n});\n/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */ function $dfc006ada1995968$var$abstract() {\n throw new Error(\"This method is not implemented: Check that a complete date adapter is provided.\");\n}\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */ class $dfc006ada1995968$var$DateAdapterBase {\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */ static override(members) {\n Object.assign($dfc006ada1995968$var$DateAdapterBase.prototype, members);\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n formats() {\n return $dfc006ada1995968$var$abstract();\n }\n parse() {\n return $dfc006ada1995968$var$abstract();\n }\n format() {\n return $dfc006ada1995968$var$abstract();\n }\n add() {\n return $dfc006ada1995968$var$abstract();\n }\n diff() {\n return $dfc006ada1995968$var$abstract();\n }\n startOf() {\n return $dfc006ada1995968$var$abstract();\n }\n endOf() {\n return $dfc006ada1995968$var$abstract();\n }\n constructor(options){\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"options\", void 0);\n this.options = options || {};\n }\n}\nvar $dfc006ada1995968$export$f32766ea09ec8bc4 = {\n _date: $dfc006ada1995968$var$DateAdapterBase\n};\nfunction $dfc006ada1995968$var$binarySearch(metaset, axis, value, intersect) {\n const { controller: controller, data: data, _sorted: _sorted } = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== \"r\" && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? (0, $c4d1694fa24f1a71$export$ebd11618f299a286) : (0, $c4d1694fa24f1a71$export$ef35774e6d314e91);\n if (!intersect) return lookupMethod(data, axis, value);\n else if (controller._sharedOptions) {\n const el = data[0];\n const range = typeof el.getRange === \"function\" && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {\n lo: start.lo,\n hi: end.hi\n };\n }\n }\n }\n return {\n lo: 0,\n hi: data.length - 1\n };\n}\nfunction $dfc006ada1995968$var$evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for(let i = 0, ilen = metasets.length; i < ilen; ++i){\n const { index: index, data: data } = metasets[i];\n const { lo: lo, hi: hi } = $dfc006ada1995968$var$binarySearch(metasets[i], axis, value, intersect);\n for(let j = lo; j <= hi; ++j){\n const element = data[j];\n if (!element.skip) handler(element, index, j);\n }\n }\n}\nfunction $dfc006ada1995968$var$getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf(\"x\") !== -1;\n const useY = axis.indexOf(\"y\") !== -1;\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\nfunction $dfc006ada1995968$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n if (!includeInvisible && !chart.isPointInArea(position)) return items;\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !(0, $c4d1694fa24f1a71$export$e7094788287c5e9b)(element, chart.chartArea, 0)) return;\n if (element.inRange(position.x, position.y, useFinalPosition)) items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n };\n $dfc006ada1995968$var$evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\nfunction $dfc006ada1995968$var$getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n function evaluationFunc(element, datasetIndex, index) {\n const { startAngle: startAngle, endAngle: endAngle } = element.getProps([\n \"startAngle\",\n \"endAngle\"\n ], useFinalPosition);\n const { angle: angle } = (0, $c4d1694fa24f1a71$export$96f57966bedc81b4)(element, {\n x: position.x,\n y: position.y\n });\n if ((0, $c4d1694fa24f1a71$export$ffb5f4729a158638)(angle, startAngle, endAngle)) items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n }\n $dfc006ada1995968$var$evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\nfunction $dfc006ada1995968$var$getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = $dfc006ada1995968$var$getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) return;\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) return;\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [\n {\n element: element,\n datasetIndex: datasetIndex,\n index: index\n }\n ];\n minDistance = distance;\n } else if (distance === minDistance) items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n }\n $dfc006ada1995968$var$evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\nfunction $dfc006ada1995968$var$getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) return [];\n return axis === \"r\" && !intersect ? $dfc006ada1995968$var$getNearestRadialItems(chart, position, axis, useFinalPosition) : $dfc006ada1995968$var$getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\nfunction $dfc006ada1995968$var$getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === \"x\" ? \"inXRange\" : \"inYRange\";\n let intersectsItem = false;\n $dfc006ada1995968$var$evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index)=>{\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n if (intersect && !intersectsItem) return [];\n return items;\n}\nvar $dfc006ada1995968$export$a13296960cae0384 = {\n evaluateInteractionItems: $dfc006ada1995968$var$evaluateInteractionItems,\n modes: {\n index (chart, e, options, useFinalPosition) {\n const position = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"x\";\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect ? $dfc006ada1995968$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : $dfc006ada1995968$var$getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n if (!items.length) return [];\n chart.getSortedVisibleDatasetMetas().forEach((meta)=>{\n const index = items[0].index;\n const element = meta.data[index];\n if (element && !element.skip) elements.push({\n element: element,\n datasetIndex: meta.index,\n index: index\n });\n });\n return elements;\n },\n dataset (chart, e, options, useFinalPosition) {\n const position = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"xy\";\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect ? $dfc006ada1995968$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : $dfc006ada1995968$var$getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for(let i = 0; i < data.length; ++i)items.push({\n element: data[i],\n datasetIndex: datasetIndex,\n index: i\n });\n }\n return items;\n },\n point (chart, e, options, useFinalPosition) {\n const position = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"xy\";\n const includeInvisible = options.includeInvisible || false;\n return $dfc006ada1995968$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n nearest (chart, e, options, useFinalPosition) {\n const position = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"xy\";\n const includeInvisible = options.includeInvisible || false;\n return $dfc006ada1995968$var$getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n x (chart, e, options, useFinalPosition) {\n const position = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(e, chart);\n return $dfc006ada1995968$var$getAxisItems(chart, position, \"x\", options.intersect, useFinalPosition);\n },\n y (chart, e, options, useFinalPosition) {\n const position = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(e, chart);\n return $dfc006ada1995968$var$getAxisItems(chart, position, \"y\", options.intersect, useFinalPosition);\n }\n }\n};\nconst $dfc006ada1995968$var$STATIC_POSITIONS = [\n \"left\",\n \"top\",\n \"right\",\n \"bottom\"\n];\nfunction $dfc006ada1995968$var$filterByPosition(array, position) {\n return array.filter((v)=>v.pos === position);\n}\nfunction $dfc006ada1995968$var$filterDynamicPositionByAxis(array, axis) {\n return array.filter((v)=>$dfc006ada1995968$var$STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction $dfc006ada1995968$var$sortByWeight(array, reverse) {\n return array.sort((a, b)=>{\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;\n });\n}\nfunction $dfc006ada1995968$var$wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n for(i = 0, ilen = (boxes || []).length; i < ilen; ++i){\n box = boxes[i];\n ({ position: pos, options: { stack: stack, stackWeight: stackWeight = 1 } } = box);\n layoutBoxes.push({\n index: i,\n box: box,\n pos: pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && pos + stack,\n stackWeight: stackWeight\n });\n }\n return layoutBoxes;\n}\nfunction $dfc006ada1995968$var$buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts){\n const { stack: stack, pos: pos, stackWeight: stackWeight } = wrap;\n if (!stack || !$dfc006ada1995968$var$STATIC_POSITIONS.includes(pos)) continue;\n const _stack = stacks[stack] || (stacks[stack] = {\n count: 0,\n placed: 0,\n weight: 0,\n size: 0\n });\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\nfunction $dfc006ada1995968$var$setLayoutDims(layouts, params) {\n const stacks = $dfc006ada1995968$var$buildStacks(layouts);\n const { vBoxMaxWidth: vBoxMaxWidth, hBoxMaxHeight: hBoxMaxHeight } = params;\n let i, ilen, layout;\n for(i = 0, ilen = layouts.length; i < ilen; ++i){\n layout = layouts[i];\n const { fullSize: fullSize } = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\nfunction $dfc006ada1995968$var$buildLayoutBoxes(boxes) {\n const layoutBoxes = $dfc006ada1995968$var$wrapBoxes(boxes);\n const fullSize = $dfc006ada1995968$var$sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize), true);\n const left = $dfc006ada1995968$var$sortByWeight($dfc006ada1995968$var$filterByPosition(layoutBoxes, \"left\"), true);\n const right = $dfc006ada1995968$var$sortByWeight($dfc006ada1995968$var$filterByPosition(layoutBoxes, \"right\"));\n const top = $dfc006ada1995968$var$sortByWeight($dfc006ada1995968$var$filterByPosition(layoutBoxes, \"top\"), true);\n const bottom = $dfc006ada1995968$var$sortByWeight($dfc006ada1995968$var$filterByPosition(layoutBoxes, \"bottom\"));\n const centerHorizontal = $dfc006ada1995968$var$filterDynamicPositionByAxis(layoutBoxes, \"x\");\n const centerVertical = $dfc006ada1995968$var$filterDynamicPositionByAxis(layoutBoxes, \"y\");\n return {\n fullSize: fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: $dfc006ada1995968$var$filterByPosition(layoutBoxes, \"chartArea\"),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\nfunction $dfc006ada1995968$var$getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction $dfc006ada1995968$var$updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction $dfc006ada1995968$var$updateDims(chartArea, params, layout, stacks) {\n const { pos: pos, box: box } = layout;\n const maxPadding = chartArea.maxPadding;\n if (!(0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(pos)) {\n if (layout.size) chartArea[pos] -= layout.size;\n const stack = stacks[layout.stack] || {\n size: 0,\n count: 1\n };\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n if (box.getPadding) $dfc006ada1995968$var$updateMaxPadding(maxPadding, box.getPadding());\n const newWidth = Math.max(0, params.outerWidth - $dfc006ada1995968$var$getCombinedMax(maxPadding, chartArea, \"left\", \"right\"));\n const newHeight = Math.max(0, params.outerHeight - $dfc006ada1995968$var$getCombinedMax(maxPadding, chartArea, \"top\", \"bottom\"));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n return layout.horizontal ? {\n same: widthChanged,\n other: heightChanged\n } : {\n same: heightChanged,\n other: widthChanged\n };\n}\nfunction $dfc006ada1995968$var$handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos(\"top\");\n chartArea.x += updatePos(\"left\");\n updatePos(\"right\");\n updatePos(\"bottom\");\n}\nfunction $dfc006ada1995968$var$getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n function marginForPositions(positions) {\n const margin = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n positions.forEach((pos)=>{\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n return horizontal ? marginForPositions([\n \"left\",\n \"right\"\n ]) : marginForPositions([\n \"top\",\n \"bottom\"\n ]);\n}\nfunction $dfc006ada1995968$var$fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n for(i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i){\n layout = boxes[i];\n box = layout.box;\n box.update(layout.width || chartArea.w, layout.height || chartArea.h, $dfc006ada1995968$var$getMargins(layout.horizontal, chartArea));\n const { same: same, other: other } = $dfc006ada1995968$var$updateDims(chartArea, params, layout, stacks);\n refit |= same && refitBoxes.length;\n changed = changed || other;\n if (!box.fullSize) refitBoxes.push(layout);\n }\n return refit && $dfc006ada1995968$var$fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction $dfc006ada1995968$var$setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\nfunction $dfc006ada1995968$var$placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let { x: x, y: y } = chartArea;\n for (const layout of boxes){\n const box = layout.box;\n const stack = stacks[layout.stack] || {\n count: 1,\n placed: 0,\n weight: 1\n };\n const weight = layout.stackWeight / stack.weight || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if ((0, $c4d1694fa24f1a71$export$dda1d9f60106f0e9)(stack.start)) y = stack.start;\n if (box.fullSize) $dfc006ada1995968$var$setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n else $dfc006ada1995968$var$setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if ((0, $c4d1694fa24f1a71$export$dda1d9f60106f0e9)(stack.start)) x = stack.start;\n if (box.fullSize) $dfc006ada1995968$var$setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n else $dfc006ada1995968$var$setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n chartArea.x = x;\n chartArea.y = y;\n}\nvar $dfc006ada1995968$export$1ecca0613f5e56d2 = {\n addBox (chart, item) {\n if (!chart.boxes) chart.boxes = [];\n item.fullSize = item.fullSize || false;\n item.position = item.position || \"top\";\n item.weight = item.weight || 0;\n item._layers = item._layers || function() {\n return [\n {\n z: 0,\n draw (chartArea) {\n item.draw(chartArea);\n }\n }\n ];\n };\n chart.boxes.push(item);\n },\n removeBox (chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) chart.boxes.splice(index, 1);\n },\n configure (chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n update (chart, width, height, minPadding) {\n if (!chart) return;\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = $dfc006ada1995968$var$buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(chart.boxes, (box)=>{\n if (typeof box.beforeLayout === \"function\") box.beforeLayout();\n });\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap)=>wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding: padding,\n availableWidth: availableWidth,\n availableHeight: availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n $dfc006ada1995968$var$updateMaxPadding(maxPadding, (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(minPadding));\n const chartArea = Object.assign({\n maxPadding: maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n const stacks = $dfc006ada1995968$var$setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n $dfc006ada1995968$var$fitBoxes(boxes.fullSize, chartArea, params, stacks);\n $dfc006ada1995968$var$fitBoxes(verticalBoxes, chartArea, params, stacks);\n if ($dfc006ada1995968$var$fitBoxes(horizontalBoxes, chartArea, params, stacks)) $dfc006ada1995968$var$fitBoxes(verticalBoxes, chartArea, params, stacks);\n $dfc006ada1995968$var$handleMaxPadding(chartArea);\n $dfc006ada1995968$var$placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n $dfc006ada1995968$var$placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w\n };\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(boxes.chartArea, (layout)=>{\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n });\n });\n }\n};\nclass $dfc006ada1995968$export$7b1aeb87f31f7da8 {\n acquireContext(canvas, aspectRatio) {}\n releaseContext(context) {\n return false;\n }\n addEventListener(chart, type, listener) {}\n removeEventListener(chart, type, listener) {}\n getDevicePixelRatio() {\n return 1;\n }\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width: width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n isAttached(canvas) {\n return true;\n }\n updateConfig(config) {}\n}\nclass $dfc006ada1995968$export$a40a96b24b46cf35 extends $dfc006ada1995968$export$7b1aeb87f31f7da8 {\n acquireContext(item) {\n return item && item.getContext && item.getContext(\"2d\") || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\nconst $dfc006ada1995968$var$EXPANDO_KEY = \"$chartjs\";\nconst $dfc006ada1995968$var$EVENT_TYPES = {\n touchstart: \"mousedown\",\n touchmove: \"mousemove\",\n touchend: \"mouseup\",\n pointerenter: \"mouseenter\",\n pointerdown: \"mousedown\",\n pointermove: \"mousemove\",\n pointerup: \"mouseup\",\n pointerleave: \"mouseout\",\n pointerout: \"mouseout\"\n};\nconst $dfc006ada1995968$var$isNullOrEmpty = (value)=>value === null || value === \"\";\nfunction $dfc006ada1995968$var$initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n const renderHeight = canvas.getAttribute(\"height\");\n const renderWidth = canvas.getAttribute(\"width\");\n canvas[$dfc006ada1995968$var$EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n style.display = style.display || \"block\";\n style.boxSizing = style.boxSizing || \"border-box\";\n if ($dfc006ada1995968$var$isNullOrEmpty(renderWidth)) {\n const displayWidth = (0, $c4d1694fa24f1a71$export$b4171a6734a65d42)(canvas, \"width\");\n if (displayWidth !== undefined) canvas.width = displayWidth;\n }\n if ($dfc006ada1995968$var$isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === \"\") canvas.height = canvas.width / (aspectRatio || 2);\n else {\n const displayHeight = (0, $c4d1694fa24f1a71$export$b4171a6734a65d42)(canvas, \"height\");\n if (displayHeight !== undefined) canvas.height = displayHeight;\n }\n }\n return canvas;\n}\nconst $dfc006ada1995968$var$eventListenerOptions = (0, $c4d1694fa24f1a71$export$3466f893ebf79586) ? {\n passive: true\n} : false;\nfunction $dfc006ada1995968$var$addListener(node, type, listener) {\n node.addEventListener(type, listener, $dfc006ada1995968$var$eventListenerOptions);\n}\nfunction $dfc006ada1995968$var$removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, $dfc006ada1995968$var$eventListenerOptions);\n}\nfunction $dfc006ada1995968$var$fromNativeEvent(event, chart) {\n const type = $dfc006ada1995968$var$EVENT_TYPES[event.type] || event.type;\n const { x: x, y: y } = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(event, chart);\n return {\n type: type,\n chart: chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null\n };\n}\nfunction $dfc006ada1995968$var$nodeListContains(nodeList, canvas) {\n for (const node of nodeList){\n if (node === canvas || node.contains(canvas)) return true;\n }\n}\nfunction $dfc006ada1995968$var$createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || $dfc006ada1995968$var$nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !$dfc006ada1995968$var$nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) listener();\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nfunction $dfc006ada1995968$var$createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || $dfc006ada1995968$var$nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !$dfc006ada1995968$var$nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) listener();\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nconst $dfc006ada1995968$var$drpListeningCharts = new Map();\nlet $dfc006ada1995968$var$oldDevicePixelRatio = 0;\nfunction $dfc006ada1995968$var$onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === $dfc006ada1995968$var$oldDevicePixelRatio) return;\n $dfc006ada1995968$var$oldDevicePixelRatio = dpr;\n $dfc006ada1995968$var$drpListeningCharts.forEach((resize, chart)=>{\n if (chart.currentDevicePixelRatio !== dpr) resize();\n });\n}\nfunction $dfc006ada1995968$var$listenDevicePixelRatioChanges(chart, resize) {\n if (!$dfc006ada1995968$var$drpListeningCharts.size) window.addEventListener(\"resize\", $dfc006ada1995968$var$onWindowResize);\n $dfc006ada1995968$var$drpListeningCharts.set(chart, resize);\n}\nfunction $dfc006ada1995968$var$unlistenDevicePixelRatioChanges(chart) {\n $dfc006ada1995968$var$drpListeningCharts.delete(chart);\n if (!$dfc006ada1995968$var$drpListeningCharts.size) window.removeEventListener(\"resize\", $dfc006ada1995968$var$onWindowResize);\n}\nfunction $dfc006ada1995968$var$createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && (0, $c4d1694fa24f1a71$export$9bb611d729802a56)(canvas);\n if (!container) return;\n const resize = (0, $c4d1694fa24f1a71$export$61196ced6d74a310)((width, height)=>{\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) listener();\n }, window);\n const observer = new ResizeObserver((entries)=>{\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n if (width === 0 && height === 0) return;\n resize(width, height);\n });\n observer.observe(container);\n $dfc006ada1995968$var$listenDevicePixelRatioChanges(chart, resize);\n return observer;\n}\nfunction $dfc006ada1995968$var$releaseObserver(chart, type, observer) {\n if (observer) observer.disconnect();\n if (type === \"resize\") $dfc006ada1995968$var$unlistenDevicePixelRatioChanges(chart);\n}\nfunction $dfc006ada1995968$var$createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = (0, $c4d1694fa24f1a71$export$61196ced6d74a310)((event)=>{\n if (chart.ctx !== null) listener($dfc006ada1995968$var$fromNativeEvent(event, chart));\n }, chart);\n $dfc006ada1995968$var$addListener(canvas, type, proxy);\n return proxy;\n}\nclass $dfc006ada1995968$export$f02da7f882cf6b2e extends $dfc006ada1995968$export$7b1aeb87f31f7da8 {\n acquireContext(canvas, aspectRatio) {\n const context = canvas && canvas.getContext && canvas.getContext(\"2d\");\n if (context && context.canvas === canvas) {\n $dfc006ada1995968$var$initCanvas(canvas, aspectRatio);\n return context;\n }\n return null;\n }\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[$dfc006ada1995968$var$EXPANDO_KEY]) return false;\n const initial = canvas[$dfc006ada1995968$var$EXPANDO_KEY].initial;\n [\n \"height\",\n \"width\"\n ].forEach((prop)=>{\n const value = initial[prop];\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(value)) canvas.removeAttribute(prop);\n else canvas.setAttribute(prop, value);\n });\n const style = initial.style || {};\n Object.keys(style).forEach((key)=>{\n canvas.style[key] = style[key];\n });\n canvas.width = canvas.width;\n delete canvas[$dfc006ada1995968$var$EXPANDO_KEY];\n return true;\n }\n addEventListener(chart, type, listener) {\n this.removeEventListener(chart, type);\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: $dfc006ada1995968$var$createAttachObserver,\n detach: $dfc006ada1995968$var$createDetachObserver,\n resize: $dfc006ada1995968$var$createResizeObserver\n };\n const handler = handlers[type] || $dfc006ada1995968$var$createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n if (!proxy) return;\n const handlers = {\n attach: $dfc006ada1995968$var$releaseObserver,\n detach: $dfc006ada1995968$var$releaseObserver,\n resize: $dfc006ada1995968$var$releaseObserver\n };\n const handler = handlers[type] || $dfc006ada1995968$var$removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n getMaximumSize(canvas, width, height, aspectRatio) {\n return (0, $c4d1694fa24f1a71$export$2329c99376c9d0a4)(canvas, width, height, aspectRatio);\n }\n isAttached(canvas) {\n const container = (0, $c4d1694fa24f1a71$export$9bb611d729802a56)(canvas);\n return !!(container && container.isConnected);\n }\n}\nfunction $dfc006ada1995968$export$72cd9e67b1b784f9(canvas) {\n if (!(0, $c4d1694fa24f1a71$export$3a1a48c8f6ef640e)() || typeof OffscreenCanvas !== \"undefined\" && canvas instanceof OffscreenCanvas) return $dfc006ada1995968$export$a40a96b24b46cf35;\n return $dfc006ada1995968$export$f02da7f882cf6b2e;\n}\nclass $dfc006ada1995968$export$db77ccec0bb4ccac {\n tooltipPosition(useFinalPosition) {\n const { x: x, y: y } = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n return {\n x: x,\n y: y\n };\n }\n hasValue() {\n return (0, $c4d1694fa24f1a71$export$d141bba7fdc215a3)(this.x) && (0, $c4d1694fa24f1a71$export$d141bba7fdc215a3)(this.y);\n }\n getProps(props, final) {\n const anims = this.$animations;\n if (!final || !anims) // let's not create an object, if not needed\n return this;\n const ret = {};\n props.forEach((prop)=>{\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n });\n return ret;\n }\n constructor(){\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"x\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"y\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"active\", false);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"options\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"$animations\", void 0);\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$db77ccec0bb4ccac, \"defaults\", {});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$db77ccec0bb4ccac, \"defaultRoutes\", undefined);\nfunction $dfc006ada1995968$var$autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = $dfc006ada1995968$var$determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? $dfc006ada1995968$var$getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n if (numMajorIndices > ticksLimit) {\n $dfc006ada1995968$var$skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n const spacing = $dfc006ada1995968$var$calculateSpacing(majorIndices, ticks, ticksLimit);\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n $dfc006ada1995968$var$skip(ticks, newTicks, spacing, (0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for(i = 0, ilen = numMajorIndices - 1; i < ilen; i++)$dfc006ada1995968$var$skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n $dfc006ada1995968$var$skip(ticks, newTicks, spacing, last, (0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n $dfc006ada1995968$var$skip(ticks, newTicks, spacing);\n return newTicks;\n}\nfunction $dfc006ada1995968$var$determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\nfunction $dfc006ada1995968$var$calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = $dfc006ada1995968$var$getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n if (!evenMajorSpacing) return Math.max(spacing, 1);\n const factors = (0, $c4d1694fa24f1a71$export$a07804094c3ecf2d)(evenMajorSpacing);\n for(let i = 0, ilen = factors.length - 1; i < ilen; i++){\n const factor = factors[i];\n if (factor > spacing) return factor;\n }\n return Math.max(spacing, 1);\n}\nfunction $dfc006ada1995968$var$getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++)if (ticks[i].major) result.push(i);\n return result;\n}\nfunction $dfc006ada1995968$var$skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n spacing = Math.ceil(spacing);\n for(i = 0; i < ticks.length; i++)if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n}\nfunction $dfc006ada1995968$var$skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(majorStart, 0);\n const end = Math.min((0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n next = start;\n while(next < 0){\n count++;\n next = Math.round(start + count * spacing);\n }\n for(i = Math.max(start, 0); i < end; i++)if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n}\nfunction $dfc006ada1995968$var$getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n if (len < 2) return false;\n for(diff = arr[0], i = 1; i < len; ++i){\n if (arr[i] - arr[i - 1] !== diff) return false;\n }\n return diff;\n}\nconst $dfc006ada1995968$var$reverseAlign = (align)=>align === \"left\" ? \"right\" : align === \"right\" ? \"left\" : align;\nconst $dfc006ada1995968$var$offsetFromEdge = (scale, edge, offset)=>edge === \"top\" || edge === \"left\" ? scale[edge] + offset : scale[edge] - offset;\nconst $dfc006ada1995968$var$getTicksLimit = (ticksLength, maxTicksLimit)=>Math.min(maxTicksLimit || ticksLength, ticksLength);\nfunction $dfc006ada1995968$var$sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n for(; i < len; i += increment)result.push(arr[Math.floor(i)]);\n return result;\n}\nfunction $dfc006ada1995968$var$getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6;\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n if (offsetGridLines) {\n if (length === 1) offset = Math.max(lineValue - start, end - lineValue);\n else if (index === 0) offset = (scale.getPixelForTick(1) - lineValue) / 2;\n else offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n lineValue += validIndex < index ? offset : -offset;\n if (lineValue < start - epsilon || lineValue > end + epsilon) return;\n }\n return lineValue;\n}\nfunction $dfc006ada1995968$var$garbageCollect(caches, length) {\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(caches, (cache)=>{\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for(i = 0; i < gcLen; ++i)delete cache.data[gc[i]];\n gc.splice(0, gcLen);\n }\n });\n}\nfunction $dfc006ada1995968$var$getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\nfunction $dfc006ada1995968$var$getTitleHeight(options, fallback) {\n if (!options.display) return 0;\n const font = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.font, fallback);\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(options.padding);\n const lines = (0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(options.text) ? options.text.length : 1;\n return lines * font.lineHeight + padding.height;\n}\nfunction $dfc006ada1995968$var$createScaleContext(parent, scale) {\n return (0, $c4d1694fa24f1a71$export$35e795649ee09318)(parent, {\n scale: scale,\n type: \"scale\"\n });\n}\nfunction $dfc006ada1995968$var$createTickContext(parent, index, tick) {\n return (0, $c4d1694fa24f1a71$export$35e795649ee09318)(parent, {\n tick: tick,\n index: index,\n type: \"tick\"\n });\n}\nfunction $dfc006ada1995968$var$titleAlign(align, position, reverse) {\n let ret = (0, $c4d1694fa24f1a71$export$3c2fa207a37baaea)(align);\n if (reverse && position !== \"right\" || !reverse && position === \"right\") ret = $dfc006ada1995968$var$reverseAlign(ret);\n return ret;\n}\nfunction $dfc006ada1995968$var$titleArgs(scale, offset, position, align) {\n const { top: top, left: left, bottom: bottom, right: right, chart: chart } = scale;\n const { chartArea: chartArea, scales: scales } = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n if (scale.isHorizontal()) {\n titleX = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, left, right);\n if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === \"center\") titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n else titleY = $dfc006ada1995968$var$offsetFromEdge(scale, position, offset);\n maxWidth = right - left;\n } else {\n if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === \"center\") titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n else titleX = $dfc006ada1995968$var$offsetFromEdge(scale, position, offset);\n titleY = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, bottom, top);\n rotation = position === \"left\" ? -(0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd) : (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd);\n }\n return {\n titleX: titleX,\n titleY: titleY,\n maxWidth: maxWidth,\n rotation: rotation\n };\n}\nclass $dfc006ada1995968$export$d60cfc58d3c358b6 extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n init(options) {\n this.options = options.setContext(this.getContext());\n this.axis = options.axis;\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n parse(raw, index) {\n return raw;\n }\n getUserBounds() {\n let { _userMin: _userMin, _userMax: _userMax, _suggestedMin: _suggestedMin, _suggestedMax: _suggestedMax } = this;\n _userMin = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(_userMin, Number.POSITIVE_INFINITY);\n _userMax = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(_userMin, _suggestedMin),\n max: (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(_userMax, _suggestedMax),\n minDefined: (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(_userMin),\n maxDefined: (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(_userMax)\n };\n }\n getMinMax(canStack) {\n let { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let range;\n if (minDefined && maxDefined) return {\n min: min,\n max: max\n };\n const metas = this.getMatchingVisibleMetas();\n for(let i = 0, ilen = metas.length; i < ilen; ++i){\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) min = Math.min(min, range.min);\n if (!maxDefined) max = Math.max(max, range.max);\n }\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n return {\n min: (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(min, (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(max, min)),\n max: (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(max, (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(min, max))\n };\n }\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n getTicks() {\n return this.ticks;\n }\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n beforeUpdate() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.beforeUpdate, [\n this\n ]);\n }\n update(maxWidth, maxHeight, margins) {\n const { beginAtZero: beginAtZero, grace: grace, ticks: tickOpts } = this.options;\n const sampleSize = tickOpts.sampleSize;\n this.beforeUpdate();\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = (0, $c4d1694fa24f1a71$export$db202ddc8be9136)(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n this.beforeBuildTicks();\n this.ticks = this.buildTicks() || [];\n this.afterBuildTicks();\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? $dfc006ada1995968$var$sample(this.ticks, sampleSize) : this.ticks);\n this.configure();\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation();\n this.afterCalculateLabelRotation();\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === \"auto\")) {\n this.ticks = $dfc006ada1995968$var$autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n if (samplingEnabled) this._convertTicksToLabels(this.ticks);\n this.beforeFit();\n this.fit();\n this.afterFit();\n this.afterUpdate();\n }\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n afterUpdate() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.afterUpdate, [\n this\n ]);\n }\n beforeSetDimensions() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.beforeSetDimensions, [\n this\n ]);\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = 0;\n this.bottom = this.height;\n }\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.afterSetDimensions, [\n this\n ]);\n }\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options[name], [\n this\n ]);\n }\n beforeDataLimits() {\n this._callHooks(\"beforeDataLimits\");\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks(\"afterDataLimits\");\n }\n beforeBuildTicks() {\n this._callHooks(\"beforeBuildTicks\");\n }\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks(\"afterBuildTicks\");\n }\n beforeTickToLabelConversion() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.beforeTickToLabelConversion, [\n this\n ]);\n }\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n tick = ticks[i];\n tick.label = (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(tickOpts.callback, [\n tick.value,\n i,\n ticks\n ], this);\n }\n }\n afterTickToLabelConversion() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.afterTickToLabelConversion, [\n this\n ]);\n }\n beforeCalculateLabelRotation() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.beforeCalculateLabelRotation, [\n this\n ]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = $dfc006ada1995968$var$getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n const maxWidth = (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - $dfc006ada1995968$var$getTickMarkLength(options.grid) - tickOpts.padding - $dfc006ada1995968$var$getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = (0, $c4d1694fa24f1a71$export$3a6d5c9ae78a2c08)(Math.min(Math.asin((0, $c4d1694fa24f1a71$export$25ce5a424b770e84)((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin((0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin((0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(maxLabelHeight / maxLabelDiagonal, -1, 1))));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.afterCalculateLabelRotation, [\n this\n ]);\n }\n afterAutoSkip() {}\n beforeFit() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.beforeFit, [\n this\n ]);\n }\n fit() {\n const minSize = {\n width: 0,\n height: 0\n };\n const { chart: chart, options: { ticks: tickOpts, title: titleOpts, grid: gridOpts } } = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n if (display) {\n const titleHeight = $dfc006ada1995968$var$getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = $dfc006ada1995968$var$getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight;\n minSize.width = $dfc006ada1995968$var$getTickMarkLength(gridOpts) + titleHeight;\n }\n if (tickOpts.display && this.ticks.length) {\n const { first: first, last: last, widest: widest, highest: highest } = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n if (isHorizontal) {\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n this._handleMargins();\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n _calculatePadding(first, last, sin, cos) {\n const { ticks: { align: align, padding: padding }, position: position } = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== \"top\" && this.axis === \"x\";\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === \"start\") paddingRight = last.width;\n else if (align === \"end\") paddingLeft = first.width;\n else if (align !== \"inner\") {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n if (align === \"start\") {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === \"end\") {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n afterFit() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.afterFit, [\n this\n ]);\n }\n isHorizontal() {\n const { axis: axis, position: position } = this.options;\n return position === \"top\" || position === \"bottom\" || axis === \"x\";\n }\n isFullSize() {\n return this.options.fullSize;\n }\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n this.generateTickLabels(ticks);\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++)if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n this.afterTickToLabelConversion();\n }\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) ticks = $dfc006ada1995968$var$sample(ticks, sampleSize);\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n return labelSizes;\n }\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const { ctx: ctx, _longestTextCache: caches } = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / $dfc006ada1995968$var$getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n for(i = 0; i < length; i += increment){\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {\n data: {},\n gc: []\n };\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(label) && !(0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(label)) {\n width = (0, $c4d1694fa24f1a71$export$e7c866399fa523f5)(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(label)) for(j = 0, jlen = label.length; j < jlen; ++j){\n nestedLabel = label[j];\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(nestedLabel) && !(0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(nestedLabel)) {\n width = (0, $c4d1694fa24f1a71$export$e7c866399fa523f5)(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n $dfc006ada1995968$var$garbageCollect(caches, length);\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n const valueAt = (idx)=>({\n width: widths[idx] || 0,\n height: heights[idx] || 0\n });\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths: widths,\n heights: heights\n };\n }\n getLabelForValue(value) {\n return value;\n }\n getPixelForValue(value, index) {\n return NaN;\n }\n getValueForPixel(pixel) {}\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) return null;\n return this.getPixelForValue(ticks[index].value);\n }\n getPixelForDecimal(decimal) {\n if (this._reversePixels) decimal = 1 - decimal;\n const pixel = this._startPixel + decimal * this._length;\n return (0, $c4d1694fa24f1a71$export$71cec2538cb2c617)(this._alignToPixels ? (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(this.chart, pixel, 0) : pixel);\n }\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n getBaseValue() {\n const { min: min, max: max } = this;\n return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0;\n }\n getContext(index) {\n const ticks = this.ticks || [];\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context || (tick.$context = $dfc006ada1995968$var$createTickContext(this.getContext(), index, tick));\n }\n return this.$context || (this.$context = $dfc006ada1995968$var$createScaleContext(this.chart.getContext(), this));\n }\n _tickSize() {\n const optionTicks = this.options.ticks;\n const rot = (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin;\n }\n _isVisible() {\n const display = this.options.display;\n if (display !== \"auto\") return !!display;\n return this.getMatchingVisibleMetas().length > 0;\n }\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const { grid: grid, position: position, border: border } = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = $dfc006ada1995968$var$getTickMarkLength(grid);\n const items = [];\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n if (position === \"top\") {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === \"bottom\") {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === \"left\") {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === \"right\") {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === \"x\") {\n if (position === \"center\") borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === \"y\") {\n if (position === \"center\") borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n const limit = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for(i = 0; i < ticksLength; i += step){\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n lineValue = $dfc006ada1995968$var$getPixelForGridLine(this, i, offset);\n if (lineValue === undefined) continue;\n alignedLineValue = (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(chart, lineValue, lineWidth);\n if (isHorizontal) tx1 = tx2 = x1 = x2 = alignedLineValue;\n else ty1 = ty2 = y1 = y2 = alignedLineValue;\n items.push({\n tx1: tx1,\n ty1: ty1,\n tx2: tx2,\n ty2: ty2,\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n width: lineWidth,\n color: lineColor,\n borderDash: borderDash,\n borderDashOffset: borderDashOffset,\n tickWidth: tickWidth,\n tickColor: tickColor,\n tickBorderDash: tickBorderDash,\n tickBorderDashOffset: tickBorderDashOffset\n });\n }\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n return items;\n }\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const { position: position, ticks: optionTicks } = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const { align: align, crossAlign: crossAlign, padding: padding, mirror: mirror } = optionTicks;\n const tl = $dfc006ada1995968$var$getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -(0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = \"middle\";\n if (position === \"top\") {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === \"bottom\") {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === \"left\") {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === \"right\") {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === \"x\") {\n if (position === \"center\") y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === \"y\") {\n if (position === \"center\") x = (chartArea.left + chartArea.right) / 2 - tickAndPadding;\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n if (axis === \"y\") {\n if (align === \"start\") textBaseline = \"top\";\n else if (align === \"end\") textBaseline = \"bottom\";\n }\n const labelSizes = this._getLabelSizes();\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n label = tick.label;\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = (0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n if (isHorizontal) {\n x = pixel;\n if (textAlign === \"inner\") {\n if (i === ilen - 1) tickTextAlign = !this.options.reverse ? \"right\" : \"left\";\n else if (i === 0) tickTextAlign = !this.options.reverse ? \"left\" : \"right\";\n else tickTextAlign = \"center\";\n }\n if (position === \"top\") {\n if (crossAlign === \"near\" || rotation !== 0) textOffset = -lineCount * lineHeight + lineHeight / 2;\n else if (crossAlign === \"center\") textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n else textOffset = -labelSizes.highest.height + lineHeight / 2;\n } else {\n if (crossAlign === \"near\" || rotation !== 0) textOffset = lineHeight / 2;\n else if (crossAlign === \"center\") textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n else textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n if (mirror) textOffset *= -1;\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) x += lineHeight / 2 * Math.sin(rotation);\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n let backdrop;\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n switch(textBaseline){\n case \"middle\":\n top -= height / 2;\n break;\n case \"bottom\":\n top -= height;\n break;\n }\n switch(textAlign){\n case \"center\":\n left -= width / 2;\n break;\n case \"right\":\n left -= width;\n break;\n }\n backdrop = {\n left: left,\n top: top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n color: optsAtIndex.backdropColor\n };\n }\n items.push({\n label: label,\n font: font,\n textOffset: textOffset,\n options: {\n rotation: rotation,\n color: color,\n strokeColor: strokeColor,\n strokeWidth: strokeWidth,\n textAlign: tickTextAlign,\n textBaseline: textBaseline,\n translation: [\n x,\n y\n ],\n backdrop: backdrop\n }\n });\n }\n return items;\n }\n _getXAxisLabelAlignment() {\n const { position: position, ticks: ticks } = this.options;\n const rotation = -(0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.labelRotation);\n if (rotation) return position === \"top\" ? \"left\" : \"right\";\n let align = \"center\";\n if (ticks.align === \"start\") align = \"left\";\n else if (ticks.align === \"end\") align = \"right\";\n else if (ticks.align === \"inner\") align = \"inner\";\n return align;\n }\n _getYAxisLabelAlignment(tl) {\n const { position: position, ticks: { crossAlign: crossAlign, mirror: mirror, padding: padding } } = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n let textAlign;\n let x;\n if (position === \"left\") {\n if (mirror) {\n x = this.right + padding;\n if (crossAlign === \"near\") textAlign = \"left\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x += widest / 2;\n } else {\n textAlign = \"right\";\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n if (crossAlign === \"near\") textAlign = \"right\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x -= widest / 2;\n } else {\n textAlign = \"left\";\n x = this.left;\n }\n }\n } else if (position === \"right\") {\n if (mirror) {\n x = this.left + padding;\n if (crossAlign === \"near\") textAlign = \"right\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x -= widest / 2;\n } else {\n textAlign = \"left\";\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n if (crossAlign === \"near\") textAlign = \"left\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x += widest / 2;\n } else {\n textAlign = \"right\";\n x = this.right;\n }\n }\n } else textAlign = \"right\";\n return {\n textAlign: textAlign,\n x: x\n };\n }\n _computeLabelArea() {\n if (this.options.ticks.mirror) return;\n const chart = this.chart;\n const position = this.options.position;\n if (position === \"left\" || position === \"right\") return {\n top: 0,\n left: this.left,\n bottom: chart.height,\n right: this.right\n };\n if (position === \"top\" || position === \"bottom\") return {\n top: this.top,\n left: 0,\n bottom: this.bottom,\n right: chart.width\n };\n }\n drawBackground() {\n const { ctx: ctx, options: { backgroundColor: backgroundColor }, left: left, top: top, width: width, height: height } = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) return 0;\n const ticks = this.ticks;\n const index = ticks.findIndex((t)=>t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n const drawLine = (p1, p2, style)=>{\n if (!style.width || !style.color) return;\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n if (grid.display) for(i = 0, ilen = items.length; i < ilen; ++i){\n const item = items[i];\n if (grid.drawOnChartArea) drawLine({\n x: item.x1,\n y: item.y1\n }, {\n x: item.x2,\n y: item.y2\n }, item);\n if (grid.drawTicks) drawLine({\n x: item.tx1,\n y: item.ty1\n }, {\n x: item.tx2,\n y: item.ty2\n }, {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n });\n }\n }\n drawBorder() {\n const { chart: chart, ctx: ctx, options: { border: border, grid: grid } } = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) return;\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n if (this.isHorizontal()) {\n x1 = (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.restore();\n }\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n if (!optionTicks.display) return;\n const ctx = this.ctx;\n const area = this._computeLabelArea();\n if (area) (0, $c4d1694fa24f1a71$export$8743009a87fcb00f)(ctx, area);\n const items = this.getLabelItems(chartArea);\n for (const item of items){\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n if (area) (0, $c4d1694fa24f1a71$export$3d8c2f653ac9d0b9)(ctx);\n }\n drawTitle() {\n const { ctx: ctx, options: { position: position, title: title, reverse: reverse } } = this;\n if (!title.display) return;\n const font = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(title.font);\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n if (position === \"bottom\" || position === \"center\" || (0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n offset += padding.bottom;\n if ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(title.text)) offset += font.lineHeight * (title.text.length - 1);\n } else offset += padding.top;\n const { titleX: titleX, titleY: titleY, maxWidth: maxWidth, rotation: rotation } = $dfc006ada1995968$var$titleArgs(this, offset, position, align);\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth: maxWidth,\n rotation: rotation,\n textAlign: $dfc006ada1995968$var$titleAlign(align, position, reverse),\n textBaseline: \"middle\",\n translation: [\n titleX,\n titleY\n ]\n });\n }\n draw(chartArea) {\n if (!this._isVisible()) return;\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(opts.grid && opts.grid.z, -1);\n const bz = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(opts.border && opts.border.z, 0);\n if (!this._isVisible() || this.draw !== $dfc006ada1995968$export$d60cfc58d3c358b6.prototype.draw) return [\n {\n z: tz,\n draw: (chartArea)=>{\n this.draw(chartArea);\n }\n }\n ];\n return [\n {\n z: gz,\n draw: (chartArea)=>{\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n },\n {\n z: bz,\n draw: ()=>{\n this.drawBorder();\n }\n },\n {\n z: tz,\n draw: (chartArea)=>{\n this.drawLabels(chartArea);\n }\n }\n ];\n }\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + \"AxisID\";\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) result.push(meta);\n }\n return result;\n }\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return (0, $c4d1694fa24f1a71$export$34aec0b863436764)(opts.font);\n }\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n constructor(cfg){\n super();\n this.id = cfg.id;\n this.type = cfg.type;\n this.options = undefined;\n this.ctx = cfg.ctx;\n this.chart = cfg.chart;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.paddingTop = undefined;\n this.paddingBottom = undefined;\n this.paddingLeft = undefined;\n this.paddingRight = undefined;\n this.axis = undefined;\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n this.ticks = [];\n this._gridLineItems = null;\n this._labelItems = null;\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n this._startPixel = undefined;\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n}\nclass $dfc006ada1995968$var$TypedRegistry {\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n if ($dfc006ada1995968$var$isIChartComponent(proto)) parentScope = this.register(proto);\n const items = this.items;\n const id = item.id;\n const scope = this.scope + \".\" + id;\n if (!id) throw new Error(\"class does not have id: \" + item);\n if (id in items) return scope;\n items[id] = item;\n $dfc006ada1995968$var$registerDefaults(item, scope, parentScope);\n if (this.override) (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).override(item.id, item.overrides);\n return scope;\n }\n get(id) {\n return this.items[id];\n }\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n if (id in items) delete items[id];\n if (scope && id in (0, $c4d1694fa24f1a71$export$4368d992c4eafac0)[scope]) {\n delete (0, $c4d1694fa24f1a71$export$4368d992c4eafac0)[scope][id];\n if (this.override) delete (0, $c4d1694fa24f1a71$export$6559d589eb85fbb6)[id];\n }\n }\n constructor(type, scope, override){\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n}\nfunction $dfc006ada1995968$var$registerDefaults(item, scope, parentScope) {\n const itemDefaults = (0, $c4d1694fa24f1a71$export$efca4cbe5dd06740)(Object.create(null), [\n parentScope ? (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).get(parentScope) : {},\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).get(scope),\n item.defaults\n ]);\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).set(scope, itemDefaults);\n if (item.defaultRoutes) $dfc006ada1995968$var$routeDefaults(scope, item.defaultRoutes);\n if (item.descriptors) (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).describe(scope, item.descriptors);\n}\nfunction $dfc006ada1995968$var$routeDefaults(scope, routes) {\n Object.keys(routes).forEach((property)=>{\n const propertyParts = property.split(\".\");\n const sourceName = propertyParts.pop();\n const sourceScope = [\n scope\n ].concat(propertyParts).join(\".\");\n const parts = routes[property].split(\".\");\n const targetName = parts.pop();\n const targetScope = parts.join(\".\");\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).route(sourceScope, sourceName, targetScope, targetName);\n });\n}\nfunction $dfc006ada1995968$var$isIChartComponent(proto) {\n return \"id\" in proto && \"defaults\" in proto;\n}\nclass $dfc006ada1995968$var$Registry {\n add(...args) {\n this._each(\"register\", args);\n }\n remove(...args) {\n this._each(\"unregister\", args);\n }\n addControllers(...args) {\n this._each(\"register\", args, this.controllers);\n }\n addElements(...args) {\n this._each(\"register\", args, this.elements);\n }\n addPlugins(...args) {\n this._each(\"register\", args, this.plugins);\n }\n addScales(...args) {\n this._each(\"register\", args, this.scales);\n }\n getController(id) {\n return this._get(id, this.controllers, \"controller\");\n }\n getElement(id) {\n return this._get(id, this.elements, \"element\");\n }\n getPlugin(id) {\n return this._get(id, this.plugins, \"plugin\");\n }\n getScale(id) {\n return this._get(id, this.scales, \"scale\");\n }\n removeControllers(...args) {\n this._each(\"unregister\", args, this.controllers);\n }\n removeElements(...args) {\n this._each(\"unregister\", args, this.elements);\n }\n removePlugins(...args) {\n this._each(\"unregister\", args, this.plugins);\n }\n removeScales(...args) {\n this._each(\"unregister\", args, this.scales);\n }\n _each(method, args, typedRegistry) {\n [\n ...args\n ].forEach((arg)=>{\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) this._exec(method, reg, arg);\n else (0, $c4d1694fa24f1a71$export$d66501df72047452)(arg, (item)=>{\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n });\n }\n _exec(method, registry, component) {\n const camelMethod = (0, $c4d1694fa24f1a71$export$a8550f7dbe79f93a)(method);\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(component[\"before\" + camelMethod], [], component);\n registry[method](component);\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(component[\"after\" + camelMethod], [], component);\n }\n _getRegistryForType(type) {\n for(let i = 0; i < this._typedRegistries.length; i++){\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) return reg;\n }\n return this.plugins;\n }\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) throw new Error('\"' + id + '\" is not a registered ' + type + \".\");\n return item;\n }\n constructor(){\n this.controllers = new $dfc006ada1995968$var$TypedRegistry($dfc006ada1995968$export$75572ec5c55b4048, \"datasets\", true);\n this.elements = new $dfc006ada1995968$var$TypedRegistry($dfc006ada1995968$export$db77ccec0bb4ccac, \"elements\");\n this.plugins = new $dfc006ada1995968$var$TypedRegistry(Object, \"plugins\");\n this.scales = new $dfc006ada1995968$var$TypedRegistry($dfc006ada1995968$export$d60cfc58d3c358b6, \"scales\");\n this._typedRegistries = [\n this.controllers,\n this.scales,\n this.elements\n ];\n }\n}\nvar $dfc006ada1995968$export$4bb7493d241fd8a5 = /* #__PURE__ */ new $dfc006ada1995968$var$Registry();\nclass $dfc006ada1995968$var$PluginService {\n notify(chart, hook, args, filter) {\n if (hook === \"beforeInit\") {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, \"install\");\n }\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n if (hook === \"afterDestroy\") {\n this._notify(descriptors, chart, \"stop\");\n this._notify(this._init, chart, \"uninstall\");\n }\n return result;\n }\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors){\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [\n chart,\n args,\n descriptor.options\n ];\n if ((0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(method, params, plugin) === false && args.cancelable) return false;\n }\n return true;\n }\n invalidate() {\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n _descriptors(chart) {\n if (this._cache) return this._cache;\n const descriptors = this._cache = this._createDescriptors(chart);\n this._notifyStateChanges(chart);\n return descriptors;\n }\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(config.options && config.options.plugins, {});\n const plugins = $dfc006ada1995968$var$allPlugins(config);\n return options === false && !all ? [] : $dfc006ada1995968$var$createDescriptors(chart, plugins, options, all);\n }\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, \"stop\");\n this._notify(diff(descriptors, previousDescriptors), chart, \"start\");\n }\n constructor(){\n this._init = [];\n }\n}\nfunction $dfc006ada1995968$var$allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys($dfc006ada1995968$export$4bb7493d241fd8a5.plugins.items);\n for(let i = 0; i < keys.length; i++)plugins.push($dfc006ada1995968$export$4bb7493d241fd8a5.getPlugin(keys[i]));\n const local = config.plugins || [];\n for(let i = 0; i < local.length; i++){\n const plugin = local[i];\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n return {\n plugins: plugins,\n localIds: localIds\n };\n}\nfunction $dfc006ada1995968$var$getOpts(options, all) {\n if (!all && options === false) return null;\n if (options === true) return {};\n return options;\n}\nfunction $dfc006ada1995968$var$createDescriptors(chart, { plugins: plugins, localIds: localIds }, options, all) {\n const result = [];\n const context = chart.getContext();\n for (const plugin of plugins){\n const id = plugin.id;\n const opts = $dfc006ada1995968$var$getOpts(options[id], all);\n if (opts === null) continue;\n result.push({\n plugin: plugin,\n options: $dfc006ada1995968$var$pluginOpts(chart.config, {\n plugin: plugin,\n local: localIds[id]\n }, opts, context)\n });\n }\n return result;\n}\nfunction $dfc006ada1995968$var$pluginOpts(config, { plugin: plugin, local: local }, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) scopes.push(plugin.defaults);\n return config.createResolver(scopes, context, [\n \"\"\n ], {\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\nfunction $dfc006ada1995968$var$getIndexAxis(type, options) {\n const datasetDefaults = (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || \"x\";\n}\nfunction $dfc006ada1995968$var$getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === \"_index_\") axis = indexAxis;\n else if (id === \"_value_\") axis = indexAxis === \"x\" ? \"y\" : \"x\";\n return axis;\n}\nfunction $dfc006ada1995968$var$getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? \"_index_\" : \"_value_\";\n}\nfunction $dfc006ada1995968$var$idMatchesAxis(id) {\n if (id === \"x\" || id === \"y\" || id === \"r\") return id;\n}\nfunction $dfc006ada1995968$var$axisFromPosition(position) {\n if (position === \"top\" || position === \"bottom\") return \"x\";\n if (position === \"left\" || position === \"right\") return \"y\";\n}\nfunction $dfc006ada1995968$var$determineAxis(id, ...scaleOptions) {\n if ($dfc006ada1995968$var$idMatchesAxis(id)) return id;\n for (const opts of scaleOptions){\n const axis = opts.axis || $dfc006ada1995968$var$axisFromPosition(opts.position) || id.length > 1 && $dfc006ada1995968$var$idMatchesAxis(id[0].toLowerCase());\n if (axis) return axis;\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\nfunction $dfc006ada1995968$var$getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + \"AxisID\"] === id) return {\n axis: axis\n };\n}\nfunction $dfc006ada1995968$var$retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d)=>d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) return $dfc006ada1995968$var$getAxisFromDataset(id, \"x\", boundDs[0]) || $dfc006ada1995968$var$getAxisFromDataset(id, \"y\", boundDs[0]);\n }\n return {};\n}\nfunction $dfc006ada1995968$var$mergeScaleConfig(config, options) {\n const chartDefaults = (0, $c4d1694fa24f1a71$export$6559d589eb85fbb6)[config.type] || {\n scales: {}\n };\n const configScales = options.scales || {};\n const chartIndexAxis = $dfc006ada1995968$var$getIndexAxis(config.type, options);\n const scales = Object.create(null);\n Object.keys(configScales).forEach((id)=>{\n const scaleConf = configScales[id];\n if (!(0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(scaleConf)) return console.error(`Invalid scale configuration for scale: ${id}`);\n if (scaleConf._proxy) return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n const axis = $dfc006ada1995968$var$determineAxis(id, scaleConf, $dfc006ada1995968$var$retrieveAxisFromDatasets(id, config), (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).scales[scaleConf.type]);\n const defaultId = $dfc006ada1995968$var$getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = (0, $c4d1694fa24f1a71$export$555508cbc6add439)(Object.create(null), [\n {\n axis: axis\n },\n scaleConf,\n defaultScaleOptions[axis],\n defaultScaleOptions[defaultId]\n ]);\n });\n config.data.datasets.forEach((dataset)=>{\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || $dfc006ada1995968$var$getIndexAxis(type, options);\n const datasetDefaults = (0, $c4d1694fa24f1a71$export$6559d589eb85fbb6)[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach((defaultID)=>{\n const axis = $dfc006ada1995968$var$getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + \"AxisID\"] || axis;\n scales[id] = scales[id] || Object.create(null);\n (0, $c4d1694fa24f1a71$export$555508cbc6add439)(scales[id], [\n {\n axis: axis\n },\n configScales[id],\n defaultScaleOptions[defaultID]\n ]);\n });\n });\n Object.keys(scales).forEach((key)=>{\n const scale = scales[key];\n (0, $c4d1694fa24f1a71$export$555508cbc6add439)(scale, [\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).scales[scale.type],\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).scale\n ]);\n });\n return scales;\n}\nfunction $dfc006ada1995968$var$initOptions(config) {\n const options = config.options || (config.options = {});\n options.plugins = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(options.plugins, {});\n options.scales = $dfc006ada1995968$var$mergeScaleConfig(config, options);\n}\nfunction $dfc006ada1995968$var$initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\nfunction $dfc006ada1995968$var$initConfig(config) {\n config = config || {};\n config.data = $dfc006ada1995968$var$initData(config.data);\n $dfc006ada1995968$var$initOptions(config);\n return config;\n}\nconst $dfc006ada1995968$var$keyCache = new Map();\nconst $dfc006ada1995968$var$keysCached = new Set();\nfunction $dfc006ada1995968$var$cachedKeys(cacheKey, generate) {\n let keys = $dfc006ada1995968$var$keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n $dfc006ada1995968$var$keyCache.set(cacheKey, keys);\n $dfc006ada1995968$var$keysCached.add(keys);\n }\n return keys;\n}\nconst $dfc006ada1995968$var$addIfFound = (set, obj, key)=>{\n const opts = (0, $c4d1694fa24f1a71$export$2d1720544b23b823)(obj, key);\n if (opts !== undefined) set.add(opts);\n};\nclass $dfc006ada1995968$var$Config {\n get platform() {\n return this._config.platform;\n }\n get type() {\n return this._config.type;\n }\n set type(type) {\n this._config.type = type;\n }\n get data() {\n return this._config.data;\n }\n set data(data) {\n this._config.data = $dfc006ada1995968$var$initData(data);\n }\n get options() {\n return this._config.options;\n }\n set options(options) {\n this._config.options = options;\n }\n get plugins() {\n return this._config.plugins;\n }\n update() {\n const config = this._config;\n this.clearCache();\n $dfc006ada1995968$var$initOptions(config);\n }\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n datasetScopeKeys(datasetType) {\n return $dfc006ada1995968$var$cachedKeys(datasetType, ()=>[\n [\n `datasets.${datasetType}`,\n \"\"\n ]\n ]);\n }\n datasetAnimationScopeKeys(datasetType, transition) {\n return $dfc006ada1995968$var$cachedKeys(`${datasetType}.transition.${transition}`, ()=>[\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`\n ],\n [\n `datasets.${datasetType}`,\n \"\"\n ]\n ]);\n }\n datasetElementScopeKeys(datasetType, elementType) {\n return $dfc006ada1995968$var$cachedKeys(`${datasetType}-${elementType}`, ()=>[\n [\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n \"\"\n ]\n ]);\n }\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return $dfc006ada1995968$var$cachedKeys(`${type}-plugin-${id}`, ()=>[\n [\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || []\n ]\n ]);\n }\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n getOptionScopes(mainScope, keyLists, resetCache) {\n const { options: options, type: type } = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) return cached;\n const scopes = new Set();\n keyLists.forEach((keys)=>{\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach((key)=>$dfc006ada1995968$var$addIfFound(scopes, mainScope, key));\n }\n keys.forEach((key)=>$dfc006ada1995968$var$addIfFound(scopes, options, key));\n keys.forEach((key)=>$dfc006ada1995968$var$addIfFound(scopes, (0, $c4d1694fa24f1a71$export$6559d589eb85fbb6)[type] || {}, key));\n keys.forEach((key)=>$dfc006ada1995968$var$addIfFound(scopes, (0, $c4d1694fa24f1a71$export$4368d992c4eafac0), key));\n keys.forEach((key)=>$dfc006ada1995968$var$addIfFound(scopes, (0, $c4d1694fa24f1a71$export$2e2af4578d910ddf), key));\n });\n const array = Array.from(scopes);\n if (array.length === 0) array.push(Object.create(null));\n if ($dfc006ada1995968$var$keysCached.has(keyLists)) cache.set(keyLists, array);\n return array;\n }\n chartOptionScopes() {\n const { options: options, type: type } = this;\n return [\n options,\n (0, $c4d1694fa24f1a71$export$6559d589eb85fbb6)[type] || {},\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).datasets[type] || {},\n {\n type: type\n },\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0),\n (0, $c4d1694fa24f1a71$export$2e2af4578d910ddf)\n ];\n }\n resolveNamedOptions(scopes, names, context, prefixes = [\n \"\"\n ]) {\n const result = {\n $shared: true\n };\n const { resolver: resolver, subPrefixes: subPrefixes } = $dfc006ada1995968$var$getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if ($dfc006ada1995968$var$needContext(resolver, names)) {\n result.$shared = false;\n context = (0, $c4d1694fa24f1a71$export$a93c5207d687da10)(context) ? context() : context;\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = (0, $c4d1694fa24f1a71$export$c3950d9923825c02)(resolver, context, subResolver);\n }\n for (const prop of names)result[prop] = options[prop];\n return result;\n }\n createResolver(scopes, context, prefixes = [\n \"\"\n ], descriptorDefaults) {\n const { resolver: resolver } = $dfc006ada1995968$var$getResolver(this._resolverCache, scopes, prefixes);\n return (0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(context) ? (0, $c4d1694fa24f1a71$export$c3950d9923825c02)(resolver, context, undefined, descriptorDefaults) : resolver;\n }\n constructor(config){\n this._config = $dfc006ada1995968$var$initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n}\nfunction $dfc006ada1995968$var$getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = (0, $c4d1694fa24f1a71$export$a9c996f45e5784d0)(scopes, prefixes);\n cached = {\n resolver: resolver,\n subPrefixes: prefixes.filter((p)=>!p.toLowerCase().includes(\"hover\"))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\nconst $dfc006ada1995968$var$hasFunction = (value)=>(0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(value) && Object.getOwnPropertyNames(value).reduce((acc, key)=>acc || (0, $c4d1694fa24f1a71$export$a93c5207d687da10)(value[key]), false);\nfunction $dfc006ada1995968$var$needContext(proxy, names) {\n const { isScriptable: isScriptable, isIndexable: isIndexable } = (0, $c4d1694fa24f1a71$export$7910e0436ed8d1de)(proxy);\n for (const prop of names){\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if (scriptable && ((0, $c4d1694fa24f1a71$export$a93c5207d687da10)(value) || $dfc006ada1995968$var$hasFunction(value)) || indexable && (0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(value)) return true;\n }\n return false;\n}\nvar $dfc006ada1995968$var$version = \"4.4.0\";\nconst $dfc006ada1995968$var$KNOWN_POSITIONS = [\n \"top\",\n \"bottom\",\n \"left\",\n \"right\",\n \"chartArea\"\n];\nfunction $dfc006ada1995968$var$positionIsHorizontal(position, axis) {\n return position === \"top\" || position === \"bottom\" || $dfc006ada1995968$var$KNOWN_POSITIONS.indexOf(position) === -1 && axis === \"x\";\n}\nfunction $dfc006ada1995968$var$compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1];\n };\n}\nfunction $dfc006ada1995968$var$onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n chart.notifyPlugins(\"afterRender\");\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(animationOptions && animationOptions.onComplete, [\n context\n ], chart);\n}\nfunction $dfc006ada1995968$var$onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(animationOptions && animationOptions.onProgress, [\n context\n ], chart);\n}\nfunction $dfc006ada1995968$var$getCanvas(item) {\n if ((0, $c4d1694fa24f1a71$export$3a1a48c8f6ef640e)() && typeof item === \"string\") item = document.getElementById(item);\n else if (item && item.length) item = item[0];\n if (item && item.canvas) item = item.canvas;\n return item;\n}\nconst $dfc006ada1995968$var$instances = {};\nconst $dfc006ada1995968$var$getChart = (key)=>{\n const canvas = $dfc006ada1995968$var$getCanvas(key);\n return Object.values($dfc006ada1995968$var$instances).filter((c)=>c.canvas === canvas).pop();\n};\nfunction $dfc006ada1995968$var$moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys){\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) obj[intKey + move] = value;\n }\n }\n}\nfunction $dfc006ada1995968$var$determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === \"mouseout\") return null;\n if (isClick) return lastEvent;\n return e;\n}\nfunction $dfc006ada1995968$var$getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\nfunction $dfc006ada1995968$var$getDatasetArea(meta, chartArea) {\n const { xScale: xScale, yScale: yScale } = meta;\n if (xScale && yScale) return {\n left: $dfc006ada1995968$var$getSizeForArea(xScale, chartArea, \"left\"),\n right: $dfc006ada1995968$var$getSizeForArea(xScale, chartArea, \"right\"),\n top: $dfc006ada1995968$var$getSizeForArea(yScale, chartArea, \"top\"),\n bottom: $dfc006ada1995968$var$getSizeForArea(yScale, chartArea, \"bottom\")\n };\n return chartArea;\n}\nclass $dfc006ada1995968$export$acaa6426d77a227e {\n static register(...items) {\n $dfc006ada1995968$export$4bb7493d241fd8a5.add(...items);\n $dfc006ada1995968$var$invalidatePlugins();\n }\n static unregister(...items) {\n $dfc006ada1995968$export$4bb7493d241fd8a5.remove(...items);\n $dfc006ada1995968$var$invalidatePlugins();\n }\n get aspectRatio() {\n const { options: { aspectRatio: aspectRatio, maintainAspectRatio: maintainAspectRatio }, width: width, height: height, _aspectRatio: _aspectRatio } = this;\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(aspectRatio)) return aspectRatio;\n if (maintainAspectRatio && _aspectRatio) return _aspectRatio;\n return height ? width / height : null;\n }\n get data() {\n return this.config.data;\n }\n set data(data) {\n this.config.data = data;\n }\n get options() {\n return this._options;\n }\n set options(options) {\n this.config.options = options;\n }\n get registry() {\n return $dfc006ada1995968$export$4bb7493d241fd8a5;\n }\n _initialize() {\n this.notifyPlugins(\"beforeInit\");\n if (this.options.responsive) this.resize();\n else (0, $c4d1694fa24f1a71$export$f787f51d84a910ad)(this, this.options.devicePixelRatio);\n this.bindEvents();\n this.notifyPlugins(\"afterInit\");\n return this;\n }\n clear() {\n (0, $c4d1694fa24f1a71$export$c9170ad7d4cd7e57)(this.canvas, this.ctx);\n return this;\n }\n stop() {\n $dfc006ada1995968$export$a424a0aa8f687495.stop(this);\n return this;\n }\n resize(width, height) {\n if (!$dfc006ada1995968$export$a424a0aa8f687495.running(this)) this._resize(width, height);\n else this._resizeBeforeDraw = {\n width: width,\n height: height\n };\n }\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? \"resize\" : \"attach\";\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!(0, $c4d1694fa24f1a71$export$f787f51d84a910ad)(this, newRatio, true)) return;\n this.notifyPlugins(\"resize\", {\n size: newSize\n });\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(options.onResize, [\n this,\n newSize\n ], this);\n if (this.attached) {\n if (this._doResize(mode)) this.render();\n }\n }\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(scalesOptions, (axisOptions, axisID)=>{\n axisOptions.id = axisID;\n });\n }\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id)=>{\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n if (scaleOpts) items = items.concat(Object.keys(scaleOpts).map((id)=>{\n const scaleOptions = scaleOpts[id];\n const axis = $dfc006ada1995968$var$determineAxis(id, scaleOptions);\n const isRadial = axis === \"r\";\n const isHorizontal = axis === \"x\";\n return {\n options: scaleOptions,\n dposition: isRadial ? \"chartArea\" : isHorizontal ? \"bottom\" : \"left\",\n dtype: isRadial ? \"radialLinear\" : isHorizontal ? \"category\" : \"linear\"\n };\n }));\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(items, (item)=>{\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = $dfc006ada1995968$var$determineAxis(id, scaleOptions);\n const scaleType = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(scaleOptions.type, item.dtype);\n if (scaleOptions.position === undefined || $dfc006ada1995968$var$positionIsHorizontal(scaleOptions.position, axis) !== $dfc006ada1995968$var$positionIsHorizontal(item.dposition)) scaleOptions.position = item.dposition;\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) scale = scales[id];\n else {\n const scaleClass = $dfc006ada1995968$export$4bb7493d241fd8a5.getScale(scaleType);\n scale = new scaleClass({\n id: id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n scale.init(scaleOptions, options);\n });\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(updated, (hasUpdated, id)=>{\n if (!hasUpdated) delete scales[id];\n });\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(scales, (scale)=>{\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(this, scale, scale.options);\n $dfc006ada1995968$export$1ecca0613f5e56d2.addBox(this, scale);\n });\n }\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n metasets.sort((a, b)=>a.index - b.index);\n if (numMeta > numData) {\n for(let i = numData; i < numMeta; ++i)this._destroyDatasetMeta(i);\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort($dfc006ada1995968$var$compare2Level(\"order\", \"index\"));\n }\n _removeUnreferencedMetasets() {\n const { _metasets: metasets, data: { datasets: datasets } } = this;\n if (metasets.length > datasets.length) delete this._stacks;\n metasets.forEach((meta, index)=>{\n if (datasets.filter((x)=>x === meta._dataset).length === 0) this._destroyDatasetMeta(index);\n });\n }\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n this._removeUnreferencedMetasets();\n for(i = 0, ilen = datasets.length; i < ilen; i++){\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || $dfc006ada1995968$var$getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = \"\" + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = $dfc006ada1995968$export$4bb7493d241fd8a5.getController(type);\n const { datasetElementType: datasetElementType, dataElementType: dataElementType } = (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: $dfc006ada1995968$export$4bb7493d241fd8a5.getElement(dataElementType),\n datasetElementType: datasetElementType && $dfc006ada1995968$export$4bb7493d241fd8a5.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n this._updateMetasets();\n return newControllers;\n }\n _resetElements() {\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this.data.datasets, (dataset, datasetIndex)=>{\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n reset() {\n this._resetElements();\n this.notifyPlugins(\"reset\");\n }\n update(mode) {\n const config = this.config;\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n this._plugins.invalidate();\n if (this.notifyPlugins(\"beforeUpdate\", {\n mode: mode,\n cancelable: true\n }) === false) return;\n const newControllers = this.buildOrUpdateControllers();\n this.notifyPlugins(\"beforeElementsUpdate\");\n let minPadding = 0;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; i++){\n const { controller: controller } = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n if (!animsDisabled) (0, $c4d1694fa24f1a71$export$d66501df72047452)(newControllers, (controller)=>{\n controller.reset();\n });\n this._updateDatasets(mode);\n this.notifyPlugins(\"afterUpdate\", {\n mode: mode\n });\n this._layers.sort($dfc006ada1995968$var$compare2Level(\"z\", \"_idx\"));\n const { _active: _active, _lastEvent: _lastEvent } = this;\n if (_lastEvent) this._eventHandler(_lastEvent, true);\n else if (_active.length) this._updateHoverStyles(_active, _active, true);\n this.render();\n }\n _updateScales() {\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this.scales, (scale)=>{\n $dfc006ada1995968$export$1ecca0613f5e56d2.removeBox(this, scale);\n });\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n if (!(0, $c4d1694fa24f1a71$export$ee7c8ad385a60b7b)(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n this.unbindEvents();\n this.bindEvents();\n }\n }\n _updateHiddenIndices() {\n const { _hiddenIndices: _hiddenIndices } = this;\n const changes = this._getUniformDataChanges() || [];\n for (const { method: method, start: start, count: count } of changes){\n const move = method === \"_removeElements\" ? -count : count;\n $dfc006ada1995968$var$moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) return;\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx)=>new Set(_dataChanges.filter((c)=>c[0] === idx).map((c, i)=>i + \",\" + c.splice(1).join(\",\")));\n const changeSet = makeSet(0);\n for(let i = 1; i < datasetCount; i++){\n if (!(0, $c4d1694fa24f1a71$export$ee7c8ad385a60b7b)(changeSet, makeSet(i))) return;\n }\n return Array.from(changeSet).map((c)=>c.split(\",\")).map((a)=>({\n method: a[1],\n start: +a[2],\n count: +a[3]\n }));\n }\n _updateLayout(minPadding) {\n if (this.notifyPlugins(\"beforeLayout\", {\n cancelable: true\n }) === false) return;\n $dfc006ada1995968$export$1ecca0613f5e56d2.update(this, this.width, this.height, minPadding);\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n this._layers = [];\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this.boxes, (box)=>{\n if (noArea && box.position === \"chartArea\") return;\n if (box.configure) box.configure();\n this._layers.push(...box._layers());\n }, this);\n this._layers.forEach((item, index)=>{\n item._idx = index;\n });\n this.notifyPlugins(\"afterLayout\");\n }\n _updateDatasets(mode) {\n if (this.notifyPlugins(\"beforeDatasetsUpdate\", {\n mode: mode,\n cancelable: true\n }) === false) return;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i)this.getDatasetMeta(i).controller.configure();\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i)this._updateDataset(i, (0, $c4d1694fa24f1a71$export$a93c5207d687da10)(mode) ? mode({\n datasetIndex: i\n }) : mode);\n this.notifyPlugins(\"afterDatasetsUpdate\", {\n mode: mode\n });\n }\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {\n meta: meta,\n index: index,\n mode: mode,\n cancelable: true\n };\n if (this.notifyPlugins(\"beforeDatasetUpdate\", args) === false) return;\n meta.controller._update(mode);\n args.cancelable = false;\n this.notifyPlugins(\"afterDatasetUpdate\", args);\n }\n render() {\n if (this.notifyPlugins(\"beforeRender\", {\n cancelable: true\n }) === false) return;\n if ($dfc006ada1995968$export$a424a0aa8f687495.has(this)) {\n if (this.attached && !$dfc006ada1995968$export$a424a0aa8f687495.running(this)) $dfc006ada1995968$export$a424a0aa8f687495.start(this);\n } else {\n this.draw();\n $dfc006ada1995968$var$onAnimationsComplete({\n chart: this\n });\n }\n }\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const { width: width, height: height } = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n if (this.width <= 0 || this.height <= 0) return;\n if (this.notifyPlugins(\"beforeDraw\", {\n cancelable: true\n }) === false) return;\n const layers = this._layers;\n for(i = 0; i < layers.length && layers[i].z <= 0; ++i)layers[i].draw(this.chartArea);\n this._drawDatasets();\n for(; i < layers.length; ++i)layers[i].draw(this.chartArea);\n this.notifyPlugins(\"afterDraw\");\n }\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n const meta = metasets[i];\n if (!filterVisible || meta.visible) result.push(meta);\n }\n return result;\n }\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n _drawDatasets() {\n if (this.notifyPlugins(\"beforeDatasetsDraw\", {\n cancelable: true\n }) === false) return;\n const metasets = this.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i)this._drawDataset(metasets[i]);\n this.notifyPlugins(\"afterDatasetsDraw\");\n }\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = $dfc006ada1995968$var$getDatasetArea(meta, this.chartArea);\n const args = {\n meta: meta,\n index: meta.index,\n cancelable: true\n };\n if (this.notifyPlugins(\"beforeDatasetDraw\", args) === false) return;\n if (useClip) (0, $c4d1694fa24f1a71$export$8743009a87fcb00f)(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n meta.controller.draw();\n if (useClip) (0, $c4d1694fa24f1a71$export$3d8c2f653ac9d0b9)(ctx);\n args.cancelable = false;\n this.notifyPlugins(\"afterDatasetDraw\", args);\n }\n isPointInArea(point) {\n return (0, $c4d1694fa24f1a71$export$e7094788287c5e9b)(point, this.chartArea, this._minPadding);\n }\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = $dfc006ada1995968$export$a13296960cae0384.modes[mode];\n if (typeof method === \"function\") return method(this, e, options, useFinalPosition);\n return [];\n }\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter((x)=>x && x._dataset === dataset).pop();\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n return meta;\n }\n getContext() {\n return this.$context || (this.$context = (0, $c4d1694fa24f1a71$export$35e795649ee09318)(null, {\n chart: this,\n type: \"chart\"\n }));\n }\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) return false;\n const meta = this.getDatasetMeta(datasetIndex);\n return typeof meta.hidden === \"boolean\" ? !meta.hidden : !dataset.hidden;\n }\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? \"show\" : \"hide\";\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n if ((0, $c4d1694fa24f1a71$export$dda1d9f60106f0e9)(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n anims.update(meta, {\n visible: visible\n });\n this.update((ctx)=>ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) meta.controller._destroy();\n delete this._metasets[datasetIndex];\n }\n _stop() {\n let i, ilen;\n this.stop();\n $dfc006ada1995968$export$a424a0aa8f687495.remove(this);\n for(i = 0, ilen = this.data.datasets.length; i < ilen; ++i)this._destroyDatasetMeta(i);\n }\n destroy() {\n this.notifyPlugins(\"beforeDestroy\");\n const { canvas: canvas, ctx: ctx } = this;\n this._stop();\n this.config.clearCache();\n if (canvas) {\n this.unbindEvents();\n (0, $c4d1694fa24f1a71$export$c9170ad7d4cd7e57)(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n delete $dfc006ada1995968$var$instances[this.id];\n this.notifyPlugins(\"afterDestroy\");\n }\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) this.bindResponsiveEvents();\n else this.attached = true;\n }\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const listener = (e, x, y)=>{\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this.options.events, (type)=>_add(type, listener));\n }\n bindResponsiveEvents() {\n if (!this._responsiveListeners) this._responsiveListeners = {};\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener)=>{\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n const listener = (width, height)=>{\n if (this.canvas) this.resize(width, height);\n };\n let detached;\n const attached = ()=>{\n _remove(\"attach\", attached);\n this.attached = true;\n this.resize();\n _add(\"resize\", listener);\n _add(\"detach\", detached);\n };\n detached = ()=>{\n this.attached = false;\n _remove(\"resize\", listener);\n this._stop();\n this._resize(0, 0);\n _add(\"attach\", attached);\n };\n if (platform.isAttached(this.canvas)) attached();\n else detached();\n }\n unbindEvents() {\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this._listeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this._responsiveListeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? \"set\" : \"remove\";\n let meta, item, i, ilen;\n if (mode === \"dataset\") {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller[\"_\" + prefix + \"DatasetHoverStyle\"]();\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) controller[prefix + \"HoverStyle\"](item.element, item.datasetIndex, item.index);\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({ datasetIndex: datasetIndex, index: index })=>{\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) throw new Error(\"No dataset found at index \" + datasetIndex);\n return {\n datasetIndex: datasetIndex,\n element: meta.data[index],\n index: index\n };\n });\n const changed = !(0, $c4d1694fa24f1a71$export$995eb9fca571757)(active, lastActive);\n if (changed) {\n this._active = active;\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter((p)=>p.plugin.id === pluginId).length === 1;\n }\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n if (deactivated.length) this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n if (activated.length && hoverOptions.mode) this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay: replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin)=>(plugin.options.events || this.options.events).includes(e.native.type);\n if (this.notifyPlugins(\"beforeEvent\", args, eventFilter) === false) return;\n const changed = this._handleEvent(e, replay, args.inChartArea);\n args.cancelable = false;\n this.notifyPlugins(\"afterEvent\", args, eventFilter);\n if (changed || args.changed) this.render();\n return this;\n }\n _handleEvent(e, replay, inChartArea) {\n const { _active: lastActive = [], options: options } = this;\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = (0, $c4d1694fa24f1a71$export$f38c853ae54ed474)(e);\n const lastEvent = $dfc006ada1995968$var$determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n if (inChartArea) {\n this._lastEvent = null;\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(options.onHover, [\n e,\n active,\n this\n ], this);\n if (isClick) (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(options.onClick, [\n e,\n active,\n this\n ], this);\n }\n const changed = !(0, $c4d1694fa24f1a71$export$995eb9fca571757)(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n this._lastEvent = lastEvent;\n return changed;\n }\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === \"mouseout\") return [];\n if (!inChartArea) return lastActive;\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n constructor(item, userConfig){\n const config = this.config = new $dfc006ada1995968$var$Config(userConfig);\n const initialCanvas = $dfc006ada1995968$var$getCanvas(item);\n const existingChart = $dfc006ada1995968$var$getChart(initialCanvas);\n if (existingChart) throw new Error(\"Canvas is already in use. Chart with ID '\" + existingChart.id + \"'\" + \" must be destroyed before the canvas with ID '\" + existingChart.canvas.id + \"' can be reused.\");\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n this.platform = new (config.platform || $dfc006ada1995968$export$72cd9e67b1b784f9(initialCanvas))();\n this.platform.updateConfig(config);\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n this.id = (0, $c4d1694fa24f1a71$export$2219238a014317b0)();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new $dfc006ada1995968$var$PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = (0, $c4d1694fa24f1a71$export$4c3d22f3d993c33f)((mode)=>this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n $dfc006ada1995968$var$instances[this.id] = this;\n if (!context || !canvas) {\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n $dfc006ada1995968$export$a424a0aa8f687495.listen(this, \"complete\", $dfc006ada1995968$var$onAnimationsComplete);\n $dfc006ada1995968$export$a424a0aa8f687495.listen(this, \"progress\", $dfc006ada1995968$var$onAnimationProgress);\n this._initialize();\n if (this.attached) this.update();\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$acaa6426d77a227e, \"defaults\", (0, $c4d1694fa24f1a71$export$4368d992c4eafac0));\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$acaa6426d77a227e, \"instances\", $dfc006ada1995968$var$instances);\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$acaa6426d77a227e, \"overrides\", (0, $c4d1694fa24f1a71$export$6559d589eb85fbb6));\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$acaa6426d77a227e, \"registry\", $dfc006ada1995968$export$4bb7493d241fd8a5);\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$acaa6426d77a227e, \"version\", $dfc006ada1995968$var$version);\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$acaa6426d77a227e, \"getChart\", $dfc006ada1995968$var$getChart);\nfunction $dfc006ada1995968$var$invalidatePlugins() {\n return (0, $c4d1694fa24f1a71$export$d66501df72047452)($dfc006ada1995968$export$acaa6426d77a227e.instances, (chart)=>chart._plugins.invalidate());\n}\nfunction $dfc006ada1995968$var$clipArc(ctx, element, endAngle) {\n const { startAngle: startAngle, pixelMargin: pixelMargin, x: x, y: y, outerRadius: outerRadius, innerRadius: innerRadius } = element;\n let angleMargin = pixelMargin / outerRadius;\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else ctx.arc(x, y, pixelMargin, endAngle + (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd), startAngle - (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd));\n ctx.closePath();\n ctx.clip();\n}\nfunction $dfc006ada1995968$var$toRadiusCorners(value) {\n return (0, $c4d1694fa24f1a71$export$21579262ef46735b)(value, [\n \"outerStart\",\n \"outerEnd\",\n \"innerStart\",\n \"innerEnd\"\n ]);\n}\n/**\n * Parse border radius from the provided options\n */ function $dfc006ada1995968$var$parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n const o = $dfc006ada1995968$var$toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val)=>{\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(o.innerStart, 0, innerLimit),\n innerEnd: (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(o.innerEnd, 0, innerLimit)\n };\n}\n/**\n * Convert (r, 𝜃) to (x, y)\n */ function $dfc006ada1995968$var$rThetaToXY(r, theta, x, y) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta)\n };\n}\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */ function $dfc006ada1995968$var$pathArc(ctx, element, offset, spacing, end, circular) {\n const { x: x, y: y, startAngle: start, pixelMargin: pixelMargin, innerRadius: innerR } = element;\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n let spacingOffset = 0;\n const alpha = end - start;\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n const beta = Math.max(0.001, alpha * outerRadius - offset / (0, $c4d1694fa24f1a71$export$56c0d5a1e737357d)) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const { outerStart: outerStart, outerEnd: outerEnd, innerStart: innerStart, innerEnd: innerEnd } = $dfc006ada1995968$var$parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n ctx.beginPath();\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = $dfc006ada1995968$var$rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd));\n }\n // The line from point 3 to point 4\n const p4 = $dfc006ada1995968$var$rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = $dfc006ada1995968$var$rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd), innerEndAdjustedAngle + Math.PI);\n }\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2;\n ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true);\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = $dfc006ada1995968$var$rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd));\n }\n // The line from point 7 to point 8\n const p8 = $dfc006ada1995968$var$rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = $dfc006ada1995968$var$rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd), outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n ctx.closePath();\n}\nfunction $dfc006ada1995968$var$drawArc(ctx, element, offset, spacing, circular) {\n const { fullCircles: fullCircles, startAngle: startAngle, circumference: circumference } = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n $dfc006ada1995968$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i)ctx.fill();\n if (!isNaN(circumference)) endAngle = startAngle + (circumference % (0, $c4d1694fa24f1a71$export$971d5caa766a69d7) || (0, $c4d1694fa24f1a71$export$971d5caa766a69d7));\n }\n $dfc006ada1995968$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\nfunction $dfc006ada1995968$var$drawBorder(ctx, element, offset, spacing, circular) {\n const { fullCircles: fullCircles, startAngle: startAngle, circumference: circumference, options: options } = element;\n const { borderWidth: borderWidth, borderJoinStyle: borderJoinStyle, borderDash: borderDash, borderDashOffset: borderDashOffset } = options;\n const inner = options.borderAlign === \"inner\";\n if (!borderWidth) return;\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || \"round\";\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || \"bevel\";\n }\n let endAngle = element.endAngle;\n if (fullCircles) {\n $dfc006ada1995968$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i)ctx.stroke();\n if (!isNaN(circumference)) endAngle = startAngle + (circumference % (0, $c4d1694fa24f1a71$export$971d5caa766a69d7) || (0, $c4d1694fa24f1a71$export$971d5caa766a69d7));\n }\n if (inner) $dfc006ada1995968$var$clipArc(ctx, element, endAngle);\n if (!fullCircles) {\n $dfc006ada1995968$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\nclass $dfc006ada1995968$export$d48203c759d6a1fc extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n inRange(chartX, chartY, useFinalPosition) {\n const point = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n const { angle: angle, distance: distance } = (0, $c4d1694fa24f1a71$export$96f57966bedc81b4)(point, {\n x: chartX,\n y: chartY\n });\n const { startAngle: startAngle, endAngle: endAngle, innerRadius: innerRadius, outerRadius: outerRadius, circumference: circumference } = this.getProps([\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\",\n \"circumference\"\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= (0, $c4d1694fa24f1a71$export$971d5caa766a69d7) || (0, $c4d1694fa24f1a71$export$ffb5f4729a158638)(angle, startAngle, endAngle);\n const withinRadius = (0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n return betweenAngles && withinRadius;\n }\n getCenterPoint(useFinalPosition) {\n const { x: x, y: y, startAngle: startAngle, endAngle: endAngle, innerRadius: innerRadius, outerRadius: outerRadius } = this.getProps([\n \"x\",\n \"y\",\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\"\n ], useFinalPosition);\n const { offset: offset, spacing: spacing } = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n tooltipPosition(useFinalPosition) {\n return this.getCenterPoint(useFinalPosition);\n }\n draw(ctx) {\n const { options: options, circumference: circumference } = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = options.borderAlign === \"inner\" ? 0.33 : 0;\n this.fullCircles = circumference > (0, $c4d1694fa24f1a71$export$971d5caa766a69d7) ? Math.floor(circumference / (0, $c4d1694fa24f1a71$export$971d5caa766a69d7)) : 0;\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) return;\n ctx.save();\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min((0, $c4d1694fa24f1a71$export$56c0d5a1e737357d), circumference || 0));\n const radiusOffset = offset * fix;\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n $dfc006ada1995968$var$drawArc(ctx, this, radiusOffset, spacing, circular);\n $dfc006ada1995968$var$drawBorder(ctx, this, radiusOffset, spacing, circular);\n ctx.restore();\n }\n constructor(cfg){\n super();\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"circumference\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"endAngle\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"fullCircles\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"innerRadius\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"outerRadius\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"pixelMargin\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"startAngle\", void 0);\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$d48203c759d6a1fc, \"id\", \"arc\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$d48203c759d6a1fc, \"defaults\", {\n borderAlign: \"center\",\n borderColor: \"#fff\",\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$d48203c759d6a1fc, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\"\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$d48203c759d6a1fc, \"descriptors\", {\n _scriptable: true,\n _indexable: (name)=>name !== \"borderDash\"\n});\nfunction $dfc006ada1995968$var$setStyle(ctx, options, style = options) {\n ctx.lineCap = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash((0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(style.borderDash, options.borderDash));\n ctx.lineDashOffset = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(style.borderColor, options.borderColor);\n}\nfunction $dfc006ada1995968$var$lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\nfunction $dfc006ada1995968$var$getLineMethod(options) {\n if (options.stepped) return 0, $c4d1694fa24f1a71$export$d24c54395ce0c509;\n if (options.tension || options.cubicInterpolationMode === \"monotone\") return 0, $c4d1694fa24f1a71$export$6554612db691658e;\n return $dfc006ada1995968$var$lineTo;\n}\nfunction $dfc006ada1995968$var$pathVars(points, segment, params = {}) {\n const count = points.length;\n const { start: paramsStart = 0, end: paramsEnd = count - 1 } = params;\n const { start: segmentStart, end: segmentEnd } = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n return {\n count: count,\n start: start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\nfunction $dfc006ada1995968$var$pathSegment(ctx, line, segment, params) {\n const { points: points, options: options } = line;\n const { count: count, start: start, loop: loop, ilen: ilen } = $dfc006ada1995968$var$pathVars(points, segment, params);\n const lineMethod = $dfc006ada1995968$var$getLineMethod(options);\n let { move: move = true, reverse: reverse } = params || {};\n let i, point, prev;\n for(i = 0; i <= ilen; ++i){\n point = points[(start + (reverse ? ilen - i : i)) % count];\n if (point.skip) continue;\n else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else lineMethod(ctx, prev, point, reverse, options.stepped);\n prev = point;\n }\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n return !!loop;\n}\nfunction $dfc006ada1995968$var$fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const { count: count, start: start, ilen: ilen } = $dfc006ada1995968$var$pathVars(points, segment, params);\n const { move: move = true, reverse: reverse } = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n const pointIndex = (index)=>(start + (reverse ? ilen - index : index)) % count;\n const drawX = ()=>{\n if (minY !== maxY) {\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n ctx.lineTo(avgX, lastY);\n }\n };\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n for(i = 0; i <= ilen; ++i){\n point = points[pointIndex(i)];\n if (point.skip) continue;\n const x = point.x;\n const y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) minY = y;\n else if (y > maxY) maxY = y;\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n ctx.lineTo(x, y);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n lastY = y;\n }\n drawX();\n}\nfunction $dfc006ada1995968$var$_getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== \"monotone\" && !opts.stepped && !borderDash;\n return useFastPath ? $dfc006ada1995968$var$fastPathSegment : $dfc006ada1995968$var$pathSegment;\n}\nfunction $dfc006ada1995968$var$_getInterpolationMethod(options) {\n if (options.stepped) return 0, $c4d1694fa24f1a71$export$7a38258bbe170828;\n if (options.tension || options.cubicInterpolationMode === \"monotone\") return 0, $c4d1694fa24f1a71$export$2f6ca3d3b1f80bf5;\n return 0, $c4d1694fa24f1a71$export$8a5498727ef6be21;\n}\nfunction $dfc006ada1995968$var$strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) path.closePath();\n }\n $dfc006ada1995968$var$setStyle(ctx, line.options);\n ctx.stroke(path);\n}\nfunction $dfc006ada1995968$var$strokePathDirect(ctx, line, start, count) {\n const { segments: segments, options: options } = line;\n const segmentMethod = $dfc006ada1995968$var$_getSegmentMethod(line);\n for (const segment of segments){\n $dfc006ada1995968$var$setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {\n start: start,\n end: start + count - 1\n })) ctx.closePath();\n ctx.stroke();\n }\n}\nconst $dfc006ada1995968$var$usePath2D = typeof Path2D === \"function\";\nfunction $dfc006ada1995968$var$draw(ctx, line, start, count) {\n if ($dfc006ada1995968$var$usePath2D && !line.options.segment) $dfc006ada1995968$var$strokePathWithCache(ctx, line, start, count);\n else $dfc006ada1995968$var$strokePathDirect(ctx, line, start, count);\n}\nclass $dfc006ada1995968$export$55e463fa7bcd3469 extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === \"monotone\") && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n (0, $c4d1694fa24f1a71$export$ab83b03e4111b1d0)(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n get points() {\n return this._points;\n }\n get segments() {\n return this._segments || (this._segments = (0, $c4d1694fa24f1a71$export$1a82df3d29112e01)(this, this.options.segment));\n }\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = (0, $c4d1694fa24f1a71$export$306ddfe3a8403e2)(this, {\n property: property,\n start: value,\n end: value\n });\n if (!segments.length) return;\n const result = [];\n const _interpolate = $dfc006ada1995968$var$_getInterpolationMethod(options);\n let i, ilen;\n for(i = 0, ilen = segments.length; i < ilen; ++i){\n const { start: start, end: end } = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n pathSegment(ctx, segment, params) {\n const segmentMethod = $dfc006ada1995968$var$_getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = $dfc006ada1995968$var$_getSegmentMethod(this);\n let loop = this._loop;\n start = start || 0;\n count = count || this.points.length - start;\n for (const segment of segments)loop &= segmentMethod(ctx, this, segment, {\n start: start,\n end: start + count - 1\n });\n return !!loop;\n }\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n if (points.length && options.borderWidth) {\n ctx.save();\n $dfc006ada1995968$var$draw(ctx, this, start, count);\n ctx.restore();\n }\n if (this.animated) {\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n constructor(cfg){\n super();\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$55e463fa7bcd3469, \"id\", \"line\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$55e463fa7bcd3469, \"defaults\", {\n borderCapStyle: \"butt\",\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: \"miter\",\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: \"default\",\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$55e463fa7bcd3469, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\",\n borderColor: \"borderColor\"\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$55e463fa7bcd3469, \"descriptors\", {\n _scriptable: true,\n _indexable: (name)=>name !== \"borderDash\" && name !== \"fill\"\n});\nfunction $dfc006ada1995968$var$inRange$1(el, pos, axis, useFinalPosition) {\n const options = el.options;\n const { [axis]: value } = el.getProps([\n axis\n ], useFinalPosition);\n return Math.abs(pos - value) < options.radius + options.hitRadius;\n}\nclass $dfc006ada1995968$export$bd159b522b230b7a extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n inRange(mouseX, mouseY, useFinalPosition) {\n const options = this.options;\n const { x: x, y: y } = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2);\n }\n inXRange(mouseX, useFinalPosition) {\n return $dfc006ada1995968$var$inRange$1(this, mouseX, \"x\", useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return $dfc006ada1995968$var$inRange$1(this, mouseY, \"y\", useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x: x, y: y } = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n return {\n x: x,\n y: y\n };\n }\n size(options) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n draw(ctx, area) {\n const options = this.options;\n if (this.skip || options.radius < 0.1 || !(0, $c4d1694fa24f1a71$export$e7094788287c5e9b)(this, area, this.size(options) / 2)) return;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n (0, $c4d1694fa24f1a71$export$493d36ec626b6698)(ctx, options, this.x, this.y);\n }\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n constructor(cfg){\n super();\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"parsed\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"skip\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"stop\", void 0);\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$bd159b522b230b7a, \"id\", \"point\");\n/**\n * @type {any}\n */ (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$bd159b522b230b7a, \"defaults\", {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: \"circle\",\n radius: 3,\n rotation: 0\n});\n/**\n * @type {any}\n */ (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$bd159b522b230b7a, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\",\n borderColor: \"borderColor\"\n});\nfunction $dfc006ada1995968$var$getBarBounds(bar, useFinalPosition) {\n const { x: x, y: y, base: base, width: width, height: height } = bar.getProps([\n \"x\",\n \"y\",\n \"base\",\n \"width\",\n \"height\"\n ], useFinalPosition);\n let left, right, top, bottom, half;\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n return {\n left: left,\n top: top,\n right: right,\n bottom: bottom\n };\n}\nfunction $dfc006ada1995968$var$skipOrLimit(skip, value, min, max) {\n return skip ? 0 : (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(value, min, max);\n}\nfunction $dfc006ada1995968$var$parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = (0, $c4d1694fa24f1a71$export$d66dc83d8cfc8dd)(value);\n return {\n t: $dfc006ada1995968$var$skipOrLimit(skip.top, o.top, 0, maxH),\n r: $dfc006ada1995968$var$skipOrLimit(skip.right, o.right, 0, maxW),\n b: $dfc006ada1995968$var$skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: $dfc006ada1995968$var$skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\nfunction $dfc006ada1995968$var$parseBorderRadius(bar, maxW, maxH) {\n const { enableBorderRadius: enableBorderRadius } = bar.getProps([\n \"enableBorderRadius\"\n ]);\n const value = bar.options.borderRadius;\n const o = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n const enableBorder = enableBorderRadius || (0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(value);\n return {\n topLeft: $dfc006ada1995968$var$skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: $dfc006ada1995968$var$skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: $dfc006ada1995968$var$skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: $dfc006ada1995968$var$skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\nfunction $dfc006ada1995968$var$boundingRects(bar) {\n const bounds = $dfc006ada1995968$var$getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = $dfc006ada1995968$var$parseBorderWidth(bar, width / 2, height / 2);\n const radius = $dfc006ada1995968$var$parseBorderRadius(bar, width / 2, height / 2);\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius: radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))\n }\n }\n };\n}\nfunction $dfc006ada1995968$var$inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && $dfc006ada1995968$var$getBarBounds(bar, useFinalPosition);\n return bounds && (skipX || (0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(x, bounds.left, bounds.right)) && (skipY || (0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(y, bounds.top, bounds.bottom));\n}\nfunction $dfc006ada1995968$var$hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\nfunction $dfc006ada1995968$var$addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction $dfc006ada1995968$var$inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\nclass $dfc006ada1995968$export$a16ed71bf4b07672 extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n draw(ctx) {\n const { inflateAmount: inflateAmount, options: { borderColor: borderColor, backgroundColor: backgroundColor } } = this;\n const { inner: inner, outer: outer } = $dfc006ada1995968$var$boundingRects(this);\n const addRectPath = $dfc006ada1995968$var$hasRadius(outer.radius) ? (0, $c4d1694fa24f1a71$export$1fbe638ecf81657e) : $dfc006ada1995968$var$addNormalRectPath;\n ctx.save();\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, $dfc006ada1995968$var$inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, $dfc006ada1995968$var$inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill(\"evenodd\");\n }\n ctx.beginPath();\n addRectPath(ctx, $dfc006ada1995968$var$inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n return $dfc006ada1995968$var$inRange(this, mouseX, mouseY, useFinalPosition);\n }\n inXRange(mouseX, useFinalPosition) {\n return $dfc006ada1995968$var$inRange(this, mouseX, null, useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return $dfc006ada1995968$var$inRange(this, null, mouseY, useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x: x, y: y, base: base, horizontal: horizontal } = this.getProps([\n \"x\",\n \"y\",\n \"base\",\n \"horizontal\"\n ], useFinalPosition);\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n getRange(axis) {\n return axis === \"x\" ? this.width / 2 : this.height / 2;\n }\n constructor(cfg){\n super();\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$a16ed71bf4b07672, \"id\", \"bar\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$a16ed71bf4b07672, \"defaults\", {\n borderSkipped: \"start\",\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: \"auto\",\n pointStyle: undefined\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$a16ed71bf4b07672, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\",\n borderColor: \"borderColor\"\n});\nvar $dfc006ada1995968$export$7a5d735b2ab6389d = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n ArcElement: $dfc006ada1995968$export$d48203c759d6a1fc,\n BarElement: $dfc006ada1995968$export$a16ed71bf4b07672,\n LineElement: $dfc006ada1995968$export$55e463fa7bcd3469,\n PointElement: $dfc006ada1995968$export$bd159b522b230b7a\n});\nconst $dfc006ada1995968$var$BORDER_COLORS = [\n \"rgb(54, 162, 235)\",\n \"rgb(255, 99, 132)\",\n \"rgb(255, 159, 64)\",\n \"rgb(255, 205, 86)\",\n \"rgb(75, 192, 192)\",\n \"rgb(153, 102, 255)\",\n \"rgb(201, 203, 207)\" // grey\n];\n// Border colors with 50% transparency\nconst $dfc006ada1995968$var$BACKGROUND_COLORS = /* #__PURE__ */ $dfc006ada1995968$var$BORDER_COLORS.map((color)=>color.replace(\"rgb(\", \"rgba(\").replace(\")\", \", 0.5)\"));\nfunction $dfc006ada1995968$var$getBorderColor(i) {\n return $dfc006ada1995968$var$BORDER_COLORS[i % $dfc006ada1995968$var$BORDER_COLORS.length];\n}\nfunction $dfc006ada1995968$var$getBackgroundColor(i) {\n return $dfc006ada1995968$var$BACKGROUND_COLORS[i % $dfc006ada1995968$var$BACKGROUND_COLORS.length];\n}\nfunction $dfc006ada1995968$var$colorizeDefaultDataset(dataset, i) {\n dataset.borderColor = $dfc006ada1995968$var$getBorderColor(i);\n dataset.backgroundColor = $dfc006ada1995968$var$getBackgroundColor(i);\n return ++i;\n}\nfunction $dfc006ada1995968$var$colorizeDoughnutDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>$dfc006ada1995968$var$getBorderColor(i++));\n return i;\n}\nfunction $dfc006ada1995968$var$colorizePolarAreaDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>$dfc006ada1995968$var$getBackgroundColor(i++));\n return i;\n}\nfunction $dfc006ada1995968$var$getColorizer(chart) {\n let i = 0;\n return (dataset, datasetIndex)=>{\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n if (controller instanceof $dfc006ada1995968$export$e04603e7d8b77172) i = $dfc006ada1995968$var$colorizeDoughnutDataset(dataset, i);\n else if (controller instanceof $dfc006ada1995968$export$2a270b3a0d973c85) i = $dfc006ada1995968$var$colorizePolarAreaDataset(dataset, i);\n else if (controller) i = $dfc006ada1995968$var$colorizeDefaultDataset(dataset, i);\n };\n}\nfunction $dfc006ada1995968$var$containsColorsDefinitions(descriptors) {\n let k;\n for(k in descriptors){\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) return true;\n }\n return false;\n}\nfunction $dfc006ada1995968$var$containsColorsDefinition(descriptor) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\nvar $dfc006ada1995968$export$c537fa0d021d010b = {\n id: \"colors\",\n defaults: {\n enabled: true,\n forceOverride: false\n },\n beforeLayout (chart, _args, options) {\n if (!options.enabled) return;\n const { data: { datasets: datasets }, options: chartOptions } = chart.config;\n const { elements: elements } = chartOptions;\n if (!options.forceOverride && ($dfc006ada1995968$var$containsColorsDefinitions(datasets) || $dfc006ada1995968$var$containsColorsDefinition(chartOptions) || elements && $dfc006ada1995968$var$containsColorsDefinitions(elements))) return;\n const colorizer = $dfc006ada1995968$var$getColorizer(chart);\n datasets.forEach(colorizer);\n }\n};\nfunction $dfc006ada1995968$var$lttbDecimation(data, start, count, availableWidth, options) {\n const samples = options.samples || availableWidth;\n if (samples >= count) return data.slice(start, start + count);\n const decimated = [];\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n decimated[sampledIndex++] = data[a];\n for(i = 0; i < samples - 2; i++){\n let avgX = 0;\n let avgY = 0;\n let j;\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n for(j = avgRangeStart; j < avgRangeEnd; j++){\n avgX += data[j].x;\n avgY += data[j].y;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const { x: pointAx, y: pointAy } = data[a];\n maxArea = area = -1;\n for(j = rangeOffs; j < rangeTo; j++){\n area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy));\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n decimated[sampledIndex++] = data[endIndex];\n return decimated;\n}\nfunction $dfc006ada1995968$var$minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n for(i = start; i < start + count; ++i){\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n const lastIndex = i - 1;\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(minIndex) && !(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(maxIndex)) {\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) decimated.push({\n ...data[intermediateIndex1],\n x: avgX\n });\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n if (i > 0 && lastIndex !== startIndex) decimated.push(data[lastIndex]);\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n return decimated;\n}\nfunction $dfc006ada1995968$var$cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, \"data\", {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data\n });\n }\n}\nfunction $dfc006ada1995968$var$cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset)=>{\n $dfc006ada1995968$var$cleanDecimatedDataset(dataset);\n });\n}\nfunction $dfc006ada1995968$var$getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n let start = 0;\n let count;\n const { iScale: iScale } = meta;\n const { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = iScale.getUserBounds();\n if (minDefined) start = (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)((0, $c4d1694fa24f1a71$export$ef35774e6d314e91)(points, iScale.axis, min).lo, 0, pointCount - 1);\n if (maxDefined) count = (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)((0, $c4d1694fa24f1a71$export$ef35774e6d314e91)(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n else count = pointCount - start;\n return {\n start: start,\n count: count\n };\n}\nvar $dfc006ada1995968$export$be17f937e9aa7533 = {\n id: \"decimation\",\n defaults: {\n algorithm: \"min-max\",\n enabled: false\n },\n beforeElementsUpdate: (chart, args, options)=>{\n if (!options.enabled) {\n $dfc006ada1995968$var$cleanDecimatedData(chart);\n return;\n }\n const availableWidth = chart.width;\n chart.data.datasets.forEach((dataset, datasetIndex)=>{\n const { _data: _data, indexAxis: indexAxis } = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n if ((0, $c4d1694fa24f1a71$export$407448d2b89b1813)([\n indexAxis,\n chart.options.indexAxis\n ]) === \"y\") return;\n if (!meta.controller.supportsDecimation) return;\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== \"linear\" && xAxis.type !== \"time\") return;\n if (chart.options.parsing) return;\n let { start: start, count: count } = $dfc006ada1995968$var$getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n $dfc006ada1995968$var$cleanDecimatedDataset(dataset);\n return;\n }\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(_data)) {\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, \"data\", {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n let decimated;\n switch(options.algorithm){\n case \"lttb\":\n decimated = $dfc006ada1995968$var$lttbDecimation(data, start, count, availableWidth, options);\n break;\n case \"min-max\":\n decimated = $dfc006ada1995968$var$minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n dataset._decimated = decimated;\n });\n },\n destroy (chart) {\n $dfc006ada1995968$var$cleanDecimatedData(chart);\n }\n};\nfunction $dfc006ada1995968$var$_segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n for (const segment of segments){\n let { start: start, end: end } = segment;\n end = $dfc006ada1995968$var$_findSegmentEnd(start, end, points);\n const bounds = $dfc006ada1995968$var$_getBounds(property, points[start], points[end], segment.loop);\n if (!target.segments) {\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n const targetSegments = (0, $c4d1694fa24f1a71$export$306ddfe3a8403e2)(target, bounds);\n for (const tgt of targetSegments){\n const subBounds = $dfc006ada1995968$var$_getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = (0, $c4d1694fa24f1a71$export$9fa96a7d116ea3ce)(segment, points, subBounds);\n for (const fillSource of fillSources)parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: $dfc006ada1995968$var$_getEdge(bounds, subBounds, \"start\", Math.max)\n },\n end: {\n [property]: $dfc006ada1995968$var$_getEdge(bounds, subBounds, \"end\", Math.min)\n }\n });\n }\n }\n return parts;\n}\nfunction $dfc006ada1995968$var$_getBounds(property, first, last, loop) {\n if (loop) return;\n let start = first[property];\n let end = last[property];\n if (property === \"angle\") {\n start = (0, $c4d1694fa24f1a71$export$28f7fcd39efa255)(start);\n end = (0, $c4d1694fa24f1a71$export$28f7fcd39efa255)(end);\n }\n return {\n property: property,\n start: start,\n end: end\n };\n}\nfunction $dfc006ada1995968$var$_pointsFromSegments(boundary, line) {\n const { x: x = null, y: y = null } = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({ start: start, end: end })=>{\n end = $dfc006ada1995968$var$_findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({\n x: first.x,\n y: y\n });\n points.push({\n x: last.x,\n y: y\n });\n } else if (x !== null) {\n points.push({\n x: x,\n y: first.y\n });\n points.push({\n x: x,\n y: last.y\n });\n }\n });\n return points;\n}\nfunction $dfc006ada1995968$var$_findSegmentEnd(start, end, points) {\n for(; end > start; end--){\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) break;\n }\n return end;\n}\nfunction $dfc006ada1995968$var$_getEdge(a, b, prop, fn) {\n if (a && b) return fn(a[prop], b[prop]);\n return a ? a[prop] : b ? b[prop] : 0;\n}\nfunction $dfc006ada1995968$var$_createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n if ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(boundary)) {\n _loop = true;\n points = boundary;\n } else points = $dfc006ada1995968$var$_pointsFromSegments(boundary, line);\n return points.length ? new $dfc006ada1995968$export$55e463fa7bcd3469({\n points: points,\n options: {\n tension: 0\n },\n _loop: _loop,\n _fullLoop: _loop\n }) : null;\n}\nfunction $dfc006ada1995968$var$_shouldApplyFill(source) {\n return source && source.fill !== false;\n}\nfunction $dfc006ada1995968$var$_resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [\n index\n ];\n let target;\n if (!propagate) return fill;\n while(fill !== false && visited.indexOf(fill) === -1){\n if (!(0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(fill)) return fill;\n target = sources[fill];\n if (!target) return false;\n if (target.visible) return fill;\n visited.push(fill);\n fill = target.fill;\n }\n return false;\n}\nfunction $dfc006ada1995968$var$_decodeFill(line, index, count) {\n const fill = $dfc006ada1995968$var$parseFillOption(line);\n if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(fill)) return isNaN(fill.value) ? false : fill;\n let target = parseFloat(fill);\n if ((0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(target) && Math.floor(target) === target) return $dfc006ada1995968$var$decodeTargetIndex(fill[0], index, target, count);\n return [\n \"origin\",\n \"start\",\n \"end\",\n \"stack\",\n \"shape\"\n ].indexOf(fill) >= 0 && fill;\n}\nfunction $dfc006ada1995968$var$decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === \"-\" || firstCh === \"+\") target = index + target;\n if (target === index || target < 0 || target >= count) return false;\n return target;\n}\nfunction $dfc006ada1995968$var$_getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === \"start\") pixel = scale.bottom;\n else if (fill === \"end\") pixel = scale.top;\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(fill)) pixel = scale.getPixelForValue(fill.value);\n else if (scale.getBasePixel) pixel = scale.getBasePixel();\n return pixel;\n}\nfunction $dfc006ada1995968$var$_getTargetValue(fill, scale, startValue) {\n let value;\n if (fill === \"start\") value = startValue;\n else if (fill === \"end\") value = scale.options.reverse ? scale.min : scale.max;\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(fill)) value = fill.value;\n else value = scale.getBaseValue();\n return value;\n}\nfunction $dfc006ada1995968$var$parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(fillOption && fillOption.target, fillOption);\n if (fill === undefined) fill = !!options.backgroundColor;\n if (fill === false || fill === null) return false;\n if (fill === true) return \"origin\";\n return fill;\n}\nfunction $dfc006ada1995968$var$_buildStackLine(source) {\n const { scale: scale, index: index, line: line } = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = $dfc006ada1995968$var$getLinesBelow(scale, index);\n linesBelow.push($dfc006ada1995968$var$_createBoundaryLine({\n x: null,\n y: scale.bottom\n }, line));\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n for(let j = segment.start; j <= segment.end; j++)$dfc006ada1995968$var$addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n return new $dfc006ada1995968$export$55e463fa7bcd3469({\n points: points,\n options: {}\n });\n}\nfunction $dfc006ada1995968$var$getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas(\"line\");\n for(let i = 0; i < metas.length; i++){\n const meta = metas[i];\n if (meta.index === index) break;\n if (!meta.hidden) below.unshift(meta.dataset);\n }\n return below;\n}\nfunction $dfc006ada1995968$var$addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for(let j = 0; j < linesBelow.length; j++){\n const line = linesBelow[j];\n const { first: first, last: last, point: point } = $dfc006ada1995968$var$findPoint(line, sourcePoint, \"x\");\n if (!point || first && last) continue;\n if (first) postponed.unshift(point);\n else {\n points.push(point);\n if (!last) break;\n }\n }\n points.push(...postponed);\n}\nfunction $dfc006ada1995968$var$findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) return {};\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if ((0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {\n first: first,\n last: last,\n point: point\n };\n}\nclass $dfc006ada1995968$var$simpleArc {\n pathSegment(ctx, bounds, opts) {\n const { x: x, y: y, radius: radius } = this;\n bounds = bounds || {\n start: 0,\n end: (0, $c4d1694fa24f1a71$export$971d5caa766a69d7)\n };\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n interpolate(point) {\n const { x: x, y: y, radius: radius } = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle: angle\n };\n }\n constructor(opts){\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n}\nfunction $dfc006ada1995968$var$_getTarget(source) {\n const { chart: chart, fill: fill, line: line } = source;\n if ((0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(fill)) return $dfc006ada1995968$var$getLineByIndex(chart, fill);\n if (fill === \"stack\") return $dfc006ada1995968$var$_buildStackLine(source);\n if (fill === \"shape\") return true;\n const boundary = $dfc006ada1995968$var$computeBoundary(source);\n if (boundary instanceof $dfc006ada1995968$var$simpleArc) return boundary;\n return $dfc006ada1995968$var$_createBoundaryLine(boundary, line);\n}\nfunction $dfc006ada1995968$var$getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\nfunction $dfc006ada1995968$var$computeBoundary(source) {\n const scale = source.scale || {};\n if (scale.getPointPositionForValue) return $dfc006ada1995968$var$computeCircularBoundary(source);\n return $dfc006ada1995968$var$computeLinearBoundary(source);\n}\nfunction $dfc006ada1995968$var$computeLinearBoundary(source) {\n const { scale: scale = {}, fill: fill } = source;\n const pixel = $dfc006ada1995968$var$_getTargetPixel(fill, scale);\n if ((0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(pixel)) {\n const horizontal = scale.isHorizontal();\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n return null;\n}\nfunction $dfc006ada1995968$var$computeCircularBoundary(source) {\n const { scale: scale, fill: fill } = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = $dfc006ada1995968$var$_getTargetValue(fill, scale, start);\n const target = [];\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new $dfc006ada1995968$var$simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n for(let i = 0; i < length; ++i)target.push(scale.getPointPositionForValue(i, value));\n return target;\n}\nfunction $dfc006ada1995968$var$_drawfill(ctx, source, area) {\n const target = $dfc006ada1995968$var$_getTarget(source);\n const { line: line, scale: scale, axis: axis } = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const { above: above = color, below: below = color } = fillOption || {};\n if (target && line.points.length) {\n (0, $c4d1694fa24f1a71$export$8743009a87fcb00f)(ctx, area);\n $dfc006ada1995968$var$doFill(ctx, {\n line: line,\n target: target,\n above: above,\n below: below,\n area: area,\n scale: scale,\n axis: axis\n });\n (0, $c4d1694fa24f1a71$export$3d8c2f653ac9d0b9)(ctx);\n }\n}\nfunction $dfc006ada1995968$var$doFill(ctx, cfg) {\n const { line: line, target: target, above: above, below: below, area: area, scale: scale } = cfg;\n const property = line._loop ? \"angle\" : cfg.axis;\n ctx.save();\n if (property === \"x\" && below !== above) {\n $dfc006ada1995968$var$clipVertical(ctx, target, area.top);\n $dfc006ada1995968$var$fill(ctx, {\n line: line,\n target: target,\n color: above,\n scale: scale,\n property: property\n });\n ctx.restore();\n ctx.save();\n $dfc006ada1995968$var$clipVertical(ctx, target, area.bottom);\n }\n $dfc006ada1995968$var$fill(ctx, {\n line: line,\n target: target,\n color: below,\n scale: scale,\n property: property\n });\n ctx.restore();\n}\nfunction $dfc006ada1995968$var$clipVertical(ctx, target, clipY) {\n const { segments: segments, points: points } = target;\n let first = true;\n let lineLoop = false;\n ctx.beginPath();\n for (const segment of segments){\n const { start: start, end: end } = segment;\n const firstPoint = points[start];\n const lastPoint = points[$dfc006ada1995968$var$_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {\n move: lineLoop\n });\n if (lineLoop) ctx.closePath();\n else ctx.lineTo(lastPoint.x, clipY);\n }\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\nfunction $dfc006ada1995968$var$fill(ctx, cfg) {\n const { line: line, target: target, property: property, color: color, scale: scale } = cfg;\n const segments = $dfc006ada1995968$var$_segments(line, target, property);\n for (const { source: src, target: tgt, start: start, end: end } of segments){\n const { style: { backgroundColor: backgroundColor = color } = {} } = src;\n const notShape = target !== true;\n ctx.save();\n ctx.fillStyle = backgroundColor;\n $dfc006ada1995968$var$clipBounds(ctx, scale, notShape && $dfc006ada1995968$var$_getBounds(property, start, end));\n ctx.beginPath();\n const lineLoop = !!line.pathSegment(ctx, src);\n let loop;\n if (notShape) {\n if (lineLoop) ctx.closePath();\n else $dfc006ada1995968$var$interpolatedLineTo(ctx, target, end, property);\n const targetLoop = !!target.pathSegment(ctx, tgt, {\n move: lineLoop,\n reverse: true\n });\n loop = lineLoop && targetLoop;\n if (!loop) $dfc006ada1995968$var$interpolatedLineTo(ctx, target, start, property);\n }\n ctx.closePath();\n ctx.fill(loop ? \"evenodd\" : \"nonzero\");\n ctx.restore();\n }\n}\nfunction $dfc006ada1995968$var$clipBounds(ctx, scale, bounds) {\n const { top: top, bottom: bottom } = scale.chart.chartArea;\n const { property: property, start: start, end: end } = bounds || {};\n if (property === \"x\") {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\nfunction $dfc006ada1995968$var$interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n}\nvar $dfc006ada1995968$export$d19ba4d812bed757 = {\n id: \"filler\",\n afterDatasetsUpdate (chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n for(i = 0; i < count; ++i){\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n if (line && line.options && line instanceof $dfc006ada1995968$export$55e463fa7bcd3469) source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: $dfc006ada1995968$var$_decodeFill(line, i, count),\n chart: chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line: line\n };\n meta.$filler = source;\n sources.push(source);\n }\n for(i = 0; i < count; ++i){\n source = sources[i];\n if (!source || source.fill === false) continue;\n source.fill = $dfc006ada1995968$var$_resolveTarget(sources, i, options.propagate);\n }\n },\n beforeDraw (chart, _args, options) {\n const draw = options.drawTime === \"beforeDraw\";\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (!source) continue;\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) $dfc006ada1995968$var$_drawfill(chart.ctx, source, area);\n }\n },\n beforeDatasetsDraw (chart, _args, options) {\n if (options.drawTime !== \"beforeDatasetsDraw\") return;\n const metasets = chart.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if ($dfc006ada1995968$var$_shouldApplyFill(source)) $dfc006ada1995968$var$_drawfill(chart.ctx, source, chart.chartArea);\n }\n },\n beforeDatasetDraw (chart, args, options) {\n const source = args.meta.$filler;\n if (!$dfc006ada1995968$var$_shouldApplyFill(source) || options.drawTime !== \"beforeDatasetDraw\") return;\n $dfc006ada1995968$var$_drawfill(chart.ctx, source, chart.chartArea);\n },\n defaults: {\n propagate: true,\n drawTime: \"beforeDatasetDraw\"\n }\n};\nconst $dfc006ada1995968$var$getBoxSize = (labelOpts, fontSize)=>{\n let { boxHeight: boxHeight = fontSize, boxWidth: boxWidth = fontSize } = labelOpts;\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n return {\n boxWidth: boxWidth,\n boxHeight: boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\nconst $dfc006ada1995968$var$itemsEqual = (a, b)=>a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass $dfc006ada1995968$var$Legend extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(labelOpts.generateLabels, [\n this.chart\n ], this) || [];\n if (labelOpts.filter) legendItems = legendItems.filter((item)=>labelOpts.filter(item, this.chart.data));\n if (labelOpts.sort) legendItems = legendItems.sort((a, b)=>labelOpts.sort(a, b, this.chart.data));\n if (this.options.reverse) legendItems.reverse();\n this.legendItems = legendItems;\n }\n fit() {\n const { options: options, ctx: ctx } = this;\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n const labelOpts = options.labels;\n const labelFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const { boxWidth: boxWidth, itemHeight: itemHeight } = $dfc006ada1995968$var$getBoxSize(labelOpts, fontSize);\n let width, height;\n ctx.font = labelFont.string;\n if (this.isHorizontal()) {\n width = this.maxWidth;\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight;\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const { ctx: ctx, maxWidth: maxWidth, options: { labels: { padding: padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const lineWidths = this.lineWidths = [\n 0\n ];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i)=>{\n const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n hitboxes[i] = {\n left: 0,\n top: top,\n row: row,\n width: itemWidth,\n height: itemHeight\n };\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n return totalHeight;\n }\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const { ctx: ctx, maxHeight: maxHeight, options: { labels: { padding: padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n let left = 0;\n let col = 0;\n this.legendItems.forEach((legendItem, i)=>{\n const { itemWidth: itemWidth, itemHeight: itemHeight } = $dfc006ada1995968$var$calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n hitboxes[i] = {\n left: left,\n top: currentColHeight,\n col: col,\n width: itemWidth,\n height: itemHeight\n };\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n totalWidth += currentColWidth;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n return totalWidth;\n }\n adjustHitBoxes() {\n if (!this.options.display) return;\n const titleHeight = this._computeTitleHeight();\n const { legendHitBoxes: hitboxes, options: { align: align, labels: { padding: padding }, rtl: rtl } } = this;\n const rtlHelper = (0, $c4d1694fa24f1a71$export$3d12bd131bb975d1)(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes){\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes){\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n isHorizontal() {\n return this.options.position === \"top\" || this.options.position === \"bottom\";\n }\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n (0, $c4d1694fa24f1a71$export$8743009a87fcb00f)(ctx, this);\n this._draw();\n (0, $c4d1694fa24f1a71$export$3d8c2f653ac9d0b9)(ctx);\n }\n }\n _draw() {\n const { options: opts, columnSizes: columnSizes, lineWidths: lineWidths, ctx: ctx } = this;\n const { align: align, labels: labelOpts } = opts;\n const defaultColor = (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).color;\n const rtlHelper = (0, $c4d1694fa24f1a71$export$3d12bd131bb975d1)(opts.rtl, this.left, this.width);\n const labelFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(labelOpts.font);\n const { padding: padding } = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n this.drawTitle();\n ctx.textAlign = rtlHelper.textAlign(\"left\");\n ctx.textBaseline = \"middle\";\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n const { boxWidth: boxWidth, boxHeight: boxHeight, itemHeight: itemHeight } = $dfc006ada1995968$var$getBoxSize(labelOpts, fontSize);\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) return;\n ctx.save();\n const lineWidth = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.lineWidth, 1);\n ctx.fillStyle = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.fillStyle, defaultColor);\n ctx.lineCap = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.lineCap, \"butt\");\n ctx.lineDashOffset = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.lineDashOffset, 0);\n ctx.lineJoin = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.lineJoin, \"miter\");\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.strokeStyle, defaultColor);\n ctx.setLineDash((0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.lineDash, []));\n if (labelOpts.usePointStyle) {\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n (0, $c4d1694fa24f1a71$export$24baa2b76016ce0e)(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(legendItem.borderRadius);\n ctx.beginPath();\n if (Object.values(borderRadius).some((v)=>v !== 0)) (0, $c4d1694fa24f1a71$export$1fbe638ecf81657e)(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n else ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n ctx.fill();\n if (lineWidth !== 0) ctx.stroke();\n }\n ctx.restore();\n };\n const fillText = function(x, y, legendItem) {\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) cursor = {\n x: (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n else cursor = {\n x: this.left + padding,\n y: (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n (0, $c4d1694fa24f1a71$export$91c6e00c14e7e6fd)(this.ctx, opts.textDirection);\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i)=>{\n ctx.strokeStyle = legendItem.fontColor;\n ctx.fillStyle = legendItem.fontColor;\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n rtlHelper.setWidth(this.width);\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n const realX = rtlHelper.x(x);\n drawLegendBox(realX, y, legendItem);\n x = (0, $c4d1694fa24f1a71$export$9d398bebfec1c039)(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n fillText(rtlHelper.x(x), y, legendItem);\n if (isHorizontal) cursor.x += width + padding;\n else if (typeof legendItem.text !== \"string\") {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += $dfc006ada1995968$var$calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else cursor.y += lineHeight;\n });\n (0, $c4d1694fa24f1a71$export$890c4ad488842ce7)(this.ctx, opts.textDirection);\n }\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(titleOpts.font);\n const titlePadding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(titleOpts.padding);\n if (!titleOpts.display) return;\n const rtlHelper = (0, $c4d1694fa24f1a71$export$3d12bd131bb975d1)(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n let left = this.left;\n let maxWidth = this.width;\n if (this.isHorizontal()) {\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(opts.align, left, this.right - maxWidth);\n } else {\n const maxHeight = this.columnSizes.reduce((acc, size)=>Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n const x = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(position, left, left + maxWidth);\n ctx.textAlign = rtlHelper.textAlign((0, $c4d1694fa24f1a71$export$3c2fa207a37baaea)(position));\n ctx.textBaseline = \"middle\";\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, titleOpts.text, x, y, titleFont);\n }\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(titleOpts.font);\n const titlePadding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n if ((0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(x, this.left, this.right) && (0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(y, this.top, this.bottom)) {\n lh = this.legendHitBoxes;\n for(i = 0; i < lh.length; ++i){\n hitBox = lh[i];\n if ((0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(x, hitBox.left, hitBox.left + hitBox.width) && (0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(y, hitBox.top, hitBox.top + hitBox.height)) return this.legendItems[i];\n }\n }\n return null;\n }\n handleEvent(e) {\n const opts = this.options;\n if (!$dfc006ada1995968$var$isListened(e.type, opts)) return;\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n if (e.type === \"mousemove\" || e.type === \"mouseout\") {\n const previous = this._hoveredItem;\n const sameItem = $dfc006ada1995968$var$itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(opts.onLeave, [\n e,\n previous,\n this\n ], this);\n this._hoveredItem = hoveredItem;\n if (hoveredItem && !sameItem) (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(opts.onHover, [\n e,\n hoveredItem,\n this\n ], this);\n } else if (hoveredItem) (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(opts.onClick, [\n e,\n hoveredItem,\n this\n ], this);\n }\n constructor(config){\n super();\n this._added = false;\n this.legendHitBoxes = [];\n this._hoveredItem = null;\n this.doughnutMode = false;\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n}\nfunction $dfc006ada1995968$var$calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = $dfc006ada1995968$var$calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = $dfc006ada1995968$var$calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {\n itemWidth: itemWidth,\n itemHeight: itemHeight\n };\n}\nfunction $dfc006ada1995968$var$calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== \"string\") legendItemText = legendItemText.reduce((a, b)=>a.length > b.length ? a : b);\n return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width;\n}\nfunction $dfc006ada1995968$var$calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== \"string\") itemHeight = $dfc006ada1995968$var$calculateLegendItemHeight(legendItem, fontLineHeight);\n return itemHeight;\n}\nfunction $dfc006ada1995968$var$calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\nfunction $dfc006ada1995968$var$isListened(type, opts) {\n if ((type === \"mousemove\" || type === \"mouseout\") && (opts.onHover || opts.onLeave)) return true;\n if (opts.onClick && (type === \"click\" || type === \"mouseup\")) return true;\n return false;\n}\nvar $dfc006ada1995968$export$ed247974535929c7 = {\n id: \"legend\",\n _element: $dfc006ada1995968$var$Legend,\n start (chart, _args, options) {\n const legend = chart.legend = new $dfc006ada1995968$var$Legend({\n ctx: chart.ctx,\n options: options,\n chart: chart\n });\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(chart, legend, options);\n $dfc006ada1995968$export$1ecca0613f5e56d2.addBox(chart, legend);\n },\n stop (chart) {\n $dfc006ada1995968$export$1ecca0613f5e56d2.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n beforeUpdate (chart, _args, options) {\n const legend = chart.legend;\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(chart, legend, options);\n legend.options = options;\n },\n afterUpdate (chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n afterEvent (chart, args) {\n if (!args.replay) chart.legend.handleEvent(args.event);\n },\n defaults: {\n display: true,\n position: \"top\",\n align: \"center\",\n fullSize: true,\n reverse: false,\n weight: 1000,\n onClick (e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n onHover: null,\n onLeave: null,\n labels: {\n color: (ctx)=>ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n generateLabels (chart) {\n const datasets = chart.data.datasets;\n const { labels: { usePointStyle: usePointStyle, pointStyle: pointStyle, textAlign: textAlign, color: color, useBorderRadius: useBorderRadius, borderRadius: borderRadius } } = chart.legend.options;\n return chart._getSortedDatasetMetas().map((meta)=>{\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(style.borderWidth);\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n title: {\n color: (ctx)=>ctx.chart.options.color,\n display: false,\n position: \"center\",\n text: \"\"\n }\n },\n descriptors: {\n _scriptable: (name)=>!name.startsWith(\"on\"),\n labels: {\n _scriptable: (name)=>![\n \"generateLabels\",\n \"filter\",\n \"sort\"\n ].includes(name)\n }\n }\n};\nclass $dfc006ada1995968$var$Title extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n update(maxWidth, maxHeight) {\n const opts = this.options;\n this.left = 0;\n this.top = 0;\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n const lineCount = (0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(opts.text) ? opts.text.length : 1;\n this._padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(opts.padding);\n const textSize = lineCount * (0, $c4d1694fa24f1a71$export$34aec0b863436764)(opts.font).lineHeight + this._padding.height;\n if (this.isHorizontal()) this.height = textSize;\n else this.width = textSize;\n }\n isHorizontal() {\n const pos = this.options.position;\n return pos === \"top\" || pos === \"bottom\";\n }\n _drawArgs(offset) {\n const { top: top, left: left, bottom: bottom, right: right, options: options } = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n if (this.isHorizontal()) {\n titleX = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === \"left\") {\n titleX = left + offset;\n titleY = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, bottom, top);\n rotation = (0, $c4d1694fa24f1a71$export$56c0d5a1e737357d) * -0.5;\n } else {\n titleX = right - offset;\n titleY = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, top, bottom);\n rotation = (0, $c4d1694fa24f1a71$export$56c0d5a1e737357d) * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {\n titleX: titleX,\n titleY: titleY,\n maxWidth: maxWidth,\n rotation: rotation\n };\n }\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n if (!opts.display) return;\n const fontOpts = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const { titleX: titleX, titleY: titleY, maxWidth: maxWidth, rotation: rotation } = this._drawArgs(offset);\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth: maxWidth,\n rotation: rotation,\n textAlign: (0, $c4d1694fa24f1a71$export$3c2fa207a37baaea)(opts.align),\n textBaseline: \"middle\",\n translation: [\n titleX,\n titleY\n ]\n });\n }\n constructor(config){\n super();\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n}\nfunction $dfc006ada1995968$var$createTitle(chart, titleOpts) {\n const title = new $dfc006ada1995968$var$Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart: chart\n });\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(chart, title, titleOpts);\n $dfc006ada1995968$export$1ecca0613f5e56d2.addBox(chart, title);\n chart.titleBlock = title;\n}\nvar $dfc006ada1995968$export$f99233281efd08a0 = {\n id: \"title\",\n _element: $dfc006ada1995968$var$Title,\n start (chart, _args, options) {\n $dfc006ada1995968$var$createTitle(chart, options);\n },\n stop (chart) {\n const titleBlock = chart.titleBlock;\n $dfc006ada1995968$export$1ecca0613f5e56d2.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n beforeUpdate (chart, _args, options) {\n const title = chart.titleBlock;\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: \"center\",\n display: false,\n font: {\n weight: \"bold\"\n },\n fullSize: true,\n padding: 10,\n position: \"top\",\n text: \"\",\n weight: 2000\n },\n defaultRoutes: {\n color: \"color\"\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\nconst $dfc006ada1995968$var$map = new WeakMap();\nvar $dfc006ada1995968$export$d5c56664638992a4 = {\n id: \"subtitle\",\n start (chart, _args, options) {\n const title = new $dfc006ada1995968$var$Title({\n ctx: chart.ctx,\n options: options,\n chart: chart\n });\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(chart, title, options);\n $dfc006ada1995968$export$1ecca0613f5e56d2.addBox(chart, title);\n $dfc006ada1995968$var$map.set(chart, title);\n },\n stop (chart) {\n $dfc006ada1995968$export$1ecca0613f5e56d2.removeBox(chart, $dfc006ada1995968$var$map.get(chart));\n $dfc006ada1995968$var$map.delete(chart);\n },\n beforeUpdate (chart, _args, options) {\n const title = $dfc006ada1995968$var$map.get(chart);\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: \"center\",\n display: false,\n font: {\n weight: \"normal\"\n },\n fullSize: true,\n padding: 0,\n position: \"top\",\n text: \"\",\n weight: 1500\n },\n defaultRoutes: {\n color: \"color\"\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\nconst $dfc006ada1995968$var$positioners = {\n average (items) {\n if (!items.length) return false;\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n return {\n x: x / count,\n y: y / count\n };\n },\n nearest (items, eventPosition) {\n if (!items.length) return false;\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = (0, $c4d1694fa24f1a71$export$158acd800e1ef08b)(eventPosition, center);\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n return {\n x: x,\n y: y\n };\n }\n};\nfunction $dfc006ada1995968$var$pushOrConcat(base, toPush) {\n if (toPush) {\n if ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(toPush)) Array.prototype.push.apply(base, toPush);\n else base.push(toPush);\n }\n return base;\n}\nfunction $dfc006ada1995968$var$splitNewlines(str) {\n if ((typeof str === \"string\" || str instanceof String) && str.indexOf(\"\\n\") > -1) return str.split(\"\\n\");\n return str;\n}\nfunction $dfc006ada1995968$var$createTooltipItem(chart, item) {\n const { element: element, datasetIndex: datasetIndex, index: index } = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const { label: label, value: value } = controller.getLabelAndValue(index);\n return {\n chart: chart,\n label: label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex: datasetIndex,\n element: element\n };\n}\nfunction $dfc006ada1995968$var$getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const { body: body, footer: footer, title: title } = tooltip;\n const { boxWidth: boxWidth, boxHeight: boxHeight } = options;\n const bodyFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.bodyFont);\n const titleFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.titleFont);\n const footerFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(options.padding);\n let height = padding.height;\n let width = 0;\n let combinedBodyLength = body.reduce((count, bodyItem)=>count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n if (titleLineCount) height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;\n if (combinedBodyLength) {\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n ctx.save();\n ctx.font = titleFont.string;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(tooltip.title, maxLineWidth);\n ctx.font = bodyFont.string;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(body, (bodyItem)=>{\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(bodyItem.before, maxLineWidth);\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(bodyItem.lines, maxLineWidth);\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(bodyItem.after, maxLineWidth);\n });\n widthPadding = 0;\n ctx.font = footerFont.string;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(tooltip.footer, maxLineWidth);\n ctx.restore();\n width += padding.width;\n return {\n width: width,\n height: height\n };\n}\nfunction $dfc006ada1995968$var$determineYAlign(chart, size) {\n const { y: y, height: height } = size;\n if (y < height / 2) return \"top\";\n else if (y > chart.height - height / 2) return \"bottom\";\n return \"center\";\n}\nfunction $dfc006ada1995968$var$doesNotFitWithAlign(xAlign, chart, options, size) {\n const { x: x, width: width } = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === \"left\" && x + width + caret > chart.width) return true;\n if (xAlign === \"right\" && x - width - caret < 0) return true;\n}\nfunction $dfc006ada1995968$var$determineXAlign(chart, options, size, yAlign) {\n const { x: x, width: width } = size;\n const { width: chartWidth, chartArea: { left: left, right: right } } = chart;\n let xAlign = \"center\";\n if (yAlign === \"center\") xAlign = x <= (left + right) / 2 ? \"left\" : \"right\";\n else if (x <= width / 2) xAlign = \"left\";\n else if (x >= chartWidth - width / 2) xAlign = \"right\";\n if ($dfc006ada1995968$var$doesNotFitWithAlign(xAlign, chart, options, size)) xAlign = \"center\";\n return xAlign;\n}\nfunction $dfc006ada1995968$var$determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || $dfc006ada1995968$var$determineYAlign(chart, size);\n return {\n xAlign: size.xAlign || options.xAlign || $dfc006ada1995968$var$determineXAlign(chart, options, size, yAlign),\n yAlign: yAlign\n };\n}\nfunction $dfc006ada1995968$var$alignX(size, xAlign) {\n let { x: x, width: width } = size;\n if (xAlign === \"right\") x -= width;\n else if (xAlign === \"center\") x -= width / 2;\n return x;\n}\nfunction $dfc006ada1995968$var$alignY(size, yAlign, paddingAndSize) {\n let { y: y, height: height } = size;\n if (yAlign === \"top\") y += paddingAndSize;\n else if (yAlign === \"bottom\") y -= height + paddingAndSize;\n else y -= height / 2;\n return y;\n}\nfunction $dfc006ada1995968$var$getBackgroundPoint(options, size, alignment, chart) {\n const { caretSize: caretSize, caretPadding: caretPadding, cornerRadius: cornerRadius } = options;\n const { xAlign: xAlign, yAlign: yAlign } = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const { topLeft: topLeft, topRight: topRight, bottomLeft: bottomLeft, bottomRight: bottomRight } = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(cornerRadius);\n let x = $dfc006ada1995968$var$alignX(size, xAlign);\n const y = $dfc006ada1995968$var$alignY(size, yAlign, paddingAndSize);\n if (yAlign === \"center\") {\n if (xAlign === \"left\") x += paddingAndSize;\n else if (xAlign === \"right\") x -= paddingAndSize;\n } else if (xAlign === \"left\") x -= Math.max(topLeft, bottomLeft) + caretSize;\n else if (xAlign === \"right\") x += Math.max(topRight, bottomRight) + caretSize;\n return {\n x: (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(x, 0, chart.width - size.width),\n y: (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(y, 0, chart.height - size.height)\n };\n}\nfunction $dfc006ada1995968$var$getAlignedX(tooltip, align, options) {\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(options.padding);\n return align === \"center\" ? tooltip.x + tooltip.width / 2 : align === \"right\" ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;\n}\nfunction $dfc006ada1995968$var$getBeforeAfterBodyLines(callback) {\n return $dfc006ada1995968$var$pushOrConcat([], $dfc006ada1995968$var$splitNewlines(callback));\n}\nfunction $dfc006ada1995968$var$createTooltipContext(parent, tooltip, tooltipItems) {\n return (0, $c4d1694fa24f1a71$export$35e795649ee09318)(parent, {\n tooltip: tooltip,\n tooltipItems: tooltipItems,\n type: \"tooltip\"\n });\n}\nfunction $dfc006ada1995968$var$overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\nconst $dfc006ada1995968$var$defaultCallbacks = {\n beforeTitle: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n title (tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n if (this && this.options && this.options.mode === \"dataset\") return item.dataset.label || \"\";\n else if (item.label) return item.label;\n else if (labelCount > 0 && item.dataIndex < labelCount) return labels[item.dataIndex];\n }\n return \"\";\n },\n afterTitle: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n beforeBody: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n beforeLabel: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n label (tooltipItem) {\n if (this && this.options && this.options.mode === \"dataset\") return tooltipItem.label + \": \" + tooltipItem.formattedValue || tooltipItem.formattedValue;\n let label = tooltipItem.dataset.label || \"\";\n if (label) label += \": \";\n const value = tooltipItem.formattedValue;\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(value)) label += value;\n return label;\n },\n labelColor (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0\n };\n },\n labelTextColor () {\n return this.options.bodyColor;\n },\n labelPointStyle (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation\n };\n },\n afterLabel: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n afterBody: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n beforeFooter: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n footer: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n afterFooter: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46)\n};\nfunction $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n if (typeof result === \"undefined\") return $dfc006ada1995968$var$defaultCallbacks[name].call(ctx, arg);\n return result;\n}\nclass $dfc006ada1995968$var$Tooltip extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n if (cached) return cached;\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new $dfc006ada1995968$export$8ab227dac26677d(this.chart, opts);\n if (opts._cacheable) this._cachedAnimations = Object.freeze(animations);\n return animations;\n }\n getContext() {\n return this.$context || (this.$context = $dfc006ada1995968$var$createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n getTitle(context, options) {\n const { callbacks: callbacks } = options;\n const beforeTitle = $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, \"beforeTitle\", this, context);\n const title = $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, \"title\", this, context);\n const afterTitle = $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, \"afterTitle\", this, context);\n let lines = [];\n lines = $dfc006ada1995968$var$pushOrConcat(lines, $dfc006ada1995968$var$splitNewlines(beforeTitle));\n lines = $dfc006ada1995968$var$pushOrConcat(lines, $dfc006ada1995968$var$splitNewlines(title));\n lines = $dfc006ada1995968$var$pushOrConcat(lines, $dfc006ada1995968$var$splitNewlines(afterTitle));\n return lines;\n }\n getBeforeBody(tooltipItems, options) {\n return $dfc006ada1995968$var$getBeforeAfterBodyLines($dfc006ada1995968$var$invokeCallbackWithFallback(options.callbacks, \"beforeBody\", this, tooltipItems));\n }\n getBody(tooltipItems, options) {\n const { callbacks: callbacks } = options;\n const bodyItems = [];\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(tooltipItems, (context)=>{\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = $dfc006ada1995968$var$overrideCallbacks(callbacks, context);\n $dfc006ada1995968$var$pushOrConcat(bodyItem.before, $dfc006ada1995968$var$splitNewlines($dfc006ada1995968$var$invokeCallbackWithFallback(scoped, \"beforeLabel\", this, context)));\n $dfc006ada1995968$var$pushOrConcat(bodyItem.lines, $dfc006ada1995968$var$invokeCallbackWithFallback(scoped, \"label\", this, context));\n $dfc006ada1995968$var$pushOrConcat(bodyItem.after, $dfc006ada1995968$var$splitNewlines($dfc006ada1995968$var$invokeCallbackWithFallback(scoped, \"afterLabel\", this, context)));\n bodyItems.push(bodyItem);\n });\n return bodyItems;\n }\n getAfterBody(tooltipItems, options) {\n return $dfc006ada1995968$var$getBeforeAfterBodyLines($dfc006ada1995968$var$invokeCallbackWithFallback(options.callbacks, \"afterBody\", this, tooltipItems));\n }\n getFooter(tooltipItems, options) {\n const { callbacks: callbacks } = options;\n const beforeFooter = $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, \"beforeFooter\", this, tooltipItems);\n const footer = $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, \"footer\", this, tooltipItems);\n const afterFooter = $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, \"afterFooter\", this, tooltipItems);\n let lines = [];\n lines = $dfc006ada1995968$var$pushOrConcat(lines, $dfc006ada1995968$var$splitNewlines(beforeFooter));\n lines = $dfc006ada1995968$var$pushOrConcat(lines, $dfc006ada1995968$var$splitNewlines(footer));\n lines = $dfc006ada1995968$var$pushOrConcat(lines, $dfc006ada1995968$var$splitNewlines(afterFooter));\n return lines;\n }\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n for(i = 0, len = active.length; i < len; ++i)tooltipItems.push($dfc006ada1995968$var$createTooltipItem(this.chart, active[i]));\n if (options.filter) tooltipItems = tooltipItems.filter((element, index, array)=>options.filter(element, index, array, data));\n if (options.itemSort) tooltipItems = tooltipItems.sort((a, b)=>options.itemSort(a, b, data));\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(tooltipItems, (context)=>{\n const scoped = $dfc006ada1995968$var$overrideCallbacks(options.callbacks, context);\n labelColors.push($dfc006ada1995968$var$invokeCallbackWithFallback(scoped, \"labelColor\", this, context));\n labelPointStyles.push($dfc006ada1995968$var$invokeCallbackWithFallback(scoped, \"labelPointStyle\", this, context));\n labelTextColors.push($dfc006ada1995968$var$invokeCallbackWithFallback(scoped, \"labelTextColor\", this, context));\n });\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n if (!active.length) {\n if (this.opacity !== 0) properties = {\n opacity: 0\n };\n } else {\n const position = $dfc006ada1995968$var$positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n const size = this._size = $dfc006ada1995968$var$getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = $dfc006ada1995968$var$determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = $dfc006ada1995968$var$getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n if (properties) this._resolveAnimations().update(this, properties);\n if (changed && options.external) options.external.call(this, {\n chart: this.chart,\n tooltip: this,\n replay: replay\n });\n }\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n getCaretPosition(tooltipPoint, size, options) {\n const { xAlign: xAlign, yAlign: yAlign } = this;\n const { caretSize: caretSize, cornerRadius: cornerRadius } = options;\n const { topLeft: topLeft, topRight: topRight, bottomLeft: bottomLeft, bottomRight: bottomRight } = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(cornerRadius);\n const { x: ptX, y: ptY } = tooltipPoint;\n const { width: width, height: height } = size;\n let x1, x2, x3, y1, y2, y3;\n if (yAlign === \"center\") {\n y2 = ptY + height / 2;\n if (xAlign === \"left\") {\n x1 = ptX;\n x2 = x1 - caretSize;\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n x3 = x1;\n } else {\n if (xAlign === \"left\") x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize;\n else if (xAlign === \"right\") x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n else x2 = this.caretX;\n if (yAlign === \"top\") {\n y1 = ptY;\n y2 = y1 - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {\n x1: x1,\n x2: x2,\n x3: x3,\n y1: y1,\n y2: y2,\n y3: y3\n };\n }\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n if (length) {\n const rtlHelper = (0, $c4d1694fa24f1a71$export$3d12bd131bb975d1)(options.rtl, this.x, this.width);\n pt.x = $dfc006ada1995968$var$getAlignedX(this, options.titleAlign, options);\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = \"middle\";\n titleFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.titleFont);\n titleSpacing = options.titleSpacing;\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing;\n if (i + 1 === length) pt.y += options.titleMarginBottom - titleSpacing;\n }\n }\n }\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const { boxHeight: boxHeight, boxWidth: boxWidth } = options;\n const bodyFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.bodyFont);\n const colorX = $dfc006ada1995968$var$getAlignedX(this, \"left\", options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2,\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n (0, $c4d1694fa24f1a71$export$493d36ec626b6698)(ctx, drawOptions, centerX, centerY);\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n (0, $c4d1694fa24f1a71$export$493d36ec626b6698)(ctx, drawOptions, centerX, centerY);\n } else {\n ctx.lineWidth = (0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1;\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(labelColor.borderRadius);\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n (0, $c4d1694fa24f1a71$export$1fbe638ecf81657e)(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n (0, $c4d1694fa24f1a71$export$1fbe638ecf81657e)(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n ctx.fillStyle = this.labelTextColors[i];\n }\n drawBody(pt, ctx, options) {\n const { body: body } = this;\n const { bodySpacing: bodySpacing, bodyAlign: bodyAlign, displayColors: displayColors, boxHeight: boxHeight, boxWidth: boxWidth, boxPadding: boxPadding } = options;\n const bodyFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n const rtlHelper = (0, $c4d1694fa24f1a71$export$3d12bd131bb975d1)(options.rtl, this.x, this.width);\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = \"middle\";\n ctx.font = bodyFont.string;\n pt.x = $dfc006ada1995968$var$getAlignedX(this, bodyAlignForCalculation, options);\n ctx.fillStyle = options.bodyColor;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this.beforeBody, fillLineOfText);\n xLinePadding = displayColors && bodyAlignForCalculation !== \"right\" ? bodyAlign === \"center\" ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;\n for(i = 0, ilen = body.length; i < ilen; ++i){\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n ctx.fillStyle = textColor;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(bodyItem.before, fillLineOfText);\n lines = bodyItem.lines;\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n for(j = 0, jlen = lines.length; j < jlen; ++j){\n fillLineOfText(lines[j]);\n bodyLineHeight = bodyFont.lineHeight;\n }\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(bodyItem.after, fillLineOfText);\n }\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing;\n }\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n if (length) {\n const rtlHelper = (0, $c4d1694fa24f1a71$export$3d12bd131bb975d1)(options.rtl, this.x, this.width);\n pt.x = $dfc006ada1995968$var$getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = \"middle\";\n footerFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.footerFont);\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n drawBackground(pt, ctx, tooltipSize, options) {\n const { xAlign: xAlign, yAlign: yAlign } = this;\n const { x: x, y: y } = pt;\n const { width: width, height: height } = tooltipSize;\n const { topLeft: topLeft, topRight: topRight, bottomLeft: bottomLeft, bottomRight: bottomRight } = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(options.cornerRadius);\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === \"top\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === \"center\" && xAlign === \"right\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === \"bottom\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === \"center\" && xAlign === \"left\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n ctx.fill();\n if (options.borderWidth > 0) ctx.stroke();\n }\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = $dfc006ada1995968$var$positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) return;\n const size = this._size = $dfc006ada1995968$var$getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = $dfc006ada1995968$var$determineAlignment(chart, options, positionAndSize);\n const point = $dfc006ada1995968$var$getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n _willRender() {\n return !!this.opacity;\n }\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n if (!opacity) return;\n this._updateAnimationTarget(options);\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(options.padding);\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n this.drawBackground(pt, ctx, tooltipSize, options);\n (0, $c4d1694fa24f1a71$export$91c6e00c14e7e6fd)(ctx, options.textDirection);\n pt.y += padding.top;\n this.drawTitle(pt, ctx, options);\n this.drawBody(pt, ctx, options);\n this.drawFooter(pt, ctx, options);\n (0, $c4d1694fa24f1a71$export$890c4ad488842ce7)(ctx, options.textDirection);\n ctx.restore();\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({ datasetIndex: datasetIndex, index: index })=>{\n const meta = this.chart.getDatasetMeta(datasetIndex);\n if (!meta) throw new Error(\"Cannot find a dataset at index \" + datasetIndex);\n return {\n datasetIndex: datasetIndex,\n element: meta.data[index],\n index: index\n };\n });\n const changed = !(0, $c4d1694fa24f1a71$export$995eb9fca571757)(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) return false;\n this._ignoreReplayEvents = false;\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n const positionChanged = this._positionChanged(active, e);\n const changed = replay || !(0, $c4d1694fa24f1a71$export$995eb9fca571757)(active, lastActive) || positionChanged;\n if (changed) {\n this._active = active;\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n this.update(true, replay);\n }\n }\n return changed;\n }\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n if (e.type === \"mouseout\") return [];\n if (!inChartArea) return lastActive;\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n if (options.reverse) active.reverse();\n return active;\n }\n _positionChanged(active, e) {\n const { caretX: caretX, caretY: caretY, options: options } = this;\n const position = $dfc006ada1995968$var$positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n constructor(config){\n super();\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$var$Tooltip, \"positioners\", $dfc006ada1995968$var$positioners);\nvar $dfc006ada1995968$export$28c660c63b792dea = {\n id: \"tooltip\",\n _element: $dfc006ada1995968$var$Tooltip,\n positioners: $dfc006ada1995968$var$positioners,\n afterInit (chart, _args, options) {\n if (options) chart.tooltip = new $dfc006ada1995968$var$Tooltip({\n chart: chart,\n options: options\n });\n },\n beforeUpdate (chart, _args, options) {\n if (chart.tooltip) chart.tooltip.initialize(options);\n },\n reset (chart, _args, options) {\n if (chart.tooltip) chart.tooltip.initialize(options);\n },\n afterDraw (chart) {\n const tooltip = chart.tooltip;\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip: tooltip\n };\n if (chart.notifyPlugins(\"beforeTooltipDraw\", {\n ...args,\n cancelable: true\n }) === false) return;\n tooltip.draw(chart.ctx);\n chart.notifyPlugins(\"afterTooltipDraw\", args);\n }\n },\n afterEvent (chart, args) {\n if (chart.tooltip) {\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) args.changed = true;\n }\n },\n defaults: {\n enabled: true,\n external: null,\n position: \"average\",\n backgroundColor: \"rgba(0,0,0,0.8)\",\n titleColor: \"#fff\",\n titleFont: {\n weight: \"bold\"\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: \"left\",\n bodyColor: \"#fff\",\n bodySpacing: 2,\n bodyFont: {},\n bodyAlign: \"left\",\n footerColor: \"#fff\",\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: \"bold\"\n },\n footerAlign: \"left\",\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts)=>opts.bodyFont.size,\n boxWidth: (ctx, opts)=>opts.bodyFont.size,\n multiKeyBackground: \"#fff\",\n displayColors: true,\n boxPadding: 0,\n borderColor: \"rgba(0,0,0,0)\",\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: \"easeOutQuart\"\n },\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"width\",\n \"height\",\n \"caretX\",\n \"caretY\"\n ]\n },\n opacity: {\n easing: \"linear\",\n duration: 200\n }\n },\n callbacks: $dfc006ada1995968$var$defaultCallbacks\n },\n defaultRoutes: {\n bodyFont: \"font\",\n footerFont: \"font\",\n titleFont: \"font\"\n },\n descriptors: {\n _scriptable: (name)=>name !== \"filter\" && name !== \"itemSort\" && name !== \"external\",\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: \"animation\"\n }\n },\n additionalOptionScopes: [\n \"interaction\"\n ]\n};\nvar $dfc006ada1995968$export$8b3ca321c77fdea6 = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n Colors: $dfc006ada1995968$export$c537fa0d021d010b,\n Decimation: $dfc006ada1995968$export$be17f937e9aa7533,\n Filler: $dfc006ada1995968$export$d19ba4d812bed757,\n Legend: $dfc006ada1995968$export$ed247974535929c7,\n SubTitle: $dfc006ada1995968$export$d5c56664638992a4,\n Title: $dfc006ada1995968$export$f99233281efd08a0,\n Tooltip: $dfc006ada1995968$export$28c660c63b792dea\n});\nconst $dfc006ada1995968$var$addIfString = (labels, raw, index, addedLabels)=>{\n if (typeof raw === \"string\") {\n index = labels.push(raw) - 1;\n addedLabels.unshift({\n index: index,\n label: raw\n });\n } else if (isNaN(raw)) index = null;\n return index;\n};\nfunction $dfc006ada1995968$var$findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) return $dfc006ada1995968$var$addIfString(labels, raw, index, addedLabels);\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\nconst $dfc006ada1995968$var$validIndex = (index, max)=>index === null ? null : (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(Math.round(index), 0, max);\nfunction $dfc006ada1995968$var$_getLabelForValue(value) {\n const labels = this.getLabels();\n if (value >= 0 && value < labels.length) return labels[value];\n return value;\n}\nclass $dfc006ada1995968$export$29e663ba4d09fe7 extends $dfc006ada1995968$export$d60cfc58d3c358b6 {\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const { index: index, label: label } of added)if (labels[index] === label) labels.splice(index, 1);\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n parse(raw, index) {\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(raw)) return null;\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index : $dfc006ada1995968$var$findOrAddLabel(labels, raw, (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(index, raw), this._addedLabels);\n return $dfc006ada1995968$var$validIndex(index, labels.length - 1);\n }\n determineDataLimits() {\n const { minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let { min: min, max: max } = this.getMinMax(true);\n if (this.options.bounds === \"ticks\") {\n if (!minDefined) min = 0;\n if (!maxDefined) max = this.getLabels().length - 1;\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1);\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n for(let value = min; value <= max; value++)ticks.push({\n value: value\n });\n return ticks;\n }\n getLabelForValue(value) {\n return $dfc006ada1995968$var$_getLabelForValue.call(this, value);\n }\n configure() {\n super.configure();\n if (!this.isHorizontal()) this._reversePixels = !this._reversePixels;\n }\n getPixelForValue(value) {\n if (typeof value !== \"number\") value = this.parse(value);\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) return null;\n return this.getPixelForValue(ticks[index].value);\n }\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n getBasePixel() {\n return this.bottom;\n }\n constructor(cfg){\n super(cfg);\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$29e663ba4d09fe7, \"id\", \"category\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$29e663ba4d09fe7, \"defaults\", {\n ticks: {\n callback: $dfc006ada1995968$var$_getLabelForValue\n }\n});\nfunction $dfc006ada1995968$var$generateTicks$1(generationOptions, dataRange) {\n const ticks = [];\n const MIN_SPACING = 1e-14;\n const { bounds: bounds, step: step, min: min, max: max, precision: precision, count: count, maxTicks: maxTicks, maxDigits: maxDigits, includeBounds: includeBounds } = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const { min: rmin, max: rmax } = dataRange;\n const minDefined = !(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(min);\n const maxDefined = !(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(max);\n const countDefined = !(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = (0, $c4d1694fa24f1a71$export$a33b77bbdbb8366c)((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) return [\n {\n value: rmin\n },\n {\n value: rmax\n }\n ];\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) spacing = (0, $c4d1694fa24f1a71$export$a33b77bbdbb8366c)(numSpaces * spacing / maxSpaces / unit) * unit;\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(precision)) {\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n if (bounds === \"ticks\") {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n if (minDefined && maxDefined && step && (0, $c4d1694fa24f1a71$export$b9a6b53f9be3734)((max - min) / step, spacing / 1000)) {\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n numSpaces = (niceMax - niceMin) / spacing;\n if ((0, $c4d1694fa24f1a71$export$a05254e7c3aeba6e)(numSpaces, Math.round(numSpaces), spacing / 1000)) numSpaces = Math.round(numSpaces);\n else numSpaces = Math.ceil(numSpaces);\n }\n const decimalPlaces = Math.max((0, $c4d1694fa24f1a71$export$23ebac1979863676)(spacing), (0, $c4d1694fa24f1a71$export$23ebac1979863676)(niceMin));\n factor = Math.pow(10, (0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({\n value: min\n });\n if (niceMin < min) j++;\n if ((0, $c4d1694fa24f1a71$export$a05254e7c3aeba6e)(Math.round((niceMin + j * spacing) * factor) / factor, min, $dfc006ada1995968$var$relativeLabelSize(min, minSpacing, generationOptions))) j++;\n } else if (niceMin < min) j++;\n }\n for(; j < numSpaces; ++j){\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) break;\n ticks.push({\n value: tickValue\n });\n }\n if (maxDefined && includeBounds && niceMax !== max) {\n if (ticks.length && (0, $c4d1694fa24f1a71$export$a05254e7c3aeba6e)(ticks[ticks.length - 1].value, max, $dfc006ada1995968$var$relativeLabelSize(max, minSpacing, generationOptions))) ticks[ticks.length - 1].value = max;\n else ticks.push({\n value: max\n });\n } else if (!maxDefined || niceMax === max) ticks.push({\n value: niceMax\n });\n return ticks;\n}\nfunction $dfc006ada1995968$var$relativeLabelSize(value, minSpacing, { horizontal: horizontal, minRotation: minRotation }) {\n const rad = (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * (\"\" + value).length;\n return Math.min(minSpacing / ratio, length);\n}\nclass $dfc006ada1995968$var$LinearScaleBase extends $dfc006ada1995968$export$d60cfc58d3c358b6 {\n parse(raw, index) {\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(raw)) return null;\n if ((typeof raw === \"number\" || raw instanceof Number) && !isFinite(+raw)) return null;\n return +raw;\n }\n handleTickRangeOptions() {\n const { beginAtZero: beginAtZero } = this.options;\n const { minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let { min: min, max: max } = this;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (beginAtZero) {\n const minSign = (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(min);\n const maxSign = (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(max);\n if (minSign < 0 && maxSign < 0) setMax(0);\n else if (minSign > 0 && maxSign > 0) setMin(0);\n }\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n setMax(max + offset);\n if (!beginAtZero) setMin(min - offset);\n }\n this.min = min;\n this.max = max;\n }\n getTickLimit() {\n const tickOpts = this.options.ticks;\n let { maxTicksLimit: maxTicksLimit, stepSize: stepSize } = tickOpts;\n let maxTicks;\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n if (maxTicksLimit) maxTicks = Math.min(maxTicksLimit, maxTicks);\n return maxTicks;\n }\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n const numericGeneratorOptions = {\n maxTicks: maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = $dfc006ada1995968$var$generateTicks$1(numericGeneratorOptions, dataRange);\n if (opts.bounds === \"ticks\") (0, $c4d1694fa24f1a71$export$53a70dd1ebbae346)(ticks, this, \"value\");\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n super.configure();\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n getLabelForValue(value) {\n return (0, $c4d1694fa24f1a71$export$ae1af26003f05816)(value, this.chart.options.locale, this.options.ticks.format);\n }\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._endValue = undefined;\n this._valueRange = 0;\n }\n}\nclass $dfc006ada1995968$export$e7f4e5e8656f0b93 extends $dfc006ada1995968$var$LinearScaleBase {\n determineDataLimits() {\n const { min: min, max: max } = this.getMinMax(true);\n this.min = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(min) ? min : 0;\n this.max = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(max) ? max : 1;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e7f4e5e8656f0b93, \"id\", \"linear\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e7f4e5e8656f0b93, \"defaults\", {\n ticks: {\n callback: (0, $c4d1694fa24f1a71$export$91477dc880baac21).formatters.numeric\n }\n});\nconst $dfc006ada1995968$var$log10Floor = (v)=>Math.floor((0, $c4d1694fa24f1a71$export$9f4f30ee63539e24)(v));\nconst $dfc006ada1995968$var$changeExponent = (v, m)=>Math.pow(10, $dfc006ada1995968$var$log10Floor(v) + m);\nfunction $dfc006ada1995968$var$isMajor(tickVal) {\n const remain = tickVal / Math.pow(10, $dfc006ada1995968$var$log10Floor(tickVal));\n return remain === 1;\n}\nfunction $dfc006ada1995968$var$steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\nfunction $dfc006ada1995968$var$startExp(min, max) {\n const range = max - min;\n let rangeExp = $dfc006ada1995968$var$log10Floor(range);\n while($dfc006ada1995968$var$steps(min, max, rangeExp) > 10)rangeExp++;\n while($dfc006ada1995968$var$steps(min, max, rangeExp) < 10)rangeExp--;\n return Math.min(rangeExp, $dfc006ada1995968$var$log10Floor(min));\n}\nfunction $dfc006ada1995968$var$generateTicks(generationOptions, { min: min, max: max }) {\n min = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(generationOptions.min, min);\n const ticks = [];\n const minExp = $dfc006ada1995968$var$log10Floor(min);\n let exp = $dfc006ada1995968$var$startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while(value < max){\n ticks.push({\n value: value,\n major: $dfc006ada1995968$var$isMajor(value),\n significand: significand\n });\n if (significand >= 10) significand = significand < 15 ? 15 : 20;\n else significand++;\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(generationOptions.max, value);\n ticks.push({\n value: lastTick,\n major: $dfc006ada1995968$var$isMajor(lastTick),\n significand: significand\n });\n return ticks;\n}\nclass $dfc006ada1995968$export$85295eaf7cb3ac3e extends $dfc006ada1995968$export$d60cfc58d3c358b6 {\n parse(raw, index) {\n const value = $dfc006ada1995968$var$LinearScaleBase.prototype.parse.apply(this, [\n raw,\n index\n ]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(value) && value > 0 ? value : null;\n }\n determineDataLimits() {\n const { min: min, max: max } = this.getMinMax(true);\n this.min = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(min) ? Math.max(0, min) : null;\n this.max = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(max) ? Math.max(0, max) : null;\n if (this.options.beginAtZero) this._zero = true;\n if (this._zero && this.min !== this._suggestedMin && !(0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(this._userMin)) this.min = min === $dfc006ada1995968$var$changeExponent(this.min, 0) ? $dfc006ada1995968$var$changeExponent(this.min, -1) : $dfc006ada1995968$var$changeExponent(this.min, 0);\n this.handleTickRangeOptions();\n }\n handleTickRangeOptions() {\n const { minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (min === max) {\n if (min <= 0) {\n setMin(1);\n setMax(10);\n } else {\n setMin($dfc006ada1995968$var$changeExponent(min, -1));\n setMax($dfc006ada1995968$var$changeExponent(max, 1));\n }\n }\n if (min <= 0) setMin($dfc006ada1995968$var$changeExponent(max, -1));\n if (max <= 0) setMax($dfc006ada1995968$var$changeExponent(min, 1));\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const opts = this.options;\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = $dfc006ada1995968$var$generateTicks(generationOptions, this);\n if (opts.bounds === \"ticks\") (0, $c4d1694fa24f1a71$export$53a70dd1ebbae346)(ticks, this, \"value\");\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n getLabelForValue(value) {\n return value === undefined ? \"0\" : (0, $c4d1694fa24f1a71$export$ae1af26003f05816)(value, this.chart.options.locale, this.options.ticks.format);\n }\n configure() {\n const start = this.min;\n super.configure();\n this._startValue = (0, $c4d1694fa24f1a71$export$9f4f30ee63539e24)(start);\n this._valueRange = (0, $c4d1694fa24f1a71$export$9f4f30ee63539e24)(this.max) - (0, $c4d1694fa24f1a71$export$9f4f30ee63539e24)(start);\n }\n getPixelForValue(value) {\n if (value === undefined || value === 0) value = this.min;\n if (value === null || isNaN(value)) return NaN;\n return this.getPixelForDecimal(value === this.min ? 0 : ((0, $c4d1694fa24f1a71$export$9f4f30ee63539e24)(value) - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._valueRange = 0;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$85295eaf7cb3ac3e, \"id\", \"logarithmic\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$85295eaf7cb3ac3e, \"defaults\", {\n ticks: {\n callback: (0, $c4d1694fa24f1a71$export$91477dc880baac21).formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n});\nfunction $dfc006ada1995968$var$getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n if (tickOpts.display && opts.display) {\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(tickOpts.backdropPadding);\n return (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(tickOpts.font && tickOpts.font.size, (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).font.size) + padding.height;\n }\n return 0;\n}\nfunction $dfc006ada1995968$var$measureLabelSize(ctx, font, label) {\n label = (0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(label) ? label : [\n label\n ];\n return {\n w: (0, $c4d1694fa24f1a71$export$faec65b429be379)(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\nfunction $dfc006ada1995968$var$determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) return {\n start: pos - size / 2,\n end: pos + size / 2\n };\n else if (angle < min || angle > max) return {\n start: pos - size,\n end: pos\n };\n return {\n start: pos,\n end: pos + size\n };\n}\nfunction $dfc006ada1995968$var$fitWithPointLabels(scale) {\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? (0, $c4d1694fa24f1a71$export$56c0d5a1e737357d) / valueCount : 0;\n for(let i = 0; i < valueCount; i++){\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(opts.font);\n const textSize = $dfc006ada1995968$var$measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n const angleRadians = (0, $c4d1694fa24f1a71$export$28f7fcd39efa255)(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round((0, $c4d1694fa24f1a71$export$3a6d5c9ae78a2c08)(angleRadians));\n const hLimits = $dfc006ada1995968$var$determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = $dfc006ada1995968$var$determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n $dfc006ada1995968$var$updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b);\n scale._pointLabelItems = $dfc006ada1995968$var$buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction $dfc006ada1995968$var$updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\nfunction $dfc006ada1995968$var$createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const { extra: extra, additionalAngle: additionalAngle, padding: padding, size: size } = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round((0, $c4d1694fa24f1a71$export$3a6d5c9ae78a2c08)((0, $c4d1694fa24f1a71$export$28f7fcd39efa255)(pointLabelPosition.angle + (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd))));\n const y = $dfc006ada1995968$var$yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = $dfc006ada1995968$var$getTextAlignForAngle(angle);\n const left = $dfc006ada1995968$var$leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n visible: true,\n x: pointLabelPosition.x,\n y: y,\n textAlign: textAlign,\n left: left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\nfunction $dfc006ada1995968$var$isNotOverlapped(item, area) {\n if (!area) return true;\n const { left: left, top: top, right: right, bottom: bottom } = item;\n const apexesInArea = (0, $c4d1694fa24f1a71$export$e7094788287c5e9b)({\n x: left,\n y: top\n }, area) || (0, $c4d1694fa24f1a71$export$e7094788287c5e9b)({\n x: left,\n y: bottom\n }, area) || (0, $c4d1694fa24f1a71$export$e7094788287c5e9b)({\n x: right,\n y: top\n }, area) || (0, $c4d1694fa24f1a71$export$e7094788287c5e9b)({\n x: right,\n y: bottom\n }, area);\n return !apexesInArea;\n}\nfunction $dfc006ada1995968$var$buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const { centerPointLabels: centerPointLabels, display: display } = opts.pointLabels;\n const itemOpts = {\n extra: $dfc006ada1995968$var$getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? (0, $c4d1694fa24f1a71$export$56c0d5a1e737357d) / valueCount : 0\n };\n let area;\n for(let i = 0; i < valueCount; i++){\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n const item = $dfc006ada1995968$var$createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === \"auto\") {\n item.visible = $dfc006ada1995968$var$isNotOverlapped(item, area);\n if (item.visible) area = item;\n }\n }\n return items;\n}\nfunction $dfc006ada1995968$var$getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) return \"center\";\n else if (angle < 180) return \"left\";\n return \"right\";\n}\nfunction $dfc006ada1995968$var$leftForTextAlign(x, w, align) {\n if (align === \"right\") x -= w;\n else if (align === \"center\") x -= w / 2;\n return x;\n}\nfunction $dfc006ada1995968$var$yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) y -= h / 2;\n else if (angle > 270 || angle < 90) y -= h;\n return y;\n}\nfunction $dfc006ada1995968$var$drawPointLabelBox(ctx, opts, item) {\n const { left: left, top: top, right: right, bottom: bottom } = item;\n const { backdropColor: backdropColor } = opts;\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(backdropColor)) {\n const borderRadius = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(opts.borderRadius);\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n (0, $c4d1694fa24f1a71$export$1fbe638ecf81657e)(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius\n });\n ctx.fill();\n } else ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n}\nfunction $dfc006ada1995968$var$drawPointLabels(scale, labelCount) {\n const { ctx: ctx, options: { pointLabels: pointLabels } } = scale;\n for(let i = labelCount - 1; i >= 0; i--){\n const item = scale._pointLabelItems[i];\n if (!item.visible) continue;\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n $dfc006ada1995968$var$drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(optsAtIndex.font);\n const { x: x, y: y, textAlign: textAlign } = item;\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: \"middle\"\n });\n }\n}\nfunction $dfc006ada1995968$var$pathRadiusLine(scale, radius, circular, labelCount) {\n const { ctx: ctx } = scale;\n if (circular) ctx.arc(scale.xCenter, scale.yCenter, radius, 0, (0, $c4d1694fa24f1a71$export$971d5caa766a69d7));\n else {\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n for(let i = 1; i < labelCount; i++){\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\nfunction $dfc006ada1995968$var$drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n const { color: color, lineWidth: lineWidth } = gridLineOpts;\n if (!circular && !labelCount || !color || !lineWidth || radius < 0) return;\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n ctx.beginPath();\n $dfc006ada1995968$var$pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\nfunction $dfc006ada1995968$var$createPointLabelContext(parent, index, label) {\n return (0, $c4d1694fa24f1a71$export$35e795649ee09318)(parent, {\n label: label,\n index: index,\n type: \"pointLabel\"\n });\n}\nclass $dfc006ada1995968$export$cfafc36d95386d38 extends $dfc006ada1995968$var$LinearScaleBase {\n setDimensions() {\n const padding = this._padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)($dfc006ada1995968$var$getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n determineDataLimits() {\n const { min: min, max: max } = this.getMinMax(false);\n this.min = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(min) && !isNaN(min) ? min : 0;\n this.max = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(max) && !isNaN(max) ? max : 0;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n return Math.ceil(this.drawingArea / $dfc006ada1995968$var$getTickBackdropHeight(this.options));\n }\n generateTickLabels(ticks) {\n $dfc006ada1995968$var$LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n this._pointLabels = this.getLabels().map((value, index)=>{\n const label = (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.pointLabels.callback, [\n value,\n index\n ], this);\n return label || label === 0 ? label : \"\";\n }).filter((v, i)=>this.chart.getDataVisibility(i));\n }\n fit() {\n const opts = this.options;\n if (opts.display && opts.pointLabels.display) $dfc006ada1995968$var$fitWithPointLabels(this);\n else this.setCenterPoint(0, 0, 0, 0);\n }\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n getIndexAngle(index) {\n const angleMultiplier = (0, $c4d1694fa24f1a71$export$971d5caa766a69d7) / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n return (0, $c4d1694fa24f1a71$export$28f7fcd39efa255)(index * angleMultiplier + (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(startAngle));\n }\n getDistanceFromCenterForValue(value) {\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(value)) return NaN;\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) return (this.max - value) * scalingFactor;\n return (value - this.min) * scalingFactor;\n }\n getValueForDistanceFromCenter(distance) {\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(distance)) return NaN;\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return $dfc006ada1995968$var$createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd) + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle: angle\n };\n }\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n getPointLabelPosition(index) {\n const { left: left, top: top, right: right, bottom: bottom } = this._pointLabelItems[index];\n return {\n left: left,\n top: top,\n right: right,\n bottom: bottom\n };\n }\n drawBackground() {\n const { backgroundColor: backgroundColor, grid: { circular: circular } } = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n $dfc006ada1995968$var$pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const { angleLines: angleLines, grid: grid, border: border } = opts;\n const labelCount = this._pointLabels.length;\n let i, offset, position;\n if (opts.pointLabels.display) $dfc006ada1995968$var$drawPointLabels(this, labelCount);\n if (grid.display) this.ticks.forEach((tick, index)=>{\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n $dfc006ada1995968$var$drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n if (angleLines.display) {\n ctx.save();\n for(i = labelCount - 1; i >= 0; i--){\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const { color: color, lineWidth: lineWidth } = optsAtIndex;\n if (!lineWidth || !color) continue;\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n ctx.restore();\n }\n }\n drawBorder() {}\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n if (!tickOpts.display) return;\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n this.ticks.forEach((tick, index)=>{\n if (index === 0 && !opts.reverse) return;\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(optsAtIndex.backdropPadding);\n ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height);\n }\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth\n });\n });\n ctx.restore();\n }\n drawTitle() {}\n constructor(cfg){\n super(cfg);\n this.xCenter = undefined;\n this.yCenter = undefined;\n this.drawingArea = undefined;\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$cfafc36d95386d38, \"id\", \"radialLinear\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$cfafc36d95386d38, \"defaults\", {\n display: true,\n animate: true,\n position: \"chartArea\",\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n grid: {\n circular: false\n },\n startAngle: 0,\n ticks: {\n showLabelBackdrop: true,\n callback: (0, $c4d1694fa24f1a71$export$91477dc880baac21).formatters.numeric\n },\n pointLabels: {\n backdropColor: undefined,\n backdropPadding: 2,\n display: true,\n font: {\n size: 10\n },\n callback (label) {\n return label;\n },\n padding: 5,\n centerPointLabels: false\n }\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$cfafc36d95386d38, \"defaultRoutes\", {\n \"angleLines.color\": \"borderColor\",\n \"pointLabels.color\": \"color\",\n \"ticks.color\": \"color\"\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$cfafc36d95386d38, \"descriptors\", {\n angleLines: {\n _fallback: \"grid\"\n }\n});\nconst $dfc006ada1995968$var$INTERVALS = {\n millisecond: {\n common: true,\n size: 1,\n steps: 1000\n },\n second: {\n common: true,\n size: 1000,\n steps: 60\n },\n minute: {\n common: true,\n size: 60000,\n steps: 60\n },\n hour: {\n common: true,\n size: 3600000,\n steps: 24\n },\n day: {\n common: true,\n size: 86400000,\n steps: 30\n },\n week: {\n common: false,\n size: 604800000,\n steps: 4\n },\n month: {\n common: true,\n size: 2.628e9,\n steps: 12\n },\n quarter: {\n common: false,\n size: 7.884e9,\n steps: 4\n },\n year: {\n common: true,\n size: 3.154e10\n }\n};\nconst $dfc006ada1995968$var$UNITS = /* #__PURE__ */ Object.keys($dfc006ada1995968$var$INTERVALS);\nfunction $dfc006ada1995968$var$sorter(a, b) {\n return a - b;\n}\nfunction $dfc006ada1995968$var$parse(scale, input) {\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(input)) return null;\n const adapter = scale._adapter;\n const { parser: parser, round: round, isoWeekday: isoWeekday } = scale._parseOpts;\n let value = input;\n if (typeof parser === \"function\") value = parser(value);\n if (!(0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(value)) value = typeof parser === \"string\" ? adapter.parse(value, parser) : adapter.parse(value);\n if (value === null) return null;\n if (round) value = round === \"week\" && ((0, $c4d1694fa24f1a71$export$d141bba7fdc215a3)(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, \"isoWeek\", isoWeekday) : adapter.startOf(value, round);\n return +value;\n}\nfunction $dfc006ada1995968$var$determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = $dfc006ada1995968$var$UNITS.length;\n for(let i = $dfc006ada1995968$var$UNITS.indexOf(minUnit); i < ilen - 1; ++i){\n const interval = $dfc006ada1995968$var$INTERVALS[$dfc006ada1995968$var$UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) return $dfc006ada1995968$var$UNITS[i];\n }\n return $dfc006ada1995968$var$UNITS[ilen - 1];\n}\nfunction $dfc006ada1995968$var$determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for(let i = $dfc006ada1995968$var$UNITS.length - 1; i >= $dfc006ada1995968$var$UNITS.indexOf(minUnit); i--){\n const unit = $dfc006ada1995968$var$UNITS[i];\n if ($dfc006ada1995968$var$INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) return unit;\n }\n return $dfc006ada1995968$var$UNITS[minUnit ? $dfc006ada1995968$var$UNITS.indexOf(minUnit) : 0];\n}\nfunction $dfc006ada1995968$var$determineMajorUnit(unit) {\n for(let i = $dfc006ada1995968$var$UNITS.indexOf(unit) + 1, ilen = $dfc006ada1995968$var$UNITS.length; i < ilen; ++i){\n if ($dfc006ada1995968$var$INTERVALS[$dfc006ada1995968$var$UNITS[i]].common) return $dfc006ada1995968$var$UNITS[i];\n }\n}\nfunction $dfc006ada1995968$var$addTick(ticks, time, timestamps) {\n if (!timestamps) ticks[time] = true;\n else if (timestamps.length) {\n const { lo: lo, hi: hi } = (0, $c4d1694fa24f1a71$export$2ed0fc6709e59212)(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\nfunction $dfc006ada1995968$var$setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n for(major = first; major <= last; major = +adapter.add(major, 1, majorUnit)){\n index = map[major];\n if (index >= 0) ticks[index].major = true;\n }\n return ticks;\n}\nfunction $dfc006ada1995968$var$ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n const map = {};\n const ilen = values.length;\n let i, value;\n for(i = 0; i < ilen; ++i){\n value = values[i];\n map[value] = i;\n ticks.push({\n value: value,\n major: false\n });\n }\n return ilen === 0 || !majorUnit ? ticks : $dfc006ada1995968$var$setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass $dfc006ada1995968$export$a894c72689ff3ec extends $dfc006ada1995968$export$d60cfc58d3c358b6 {\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n const adapter = this._adapter = new $dfc006ada1995968$export$f32766ea09ec8bc4._date(scaleOpts.adapters.date);\n adapter.init(opts);\n (0, $c4d1694fa24f1a71$export$555508cbc6add439)(time.displayFormats, adapter.formats());\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n super.init(scaleOpts);\n this._normalized = opts.normalized;\n }\n parse(raw, index) {\n if (raw === undefined) return null;\n return $dfc006ada1995968$var$parse(this, raw);\n }\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || \"day\";\n let { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) min = Math.min(min, bounds.min);\n if (!maxDefined && !isNaN(bounds.max)) max = Math.max(max, bounds.max);\n }\n if (!minDefined || !maxDefined) {\n _applyBounds(this._getLabelBounds());\n if (options.bounds !== \"ticks\" || options.ticks.source !== \"labels\") _applyBounds(this.getMinMax(false));\n }\n min = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {\n min: min,\n max: max\n };\n }\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === \"labels\" ? this.getLabelTimestamps() : this._generate();\n if (options.bounds === \"ticks\" && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n const min = this.min;\n const max = this.max;\n const ticks = (0, $c4d1694fa24f1a71$export$c03999cb2f36933f)(timestamps, min, max);\n this._unit = timeOpts.unit || (tickOpts.autoSkip ? $dfc006ada1995968$var$determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : $dfc006ada1995968$var$determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === \"year\" ? undefined : $dfc006ada1995968$var$determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n if (options.reverse) ticks.reverse();\n return $dfc006ada1995968$var$ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n afterAutoSkip() {\n if (this.options.offsetAfterAutoskip) this.initOffsets(this.ticks.map((tick)=>+tick.value));\n }\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) start = 1 - first;\n else start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) end = last;\n else end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(start, 0, limit);\n end = (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(end, 0, limit);\n this._offsets = {\n start: start,\n end: end,\n factor: 1 / (start + 1 + end)\n };\n }\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n const minor = timeOpts.unit || $dfc006ada1995968$var$determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(options.ticks.stepSize, 1);\n const weekday = minor === \"week\" ? timeOpts.isoWeekday : false;\n const hasWeekday = (0, $c4d1694fa24f1a71$export$d141bba7fdc215a3)(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n if (hasWeekday) first = +adapter.startOf(first, \"isoWeek\", weekday);\n first = +adapter.startOf(first, hasWeekday ? \"day\" : minor);\n if (adapter.diff(max, min, minor) > 100000 * stepSize) throw new Error(min + \" and \" + max + \" are too far apart with stepSize of \" + stepSize + \" \" + minor);\n const timestamps = options.ticks.source === \"data\" && this.getDataTimestamps();\n for(time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++)$dfc006ada1995968$var$addTick(ticks, time, timestamps);\n if (time === max || options.bounds === \"ticks\" || count === 1) $dfc006ada1995968$var$addTick(ticks, time, timestamps);\n return Object.keys(ticks).sort($dfc006ada1995968$var$sorter).map((x)=>+x);\n }\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n if (timeOpts.tooltipFormat) return adapter.format(value, timeOpts.tooltipFormat);\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n if (formatter) return (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(formatter, [\n time,\n index,\n ticks\n ], this);\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n generateTickLabels(ticks) {\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n return {\n w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,\n h: tickLabelWidth * sinRotation + tickFontSize * cosRotation\n };\n }\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, $dfc006ada1995968$var$ticksFromTimestamps(this, [\n exampleTime\n ], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n if (timestamps.length) return timestamps;\n const metas = this.getMatchingVisibleMetas();\n if (this._normalized && metas.length) return this._cache.data = metas[0].controller.getAllParsedValues(this);\n for(i = 0, ilen = metas.length; i < ilen; ++i)timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n return this._cache.data = this.normalize(timestamps);\n }\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n if (timestamps.length) return timestamps;\n const labels = this.getLabels();\n for(i = 0, ilen = labels.length; i < ilen; ++i)timestamps.push($dfc006ada1995968$var$parse(this, labels[i]));\n return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);\n }\n normalize(values) {\n return (0, $c4d1694fa24f1a71$export$71511d61b312f219)(values.sort($dfc006ada1995968$var$sorter));\n }\n constructor(props){\n super(props);\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n this._unit = \"day\";\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$a894c72689ff3ec, \"id\", \"time\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$a894c72689ff3ec, \"defaults\", {\n bounds: \"data\",\n adapters: {},\n time: {\n parser: false,\n unit: false,\n round: false,\n isoWeekday: false,\n minUnit: \"millisecond\",\n displayFormats: {}\n },\n ticks: {\n source: \"auto\",\n callback: false,\n major: {\n enabled: false\n }\n }\n});\nfunction $dfc006ada1995968$var$interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) ({ lo: lo, hi: hi } = (0, $c4d1694fa24f1a71$export$ef35774e6d314e91)(table, \"pos\", val));\n ({ pos: prevSource, time: prevTarget } = table[lo]);\n ({ pos: nextSource, time: nextTarget } = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) ({ lo: lo, hi: hi } = (0, $c4d1694fa24f1a71$export$ef35774e6d314e91)(table, \"time\", val));\n ({ time: prevSource, pos: prevTarget } = table[lo]);\n ({ time: nextSource, pos: nextTarget } = table[hi]);\n }\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass $dfc006ada1995968$export$85df64a8eb6dc986 extends $dfc006ada1995968$export$a894c72689ff3ec {\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = $dfc006ada1995968$var$interpolate(table, this.min);\n this._tableRange = $dfc006ada1995968$var$interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n buildLookupTable(timestamps) {\n const { min: min, max: max } = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n for(i = 0, ilen = timestamps.length; i < ilen; ++i){\n curr = timestamps[i];\n if (curr >= min && curr <= max) items.push(curr);\n }\n if (items.length < 2) return [\n {\n time: min,\n pos: 0\n },\n {\n time: max,\n pos: 1\n }\n ];\n for(i = 0, ilen = items.length; i < ilen; ++i){\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n if (Math.round((next + prev) / 2) !== curr) table.push({\n time: curr,\n pos: i / (ilen - 1)\n });\n }\n return table;\n }\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) timestamps.splice(0, 0, min);\n if (!timestamps.includes(max) || timestamps.length === 1) timestamps.push(max);\n return timestamps.sort((a, b)=>a - b);\n }\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n if (timestamps.length) return timestamps;\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) timestamps = this.normalize(data.concat(label));\n else timestamps = data.length ? data : label;\n timestamps = this._cache.all = timestamps;\n return timestamps;\n }\n getDecimalForValue(value) {\n return ($dfc006ada1995968$var$interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return $dfc006ada1995968$var$interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n constructor(props){\n super(props);\n this._table = [];\n this._minPos = undefined;\n this._tableRange = undefined;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$85df64a8eb6dc986, \"id\", \"timeseries\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$85df64a8eb6dc986, \"defaults\", $dfc006ada1995968$export$a894c72689ff3ec.defaults);\nvar $dfc006ada1995968$export$bcac1c16f1530ec2 = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n CategoryScale: $dfc006ada1995968$export$29e663ba4d09fe7,\n LinearScale: $dfc006ada1995968$export$e7f4e5e8656f0b93,\n LogarithmicScale: $dfc006ada1995968$export$85295eaf7cb3ac3e,\n RadialLinearScale: $dfc006ada1995968$export$cfafc36d95386d38,\n TimeScale: $dfc006ada1995968$export$a894c72689ff3ec,\n TimeSeriesScale: $dfc006ada1995968$export$85df64a8eb6dc986\n});\nconst $dfc006ada1995968$export$e8959e79e3af550f = [\n $dfc006ada1995968$export$a6506504f799c5d5,\n $dfc006ada1995968$export$7a5d735b2ab6389d,\n $dfc006ada1995968$export$8b3ca321c77fdea6,\n $dfc006ada1995968$export$bcac1c16f1530ec2\n];\n\n\n(0, $dfc006ada1995968$export$acaa6426d77a227e).register(...(0, $dfc006ada1995968$export$e8959e79e3af550f));\nvar $90463797e5db2d19$export$2e2bcd8739ae039 = (0, $dfc006ada1995968$export$acaa6426d77a227e);\n\n\n/**!\n * Sortable 1.15.1\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */ function $c8f95463ff5f043e$var$ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function(sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction $c8f95463ff5f043e$var$_objectSpread2(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) $c8f95463ff5f043e$var$ownKeys(Object(source), true).forEach(function(key) {\n $c8f95463ff5f043e$var$_defineProperty(target, key, source[key]);\n });\n else if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n else $c8f95463ff5f043e$var$ownKeys(Object(source)).forEach(function(key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\n}\nfunction $c8f95463ff5f043e$var$_typeof(obj) {\n \"@babel/helpers - typeof\";\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") $c8f95463ff5f043e$var$_typeof = function(obj) {\n return typeof obj;\n };\n else $c8f95463ff5f043e$var$_typeof = function(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n return $c8f95463ff5f043e$var$_typeof(obj);\n}\nfunction $c8f95463ff5f043e$var$_defineProperty(obj, key, value) {\n if (key in obj) Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n else obj[key] = value;\n return obj;\n}\nfunction $c8f95463ff5f043e$var$_extends() {\n $c8f95463ff5f043e$var$_extends = Object.assign || function(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i];\n for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];\n }\n return target;\n };\n return $c8f95463ff5f043e$var$_extends.apply(this, arguments);\n}\nfunction $c8f95463ff5f043e$var$_objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for(i = 0; i < sourceKeys.length; i++){\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction $c8f95463ff5f043e$var$_objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = $c8f95463ff5f043e$var$_objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for(i = 0; i < sourceSymbolKeys.length; i++){\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction $c8f95463ff5f043e$var$_toConsumableArray(arr) {\n return $c8f95463ff5f043e$var$_arrayWithoutHoles(arr) || $c8f95463ff5f043e$var$_iterableToArray(arr) || $c8f95463ff5f043e$var$_unsupportedIterableToArray(arr) || $c8f95463ff5f043e$var$_nonIterableSpread();\n}\nfunction $c8f95463ff5f043e$var$_arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return $c8f95463ff5f043e$var$_arrayLikeToArray(arr);\n}\nfunction $c8f95463ff5f043e$var$_iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction $c8f95463ff5f043e$var$_unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return $c8f95463ff5f043e$var$_arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $c8f95463ff5f043e$var$_arrayLikeToArray(o, minLen);\n}\nfunction $c8f95463ff5f043e$var$_arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction $c8f95463ff5f043e$var$_nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nvar $c8f95463ff5f043e$var$version = \"1.15.1\";\nfunction $c8f95463ff5f043e$var$userAgent(pattern) {\n if (typeof window !== \"undefined\" && window.navigator) return !!/*@__PURE__*/ navigator.userAgent.match(pattern);\n}\nvar $c8f95463ff5f043e$var$IE11OrLess = $c8f95463ff5f043e$var$userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar $c8f95463ff5f043e$var$Edge = $c8f95463ff5f043e$var$userAgent(/Edge/i);\nvar $c8f95463ff5f043e$var$FireFox = $c8f95463ff5f043e$var$userAgent(/firefox/i);\nvar $c8f95463ff5f043e$var$Safari = $c8f95463ff5f043e$var$userAgent(/safari/i) && !$c8f95463ff5f043e$var$userAgent(/chrome/i) && !$c8f95463ff5f043e$var$userAgent(/android/i);\nvar $c8f95463ff5f043e$var$IOS = $c8f95463ff5f043e$var$userAgent(/iP(ad|od|hone)/i);\nvar $c8f95463ff5f043e$var$ChromeForAndroid = $c8f95463ff5f043e$var$userAgent(/chrome/i) && $c8f95463ff5f043e$var$userAgent(/android/i);\nvar $c8f95463ff5f043e$var$captureMode = {\n capture: false,\n passive: false\n};\nfunction $c8f95463ff5f043e$var$on(el, event, fn) {\n el.addEventListener(event, fn, !$c8f95463ff5f043e$var$IE11OrLess && $c8f95463ff5f043e$var$captureMode);\n}\nfunction $c8f95463ff5f043e$var$off(el, event, fn) {\n el.removeEventListener(event, fn, !$c8f95463ff5f043e$var$IE11OrLess && $c8f95463ff5f043e$var$captureMode);\n}\nfunction $c8f95463ff5f043e$var$matches(/**HTMLElement*/ el, /**String*/ selector) {\n if (!selector) return;\n selector[0] === \">\" && (selector = selector.substring(1));\n if (el) try {\n if (el.matches) return el.matches(selector);\n else if (el.msMatchesSelector) return el.msMatchesSelector(selector);\n else if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);\n } catch (_) {\n return false;\n }\n return false;\n}\nfunction $c8f95463ff5f043e$var$getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction $c8f95463ff5f043e$var$closest(/**HTMLElement*/ el, /**String*/ selector, /**HTMLElement*/ ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === \">\" ? el.parentNode === ctx && $c8f95463ff5f043e$var$matches(el, selector) : $c8f95463ff5f043e$var$matches(el, selector)) || includeCTX && el === ctx) return el;\n if (el === ctx) break;\n /* jshint boss:true */ }while (el = $c8f95463ff5f043e$var$getParentOrHost(el));\n }\n return null;\n}\nvar $c8f95463ff5f043e$var$R_SPACE = /\\s+/g;\nfunction $c8f95463ff5f043e$var$toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) el.classList[state ? \"add\" : \"remove\"](name);\n else {\n var className = (\" \" + el.className + \" \").replace($c8f95463ff5f043e$var$R_SPACE, \" \").replace(\" \" + name + \" \", \" \");\n el.className = (className + (state ? \" \" + name : \"\")).replace($c8f95463ff5f043e$var$R_SPACE, \" \");\n }\n }\n}\nfunction $c8f95463ff5f043e$var$css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) val = document.defaultView.getComputedStyle(el, \"\");\n else if (el.currentStyle) val = el.currentStyle;\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf(\"webkit\") === -1) prop = \"-webkit-\" + prop;\n style[prop] = val + (typeof val === \"string\" ? \"\" : \"px\");\n }\n }\n}\nfunction $c8f95463ff5f043e$var$matrix(el, selfOnly) {\n var appliedTransforms = \"\";\n if (typeof el === \"string\") appliedTransforms = el;\n else do {\n var transform = $c8f95463ff5f043e$var$css(el, \"transform\");\n if (transform && transform !== \"none\") appliedTransforms = transform + \" \" + appliedTransforms;\n /* jshint boss:true */ }while (!selfOnly && (el = el.parentNode));\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */ return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction $c8f95463ff5f043e$var$find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length;\n if (iterator) for(; i < n; i++)iterator(list[i], i);\n return list;\n }\n return [];\n}\nfunction $c8f95463ff5f043e$var$getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) return scrollingElement;\n else return document.documentElement;\n}\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */ function $c8f95463ff5f043e$var$getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== $c8f95463ff5f043e$var$getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!$c8f95463ff5f043e$var$IE11OrLess) {\n do if (container && container.getBoundingClientRect && ($c8f95463ff5f043e$var$css(container, \"transform\") !== \"none\" || relativeToNonStaticParent && $c8f95463ff5f043e$var$css(container, \"position\") !== \"static\")) {\n var containerRect = container.getBoundingClientRect();\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt($c8f95463ff5f043e$var$css(container, \"border-top-width\"));\n left -= containerRect.left + parseInt($c8f95463ff5f043e$var$css(container, \"border-left-width\"));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = $c8f95463ff5f043e$var$matrix(container || el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\r\n * Returns the content rect of the element (bounding rect minus border and padding)\r\n * @param {HTMLElement} el \r\n */ function $c8f95463ff5f043e$var$getContentRect(el) {\n var rect = $c8f95463ff5f043e$var$getRect(el);\n var paddingLeft = parseInt($c8f95463ff5f043e$var$css(el, \"padding-left\")), paddingTop = parseInt($c8f95463ff5f043e$var$css(el, \"padding-top\")), paddingRight = parseInt($c8f95463ff5f043e$var$css(el, \"padding-right\")), paddingBottom = parseInt($c8f95463ff5f043e$var$css(el, \"padding-bottom\"));\n rect.top += paddingTop + parseInt($c8f95463ff5f043e$var$css(el, \"border-top-width\"));\n rect.left += paddingLeft + parseInt($c8f95463ff5f043e$var$css(el, \"border-left-width\"));\n // Client Width/Height includes padding only\n rect.width = el.clientWidth - paddingLeft - paddingRight;\n rect.height = el.clientHeight - paddingTop - paddingBottom;\n rect.bottom = rect.top + rect.height;\n rect.right = rect.left + rect.width;\n return rect;\n}\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */ function $c8f95463ff5f043e$var$isScrolledPast(el, elSide, parentSide) {\n var parent = $c8f95463ff5f043e$var$getParentAutoScrollElement(el, true), elSideVal = $c8f95463ff5f043e$var$getRect(el)[elSide];\n /* jshint boss:true */ while(parent){\n var parentSideVal = $c8f95463ff5f043e$var$getRect(parent)[parentSide], visible = void 0;\n if (parentSide === \"top\" || parentSide === \"left\") visible = elSideVal >= parentSideVal;\n else visible = elSideVal <= parentSideVal;\n if (!visible) return parent;\n if (parent === $c8f95463ff5f043e$var$getWindowScrollingElement()) break;\n parent = $c8f95463ff5f043e$var$getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */ function $c8f95463ff5f043e$var$getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0, i = 0, children = el.children;\n while(i < children.length){\n if (children[i].style.display !== \"none\" && children[i] !== $c8f95463ff5f043e$export$31b3ca70d8f57423.ghost && (includeDragEl || children[i] !== $c8f95463ff5f043e$export$31b3ca70d8f57423.dragged) && $c8f95463ff5f043e$var$closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) return children[i];\n currentChild++;\n }\n i++;\n }\n return null;\n}\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */ function $c8f95463ff5f043e$var$lastChild(el, selector) {\n var last = el.lastElementChild;\n while(last && (last === $c8f95463ff5f043e$export$31b3ca70d8f57423.ghost || $c8f95463ff5f043e$var$css(last, \"display\") === \"none\" || selector && !$c8f95463ff5f043e$var$matches(last, selector)))last = last.previousElementSibling;\n return last || null;\n}\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */ function $c8f95463ff5f043e$var$index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) return -1;\n /* jshint boss:true */ while(el = el.previousElementSibling)if (el.nodeName.toUpperCase() !== \"TEMPLATE\" && el !== $c8f95463ff5f043e$export$31b3ca70d8f57423.clone && (!selector || $c8f95463ff5f043e$var$matches(el, selector))) index++;\n return index;\n}\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */ function $c8f95463ff5f043e$var$getRelativeScrollOffset(el) {\n var offsetLeft = 0, offsetTop = 0, winScroller = $c8f95463ff5f043e$var$getWindowScrollingElement();\n if (el) do {\n var elMatrix = $c8f95463ff5f043e$var$matrix(el), scaleX = elMatrix.a, scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n }while (el !== winScroller && (el = el.parentNode));\n return [\n offsetLeft,\n offsetTop\n ];\n}\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */ function $c8f95463ff5f043e$var$indexOfObject(arr, obj) {\n for(var i in arr){\n if (!arr.hasOwnProperty(i)) continue;\n for(var key in obj){\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction $c8f95463ff5f043e$var$getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return $c8f95463ff5f043e$var$getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = $c8f95463ff5f043e$var$css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == \"auto\" || elemCSS.overflowX == \"scroll\") || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == \"auto\" || elemCSS.overflowY == \"scroll\")) {\n if (!elem.getBoundingClientRect || elem === document.body) return $c8f95463ff5f043e$var$getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n while (elem = elem.parentNode);\n return $c8f95463ff5f043e$var$getWindowScrollingElement();\n}\nfunction $c8f95463ff5f043e$var$extend(dst, src) {\n if (dst && src) {\n for(var key in src)if (src.hasOwnProperty(key)) dst[key] = src[key];\n }\n return dst;\n}\nfunction $c8f95463ff5f043e$var$isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar $c8f95463ff5f043e$var$_throttleTimeout;\nfunction $c8f95463ff5f043e$var$throttle(callback, ms) {\n return function() {\n if (!$c8f95463ff5f043e$var$_throttleTimeout) {\n var args = arguments, _this = this;\n if (args.length === 1) callback.call(_this, args[0]);\n else callback.apply(_this, args);\n $c8f95463ff5f043e$var$_throttleTimeout = setTimeout(function() {\n $c8f95463ff5f043e$var$_throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction $c8f95463ff5f043e$var$cancelThrottle() {\n clearTimeout($c8f95463ff5f043e$var$_throttleTimeout);\n $c8f95463ff5f043e$var$_throttleTimeout = void 0;\n}\nfunction $c8f95463ff5f043e$var$scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction $c8f95463ff5f043e$var$clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) return Polymer.dom(el).cloneNode(true);\n else if ($) return $(el).clone(true)[0];\n else return el.cloneNode(true);\n}\nfunction $c8f95463ff5f043e$var$setRect(el, rect) {\n $c8f95463ff5f043e$var$css(el, \"position\", \"absolute\");\n $c8f95463ff5f043e$var$css(el, \"top\", rect.top);\n $c8f95463ff5f043e$var$css(el, \"left\", rect.left);\n $c8f95463ff5f043e$var$css(el, \"width\", rect.width);\n $c8f95463ff5f043e$var$css(el, \"height\", rect.height);\n}\nfunction $c8f95463ff5f043e$var$unsetRect(el) {\n $c8f95463ff5f043e$var$css(el, \"position\", \"\");\n $c8f95463ff5f043e$var$css(el, \"top\", \"\");\n $c8f95463ff5f043e$var$css(el, \"left\", \"\");\n $c8f95463ff5f043e$var$css(el, \"width\", \"\");\n $c8f95463ff5f043e$var$css(el, \"height\", \"\");\n}\nvar $c8f95463ff5f043e$var$expando = \"Sortable\" + new Date().getTime();\nfunction $c8f95463ff5f043e$var$AnimationStateManager() {\n var animationStates = [], animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function(child) {\n if ($c8f95463ff5f043e$var$css(child, \"display\") === \"none\" || child === $c8f95463ff5f043e$export$31b3ca70d8f57423.ghost) return;\n animationStates.push({\n target: child,\n rect: $c8f95463ff5f043e$var$getRect(child)\n });\n var fromRect = $c8f95463ff5f043e$var$_objectSpread2({}, animationStates[animationStates.length - 1].rect);\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = $c8f95463ff5f043e$var$matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice($c8f95463ff5f043e$var$indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === \"function\") callback();\n return;\n }\n var animating = false, animationTime = 0;\n animationStates.forEach(function(state) {\n var time = 0, target = state.target, fromRect = target.fromRect, toRect = $c8f95463ff5f043e$var$getRect(target), prevFromRect = target.prevFromRect, prevToRect = target.prevToRect, animatingRect = state.rect, targetMatrix = $c8f95463ff5f043e$var$matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) // Could also check if animatingRect is between fromRect and toRect\n {\n if ($c8f95463ff5f043e$var$isRectEqual(prevFromRect, toRect) && !$c8f95463ff5f043e$var$isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) // If returning to same place as started from animation and on same axis\n time = $c8f95463ff5f043e$var$calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n // if fromRect != toRect: animate\n if (!$c8f95463ff5f043e$var$isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) time = _this.options.animation;\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function() {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === \"function\") callback();\n } else animationCallbackId = setTimeout(function() {\n if (typeof callback === \"function\") callback();\n }, animationTime);\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n $c8f95463ff5f043e$var$css(target, \"transition\", \"\");\n $c8f95463ff5f043e$var$css(target, \"transform\", \"\");\n var elMatrix = $c8f95463ff5f043e$var$matrix(this.el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d, translateX = (currentRect.left - toRect.left) / (scaleX || 1), translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n $c8f95463ff5f043e$var$css(target, \"transform\", \"translate3d(\" + translateX + \"px,\" + translateY + \"px,0)\");\n this.forRepaintDummy = $c8f95463ff5f043e$var$repaint(target); // repaint\n $c8f95463ff5f043e$var$css(target, \"transition\", \"transform \" + duration + \"ms\" + (this.options.easing ? \" \" + this.options.easing : \"\"));\n $c8f95463ff5f043e$var$css(target, \"transform\", \"translate3d(0,0,0)\");\n typeof target.animated === \"number\" && clearTimeout(target.animated);\n target.animated = setTimeout(function() {\n $c8f95463ff5f043e$var$css(target, \"transition\", \"\");\n $c8f95463ff5f043e$var$css(target, \"transform\", \"\");\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction $c8f95463ff5f043e$var$repaint(target) {\n return target.offsetWidth;\n}\nfunction $c8f95463ff5f043e$var$calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\nvar $c8f95463ff5f043e$var$plugins = [];\nvar $c8f95463ff5f043e$var$defaults = {\n initializeByDefault: true\n};\nvar $c8f95463ff5f043e$var$PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for(var option in $c8f95463ff5f043e$var$defaults)if ($c8f95463ff5f043e$var$defaults.hasOwnProperty(option) && !(option in plugin)) plugin[option] = $c8f95463ff5f043e$var$defaults[option];\n $c8f95463ff5f043e$var$plugins.forEach(function(p) {\n if (p.pluginName === plugin.pluginName) throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n });\n $c8f95463ff5f043e$var$plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function() {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + \"Global\";\n $c8f95463ff5f043e$var$plugins.forEach(function(plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) sortable[plugin.pluginName][eventNameGlobal]($c8f95463ff5f043e$var$_objectSpread2({\n sortable: sortable\n }, evt));\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) sortable[plugin.pluginName][eventName]($c8f95463ff5f043e$var$_objectSpread2({\n sortable: sortable\n }, evt));\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n $c8f95463ff5f043e$var$plugins.forEach(function(plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n // Add default options from plugin\n $c8f95463ff5f043e$var$_extends(defaults, initialized.defaults);\n });\n for(var option in sortable.options){\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== \"undefined\") sortable.options[option] = modified;\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n $c8f95463ff5f043e$var$plugins.forEach(function(plugin) {\n if (typeof plugin.eventProperties !== \"function\") return;\n $c8f95463ff5f043e$var$_extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n $c8f95463ff5f043e$var$plugins.forEach(function(plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === \"function\") modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n });\n return modifiedValue;\n }\n};\nfunction $c8f95463ff5f043e$var$dispatchEvent(_ref) {\n var sortable = _ref.sortable, rootEl = _ref.rootEl, name = _ref.name, targetEl = _ref.targetEl, cloneEl = _ref.cloneEl, toEl = _ref.toEl, fromEl = _ref.fromEl, oldIndex = _ref.oldIndex, newIndex = _ref.newIndex, oldDraggableIndex = _ref.oldDraggableIndex, newDraggableIndex = _ref.newDraggableIndex, originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[$c8f95463ff5f043e$var$expando];\n if (!sortable) return;\n var evt, options = sortable.options, onName = \"on\" + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !$c8f95463ff5f043e$var$IE11OrLess && !$c8f95463ff5f043e$var$Edge) evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n else {\n evt = document.createEvent(\"Event\");\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = $c8f95463ff5f043e$var$_objectSpread2($c8f95463ff5f043e$var$_objectSpread2({}, extraEventProperties), $c8f95463ff5f043e$var$PluginManager.getEventProperties(name, sortable));\n for(var option in allEventProperties)evt[option] = allEventProperties[option];\n if (rootEl) rootEl.dispatchEvent(evt);\n if (options[onName]) options[onName].call(sortable, evt);\n}\nvar $c8f95463ff5f043e$var$_excluded = [\n \"evt\"\n];\nvar $c8f95463ff5f043e$var$pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, originalEvent = _ref.evt, data = $c8f95463ff5f043e$var$_objectWithoutProperties(_ref, $c8f95463ff5f043e$var$_excluded);\n $c8f95463ff5f043e$var$PluginManager.pluginEvent.bind($c8f95463ff5f043e$export$31b3ca70d8f57423)(eventName, sortable, $c8f95463ff5f043e$var$_objectSpread2({\n dragEl: $c8f95463ff5f043e$var$dragEl,\n parentEl: $c8f95463ff5f043e$var$parentEl,\n ghostEl: $c8f95463ff5f043e$var$ghostEl,\n rootEl: $c8f95463ff5f043e$var$rootEl,\n nextEl: $c8f95463ff5f043e$var$nextEl,\n lastDownEl: $c8f95463ff5f043e$var$lastDownEl,\n cloneEl: $c8f95463ff5f043e$var$cloneEl,\n cloneHidden: $c8f95463ff5f043e$var$cloneHidden,\n dragStarted: $c8f95463ff5f043e$var$moved,\n putSortable: $c8f95463ff5f043e$var$putSortable,\n activeSortable: $c8f95463ff5f043e$export$31b3ca70d8f57423.active,\n originalEvent: originalEvent,\n oldIndex: $c8f95463ff5f043e$var$oldIndex,\n oldDraggableIndex: $c8f95463ff5f043e$var$oldDraggableIndex,\n newIndex: $c8f95463ff5f043e$var$newIndex,\n newDraggableIndex: $c8f95463ff5f043e$var$newDraggableIndex,\n hideGhostForTarget: $c8f95463ff5f043e$var$_hideGhostForTarget,\n unhideGhostForTarget: $c8f95463ff5f043e$var$_unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n $c8f95463ff5f043e$var$cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n $c8f95463ff5f043e$var$cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction $c8f95463ff5f043e$var$_dispatchEvent(info) {\n $c8f95463ff5f043e$var$dispatchEvent($c8f95463ff5f043e$var$_objectSpread2({\n putSortable: $c8f95463ff5f043e$var$putSortable,\n cloneEl: $c8f95463ff5f043e$var$cloneEl,\n targetEl: $c8f95463ff5f043e$var$dragEl,\n rootEl: $c8f95463ff5f043e$var$rootEl,\n oldIndex: $c8f95463ff5f043e$var$oldIndex,\n oldDraggableIndex: $c8f95463ff5f043e$var$oldDraggableIndex,\n newIndex: $c8f95463ff5f043e$var$newIndex,\n newDraggableIndex: $c8f95463ff5f043e$var$newDraggableIndex\n }, info));\n}\nvar $c8f95463ff5f043e$var$dragEl, $c8f95463ff5f043e$var$parentEl, $c8f95463ff5f043e$var$ghostEl, $c8f95463ff5f043e$var$rootEl, $c8f95463ff5f043e$var$nextEl, $c8f95463ff5f043e$var$lastDownEl, $c8f95463ff5f043e$var$cloneEl, $c8f95463ff5f043e$var$cloneHidden, $c8f95463ff5f043e$var$oldIndex, $c8f95463ff5f043e$var$newIndex, $c8f95463ff5f043e$var$oldDraggableIndex, $c8f95463ff5f043e$var$newDraggableIndex, $c8f95463ff5f043e$var$activeGroup, $c8f95463ff5f043e$var$putSortable, $c8f95463ff5f043e$var$awaitingDragStarted = false, $c8f95463ff5f043e$var$ignoreNextClick = false, $c8f95463ff5f043e$var$sortables = [], $c8f95463ff5f043e$var$tapEvt, $c8f95463ff5f043e$var$touchEvt, $c8f95463ff5f043e$var$lastDx, $c8f95463ff5f043e$var$lastDy, $c8f95463ff5f043e$var$tapDistanceLeft, $c8f95463ff5f043e$var$tapDistanceTop, $c8f95463ff5f043e$var$moved, $c8f95463ff5f043e$var$lastTarget, $c8f95463ff5f043e$var$lastDirection, $c8f95463ff5f043e$var$pastFirstInvertThresh = false, $c8f95463ff5f043e$var$isCircumstantialInvert = false, $c8f95463ff5f043e$var$targetMoveDistance, // For positioning ghost absolutely\n$c8f95463ff5f043e$var$ghostRelativeParent, $c8f95463ff5f043e$var$ghostRelativeParentInitialScroll = [], // (left, top)\n$c8f95463ff5f043e$var$_silent = false, $c8f95463ff5f043e$var$savedInputChecked = [];\n/** @const */ var $c8f95463ff5f043e$var$documentExists = typeof document !== \"undefined\", $c8f95463ff5f043e$var$PositionGhostAbsolutely = $c8f95463ff5f043e$var$IOS, $c8f95463ff5f043e$var$CSSFloatProperty = $c8f95463ff5f043e$var$Edge || $c8f95463ff5f043e$var$IE11OrLess ? \"cssFloat\" : \"float\", // This will not pass for IE9, because IE9 DnD only works on anchors\n$c8f95463ff5f043e$var$supportDraggable = $c8f95463ff5f043e$var$documentExists && !$c8f95463ff5f043e$var$ChromeForAndroid && !$c8f95463ff5f043e$var$IOS && \"draggable\" in document.createElement(\"div\"), $c8f95463ff5f043e$var$supportCssPointerEvents = function() {\n if (!$c8f95463ff5f043e$var$documentExists) return;\n // false when <= IE11\n if ($c8f95463ff5f043e$var$IE11OrLess) return false;\n var el = document.createElement(\"x\");\n el.style.cssText = \"pointer-events:auto\";\n return el.style.pointerEvents === \"auto\";\n}(), $c8f95463ff5f043e$var$_detectDirection = function _detectDirection(el, options) {\n var elCSS = $c8f95463ff5f043e$var$css(el), elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth), child1 = $c8f95463ff5f043e$var$getChild(el, 0, options), child2 = $c8f95463ff5f043e$var$getChild(el, 1, options), firstChildCSS = child1 && $c8f95463ff5f043e$var$css(child1), secondChildCSS = child2 && $c8f95463ff5f043e$var$css(child2), firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + $c8f95463ff5f043e$var$getRect(child1).width, secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + $c8f95463ff5f043e$var$getRect(child2).width;\n if (elCSS.display === \"flex\") return elCSS.flexDirection === \"column\" || elCSS.flexDirection === \"column-reverse\" ? \"vertical\" : \"horizontal\";\n if (elCSS.display === \"grid\") return elCSS.gridTemplateColumns.split(\" \").length <= 1 ? \"vertical\" : \"horizontal\";\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== \"none\") {\n var touchingSideChild2 = firstChildCSS[\"float\"] === \"left\" ? \"left\" : \"right\";\n return child2 && (secondChildCSS.clear === \"both\" || secondChildCSS.clear === touchingSideChild2) ? \"vertical\" : \"horizontal\";\n }\n return child1 && (firstChildCSS.display === \"block\" || firstChildCSS.display === \"flex\" || firstChildCSS.display === \"table\" || firstChildCSS.display === \"grid\" || firstChildWidth >= elWidth && elCSS[$c8f95463ff5f043e$var$CSSFloatProperty] === \"none\" || child2 && elCSS[$c8f95463ff5f043e$var$CSSFloatProperty] === \"none\" && firstChildWidth + secondChildWidth > elWidth) ? \"vertical\" : \"horizontal\";\n}, $c8f95463ff5f043e$var$_dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top, dragElS2Opp = vertical ? dragRect.right : dragRect.bottom, dragElOppLength = vertical ? dragRect.width : dragRect.height, targetS1Opp = vertical ? targetRect.left : targetRect.top, targetS2Opp = vertical ? targetRect.right : targetRect.bottom, targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n}, /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */ $c8f95463ff5f043e$var$_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n $c8f95463ff5f043e$var$sortables.some(function(sortable) {\n var threshold = sortable[$c8f95463ff5f043e$var$expando].options.emptyInsertThreshold;\n if (!threshold || $c8f95463ff5f043e$var$lastChild(sortable)) return;\n var rect = $c8f95463ff5f043e$var$getRect(sortable), insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) return ret = sortable;\n });\n return ret;\n}, $c8f95463ff5f043e$var$_prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function(to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) // Default pull value\n // Default pull and put value if same group\n return true;\n else if (value == null || value === false) return false;\n else if (pull && value === \"clone\") return value;\n else if (typeof value === \"function\") return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === \"string\" && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || $c8f95463ff5f043e$var$_typeof(originalGroup) != \"object\") originalGroup = {\n name: originalGroup\n };\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n}, $c8f95463ff5f043e$var$_hideGhostForTarget = function _hideGhostForTarget() {\n if (!$c8f95463ff5f043e$var$supportCssPointerEvents && $c8f95463ff5f043e$var$ghostEl) $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"display\", \"none\");\n}, $c8f95463ff5f043e$var$_unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!$c8f95463ff5f043e$var$supportCssPointerEvents && $c8f95463ff5f043e$var$ghostEl) $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"display\", \"\");\n};\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif ($c8f95463ff5f043e$var$documentExists && !$c8f95463ff5f043e$var$ChromeForAndroid) document.addEventListener(\"click\", function(evt) {\n if ($c8f95463ff5f043e$var$ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n $c8f95463ff5f043e$var$ignoreNextClick = false;\n return false;\n }\n}, true);\nvar $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if ($c8f95463ff5f043e$var$dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = $c8f95463ff5f043e$var$_detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for(var i in evt)if (evt.hasOwnProperty(i)) event[i] = evt[i];\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[$c8f95463ff5f043e$var$expando]._onDragOver(event);\n }\n }\n};\nvar $c8f95463ff5f043e$var$_checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if ($c8f95463ff5f043e$var$dragEl) $c8f95463ff5f043e$var$dragEl.parentNode[$c8f95463ff5f043e$var$expando]._isOutsideThisEl(evt.target);\n};\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */ function $c8f95463ff5f043e$export$31b3ca70d8f57423(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) throw \"Sortable: `el` must be an HTMLElement, not \".concat(({}).toString.call(el));\n this.el = el; // root element\n this.options = options = $c8f95463ff5f043e$var$_extends({}, options);\n // Export instance\n el[$c8f95463ff5f043e$var$expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? \">li\" : \">*\",\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return $c8f95463ff5f043e$var$_detectDirection(el, this.options);\n },\n ghostClass: \"sortable-ghost\",\n chosenClass: \"sortable-chosen\",\n dragClass: \"sortable-drag\",\n ignore: \"a, img\",\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData(\"Text\", dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: \"data-id\",\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: \"sortable-fallback\",\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: $c8f95463ff5f043e$export$31b3ca70d8f57423.supportPointer !== false && \"PointerEvent\" in window && !$c8f95463ff5f043e$var$Safari,\n emptyInsertThreshold: 5\n };\n $c8f95463ff5f043e$var$PluginManager.initializePlugins(this, el, defaults);\n // Set default options\n for(var name in defaults)!(name in options) && (options[name] = defaults[name]);\n $c8f95463ff5f043e$var$_prepareGroup(options);\n // Bind all private methods\n for(var fn in this)if (fn.charAt(0) === \"_\" && typeof this[fn] === \"function\") this[fn] = this[fn].bind(this);\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : $c8f95463ff5f043e$var$supportDraggable;\n if (this.nativeDraggable) // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n // Bind events\n if (options.supportPointer) $c8f95463ff5f043e$var$on(el, \"pointerdown\", this._onTapStart);\n else {\n $c8f95463ff5f043e$var$on(el, \"mousedown\", this._onTapStart);\n $c8f95463ff5f043e$var$on(el, \"touchstart\", this._onTapStart);\n }\n if (this.nativeDraggable) {\n $c8f95463ff5f043e$var$on(el, \"dragover\", this);\n $c8f95463ff5f043e$var$on(el, \"dragenter\", this);\n }\n $c8f95463ff5f043e$var$sortables.push(this.el);\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n // Add animation state manager\n $c8f95463ff5f043e$var$_extends(this, $c8f95463ff5f043e$var$AnimationStateManager());\n}\n$c8f95463ff5f043e$export$31b3ca70d8f57423.prototype = /** @lends Sortable.prototype */ {\n constructor: $c8f95463ff5f043e$export$31b3ca70d8f57423,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) $c8f95463ff5f043e$var$lastTarget = null;\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === \"function\" ? this.options.direction.call(this, evt, target, $c8f95463ff5f043e$var$dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(/** Event|TouchEvent */ evt) {\n if (!evt.cancelable) return;\n var _this = this, el = this.el, options = this.options, preventOnFilter = options.preventOnFilter, type = evt.type, touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === \"touch\" && evt, target = (touch || evt).target, originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, filter = options.filter;\n $c8f95463ff5f043e$var$_saveInputCheckedState(el);\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if ($c8f95463ff5f043e$var$dragEl) return;\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) return; // only left button and enabled\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) return;\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && $c8f95463ff5f043e$var$Safari && target && target.tagName.toUpperCase() === \"SELECT\") return;\n target = $c8f95463ff5f043e$var$closest(target, options.draggable, el, false);\n if (target && target.animated) return;\n if ($c8f95463ff5f043e$var$lastDownEl === target) // Ignoring duplicate `down`\n return;\n // Get the index of the dragged element within its parent\n $c8f95463ff5f043e$var$oldIndex = $c8f95463ff5f043e$var$index(target);\n $c8f95463ff5f043e$var$oldDraggableIndex = $c8f95463ff5f043e$var$index(target, options.draggable);\n // Check filter\n if (typeof filter === \"function\") {\n if (filter.call(this, evt, target, this)) {\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: \"filter\",\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n $c8f95463ff5f043e$var$pluginEvent(\"filter\", _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(\",\").some(function(criteria) {\n criteria = $c8f95463ff5f043e$var$closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: \"filter\",\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n $c8f95463ff5f043e$var$pluginEvent(\"filter\", _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !$c8f95463ff5f043e$var$closest(originalTarget, options.handle, el, false)) return;\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(/** Event */ evt, /** Touch */ touch, /** HTMLElement */ target) {\n var _this = this, el = _this.el, options = _this.options, ownerDocument = el.ownerDocument, dragStartFn;\n if (target && !$c8f95463ff5f043e$var$dragEl && target.parentNode === el) {\n var dragRect = $c8f95463ff5f043e$var$getRect(target);\n $c8f95463ff5f043e$var$rootEl = el;\n $c8f95463ff5f043e$var$dragEl = target;\n $c8f95463ff5f043e$var$parentEl = $c8f95463ff5f043e$var$dragEl.parentNode;\n $c8f95463ff5f043e$var$nextEl = $c8f95463ff5f043e$var$dragEl.nextSibling;\n $c8f95463ff5f043e$var$lastDownEl = target;\n $c8f95463ff5f043e$var$activeGroup = options.group;\n $c8f95463ff5f043e$export$31b3ca70d8f57423.dragged = $c8f95463ff5f043e$var$dragEl;\n $c8f95463ff5f043e$var$tapEvt = {\n target: $c8f95463ff5f043e$var$dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n $c8f95463ff5f043e$var$tapDistanceLeft = $c8f95463ff5f043e$var$tapEvt.clientX - dragRect.left;\n $c8f95463ff5f043e$var$tapDistanceTop = $c8f95463ff5f043e$var$tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n $c8f95463ff5f043e$var$dragEl.style[\"will-change\"] = \"all\";\n dragStartFn = function dragStartFn() {\n $c8f95463ff5f043e$var$pluginEvent(\"delayEnded\", _this, {\n evt: evt\n });\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!$c8f95463ff5f043e$var$FireFox && _this.nativeDraggable) $c8f95463ff5f043e$var$dragEl.draggable = true;\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n // Drag start event\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: _this,\n name: \"choose\",\n originalEvent: evt\n });\n // Chosen item\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, options.chosenClass, true);\n };\n // Disable \"draggable\"\n options.ignore.split(\",\").forEach(function(criteria) {\n $c8f95463ff5f043e$var$find($c8f95463ff5f043e$var$dragEl, criteria.trim(), $c8f95463ff5f043e$var$_disableDraggable);\n });\n $c8f95463ff5f043e$var$on(ownerDocument, \"dragover\", $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent);\n $c8f95463ff5f043e$var$on(ownerDocument, \"mousemove\", $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent);\n $c8f95463ff5f043e$var$on(ownerDocument, \"touchmove\", $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent);\n $c8f95463ff5f043e$var$on(ownerDocument, \"mouseup\", _this._onDrop);\n $c8f95463ff5f043e$var$on(ownerDocument, \"touchend\", _this._onDrop);\n $c8f95463ff5f043e$var$on(ownerDocument, \"touchcancel\", _this._onDrop);\n // Make dragEl draggable (must be before delay for FireFox)\n if ($c8f95463ff5f043e$var$FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n $c8f95463ff5f043e$var$dragEl.draggable = true;\n }\n $c8f95463ff5f043e$var$pluginEvent(\"delayStart\", this, {\n evt: evt\n });\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !($c8f95463ff5f043e$var$Edge || $c8f95463ff5f043e$var$IE11OrLess))) {\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n $c8f95463ff5f043e$var$on(ownerDocument, \"mouseup\", _this._disableDelayedDrag);\n $c8f95463ff5f043e$var$on(ownerDocument, \"touchend\", _this._disableDelayedDrag);\n $c8f95463ff5f043e$var$on(ownerDocument, \"touchcancel\", _this._disableDelayedDrag);\n $c8f95463ff5f043e$var$on(ownerDocument, \"mousemove\", _this._delayedDragTouchMoveHandler);\n $c8f95463ff5f043e$var$on(ownerDocument, \"touchmove\", _this._delayedDragTouchMoveHandler);\n options.supportPointer && $c8f95463ff5f043e$var$on(ownerDocument, \"pointermove\", _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else dragStartFn();\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(/** TouchEvent|PointerEvent **/ e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) this._disableDelayedDrag();\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n $c8f95463ff5f043e$var$dragEl && $c8f95463ff5f043e$var$_disableDraggable($c8f95463ff5f043e$var$dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n $c8f95463ff5f043e$var$off(ownerDocument, \"mouseup\", this._disableDelayedDrag);\n $c8f95463ff5f043e$var$off(ownerDocument, \"touchend\", this._disableDelayedDrag);\n $c8f95463ff5f043e$var$off(ownerDocument, \"touchcancel\", this._disableDelayedDrag);\n $c8f95463ff5f043e$var$off(ownerDocument, \"mousemove\", this._delayedDragTouchMoveHandler);\n $c8f95463ff5f043e$var$off(ownerDocument, \"touchmove\", this._delayedDragTouchMoveHandler);\n $c8f95463ff5f043e$var$off(ownerDocument, \"pointermove\", this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(/** Event */ evt, /** Touch */ touch) {\n touch = touch || evt.pointerType == \"touch\" && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) $c8f95463ff5f043e$var$on(document, \"pointermove\", this._onTouchMove);\n else if (touch) $c8f95463ff5f043e$var$on(document, \"touchmove\", this._onTouchMove);\n else $c8f95463ff5f043e$var$on(document, \"mousemove\", this._onTouchMove);\n } else {\n $c8f95463ff5f043e$var$on($c8f95463ff5f043e$var$dragEl, \"dragend\", this);\n $c8f95463ff5f043e$var$on($c8f95463ff5f043e$var$rootEl, \"dragstart\", this._onDragStart);\n }\n try {\n if (document.selection) // Timeout neccessary for IE9\n $c8f95463ff5f043e$var$_nextTick(function() {\n document.selection.empty();\n });\n else window.getSelection().removeAllRanges();\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n $c8f95463ff5f043e$var$awaitingDragStarted = false;\n if ($c8f95463ff5f043e$var$rootEl && $c8f95463ff5f043e$var$dragEl) {\n $c8f95463ff5f043e$var$pluginEvent(\"dragStarted\", this, {\n evt: evt\n });\n if (this.nativeDraggable) $c8f95463ff5f043e$var$on(document, \"dragover\", $c8f95463ff5f043e$var$_checkOutsideTargetEl);\n var options = this.options;\n // Apply effect\n !fallback && $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, options.dragClass, false);\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, options.ghostClass, true);\n $c8f95463ff5f043e$export$31b3ca70d8f57423.active = this;\n fallback && this._appendGhost();\n // Drag start event\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"start\",\n originalEvent: evt\n });\n } else this._nulling();\n },\n _emulateDragOver: function _emulateDragOver() {\n if ($c8f95463ff5f043e$var$touchEvt) {\n this._lastX = $c8f95463ff5f043e$var$touchEvt.clientX;\n this._lastY = $c8f95463ff5f043e$var$touchEvt.clientY;\n $c8f95463ff5f043e$var$_hideGhostForTarget();\n var target = document.elementFromPoint($c8f95463ff5f043e$var$touchEvt.clientX, $c8f95463ff5f043e$var$touchEvt.clientY);\n var parent = target;\n while(target && target.shadowRoot){\n target = target.shadowRoot.elementFromPoint($c8f95463ff5f043e$var$touchEvt.clientX, $c8f95463ff5f043e$var$touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n $c8f95463ff5f043e$var$dragEl.parentNode[$c8f95463ff5f043e$var$expando]._isOutsideThisEl(target);\n if (parent) do {\n if (parent[$c8f95463ff5f043e$var$expando]) {\n var inserted = void 0;\n inserted = parent[$c8f95463ff5f043e$var$expando]._onDragOver({\n clientX: $c8f95463ff5f043e$var$touchEvt.clientX,\n clientY: $c8f95463ff5f043e$var$touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) break;\n }\n target = parent; // store last element\n }while (parent = parent.parentNode);\n $c8f95463ff5f043e$var$_unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(/**TouchEvent*/ evt) {\n if ($c8f95463ff5f043e$var$tapEvt) {\n var options = this.options, fallbackTolerance = options.fallbackTolerance, fallbackOffset = options.fallbackOffset, touch = evt.touches ? evt.touches[0] : evt, ghostMatrix = $c8f95463ff5f043e$var$ghostEl && $c8f95463ff5f043e$var$matrix($c8f95463ff5f043e$var$ghostEl, true), scaleX = $c8f95463ff5f043e$var$ghostEl && ghostMatrix && ghostMatrix.a, scaleY = $c8f95463ff5f043e$var$ghostEl && ghostMatrix && ghostMatrix.d, relativeScrollOffset = $c8f95463ff5f043e$var$PositionGhostAbsolutely && $c8f95463ff5f043e$var$ghostRelativeParent && $c8f95463ff5f043e$var$getRelativeScrollOffset($c8f95463ff5f043e$var$ghostRelativeParent), dx = (touch.clientX - $c8f95463ff5f043e$var$tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - $c8f95463ff5f043e$var$ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1), dy = (touch.clientY - $c8f95463ff5f043e$var$tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - $c8f95463ff5f043e$var$ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n // only set the status to dragging, when we are actually dragging\n if (!$c8f95463ff5f043e$export$31b3ca70d8f57423.active && !$c8f95463ff5f043e$var$awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) return;\n this._onDragStart(evt, true);\n }\n if ($c8f95463ff5f043e$var$ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - ($c8f95463ff5f043e$var$lastDx || 0);\n ghostMatrix.f += dy - ($c8f95463ff5f043e$var$lastDy || 0);\n } else ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"webkitTransform\", cssMatrix);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"mozTransform\", cssMatrix);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"msTransform\", cssMatrix);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"transform\", cssMatrix);\n $c8f95463ff5f043e$var$lastDx = dx;\n $c8f95463ff5f043e$var$lastDy = dy;\n $c8f95463ff5f043e$var$touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!$c8f95463ff5f043e$var$ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : $c8f95463ff5f043e$var$rootEl, rect = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$dragEl, true, $c8f95463ff5f043e$var$PositionGhostAbsolutely, true, container), options = this.options;\n // Position absolutely\n if ($c8f95463ff5f043e$var$PositionGhostAbsolutely) {\n // Get relatively positioned parent\n $c8f95463ff5f043e$var$ghostRelativeParent = container;\n while($c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostRelativeParent, \"position\") === \"static\" && $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostRelativeParent, \"transform\") === \"none\" && $c8f95463ff5f043e$var$ghostRelativeParent !== document)$c8f95463ff5f043e$var$ghostRelativeParent = $c8f95463ff5f043e$var$ghostRelativeParent.parentNode;\n if ($c8f95463ff5f043e$var$ghostRelativeParent !== document.body && $c8f95463ff5f043e$var$ghostRelativeParent !== document.documentElement) {\n if ($c8f95463ff5f043e$var$ghostRelativeParent === document) $c8f95463ff5f043e$var$ghostRelativeParent = $c8f95463ff5f043e$var$getWindowScrollingElement();\n rect.top += $c8f95463ff5f043e$var$ghostRelativeParent.scrollTop;\n rect.left += $c8f95463ff5f043e$var$ghostRelativeParent.scrollLeft;\n } else $c8f95463ff5f043e$var$ghostRelativeParent = $c8f95463ff5f043e$var$getWindowScrollingElement();\n $c8f95463ff5f043e$var$ghostRelativeParentInitialScroll = $c8f95463ff5f043e$var$getRelativeScrollOffset($c8f95463ff5f043e$var$ghostRelativeParent);\n }\n $c8f95463ff5f043e$var$ghostEl = $c8f95463ff5f043e$var$dragEl.cloneNode(true);\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$ghostEl, options.ghostClass, false);\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$ghostEl, options.fallbackClass, true);\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$ghostEl, options.dragClass, true);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"transition\", \"\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"transform\", \"\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"box-sizing\", \"border-box\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"margin\", 0);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"top\", rect.top);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"left\", rect.left);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"width\", rect.width);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"height\", rect.height);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"opacity\", \"0.8\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"position\", $c8f95463ff5f043e$var$PositionGhostAbsolutely ? \"absolute\" : \"fixed\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"zIndex\", \"100000\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"pointerEvents\", \"none\");\n $c8f95463ff5f043e$export$31b3ca70d8f57423.ghost = $c8f95463ff5f043e$var$ghostEl;\n container.appendChild($c8f95463ff5f043e$var$ghostEl);\n // Set transform-origin\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"transform-origin\", $c8f95463ff5f043e$var$tapDistanceLeft / parseInt($c8f95463ff5f043e$var$ghostEl.style.width) * 100 + \"% \" + $c8f95463ff5f043e$var$tapDistanceTop / parseInt($c8f95463ff5f043e$var$ghostEl.style.height) * 100 + \"%\");\n }\n },\n _onDragStart: function _onDragStart(/**Event*/ evt, /**boolean*/ fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n $c8f95463ff5f043e$var$pluginEvent(\"dragStart\", this, {\n evt: evt\n });\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) {\n this._onDrop();\n return;\n }\n $c8f95463ff5f043e$var$pluginEvent(\"setupClone\", this);\n if (!$c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) {\n $c8f95463ff5f043e$var$cloneEl = $c8f95463ff5f043e$var$clone($c8f95463ff5f043e$var$dragEl);\n $c8f95463ff5f043e$var$cloneEl.removeAttribute(\"id\");\n $c8f95463ff5f043e$var$cloneEl.draggable = false;\n $c8f95463ff5f043e$var$cloneEl.style[\"will-change\"] = \"\";\n this._hideClone();\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$cloneEl, this.options.chosenClass, false);\n $c8f95463ff5f043e$export$31b3ca70d8f57423.clone = $c8f95463ff5f043e$var$cloneEl;\n }\n // #1143: IFrame support workaround\n _this.cloneId = $c8f95463ff5f043e$var$_nextTick(function() {\n $c8f95463ff5f043e$var$pluginEvent(\"clone\", _this);\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) $c8f95463ff5f043e$var$rootEl.insertBefore($c8f95463ff5f043e$var$cloneEl, $c8f95463ff5f043e$var$dragEl);\n _this._hideClone();\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: _this,\n name: \"clone\"\n });\n });\n !fallback && $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, options.dragClass, true);\n // Set proper drop events\n if (fallback) {\n $c8f95463ff5f043e$var$ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n $c8f95463ff5f043e$var$off(document, \"mouseup\", _this._onDrop);\n $c8f95463ff5f043e$var$off(document, \"touchend\", _this._onDrop);\n $c8f95463ff5f043e$var$off(document, \"touchcancel\", _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = \"move\";\n options.setData && options.setData.call(_this, dataTransfer, $c8f95463ff5f043e$var$dragEl);\n }\n $c8f95463ff5f043e$var$on(document, \"drop\", _this);\n // #1276 fix:\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$dragEl, \"transform\", \"translateZ(0)\");\n }\n $c8f95463ff5f043e$var$awaitingDragStarted = true;\n _this._dragStartId = $c8f95463ff5f043e$var$_nextTick(_this._dragStarted.bind(_this, fallback, evt));\n $c8f95463ff5f043e$var$on(document, \"selectstart\", _this);\n $c8f95463ff5f043e$var$moved = true;\n if ($c8f95463ff5f043e$var$Safari) $c8f95463ff5f043e$var$css(document.body, \"user-select\", \"none\");\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(/**Event*/ evt) {\n var el = this.el, target = evt.target, dragRect, targetRect, revert, options = this.options, group = options.group, activeSortable = $c8f95463ff5f043e$export$31b3ca70d8f57423.active, isOwner = $c8f95463ff5f043e$var$activeGroup === group, canSort = options.sort, fromSortable = $c8f95463ff5f043e$var$putSortable || activeSortable, vertical, _this = this, completedFired = false;\n if ($c8f95463ff5f043e$var$_silent) return;\n function dragOverEvent(name, extra) {\n $c8f95463ff5f043e$var$pluginEvent(name, _this, $c8f95463ff5f043e$var$_objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? \"vertical\" : \"horizontal\",\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return $c8f95463ff5f043e$var$_onMove($c8f95463ff5f043e$var$rootEl, el, $c8f95463ff5f043e$var$dragEl, dragRect, target, $c8f95463ff5f043e$var$getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n // Capture animation state\n function capture() {\n dragOverEvent(\"dragOverAnimationCapture\");\n _this.captureAnimationState();\n if (_this !== fromSortable) fromSortable.captureAnimationState();\n }\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent(\"dragOverCompleted\", {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) activeSortable._hideClone();\n else activeSortable._showClone(_this);\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, $c8f95463ff5f043e$var$putSortable ? $c8f95463ff5f043e$var$putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, options.ghostClass, true);\n }\n if ($c8f95463ff5f043e$var$putSortable !== _this && _this !== $c8f95463ff5f043e$export$31b3ca70d8f57423.active) $c8f95463ff5f043e$var$putSortable = _this;\n else if (_this === $c8f95463ff5f043e$export$31b3ca70d8f57423.active && $c8f95463ff5f043e$var$putSortable) $c8f95463ff5f043e$var$putSortable = null;\n // Animation\n if (fromSortable === _this) _this._ignoreWhileAnimating = target;\n _this.animateAll(function() {\n dragOverEvent(\"dragOverAnimationComplete\");\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n // Null lastTarget if it is not inside a previously swapped element\n if (target === $c8f95463ff5f043e$var$dragEl && !$c8f95463ff5f043e$var$dragEl.animated || target === el && !target.animated) $c8f95463ff5f043e$var$lastTarget = null;\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n $c8f95463ff5f043e$var$dragEl.parentNode[$c8f95463ff5f043e$var$expando]._isOutsideThisEl(evt.target);\n // Do not detect for empty insert if already inserted\n !insertion && $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n // Call when dragEl has been inserted\n function changed() {\n $c8f95463ff5f043e$var$newIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl);\n $c8f95463ff5f043e$var$newDraggableIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl, options.draggable);\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: _this,\n name: \"change\",\n toEl: el,\n newIndex: $c8f95463ff5f043e$var$newIndex,\n newDraggableIndex: $c8f95463ff5f043e$var$newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) evt.cancelable && evt.preventDefault();\n target = $c8f95463ff5f043e$var$closest(target, options.draggable, el, true);\n dragOverEvent(\"dragOver\");\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) return completedFired;\n if ($c8f95463ff5f043e$var$dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) return completed(false);\n $c8f95463ff5f043e$var$ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = $c8f95463ff5f043e$var$parentEl !== $c8f95463ff5f043e$var$rootEl // Reverting item into the original list\n ) : $c8f95463ff5f043e$var$putSortable === this || (this.lastPutMode = $c8f95463ff5f043e$var$activeGroup.checkPull(this, activeSortable, $c8f95463ff5f043e$var$dragEl, evt)) && group.checkPut(this, activeSortable, $c8f95463ff5f043e$var$dragEl, evt))) {\n vertical = this._getDirection(evt, target) === \"vertical\";\n dragRect = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$dragEl);\n dragOverEvent(\"dragOverValid\");\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) return completedFired;\n if (revert) {\n $c8f95463ff5f043e$var$parentEl = $c8f95463ff5f043e$var$rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent(\"revert\");\n if (!$c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) {\n if ($c8f95463ff5f043e$var$nextEl) $c8f95463ff5f043e$var$rootEl.insertBefore($c8f95463ff5f043e$var$dragEl, $c8f95463ff5f043e$var$nextEl);\n else $c8f95463ff5f043e$var$rootEl.appendChild($c8f95463ff5f043e$var$dragEl);\n }\n return completed(true);\n }\n var elLastChild = $c8f95463ff5f043e$var$lastChild(el, options.draggable);\n if (!elLastChild || $c8f95463ff5f043e$var$_ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n // If already at end of list: Do not insert\n if (elLastChild === $c8f95463ff5f043e$var$dragEl) return completed(false);\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) target = elLastChild;\n if (target) targetRect = $c8f95463ff5f043e$var$getRect(target);\n if ($c8f95463ff5f043e$var$_onMove($c8f95463ff5f043e$var$rootEl, el, $c8f95463ff5f043e$var$dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) // the last draggable element is not the last node\n el.insertBefore($c8f95463ff5f043e$var$dragEl, elLastChild.nextSibling);\n else el.appendChild($c8f95463ff5f043e$var$dragEl);\n $c8f95463ff5f043e$var$parentEl = el; // actualization\n changed();\n return completed(true);\n }\n } else if (elLastChild && $c8f95463ff5f043e$var$_ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = $c8f95463ff5f043e$var$getChild(el, 0, options, true);\n if (firstChild === $c8f95463ff5f043e$var$dragEl) return completed(false);\n target = firstChild;\n targetRect = $c8f95463ff5f043e$var$getRect(target);\n if ($c8f95463ff5f043e$var$_onMove($c8f95463ff5f043e$var$rootEl, el, $c8f95463ff5f043e$var$dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore($c8f95463ff5f043e$var$dragEl, firstChild);\n $c8f95463ff5f043e$var$parentEl = el; // actualization\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = $c8f95463ff5f043e$var$getRect(target);\n var direction = 0, targetBeforeFirstSwap, differentLevel = $c8f95463ff5f043e$var$dragEl.parentNode !== el, differentRowCol = !$c8f95463ff5f043e$var$_dragElInRowColumn($c8f95463ff5f043e$var$dragEl.animated && $c8f95463ff5f043e$var$dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical), side1 = vertical ? \"top\" : \"left\", scrolledPastTop = $c8f95463ff5f043e$var$isScrolledPast(target, \"top\", \"top\") || $c8f95463ff5f043e$var$isScrolledPast($c8f95463ff5f043e$var$dragEl, \"top\", \"top\"), scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if ($c8f95463ff5f043e$var$lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n $c8f95463ff5f043e$var$pastFirstInvertThresh = false;\n $c8f95463ff5f043e$var$isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = $c8f95463ff5f043e$var$_getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, $c8f95463ff5f043e$var$isCircumstantialInvert, $c8f95463ff5f043e$var$lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl);\n do {\n dragIndex -= direction;\n sibling = $c8f95463ff5f043e$var$parentEl.children[dragIndex];\n }while (sibling && ($c8f95463ff5f043e$var$css(sibling, \"display\") === \"none\" || sibling === $c8f95463ff5f043e$var$ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) return completed(false);\n $c8f95463ff5f043e$var$lastTarget = target;\n $c8f95463ff5f043e$var$lastDirection = direction;\n var nextSibling = target.nextElementSibling, after = false;\n after = direction === 1;\n var moveVector = $c8f95463ff5f043e$var$_onMove($c8f95463ff5f043e$var$rootEl, el, $c8f95463ff5f043e$var$dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) after = moveVector === 1;\n $c8f95463ff5f043e$var$_silent = true;\n setTimeout($c8f95463ff5f043e$var$_unsilent, 30);\n capture();\n if (after && !nextSibling) el.appendChild($c8f95463ff5f043e$var$dragEl);\n else target.parentNode.insertBefore($c8f95463ff5f043e$var$dragEl, after ? nextSibling : target);\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) $c8f95463ff5f043e$var$scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n $c8f95463ff5f043e$var$parentEl = $c8f95463ff5f043e$var$dragEl.parentNode; // actualization\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !$c8f95463ff5f043e$var$isCircumstantialInvert) $c8f95463ff5f043e$var$targetMoveDistance = Math.abs(targetBeforeFirstSwap - $c8f95463ff5f043e$var$getRect(target)[side1]);\n changed();\n return completed(true);\n }\n }\n if (el.contains($c8f95463ff5f043e$var$dragEl)) return completed(false);\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n $c8f95463ff5f043e$var$off(document, \"mousemove\", this._onTouchMove);\n $c8f95463ff5f043e$var$off(document, \"touchmove\", this._onTouchMove);\n $c8f95463ff5f043e$var$off(document, \"pointermove\", this._onTouchMove);\n $c8f95463ff5f043e$var$off(document, \"dragover\", $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent);\n $c8f95463ff5f043e$var$off(document, \"mousemove\", $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent);\n $c8f95463ff5f043e$var$off(document, \"touchmove\", $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n $c8f95463ff5f043e$var$off(ownerDocument, \"mouseup\", this._onDrop);\n $c8f95463ff5f043e$var$off(ownerDocument, \"touchend\", this._onDrop);\n $c8f95463ff5f043e$var$off(ownerDocument, \"pointerup\", this._onDrop);\n $c8f95463ff5f043e$var$off(ownerDocument, \"touchcancel\", this._onDrop);\n $c8f95463ff5f043e$var$off(document, \"selectstart\", this);\n },\n _onDrop: function _onDrop(/**Event*/ evt) {\n var el = this.el, options = this.options;\n // Get the index of the dragged element within its parent\n $c8f95463ff5f043e$var$newIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl);\n $c8f95463ff5f043e$var$newDraggableIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl, options.draggable);\n $c8f95463ff5f043e$var$pluginEvent(\"drop\", this, {\n evt: evt\n });\n $c8f95463ff5f043e$var$parentEl = $c8f95463ff5f043e$var$dragEl && $c8f95463ff5f043e$var$dragEl.parentNode;\n // Get again after plugin event\n $c8f95463ff5f043e$var$newIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl);\n $c8f95463ff5f043e$var$newDraggableIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl, options.draggable);\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) {\n this._nulling();\n return;\n }\n $c8f95463ff5f043e$var$awaitingDragStarted = false;\n $c8f95463ff5f043e$var$isCircumstantialInvert = false;\n $c8f95463ff5f043e$var$pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n $c8f95463ff5f043e$var$_cancelNextTick(this.cloneId);\n $c8f95463ff5f043e$var$_cancelNextTick(this._dragStartId);\n // Unbind events\n if (this.nativeDraggable) {\n $c8f95463ff5f043e$var$off(document, \"drop\", this);\n $c8f95463ff5f043e$var$off(el, \"dragstart\", this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if ($c8f95463ff5f043e$var$Safari) $c8f95463ff5f043e$var$css(document.body, \"user-select\", \"\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$dragEl, \"transform\", \"\");\n if (evt) {\n if ($c8f95463ff5f043e$var$moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n $c8f95463ff5f043e$var$ghostEl && $c8f95463ff5f043e$var$ghostEl.parentNode && $c8f95463ff5f043e$var$ghostEl.parentNode.removeChild($c8f95463ff5f043e$var$ghostEl);\n if ($c8f95463ff5f043e$var$rootEl === $c8f95463ff5f043e$var$parentEl || $c8f95463ff5f043e$var$putSortable && $c8f95463ff5f043e$var$putSortable.lastPutMode !== \"clone\") // Remove clone(s)\n $c8f95463ff5f043e$var$cloneEl && $c8f95463ff5f043e$var$cloneEl.parentNode && $c8f95463ff5f043e$var$cloneEl.parentNode.removeChild($c8f95463ff5f043e$var$cloneEl);\n if ($c8f95463ff5f043e$var$dragEl) {\n if (this.nativeDraggable) $c8f95463ff5f043e$var$off($c8f95463ff5f043e$var$dragEl, \"dragend\", this);\n $c8f95463ff5f043e$var$_disableDraggable($c8f95463ff5f043e$var$dragEl);\n $c8f95463ff5f043e$var$dragEl.style[\"will-change\"] = \"\";\n // Remove classes\n // ghostClass is added in dragStarted\n if ($c8f95463ff5f043e$var$moved && !$c8f95463ff5f043e$var$awaitingDragStarted) $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, $c8f95463ff5f043e$var$putSortable ? $c8f95463ff5f043e$var$putSortable.options.ghostClass : this.options.ghostClass, false);\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, this.options.chosenClass, false);\n // Drag stop event\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"unchoose\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if ($c8f95463ff5f043e$var$rootEl !== $c8f95463ff5f043e$var$parentEl) {\n if ($c8f95463ff5f043e$var$newIndex >= 0) {\n // Add event\n $c8f95463ff5f043e$var$_dispatchEvent({\n rootEl: $c8f95463ff5f043e$var$parentEl,\n name: \"add\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n fromEl: $c8f95463ff5f043e$var$rootEl,\n originalEvent: evt\n });\n // Remove event\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"remove\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n originalEvent: evt\n });\n // drag from one list and drop into another\n $c8f95463ff5f043e$var$_dispatchEvent({\n rootEl: $c8f95463ff5f043e$var$parentEl,\n name: \"sort\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n fromEl: $c8f95463ff5f043e$var$rootEl,\n originalEvent: evt\n });\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"sort\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n originalEvent: evt\n });\n }\n $c8f95463ff5f043e$var$putSortable && $c8f95463ff5f043e$var$putSortable.save();\n } else {\n if ($c8f95463ff5f043e$var$newIndex !== $c8f95463ff5f043e$var$oldIndex) {\n if ($c8f95463ff5f043e$var$newIndex >= 0) {\n // drag & drop within the same list\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"update\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n originalEvent: evt\n });\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"sort\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.active) {\n /* jshint eqnull:true */ if ($c8f95463ff5f043e$var$newIndex == null || $c8f95463ff5f043e$var$newIndex === -1) {\n $c8f95463ff5f043e$var$newIndex = $c8f95463ff5f043e$var$oldIndex;\n $c8f95463ff5f043e$var$newDraggableIndex = $c8f95463ff5f043e$var$oldDraggableIndex;\n }\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"end\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n originalEvent: evt\n });\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n $c8f95463ff5f043e$var$pluginEvent(\"nulling\", this);\n $c8f95463ff5f043e$var$rootEl = $c8f95463ff5f043e$var$dragEl = $c8f95463ff5f043e$var$parentEl = $c8f95463ff5f043e$var$ghostEl = $c8f95463ff5f043e$var$nextEl = $c8f95463ff5f043e$var$cloneEl = $c8f95463ff5f043e$var$lastDownEl = $c8f95463ff5f043e$var$cloneHidden = $c8f95463ff5f043e$var$tapEvt = $c8f95463ff5f043e$var$touchEvt = $c8f95463ff5f043e$var$moved = $c8f95463ff5f043e$var$newIndex = $c8f95463ff5f043e$var$newDraggableIndex = $c8f95463ff5f043e$var$oldIndex = $c8f95463ff5f043e$var$oldDraggableIndex = $c8f95463ff5f043e$var$lastTarget = $c8f95463ff5f043e$var$lastDirection = $c8f95463ff5f043e$var$putSortable = $c8f95463ff5f043e$var$activeGroup = $c8f95463ff5f043e$export$31b3ca70d8f57423.dragged = $c8f95463ff5f043e$export$31b3ca70d8f57423.ghost = $c8f95463ff5f043e$export$31b3ca70d8f57423.clone = $c8f95463ff5f043e$export$31b3ca70d8f57423.active = null;\n $c8f95463ff5f043e$var$savedInputChecked.forEach(function(el) {\n el.checked = true;\n });\n $c8f95463ff5f043e$var$savedInputChecked.length = $c8f95463ff5f043e$var$lastDx = $c8f95463ff5f043e$var$lastDy = 0;\n },\n handleEvent: function handleEvent(/**Event*/ evt) {\n switch(evt.type){\n case \"drop\":\n case \"dragend\":\n this._onDrop(evt);\n break;\n case \"dragenter\":\n case \"dragover\":\n if ($c8f95463ff5f043e$var$dragEl) {\n this._onDragOver(evt);\n $c8f95463ff5f043e$var$_globalDragOver(evt);\n }\n break;\n case \"selectstart\":\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */ toArray: function toArray() {\n var order = [], el, children = this.el.children, i = 0, n = children.length, options = this.options;\n for(; i < n; i++){\n el = children[i];\n if ($c8f95463ff5f043e$var$closest(el, options.draggable, this.el, false)) order.push(el.getAttribute(options.dataIdAttr) || $c8f95463ff5f043e$var$_generateId(el));\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */ sort: function sort(order, useAnimation) {\n var items = {}, rootEl = this.el;\n this.toArray().forEach(function(id, i) {\n var el = rootEl.children[i];\n if ($c8f95463ff5f043e$var$closest(el, this.options.draggable, rootEl, false)) items[id] = el;\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function(id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */ save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */ closest: function closest$1(el, selector) {\n return $c8f95463ff5f043e$var$closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */ option: function option(name, value) {\n var options = this.options;\n if (value === void 0) return options[name];\n else {\n var modifiedValue = $c8f95463ff5f043e$var$PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== \"undefined\") options[name] = modifiedValue;\n else options[name] = value;\n if (name === \"group\") $c8f95463ff5f043e$var$_prepareGroup(options);\n }\n },\n /**\r\n * Destroy\r\n */ destroy: function destroy() {\n $c8f95463ff5f043e$var$pluginEvent(\"destroy\", this);\n var el = this.el;\n el[$c8f95463ff5f043e$var$expando] = null;\n $c8f95463ff5f043e$var$off(el, \"mousedown\", this._onTapStart);\n $c8f95463ff5f043e$var$off(el, \"touchstart\", this._onTapStart);\n $c8f95463ff5f043e$var$off(el, \"pointerdown\", this._onTapStart);\n if (this.nativeDraggable) {\n $c8f95463ff5f043e$var$off(el, \"dragover\", this);\n $c8f95463ff5f043e$var$off(el, \"dragenter\", this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll(\"[draggable]\"), function(el) {\n el.removeAttribute(\"draggable\");\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n $c8f95463ff5f043e$var$sortables.splice($c8f95463ff5f043e$var$sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!$c8f95463ff5f043e$var$cloneHidden) {\n $c8f95463ff5f043e$var$pluginEvent(\"hideClone\", this);\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) return;\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$cloneEl, \"display\", \"none\");\n if (this.options.removeCloneOnHide && $c8f95463ff5f043e$var$cloneEl.parentNode) $c8f95463ff5f043e$var$cloneEl.parentNode.removeChild($c8f95463ff5f043e$var$cloneEl);\n $c8f95463ff5f043e$var$cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== \"clone\") {\n this._hideClone();\n return;\n }\n if ($c8f95463ff5f043e$var$cloneHidden) {\n $c8f95463ff5f043e$var$pluginEvent(\"showClone\", this);\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) return;\n // show clone at dragEl or original position\n if ($c8f95463ff5f043e$var$dragEl.parentNode == $c8f95463ff5f043e$var$rootEl && !this.options.group.revertClone) $c8f95463ff5f043e$var$rootEl.insertBefore($c8f95463ff5f043e$var$cloneEl, $c8f95463ff5f043e$var$dragEl);\n else if ($c8f95463ff5f043e$var$nextEl) $c8f95463ff5f043e$var$rootEl.insertBefore($c8f95463ff5f043e$var$cloneEl, $c8f95463ff5f043e$var$nextEl);\n else $c8f95463ff5f043e$var$rootEl.appendChild($c8f95463ff5f043e$var$cloneEl);\n if (this.options.group.revertClone) this.animate($c8f95463ff5f043e$var$dragEl, $c8f95463ff5f043e$var$cloneEl);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$cloneEl, \"display\", \"\");\n $c8f95463ff5f043e$var$cloneHidden = false;\n }\n }\n};\nfunction $c8f95463ff5f043e$var$_globalDragOver(/**Event*/ evt) {\n if (evt.dataTransfer) evt.dataTransfer.dropEffect = \"move\";\n evt.cancelable && evt.preventDefault();\n}\nfunction $c8f95463ff5f043e$var$_onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt, sortable = fromEl[$c8f95463ff5f043e$var$expando], onMoveFn = sortable.options.onMove, retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !$c8f95463ff5f043e$var$IE11OrLess && !$c8f95463ff5f043e$var$Edge) evt = new CustomEvent(\"move\", {\n bubbles: true,\n cancelable: true\n });\n else {\n evt = document.createEvent(\"Event\");\n evt.initEvent(\"move\", true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || $c8f95463ff5f043e$var$getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) retVal = onMoveFn.call(sortable, evt, originalEvent);\n return retVal;\n}\nfunction $c8f95463ff5f043e$var$_disableDraggable(el) {\n el.draggable = false;\n}\nfunction $c8f95463ff5f043e$var$_unsilent() {\n $c8f95463ff5f043e$var$_silent = false;\n}\nfunction $c8f95463ff5f043e$var$_ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$getChild(sortable.el, 0, sortable.options, true));\n var sortableContentRect = $c8f95463ff5f043e$var$getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX < sortableContentRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < sortableContentRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction $c8f95463ff5f043e$var$_ghostIsLast(evt, vertical, sortable) {\n var lastElRect = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$lastChild(sortable.el, sortable.options.draggable));\n var sortableContentRect = $c8f95463ff5f043e$var$getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX > sortableContentRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > sortableContentRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction $c8f95463ff5f043e$var$_getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX, targetLength = vertical ? targetRect.height : targetRect.width, targetS1 = vertical ? targetRect.top : targetRect.left, targetS2 = vertical ? targetRect.bottom : targetRect.right, invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && $c8f95463ff5f043e$var$targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!$c8f95463ff5f043e$var$pastFirstInvertThresh && ($c8f95463ff5f043e$var$lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n $c8f95463ff5f043e$var$pastFirstInvertThresh = true;\n if (!$c8f95463ff5f043e$var$pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if ($c8f95463ff5f043e$var$lastDirection === 1 ? mouseOnAxis < targetS1 + $c8f95463ff5f043e$var$targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - $c8f95463ff5f043e$var$targetMoveDistance) return -$c8f95463ff5f043e$var$lastDirection;\n } else invert = true;\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) return $c8f95463ff5f043e$var$_getInsertDirection(target);\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n return 0;\n}\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */ function $c8f95463ff5f043e$var$_getInsertDirection(target) {\n if ($c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl) < $c8f95463ff5f043e$var$index(target)) return 1;\n else return -1;\n}\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */ function $c8f95463ff5f043e$var$_generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent, i = str.length, sum = 0;\n while(i--)sum += str.charCodeAt(i);\n return sum.toString(36);\n}\nfunction $c8f95463ff5f043e$var$_saveInputCheckedState(root) {\n $c8f95463ff5f043e$var$savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName(\"input\");\n var idx = inputs.length;\n while(idx--){\n var el = inputs[idx];\n el.checked && $c8f95463ff5f043e$var$savedInputChecked.push(el);\n }\n}\nfunction $c8f95463ff5f043e$var$_nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction $c8f95463ff5f043e$var$_cancelNextTick(id) {\n return clearTimeout(id);\n}\n// Fixed #973:\nif ($c8f95463ff5f043e$var$documentExists) $c8f95463ff5f043e$var$on(document, \"touchmove\", function(evt) {\n if (($c8f95463ff5f043e$export$31b3ca70d8f57423.active || $c8f95463ff5f043e$var$awaitingDragStarted) && evt.cancelable) evt.preventDefault();\n});\n// Export utils\n$c8f95463ff5f043e$export$31b3ca70d8f57423.utils = {\n on: $c8f95463ff5f043e$var$on,\n off: $c8f95463ff5f043e$var$off,\n css: $c8f95463ff5f043e$var$css,\n find: $c8f95463ff5f043e$var$find,\n is: function is(el, selector) {\n return !!$c8f95463ff5f043e$var$closest(el, selector, el, false);\n },\n extend: $c8f95463ff5f043e$var$extend,\n throttle: $c8f95463ff5f043e$var$throttle,\n closest: $c8f95463ff5f043e$var$closest,\n toggleClass: $c8f95463ff5f043e$var$toggleClass,\n clone: $c8f95463ff5f043e$var$clone,\n index: $c8f95463ff5f043e$var$index,\n nextTick: $c8f95463ff5f043e$var$_nextTick,\n cancelNextTick: $c8f95463ff5f043e$var$_cancelNextTick,\n detectDirection: $c8f95463ff5f043e$var$_detectDirection,\n getChild: $c8f95463ff5f043e$var$getChild\n};\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */ $c8f95463ff5f043e$export$31b3ca70d8f57423.get = function(element) {\n return element[$c8f95463ff5f043e$var$expando];\n};\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */ $c8f95463ff5f043e$export$31b3ca70d8f57423.mount = function() {\n for(var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++)plugins[_key] = arguments[_key];\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function(plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) throw \"Sortable: Mounted plugin must be a constructor function, not \".concat(({}).toString.call(plugin));\n if (plugin.utils) $c8f95463ff5f043e$export$31b3ca70d8f57423.utils = $c8f95463ff5f043e$var$_objectSpread2($c8f95463ff5f043e$var$_objectSpread2({}, $c8f95463ff5f043e$export$31b3ca70d8f57423.utils), plugin.utils);\n $c8f95463ff5f043e$var$PluginManager.mount(plugin);\n });\n};\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */ $c8f95463ff5f043e$export$31b3ca70d8f57423.create = function(el, options) {\n return new $c8f95463ff5f043e$export$31b3ca70d8f57423(el, options);\n};\n// Export\n$c8f95463ff5f043e$export$31b3ca70d8f57423.version = $c8f95463ff5f043e$var$version;\nvar $c8f95463ff5f043e$var$autoScrolls = [], $c8f95463ff5f043e$var$scrollEl, $c8f95463ff5f043e$var$scrollRootEl, $c8f95463ff5f043e$var$scrolling = false, $c8f95463ff5f043e$var$lastAutoScrollX, $c8f95463ff5f043e$var$lastAutoScrollY, $c8f95463ff5f043e$var$touchEvt$1, $c8f95463ff5f043e$var$pointerElemChangedInterval;\nfunction $c8f95463ff5f043e$var$AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n // Bind all private methods\n for(var fn in this)if (fn.charAt(0) === \"_\" && typeof this[fn] === \"function\") this[fn] = this[fn].bind(this);\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) $c8f95463ff5f043e$var$on(document, \"dragover\", this._handleAutoScroll);\n else {\n if (this.options.supportPointer) $c8f95463ff5f043e$var$on(document, \"pointermove\", this._handleFallbackAutoScroll);\n else if (originalEvent.touches) $c8f95463ff5f043e$var$on(document, \"touchmove\", this._handleFallbackAutoScroll);\n else $c8f95463ff5f043e$var$on(document, \"mousemove\", this._handleFallbackAutoScroll);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) this._handleAutoScroll(originalEvent);\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) $c8f95463ff5f043e$var$off(document, \"dragover\", this._handleAutoScroll);\n else {\n $c8f95463ff5f043e$var$off(document, \"pointermove\", this._handleFallbackAutoScroll);\n $c8f95463ff5f043e$var$off(document, \"touchmove\", this._handleFallbackAutoScroll);\n $c8f95463ff5f043e$var$off(document, \"mousemove\", this._handleFallbackAutoScroll);\n }\n $c8f95463ff5f043e$var$clearPointerElemChangedInterval();\n $c8f95463ff5f043e$var$clearAutoScrolls();\n $c8f95463ff5f043e$var$cancelThrottle();\n },\n nulling: function nulling() {\n $c8f95463ff5f043e$var$touchEvt$1 = $c8f95463ff5f043e$var$scrollRootEl = $c8f95463ff5f043e$var$scrollEl = $c8f95463ff5f043e$var$scrolling = $c8f95463ff5f043e$var$pointerElemChangedInterval = $c8f95463ff5f043e$var$lastAutoScrollX = $c8f95463ff5f043e$var$lastAutoScrollY = null;\n $c8f95463ff5f043e$var$autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, elem = document.elementFromPoint(x, y);\n $c8f95463ff5f043e$var$touchEvt$1 = evt;\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || $c8f95463ff5f043e$var$Edge || $c8f95463ff5f043e$var$IE11OrLess || $c8f95463ff5f043e$var$Safari) {\n $c8f95463ff5f043e$var$autoScroll(evt, this.options, elem, fallback);\n // Listener for pointer element change\n var ogElemScroller = $c8f95463ff5f043e$var$getParentAutoScrollElement(elem, true);\n if ($c8f95463ff5f043e$var$scrolling && (!$c8f95463ff5f043e$var$pointerElemChangedInterval || x !== $c8f95463ff5f043e$var$lastAutoScrollX || y !== $c8f95463ff5f043e$var$lastAutoScrollY)) {\n $c8f95463ff5f043e$var$pointerElemChangedInterval && $c8f95463ff5f043e$var$clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n $c8f95463ff5f043e$var$pointerElemChangedInterval = setInterval(function() {\n var newElem = $c8f95463ff5f043e$var$getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n $c8f95463ff5f043e$var$clearAutoScrolls();\n }\n $c8f95463ff5f043e$var$autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n $c8f95463ff5f043e$var$lastAutoScrollX = x;\n $c8f95463ff5f043e$var$lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || $c8f95463ff5f043e$var$getParentAutoScrollElement(elem, true) === $c8f95463ff5f043e$var$getWindowScrollingElement()) {\n $c8f95463ff5f043e$var$clearAutoScrolls();\n return;\n }\n $c8f95463ff5f043e$var$autoScroll(evt, this.options, $c8f95463ff5f043e$var$getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return $c8f95463ff5f043e$var$_extends(AutoScroll, {\n pluginName: \"scroll\",\n initializeByDefault: true\n });\n}\nfunction $c8f95463ff5f043e$var$clearAutoScrolls() {\n $c8f95463ff5f043e$var$autoScrolls.forEach(function(autoScroll) {\n clearInterval(autoScroll.pid);\n });\n $c8f95463ff5f043e$var$autoScrolls = [];\n}\nfunction $c8f95463ff5f043e$var$clearPointerElemChangedInterval() {\n clearInterval($c8f95463ff5f043e$var$pointerElemChangedInterval);\n}\nvar $c8f95463ff5f043e$var$autoScroll = $c8f95463ff5f043e$var$throttle(function(evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, sens = options.scrollSensitivity, speed = options.scrollSpeed, winScroller = $c8f95463ff5f043e$var$getWindowScrollingElement();\n var scrollThisInstance = false, scrollCustomFn;\n // New scroll root, set scrollEl\n if ($c8f95463ff5f043e$var$scrollRootEl !== rootEl) {\n $c8f95463ff5f043e$var$scrollRootEl = rootEl;\n $c8f95463ff5f043e$var$clearAutoScrolls();\n $c8f95463ff5f043e$var$scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if ($c8f95463ff5f043e$var$scrollEl === true) $c8f95463ff5f043e$var$scrollEl = $c8f95463ff5f043e$var$getParentAutoScrollElement(rootEl, true);\n }\n var layersOut = 0;\n var currentParent = $c8f95463ff5f043e$var$scrollEl;\n do {\n var el = currentParent, rect = $c8f95463ff5f043e$var$getRect(el), top = rect.top, bottom = rect.bottom, left = rect.left, right = rect.right, width = rect.width, height = rect.height, canScrollX = void 0, canScrollY = void 0, scrollWidth = el.scrollWidth, scrollHeight = el.scrollHeight, elCSS = $c8f95463ff5f043e$var$css(el), scrollPosX = el.scrollLeft, scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === \"auto\" || elCSS.overflowX === \"scroll\" || elCSS.overflowX === \"visible\");\n canScrollY = height < scrollHeight && (elCSS.overflowY === \"auto\" || elCSS.overflowY === \"scroll\" || elCSS.overflowY === \"visible\");\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === \"auto\" || elCSS.overflowX === \"scroll\");\n canScrollY = height < scrollHeight && (elCSS.overflowY === \"auto\" || elCSS.overflowY === \"scroll\");\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!$c8f95463ff5f043e$var$autoScrolls[layersOut]) {\n for(var i = 0; i <= layersOut; i++)if (!$c8f95463ff5f043e$var$autoScrolls[i]) $c8f95463ff5f043e$var$autoScrolls[i] = {};\n }\n if ($c8f95463ff5f043e$var$autoScrolls[layersOut].vx != vx || $c8f95463ff5f043e$var$autoScrolls[layersOut].vy != vy || $c8f95463ff5f043e$var$autoScrolls[layersOut].el !== el) {\n $c8f95463ff5f043e$var$autoScrolls[layersOut].el = el;\n $c8f95463ff5f043e$var$autoScrolls[layersOut].vx = vx;\n $c8f95463ff5f043e$var$autoScrolls[layersOut].vy = vy;\n clearInterval($c8f95463ff5f043e$var$autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */ $c8f95463ff5f043e$var$autoScrolls[layersOut].pid = setInterval((function() {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) $c8f95463ff5f043e$export$31b3ca70d8f57423.active._onTouchMove($c8f95463ff5f043e$var$touchEvt$1); // To move ghost if it is positioned absolutely\n var scrollOffsetY = $c8f95463ff5f043e$var$autoScrolls[this.layer].vy ? $c8f95463ff5f043e$var$autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = $c8f95463ff5f043e$var$autoScrolls[this.layer].vx ? $c8f95463ff5f043e$var$autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === \"function\") {\n if (scrollCustomFn.call($c8f95463ff5f043e$export$31b3ca70d8f57423.dragged.parentNode[$c8f95463ff5f043e$var$expando], scrollOffsetX, scrollOffsetY, evt, $c8f95463ff5f043e$var$touchEvt$1, $c8f95463ff5f043e$var$autoScrolls[this.layer].el) !== \"continue\") return;\n }\n $c8f95463ff5f043e$var$scrollBy($c8f95463ff5f043e$var$autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }).bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n }while (options.bubbleScroll && currentParent !== winScroller && (currentParent = $c8f95463ff5f043e$var$getParentAutoScrollElement(currentParent, false)));\n $c8f95463ff5f043e$var$scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\nvar $c8f95463ff5f043e$var$drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, dragEl = _ref.dragEl, activeSortable = _ref.activeSortable, dispatchSortableEvent = _ref.dispatchSortableEvent, hideGhostForTarget = _ref.hideGhostForTarget, unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent(\"spill\");\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction $c8f95463ff5f043e$var$Revert() {}\n$c8f95463ff5f043e$var$Revert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl, putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) putSortable.captureAnimationState();\n var nextSibling = $c8f95463ff5f043e$var$getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) this.sortable.el.insertBefore(dragEl, nextSibling);\n else this.sortable.el.appendChild(dragEl);\n this.sortable.animateAll();\n if (putSortable) putSortable.animateAll();\n },\n drop: $c8f95463ff5f043e$var$drop\n};\n$c8f95463ff5f043e$var$_extends($c8f95463ff5f043e$var$Revert, {\n pluginName: \"revertOnSpill\"\n});\nfunction $c8f95463ff5f043e$var$Remove() {}\n$c8f95463ff5f043e$var$Remove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl, putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: $c8f95463ff5f043e$var$drop\n};\n$c8f95463ff5f043e$var$_extends($c8f95463ff5f043e$var$Remove, {\n pluginName: \"removeOnSpill\"\n});\nvar $c8f95463ff5f043e$var$lastSwapEl;\nfunction $c8f95463ff5f043e$export$bdb5f0a1b77546f4() {\n function Swap() {\n this.defaults = {\n swapClass: \"sortable-swap-highlight\"\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n $c8f95463ff5f043e$var$lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed, target = _ref2.target, onMove = _ref2.onMove, activeSortable = _ref2.activeSortable, changed = _ref2.changed, cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el, options = this.options;\n if (target && target !== el) {\n var prevSwapEl = $c8f95463ff5f043e$var$lastSwapEl;\n if (onMove(target) !== false) {\n $c8f95463ff5f043e$var$toggleClass(target, options.swapClass, true);\n $c8f95463ff5f043e$var$lastSwapEl = target;\n } else $c8f95463ff5f043e$var$lastSwapEl = null;\n if (prevSwapEl && prevSwapEl !== $c8f95463ff5f043e$var$lastSwapEl) $c8f95463ff5f043e$var$toggleClass(prevSwapEl, options.swapClass, false);\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable, putSortable = _ref3.putSortable, dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n $c8f95463ff5f043e$var$lastSwapEl && $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$lastSwapEl, options.swapClass, false);\n if ($c8f95463ff5f043e$var$lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== $c8f95463ff5f043e$var$lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n $c8f95463ff5f043e$var$swapNodes(dragEl, $c8f95463ff5f043e$var$lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n $c8f95463ff5f043e$var$lastSwapEl = null;\n }\n };\n return $c8f95463ff5f043e$var$_extends(Swap, {\n pluginName: \"swap\",\n eventProperties: function eventProperties() {\n return {\n swapItem: $c8f95463ff5f043e$var$lastSwapEl\n };\n }\n });\n}\nfunction $c8f95463ff5f043e$var$swapNodes(n1, n2) {\n var p1 = n1.parentNode, p2 = n2.parentNode, i1, i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = $c8f95463ff5f043e$var$index(n1);\n i2 = $c8f95463ff5f043e$var$index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) i2++;\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\nvar $c8f95463ff5f043e$var$multiDragElements = [], $c8f95463ff5f043e$var$multiDragClones = [], $c8f95463ff5f043e$var$lastMultiDragSelect, // for selection with modifier key down (SHIFT)\n$c8f95463ff5f043e$var$multiDragSortable, $c8f95463ff5f043e$var$initialFolding = false, // Initial multi-drag fold when drag started\n$c8f95463ff5f043e$var$folding = false, // Folding any other time\n$c8f95463ff5f043e$var$dragStarted = false, $c8f95463ff5f043e$var$dragEl$1, $c8f95463ff5f043e$var$clonesFromRect, $c8f95463ff5f043e$var$clonesHidden;\nfunction $c8f95463ff5f043e$export$18e5d2a5d1df842d() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for(var fn in this)if (fn.charAt(0) === \"_\" && typeof this[fn] === \"function\") this[fn] = this[fn].bind(this);\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) $c8f95463ff5f043e$var$on(document, \"pointerup\", this._deselectMultiDrag);\n else {\n $c8f95463ff5f043e$var$on(document, \"mouseup\", this._deselectMultiDrag);\n $c8f95463ff5f043e$var$on(document, \"touchend\", this._deselectMultiDrag);\n }\n }\n $c8f95463ff5f043e$var$on(document, \"keydown\", this._checkKeyDown);\n $c8f95463ff5f043e$var$on(document, \"keyup\", this._checkKeyUp);\n this.defaults = {\n selectedClass: \"sortable-selected\",\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = \"\";\n if ($c8f95463ff5f043e$var$multiDragElements.length && $c8f95463ff5f043e$var$multiDragSortable === sortable) $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement, i) {\n data += (!i ? \"\" : \", \") + multiDragElement.textContent;\n });\n else data = dragEl.textContent;\n dataTransfer.setData(\"Text\", data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n $c8f95463ff5f043e$var$dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~$c8f95463ff5f043e$var$multiDragElements.indexOf($c8f95463ff5f043e$var$dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable, cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for(var i = 0; i < $c8f95463ff5f043e$var$multiDragElements.length; i++){\n $c8f95463ff5f043e$var$multiDragClones.push($c8f95463ff5f043e$var$clone($c8f95463ff5f043e$var$multiDragElements[i]));\n $c8f95463ff5f043e$var$multiDragClones[i].sortableIndex = $c8f95463ff5f043e$var$multiDragElements[i].sortableIndex;\n $c8f95463ff5f043e$var$multiDragClones[i].draggable = false;\n $c8f95463ff5f043e$var$multiDragClones[i].style[\"will-change\"] = \"\";\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$multiDragClones[i], this.options.selectedClass, false);\n $c8f95463ff5f043e$var$multiDragElements[i] === $c8f95463ff5f043e$var$dragEl$1 && $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable, rootEl = _ref3.rootEl, dispatchSortableEvent = _ref3.dispatchSortableEvent, cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if ($c8f95463ff5f043e$var$multiDragElements.length && $c8f95463ff5f043e$var$multiDragSortable === sortable) {\n $c8f95463ff5f043e$var$insertMultiDragClones(true, rootEl);\n dispatchSortableEvent(\"clone\");\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown, rootEl = _ref4.rootEl, cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n $c8f95463ff5f043e$var$insertMultiDragClones(false, rootEl);\n $c8f95463ff5f043e$var$multiDragClones.forEach(function(clone) {\n $c8f95463ff5f043e$var$css(clone, \"display\", \"\");\n });\n cloneNowShown();\n $c8f95463ff5f043e$var$clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable, cloneNowHidden = _ref5.cloneNowHidden, cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n $c8f95463ff5f043e$var$multiDragClones.forEach(function(clone) {\n $c8f95463ff5f043e$var$css(clone, \"display\", \"none\");\n if (_this.options.removeCloneOnHide && clone.parentNode) clone.parentNode.removeChild(clone);\n });\n cloneNowHidden();\n $c8f95463ff5f043e$var$clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && $c8f95463ff5f043e$var$multiDragSortable) $c8f95463ff5f043e$var$multiDragSortable.multiDrag._deselectMultiDrag();\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n multiDragElement.sortableIndex = $c8f95463ff5f043e$var$index(multiDragElement);\n });\n // Sort multi-drag elements\n $c8f95463ff5f043e$var$multiDragElements = $c8f95463ff5f043e$var$multiDragElements.sort(function(a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n $c8f95463ff5f043e$var$dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n sortable.captureAnimationState();\n if (this.options.animation) {\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $c8f95463ff5f043e$var$dragEl$1) return;\n $c8f95463ff5f043e$var$css(multiDragElement, \"position\", \"absolute\");\n });\n var dragRect = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$dragEl$1, false, true, true);\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $c8f95463ff5f043e$var$dragEl$1) return;\n $c8f95463ff5f043e$var$setRect(multiDragElement, dragRect);\n });\n $c8f95463ff5f043e$var$folding = true;\n $c8f95463ff5f043e$var$initialFolding = true;\n }\n }\n sortable.animateAll(function() {\n $c8f95463ff5f043e$var$folding = false;\n $c8f95463ff5f043e$var$initialFolding = false;\n if (_this2.options.animation) $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n $c8f95463ff5f043e$var$unsetRect(multiDragElement);\n });\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) $c8f95463ff5f043e$var$removeMultiDragElements();\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target, completed = _ref8.completed, cancel = _ref8.cancel;\n if ($c8f95463ff5f043e$var$folding && ~$c8f95463ff5f043e$var$multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable, rootEl = _ref9.rootEl, sortable = _ref9.sortable, dragRect = _ref9.dragRect;\n if ($c8f95463ff5f043e$var$multiDragElements.length > 1) {\n // Setup unfold animation\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: $c8f95463ff5f043e$var$folding ? $c8f95463ff5f043e$var$getRect(multiDragElement) : dragRect\n });\n $c8f95463ff5f043e$var$unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n $c8f95463ff5f043e$var$folding = false;\n $c8f95463ff5f043e$var$insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable, isOwner = _ref10.isOwner, insertion = _ref10.insertion, activeSortable = _ref10.activeSortable, parentEl = _ref10.parentEl, putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) activeSortable._hideClone();\n $c8f95463ff5f043e$var$initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && $c8f95463ff5f043e$var$multiDragElements.length > 1 && ($c8f95463ff5f043e$var$folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$dragEl$1, false, true, true);\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $c8f95463ff5f043e$var$dragEl$1) return;\n $c8f95463ff5f043e$var$setRect(multiDragElement, dragRectAbsolute);\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n $c8f95463ff5f043e$var$folding = true;\n }\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!$c8f95463ff5f043e$var$folding) $c8f95463ff5f043e$var$removeMultiDragElements();\n if ($c8f95463ff5f043e$var$multiDragElements.length > 1) {\n var clonesHiddenBefore = $c8f95463ff5f043e$var$clonesHidden;\n activeSortable._showClone(sortable);\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !$c8f95463ff5f043e$var$clonesHidden && clonesHiddenBefore) $c8f95463ff5f043e$var$multiDragClones.forEach(function(clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: $c8f95463ff5f043e$var$clonesFromRect\n });\n clone.fromRect = $c8f95463ff5f043e$var$clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n } else activeSortable._showClone(sortable);\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect, isOwner = _ref11.isOwner, activeSortable = _ref11.activeSortable;\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n $c8f95463ff5f043e$var$clonesFromRect = $c8f95463ff5f043e$var$_extends({}, dragRect);\n var dragMatrix = $c8f95463ff5f043e$var$matrix($c8f95463ff5f043e$var$dragEl$1, true);\n $c8f95463ff5f043e$var$clonesFromRect.top -= dragMatrix.f;\n $c8f95463ff5f043e$var$clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if ($c8f95463ff5f043e$var$folding) {\n $c8f95463ff5f043e$var$folding = false;\n $c8f95463ff5f043e$var$removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent, rootEl = _ref12.rootEl, parentEl = _ref12.parentEl, sortable = _ref12.sortable, dispatchSortableEvent = _ref12.dispatchSortableEvent, oldIndex = _ref12.oldIndex, putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options, children = parentEl.children;\n // Multi-drag selection\n if (!$c8f95463ff5f043e$var$dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) this._deselectMultiDrag();\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl$1, options.selectedClass, !~$c8f95463ff5f043e$var$multiDragElements.indexOf($c8f95463ff5f043e$var$dragEl$1));\n if (!~$c8f95463ff5f043e$var$multiDragElements.indexOf($c8f95463ff5f043e$var$dragEl$1)) {\n $c8f95463ff5f043e$var$multiDragElements.push($c8f95463ff5f043e$var$dragEl$1);\n $c8f95463ff5f043e$var$dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: \"select\",\n targetEl: $c8f95463ff5f043e$var$dragEl$1,\n originalEvent: evt\n });\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && $c8f95463ff5f043e$var$lastMultiDragSelect && sortable.el.contains($c8f95463ff5f043e$var$lastMultiDragSelect)) {\n var lastIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$lastMultiDragSelect), currentIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n for(; i < n; i++){\n if (~$c8f95463ff5f043e$var$multiDragElements.indexOf(children[i])) continue;\n $c8f95463ff5f043e$var$toggleClass(children[i], options.selectedClass, true);\n $c8f95463ff5f043e$var$multiDragElements.push(children[i]);\n $c8f95463ff5f043e$var$dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: \"select\",\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else $c8f95463ff5f043e$var$lastMultiDragSelect = $c8f95463ff5f043e$var$dragEl$1;\n $c8f95463ff5f043e$var$multiDragSortable = toSortable;\n } else {\n $c8f95463ff5f043e$var$multiDragElements.splice($c8f95463ff5f043e$var$multiDragElements.indexOf($c8f95463ff5f043e$var$dragEl$1), 1);\n $c8f95463ff5f043e$var$lastMultiDragSelect = null;\n $c8f95463ff5f043e$var$dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: \"deselect\",\n targetEl: $c8f95463ff5f043e$var$dragEl$1,\n originalEvent: evt\n });\n }\n }\n // Multi-drag drop\n if ($c8f95463ff5f043e$var$dragStarted && this.isMultiDrag) {\n $c8f95463ff5f043e$var$folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[$c8f95463ff5f043e$var$expando].options.sort || parentEl !== rootEl) && $c8f95463ff5f043e$var$multiDragElements.length > 1) {\n var dragRect = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$dragEl$1), multiDragIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl$1, \":not(.\" + this.options.selectedClass + \")\");\n if (!$c8f95463ff5f043e$var$initialFolding && options.animation) $c8f95463ff5f043e$var$dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!$c8f95463ff5f043e$var$initialFolding) {\n if (options.animation) {\n $c8f95463ff5f043e$var$dragEl$1.fromRect = dragRect;\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== $c8f95463ff5f043e$var$dragEl$1) {\n var rect = $c8f95463ff5f043e$var$folding ? $c8f95463ff5f043e$var$getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n $c8f95463ff5f043e$var$removeMultiDragElements();\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n if (children[multiDragIndex]) parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n else parentEl.appendChild(multiDragElement);\n multiDragIndex++;\n });\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl$1)) {\n var update = false;\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement.sortableIndex !== $c8f95463ff5f043e$var$index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent(\"update\");\n dispatchSortableEvent(\"sort\");\n }\n }\n }\n // Must be done after capturing individual rects (scroll bar)\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n $c8f95463ff5f043e$var$unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n $c8f95463ff5f043e$var$multiDragSortable = toSortable;\n }\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== \"clone\") $c8f95463ff5f043e$var$multiDragClones.forEach(function(clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = $c8f95463ff5f043e$var$dragStarted = false;\n $c8f95463ff5f043e$var$multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n $c8f95463ff5f043e$var$off(document, \"pointerup\", this._deselectMultiDrag);\n $c8f95463ff5f043e$var$off(document, \"mouseup\", this._deselectMultiDrag);\n $c8f95463ff5f043e$var$off(document, \"touchend\", this._deselectMultiDrag);\n $c8f95463ff5f043e$var$off(document, \"keydown\", this._checkKeyDown);\n $c8f95463ff5f043e$var$off(document, \"keyup\", this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof $c8f95463ff5f043e$var$dragStarted !== \"undefined\" && $c8f95463ff5f043e$var$dragStarted) return;\n // Only deselect if selection is in this sortable\n if ($c8f95463ff5f043e$var$multiDragSortable !== this.sortable) return;\n // Only deselect if target is not item in this sortable\n if (evt && $c8f95463ff5f043e$var$closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while($c8f95463ff5f043e$var$multiDragElements.length){\n var el = $c8f95463ff5f043e$var$multiDragElements[0];\n $c8f95463ff5f043e$var$toggleClass(el, this.options.selectedClass, false);\n $c8f95463ff5f043e$var$multiDragElements.shift();\n $c8f95463ff5f043e$var$dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: \"deselect\",\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) this.multiDragKeyDown = true;\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) this.multiDragKeyDown = false;\n }\n };\n return $c8f95463ff5f043e$var$_extends(MultiDrag, {\n // Static methods & properties\n pluginName: \"multiDrag\",\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */ select: function select(el) {\n var sortable = el.parentNode[$c8f95463ff5f043e$var$expando];\n if (!sortable || !sortable.options.multiDrag || ~$c8f95463ff5f043e$var$multiDragElements.indexOf(el)) return;\n if ($c8f95463ff5f043e$var$multiDragSortable && $c8f95463ff5f043e$var$multiDragSortable !== sortable) {\n $c8f95463ff5f043e$var$multiDragSortable.multiDrag._deselectMultiDrag();\n $c8f95463ff5f043e$var$multiDragSortable = sortable;\n }\n $c8f95463ff5f043e$var$toggleClass(el, sortable.options.selectedClass, true);\n $c8f95463ff5f043e$var$multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */ deselect: function deselect(el) {\n var sortable = el.parentNode[$c8f95463ff5f043e$var$expando], index = $c8f95463ff5f043e$var$multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n $c8f95463ff5f043e$var$toggleClass(el, sortable.options.selectedClass, false);\n $c8f95463ff5f043e$var$multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [], newIndicies = [];\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n // multiDragElements will already be sorted if folding\n var newIndex;\n if ($c8f95463ff5f043e$var$folding && multiDragElement !== $c8f95463ff5f043e$var$dragEl$1) newIndex = -1;\n else if ($c8f95463ff5f043e$var$folding) newIndex = $c8f95463ff5f043e$var$index(multiDragElement, \":not(.\" + _this3.options.selectedClass + \")\");\n else newIndex = $c8f95463ff5f043e$var$index(multiDragElement);\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: $c8f95463ff5f043e$var$_toConsumableArray($c8f95463ff5f043e$var$multiDragElements),\n clones: [].concat($c8f95463ff5f043e$var$multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === \"ctrl\") key = \"Control\";\n else if (key.length > 1) key = key.charAt(0).toUpperCase() + key.substr(1);\n return key;\n }\n }\n });\n}\nfunction $c8f95463ff5f043e$var$insertMultiDragElements(clonesInserted, rootEl) {\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) rootEl.insertBefore(multiDragElement, target);\n else rootEl.appendChild(multiDragElement);\n });\n}\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */ function $c8f95463ff5f043e$var$insertMultiDragClones(elementsInserted, rootEl) {\n $c8f95463ff5f043e$var$multiDragClones.forEach(function(clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) rootEl.insertBefore(clone, target);\n else rootEl.appendChild(clone);\n });\n}\nfunction $c8f95463ff5f043e$var$removeMultiDragElements() {\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $c8f95463ff5f043e$var$dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n$c8f95463ff5f043e$export$31b3ca70d8f57423.mount(new $c8f95463ff5f043e$var$AutoScrollPlugin());\n$c8f95463ff5f043e$export$31b3ca70d8f57423.mount($c8f95463ff5f043e$var$Remove, $c8f95463ff5f043e$var$Revert);\nvar $c8f95463ff5f043e$export$2e2bcd8739ae039 = $c8f95463ff5f043e$export$31b3ca70d8f57423;\n\n\nasync function $918fc77ea978604c$export$1402cba6a733f33a() {\n return new Promise((resolve)=>{\n requestAnimationFrame(resolve);\n });\n}\n\n\nfunction $a5e7d2d106c3fea1$export$dc799133ea41435b(y, x, h, derivatives) {\n const n = y.length;\n const dydx = derivatives(y, x);\n const yTemp = dydx; // Reuse array for result to avoid allocation and GC\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h * dydx[i];\n return yTemp;\n}\nfunction $a5e7d2d106c3fea1$export$926181dbdeb3ce30(y, x, h, derivatives) {\n const n = y.length;\n const dydx = derivatives(y, x);\n const yTemp = new Array(n);\n const h2 = h / 2.0;\n const h6 = h / 6.0;\n const xhh = x + h2;\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h2 * dydx[i];\n let dydxTemp = derivatives(yTemp, xhh);\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h2 * dydxTemp[i];\n const dydxM = derivatives(yTemp, xhh);\n for(let i = 0; i < n; i += 1){\n yTemp[i] = y[i] + h * dydxM[i];\n dydxM[i] += dydxTemp[i];\n }\n dydxTemp = derivatives(yTemp, x + h);\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h6 * (dydx[i] + dydxTemp[i] + 2.0 * dydxM[i]);\n return yTemp;\n}\n\n\nfunction $12561087c4c3e6ef$export$35d34bc0ed591a92(stocksAtT, t, h, getFlows, integrator = (0, $a5e7d2d106c3fea1$export$926181dbdeb3ce30)) {\n return integrator(stocksAtT, t, h, getFlows);\n}\nfunction $12561087c4c3e6ef$export$342c33653c71264(stocksAtT, t, h, getFlows, criterion, integrator = (0, $a5e7d2d106c3fea1$export$926181dbdeb3ce30)) {\n let iterations = 0;\n let { userdata: userdata, done: done } = criterion(stocksAtT, t, undefined, iterations);\n if (!done) {\n let newT = t;\n let newStocks;\n do {\n newStocks = integrator(newStocks !== null && newStocks !== void 0 ? newStocks : stocksAtT, newT, h, getFlows);\n newT += h;\n iterations += 1;\n ({ userdata: userdata, done: done } = criterion(newStocks, newT, userdata, iterations));\n }while (!done);\n }\n return userdata;\n}\n\n\nfunction $77c357198c6cf64b$var$step5(stocksAtT, t, h, computeFlows, integrator) {\n return (0, $12561087c4c3e6ef$export$35d34bc0ed591a92)(stocksAtT, t, h, computeFlows, integrator);\n}\nfunction $77c357198c6cf64b$var$step6(stocksAtT, flowsAtT, t, h, computeFlows, integrator) {\n const mutableFlowsAtT = [\n ...flowsAtT\n ];\n const getFlows = (y, x)=>x === t ? mutableFlowsAtT : computeFlows(y, x);\n return (0, $12561087c4c3e6ef$export$35d34bc0ed591a92)(stocksAtT, t, h, getFlows, integrator);\n}\nfunction $77c357198c6cf64b$export$35d34bc0ed591a92(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrIntegrator, integrator) {\n if (typeof tOrFlowsAtT === \"number\") return $77c357198c6cf64b$var$step5(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrIntegrator);\n return $77c357198c6cf64b$var$step6(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrIntegrator, integrator);\n}\nfunction $77c357198c6cf64b$var$converge6(stocksAtT, t, h, computeFlows, criterion, integrator) {\n return (0, $12561087c4c3e6ef$export$342c33653c71264)(stocksAtT, t, h, computeFlows, criterion, integrator);\n}\nfunction $77c357198c6cf64b$var$converge7(stocksAtT, flowsAtT, t, h, computeFlows, criterion, integrator) {\n const mutableFlowsAtT = [\n ...flowsAtT\n ];\n const getFlows = (y, x)=>x === t ? mutableFlowsAtT : computeFlows(y, x);\n return (0, $12561087c4c3e6ef$export$342c33653c71264)(stocksAtT, t, h, getFlows, criterion, integrator);\n}\nfunction $77c357198c6cf64b$export$342c33653c71264(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrCriterion, criterionOrIntegrator, integrator) {\n if (typeof tOrFlowsAtT === \"number\") return $77c357198c6cf64b$var$converge6(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrCriterion, criterionOrIntegrator);\n return $77c357198c6cf64b$var$converge7(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrCriterion, criterionOrIntegrator, integrator);\n}\n\n\nclass $ca4792769be6b7d6$export$a1edc412be3e1841 {\n static elementObjectToArray(ids, object) {\n return ids.map((id)=>object[id]);\n }\n static arrayToElementObject(ids, array) {\n const result = {};\n for(let i = 0; i < ids.length; i += 1){\n const id = ids[i];\n result[id] = array[i];\n }\n return result;\n }\n stocksToStockArray(stocks) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.elementObjectToArray(this.stockIds, stocks);\n }\n stockArrayToStocks(stockArray) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.arrayToElementObject(this.stockIds, stockArray);\n }\n flowsToFlowArray(flows) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.elementObjectToArray(this.flowIds, flows);\n }\n flowArrayToFlows(flowArray) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.arrayToElementObject(this.flowIds, flowArray);\n }\n variablesToVariableArray(variables) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.elementObjectToArray(this.variableIds, variables);\n }\n variableArrayToVariables(variableArray) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.arrayToElementObject(this.variableIds, variableArray);\n }\n parametersToParameterArray(parameters) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.elementObjectToArray(this.parameterIds, parameters);\n }\n parameterArrayToParameters(parameterArray) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.arrayToElementObject(this.parameterIds, parameterArray);\n }\n evaluateFlowPerStock(stocks, parameters, t) {\n const { flows: flows } = this.evaluate(stocks, parameters, t);\n return this.accumulateFlowsPerStock(flows);\n }\n createFlowEvaluator(parameters) {\n const result = (stocksArray, t)=>{\n const stocks = this.stockArrayToStocks(stocksArray);\n const flowsPerStock = this.evaluateFlowPerStock(stocks, parameters, t);\n const flowPerStockArray = this.stocksToStockArray(flowsPerStock);\n return flowPerStockArray;\n };\n return result;\n }\n step(stocks, t, h, flowEvaluator) {\n const stocksArray = this.stocksToStockArray(stocks);\n const newStocksArray = (0, $77c357198c6cf64b$export$35d34bc0ed591a92)(stocksArray, t, h, flowEvaluator);\n return this.stockArrayToStocks(newStocksArray);\n }\n constructor(stocksIds, flowIds, variableIds, parameterIds){\n this.stockIds = stocksIds;\n this.flowIds = flowIds;\n this.variableIds = variableIds;\n this.parameterIds = parameterIds;\n }\n}\n$ca4792769be6b7d6$export$a1edc412be3e1841.elementIds = [\n \"stocks\",\n \"parameters\",\n \"variables\",\n \"flows\"\n];\n\n\nconst $995a1f169f5e286f$var$stockIds = [\n \"capacityOfNewlyProducedPhones\",\n \"capacityOfRecycledMaterials\",\n \"capacityOfRefurbishedPhones\",\n \"capacityOfRepairedPhones\",\n \"phonesInUse\",\n \"supplyOfBrokenPhones\",\n \"supplyOfDisposedPhones\",\n \"supplyOfHibernatingPhones\",\n \"supplyOfNewlyProducedPhones\",\n \"supplyOfRecycledMaterials\",\n \"supplyOfRefurbishedPhones\",\n \"supplyOfRepairedPhones\"\n];\nconst $995a1f169f5e286f$var$flowIds = [\n \"abandon\",\n \"acquireNewlyProduced\",\n \"acquireRefurbished\",\n \"acquireRepaired\",\n \"acquireUsed\",\n \"capacityOfNewlyProducedPhonesAdjustment\",\n \"capacityOfRecycledMaterialsAdjustment\",\n \"capacityOfRefurbishedPhonesAdjustment\",\n \"disposeBroken\",\n \"disposeHibernating\",\n \"goBroken\",\n \"landfill\",\n \"produceFromNaturalResources\",\n \"produceFromRecycledMaterials\",\n \"recycle\",\n \"refurbish\",\n \"repair\",\n \"repairShopCapcityAdjustment\"\n];\nconst $995a1f169f5e286f$var$variableIds = [\n \"demandForNaturalResources\",\n \"demandForNewlyProducedPhones\",\n \"demandForPhones\",\n \"demandForRecycledMaterials\",\n \"demandForRefurbishedPhones\",\n \"demandForRefurbishment\",\n \"demandForRepairedPhones\",\n \"demandForReusedPhones\",\n \"inflowIncentiveSumForPhonesInUse\",\n \"phoneGoal\",\n \"phonesInUseExcess\",\n \"recycleDemand\",\n \"repairDemand\",\n \"resourceDemand\",\n \"supplyOfBrokenPhonesForDisposal\",\n \"supplyOfBrokenPhonesForRepair\",\n \"supplyOfDisposedPhonesForLandfilling\",\n \"supplyOfDisposedPhonesForRecycling\"\n];\nconst $995a1f169f5e286f$var$parameterIds = [\n \"abandonExcessRate\",\n \"abandonRate\",\n \"acquireRate\",\n \"breakRate\",\n \"capacityAdjustmentRate\",\n \"disposeIncentive\",\n \"disposeRate\",\n \"durability\",\n \"landfillIncentive\",\n \"landfillRate\",\n \"naturalResourcesIncentive\",\n \"newPhoneProductionRate\",\n \"newlyProducedPhoneIncentive\",\n \"numberOfUsers\",\n \"phonesPerUserGoal\",\n \"recycleRate\",\n \"recyclingIncentive\",\n \"refurbishmentIncentive\",\n \"refurbishmentRate\",\n \"repairIncentive\",\n \"repairRate\",\n \"reuseIncentive\"\n];\nclass $995a1f169f5e286f$var$CircularEconomyModel extends (0, $ca4792769be6b7d6$export$a1edc412be3e1841) {\n // eslint-disable-next-line class-methods-use-this\n evaluate(stocks, parameters, t) {\n const { capacityOfNewlyProducedPhones: capacityOfNewlyProducedPhones, capacityOfRecycledMaterials: capacityOfRecycledMaterials, capacityOfRefurbishedPhones: capacityOfRefurbishedPhones, capacityOfRepairedPhones: capacityOfRepairedPhones, phonesInUse: phonesInUse, supplyOfBrokenPhones: supplyOfBrokenPhones, supplyOfDisposedPhones: supplyOfDisposedPhones, supplyOfHibernatingPhones: supplyOfHibernatingPhones, supplyOfNewlyProducedPhones: supplyOfNewlyProducedPhones, supplyOfRecycledMaterials: supplyOfRecycledMaterials, supplyOfRefurbishedPhones: supplyOfRefurbishedPhones, supplyOfRepairedPhones: supplyOfRepairedPhones } = stocks;\n const { abandonExcessRate: abandonExcessRate, abandonRate: abandonRate, acquireRate: acquireRate, breakRate: breakRate, capacityAdjustmentRate: capacityAdjustmentRate, disposeIncentive: disposeIncentive, disposeRate: disposeRate, durability: durability, landfillIncentive: landfillIncentive, landfillRate: landfillRate, naturalResourcesIncentive: naturalResourcesIncentive, newPhoneProductionRate: newPhoneProductionRate, newlyProducedPhoneIncentive: newlyProducedPhoneIncentive, numberOfUsers: numberOfUsers, phonesPerUserGoal: phonesPerUserGoal, recycleRate: recycleRate, recyclingIncentive: recyclingIncentive, refurbishmentIncentive: refurbishmentIncentive, refurbishmentRate: refurbishmentRate, repairIncentive: repairIncentive, repairRate: repairRate, reuseIncentive: reuseIncentive } = parameters;\n const phoneGoal = numberOfUsers * phonesPerUserGoal;\n const phonesInUseExcess = Math.max(phonesInUse - phoneGoal, 0);\n const abandon = abandonRate * phonesInUse + abandonExcessRate * phonesInUseExcess;\n const inflowIncentiveSumForPhonesInUse = reuseIncentive + repairIncentive + refurbishmentIncentive + newlyProducedPhoneIncentive;\n const demandForPhones = Math.max(0, phoneGoal - phonesInUse);\n const demandForNewlyProducedPhones = newlyProducedPhoneIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireNewlyProduced = acquireRate * Math.min(supplyOfNewlyProducedPhones, demandForNewlyProducedPhones);\n const demandForRefurbishedPhones = refurbishmentIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireRefurbished = acquireRate * Math.min(demandForRefurbishedPhones, supplyOfRefurbishedPhones);\n const demandForRepairedPhones = repairIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireRepaired = acquireRate * Math.min(demandForRepairedPhones, supplyOfRepairedPhones);\n const demandForReusedPhones = reuseIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireUsed = acquireRate * Math.min(supplyOfHibernatingPhones, demandForReusedPhones);\n const capacityOfNewlyProducedPhonesAdjustment = capacityAdjustmentRate * (demandForNewlyProducedPhones - capacityOfNewlyProducedPhones);\n const resourceDemand = Math.max(capacityOfNewlyProducedPhones - supplyOfNewlyProducedPhones, 0);\n const demandForRecycledMaterials = recyclingIncentive / (naturalResourcesIncentive + recyclingIncentive) * resourceDemand;\n const capacityOfRecycledMaterialsAdjustment = capacityAdjustmentRate * (demandForRecycledMaterials - capacityOfRecycledMaterials);\n const capacityOfRefurbishedPhonesAdjustment = capacityAdjustmentRate * (demandForRefurbishedPhones - capacityOfRefurbishedPhones);\n const supplyOfBrokenPhonesForDisposal = disposeIncentive / (repairIncentive + disposeIncentive) * supplyOfBrokenPhones;\n const disposeBroken = disposeRate * supplyOfBrokenPhonesForDisposal;\n const disposeHibernating = disposeRate * supplyOfHibernatingPhones;\n const goBroken = breakRate / durability * phonesInUse;\n const supplyOfDisposedPhonesForLandfilling = landfillIncentive / (recyclingIncentive + landfillIncentive) * supplyOfDisposedPhones;\n const landfill = landfillRate * supplyOfDisposedPhonesForLandfilling;\n const demandForNaturalResources = naturalResourcesIncentive / (naturalResourcesIncentive + recyclingIncentive) * resourceDemand;\n const produceFromNaturalResources = newPhoneProductionRate * demandForNaturalResources;\n const produceFromRecycledMaterials = newPhoneProductionRate * Math.min(demandForRecycledMaterials, supplyOfRecycledMaterials);\n const supplyOfDisposedPhonesForRecycling = recyclingIncentive / (recyclingIncentive + landfillIncentive) * supplyOfDisposedPhones;\n const recycleDemand = Math.max(capacityOfRecycledMaterials - supplyOfRecycledMaterials, 0);\n const recycle = recycleRate * Math.min(supplyOfDisposedPhonesForRecycling, recycleDemand);\n const demandForRefurbishment = Math.max(capacityOfRefurbishedPhones - supplyOfRefurbishedPhones, 0);\n const refurbish = refurbishmentRate * Math.min(supplyOfHibernatingPhones, demandForRefurbishment);\n const repairDemand = Math.max(capacityOfRepairedPhones - supplyOfRepairedPhones, 0);\n const repair = repairRate * Math.min(supplyOfBrokenPhones, repairDemand);\n const repairShopCapcityAdjustment = capacityAdjustmentRate * (demandForRepairedPhones - capacityOfRepairedPhones);\n const supplyOfBrokenPhonesForRepair = repairIncentive / (repairIncentive + disposeIncentive) * supplyOfBrokenPhones;\n const variables = {\n demandForNaturalResources: demandForNaturalResources,\n demandForNewlyProducedPhones: demandForNewlyProducedPhones,\n demandForPhones: demandForPhones,\n demandForRecycledMaterials: demandForRecycledMaterials,\n demandForRefurbishedPhones: demandForRefurbishedPhones,\n demandForRefurbishment: demandForRefurbishment,\n demandForRepairedPhones: demandForRepairedPhones,\n demandForReusedPhones: demandForReusedPhones,\n inflowIncentiveSumForPhonesInUse: inflowIncentiveSumForPhonesInUse,\n phoneGoal: phoneGoal,\n phonesInUseExcess: phonesInUseExcess,\n recycleDemand: recycleDemand,\n repairDemand: repairDemand,\n resourceDemand: resourceDemand,\n supplyOfBrokenPhonesForDisposal: supplyOfBrokenPhonesForDisposal,\n supplyOfBrokenPhonesForRepair: supplyOfBrokenPhonesForRepair,\n supplyOfDisposedPhonesForLandfilling: supplyOfDisposedPhonesForLandfilling,\n supplyOfDisposedPhonesForRecycling: supplyOfDisposedPhonesForRecycling\n };\n const flows = {\n abandon: abandon,\n acquireNewlyProduced: acquireNewlyProduced,\n acquireRefurbished: acquireRefurbished,\n acquireRepaired: acquireRepaired,\n acquireUsed: acquireUsed,\n capacityOfNewlyProducedPhonesAdjustment: capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterialsAdjustment: capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhonesAdjustment: capacityOfRefurbishedPhonesAdjustment,\n disposeBroken: disposeBroken,\n disposeHibernating: disposeHibernating,\n goBroken: goBroken,\n landfill: landfill,\n produceFromNaturalResources: produceFromNaturalResources,\n produceFromRecycledMaterials: produceFromRecycledMaterials,\n recycle: recycle,\n refurbish: refurbish,\n repair: repair,\n repairShopCapcityAdjustment: repairShopCapcityAdjustment\n };\n return {\n t: t,\n stocks: stocks,\n parameters: parameters,\n variables: variables,\n flows: flows\n };\n }\n // eslint-disable-next-line class-methods-use-this\n accumulateFlowsPerStock(flows) {\n const { abandon: abandon, acquireNewlyProduced: acquireNewlyProduced, acquireRefurbished: acquireRefurbished, acquireRepaired: acquireRepaired, acquireUsed: acquireUsed, capacityOfNewlyProducedPhonesAdjustment: capacityOfNewlyProducedPhonesAdjustment, capacityOfRecycledMaterialsAdjustment: capacityOfRecycledMaterialsAdjustment, capacityOfRefurbishedPhonesAdjustment: capacityOfRefurbishedPhonesAdjustment, disposeBroken: disposeBroken, disposeHibernating: disposeHibernating, goBroken: goBroken, landfill: landfill, produceFromNaturalResources: produceFromNaturalResources, produceFromRecycledMaterials: produceFromRecycledMaterials, recycle: recycle, refurbish: refurbish, repair: repair, repairShopCapcityAdjustment: repairShopCapcityAdjustment } = flows;\n const flowPerStock = {\n capacityOfNewlyProducedPhones: capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterials: capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhones: capacityOfRefurbishedPhonesAdjustment,\n capacityOfRepairedPhones: repairShopCapcityAdjustment,\n phonesInUse: acquireNewlyProduced + acquireRefurbished + acquireRepaired + acquireUsed - (abandon + goBroken),\n supplyOfBrokenPhones: goBroken - (disposeBroken + repair),\n supplyOfDisposedPhones: disposeBroken + disposeHibernating - (landfill + recycle),\n supplyOfHibernatingPhones: abandon - (acquireUsed + disposeHibernating + refurbish),\n supplyOfNewlyProducedPhones: produceFromNaturalResources + produceFromRecycledMaterials - acquireNewlyProduced,\n supplyOfRecycledMaterials: recycle - produceFromRecycledMaterials,\n supplyOfRefurbishedPhones: refurbish - acquireRefurbished,\n supplyOfRepairedPhones: repair - acquireRepaired\n };\n return flowPerStock;\n }\n constructor(){\n super($995a1f169f5e286f$var$stockIds, $995a1f169f5e286f$var$flowIds, $995a1f169f5e286f$var$variableIds, $995a1f169f5e286f$var$parameterIds);\n }\n}\n$995a1f169f5e286f$var$CircularEconomyModel.initialStocks = {\n capacityOfNewlyProducedPhones: 0,\n capacityOfRecycledMaterials: 0,\n capacityOfRefurbishedPhones: 0,\n capacityOfRepairedPhones: 0,\n phonesInUse: 0,\n supplyOfBrokenPhones: 0,\n supplyOfDisposedPhones: 0,\n supplyOfHibernatingPhones: 0,\n supplyOfNewlyProducedPhones: 0,\n supplyOfRecycledMaterials: 0,\n supplyOfRefurbishedPhones: 0,\n supplyOfRepairedPhones: 0\n};\n$995a1f169f5e286f$var$CircularEconomyModel.defaultParameters = {\n abandonExcessRate: 0.5,\n abandonRate: 0.1,\n acquireRate: 1,\n breakRate: 0.1,\n capacityAdjustmentRate: 0.1,\n disposeIncentive: 0.5,\n disposeRate: 0.5,\n durability: 1,\n landfillIncentive: 0.5,\n landfillRate: 1,\n naturalResourcesIncentive: 0.5,\n newPhoneProductionRate: 0.5,\n newlyProducedPhoneIncentive: 0.82,\n numberOfUsers: 1000000,\n phonesPerUserGoal: 1,\n recycleRate: 1,\n recyclingIncentive: 0.89,\n refurbishmentIncentive: 0.5,\n refurbishmentRate: 1,\n repairIncentive: 0.5,\n repairRate: 1,\n reuseIncentive: 0.86\n};\nvar $995a1f169f5e286f$export$2e2bcd8739ae039 = $995a1f169f5e286f$var$CircularEconomyModel;\n\n\nclass $2495d722a6806b18$var$ModelSimulator {\n evaluateFlowPerStockWithCache(stockArray, t) {\n if (this.flowPerStockCache !== null && this.flowPerStockCache.t === t) return [\n ...this.flowPerStockCache.value\n ];\n return this.flowEvaluator(stockArray, t);\n }\n step() {\n const { stocks: stocks, parameters: parameters, t: t } = this.record;\n const newStocks = this.model.step(stocks, t, this.h, this.flowEvaluatorWithCache);\n const newRecord = this.model.evaluate(newStocks, parameters, t + this.h);\n this.flowPerStockCache = {\n t: newRecord.t,\n value: this.model.stocksToStockArray(this.model.accumulateFlowsPerStock(newRecord.flows))\n };\n this.record = newRecord;\n return newRecord;\n }\n constructor(model, stocks, parameters, t, h){\n this.model = model;\n this.parameters = parameters;\n this.flowPerStockCache = null;\n this.record = this.model.evaluate(stocks, parameters, t);\n this.h = h;\n this.flowEvaluator = this.model.createFlowEvaluator(parameters);\n this.flowEvaluatorWithCache = this.evaluateFlowPerStockWithCache.bind(this);\n }\n}\nvar $2495d722a6806b18$export$2e2bcd8739ae039 = $2495d722a6806b18$var$ModelSimulator;\n\n\nvar $c87ac678829b8e5f$exports = {};\nvar $08c10a8642478998$exports = {};\nvar $1b7ff3cd61804da8$exports = {};\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */ function $1b7ff3cd61804da8$var$arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1, length = array == null ? 0 : array.length;\n if (initAccum && length) accumulator = array[++index];\n while(++index < length)accumulator = iteratee(accumulator, array[index], index, array);\n return accumulator;\n}\n$1b7ff3cd61804da8$exports = $1b7ff3cd61804da8$var$arrayReduce;\n\n\nvar $1f2a8327a9c6cd40$exports = {};\nvar $22d081411f8ece61$exports = {};\nvar $cbf1cd6f0a53572d$exports = {};\n/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */ function $cbf1cd6f0a53572d$var$basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n$cbf1cd6f0a53572d$exports = $cbf1cd6f0a53572d$var$basePropertyOf;\n\n\n/** Used to map Latin Unicode letters to basic Latin letters. */ var $22d081411f8ece61$var$deburredLetters = {\n // Latin-1 Supplement block.\n \"\\xc0\": \"A\",\n \"\\xc1\": \"A\",\n \"\\xc2\": \"A\",\n \"\\xc3\": \"A\",\n \"\\xc4\": \"A\",\n \"\\xc5\": \"A\",\n \"\\xe0\": \"a\",\n \"\\xe1\": \"a\",\n \"\\xe2\": \"a\",\n \"\\xe3\": \"a\",\n \"\\xe4\": \"a\",\n \"\\xe5\": \"a\",\n \"\\xc7\": \"C\",\n \"\\xe7\": \"c\",\n \"\\xd0\": \"D\",\n \"\\xf0\": \"d\",\n \"\\xc8\": \"E\",\n \"\\xc9\": \"E\",\n \"\\xca\": \"E\",\n \"\\xcb\": \"E\",\n \"\\xe8\": \"e\",\n \"\\xe9\": \"e\",\n \"\\xea\": \"e\",\n \"\\xeb\": \"e\",\n \"\\xcc\": \"I\",\n \"\\xcd\": \"I\",\n \"\\xce\": \"I\",\n \"\\xcf\": \"I\",\n \"\\xec\": \"i\",\n \"\\xed\": \"i\",\n \"\\xee\": \"i\",\n \"\\xef\": \"i\",\n \"\\xd1\": \"N\",\n \"\\xf1\": \"n\",\n \"\\xd2\": \"O\",\n \"\\xd3\": \"O\",\n \"\\xd4\": \"O\",\n \"\\xd5\": \"O\",\n \"\\xd6\": \"O\",\n \"\\xd8\": \"O\",\n \"\\xf2\": \"o\",\n \"\\xf3\": \"o\",\n \"\\xf4\": \"o\",\n \"\\xf5\": \"o\",\n \"\\xf6\": \"o\",\n \"\\xf8\": \"o\",\n \"\\xd9\": \"U\",\n \"\\xda\": \"U\",\n \"\\xdb\": \"U\",\n \"\\xdc\": \"U\",\n \"\\xf9\": \"u\",\n \"\\xfa\": \"u\",\n \"\\xfb\": \"u\",\n \"\\xfc\": \"u\",\n \"\\xdd\": \"Y\",\n \"\\xfd\": \"y\",\n \"\\xff\": \"y\",\n \"\\xc6\": \"Ae\",\n \"\\xe6\": \"ae\",\n \"\\xde\": \"Th\",\n \"\\xfe\": \"th\",\n \"\\xdf\": \"ss\",\n // Latin Extended-A block.\n \"\\u0100\": \"A\",\n \"\\u0102\": \"A\",\n \"\\u0104\": \"A\",\n \"\\u0101\": \"a\",\n \"\\u0103\": \"a\",\n \"\\u0105\": \"a\",\n \"\\u0106\": \"C\",\n \"\\u0108\": \"C\",\n \"\\u010A\": \"C\",\n \"\\u010C\": \"C\",\n \"\\u0107\": \"c\",\n \"\\u0109\": \"c\",\n \"\\u010B\": \"c\",\n \"\\u010D\": \"c\",\n \"\\u010E\": \"D\",\n \"\\u0110\": \"D\",\n \"\\u010F\": \"d\",\n \"\\u0111\": \"d\",\n \"\\u0112\": \"E\",\n \"\\u0114\": \"E\",\n \"\\u0116\": \"E\",\n \"\\u0118\": \"E\",\n \"\\u011A\": \"E\",\n \"\\u0113\": \"e\",\n \"\\u0115\": \"e\",\n \"\\u0117\": \"e\",\n \"\\u0119\": \"e\",\n \"\\u011B\": \"e\",\n \"\\u011C\": \"G\",\n \"\\u011E\": \"G\",\n \"\\u0120\": \"G\",\n \"\\u0122\": \"G\",\n \"\\u011D\": \"g\",\n \"\\u011F\": \"g\",\n \"\\u0121\": \"g\",\n \"\\u0123\": \"g\",\n \"\\u0124\": \"H\",\n \"\\u0126\": \"H\",\n \"\\u0125\": \"h\",\n \"\\u0127\": \"h\",\n \"\\u0128\": \"I\",\n \"\\u012A\": \"I\",\n \"\\u012C\": \"I\",\n \"\\u012E\": \"I\",\n \"\\u0130\": \"I\",\n \"\\u0129\": \"i\",\n \"\\u012B\": \"i\",\n \"\\u012D\": \"i\",\n \"\\u012F\": \"i\",\n \"\\u0131\": \"i\",\n \"\\u0134\": \"J\",\n \"\\u0135\": \"j\",\n \"\\u0136\": \"K\",\n \"\\u0137\": \"k\",\n \"\\u0138\": \"k\",\n \"\\u0139\": \"L\",\n \"\\u013B\": \"L\",\n \"\\u013D\": \"L\",\n \"\\u013F\": \"L\",\n \"\\u0141\": \"L\",\n \"\\u013A\": \"l\",\n \"\\u013C\": \"l\",\n \"\\u013E\": \"l\",\n \"\\u0140\": \"l\",\n \"\\u0142\": \"l\",\n \"\\u0143\": \"N\",\n \"\\u0145\": \"N\",\n \"\\u0147\": \"N\",\n \"\\u014A\": \"N\",\n \"\\u0144\": \"n\",\n \"\\u0146\": \"n\",\n \"\\u0148\": \"n\",\n \"\\u014B\": \"n\",\n \"\\u014C\": \"O\",\n \"\\u014E\": \"O\",\n \"\\u0150\": \"O\",\n \"\\u014D\": \"o\",\n \"\\u014F\": \"o\",\n \"\\u0151\": \"o\",\n \"\\u0154\": \"R\",\n \"\\u0156\": \"R\",\n \"\\u0158\": \"R\",\n \"\\u0155\": \"r\",\n \"\\u0157\": \"r\",\n \"\\u0159\": \"r\",\n \"\\u015A\": \"S\",\n \"\\u015C\": \"S\",\n \"\\u015E\": \"S\",\n \"\\u0160\": \"S\",\n \"\\u015B\": \"s\",\n \"\\u015D\": \"s\",\n \"\\u015F\": \"s\",\n \"\\u0161\": \"s\",\n \"\\u0162\": \"T\",\n \"\\u0164\": \"T\",\n \"\\u0166\": \"T\",\n \"\\u0163\": \"t\",\n \"\\u0165\": \"t\",\n \"\\u0167\": \"t\",\n \"\\u0168\": \"U\",\n \"\\u016A\": \"U\",\n \"\\u016C\": \"U\",\n \"\\u016E\": \"U\",\n \"\\u0170\": \"U\",\n \"\\u0172\": \"U\",\n \"\\u0169\": \"u\",\n \"\\u016B\": \"u\",\n \"\\u016D\": \"u\",\n \"\\u016F\": \"u\",\n \"\\u0171\": \"u\",\n \"\\u0173\": \"u\",\n \"\\u0174\": \"W\",\n \"\\u0175\": \"w\",\n \"\\u0176\": \"Y\",\n \"\\u0177\": \"y\",\n \"\\u0178\": \"Y\",\n \"\\u0179\": \"Z\",\n \"\\u017B\": \"Z\",\n \"\\u017D\": \"Z\",\n \"\\u017A\": \"z\",\n \"\\u017C\": \"z\",\n \"\\u017E\": \"z\",\n \"\\u0132\": \"IJ\",\n \"\\u0133\": \"ij\",\n \"\\u0152\": \"Oe\",\n \"\\u0153\": \"oe\",\n \"\\u0149\": \"'n\",\n \"\\u017F\": \"s\"\n};\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */ var $22d081411f8ece61$var$deburrLetter = $cbf1cd6f0a53572d$exports($22d081411f8ece61$var$deburredLetters);\n$22d081411f8ece61$exports = $22d081411f8ece61$var$deburrLetter;\n\n\nvar $ee44123cee6ab817$exports = {};\nvar $e5d1c83d06342727$exports = {};\nvar $8ae6ebea7b194487$exports = {};\nvar $d6b32571b971a536$exports = {};\nvar $5c41b9a5519f3a64$exports = {};\n/** Detect free variable `global` from Node.js. */ var $5c41b9a5519f3a64$var$freeGlobal = typeof $parcel$global == \"object\" && $parcel$global && $parcel$global.Object === Object && $parcel$global;\n$5c41b9a5519f3a64$exports = $5c41b9a5519f3a64$var$freeGlobal;\n\n\n/** Detect free variable `self`. */ var $d6b32571b971a536$var$freeSelf = typeof self == \"object\" && self && self.Object === Object && self;\n/** Used as a reference to the global object. */ var $d6b32571b971a536$var$root = $5c41b9a5519f3a64$exports || $d6b32571b971a536$var$freeSelf || Function(\"return this\")();\n$d6b32571b971a536$exports = $d6b32571b971a536$var$root;\n\n\n/** Built-in value references. */ var $8ae6ebea7b194487$var$Symbol = $d6b32571b971a536$exports.Symbol;\n$8ae6ebea7b194487$exports = $8ae6ebea7b194487$var$Symbol;\n\n\nvar $19ec4e0dcd973343$exports = {};\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */ function $19ec4e0dcd973343$var$arrayMap(array, iteratee) {\n var index = -1, length = array == null ? 0 : array.length, result = Array(length);\n while(++index < length)result[index] = iteratee(array[index], index, array);\n return result;\n}\n$19ec4e0dcd973343$exports = $19ec4e0dcd973343$var$arrayMap;\n\n\nvar $80ba2d19709662a3$exports = {};\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */ var $80ba2d19709662a3$var$isArray = Array.isArray;\n$80ba2d19709662a3$exports = $80ba2d19709662a3$var$isArray;\n\n\nvar $f2239ecfa31470ab$exports = {};\nvar $a72fb30b329d5697$exports = {};\n\nvar $cc11b91eeb6cba09$exports = {};\n\n/** Used for built-in method references. */ var $cc11b91eeb6cba09$var$objectProto = Object.prototype;\n/** Used to check objects for own properties. */ var $cc11b91eeb6cba09$var$hasOwnProperty = $cc11b91eeb6cba09$var$objectProto.hasOwnProperty;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */ var $cc11b91eeb6cba09$var$nativeObjectToString = $cc11b91eeb6cba09$var$objectProto.toString;\n/** Built-in value references. */ var $cc11b91eeb6cba09$var$symToStringTag = $8ae6ebea7b194487$exports ? $8ae6ebea7b194487$exports.toStringTag : undefined;\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */ function $cc11b91eeb6cba09$var$getRawTag(value) {\n var isOwn = $cc11b91eeb6cba09$var$hasOwnProperty.call(value, $cc11b91eeb6cba09$var$symToStringTag), tag = value[$cc11b91eeb6cba09$var$symToStringTag];\n try {\n value[$cc11b91eeb6cba09$var$symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n var result = $cc11b91eeb6cba09$var$nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) value[$cc11b91eeb6cba09$var$symToStringTag] = tag;\n else delete value[$cc11b91eeb6cba09$var$symToStringTag];\n }\n return result;\n}\n$cc11b91eeb6cba09$exports = $cc11b91eeb6cba09$var$getRawTag;\n\n\nvar $34878bff9c6a1b5d$exports = {};\n/** Used for built-in method references. */ var $34878bff9c6a1b5d$var$objectProto = Object.prototype;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */ var $34878bff9c6a1b5d$var$nativeObjectToString = $34878bff9c6a1b5d$var$objectProto.toString;\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */ function $34878bff9c6a1b5d$var$objectToString(value) {\n return $34878bff9c6a1b5d$var$nativeObjectToString.call(value);\n}\n$34878bff9c6a1b5d$exports = $34878bff9c6a1b5d$var$objectToString;\n\n\n/** `Object#toString` result references. */ var $a72fb30b329d5697$var$nullTag = \"[object Null]\", $a72fb30b329d5697$var$undefinedTag = \"[object Undefined]\";\n/** Built-in value references. */ var $a72fb30b329d5697$var$symToStringTag = $8ae6ebea7b194487$exports ? $8ae6ebea7b194487$exports.toStringTag : undefined;\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */ function $a72fb30b329d5697$var$baseGetTag(value) {\n if (value == null) return value === undefined ? $a72fb30b329d5697$var$undefinedTag : $a72fb30b329d5697$var$nullTag;\n return $a72fb30b329d5697$var$symToStringTag && $a72fb30b329d5697$var$symToStringTag in Object(value) ? $cc11b91eeb6cba09$exports(value) : $34878bff9c6a1b5d$exports(value);\n}\n$a72fb30b329d5697$exports = $a72fb30b329d5697$var$baseGetTag;\n\n\nvar $12765be2afa50e71$exports = {};\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */ function $12765be2afa50e71$var$isObjectLike(value) {\n return value != null && typeof value == \"object\";\n}\n$12765be2afa50e71$exports = $12765be2afa50e71$var$isObjectLike;\n\n\n/** `Object#toString` result references. */ var $f2239ecfa31470ab$var$symbolTag = \"[object Symbol]\";\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */ function $f2239ecfa31470ab$var$isSymbol(value) {\n return typeof value == \"symbol\" || $12765be2afa50e71$exports(value) && $a72fb30b329d5697$exports(value) == $f2239ecfa31470ab$var$symbolTag;\n}\n$f2239ecfa31470ab$exports = $f2239ecfa31470ab$var$isSymbol;\n\n\n/** Used as references for various `Number` constants. */ var $e5d1c83d06342727$var$INFINITY = 1 / 0;\n/** Used to convert symbols to primitives and strings. */ var $e5d1c83d06342727$var$symbolProto = $8ae6ebea7b194487$exports ? $8ae6ebea7b194487$exports.prototype : undefined, $e5d1c83d06342727$var$symbolToString = $e5d1c83d06342727$var$symbolProto ? $e5d1c83d06342727$var$symbolProto.toString : undefined;\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */ function $e5d1c83d06342727$var$baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == \"string\") return value;\n if ($80ba2d19709662a3$exports(value)) // Recursively convert values (susceptible to call stack limits).\n return $19ec4e0dcd973343$exports(value, $e5d1c83d06342727$var$baseToString) + \"\";\n if ($f2239ecfa31470ab$exports(value)) return $e5d1c83d06342727$var$symbolToString ? $e5d1c83d06342727$var$symbolToString.call(value) : \"\";\n var result = value + \"\";\n return result == \"0\" && 1 / value == -$e5d1c83d06342727$var$INFINITY ? \"-0\" : result;\n}\n$e5d1c83d06342727$exports = $e5d1c83d06342727$var$baseToString;\n\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */ function $ee44123cee6ab817$var$toString(value) {\n return value == null ? \"\" : $e5d1c83d06342727$exports(value);\n}\n$ee44123cee6ab817$exports = $ee44123cee6ab817$var$toString;\n\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */ var $1f2a8327a9c6cd40$var$reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n/** Used to compose unicode character classes. */ var $1f2a8327a9c6cd40$var$rsComboMarksRange = \"\\\\u0300-\\\\u036f\", $1f2a8327a9c6cd40$var$reComboHalfMarksRange = \"\\\\ufe20-\\\\ufe2f\", $1f2a8327a9c6cd40$var$rsComboSymbolsRange = \"\\\\u20d0-\\\\u20ff\", $1f2a8327a9c6cd40$var$rsComboRange = $1f2a8327a9c6cd40$var$rsComboMarksRange + $1f2a8327a9c6cd40$var$reComboHalfMarksRange + $1f2a8327a9c6cd40$var$rsComboSymbolsRange;\n/** Used to compose unicode capture groups. */ var $1f2a8327a9c6cd40$var$rsCombo = \"[\" + $1f2a8327a9c6cd40$var$rsComboRange + \"]\";\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */ var $1f2a8327a9c6cd40$var$reComboMark = RegExp($1f2a8327a9c6cd40$var$rsCombo, \"g\");\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */ function $1f2a8327a9c6cd40$var$deburr(string) {\n string = $ee44123cee6ab817$exports(string);\n return string && string.replace($1f2a8327a9c6cd40$var$reLatin, $22d081411f8ece61$exports).replace($1f2a8327a9c6cd40$var$reComboMark, \"\");\n}\n$1f2a8327a9c6cd40$exports = $1f2a8327a9c6cd40$var$deburr;\n\n\nvar $31925c2e0b1bffc8$exports = {};\nvar $9589882a1b02d2bd$exports = {};\n/** Used to match words composed of alphanumeric characters. */ var $9589882a1b02d2bd$var$reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */ function $9589882a1b02d2bd$var$asciiWords(string) {\n return string.match($9589882a1b02d2bd$var$reAsciiWord) || [];\n}\n$9589882a1b02d2bd$exports = $9589882a1b02d2bd$var$asciiWords;\n\n\nvar $5f3800a21019ebc5$exports = {};\n/** Used to detect strings that need a more robust regexp to match words. */ var $5f3800a21019ebc5$var$reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */ function $5f3800a21019ebc5$var$hasUnicodeWord(string) {\n return $5f3800a21019ebc5$var$reHasUnicodeWord.test(string);\n}\n$5f3800a21019ebc5$exports = $5f3800a21019ebc5$var$hasUnicodeWord;\n\n\n\nvar $59413fe1d37c7fe4$exports = {};\n/** Used to compose unicode character classes. */ var $59413fe1d37c7fe4$var$rsAstralRange = \"\\ud800-\\udfff\", $59413fe1d37c7fe4$var$rsComboMarksRange = \"\\\\u0300-\\\\u036f\", $59413fe1d37c7fe4$var$reComboHalfMarksRange = \"\\\\ufe20-\\\\ufe2f\", $59413fe1d37c7fe4$var$rsComboSymbolsRange = \"\\\\u20d0-\\\\u20ff\", $59413fe1d37c7fe4$var$rsComboRange = $59413fe1d37c7fe4$var$rsComboMarksRange + $59413fe1d37c7fe4$var$reComboHalfMarksRange + $59413fe1d37c7fe4$var$rsComboSymbolsRange, $59413fe1d37c7fe4$var$rsDingbatRange = \"\\\\u2700-\\\\u27bf\", $59413fe1d37c7fe4$var$rsLowerRange = \"a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff\", $59413fe1d37c7fe4$var$rsMathOpRange = \"\\\\xac\\\\xb1\\\\xd7\\\\xf7\", $59413fe1d37c7fe4$var$rsNonCharRange = \"\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\", $59413fe1d37c7fe4$var$rsPunctuationRange = \"\\\\u2000-\\\\u206f\", $59413fe1d37c7fe4$var$rsSpaceRange = \" \\\\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\", $59413fe1d37c7fe4$var$rsUpperRange = \"A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde\", $59413fe1d37c7fe4$var$rsVarRange = \"\\\\ufe0e\\\\ufe0f\", $59413fe1d37c7fe4$var$rsBreakRange = $59413fe1d37c7fe4$var$rsMathOpRange + $59413fe1d37c7fe4$var$rsNonCharRange + $59413fe1d37c7fe4$var$rsPunctuationRange + $59413fe1d37c7fe4$var$rsSpaceRange;\n/** Used to compose unicode capture groups. */ var $59413fe1d37c7fe4$var$rsApos = \"['\\u2019]\", $59413fe1d37c7fe4$var$rsBreak = \"[\" + $59413fe1d37c7fe4$var$rsBreakRange + \"]\", $59413fe1d37c7fe4$var$rsCombo = \"[\" + $59413fe1d37c7fe4$var$rsComboRange + \"]\", $59413fe1d37c7fe4$var$rsDigits = \"\\\\d+\", $59413fe1d37c7fe4$var$rsDingbat = \"[\" + $59413fe1d37c7fe4$var$rsDingbatRange + \"]\", $59413fe1d37c7fe4$var$rsLower = \"[\" + $59413fe1d37c7fe4$var$rsLowerRange + \"]\", $59413fe1d37c7fe4$var$rsMisc = \"[^\" + $59413fe1d37c7fe4$var$rsAstralRange + $59413fe1d37c7fe4$var$rsBreakRange + $59413fe1d37c7fe4$var$rsDigits + $59413fe1d37c7fe4$var$rsDingbatRange + $59413fe1d37c7fe4$var$rsLowerRange + $59413fe1d37c7fe4$var$rsUpperRange + \"]\", $59413fe1d37c7fe4$var$rsFitz = \"\\ud83c[\\udffb-\\udfff]\", $59413fe1d37c7fe4$var$rsModifier = \"(?:\" + $59413fe1d37c7fe4$var$rsCombo + \"|\" + $59413fe1d37c7fe4$var$rsFitz + \")\", $59413fe1d37c7fe4$var$rsNonAstral = \"[^\" + $59413fe1d37c7fe4$var$rsAstralRange + \"]\", $59413fe1d37c7fe4$var$rsRegional = \"(?:\\ud83c[\\udde6-\\uddff]){2}\", $59413fe1d37c7fe4$var$rsSurrPair = \"[\\ud800-\\udbff][\\udc00-\\udfff]\", $59413fe1d37c7fe4$var$rsUpper = \"[\" + $59413fe1d37c7fe4$var$rsUpperRange + \"]\", $59413fe1d37c7fe4$var$rsZWJ = \"\\\\u200d\";\n/** Used to compose unicode regexes. */ var $59413fe1d37c7fe4$var$rsMiscLower = \"(?:\" + $59413fe1d37c7fe4$var$rsLower + \"|\" + $59413fe1d37c7fe4$var$rsMisc + \")\", $59413fe1d37c7fe4$var$rsMiscUpper = \"(?:\" + $59413fe1d37c7fe4$var$rsUpper + \"|\" + $59413fe1d37c7fe4$var$rsMisc + \")\", $59413fe1d37c7fe4$var$rsOptContrLower = \"(?:\" + $59413fe1d37c7fe4$var$rsApos + \"(?:d|ll|m|re|s|t|ve))?\", $59413fe1d37c7fe4$var$rsOptContrUpper = \"(?:\" + $59413fe1d37c7fe4$var$rsApos + \"(?:D|LL|M|RE|S|T|VE))?\", $59413fe1d37c7fe4$var$reOptMod = $59413fe1d37c7fe4$var$rsModifier + \"?\", $59413fe1d37c7fe4$var$rsOptVar = \"[\" + $59413fe1d37c7fe4$var$rsVarRange + \"]?\", $59413fe1d37c7fe4$var$rsOptJoin = \"(?:\" + $59413fe1d37c7fe4$var$rsZWJ + \"(?:\" + [\n $59413fe1d37c7fe4$var$rsNonAstral,\n $59413fe1d37c7fe4$var$rsRegional,\n $59413fe1d37c7fe4$var$rsSurrPair\n].join(\"|\") + \")\" + $59413fe1d37c7fe4$var$rsOptVar + $59413fe1d37c7fe4$var$reOptMod + \")*\", $59413fe1d37c7fe4$var$rsOrdLower = \"\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])\", $59413fe1d37c7fe4$var$rsOrdUpper = \"\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])\", $59413fe1d37c7fe4$var$rsSeq = $59413fe1d37c7fe4$var$rsOptVar + $59413fe1d37c7fe4$var$reOptMod + $59413fe1d37c7fe4$var$rsOptJoin, $59413fe1d37c7fe4$var$rsEmoji = \"(?:\" + [\n $59413fe1d37c7fe4$var$rsDingbat,\n $59413fe1d37c7fe4$var$rsRegional,\n $59413fe1d37c7fe4$var$rsSurrPair\n].join(\"|\") + \")\" + $59413fe1d37c7fe4$var$rsSeq;\n/** Used to match complex or compound words. */ var $59413fe1d37c7fe4$var$reUnicodeWord = RegExp([\n $59413fe1d37c7fe4$var$rsUpper + \"?\" + $59413fe1d37c7fe4$var$rsLower + \"+\" + $59413fe1d37c7fe4$var$rsOptContrLower + \"(?=\" + [\n $59413fe1d37c7fe4$var$rsBreak,\n $59413fe1d37c7fe4$var$rsUpper,\n \"$\"\n ].join(\"|\") + \")\",\n $59413fe1d37c7fe4$var$rsMiscUpper + \"+\" + $59413fe1d37c7fe4$var$rsOptContrUpper + \"(?=\" + [\n $59413fe1d37c7fe4$var$rsBreak,\n $59413fe1d37c7fe4$var$rsUpper + $59413fe1d37c7fe4$var$rsMiscLower,\n \"$\"\n ].join(\"|\") + \")\",\n $59413fe1d37c7fe4$var$rsUpper + \"?\" + $59413fe1d37c7fe4$var$rsMiscLower + \"+\" + $59413fe1d37c7fe4$var$rsOptContrLower,\n $59413fe1d37c7fe4$var$rsUpper + \"+\" + $59413fe1d37c7fe4$var$rsOptContrUpper,\n $59413fe1d37c7fe4$var$rsOrdUpper,\n $59413fe1d37c7fe4$var$rsOrdLower,\n $59413fe1d37c7fe4$var$rsDigits,\n $59413fe1d37c7fe4$var$rsEmoji\n].join(\"|\"), \"g\");\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */ function $59413fe1d37c7fe4$var$unicodeWords(string) {\n return string.match($59413fe1d37c7fe4$var$reUnicodeWord) || [];\n}\n$59413fe1d37c7fe4$exports = $59413fe1d37c7fe4$var$unicodeWords;\n\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */ function $31925c2e0b1bffc8$var$words(string, pattern, guard) {\n string = $ee44123cee6ab817$exports(string);\n pattern = guard ? undefined : pattern;\n if (pattern === undefined) return $5f3800a21019ebc5$exports(string) ? $59413fe1d37c7fe4$exports(string) : $9589882a1b02d2bd$exports(string);\n return string.match(pattern) || [];\n}\n$31925c2e0b1bffc8$exports = $31925c2e0b1bffc8$var$words;\n\n\n/** Used to compose unicode capture groups. */ var $08c10a8642478998$var$rsApos = \"['\\u2019]\";\n/** Used to match apostrophes. */ var $08c10a8642478998$var$reApos = RegExp($08c10a8642478998$var$rsApos, \"g\");\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */ function $08c10a8642478998$var$createCompounder(callback) {\n return function(string) {\n return $1b7ff3cd61804da8$exports($31925c2e0b1bffc8$exports($1f2a8327a9c6cd40$exports(string).replace($08c10a8642478998$var$reApos, \"\")), callback, \"\");\n };\n}\n$08c10a8642478998$exports = $08c10a8642478998$var$createCompounder;\n\n\n/**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */ var $c87ac678829b8e5f$var$kebabCase = $08c10a8642478998$exports(function(result, word, index) {\n return result + (index ? \"-\" : \"\") + word.toLowerCase();\n});\n$c87ac678829b8e5f$exports = $c87ac678829b8e5f$var$kebabCase;\n\n\n/**\n * Loads an external SVG file and returns the DOM tree of its first element.\n *\n * @param {string|URL} uri\n * @param {boolean} clearStyles\n * If true removes the style elements from the file\n * @return {Promise}\n */ async function $22519adc90afc1c6$export$b6a2e78b63791dfa(uri, clearStyles = true) {\n var _svgDoc_querySelectorAll;\n const response = await fetch(uri);\n if (response.status < 200 || response.status >= 300) throw new Error(`Server returned status ${response.status} (${response.statusText}) loading ${new URL(uri).href}.`);\n const svgText = await response.text();\n const div = document.createElement(\"div\");\n div.innerHTML = svgText;\n const svgDoc = div.querySelector(\"svg\");\n if (svgDoc === null) throw new Error(`No SVG element found in ${new URL(uri).href}.`);\n if (clearStyles) (_svgDoc_querySelectorAll = svgDoc.querySelectorAll(\"style\")) === null || _svgDoc_querySelectorAll === void 0 ? void 0 : _svgDoc_querySelectorAll.forEach((s)=>s.remove());\n return svgDoc;\n}\n\n\nfunction $853946bed0db7ade$export$99496351b147462(elem, selector, type) {\n const result = elem.querySelector(selector);\n if (result === null) throw new Error(`No element found matching selector ${selector}.`);\n if (!(result instanceof type)) throw new Error(`Element matching selector ${selector} has the wrong type.`);\n return result;\n}\nfunction $853946bed0db7ade$export$65a5d093667c64b6(elem, selector, type) {\n const results = elem.querySelectorAll(selector);\n results.forEach((result)=>{\n if (!(result instanceof type)) throw new Error(`An element matching selector ${selector} has the wrong type.`);\n });\n return results;\n}\n\n\nvar $eaf19eafa3312639$exports = {};\n\n$eaf19eafa3312639$exports = (parcelRequire(\"9v928\")).getBundleURL(\"kdWl4\") + \"model.f8e270f6.svg\";\n\n\nconst $fee6658e550852f2$var$svgUrl = new URL($eaf19eafa3312639$exports);\nconst $fee6658e550852f2$var$mainFlowIds = [\n \"abandon\",\n \"acquireNewlyProduced\",\n \"acquireRefurbished\",\n \"acquireRepaired\",\n \"acquireUsed\",\n \"disposeBroken\",\n \"disposeHibernating\",\n \"goBroken\",\n \"landfill\",\n \"produceFromNaturalResources\",\n \"produceFromRecycledMaterials\",\n \"recycle\",\n \"refurbish\",\n \"repair\"\n];\nconst $fee6658e550852f2$var$flowVizSigns = {\n abandon: 1,\n acquireNewlyProduced: -1,\n acquireRefurbished: -1,\n acquireRepaired: -1,\n acquireUsed: -1,\n disposeBroken: -1,\n disposeHibernating: -1,\n goBroken: -1,\n landfill: -1,\n produceFromNaturalResources: -1,\n produceFromRecycledMaterials: -1,\n recycle: -1,\n refurbish: -1,\n repair: -1\n};\nclass $fee6658e550852f2$export$2e2bcd8739ae039 {\n updateSvgFlows(deltaMs, record) {\n const { flows: flows } = record;\n const flowVizScale = 5.0 / record.parameters.numberOfUsers;\n const dashGap = 20;\n $fee6658e550852f2$var$mainFlowIds.forEach((id)=>{\n const flow = flows[id];\n const flowVizSign = $fee6658e550852f2$var$flowVizSigns[id];\n const elementId = `${(0, (/*@__PURE__*/$parcel$interopDefault($c87ac678829b8e5f$exports)))(id)}-flow`;\n const element = (0, $853946bed0db7ade$export$99496351b147462)(this.svg, `#${elementId}`, SVGPathElement);\n var _element_getAttribute;\n const lastDashOffset = parseFloat((_element_getAttribute = element.getAttribute(\"stroke-dashoffset\")) !== null && _element_getAttribute !== void 0 ? _element_getAttribute : \"0\");\n // The dash offset step must not be small compared to the dash gap.\n // Otherwise, the flow animation may appear to move backwards.\n const dashOffsetStep = Math.max(-0.3 * dashGap, Math.min(flowVizSign * (deltaMs * flow) * flowVizScale, 0.1 * dashGap));\n const dashOffset = (Number.isNaN(lastDashOffset) ? 0 : lastDashOffset) + dashOffsetStep;\n element.setAttribute(\"stroke-dashoffset\", `${dashOffset}`);\n element.setAttribute(\"stroke-dasharray\", `0 ${dashGap}`);\n });\n }\n updateSvgStocks(deltaMs, record) {\n const { stocks: stocks } = record;\n const stockVizScale = 50000.0 / record.parameters.numberOfUsers;\n this.model.stockIds.forEach((id)=>{\n const elementId = (0, (/*@__PURE__*/$parcel$interopDefault($c87ac678829b8e5f$exports)))(id);\n const element = this.svg.getElementById(elementId);\n if (element === null) throw new Error(`SVG element with id ${elementId} for stock ${id} not found.`);\n if (!(element instanceof SVGCircleElement)) throw new Error(`Stock element for stock ${id} with id ${elementId} is not an SVG circle element.`);\n const stock = stocks[id];\n const radius = Math.sqrt(stock * stockVizScale / Math.PI);\n element.setAttribute(\"r\", `${radius}`);\n });\n }\n updateSvg(deltaMs, record) {\n this.updateSvgFlows(deltaMs, record);\n this.updateSvgStocks(deltaMs, record);\n }\n update(deltaMs, record) {\n this.updateSvg(deltaMs, record);\n }\n static prepareSvg(model, svg) {\n const createSVGElement = (tagName)=>svg.ownerDocument.createElementNS(\"http://www.w3.org/2000/svg\", tagName);\n svg.classList.add(\"model-visualization\");\n svg.querySelectorAll(\"circle, rect, path, text\").forEach((element)=>{\n element.removeAttribute(\"style\");\n });\n const elementsToRemove = [\n ...svg.children\n ];\n const labelLayer = createSVGElement(\"g\");\n labelLayer.classList.add(\"labels\");\n const supplyLayer = createSVGElement(\"g\");\n supplyLayer.classList.add(\"supplies\");\n const capacityLayer = createSVGElement(\"g\");\n capacityLayer.classList.add(\"capacities\");\n const flowLayer = createSVGElement(\"g\");\n flowLayer.classList.add(\"flows\");\n svg.append(capacityLayer, flowLayer, supplyLayer, labelLayer);\n svg.querySelectorAll(\"text\").forEach((baseElement)=>{\n const clone = baseElement.cloneNode(true);\n clone.classList.add(\"label\");\n labelLayer.append(clone);\n });\n svg.querySelectorAll(\"rect\").forEach((baseElement)=>{\n const clone = baseElement.cloneNode(false);\n clone.classList.add(\"capacity\");\n capacityLayer.append(clone);\n });\n model.stockIds.filter((id)=>id.startsWith(\"supplyOf\")).forEach((id)=>{\n const baseElementId = (0, (/*@__PURE__*/$parcel$interopDefault($c87ac678829b8e5f$exports)))(id.replace(/^supplyOf/, \"\"));\n const baseElement = (0, $853946bed0db7ade$export$99496351b147462)(svg, `#${baseElementId}`, SVGGeometryElement);\n const clone = baseElement.cloneNode(false);\n clone.id = `supply-of-${baseElement.id}`;\n clone.classList.add(\"stock\", \"supply\");\n supplyLayer.append(clone);\n });\n const phonesInUse = (0, $853946bed0db7ade$export$99496351b147462)(svg, \"#phones-in-use\", SVGGeometryElement);\n const phonesInUseClone = phonesInUse.cloneNode(false);\n supplyLayer.append(phonesInUseClone);\n model.stockIds.filter((id)=>id.startsWith(\"capacityOf\")).forEach((id)=>{\n const baseElementId = (0, (/*@__PURE__*/$parcel$interopDefault($c87ac678829b8e5f$exports)))(id.replace(/^capacityOf/, \"\"));\n const baseElement = (0, $853946bed0db7ade$export$99496351b147462)(svg, `#${baseElementId}`, SVGGeometryElement);\n const clone = baseElement.cloneNode(false);\n clone.id = `capacity-of-${baseElementId}`;\n clone.classList.add(\"stock\", \"capacity\");\n capacityLayer.append(clone);\n });\n $fee6658e550852f2$var$mainFlowIds.forEach((id)=>{\n const baseElementId = (0, (/*@__PURE__*/$parcel$interopDefault($c87ac678829b8e5f$exports)))(id);\n const baseElement = (0, $853946bed0db7ade$export$99496351b147462)(svg, `#${baseElementId}`, SVGGeometryElement);\n const edge = baseElement.cloneNode(false);\n edge.id = `${baseElementId}-edge`;\n edge.removeAttribute(\"style\");\n edge.classList.add(\"flow\", \"edge\");\n flowLayer.append(edge);\n const flow = baseElement.cloneNode(false);\n flow.id = `${baseElementId}-flow`;\n flow.removeAttribute(\"style\");\n flow.classList.add(\"flow\", \"anim-edge\");\n flowLayer.append(flow);\n });\n elementsToRemove.forEach((element)=>element.remove());\n }\n static async create(model) {\n const svg = await (0, $22519adc90afc1c6$export$b6a2e78b63791dfa)($fee6658e550852f2$var$svgUrl);\n this.prepareSvg(model, svg);\n return new $fee6658e550852f2$export$2e2bcd8739ae039(model, svg);\n }\n constructor(model, svg){\n this.model = model;\n this.svg = svg;\n this.element = document.createElement(\"div\");\n this.element.append(this.svg);\n }\n}\n\n\nasync function $eeb33a528debb3be$export$3e2b244719956741() {\n return new Promise((resolve)=>{\n const state = document.readyState;\n if (state === \"complete\" || state === \"interactive\") setTimeout(resolve, 0);\n document.addEventListener(\"DOMContentLoaded\", ()=>resolve());\n });\n}\n\n\n\nfunction $0b5cf6504bbda2cd$export$2e2bcd8739ae039(str) {\n if (typeof str !== \"string\") return false;\n if (str.trim() !== str) return false;\n if (str.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/) === null) return false;\n return true;\n}\n\n\nclass $279b597edf84dcbf$export$2e2bcd8739ae039 {\n constructor(i18nKey){\n this.i18nKey = i18nKey;\n }\n}\n\n\nclass $0d00df7a0e9c1179$export$2e2bcd8739ae039 extends (0, $279b597edf84dcbf$export$2e2bcd8739ae039) {\n applyTo(parameters) {\n this.callable(parameters);\n return parameters;\n }\n constructor(i18nKey, callable){\n super(i18nKey);\n this.callable = callable;\n }\n}\n\n\nclass $c66a53d1ef21207e$export$2e2bcd8739ae039 extends (0, $0d00df7a0e9c1179$export$2e2bcd8739ae039) {\n static createFunction(parameterIds, script) {\n parameterIds.forEach((parameterId)=>{\n if (!(0, $0b5cf6504bbda2cd$export$2e2bcd8739ae039)(parameterId)) throw new Error(`Parameter name '${parameterId}' can not be used as a variable`);\n });\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const wrappedScript = new Function(script).toString();\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const func = new Function(`{ ${parameterIds.join(\", \")} }`, `(${wrappedScript})(); return { ${parameterIds.join(\", \")} }`);\n return (parameters)=>{\n const transformedParameters = func(parameters);\n Object.assign(parameters, transformedParameters);\n return parameters;\n };\n }\n constructor(i18nKey, parameterIds, script){\n super(i18nKey, $c66a53d1ef21207e$export$2e2bcd8739ae039.createFunction(parameterIds, script));\n this.script = script;\n }\n}\n\n\nasync function $157dc5a8c12caacb$var$init() {\n const model = new (0, $995a1f169f5e286f$export$2e2bcd8739ae039)();\n const modelSimulator = new (0, $2495d722a6806b18$export$2e2bcd8739ae039)(model, // FIXME: It should be possible to pass CircularEconomyModel.initialStocks directly, but TypeScript does not complain.\n {\n ...(0, $995a1f169f5e286f$export$2e2bcd8739ae039).initialStocks\n }, // FIXME: It should be possible to pass CircularEconomyModel.defaultParameters directly, but TypeScript does not complain.\n {\n ...(0, $995a1f169f5e286f$export$2e2bcd8739ae039).defaultParameters\n }, 0.0, 0.01);\n const availableParameterTransformsContainer = (0, $853946bed0db7ade$export$99496351b147462)(document, \"#parameter-transforms .available\", HTMLElement);\n const activeParameterTransformsContainer = (0, $853946bed0db7ade$export$99496351b147462)(document, \"#parameter-transforms .active\", HTMLElement);\n const availableParameterTransforms = new Map();\n function getDistinctParameters(p1, p2) {\n const result = {};\n model.parameterIds.forEach((id)=>{\n if (p1[id] !== p2[id]) result[id] = p2[id];\n });\n return result;\n }\n function updateParameters() {\n const parameters = {\n ...(0, $995a1f169f5e286f$export$2e2bcd8739ae039).defaultParameters\n };\n [\n ...activeParameterTransformsContainer.children\n ].forEach((e)=>{\n (0, $GE7rZ.strict)(e instanceof HTMLElement);\n const id = e.getAttribute(\"data-id\");\n (0, $GE7rZ.strict)(id !== null);\n const parameterTransform = availableParameterTransforms.get(id);\n (0, $GE7rZ.strict)(parameterTransform !== undefined);\n const backupParameters = {\n ...parameters\n };\n parameterTransform.applyTo(parameters);\n const distinctParameters = getDistinctParameters(backupParameters, parameters);\n e.title = `${parameterTransform.script}\\n\\n${JSON.stringify(distinctParameters, null, 2)}\\n\\n${JSON.stringify(parameters, null, 2)}`;\n });\n Object.assign(modelSimulator.parameters, parameters);\n }\n (0, $c8f95463ff5f043e$export$2e2bcd8739ae039).create(availableParameterTransformsContainer, {\n group: {\n name: \"sharedParameterTransforms\",\n pull: \"clone\",\n put: false\n }\n });\n (0, $c8f95463ff5f043e$export$2e2bcd8739ae039).create(activeParameterTransformsContainer, {\n group: {\n name: \"sharedParameterTransforms\"\n },\n removeOnSpill: true,\n onSort: ()=>updateParameters(),\n onSpill: (event)=>{\n event.item.remove();\n updateParameters();\n }\n });\n const parameterTransforms = {\n create: (id, script)=>{\n if (availableParameterTransforms.has(id)) throw new Error(`Parameter transform with id '${id}' already exists`);\n availableParameterTransforms.set(id, new (0, $c66a53d1ef21207e$export$2e2bcd8739ae039)(\"none\", model.parameterIds, script));\n const dummyElement = document.createElement(\"div\");\n dummyElement.innerHTML = `
${id}
`;\n const parameterTransformElement = dummyElement.firstChild;\n (0, $GE7rZ.strict)(parameterTransformElement !== null);\n availableParameterTransformsContainer.append(parameterTransformElement);\n },\n destroy: (id)=>{\n availableParameterTransforms.delete(id);\n }\n };\n (0, $853946bed0db7ade$export$99496351b147462)(document, \"#add-parameter-transform\", HTMLElement).addEventListener(\"click\", ()=>{\n const idElement = (0, $853946bed0db7ade$export$99496351b147462)(document, \"#parameter-transform-id\", HTMLInputElement);\n const id = idElement.value;\n const scriptElement = (0, $853946bed0db7ade$export$99496351b147462)(document, \"#parameter-transform-script\", HTMLTextAreaElement);\n const script = scriptElement.value;\n parameterTransforms.create(id, script);\n });\n let circularityIndex = 0;\n const circularityIndexElement = (0, $853946bed0db7ade$export$99496351b147462)(document, \"#circularity-index\", HTMLElement);\n let userSatisfaction = 0;\n const userSatisfactionElement = (0, $853946bed0db7ade$export$99496351b147462)(document, \"#user-satisfaction\", HTMLElement);\n const visualization = await (0, $fee6658e550852f2$export$2e2bcd8739ae039).create(model);\n document.body.prepend(visualization.element);\n function toChartRecord(record) {\n return (0, $995a1f169f5e286f$export$2e2bcd8739ae039).elementIds.map((key)=>Object.entries(record[key]).map(([id, value])=>({\n id: id,\n value: value\n }))).reduce((cur, acc)=>[\n ...cur,\n ...acc\n ], []);\n }\n const initialChartRecord = toChartRecord(modelSimulator.record);\n const chartCanvas = document.getElementById(\"chart\");\n (0, $GE7rZ.strict)(chartCanvas !== null, \"chart element not found\");\n const chart = new (0, $90463797e5db2d19$export$2e2bcd8739ae039)(chartCanvas, {\n type: \"bar\",\n data: {\n labels: initialChartRecord.map((row)=>row.id),\n datasets: [\n {\n label: \"Values\",\n data: initialChartRecord.map((row)=>row.value)\n }\n ]\n },\n options: {\n animation: false\n }\n });\n function updateIndices(record) {\n const smoothingFactor = 0.5;\n const { phonesInUse: phonesInUse } = record.stocks;\n const { produceFromNaturalResources: produceFromNaturalResources, acquireNewlyProduced: acquireNewlyProduced, acquireUsed: acquireUsed, acquireRepaired: acquireRepaired, acquireRefurbished: acquireRefurbished, disposeHibernating: disposeHibernating, disposeBroken: disposeBroken, landfill: landfill } = record.flows;\n const { phoneGoal: phoneGoal } = record.variables;\n const naturalResourcesShare = Math.min(1.0, produceFromNaturalResources / (acquireNewlyProduced + acquireUsed + acquireRepaired + acquireRefurbished));\n const landfillShare = Math.min(1.0, landfill / (disposeHibernating + disposeBroken));\n const circularityIndexTarget = Math.min(1.0 - naturalResourcesShare, 1.0 - landfillShare);\n circularityIndex += (circularityIndexTarget - circularityIndex) * smoothingFactor;\n circularityIndexElement.innerText = `${(circularityIndex * 100).toFixed(2)}%`;\n const userSatisfactionTarget = phonesInUse < phoneGoal ? phonesInUse / phoneGoal : phoneGoal / phonesInUse;\n userSatisfaction += (userSatisfactionTarget - userSatisfaction) * smoothingFactor;\n userSatisfactionElement.innerText = `${(userSatisfaction * 100).toFixed(2)}%`;\n }\n function stepSimulation(deltaMs) {\n // TODO: pass deltaMs to modelSimulator.step()\n const record = modelSimulator.step();\n updateIndices(record);\n const chartRecord = toChartRecord(record);\n // console.log(chartRecord);\n chart.data.datasets[0].data = chartRecord.map((row)=>row.value);\n chart.update();\n visualization.update(deltaMs, record);\n }\n let running = false;\n const runCheckBox = document.getElementById(\"run\");\n (0, $GE7rZ.strict)(runCheckBox !== null, \"run checkbox not found\");\n async function loopSimulation() {\n running = true;\n let lastTimeMs = null;\n while(runCheckBox.checked){\n // eslint-disable-next-line no-await-in-loop\n const currentTimeMs = await (0, $918fc77ea978604c$export$1402cba6a733f33a)();\n const deltaMs = lastTimeMs === null ? 0 : currentTimeMs - lastTimeMs;\n stepSimulation(deltaMs);\n lastTimeMs = currentTimeMs;\n }\n running = false;\n }\n runCheckBox.addEventListener(\"input\", ()=>{\n if (!running) loopSimulation().catch((err)=>{\n throw err;\n });\n });\n stepSimulation(0);\n const circularEconomyApi = {\n model: model,\n modelSimulator: modelSimulator,\n parameterTransforms: parameterTransforms\n };\n return circularEconomyApi;\n}\nwindow.circularEconomy = (0, $eeb33a528debb3be$export$3e2b244719956741)().then($157dc5a8c12caacb$var$init);\n\n\n//# sourceMappingURL=index.7e1ba3ae.js.map\n","// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b\n\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nvar _require = require('./internal/errors'),\n _require$codes = _require.codes,\n ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE,\n ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;\nvar AssertionError = require('./internal/assert/assertion_error');\nvar _require2 = require('util/'),\n inspect = _require2.inspect;\nvar _require$types = require('util/').types,\n isPromise = _require$types.isPromise,\n isRegExp = _require$types.isRegExp;\nvar objectAssign = require('object.assign/polyfill')();\nvar objectIs = require('object-is/polyfill')();\nvar RegExpPrototypeTest = require('call-bind/callBound')('RegExp.prototype.test');\nvar errorCache = new Map();\nvar isDeepEqual;\nvar isDeepStrictEqual;\nvar parseExpressionAt;\nvar findNodeAround;\nvar decoder;\nfunction lazyLoadComparison() {\n var comparison = require('./internal/util/comparisons');\n isDeepEqual = comparison.isDeepEqual;\n isDeepStrictEqual = comparison.isDeepStrictEqual;\n}\n\n// Escape control characters but not \\n and \\t to keep the line breaks and\n// indentation intact.\n// eslint-disable-next-line no-control-regex\nvar escapeSequencesRegExp = /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/g;\nvar meta = [\"\\\\u0000\", \"\\\\u0001\", \"\\\\u0002\", \"\\\\u0003\", \"\\\\u0004\", \"\\\\u0005\", \"\\\\u0006\", \"\\\\u0007\", '\\\\b', '', '', \"\\\\u000b\", '\\\\f', '', \"\\\\u000e\", \"\\\\u000f\", \"\\\\u0010\", \"\\\\u0011\", \"\\\\u0012\", \"\\\\u0013\", \"\\\\u0014\", \"\\\\u0015\", \"\\\\u0016\", \"\\\\u0017\", \"\\\\u0018\", \"\\\\u0019\", \"\\\\u001a\", \"\\\\u001b\", \"\\\\u001c\", \"\\\\u001d\", \"\\\\u001e\", \"\\\\u001f\"];\nvar escapeFn = function escapeFn(str) {\n return meta[str.charCodeAt(0)];\n};\nvar warned = false;\n\n// The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\nvar NO_EXCEPTION_SENTINEL = {};\n\n// All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction innerFail(obj) {\n if (obj.message instanceof Error) throw obj.message;\n throw new AssertionError(obj);\n}\nfunction fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length;\n var internalMessage;\n if (argsLen === 0) {\n internalMessage = 'Failed';\n } else if (argsLen === 1) {\n message = actual;\n actual = undefined;\n } else {\n if (warned === false) {\n warned = true;\n var warn = process.emitWarning ? process.emitWarning : console.warn.bind(console);\n warn('assert.fail() with more than one argument is deprecated. ' + 'Please use assert.strictEqual() instead or only pass a message.', 'DeprecationWarning', 'DEP0094');\n }\n if (argsLen === 2) operator = '!=';\n }\n if (message instanceof Error) throw message;\n var errArgs = {\n actual: actual,\n expected: expected,\n operator: operator === undefined ? 'fail' : operator,\n stackStartFn: stackStartFn || fail\n };\n if (message !== undefined) {\n errArgs.message = message;\n }\n var err = new AssertionError(errArgs);\n if (internalMessage) {\n err.message = internalMessage;\n err.generatedMessage = true;\n }\n throw err;\n}\nassert.fail = fail;\n\n// The AssertionError is defined in internal/error.\nassert.AssertionError = AssertionError;\nfunction innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = false;\n if (argLen === 0) {\n generatedMessage = true;\n message = 'No value argument passed to `assert.ok()`';\n } else if (message instanceof Error) {\n throw message;\n }\n var err = new AssertionError({\n actual: value,\n expected: true,\n message: message,\n operator: '==',\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\n\n// Pure assertion tests whether a value is truthy, as determined\n// by !!value.\nfunction ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n innerOk.apply(void 0, [ok, args.length].concat(args));\n}\nassert.ok = ok;\n\n// The equality assertion tests shallow, coercive equality with ==.\n/* eslint-disable no-restricted-properties */\nassert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n // eslint-disable-next-line eqeqeq\n if (actual != expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '==',\n stackStartFn: equal\n });\n }\n};\n\n// The non-equality assertion tests for whether two objects are not\n// equal with !=.\nassert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n // eslint-disable-next-line eqeqeq\n if (actual == expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '!=',\n stackStartFn: notEqual\n });\n }\n};\n\n// The equivalence assertion tests a deep equality relation.\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (!isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepEqual',\n stackStartFn: deepEqual\n });\n }\n};\n\n// The non-equivalence assertion tests for any deep inequality.\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepEqual',\n stackStartFn: notDeepEqual\n });\n }\n};\n/* eslint-enable */\n\nassert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (!isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepStrictEqual',\n stackStartFn: deepStrictEqual\n });\n }\n};\nassert.notDeepStrictEqual = notDeepStrictEqual;\nfunction notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepStrictEqual',\n stackStartFn: notDeepStrictEqual\n });\n }\n}\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (!objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'strictEqual',\n stackStartFn: strictEqual\n });\n }\n};\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notStrictEqual',\n stackStartFn: notStrictEqual\n });\n }\n};\nvar Comparison = /*#__PURE__*/_createClass(function Comparison(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison);\n keys.forEach(function (key) {\n if (key in obj) {\n if (actual !== undefined && typeof actual[key] === 'string' && isRegExp(obj[key]) && RegExpPrototypeTest(obj[key], actual[key])) {\n _this[key] = actual[key];\n } else {\n _this[key] = obj[key];\n }\n }\n });\n});\nfunction compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) {\n if (!message) {\n // Create placeholder objects to create a nice output.\n var a = new Comparison(actual, keys);\n var b = new Comparison(expected, keys, actual);\n var err = new AssertionError({\n actual: a,\n expected: b,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.actual = actual;\n err.expected = expected;\n err.operator = fn.name;\n throw err;\n }\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n}\nfunction expectedException(actual, expected, msg, fn) {\n if (typeof expected !== 'function') {\n if (isRegExp(expected)) return RegExpPrototypeTest(expected, actual);\n // assert.doesNotThrow does not accept objects.\n if (arguments.length === 2) {\n throw new ERR_INVALID_ARG_TYPE('expected', ['Function', 'RegExp'], expected);\n }\n\n // Handle primitives properly.\n if (_typeof(actual) !== 'object' || actual === null) {\n var err = new AssertionError({\n actual: actual,\n expected: expected,\n message: msg,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.operator = fn.name;\n throw err;\n }\n var keys = Object.keys(expected);\n // Special handle errors to make sure the name and the message are compared\n // as well.\n if (expected instanceof Error) {\n keys.push('name', 'message');\n } else if (keys.length === 0) {\n throw new ERR_INVALID_ARG_VALUE('error', expected, 'may not be an empty object');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n keys.forEach(function (key) {\n if (typeof actual[key] === 'string' && isRegExp(expected[key]) && RegExpPrototypeTest(expected[key], actual[key])) {\n return;\n }\n compareExceptionKey(actual, expected, key, msg, keys, fn);\n });\n return true;\n }\n // Guard instanceof against arrow functions as they don't have a prototype.\n if (expected.prototype !== undefined && actual instanceof expected) {\n return true;\n }\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n return expected.call({}, actual) === true;\n}\nfunction getActual(fn) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', 'Function', fn);\n }\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n}\nfunction checkIsPromise(obj) {\n // Accept native ES6 promises and promises that are implemented in a similar\n // way. Do not accept thenables that use a function as `obj` and that have no\n // `catch` handler.\n\n // TODO: thenables are checked up until they have the correct methods,\n // but according to documentation, the `then` method should receive\n // the `fulfill` and `reject` arguments as well or it may be never resolved.\n\n return isPromise(obj) || obj !== null && _typeof(obj) === 'object' && typeof obj.then === 'function' && typeof obj.catch === 'function';\n}\nfunction waitForActual(promiseFn) {\n return Promise.resolve().then(function () {\n var resultPromise;\n if (typeof promiseFn === 'function') {\n // Return a rejected promise if `promiseFn` throws synchronously.\n resultPromise = promiseFn();\n // Fail in case no promise is returned.\n if (!checkIsPromise(resultPromise)) {\n throw new ERR_INVALID_RETURN_VALUE('instance of Promise', 'promiseFn', resultPromise);\n }\n } else if (checkIsPromise(promiseFn)) {\n resultPromise = promiseFn;\n } else {\n throw new ERR_INVALID_ARG_TYPE('promiseFn', ['Function', 'Promise'], promiseFn);\n }\n return Promise.resolve().then(function () {\n return resultPromise;\n }).then(function () {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function (e) {\n return e;\n });\n });\n}\nfunction expectsError(stackStartFn, actual, error, message) {\n if (typeof error === 'string') {\n if (arguments.length === 4) {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n if (_typeof(actual) === 'object' && actual !== null) {\n if (actual.message === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error message \\\"\".concat(actual.message, \"\\\" is identical to the message.\"));\n }\n } else if (actual === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error \\\"\".concat(actual, \"\\\" is identical to the message.\"));\n }\n message = error;\n error = undefined;\n } else if (error != null && _typeof(error) !== 'object' && typeof error !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = '';\n if (error && error.name) {\n details += \" (\".concat(error.name, \")\");\n }\n details += message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'rejects' ? 'rejection' : 'exception';\n innerFail({\n actual: undefined,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn: stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn)) {\n throw actual;\n }\n}\nfunction expectsNoError(stackStartFn, actual, error, message) {\n if (actual === NO_EXCEPTION_SENTINEL) return;\n if (typeof error === 'string') {\n message = error;\n error = undefined;\n }\n if (!error || expectedException(actual, error)) {\n var details = message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'doesNotReject' ? 'rejection' : 'exception';\n innerFail({\n actual: actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, \"\\n\") + \"Actual message: \\\"\".concat(actual && actual.message, \"\\\"\"),\n stackStartFn: stackStartFn\n });\n }\n throw actual;\n}\nassert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n};\nassert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n return waitForActual(promiseFn).then(function (result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n};\nassert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n};\nassert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {\n args[_key5 - 1] = arguments[_key5];\n }\n return waitForActual(fn).then(function (result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n};\nassert.ifError = function ifError(err) {\n if (err !== null && err !== undefined) {\n var message = 'ifError got unwanted exception: ';\n if (_typeof(err) === 'object' && typeof err.message === 'string') {\n if (err.message.length === 0 && err.constructor) {\n message += err.constructor.name;\n } else {\n message += err.message;\n }\n } else {\n message += inspect(err);\n }\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: 'ifError',\n message: message,\n stackStartFn: ifError\n });\n\n // Make sure we actually have a stack trace!\n var origStack = err.stack;\n if (typeof origStack === 'string') {\n // This will remove any duplicated frames from the error frames taken\n // from within `ifError` and add the original error frames to the newly\n // created ones.\n var tmp2 = origStack.split('\\n');\n tmp2.shift();\n // Filter all frames existing in err.stack.\n var tmp1 = newErr.stack.split('\\n');\n for (var i = 0; i < tmp2.length; i++) {\n // Find the first occurrence of the frame.\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n // Only keep new frames.\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join('\\n'), \"\\n\").concat(tmp2.join('\\n'));\n }\n throw newErr;\n }\n};\n\n// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a871df3dfb8ea663ef5e1f8f62701ec51384ecb\nfunction internalMatch(string, regexp, message, fn, fnName) {\n if (!isRegExp(regexp)) {\n throw new ERR_INVALID_ARG_TYPE('regexp', 'RegExp', regexp);\n }\n var match = fnName === 'match';\n if (typeof string !== 'string' || RegExpPrototypeTest(regexp, string) !== match) {\n if (message instanceof Error) {\n throw message;\n }\n var generatedMessage = !message;\n\n // 'The input was expected to not match the regular expression ' +\n message = message || (typeof string !== 'string' ? 'The \"string\" argument must be of type string. Received type ' + \"\".concat(_typeof(string), \" (\").concat(inspect(string), \")\") : (match ? 'The input did not match the regular expression ' : 'The input was expected to not match the regular expression ') + \"\".concat(inspect(regexp), \". Input:\\n\\n\").concat(inspect(string), \"\\n\"));\n var err = new AssertionError({\n actual: string,\n expected: regexp,\n message: message,\n operator: fnName,\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\nassert.match = function match(string, regexp, message) {\n internalMatch(string, regexp, message, match, 'match');\n};\nassert.doesNotMatch = function doesNotMatch(string, regexp, message) {\n internalMatch(string, regexp, message, doesNotMatch, 'doesNotMatch');\n};\n\n// Expose a strict only variant of assert\nfunction strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n innerOk.apply(void 0, [strict, args.length].concat(args));\n}\nassert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n});\nassert.strict.strict = assert.strict;","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","// Currently in sync with Node.js lib/internal/errors.js\n// https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f\n\n/* eslint node-core/documented-errors: \"error\" */\n/* eslint node-core/alphabetize-errors: \"error\" */\n/* eslint node-core/prefer-util-format-errors: \"error\" */\n\n'use strict';\n\n// The whole point behind this internal module is to allow Node.js to no\n// longer be forced to treat every error message change as a semver-major\n// change. The NodeError classes here all expose a `code` property whose\n// value statically and permanently identifies the error. While the error\n// message may change, the code should not.\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar codes = {};\n\n// Lazy loaded\nvar assert;\nvar util;\nfunction createErrorType(code, message, Base) {\n if (!Base) {\n Base = Error;\n }\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === 'string') {\n return message;\n } else {\n return message(arg1, arg2, arg3);\n }\n }\n var NodeError = /*#__PURE__*/function (_Base) {\n _inherits(NodeError, _Base);\n var _super = _createSuper(NodeError);\n function NodeError(arg1, arg2, arg3) {\n var _this;\n _classCallCheck(this, NodeError);\n _this = _super.call(this, getMessage(arg1, arg2, arg3));\n _this.code = code;\n return _this;\n }\n return _createClass(NodeError);\n }(Base);\n codes[code] = NodeError;\n}\n\n// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\nfunction oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function (i) {\n return String(i);\n });\n if (len > 2) {\n return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(', '), \", or \") + expected[len - 1];\n } else if (len === 2) {\n return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n } else {\n return \"of \".concat(thing, \" \").concat(expected[0]);\n }\n } else {\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\nfunction startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n return str.substring(this_len - search.length, this_len) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\nfunction includes(str, search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n if (start + search.length > str.length) {\n return false;\n } else {\n return str.indexOf(search, start) !== -1;\n }\n}\ncreateErrorType('ERR_AMBIGUOUS_ARGUMENT', 'The \"%s\" argument is ambiguous. %s', TypeError);\ncreateErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {\n if (assert === undefined) assert = require('../assert');\n assert(typeof name === 'string', \"'name' must be a string\");\n\n // determiner: 'must be' or 'must not be'\n var determiner;\n if (typeof expected === 'string' && startsWith(expected, 'not ')) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n } else {\n determiner = 'must be';\n }\n var msg;\n if (endsWith(name, ' argument')) {\n // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } else {\n var type = includes(name, '.') ? 'property' : 'argument';\n msg = \"The \\\"\".concat(name, \"\\\" \").concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n }\n\n // TODO(BridgeAR): Improve the output by showing `null` and similar.\n msg += \". Received type \".concat(_typeof(actual));\n return msg;\n}, TypeError);\ncreateErrorType('ERR_INVALID_ARG_VALUE', function (name, value) {\n var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'is invalid';\n if (util === undefined) util = require('util/');\n var inspected = util.inspect(value);\n if (inspected.length > 128) {\n inspected = \"\".concat(inspected.slice(0, 128), \"...\");\n }\n return \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n}, TypeError, RangeError);\ncreateErrorType('ERR_INVALID_RETURN_VALUE', function (input, name, value) {\n var type;\n if (value && value.constructor && value.constructor.name) {\n type = \"instance of \".concat(value.constructor.name);\n } else {\n type = \"type \".concat(_typeof(value));\n }\n return \"Expected \".concat(input, \" to be returned from the \\\"\").concat(name, \"\\\"\") + \" function but got \".concat(type, \".\");\n}, TypeError);\ncreateErrorType('ERR_MISSING_ARGS', function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (assert === undefined) assert = require('../assert');\n assert(args.length > 0, 'At least one arg needs to be specified');\n var msg = 'The ';\n var len = args.length;\n args = args.map(function (a) {\n return \"\\\"\".concat(a, \"\\\"\");\n });\n switch (len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(', ');\n msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n}, TypeError);\nmodule.exports.codes = codes;","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||\n function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for (var i = 0; i < keys.length; i++) {\n descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n }\n return descriptors;\n };\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n if (typeof process !== 'undefined' && process.noDeprecation === true) {\n return fn;\n }\n\n // Allow for deprecating things in the process of starting up.\n if (typeof process === 'undefined') {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnvRegex = /^$/;\n\nif (process.env.NODE_DEBUG) {\n var debugEnv = process.env.NODE_DEBUG;\n debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+?.]/g, '\\\\$&')\n .replace(/\\*/g, '.*')\n .replace(/,/g, '$|^')\n .toUpperCase();\n debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i');\n}\nexports.debuglog = function(set) {\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').slice(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.slice(1, -1);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexports.types = require('./support/types');\n\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\nexports.types.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\nexports.types.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\nexports.types.isNativeError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nvar kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;\n\nexports.promisify = function promisify(original) {\n if (typeof original !== 'function')\n throw new TypeError('The \"original\" argument must be of type Function');\n\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== 'function') {\n throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n }\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return fn;\n }\n\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function (resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n args.push(function (err, value) {\n if (err) {\n promiseReject(err);\n } else {\n promiseResolve(value);\n }\n });\n\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n\n return promise;\n }\n\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n\n if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return Object.defineProperties(\n fn,\n getOwnPropertyDescriptors(original)\n );\n}\n\nexports.promisify.custom = kCustomPromisifiedSymbol\n\nfunction callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error('Promise was rejected with a falsy value');\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\n\nfunction callbackify(original) {\n if (typeof original !== 'function') {\n throw new TypeError('The \"original\" argument must be of type Function');\n }\n\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args)\n .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) },\n function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) });\n }\n\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified,\n getOwnPropertyDescriptors(original));\n return callbackified;\n}\nexports.callbackify = callbackify;\n","// Currently in sync with Node.js lib/internal/util/types.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\n'use strict';\n\nvar isArgumentsObject = require('is-arguments');\nvar isGeneratorFunction = require('is-generator-function');\nvar whichTypedArray = require('which-typed-array');\nvar isTypedArray = require('is-typed-array');\n\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\n\nvar BigIntSupported = typeof BigInt !== 'undefined';\nvar SymbolSupported = typeof Symbol !== 'undefined';\n\nvar ObjectToString = uncurryThis(Object.prototype.toString);\n\nvar numberValue = uncurryThis(Number.prototype.valueOf);\nvar stringValue = uncurryThis(String.prototype.valueOf);\nvar booleanValue = uncurryThis(Boolean.prototype.valueOf);\n\nif (BigIntSupported) {\n var bigIntValue = uncurryThis(BigInt.prototype.valueOf);\n}\n\nif (SymbolSupported) {\n var symbolValue = uncurryThis(Symbol.prototype.valueOf);\n}\n\nfunction checkBoxedPrimitive(value, prototypeValueOf) {\n if (typeof value !== 'object') {\n return false;\n }\n try {\n prototypeValueOf(value);\n return true;\n } catch(e) {\n return false;\n }\n}\n\nexports.isArgumentsObject = isArgumentsObject;\nexports.isGeneratorFunction = isGeneratorFunction;\nexports.isTypedArray = isTypedArray;\n\n// Taken from here and modified for better browser support\n// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js\nfunction isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}\nexports.isPromise = isPromise;\n\nfunction isArrayBufferView(value) {\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n return ArrayBuffer.isView(value);\n }\n\n return (\n isTypedArray(value) ||\n isDataView(value)\n );\n}\nexports.isArrayBufferView = isArrayBufferView;\n\n\nfunction isUint8Array(value) {\n return whichTypedArray(value) === 'Uint8Array';\n}\nexports.isUint8Array = isUint8Array;\n\nfunction isUint8ClampedArray(value) {\n return whichTypedArray(value) === 'Uint8ClampedArray';\n}\nexports.isUint8ClampedArray = isUint8ClampedArray;\n\nfunction isUint16Array(value) {\n return whichTypedArray(value) === 'Uint16Array';\n}\nexports.isUint16Array = isUint16Array;\n\nfunction isUint32Array(value) {\n return whichTypedArray(value) === 'Uint32Array';\n}\nexports.isUint32Array = isUint32Array;\n\nfunction isInt8Array(value) {\n return whichTypedArray(value) === 'Int8Array';\n}\nexports.isInt8Array = isInt8Array;\n\nfunction isInt16Array(value) {\n return whichTypedArray(value) === 'Int16Array';\n}\nexports.isInt16Array = isInt16Array;\n\nfunction isInt32Array(value) {\n return whichTypedArray(value) === 'Int32Array';\n}\nexports.isInt32Array = isInt32Array;\n\nfunction isFloat32Array(value) {\n return whichTypedArray(value) === 'Float32Array';\n}\nexports.isFloat32Array = isFloat32Array;\n\nfunction isFloat64Array(value) {\n return whichTypedArray(value) === 'Float64Array';\n}\nexports.isFloat64Array = isFloat64Array;\n\nfunction isBigInt64Array(value) {\n return whichTypedArray(value) === 'BigInt64Array';\n}\nexports.isBigInt64Array = isBigInt64Array;\n\nfunction isBigUint64Array(value) {\n return whichTypedArray(value) === 'BigUint64Array';\n}\nexports.isBigUint64Array = isBigUint64Array;\n\nfunction isMapToString(value) {\n return ObjectToString(value) === '[object Map]';\n}\nisMapToString.working = (\n typeof Map !== 'undefined' &&\n isMapToString(new Map())\n);\n\nfunction isMap(value) {\n if (typeof Map === 'undefined') {\n return false;\n }\n\n return isMapToString.working\n ? isMapToString(value)\n : value instanceof Map;\n}\nexports.isMap = isMap;\n\nfunction isSetToString(value) {\n return ObjectToString(value) === '[object Set]';\n}\nisSetToString.working = (\n typeof Set !== 'undefined' &&\n isSetToString(new Set())\n);\nfunction isSet(value) {\n if (typeof Set === 'undefined') {\n return false;\n }\n\n return isSetToString.working\n ? isSetToString(value)\n : value instanceof Set;\n}\nexports.isSet = isSet;\n\nfunction isWeakMapToString(value) {\n return ObjectToString(value) === '[object WeakMap]';\n}\nisWeakMapToString.working = (\n typeof WeakMap !== 'undefined' &&\n isWeakMapToString(new WeakMap())\n);\nfunction isWeakMap(value) {\n if (typeof WeakMap === 'undefined') {\n return false;\n }\n\n return isWeakMapToString.working\n ? isWeakMapToString(value)\n : value instanceof WeakMap;\n}\nexports.isWeakMap = isWeakMap;\n\nfunction isWeakSetToString(value) {\n return ObjectToString(value) === '[object WeakSet]';\n}\nisWeakSetToString.working = (\n typeof WeakSet !== 'undefined' &&\n isWeakSetToString(new WeakSet())\n);\nfunction isWeakSet(value) {\n return isWeakSetToString(value);\n}\nexports.isWeakSet = isWeakSet;\n\nfunction isArrayBufferToString(value) {\n return ObjectToString(value) === '[object ArrayBuffer]';\n}\nisArrayBufferToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n isArrayBufferToString(new ArrayBuffer())\n);\nfunction isArrayBuffer(value) {\n if (typeof ArrayBuffer === 'undefined') {\n return false;\n }\n\n return isArrayBufferToString.working\n ? isArrayBufferToString(value)\n : value instanceof ArrayBuffer;\n}\nexports.isArrayBuffer = isArrayBuffer;\n\nfunction isDataViewToString(value) {\n return ObjectToString(value) === '[object DataView]';\n}\nisDataViewToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n typeof DataView !== 'undefined' &&\n isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1))\n);\nfunction isDataView(value) {\n if (typeof DataView === 'undefined') {\n return false;\n }\n\n return isDataViewToString.working\n ? isDataViewToString(value)\n : value instanceof DataView;\n}\nexports.isDataView = isDataView;\n\n// Store a copy of SharedArrayBuffer in case it's deleted elsewhere\nvar SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined;\nfunction isSharedArrayBufferToString(value) {\n return ObjectToString(value) === '[object SharedArrayBuffer]';\n}\nfunction isSharedArrayBuffer(value) {\n if (typeof SharedArrayBufferCopy === 'undefined') {\n return false;\n }\n\n if (typeof isSharedArrayBufferToString.working === 'undefined') {\n isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());\n }\n\n return isSharedArrayBufferToString.working\n ? isSharedArrayBufferToString(value)\n : value instanceof SharedArrayBufferCopy;\n}\nexports.isSharedArrayBuffer = isSharedArrayBuffer;\n\nfunction isAsyncFunction(value) {\n return ObjectToString(value) === '[object AsyncFunction]';\n}\nexports.isAsyncFunction = isAsyncFunction;\n\nfunction isMapIterator(value) {\n return ObjectToString(value) === '[object Map Iterator]';\n}\nexports.isMapIterator = isMapIterator;\n\nfunction isSetIterator(value) {\n return ObjectToString(value) === '[object Set Iterator]';\n}\nexports.isSetIterator = isSetIterator;\n\nfunction isGeneratorObject(value) {\n return ObjectToString(value) === '[object Generator]';\n}\nexports.isGeneratorObject = isGeneratorObject;\n\nfunction isWebAssemblyCompiledModule(value) {\n return ObjectToString(value) === '[object WebAssembly.Module]';\n}\nexports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;\n\nfunction isNumberObject(value) {\n return checkBoxedPrimitive(value, numberValue);\n}\nexports.isNumberObject = isNumberObject;\n\nfunction isStringObject(value) {\n return checkBoxedPrimitive(value, stringValue);\n}\nexports.isStringObject = isStringObject;\n\nfunction isBooleanObject(value) {\n return checkBoxedPrimitive(value, booleanValue);\n}\nexports.isBooleanObject = isBooleanObject;\n\nfunction isBigIntObject(value) {\n return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);\n}\nexports.isBigIntObject = isBigIntObject;\n\nfunction isSymbolObject(value) {\n return SymbolSupported && checkBoxedPrimitive(value, symbolValue);\n}\nexports.isSymbolObject = isSymbolObject;\n\nfunction isBoxedPrimitive(value) {\n return (\n isNumberObject(value) ||\n isStringObject(value) ||\n isBooleanObject(value) ||\n isBigIntObject(value) ||\n isSymbolObject(value)\n );\n}\nexports.isBoxedPrimitive = isBoxedPrimitive;\n\nfunction isAnyArrayBuffer(value) {\n return typeof Uint8Array !== 'undefined' && (\n isArrayBuffer(value) ||\n isSharedArrayBuffer(value)\n );\n}\nexports.isAnyArrayBuffer = isAnyArrayBuffer;\n\n['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) {\n Object.defineProperty(exports, method, {\n enumerable: false,\n value: function() {\n throw new Error(method + ' is not supported in userland');\n }\n });\n});\n","'use strict';\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\n\nvar isStandardArguments = function isArguments(value) {\n\tif (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {\n\t\treturn false;\n\t}\n\treturn $toString(value) === '[object Arguments]';\n};\n\nvar isLegacyArguments = function isArguments(value) {\n\tif (isStandardArguments(value)) {\n\t\treturn true;\n\t}\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.length === 'number' &&\n\t\tvalue.length >= 0 &&\n\t\t$toString(value) !== '[object Array]' &&\n\t\t$toString(value.callee) === '[object Function]';\n};\n\nvar supportsStandardArguments = (function () {\n\treturn isStandardArguments(arguments);\n}());\n\nisStandardArguments.isLegacyArguments = isLegacyArguments; // for tests\n\nmodule.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('hasown');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = require('function-bind');\n\n/** @type {(o: {}, p: PropertyKey) => p is keyof o} */\nmodule.exports = bind.call(call, $hasOwn);\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\nvar setFunctionLength = require('set-function-length');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tif (typeof originalFunction !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\tvar func = $reflectApply(bind, $call, arguments);\n\treturn setFunctionLength(\n\t\tfunc,\n\t\t1 + $max(0, originalFunction.length - (arguments.length - 1)),\n\t\ttrue\n\t);\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar gOPD = require('gopd');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $floor = GetIntrinsic('%Math.floor%');\n\nmodule.exports = function setFunctionLength(fn, length) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tif (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {\n\t\tthrow new $TypeError('`length` must be a positive 32-bit integer');\n\t}\n\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\n\tvar functionLengthIsConfigurable = true;\n\tvar functionLengthIsWritable = true;\n\tif ('length' in fn && gOPD) {\n\t\tvar desc = gOPD(fn, 'length');\n\t\tif (desc && !desc.configurable) {\n\t\t\tfunctionLengthIsConfigurable = false;\n\t\t}\n\t\tif (desc && !desc.writable) {\n\t\t\tfunctionLengthIsWritable = false;\n\t\t}\n\t}\n\n\tif (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(fn, 'length', length, true, true);\n\t\t} else {\n\t\t\tdefine(fn, 'length', length);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors')();\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar gopd = require('gopd');\n\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\tif ($defineProperty) {\n\t\ttry {\n\t\t\t$defineProperty({}, 'a', { value: 1 });\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\t// IE 8 has a broken defineProperty\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!hasPropertyDescriptors()) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar fnToStr = Function.prototype.toString;\nvar isFnRegex = /^\\s*(?:function)?\\*/;\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar getProto = Object.getPrototypeOf;\nvar getGeneratorFunc = function () { // eslint-disable-line consistent-return\n\tif (!hasToStringTag) {\n\t\treturn false;\n\t}\n\ttry {\n\t\treturn Function('return function*() {}')();\n\t} catch (e) {\n\t}\n};\nvar GeneratorFunction;\n\nmodule.exports = function isGeneratorFunction(fn) {\n\tif (typeof fn !== 'function') {\n\t\treturn false;\n\t}\n\tif (isFnRegex.test(fnToStr.call(fn))) {\n\t\treturn true;\n\t}\n\tif (!hasToStringTag) {\n\t\tvar str = toStr.call(fn);\n\t\treturn str === '[object GeneratorFunction]';\n\t}\n\tif (!getProto) {\n\t\treturn false;\n\t}\n\tif (typeof GeneratorFunction === 'undefined') {\n\t\tvar generatorFunc = getGeneratorFunc();\n\t\tGeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;\n\t}\n\treturn getProto(fn) === GeneratorFunction;\n};\n","'use strict';\n\nvar forEach = require('for-each');\nvar availableTypedArrays = require('available-typed-arrays');\nvar callBind = require('call-bind');\nvar callBound = require('call-bind/callBound');\nvar gOPD = require('gopd');\n\nvar $toString = callBound('Object.prototype.toString');\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\nvar typedArrays = availableTypedArrays();\n\nvar $slice = callBound('String.prototype.slice');\nvar getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\n\nvar $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tif (array[i] === value) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n};\nvar cache = { __proto__: null };\nif (hasToStringTag && gOPD && getPrototypeOf) {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new g[typedArray]();\n\t\tif (Symbol.toStringTag in arr) {\n\t\t\tvar proto = getPrototypeOf(arr);\n\t\t\tvar descriptor = gOPD(proto, Symbol.toStringTag);\n\t\t\tif (!descriptor) {\n\t\t\t\tvar superProto = getPrototypeOf(proto);\n\t\t\t\tdescriptor = gOPD(superProto, Symbol.toStringTag);\n\t\t\t}\n\t\t\tcache['$' + typedArray] = callBind(descriptor.get);\n\t\t}\n\t});\n} else {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new g[typedArray]();\n\t\tvar fn = arr.slice || arr.set;\n\t\tif (fn) {\n\t\t\tcache['$' + typedArray] = callBind(fn);\n\t\t}\n\t});\n}\n\nvar tryTypedArrays = function tryAllTypedArrays(value) {\n\tvar found = false;\n\tforEach(cache, function (getter, typedArray) {\n\t\tif (!found) {\n\t\t\ttry {\n\t\t\t\tif ('$' + getter(value) === typedArray) {\n\t\t\t\t\tfound = $slice(typedArray, 1);\n\t\t\t\t}\n\t\t\t} catch (e) { /**/ }\n\t\t}\n\t});\n\treturn found;\n};\n\nvar trySlices = function tryAllSlices(value) {\n\tvar found = false;\n\tforEach(cache, function (getter, name) {\n\t\tif (!found) {\n\t\t\ttry {\n\t\t\t\tgetter(value);\n\t\t\t\tfound = $slice(name, 1);\n\t\t\t} catch (e) { /**/ }\n\t\t}\n\t});\n\treturn found;\n};\n\nmodule.exports = function whichTypedArray(value) {\n\tif (!value || typeof value !== 'object') { return false; }\n\tif (!hasToStringTag) {\n\t\tvar tag = $slice($toString(value), 8, -1);\n\t\tif ($indexOf(typedArrays, tag) > -1) {\n\t\t\treturn tag;\n\t\t}\n\t\tif (tag !== 'Object') {\n\t\t\treturn false;\n\t\t}\n\t\t// node < 0.6 hits here on real Typed Arrays\n\t\treturn trySlices(value);\n\t}\n\tif (!gOPD) { return null; } // unknown engine\n\treturn tryTypedArrays(value);\n};\n","'use strict';\n\nvar isCallable = require('is-callable');\n\nvar toStr = Object.prototype.toString;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar forEachArray = function forEachArray(array, iterator, receiver) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (hasOwnProperty.call(array, i)) {\n if (receiver == null) {\n iterator(array[i], i, array);\n } else {\n iterator.call(receiver, array[i], i, array);\n }\n }\n }\n};\n\nvar forEachString = function forEachString(string, iterator, receiver) {\n for (var i = 0, len = string.length; i < len; i++) {\n // no such thing as a sparse string.\n if (receiver == null) {\n iterator(string.charAt(i), i, string);\n } else {\n iterator.call(receiver, string.charAt(i), i, string);\n }\n }\n};\n\nvar forEachObject = function forEachObject(object, iterator, receiver) {\n for (var k in object) {\n if (hasOwnProperty.call(object, k)) {\n if (receiver == null) {\n iterator(object[k], k, object);\n } else {\n iterator.call(receiver, object[k], k, object);\n }\n }\n }\n};\n\nvar forEach = function forEach(list, iterator, thisArg) {\n if (!isCallable(iterator)) {\n throw new TypeError('iterator must be a function');\n }\n\n var receiver;\n if (arguments.length >= 3) {\n receiver = thisArg;\n }\n\n if (toStr.call(list) === '[object Array]') {\n forEachArray(list, iterator, receiver);\n } else if (typeof list === 'string') {\n forEachString(list, iterator, receiver);\n } else {\n forEachObject(list, iterator, receiver);\n }\n};\n\nmodule.exports = forEach;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar possibleNames = [\n\t'BigInt64Array',\n\t'BigUint64Array',\n\t'Float32Array',\n\t'Float64Array',\n\t'Int16Array',\n\t'Int32Array',\n\t'Int8Array',\n\t'Uint16Array',\n\t'Uint32Array',\n\t'Uint8Array',\n\t'Uint8ClampedArray'\n];\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\n\nmodule.exports = function availableTypedArrays() {\n\tvar out = [];\n\tfor (var i = 0; i < possibleNames.length; i++) {\n\t\tif (typeof g[possibleNames[i]] === 'function') {\n\t\t\tout[out.length] = possibleNames[i];\n\t\t}\n\t}\n\treturn out;\n};\n","'use strict';\n\nvar whichTypedArray = require('which-typed-array');\n\nmodule.exports = function isTypedArray(value) {\n\treturn !!whichTypedArray(value);\n};\n","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","// Currently in sync with Node.js lib/internal/assert/assertion_error.js\n// https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c\n\n'use strict';\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _require = require('util/'),\n inspect = _require.inspect;\nvar _require2 = require('../errors'),\n ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n return str.substring(this_len - search.length, this_len) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\nfunction repeat(str, count) {\n count = Math.floor(count);\n if (str.length == 0 || count == 0) return '';\n var maxCount = str.length * count;\n count = Math.floor(Math.log(count) / Math.log(2));\n while (count) {\n str += str;\n count--;\n }\n str += str.substring(0, maxCount - str.length);\n return str;\n}\nvar blue = '';\nvar green = '';\nvar red = '';\nvar white = '';\nvar kReadableOperator = {\n deepStrictEqual: 'Expected values to be strictly deep-equal:',\n strictEqual: 'Expected values to be strictly equal:',\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: 'Expected values to be loosely deep-equal:',\n equal: 'Expected values to be loosely equal:',\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: 'Values identical but not reference-equal:'\n};\n\n// Comparing short primitives should just show === / !== instead of using the\n// diff.\nvar kMaxShortLength = 10;\nfunction copyError(source) {\n var keys = Object.keys(source);\n var target = Object.create(Object.getPrototypeOf(source));\n keys.forEach(function (key) {\n target[key] = source[key];\n });\n Object.defineProperty(target, 'message', {\n value: source.message\n });\n return target;\n}\nfunction inspectValue(val) {\n // The util.inspect default values could be changed. This makes sure the\n // error messages contain the necessary information nevertheless.\n return inspect(val, {\n compact: false,\n customInspect: false,\n depth: 1000,\n maxArrayLength: Infinity,\n // Assert compares only enumerable properties (with a few exceptions).\n showHidden: false,\n // Having a long line as error is better than wrapping the line for\n // comparison for now.\n // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we\n // have meta information about the inspected properties (i.e., know where\n // in what line the property starts and ends).\n breakLength: Infinity,\n // Assert does not detect proxies currently.\n showProxy: false,\n sorted: true,\n // Inspect getters as we also check them when comparing entries.\n getters: true\n });\n}\nfunction createErrDiff(actual, expected, operator) {\n var other = '';\n var res = '';\n var lastPos = 0;\n var end = '';\n var skipped = false;\n var actualInspected = inspectValue(actual);\n var actualLines = actualInspected.split('\\n');\n var expectedLines = inspectValue(expected).split('\\n');\n var i = 0;\n var indicator = '';\n\n // In case both values are objects explicitly mark them as not reference equal\n // for the `strictEqual` operator.\n if (operator === 'strictEqual' && _typeof(actual) === 'object' && _typeof(expected) === 'object' && actual !== null && expected !== null) {\n operator = 'strictEqualObject';\n }\n\n // If \"actual\" and \"expected\" fit on a single line and they are not strictly\n // equal, check further special handling.\n if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n // If the character length of \"actual\" and \"expected\" together is less than\n // kMaxShortLength and if neither is an object and at least one of them is\n // not `zero`, use the strict equal comparison to visualize the output.\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== 'object' || actual === null) && (_typeof(expected) !== 'object' || expected === null) && (actual !== 0 || expected !== 0)) {\n // -0 === +0\n return \"\".concat(kReadableOperator[operator], \"\\n\\n\") + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], \"\\n\");\n }\n } else if (operator !== 'strictEqualObject') {\n // If the stderr is a tty and the input length is lower than the current\n // columns per line, add a mismatch indicator below the output. If it is\n // not a tty, use a default value of 80 characters.\n var maxLength = process.stderr && process.stderr.isTTY ? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n while (actualLines[0][i] === expectedLines[0][i]) {\n i++;\n }\n // Ignore the first characters.\n if (i > 2) {\n // Add position indicator for the first mismatch in case it is a\n // single line and the input length is less than the column length.\n indicator = \"\\n \".concat(repeat(' ', i), \"^\");\n i = 0;\n }\n }\n }\n }\n\n // Remove all ending lines that match (this optimizes the output for\n // readability by reducing the number of total changed lines).\n var a = actualLines[actualLines.length - 1];\n var b = expectedLines[expectedLines.length - 1];\n while (a === b) {\n if (i++ < 2) {\n end = \"\\n \".concat(a).concat(end);\n } else {\n other = a;\n }\n actualLines.pop();\n expectedLines.pop();\n if (actualLines.length === 0 || expectedLines.length === 0) break;\n a = actualLines[actualLines.length - 1];\n b = expectedLines[expectedLines.length - 1];\n }\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n // Strict equal with identical objects that are not identical by reference.\n // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() })\n if (maxLines === 0) {\n // We have to get the result again. The lines were all removed before.\n var _actualLines = actualInspected.split('\\n');\n\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (_actualLines.length > 30) {\n _actualLines[26] = \"\".concat(blue, \"...\").concat(white);\n while (_actualLines.length > 27) {\n _actualLines.pop();\n }\n }\n return \"\".concat(kReadableOperator.notIdentical, \"\\n\\n\").concat(_actualLines.join('\\n'), \"\\n\");\n }\n if (i > 3) {\n end = \"\\n\".concat(blue, \"...\").concat(white).concat(end);\n skipped = true;\n }\n if (other !== '') {\n end = \"\\n \".concat(other).concat(end);\n other = '';\n }\n var printedLines = 0;\n var msg = kReadableOperator[operator] + \"\\n\".concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white);\n var skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0; i < maxLines; i++) {\n // Only extra expected lines exist\n var cur = i - lastPos;\n if (actualLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(expectedLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(expectedLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the expected line to the cache.\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]);\n printedLines++;\n // Only extra actual lines exist\n } else if (expectedLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result.\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLines[i]);\n printedLines++;\n // Lines diverge\n } else {\n var expectedLine = expectedLines[i];\n var actualLine = actualLines[i];\n // If the lines diverge, specifically check for lines that only diverge by\n // a trailing comma. In that case it is actually identical and we should\n // mark it as such.\n var divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, ',') || actualLine.slice(0, -1) !== expectedLine);\n // If the expected line has a trailing comma but is otherwise identical,\n // add a comma at the end of the actual line. Otherwise the output could\n // look weird as in:\n //\n // [\n // 1 // No comma at the end!\n // + 2\n // ]\n //\n if (divergingLines && endsWith(expectedLine, ',') && expectedLine.slice(0, -1) === actualLine) {\n divergingLines = false;\n actualLine += ',';\n }\n if (divergingLines) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result and cache the expected diverging\n // line so consecutive diverging lines show up as +++--- and not +-+-+-.\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLine);\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLine);\n printedLines += 2;\n // Lines are identical\n } else {\n // Add all cached information to the result before adding other things\n // and reset the cache.\n res += other;\n other = '';\n // If the last diverging line is exactly one line above or if it is the\n // very first line, add the line to the result.\n if (cur === 1 || i === 0) {\n res += \"\\n \".concat(actualLine);\n printedLines++;\n }\n }\n }\n // Inspected object to big (Show ~20 rows max)\n if (printedLines > 20 && i < maxLines - 2) {\n return \"\".concat(msg).concat(skippedMsg, \"\\n\").concat(res, \"\\n\").concat(blue, \"...\").concat(white).concat(other, \"\\n\") + \"\".concat(blue, \"...\").concat(white);\n }\n }\n return \"\".concat(msg).concat(skipped ? skippedMsg : '', \"\\n\").concat(res).concat(other).concat(end).concat(indicator);\n}\nvar AssertionError = /*#__PURE__*/function (_Error, _inspect$custom) {\n _inherits(AssertionError, _Error);\n var _super = _createSuper(AssertionError);\n function AssertionError(options) {\n var _this;\n _classCallCheck(this, AssertionError);\n if (_typeof(options) !== 'object' || options === null) {\n throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);\n }\n var message = options.message,\n operator = options.operator,\n stackStartFn = options.stackStartFn;\n var actual = options.actual,\n expected = options.expected;\n var limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n if (message != null) {\n _this = _super.call(this, String(message));\n } else {\n if (process.stderr && process.stderr.isTTY) {\n // Reset on each call to make sure we handle dynamically set environment\n // variables correct.\n if (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1) {\n blue = \"\\x1B[34m\";\n green = \"\\x1B[32m\";\n white = \"\\x1B[39m\";\n red = \"\\x1B[31m\";\n } else {\n blue = '';\n green = '';\n white = '';\n red = '';\n }\n }\n // Prevent the error stack from being visible by duplicating the error\n // in a very close way to the original in case both sides are actually\n // instances of Error.\n if (_typeof(actual) === 'object' && actual !== null && _typeof(expected) === 'object' && expected !== null && 'stack' in actual && actual instanceof Error && 'stack' in expected && expected instanceof Error) {\n actual = copyError(actual);\n expected = copyError(expected);\n }\n if (operator === 'deepStrictEqual' || operator === 'strictEqual') {\n _this = _super.call(this, createErrDiff(actual, expected, operator));\n } else if (operator === 'notDeepStrictEqual' || operator === 'notStrictEqual') {\n // In case the objects are equal but the operator requires unequal, show\n // the first object and say A equals B\n var base = kReadableOperator[operator];\n var res = inspectValue(actual).split('\\n');\n\n // In case \"actual\" is an object, it should not be reference equal.\n if (operator === 'notStrictEqual' && _typeof(actual) === 'object' && actual !== null) {\n base = kReadableOperator.notStrictEqualObject;\n }\n\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (res.length > 30) {\n res[26] = \"\".concat(blue, \"...\").concat(white);\n while (res.length > 27) {\n res.pop();\n }\n }\n\n // Only print a single input.\n if (res.length === 1) {\n _this = _super.call(this, \"\".concat(base, \" \").concat(res[0]));\n } else {\n _this = _super.call(this, \"\".concat(base, \"\\n\\n\").concat(res.join('\\n'), \"\\n\"));\n }\n } else {\n var _res = inspectValue(actual);\n var other = '';\n var knownOperators = kReadableOperator[operator];\n if (operator === 'notDeepEqual' || operator === 'notEqual') {\n _res = \"\".concat(kReadableOperator[operator], \"\\n\\n\").concat(_res);\n if (_res.length > 1024) {\n _res = \"\".concat(_res.slice(0, 1021), \"...\");\n }\n } else {\n other = \"\".concat(inspectValue(expected));\n if (_res.length > 512) {\n _res = \"\".concat(_res.slice(0, 509), \"...\");\n }\n if (other.length > 512) {\n other = \"\".concat(other.slice(0, 509), \"...\");\n }\n if (operator === 'deepEqual' || operator === 'equal') {\n _res = \"\".concat(knownOperators, \"\\n\\n\").concat(_res, \"\\n\\nshould equal\\n\\n\");\n } else {\n other = \" \".concat(operator, \" \").concat(other);\n }\n }\n _this = _super.call(this, \"\".concat(_res).concat(other));\n }\n }\n Error.stackTraceLimit = limit;\n _this.generatedMessage = !message;\n Object.defineProperty(_assertThisInitialized(_this), 'name', {\n value: 'AssertionError [ERR_ASSERTION]',\n enumerable: false,\n writable: true,\n configurable: true\n });\n _this.code = 'ERR_ASSERTION';\n _this.actual = actual;\n _this.expected = expected;\n _this.operator = operator;\n if (Error.captureStackTrace) {\n // eslint-disable-next-line no-restricted-syntax\n Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn);\n }\n // Create error message including the error code in the name.\n _this.stack;\n // Reset the name.\n _this.name = 'AssertionError';\n return _possibleConstructorReturn(_this);\n }\n _createClass(AssertionError, [{\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n }, {\n key: _inspect$custom,\n value: function value(recurseTimes, ctx) {\n // This limits the `actual` and `expected` property default inspection to\n // the minimum depth. Otherwise those values would be too verbose compared\n // to the actual error message which contains a combined view of these two\n // input values.\n return inspect(this, _objectSpread(_objectSpread({}, ctx), {}, {\n customInspect: false,\n depth: 0\n }));\n }\n }]);\n return AssertionError;\n}( /*#__PURE__*/_wrapNativeSuper(Error), inspect.custom);\nmodule.exports = AssertionError;","'use strict';\n\nvar implementation = require('./implementation');\n\nvar lacksProperEnumerationOrder = function () {\n\tif (!Object.assign) {\n\t\treturn false;\n\t}\n\t/*\n\t * v8, specifically in node 4.x, has a bug with incorrect property enumeration order\n\t * note: this does not detect the bug unless there's 20 characters\n\t */\n\tvar str = 'abcdefghijklmnopqrst';\n\tvar letters = str.split('');\n\tvar map = {};\n\tfor (var i = 0; i < letters.length; ++i) {\n\t\tmap[letters[i]] = letters[i];\n\t}\n\tvar obj = Object.assign({}, map);\n\tvar actual = '';\n\tfor (var k in obj) {\n\t\tactual += k;\n\t}\n\treturn str !== actual;\n};\n\nvar assignHasPendingExceptions = function () {\n\tif (!Object.assign || !Object.preventExtensions) {\n\t\treturn false;\n\t}\n\t/*\n\t * Firefox 37 still has \"pending exception\" logic in its Object.assign implementation,\n\t * which is 72% slower than our shim, and Firefox 40's native implementation.\n\t */\n\tvar thrower = Object.preventExtensions({ 1: 2 });\n\ttry {\n\t\tObject.assign(thrower, 'xy');\n\t} catch (e) {\n\t\treturn thrower[1] === 'y';\n\t}\n\treturn false;\n};\n\nmodule.exports = function getPolyfill() {\n\tif (!Object.assign) {\n\t\treturn implementation;\n\t}\n\tif (lacksProperEnumerationOrder()) {\n\t\treturn implementation;\n\t}\n\tif (assignHasPendingExceptions()) {\n\t\treturn implementation;\n\t}\n\treturn Object.assign;\n};\n","'use strict';\n\n// modified from https://github.com/es-shims/es6-shim\nvar objectKeys = require('object-keys');\nvar hasSymbols = require('has-symbols/shams')();\nvar callBound = require('call-bind/callBound');\nvar toObject = Object;\nvar $push = callBound('Array.prototype.push');\nvar $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');\nvar originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;\n\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function assign(target, source1) {\n\tif (target == null) { throw new TypeError('target must be an object'); }\n\tvar to = toObject(target); // step 1\n\tif (arguments.length === 1) {\n\t\treturn to; // step 2\n\t}\n\tfor (var s = 1; s < arguments.length; ++s) {\n\t\tvar from = toObject(arguments[s]); // step 3.a.i\n\n\t\t// step 3.a.ii:\n\t\tvar keys = objectKeys(from);\n\t\tvar getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);\n\t\tif (getSymbols) {\n\t\t\tvar syms = getSymbols(from);\n\t\t\tfor (var j = 0; j < syms.length; ++j) {\n\t\t\t\tvar key = syms[j];\n\t\t\t\tif ($propIsEnumerable(from, key)) {\n\t\t\t\t\t$push(keys, key);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// step 3.a.iii:\n\t\tfor (var i = 0; i < keys.length; ++i) {\n\t\t\tvar nextKey = keys[i];\n\t\t\tif ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2\n\t\t\t\tvar propValue = from[nextKey]; // step 3.a.iii.2.a\n\t\t\t\tto[nextKey] = propValue; // step 3.a.iii.2.b\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to; // step 4\n};\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\treturn typeof Object.is === 'function' ? Object.is : implementation;\n};\n","'use strict';\n\nvar numberIsNaN = function (value) {\n\treturn value !== value;\n};\n\nmodule.exports = function is(a, b) {\n\tif (a === 0 && b === 0) {\n\t\treturn 1 / a === 1 / b;\n\t}\n\tif (a === b) {\n\t\treturn true;\n\t}\n\tif (numberIsNaN(a) && numberIsNaN(b)) {\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n","// Currently in sync with Node.js lib/internal/util/comparisons.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\n'use strict';\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar regexFlagsSupported = /a/g.flags !== undefined;\nvar arrayFromSet = function arrayFromSet(set) {\n var array = [];\n set.forEach(function (value) {\n return array.push(value);\n });\n return array;\n};\nvar arrayFromMap = function arrayFromMap(map) {\n var array = [];\n map.forEach(function (value, key) {\n return array.push([key, value]);\n });\n return array;\n};\nvar objectIs = Object.is ? Object.is : require('object-is');\nvar objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function () {\n return [];\n};\nvar numberIsNaN = Number.isNaN ? Number.isNaN : require('is-nan');\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\nvar hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);\nvar propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable);\nvar objectToString = uncurryThis(Object.prototype.toString);\nvar _require$types = require('util/').types,\n isAnyArrayBuffer = _require$types.isAnyArrayBuffer,\n isArrayBufferView = _require$types.isArrayBufferView,\n isDate = _require$types.isDate,\n isMap = _require$types.isMap,\n isRegExp = _require$types.isRegExp,\n isSet = _require$types.isSet,\n isNativeError = _require$types.isNativeError,\n isBoxedPrimitive = _require$types.isBoxedPrimitive,\n isNumberObject = _require$types.isNumberObject,\n isStringObject = _require$types.isStringObject,\n isBooleanObject = _require$types.isBooleanObject,\n isBigIntObject = _require$types.isBigIntObject,\n isSymbolObject = _require$types.isSymbolObject,\n isFloat32Array = _require$types.isFloat32Array,\n isFloat64Array = _require$types.isFloat64Array;\nfunction isNonIndex(key) {\n if (key.length === 0 || key.length > 10) return true;\n for (var i = 0; i < key.length; i++) {\n var code = key.charCodeAt(i);\n if (code < 48 || code > 57) return true;\n }\n // The maximum size for an array is 2 ** 32 -1.\n return key.length === 10 && key >= Math.pow(2, 32);\n}\nfunction getOwnNonIndexProperties(value) {\n return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));\n}\n\n// Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n var x = a.length;\n var y = b.length;\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}\nvar ONLY_ENUMERABLE = undefined;\nvar kStrict = true;\nvar kLoose = false;\nvar kNoIterator = 0;\nvar kIsArray = 1;\nvar kIsSet = 2;\nvar kIsMap = 3;\n\n// Check if they have the same source and flags\nfunction areSimilarRegExps(a, b) {\n return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);\n}\nfunction areSimilarFloatArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n for (var offset = 0; offset < a.byteLength; offset++) {\n if (a[offset] !== b[offset]) {\n return false;\n }\n }\n return true;\n}\nfunction areSimilarTypedArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n return compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;\n}\nfunction areEqualArrayBuffers(buf1, buf2) {\n return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;\n}\nfunction isEqualBoxedPrimitive(val1, val2) {\n if (isNumberObject(val1)) {\n return isNumberObject(val2) && objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));\n }\n if (isStringObject(val1)) {\n return isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);\n }\n if (isBooleanObject(val1)) {\n return isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);\n }\n if (isBigIntObject(val1)) {\n return isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);\n }\n return isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);\n}\n\n// Notes: Type tags are historical [[Class]] properties that can be set by\n// FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS\n// and retrieved using Object.prototype.toString.call(obj) in JS\n// See https://tc39.github.io/ecma262/#sec-object.prototype.tostring\n// for a list of tags pre-defined in the spec.\n// There are some unspecified tags in the wild too (e.g. typed array tags).\n// Since tags can be altered, they only serve fast failures\n//\n// Typed arrays and buffers are checked by comparing the content in their\n// underlying ArrayBuffer. This optimization requires that it's\n// reasonable to interpret their underlying memory in the same way,\n// which is checked by comparing their type tags.\n// (e.g. a Uint8Array and a Uint16Array with the same memory content\n// could still be different because they will be interpreted differently).\n//\n// For strict comparison, objects should have\n// a) The same built-in type tags\n// b) The same prototypes.\n\nfunction innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? objectIs(val1, val2) : true;\n }\n\n // Check more closely if val1 and val2 are equal.\n if (strict) {\n if (_typeof(val1) !== 'object') {\n return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2);\n }\n if (_typeof(val2) !== 'object' || val1 === null || val2 === null) {\n return false;\n }\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) {\n return false;\n }\n } else {\n if (val1 === null || _typeof(val1) !== 'object') {\n if (val2 === null || _typeof(val2) !== 'object') {\n // eslint-disable-next-line eqeqeq\n return val1 == val2;\n }\n return false;\n }\n if (val2 === null || _typeof(val2) !== 'object') {\n return false;\n }\n }\n var val1Tag = objectToString(val1);\n var val2Tag = objectToString(val2);\n if (val1Tag !== val2Tag) {\n return false;\n }\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) {\n return false;\n }\n var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n if (keys1.length !== keys2.length) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kIsArray, keys1);\n }\n // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n if (val1Tag === '[object Object]') {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) {\n return false;\n }\n }\n if (isDate(val1)) {\n if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) {\n return false;\n }\n } else if (isRegExp(val1)) {\n if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) {\n return false;\n }\n } else if (isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) {\n return false;\n }\n } else if (isArrayBufferView(val1)) {\n if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {\n if (!areSimilarFloatArrays(val1, val2)) {\n return false;\n }\n } else if (!areSimilarTypedArrays(val1, val2)) {\n return false;\n }\n // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n if (_keys.length !== _keys2.length) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);\n } else if (isSet(val1)) {\n if (!isSet(val2) || val1.size !== val2.size) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kIsSet);\n } else if (isMap(val1)) {\n if (!isMap(val2) || val1.size !== val2.size) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kIsMap);\n } else if (isAnyArrayBuffer(val1)) {\n if (!areEqualArrayBuffers(val1, val2)) {\n return false;\n }\n } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kNoIterator);\n}\nfunction getEnumerables(val, keys) {\n return keys.filter(function (k) {\n return propertyIsEnumerable(val, k);\n });\n}\nfunction keyCheck(val1, val2, strict, memos, iterationType, aKeys) {\n // For all remaining Object pairs, including Array, objects and Maps,\n // equivalence is determined by having:\n // a) The same number of owned enumerable properties\n // b) The same set of keys/indexes (although not necessarily the same order)\n // c) Equivalent values for every corresponding key/index\n // d) For Sets and Maps, equal contents\n // Note: this accounts for both named and indexed properties on Arrays.\n if (arguments.length === 5) {\n aKeys = Object.keys(val1);\n var bKeys = Object.keys(val2);\n\n // The pair must have the same number of owned properties.\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n }\n\n // Cheap key test\n var i = 0;\n for (; i < aKeys.length; i++) {\n if (!hasOwnProperty(val2, aKeys[i])) {\n return false;\n }\n }\n if (strict && arguments.length === 5) {\n var symbolKeysA = objectGetOwnPropertySymbols(val1);\n if (symbolKeysA.length !== 0) {\n var count = 0;\n for (i = 0; i < symbolKeysA.length; i++) {\n var key = symbolKeysA[i];\n if (propertyIsEnumerable(val1, key)) {\n if (!propertyIsEnumerable(val2, key)) {\n return false;\n }\n aKeys.push(key);\n count++;\n } else if (propertyIsEnumerable(val2, key)) {\n return false;\n }\n }\n var symbolKeysB = objectGetOwnPropertySymbols(val2);\n if (symbolKeysA.length !== symbolKeysB.length && getEnumerables(val2, symbolKeysB).length !== count) {\n return false;\n }\n } else {\n var _symbolKeysB = objectGetOwnPropertySymbols(val2);\n if (_symbolKeysB.length !== 0 && getEnumerables(val2, _symbolKeysB).length !== 0) {\n return false;\n }\n }\n }\n if (aKeys.length === 0 && (iterationType === kNoIterator || iterationType === kIsArray && val1.length === 0 || val1.size === 0)) {\n return true;\n }\n\n // Use memos to handle cycles.\n if (memos === undefined) {\n memos = {\n val1: new Map(),\n val2: new Map(),\n position: 0\n };\n } else {\n // We prevent up to two map.has(x) calls by directly retrieving the value\n // and checking for undefined. The map can only contain numbers, so it is\n // safe to check for undefined only.\n var val2MemoA = memos.val1.get(val1);\n if (val2MemoA !== undefined) {\n var val2MemoB = memos.val2.get(val2);\n if (val2MemoB !== undefined) {\n return val2MemoA === val2MemoB;\n }\n }\n memos.position++;\n }\n memos.val1.set(val1, memos.position);\n memos.val2.set(val2, memos.position);\n var areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType);\n memos.val1.delete(val1);\n memos.val2.delete(val2);\n return areEq;\n}\nfunction setHasEqualElement(set, val1, strict, memo) {\n // Go looking.\n var setValues = arrayFromSet(set);\n for (var i = 0; i < setValues.length; i++) {\n var val2 = setValues[i];\n if (innerDeepEqual(val1, val2, strict, memo)) {\n // Remove the matching element to make sure we do not check that again.\n set.delete(val2);\n return true;\n }\n }\n return false;\n}\n\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using\n// Sadly it is not possible to detect corresponding values properly in case the\n// type is a string, number, bigint or boolean. The reason is that those values\n// can match lots of different string values (e.g., 1n == '+00001').\nfunction findLooseMatchingPrimitives(prim) {\n switch (_typeof(prim)) {\n case 'undefined':\n return null;\n case 'object':\n // Only pass in null as object!\n return undefined;\n case 'symbol':\n return false;\n case 'string':\n prim = +prim;\n // Loose equal entries exist only if the string is possible to convert to\n // a regular number and not NaN.\n // Fall through\n case 'number':\n if (numberIsNaN(prim)) {\n return false;\n }\n }\n return true;\n}\nfunction setMightHaveLoosePrim(a, b, prim) {\n var altValue = findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n return b.has(altValue) && !a.has(altValue);\n}\nfunction mapMightHaveLoosePrim(a, b, prim, item, memo) {\n var altValue = findLooseMatchingPrimitives(prim);\n if (altValue != null) {\n return altValue;\n }\n var curB = b.get(altValue);\n if (curB === undefined && !b.has(altValue) || !innerDeepEqual(item, curB, false, memo)) {\n return false;\n }\n return !a.has(altValue) && innerDeepEqual(item, curB, false, memo);\n}\nfunction setEquiv(a, b, strict, memo) {\n // This is a lazily initiated Set of entries which have to be compared\n // pairwise.\n var set = null;\n var aValues = arrayFromSet(a);\n for (var i = 0; i < aValues.length; i++) {\n var val = aValues[i];\n // Note: Checking for the objects first improves the performance for object\n // heavy sets but it is a minor slow down for primitives. As they are fast\n // to check this improves the worst case scenario instead.\n if (_typeof(val) === 'object' && val !== null) {\n if (set === null) {\n set = new Set();\n }\n // If the specified value doesn't exist in the second set its an not null\n // object (or non strict only: a not matching primitive) we'll need to go\n // hunting for something thats deep-(strict-)equal to it. To make this\n // O(n log n) complexity we have to copy these values in a new set first.\n set.add(val);\n } else if (!b.has(val)) {\n if (strict) return false;\n\n // Fast path to detect missing string, symbol, undefined and null values.\n if (!setMightHaveLoosePrim(a, b, val)) {\n return false;\n }\n if (set === null) {\n set = new Set();\n }\n set.add(val);\n }\n }\n if (set !== null) {\n var bValues = arrayFromSet(b);\n for (var _i = 0; _i < bValues.length; _i++) {\n var _val = bValues[_i];\n // We have to check if a primitive value is already\n // matching and only if it's not, go hunting for it.\n if (_typeof(_val) === 'object' && _val !== null) {\n if (!setHasEqualElement(set, _val, strict, memo)) return false;\n } else if (!strict && !a.has(_val) && !setHasEqualElement(set, _val, strict, memo)) {\n return false;\n }\n }\n return set.size === 0;\n }\n return true;\n}\nfunction mapHasEqualEntry(set, map, key1, item1, strict, memo) {\n // To be able to handle cases like:\n // Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']])\n // ... we need to consider *all* matching keys, not just the first we find.\n var setValues = arrayFromSet(set);\n for (var i = 0; i < setValues.length; i++) {\n var key2 = setValues[i];\n if (innerDeepEqual(key1, key2, strict, memo) && innerDeepEqual(item1, map.get(key2), strict, memo)) {\n set.delete(key2);\n return true;\n }\n }\n return false;\n}\nfunction mapEquiv(a, b, strict, memo) {\n var set = null;\n var aEntries = arrayFromMap(a);\n for (var i = 0; i < aEntries.length; i++) {\n var _aEntries$i = _slicedToArray(aEntries[i], 2),\n key = _aEntries$i[0],\n item1 = _aEntries$i[1];\n if (_typeof(key) === 'object' && key !== null) {\n if (set === null) {\n set = new Set();\n }\n set.add(key);\n } else {\n // By directly retrieving the value we prevent another b.has(key) check in\n // almost all possible cases.\n var item2 = b.get(key);\n if (item2 === undefined && !b.has(key) || !innerDeepEqual(item1, item2, strict, memo)) {\n if (strict) return false;\n // Fast path to detect missing string, symbol, undefined and null\n // keys.\n if (!mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;\n if (set === null) {\n set = new Set();\n }\n set.add(key);\n }\n }\n }\n if (set !== null) {\n var bEntries = arrayFromMap(b);\n for (var _i2 = 0; _i2 < bEntries.length; _i2++) {\n var _bEntries$_i = _slicedToArray(bEntries[_i2], 2),\n _key = _bEntries$_i[0],\n item = _bEntries$_i[1];\n if (_typeof(_key) === 'object' && _key !== null) {\n if (!mapHasEqualEntry(set, a, _key, item, strict, memo)) return false;\n } else if (!strict && (!a.has(_key) || !innerDeepEqual(a.get(_key), item, false, memo)) && !mapHasEqualEntry(set, a, _key, item, false, memo)) {\n return false;\n }\n }\n return set.size === 0;\n }\n return true;\n}\nfunction objEquiv(a, b, strict, keys, memos, iterationType) {\n // Sets and maps don't have their entries accessible via normal object\n // properties.\n var i = 0;\n if (iterationType === kIsSet) {\n if (!setEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsMap) {\n if (!mapEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsArray) {\n for (; i < a.length; i++) {\n if (hasOwnProperty(a, i)) {\n if (!hasOwnProperty(b, i) || !innerDeepEqual(a[i], b[i], strict, memos)) {\n return false;\n }\n } else if (hasOwnProperty(b, i)) {\n return false;\n } else {\n // Array is sparse.\n var keysA = Object.keys(a);\n for (; i < keysA.length; i++) {\n var key = keysA[i];\n if (!hasOwnProperty(b, key) || !innerDeepEqual(a[key], b[key], strict, memos)) {\n return false;\n }\n }\n if (keysA.length !== Object.keys(b).length) {\n return false;\n }\n return true;\n }\n }\n }\n\n // The pair must have equivalent values for every corresponding key.\n // Possibly expensive deep test:\n for (i = 0; i < keys.length; i++) {\n var _key2 = keys[i];\n if (!innerDeepEqual(a[_key2], b[_key2], strict, memos)) {\n return false;\n }\n }\n return true;\n}\nfunction isDeepEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kLoose);\n}\nfunction isDeepStrictEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kStrict);\n}\nmodule.exports = {\n isDeepEqual: isDeepEqual,\n isDeepStrictEqual: isDeepStrictEqual\n};","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Object);\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar defineDataProperty = require('define-data-property');\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar supportsDescriptors = require('has-property-descriptors')();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object) {\n\t\tif (predicate === true) {\n\t\t\tif (object[name] === value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (!isFunction(predicate) || !predicate()) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (supportsDescriptors) {\n\t\tdefineDataProperty(object, name, value, true);\n\t} else {\n\t\tdefineDataProperty(object, name, value);\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","'use strict';\n\nvar getPolyfill = require('./polyfill');\nvar define = require('define-properties');\n\nmodule.exports = function shimObjectIs() {\n\tvar polyfill = getPolyfill();\n\tdefine(Object, { is: polyfill }, {\n\t\tis: function testObjectIs() {\n\t\t\treturn Object.is !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Number);\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\nmodule.exports = function isNaN(value) {\n\treturn value !== value;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) {\n\t\treturn Number.isNaN;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\nmodule.exports = function shimNumberIsNaN() {\n\tvar polyfill = getPolyfill();\n\tdefine(Number, { isNaN: polyfill }, {\n\t\tisNaN: function testIsNaN() {\n\t\t\treturn Number.isNaN !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","import { strict as assert } from 'assert';\nimport Chart from 'chart.js/auto';\nimport Sortable from 'sortablejs';\n\nimport { animationFrame } from './util/animation-frame';\nimport type {\n StockIds,\n FlowIds,\n VariableIds,\n ParameterIds,\n} from './circular-economy-model';\nimport CircularEconomyModel, {\n Parameters,\n Record,\n} from './circular-economy-model';\nimport ModelSimulator from './model-simulator';\nimport Visualization from './visualization';\nimport { documentReady } from './util/document-ready';\nimport { guardedQuerySelector } from './util/guarded-query-selectors';\nimport ScriptedParameterTransform from './parameter-transform/scripted-parameter-transform';\n\ntype CircularEconomyModelSimulator = ModelSimulator<\n StockIds,\n FlowIds,\n VariableIds,\n ParameterIds\n>;\n\ntype ScriptCircularEconomyParameterTransform =\n ScriptedParameterTransform;\n\ntype CircularEconomyApi = {\n model: CircularEconomyModel;\n modelSimulator: CircularEconomyModelSimulator;\n parameterTransforms: {\n create: (id: string, script: string) => void;\n destroy: (id: string) => void;\n };\n};\n\nasync function init(): Promise {\n const model = new CircularEconomyModel();\n const modelSimulator = new ModelSimulator(\n model,\n // FIXME: It should be possible to pass CircularEconomyModel.initialStocks directly, but TypeScript does not complain.\n { ...CircularEconomyModel.initialStocks },\n // FIXME: It should be possible to pass CircularEconomyModel.defaultParameters directly, but TypeScript does not complain.\n { ...CircularEconomyModel.defaultParameters },\n 0.0,\n 0.01,\n );\n\n const availableParameterTransformsContainer = guardedQuerySelector(\n document,\n '#parameter-transforms .available',\n HTMLElement,\n );\n const activeParameterTransformsContainer = guardedQuerySelector(\n document,\n '#parameter-transforms .active',\n HTMLElement,\n );\n\n const availableParameterTransforms = new Map<\n string,\n ScriptCircularEconomyParameterTransform\n >();\n\n function getDistinctParameters(\n p1: Parameters,\n p2: Parameters,\n ): Partial {\n const result: Partial = {};\n model.parameterIds.forEach((id) => {\n if (p1[id] !== p2[id]) {\n result[id] = p2[id];\n }\n });\n return result;\n }\n\n function updateParameters() {\n const parameters = { ...CircularEconomyModel.defaultParameters };\n [...activeParameterTransformsContainer.children].forEach((e) => {\n assert(e instanceof HTMLElement);\n const id = e.getAttribute('data-id');\n assert(id !== null);\n const parameterTransform = availableParameterTransforms.get(id);\n assert(parameterTransform !== undefined);\n const backupParameters = { ...parameters };\n parameterTransform.applyTo(parameters);\n const distinctParameters = getDistinctParameters(\n backupParameters,\n parameters,\n );\n e.title = `${parameterTransform.script}\\n\\n${JSON.stringify(\n distinctParameters,\n null,\n 2,\n )}\\n\\n${JSON.stringify(parameters, null, 2)}`;\n });\n Object.assign(modelSimulator.parameters, parameters);\n }\n\n Sortable.create(availableParameterTransformsContainer, {\n group: {\n name: 'sharedParameterTransforms',\n pull: 'clone',\n put: false, // Do not allow items to be put into this list\n },\n });\n Sortable.create(activeParameterTransformsContainer, {\n group: { name: 'sharedParameterTransforms' },\n removeOnSpill: true,\n onSort: () => updateParameters(),\n onSpill: (event) => {\n event.item.remove();\n updateParameters();\n },\n });\n const parameterTransforms = {\n create: (id: string, script: string) => {\n if (availableParameterTransforms.has(id))\n throw new Error(`Parameter transform with id '${id}' already exists`);\n availableParameterTransforms.set(\n id,\n new ScriptedParameterTransform(\n 'none',\n model.parameterIds,\n script,\n ),\n );\n const dummyElement = document.createElement('div');\n dummyElement.innerHTML = `
${id}
`;\n const parameterTransformElement = dummyElement.firstChild;\n assert(parameterTransformElement !== null);\n availableParameterTransformsContainer.append(parameterTransformElement);\n },\n destroy: (id: string) => {\n availableParameterTransforms.delete(id);\n },\n };\n\n guardedQuerySelector(\n document,\n '#add-parameter-transform',\n HTMLElement,\n ).addEventListener('click', () => {\n const idElement = guardedQuerySelector(\n document,\n '#parameter-transform-id',\n HTMLInputElement,\n );\n const id = idElement.value;\n const scriptElement = guardedQuerySelector(\n document,\n '#parameter-transform-script',\n HTMLTextAreaElement,\n );\n const script = scriptElement.value;\n parameterTransforms.create(id, script);\n });\n\n let circularityIndex = 0;\n const circularityIndexElement = guardedQuerySelector(\n document,\n '#circularity-index',\n HTMLElement,\n );\n\n let userSatisfaction = 0;\n const userSatisfactionElement = guardedQuerySelector(\n document,\n '#user-satisfaction',\n HTMLElement,\n );\n\n const visualization = await Visualization.create(model);\n document.body.prepend(visualization.element);\n\n function toChartRecord(record: Record) {\n return CircularEconomyModel.elementIds\n .map((key) =>\n Object.entries(record[key]).map(([id, value]) => ({ id, value })),\n )\n .reduce((cur, acc) => [...cur, ...acc], []);\n }\n\n const initialChartRecord = toChartRecord(modelSimulator.record);\n\n const chartCanvas = document.getElementById('chart') as HTMLCanvasElement;\n assert(chartCanvas !== null, 'chart element not found');\n const chart = new Chart(chartCanvas, {\n type: 'bar',\n data: {\n labels: initialChartRecord.map((row) => row.id),\n datasets: [\n {\n label: 'Values',\n data: initialChartRecord.map((row) => row.value),\n },\n ],\n },\n options: { animation: false },\n });\n\n function updateIndices(record: Record) {\n const smoothingFactor = 0.5;\n\n const { phonesInUse } = record.stocks;\n const {\n produceFromNaturalResources,\n acquireNewlyProduced,\n acquireUsed,\n acquireRepaired,\n acquireRefurbished,\n disposeHibernating,\n disposeBroken,\n landfill,\n } = record.flows;\n const { phoneGoal } = record.variables;\n\n const naturalResourcesShare = Math.min(\n 1.0,\n produceFromNaturalResources /\n (acquireNewlyProduced +\n acquireUsed +\n acquireRepaired +\n acquireRefurbished),\n );\n const landfillShare = Math.min(\n 1.0,\n landfill / (disposeHibernating + disposeBroken),\n );\n const circularityIndexTarget = Math.min(\n 1.0 - naturalResourcesShare,\n 1.0 - landfillShare,\n );\n\n circularityIndex +=\n (circularityIndexTarget - circularityIndex) * smoothingFactor;\n circularityIndexElement.innerText = `${(circularityIndex * 100).toFixed(\n 2,\n )}%`;\n\n const userSatisfactionTarget =\n phonesInUse < phoneGoal\n ? phonesInUse / phoneGoal\n : phoneGoal / phonesInUse;\n userSatisfaction +=\n (userSatisfactionTarget - userSatisfaction) * smoothingFactor;\n userSatisfactionElement.innerText = `${(userSatisfaction * 100).toFixed(\n 2,\n )}%`;\n }\n\n function stepSimulation(deltaMs: number) {\n // TODO: pass deltaMs to modelSimulator.step()\n const record = modelSimulator.step();\n\n updateIndices(record);\n\n const chartRecord = toChartRecord(record);\n // console.log(chartRecord);\n chart.data.datasets[0].data = chartRecord.map((row) => row.value);\n\n chart.update();\n\n visualization.update(deltaMs, record);\n }\n\n let running = false;\n const runCheckBox = document.getElementById('run') as HTMLInputElement;\n assert(runCheckBox !== null, 'run checkbox not found');\n\n async function loopSimulation() {\n running = true;\n let lastTimeMs: DOMHighResTimeStamp | null = null;\n\n while (runCheckBox.checked) {\n // eslint-disable-next-line no-await-in-loop\n const currentTimeMs = await animationFrame();\n const deltaMs = lastTimeMs === null ? 0 : currentTimeMs - lastTimeMs;\n stepSimulation(deltaMs);\n lastTimeMs = currentTimeMs;\n }\n running = false;\n }\n\n runCheckBox.addEventListener('input', () => {\n if (!running)\n loopSimulation().catch((err) => {\n throw err;\n });\n });\n\n stepSimulation(0);\n\n const circularEconomyApi: CircularEconomyApi = {\n model,\n modelSimulator,\n parameterTransforms,\n };\n\n return circularEconomyApi;\n}\n\ndeclare global {\n interface Window {\n circularEconomy: Promise;\n }\n}\n\nwindow.circularEconomy = documentReady().then(init);\n","import {Chart, registerables} from '../dist/chart.js';\n\nChart.register(...registerables);\n\nexport * from '../dist/chart.js';\nexport default Chart;\n","/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */\nimport { r as requestAnimFrame, a as resolve, e as effects, c as color, i as isObject, d as defaults, b as isArray, v as valueOrDefault, u as unlistenArrayEvents, l as listenArrayEvents, f as resolveObjectKey, g as isNumberFinite, h as defined, s as sign, j as createContext, k as isNullOrUndef, _ as _arrayUnique, t as toRadians, m as toPercentage, n as toDimension, T as TAU, o as formatNumber, p as _angleBetween, H as HALF_PI, P as PI, q as _getStartAndCountOfVisiblePoints, w as _scaleRangesChanged, x as isNumber, y as _parseObjectDataRadialScale, z as getRelativePosition, A as _rlookupByKey, B as _lookupByKey, C as _isPointInArea, D as getAngleFromPoint, E as toPadding, F as each, G as getMaximumSize, I as _getParentNode, J as readUsedSize, K as supportsEventListenerOptions, L as throttled, M as _isDomSupported, N as _factorize, O as finiteOrDefault, Q as callback, R as _addGrace, S as _limitValue, U as toDegrees, V as _measureText, W as _int16Range, X as _alignPixel, Y as clipArea, Z as renderText, $ as unclipArea, a0 as toFont, a1 as _toLeftRightCenter, a2 as _alignStartEnd, a3 as overrides, a4 as merge, a5 as _capitalize, a6 as descriptors, a7 as isFunction, a8 as _attachContext, a9 as _createResolver, aa as _descriptors, ab as mergeIf, ac as uid, ad as debounce, ae as retinaScale, af as clearCanvas, ag as setsEqual, ah as _elementsEqual, ai as _isClickEvent, aj as _isBetween, ak as _readValueToProps, al as _updateBezierControlPoints, am as _computeSegments, an as _boundSegments, ao as _steppedInterpolation, ap as _bezierInterpolation, aq as _pointInLine, ar as _steppedLineTo, as as _bezierCurveTo, at as drawPoint, au as addRoundedRectPath, av as toTRBL, aw as toTRBLCorners, ax as _boundSegment, ay as _normalizeAngle, az as getRtlAdapter, aA as overrideTextDirection, aB as _textX, aC as restoreTextDirection, aD as drawPointLegend, aE as distanceBetweenPoints, aF as noop, aG as _setMinAndMaxByKey, aH as niceNum, aI as almostWhole, aJ as almostEquals, aK as _decimalPlaces, aL as Ticks, aM as log10, aN as _longestText, aO as _filterBetween, aP as _lookup } from './chunks/helpers.segment.js';\nimport '@kurkle/color';\n\nclass Animator {\n constructor(){\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n callbacks.forEach((fn)=>fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n this._request = requestAnimFrame.call(window, ()=>{\n this._update();\n this._request = null;\n if (this._running) {\n this._refresh();\n }\n });\n }\n _update(date = Date.now()) {\n let remaining = 0;\n this._charts.forEach((anims, chart)=>{\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n for(; i >= 0; --i){\n item = items[i];\n if (item._active) {\n if (item._total > anims.duration) {\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n remaining += items.length;\n });\n this._lastDate = date;\n if (remaining === 0) {\n this._running = false;\n }\n }\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur)=>Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n for(; i >= 0; --i){\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\nvar animator = /* #__PURE__ */ new Animator();\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean (from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n color (from, to, factor) {\n const c0 = color(from || transparent);\n const c1 = c0.valid && color(to || transparent);\n return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to;\n },\n number (from, to, factor) {\n return from + (to - from) * factor;\n }\n};\nclass Animation {\n constructor(cfg, target, prop, to){\n const currentValue = target[prop];\n to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n const from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n active() {\n return this._active;\n }\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n this._from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n }\n }\n cancel() {\n if (this._active) {\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n this._active = from !== to && (loop || elapsed < duration);\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n factor = elapsed / duration % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n this._target[prop] = this._fn(from, to, factor);\n }\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej)=>{\n promises.push({\n res,\n rej\n });\n });\n }\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for(let i = 0; i < promises.length; i++){\n promises[i][method]();\n }\n }\n}\n\nclass Animations {\n constructor(chart, config){\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n Object.getOwnPropertyNames(config).forEach((key)=>{\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions){\n resolved[option] = cfg[option];\n }\n (isArray(cfg.properties) && cfg.properties || [\n key\n ]).forEach((prop)=>{\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n awaitAll(target.options.$animations, newOptions).then(()=>{\n target.options = newOptions;\n }, ()=>{\n });\n }\n return animations;\n }\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n for(i = props.length - 1; i >= 0; --i){\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n if (animation) {\n if (cfg && animation.active()) {\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n target[prop] = value;\n continue;\n }\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n update(target, values) {\n if (this._properties.size === 0) {\n Object.assign(target, values);\n return;\n }\n const animations = this._createAnimations(target, values);\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for(let i = 0; i < keys.length; i++){\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n return Promise.all(running);\n}\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n target.options = options = Object.assign({}, options, {\n $shared: false,\n $animations: {}\n });\n }\n return options;\n}\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\nfunction toClip(value) {\n let t, r, b, l;\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n keys.push(metasets[i].index);\n }\n return keys;\n}\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n if (value === null) {\n return;\n }\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isNumberFinite(otherValue) && (singleMode || value === 0 || sign(value) === sign(otherValue))) {\n value += otherValue;\n }\n }\n return value;\n}\nfunction convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || stacked === undefined && meta.stack !== undefined;\n}\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction getUserBounds(scale) {\n const { min , max , minDefined , maxDefined } = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()){\n const value = stack[meta.index];\n if (positive && value > 0 || !positive && value < 0) {\n return meta.index;\n }\n }\n return null;\n}\nfunction updateStacks(controller, parsed) {\n const { chart , _cachedMeta: meta } = controller;\n const stacks = chart._stacks || (chart._stacks = {});\n const { iScale , vScale , index: datasetIndex } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n for(let i = 0; i < ilen; ++i){\n const item = parsed[i];\n const { [iAxis]: index , [vAxis]: value } = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter((key)=>scales[key].axis === axis).shift();\n}\nfunction createDatasetContext(parent, index) {\n return createContext(parent, {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n });\n}\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\nfunction clearStacks(meta, items) {\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n items = items || meta._parsed;\n for (const parsed of items){\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n delete stacks[axis]._visualValues[datasetIndex];\n }\n }\n}\nconst isDirectUpdateMode = (mode)=>mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared)=>shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart)=>canStack && !meta.hidden && meta._stacked && {\n keys: getSortedDatasetIndices(chart, true),\n values: null\n };\nclass DatasetController {\n static defaults = {};\n static datasetElementType = null;\n static dataElementType = null;\n constructor(chart, datasetIndex){\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n this.initialize();\n }\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n 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\");\n }\n }\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n const chooseId = (axis, x, y, r)=>axis === 'x' ? x : axis === 'r' ? r : y;\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale ? meta.vScale : meta.iScale;\n }\n reset() {\n this._update('reset');\n }\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n if (isObject(data)) {\n this._data = convertObjectDataToArray(data);\n } else if (_data !== data) {\n if (_data) {\n unlistenArrayEvents(_data, this);\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n addElements() {\n const meta = this._cachedMeta;\n this._dataCheck();\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n this._dataCheck();\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n this._resyncElements(resetNewElements);\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n }\n }\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n parse(start, count) {\n const { _cachedMeta: meta , _data: data } = this;\n const { iScale , _stacked } = meta;\n const iAxis = iScale.axis;\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n const isNotInOrderComparedToPrev = ()=>cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];\n for(i = 0; i < count; ++i){\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n parsePrimitiveData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return applyStack(stack, value, meta.index, {\n mode\n });\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n const { min: otherMin , max: otherMax } = getUserBounds(otherScale);\n let i, parsed;\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n for(i = 0; i < ilen; ++i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n break;\n }\n }\n if (sorted) {\n for(i = ilen - 1; i >= 0; --i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n for(i = 0, ilen = parsed.length; i < ilen; ++i){\n value = parsed[i][scale.axis];\n if (isNumberFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n getMaxOverflow() {\n return false;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n update(mode) {}\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || elements.length - start;\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n for(i = start; i < start + count; ++i){\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n for(i = 0; i < active.length; ++i){\n active[i].draw(ctx, area);\n }\n }\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index || 0, mode);\n }\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context || (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [\n `${elementType}Hover`,\n 'hover',\n elementType,\n ''\n ] : [\n elementType,\n ''\n ];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n const context = ()=>this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n if (values.$shared) {\n values.$shared = sharing;\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n return values;\n }\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions;\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {\n sharedOptions,\n includeOptions\n };\n }\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n options: !active && this.getSharedOptions(options) || options\n });\n }\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n for (const [method, arg1, arg2] of this._syncList){\n this[method](arg1, arg2);\n }\n this._syncList = [];\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n if (count) {\n this.parse(0, count);\n }\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n const move = (arr)=>{\n arr.length += count;\n for(i = arr.length - 1; i >= end; i--){\n arr[i] = arr[i - count];\n }\n };\n move(data);\n for(i = start; i < end; ++i){\n data[i] = new this.dataElementType();\n }\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n updateElements(element, start, count, mode) {}\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([\n this.index,\n ...args\n ]);\n }\n _onDataPush() {\n const count = arguments.length;\n this._sync([\n '_insertElements',\n this.getDataset().data.length - count,\n count\n ]);\n }\n _onDataPop() {\n this._sync([\n '_removeElements',\n this._cachedMeta.data.length - 1,\n 1\n ]);\n }\n _onDataShift() {\n this._sync([\n '_removeElements',\n 0,\n 1\n ]);\n }\n _onDataSplice(start, count) {\n if (count) {\n this._sync([\n '_removeElements',\n start,\n count\n ]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync([\n '_insertElements',\n start,\n newCount\n ]);\n }\n }\n _onDataUnshift() {\n this._sync([\n '_insertElements',\n 0,\n arguments.length\n ]);\n }\n}\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n for(let i = 0, ilen = visibleMetas.length; i < ilen; i++){\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b)=>a - b));\n }\n return scale._cache.$bar;\n}\n function computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = ()=>{\n if (curr === 32767 || curr === -32768) {\n return;\n }\n if (defined(prev)) {\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n for(i = 0, ilen = values.length; i < ilen; ++i){\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n prev = undefined;\n for(i = 0, ilen = scale.ticks.length; i < ilen; ++i){\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n return min;\n}\n function computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n size = thickness * stackCount;\n ratio = 1;\n }\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - size / 2\n };\n}\n function computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n if (prev === null) {\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n if (next === null) {\n next = curr + curr - prev;\n }\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n item[vScale.axis] = barEnd;\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n for(i = start, ilen = start + count; i < ilen; ++i){\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {\n start,\n end,\n reverse,\n top,\n bottom\n };\n}\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n if (edge === true) {\n properties.borderSkipped = {\n top: true,\n right: true,\n bottom: true,\n left: true\n };\n return;\n }\n const { start , end , reverse , top , bottom } = borderProps(properties);\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\nfunction setInflateAmount(properties, { inflateAmount }, ratio) {\n properties.inflateAmount = inflateAmount === 'auto' ? ratio === 1 ? 0.33 : 0 : inflateAmount;\n}\nclass BarController extends DatasetController {\n static id = 'bar';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true\n }\n }\n };\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseObjectData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for(i = start, ilen = start + count; i < ilen; ++i){\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n getMaxOverflow() {\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const { iScale , vScale } = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom) ? '[' + custom.start + ', ' + custom.end + ']' : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const { index , _cachedMeta: { vScale } } = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n for(let i = start; i < start + count; i++){\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {\n base,\n head: base\n } : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || index === stack._top || index === stack._bottom,\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n _getStacks(last, dataIndex) {\n const { iScale } = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const skipNull = (meta)=>{\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n for (const meta of metasets){\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === undefined && meta.stack === undefined) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n if (!stacks.length) {\n stacks.push(undefined);\n }\n return stacks;\n }\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = name !== undefined ? stacks.indexOf(name) : -1;\n return index === -1 ? stacks.length - 1 : index;\n }\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n for(i = 0, ilen = meta.data.length; i < ilen; ++i){\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n _calculateBarValuePixels(index) {\n const { _cachedMeta: { vScale , _stacked , index: datasetIndex } , options: { base: baseValue , minBarLength } } = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n if (length !== value) {\n start = length - value;\n length = value;\n }\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n head = base;\n }\n size = head - base;\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n if (_stacked && !floating) {\n parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n }\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex' ? computeFlexCategoryTraits(index, ruler, options, stackCount) : computeFitCategoryTraits(index, ruler, options, stackCount);\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + range.chunk * stackIndex + range.chunk / 2;\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n for(; i < ilen; ++i){\n if (this.getParsed(i)[vScale.axis] !== null) {\n rects[i].draw(this._ctx);\n }\n }\n }\n}\n\nclass BubbleController extends DatasetController {\n static id = 'bubble';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'borderWidth',\n 'radius'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n update(mode) {\n const points = this._cachedMeta.data;\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n if (reset) {\n properties.options.radius = 0;\n }\n }\n this.updateElement(point, i, properties, mode);\n }\n }\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n if (values.$shared) {\n values = Object.assign({}, values, {\n $shared: false\n });\n }\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n return values;\n }\n}\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {\n ratioX,\n ratioY,\n offsetX,\n offsetY\n };\n}\nclass DoughnutController extends DatasetController {\n static id = 'doughnut';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'circumference',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'startAngle',\n 'x',\n 'y',\n 'offset',\n 'borderWidth',\n 'spacing'\n ]\n }\n },\n cutout: '50%',\n rotation: 0,\n circumference: 360,\n radius: '100%',\n spacing: 0,\n indexAxis: 'r'\n };\n static descriptors = {\n _scriptable: (name)=>name !== 'spacing',\n _indexable: (name)=>name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash')\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n linkScales() {}\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i)=>+data[i];\n if (isObject(data[start])) {\n const { key ='value' } = this._parsing;\n getter = (i)=>+resolveObjectKey(data[i], key);\n }\n let i, ilen;\n for(i = start, ilen = start + count; i < ilen; ++i){\n meta._parsed[i] = getter(i);\n }\n }\n }\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n for(let i = 0; i < this.chart.data.datasets.length; ++i){\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n return {\n rotation: min,\n circumference: max - min\n };\n }\n update(mode) {\n const chart = this.chart;\n const { chartArea } = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n const { circumference , rotation } = this._getRotationExtents();\n const { ratioX , ratioY , offsetX , offsetY } = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n meta.total = this.calculateTotal();\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n for(i = 0; i < start; ++i){\n startAngle += this._circumference(i, reset);\n }\n for(i = start; i < start + count; ++i){\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n this.updateElement(arc, i, properties, mode);\n }\n }\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n for(i = 0; i < metaData.length; i++){\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n return total;\n }\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n if (!arcs) {\n for(i = 0, ilen = chart.data.datasets.length; i < ilen; ++i){\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n if (!arcs) {\n return 0;\n }\n for(i = 0, ilen = arcs.length; i < ilen; ++i){\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n getMaxOffset(arcs) {\n let max = 0;\n for(let i = 0, ilen = arcs.length; i < ilen; ++i){\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n for(let i = 0; i < datasetIndex; ++i){\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n return ringWeightOffset;\n }\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n\nclass LineController extends DatasetController {\n static id = 'line';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n showLine: true,\n spanGaps: false\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category'\n },\n _value_: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { dataset: line , data: points = [] , _dataset } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n this.updateElements(points, start, count, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = 0; i < pointsCount; ++i){\n const point = points[i];\n const properties = directUpdate ? point : {};\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n\nclass PolarAreaController extends DatasetController {\n static id = 'polarArea';\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ]\n }\n },\n indexAxis: 'r',\n startAngle: 0\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const arcs = this._cachedMeta.data;\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n meta.data.forEach((element, index)=>{\n const parsed = this.getParsed(index).r;\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n return range;\n }\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n this.outerRadius = outerRadius - radiusLength * this.index;\n this.innerRadius = this.outerRadius - radiusLength;\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n const defaultAngle = 360 / this.countVisibleElements();\n for(i = 0; i < start; ++i){\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for(i = start; i < start + count; i++){\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n this.updateElement(arc, i, properties, mode);\n }\n }\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n meta.data.forEach((element, index)=>{\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n return count;\n }\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index) ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle) : 0;\n }\n}\n\nclass PieController extends DoughnutController {\n static id = 'pie';\n static defaults = {\n cutout: 0,\n rotation: 0,\n circumference: 360,\n radius: '100%'\n };\n}\n\nclass RadarController extends DatasetController {\n static id = 'radar';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n }\n };\n static overrides = {\n aspectRatio: 1,\n scales: {\n r: {\n type: 'radialLinear'\n }\n }\n };\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n line.points = points;\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n this.updateElement(line, undefined, properties, mode);\n }\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n\nclass ScatterController extends DatasetController {\n static id = 'scatter';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n static overrides = {\n interaction: {\n mode: 'point'\n },\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { data: points = [] } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n if (this.options.showLine) {\n if (!this.datasetElementType) {\n this.addElements();\n }\n const { dataset: line , _dataset } = meta;\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n } else if (this.datasetElementType) {\n delete meta.dataset;\n this.datasetElementType = false;\n }\n this.updateElements(points, start, count, mode);\n }\n addElements() {\n const { showLine } = this.options;\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n super.addElements();\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = start; i < start + count; ++i){\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n if (!this.options.showLine) {\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n\nvar controllers = /*#__PURE__*/Object.freeze({\n__proto__: null,\nBarController: BarController,\nBubbleController: BubbleController,\nDoughnutController: DoughnutController,\nLineController: LineController,\nPieController: PieController,\nPolarAreaController: PolarAreaController,\nRadarController: RadarController,\nScatterController: ScatterController\n});\n\n/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */ function abstract() {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */ class DateAdapterBase {\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */ static override(members) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n options;\n constructor(options){\n this.options = options || {};\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n formats() {\n return abstract();\n }\n parse() {\n return abstract();\n }\n format() {\n return abstract();\n }\n add() {\n return abstract();\n }\n diff() {\n return abstract();\n }\n startOf() {\n return abstract();\n }\n endOf() {\n return abstract();\n }\n}\nvar adapters = {\n _date: DateAdapterBase\n};\n\nfunction binarySearch(metaset, axis, value, intersect) {\n const { controller , data , _sorted } = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {\n lo: start.lo,\n hi: end.hi\n };\n }\n }\n }\n return {\n lo: 0,\n hi: data.length - 1\n };\n}\n function evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for(let i = 0, ilen = metasets.length; i < ilen; ++i){\n const { index , data } = metasets[i];\n const { lo , hi } = binarySearch(metasets[i], axis, value, intersect);\n for(let j = lo; j <= hi; ++j){\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n function getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n function getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n };\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n function getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n function evaluationFunc(element, datasetIndex, index) {\n const { startAngle , endAngle } = element.getProps([\n 'startAngle',\n 'endAngle'\n ], useFinalPosition);\n const { angle } = getAngleFromPoint(element, {\n x: position.x,\n y: position.y\n });\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [\n {\n element,\n datasetIndex,\n index\n }\n ];\n minDistance = distance;\n } else if (distance === minDistance) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n return axis === 'r' && !intersect ? getNearestRadialItems(chart, position, axis, useFinalPosition) : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n function getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index)=>{\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n var Interaction = {\n evaluateInteractionItems,\n modes: {\n index (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n if (!items.length) {\n return [];\n }\n chart.getSortedVisibleDatasetMetas().forEach((meta)=>{\n const index = items[0].index;\n const element = meta.data[index];\n if (element && !element.skip) {\n elements.push({\n element,\n datasetIndex: meta.index,\n index\n });\n }\n });\n return elements;\n },\n dataset (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for(let i = 0; i < data.length; ++i){\n items.push({\n element: data[i],\n datasetIndex,\n index: i\n });\n }\n }\n return items;\n },\n point (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n nearest (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n x (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n y (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n\nconst STATIC_POSITIONS = [\n 'left',\n 'top',\n 'right',\n 'bottom'\n];\nfunction filterByPosition(array, position) {\n return array.filter((v)=>v.pos === position);\n}\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter((v)=>STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b)=>{\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;\n });\n}\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n for(i = 0, ilen = (boxes || []).length; i < ilen; ++i){\n box = boxes[i];\n ({ position: pos , options: { stack , stackWeight =1 } } = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && pos + stack,\n stackWeight\n });\n }\n return layoutBoxes;\n}\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts){\n const { stack , pos , stackWeight } = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {\n count: 0,\n placed: 0,\n weight: 0,\n size: 0\n });\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n function setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const { vBoxMaxWidth , hBoxMaxHeight } = params;\n let i, ilen, layout;\n for(i = 0, ilen = layouts.length; i < ilen; ++i){\n layout = layouts[i];\n const { fullSize } = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction updateDims(chartArea, params, layout, stacks) {\n const { pos , box } = layout;\n const maxPadding = chartArea.maxPadding;\n if (!isObject(pos)) {\n if (layout.size) {\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {\n size: 0,\n count: 1\n };\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n return layout.horizontal ? {\n same: widthChanged,\n other: heightChanged\n } : {\n same: heightChanged,\n other: widthChanged\n };\n}\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n function marginForPositions(positions) {\n const margin = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n positions.forEach((pos)=>{\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n return horizontal ? marginForPositions([\n 'left',\n 'right'\n ]) : marginForPositions([\n 'top',\n 'bottom'\n ]);\n}\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n for(i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i){\n layout = boxes[i];\n box = layout.box;\n box.update(layout.width || chartArea.w, layout.height || chartArea.h, getMargins(layout.horizontal, chartArea));\n const { same , other } = updateDims(chartArea, params, layout, stacks);\n refit |= same && refitBoxes.length;\n changed = changed || other;\n if (!box.fullSize) {\n refitBoxes.push(layout);\n }\n }\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let { x , y } = chartArea;\n for (const layout of boxes){\n const box = layout.box;\n const stack = stacks[layout.stack] || {\n count: 1,\n placed: 0,\n weight: 1\n };\n const weight = layout.stackWeight / stack.weight || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n chartArea.x = x;\n chartArea.y = y;\n}\nvar layouts = {\n addBox (chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n item._layers = item._layers || function() {\n return [\n {\n z: 0,\n draw (chartArea) {\n item.draw(chartArea);\n }\n }\n ];\n };\n chart.boxes.push(item);\n },\n removeBox (chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n configure (chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n update (chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n each(chart.boxes, (box)=>{\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap)=>wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n handleMaxPadding(chartArea);\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w\n };\n each(boxes.chartArea, (layout)=>{\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n });\n });\n }\n};\n\nclass BasePlatform {\n acquireContext(canvas, aspectRatio) {}\n releaseContext(context) {\n return false;\n }\n addEventListener(chart, type, listener) {}\n removeEventListener(chart, type, listener) {}\n getDevicePixelRatio() {\n return 1;\n }\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n isAttached(canvas) {\n return true;\n }\n updateConfig(config) {\n }\n}\n\nclass BasicPlatform extends BasePlatform {\n acquireContext(item) {\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n\nconst EXPANDO_KEY = '$chartjs';\n const EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\nconst isNullOrEmpty = (value)=>value === null || value === '';\n function initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n style.display = style.display || 'block';\n style.boxSizing = style.boxSizing || 'border-box';\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n return canvas;\n}\nconst eventListenerOptions = supportsEventListenerOptions ? {\n passive: true\n} : false;\nfunction addListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n}\nfunction removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const { x , y } = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null\n };\n}\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList){\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart)=>{\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height)=>{\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n listener();\n }\n }, window);\n const observer = new ResizeObserver((entries)=>{\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n return observer;\n}\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event)=>{\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n addListener(canvas, type, proxy);\n return proxy;\n}\n class DomPlatform extends BasePlatform {\n acquireContext(canvas, aspectRatio) {\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n if (context && context.canvas === canvas) {\n initCanvas(canvas, aspectRatio);\n return context;\n }\n return null;\n }\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n const initial = canvas[EXPANDO_KEY].initial;\n [\n 'height',\n 'width'\n ].forEach((prop)=>{\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n const style = initial.style || {};\n Object.keys(style).forEach((key)=>{\n canvas.style[key] = style[key];\n });\n canvas.width = canvas.width;\n delete canvas[EXPANDO_KEY];\n return true;\n }\n addEventListener(chart, type, listener) {\n this.removeEventListener(chart, type);\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n if (!proxy) {\n return;\n }\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n isAttached(canvas) {\n const container = _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n\nfunction _detectPlatform(canvas) {\n if (!_isDomSupported() || typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nclass Element {\n static defaults = {};\n static defaultRoutes = undefined;\n x;\n y;\n active = false;\n options;\n $animations;\n tooltipPosition(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n getProps(props, final) {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this;\n }\n const ret = {};\n props.forEach((prop)=>{\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n });\n return ret;\n }\n}\n\nfunction autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for(i = 0, ilen = numMajorIndices - 1; i < ilen; i++){\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n function calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n const factors = _factorize(evenMajorSpacing);\n for(let i = 0, ilen = factors.length - 1; i < ilen; i++){\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n function getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n function skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n spacing = Math.ceil(spacing);\n for(i = 0; i < ticks.length; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n function skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n next = start;\n while(next < 0){\n count++;\n next = Math.round(start + count * spacing);\n }\n for(i = Math.max(start, 0); i < end; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n function getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n if (len < 2) {\n return false;\n }\n for(diff = arr[0], i = 1; i < len; ++i){\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n\nconst reverseAlign = (align)=>align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset)=>edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit)=>Math.min(maxTicksLimit || ticksLength, ticksLength);\n function sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n for(; i < len; i += increment){\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n function getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6;\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n function garbageCollect(caches, length) {\n each(caches, (cache)=>{\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for(i = 0; i < gcLen; ++i){\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n function getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n function getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n return lines * font.lineHeight + padding.height;\n}\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\nfunction titleAlign(align, position, reverse) {\n let ret = _toLeftRightCenter(align);\n if (reverse && position !== 'right' || !reverse && position === 'right') {\n ret = reverseAlign(ret);\n }\n return ret;\n}\nfunction titleArgs(scale, offset, position, align) {\n const { top , left , bottom , right , chart } = scale;\n const { chartArea , scales } = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n}\nclass Scale extends Element {\n constructor(cfg){\n super();\n this.id = cfg.id;\n this.type = cfg.type;\n this.options = undefined;\n this.ctx = cfg.ctx;\n this.chart = cfg.chart;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.paddingTop = undefined;\n this.paddingBottom = undefined;\n this.paddingLeft = undefined;\n this.paddingRight = undefined;\n this.axis = undefined;\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n this.ticks = [];\n this._gridLineItems = null;\n this._labelItems = null;\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n this._startPixel = undefined;\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n init(options) {\n this.options = options.setContext(this.getContext());\n this.axis = options.axis;\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n parse(raw, index) {\n return raw;\n }\n getUserBounds() {\n let { _userMin , _userMax , _suggestedMin , _suggestedMax } = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isNumberFinite(_userMin),\n maxDefined: isNumberFinite(_userMax)\n };\n }\n getMinMax(canStack) {\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n let range;\n if (minDefined && maxDefined) {\n return {\n min,\n max\n };\n }\n const metas = this.getMatchingVisibleMetas();\n for(let i = 0, ilen = metas.length; i < ilen; ++i){\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n getTicks() {\n return this.ticks;\n }\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n beforeUpdate() {\n callback(this.options.beforeUpdate, [\n this\n ]);\n }\n update(maxWidth, maxHeight, margins) {\n const { beginAtZero , grace , ticks: tickOpts } = this.options;\n const sampleSize = tickOpts.sampleSize;\n this.beforeUpdate();\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n this.beforeBuildTicks();\n this.ticks = this.buildTicks() || [];\n this.afterBuildTicks();\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n this.configure();\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation();\n this.afterCalculateLabelRotation();\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n if (samplingEnabled) {\n this._convertTicksToLabels(this.ticks);\n }\n this.beforeFit();\n this.fit();\n this.afterFit();\n this.afterUpdate();\n }\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n afterUpdate() {\n callback(this.options.afterUpdate, [\n this\n ]);\n }\n beforeSetDimensions() {\n callback(this.options.beforeSetDimensions, [\n this\n ]);\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = 0;\n this.bottom = this.height;\n }\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n callback(this.options.afterSetDimensions, [\n this\n ]);\n }\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n callback(this.options[name], [\n this\n ]);\n }\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n beforeTickToLabelConversion() {\n callback(this.options.beforeTickToLabelConversion, [\n this\n ]);\n }\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n tick = ticks[i];\n tick.label = callback(tickOpts.callback, [\n tick.value,\n i,\n ticks\n ], this);\n }\n }\n afterTickToLabelConversion() {\n callback(this.options.afterTickToLabelConversion, [\n this\n ]);\n }\n beforeCalculateLabelRotation() {\n callback(this.options.beforeCalculateLabelRotation, [\n this\n ]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n callback(this.options.afterCalculateLabelRotation, [\n this\n ]);\n }\n afterAutoSkip() {}\n beforeFit() {\n callback(this.options.beforeFit, [\n this\n ]);\n }\n fit() {\n const minSize = {\n width: 0,\n height: 0\n };\n const { chart , options: { ticks: tickOpts , title: titleOpts , grid: gridOpts } } = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight;\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n if (tickOpts.display && this.ticks.length) {\n const { first , last , widest , highest } = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n if (isHorizontal) {\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n this._handleMargins();\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n _calculatePadding(first, last, sin, cos) {\n const { ticks: { align , padding } , position } = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n afterFit() {\n callback(this.options.afterFit, [\n this\n ]);\n }\n isHorizontal() {\n const { axis , position } = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n isFullSize() {\n return this.options.fullSize;\n }\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n this.generateTickLabels(ticks);\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n this.afterTickToLabelConversion();\n }\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n return labelSizes;\n }\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const { ctx , _longestTextCache: caches } = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n for(i = 0; i < length; i += increment){\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {\n data: {},\n gc: []\n };\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n for(j = 0, jlen = label.length; j < jlen; ++j){\n nestedLabel = label[j];\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n const valueAt = (idx)=>({\n width: widths[idx] || 0,\n height: heights[idx] || 0\n });\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights\n };\n }\n getLabelForValue(value) {\n return value;\n }\n getPixelForValue(value, index) {\n return NaN;\n }\n getValueForPixel(pixel) {}\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n getBaseValue() {\n const { min , max } = this;\n return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0;\n }\n getContext(index) {\n const ticks = this.ticks || [];\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context || (tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this));\n }\n _tickSize() {\n const optionTicks = this.options.ticks;\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin;\n }\n _isVisible() {\n const display = this.options.display;\n if (display !== 'auto') {\n return !!display;\n }\n return this.getMatchingVisibleMetas().length > 0;\n }\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const { grid , position , border } = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for(i = 0; i < ticksLength; i += step){\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n lineValue = getPixelForGridLine(this, i, offset);\n if (lineValue === undefined) {\n continue;\n }\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset\n });\n }\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n return items;\n }\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const { position , ticks: optionTicks } = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const { align , crossAlign , padding , mirror } = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = (chartArea.left + chartArea.right) / 2 - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n const labelSizes = this._getLabelSizes();\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n label = tick.label;\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n if (isHorizontal) {\n x = pixel;\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += lineHeight / 2 * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n let backdrop;\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n switch(textBaseline){\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n }\n switch(textAlign){\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n }\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n color: optsAtIndex.backdropColor\n };\n }\n items.push({\n label,\n font,\n textOffset,\n options: {\n rotation,\n color,\n strokeColor,\n strokeWidth,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [\n x,\n y\n ],\n backdrop\n }\n });\n }\n return items;\n }\n _getXAxisLabelAlignment() {\n const { position , ticks } = this.options;\n const rotation = -toRadians(this.labelRotation);\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n let align = 'center';\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n return align;\n }\n _getYAxisLabelAlignment(tl) {\n const { position , ticks: { crossAlign , mirror , padding } } = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n let textAlign;\n let x;\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n return {\n textAlign,\n x\n };\n }\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n const chart = this.chart;\n const position = this.options.position;\n if (position === 'left' || position === 'right') {\n return {\n top: 0,\n left: this.left,\n bottom: chart.height,\n right: this.right\n };\n }\n if (position === 'top' || position === 'bottom') {\n return {\n top: this.top,\n left: 0,\n bottom: this.bottom,\n right: chart.width\n };\n }\n }\n drawBackground() {\n const { ctx , options: { backgroundColor } , left , top , width , height } = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex((t)=>t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n const drawLine = (p1, p2, style)=>{\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n if (grid.display) {\n for(i = 0, ilen = items.length; i < ilen; ++i){\n const item = items[i];\n if (grid.drawOnChartArea) {\n drawLine({\n x: item.x1,\n y: item.y1\n }, {\n x: item.x2,\n y: item.y2\n }, item);\n }\n if (grid.drawTicks) {\n drawLine({\n x: item.tx1,\n y: item.ty1\n }, {\n x: item.tx2,\n y: item.ty2\n }, {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n });\n }\n }\n }\n }\n drawBorder() {\n const { chart , ctx , options: { border , grid } } = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.restore();\n }\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n if (!optionTicks.display) {\n return;\n }\n const ctx = this.ctx;\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n const items = this.getLabelItems(chartArea);\n for (const item of items){\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n if (area) {\n unclipArea(ctx);\n }\n }\n drawTitle() {\n const { ctx , options: { position , title , reverse } } = this;\n if (!title.display) {\n return;\n }\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n const { titleX , titleY , maxWidth , rotation } = titleArgs(this, offset, position, align);\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n return [\n {\n z: tz,\n draw: (chartArea)=>{\n this.draw(chartArea);\n }\n }\n ];\n }\n return [\n {\n z: gz,\n draw: (chartArea)=>{\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n },\n {\n z: bz,\n draw: ()=>{\n this.drawBorder();\n }\n },\n {\n z: tz,\n draw: (chartArea)=>{\n this.drawLabels(chartArea);\n }\n }\n ];\n }\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n\nclass TypedRegistry {\n constructor(type, scope, override){\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n if (isIChartComponent(proto)) {\n parentScope = this.register(proto);\n }\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n if (id in items) {\n return scope;\n }\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n return scope;\n }\n get(id) {\n return this.items[id];\n }\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n if (id in items) {\n delete items[id];\n }\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\nfunction registerDefaults(item, scope, parentScope) {\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n defaults.set(scope, itemDefaults);\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach((property)=>{\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [\n scope\n ].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n\nclass Registry {\n constructor(){\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n this._typedRegistries = [\n this.controllers,\n this.scales,\n this.elements\n ];\n }\n add(...args) {\n this._each('register', args);\n }\n remove(...args) {\n this._each('unregister', args);\n }\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n _each(method, args, typedRegistry) {\n [\n ...args\n ].forEach((arg)=>{\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) {\n this._exec(method, reg, arg);\n } else {\n each(arg, (item)=>{\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n callback(component['before' + camelMethod], [], component);\n registry[method](component);\n callback(component['after' + camelMethod], [], component);\n }\n _getRegistryForType(type) {\n for(let i = 0; i < this._typedRegistries.length; i++){\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n return this.plugins;\n }\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n}\nvar registry = /* #__PURE__ */ new Registry();\n\nclass PluginService {\n constructor(){\n this._init = [];\n }\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors){\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [\n chart,\n args,\n descriptor.options\n ];\n if (callback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n return true;\n }\n invalidate() {\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n const descriptors = this._cache = this._createDescriptors(chart);\n this._notifyStateChanges(chart);\n return descriptors;\n }\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\n function allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for(let i = 0; i < keys.length; i++){\n plugins.push(registry.getPlugin(keys[i]));\n }\n const local = config.plugins || [];\n for(let i = 0; i < local.length; i++){\n const plugin = local[i];\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n return {\n plugins,\n localIds\n };\n}\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\nfunction createDescriptors(chart, { plugins , localIds }, options, all) {\n const result = [];\n const context = chart.getContext();\n for (const plugin of plugins){\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {\n plugin,\n local: localIds[id]\n }, opts, context)\n });\n }\n return result;\n}\nfunction pluginOpts(config, { plugin , local }, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [\n ''\n ], {\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n\nfunction getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\nfunction idMatchesAxis(id) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n}\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\nfunction determineAxis(id, ...scaleOptions) {\n if (idMatchesAxis(id)) {\n return id;\n }\n for (const opts of scaleOptions){\n const axis = opts.axis || axisFromPosition(opts.position) || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n if (axis) {\n return axis;\n }\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\nfunction getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + 'AxisID'] === id) {\n return {\n axis\n };\n }\n}\nfunction retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d)=>d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) {\n return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n }\n }\n return {};\n}\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {\n scales: {}\n };\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n Object.keys(configScales).forEach((id)=>{\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [\n {\n axis\n },\n scaleConf,\n defaultScaleOptions[axis],\n defaultScaleOptions[defaultId]\n ]);\n });\n config.data.datasets.forEach((dataset)=>{\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach((defaultID)=>{\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [\n {\n axis\n },\n configScales[id],\n defaultScaleOptions[defaultID]\n ]);\n });\n });\n Object.keys(scales).forEach((key)=>{\n const scale = scales[key];\n mergeIf(scale, [\n defaults.scales[scale.type],\n defaults.scale\n ]);\n });\n return scales;\n}\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n initOptions(config);\n return config;\n}\nconst keyCache = new Map();\nconst keysCached = new Set();\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\nconst addIfFound = (set, obj, key)=>{\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\nclass Config {\n constructor(config){\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n get platform() {\n return this._config.platform;\n }\n get type() {\n return this._config.type;\n }\n set type(type) {\n this._config.type = type;\n }\n get data() {\n return this._config.data;\n }\n set data(data) {\n this._config.data = initData(data);\n }\n get options() {\n return this._config.options;\n }\n set options(options) {\n this._config.options = options;\n }\n get plugins() {\n return this._config.plugins;\n }\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType, ()=>[\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`, ()=>[\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`\n ],\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`, ()=>[\n [\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]\n ]);\n }\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`, ()=>[\n [\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || []\n ]\n ]);\n }\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n getOptionScopes(mainScope, keyLists, resetCache) {\n const { options , type } = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n const scopes = new Set();\n keyLists.forEach((keys)=>{\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach((key)=>addIfFound(scopes, mainScope, key));\n }\n keys.forEach((key)=>addIfFound(scopes, options, key));\n keys.forEach((key)=>addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach((key)=>addIfFound(scopes, defaults, key));\n keys.forEach((key)=>addIfFound(scopes, descriptors, key));\n });\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n chartOptionScopes() {\n const { options , type } = this;\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {},\n {\n type\n },\n defaults,\n descriptors\n ];\n }\n resolveNamedOptions(scopes, names, context, prefixes = [\n ''\n ]) {\n const result = {\n $shared: true\n };\n const { resolver , subPrefixes } = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n for (const prop of names){\n result[prop] = options[prop];\n }\n return result;\n }\n createResolver(scopes, context, prefixes = [\n ''\n ], descriptorDefaults) {\n const { resolver } = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context) ? _attachContext(resolver, context, undefined, descriptorDefaults) : resolver;\n }\n}\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter((p)=>!p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\nconst hasFunction = (value)=>isObject(value) && Object.getOwnPropertyNames(value).reduce((acc, key)=>acc || isFunction(value[key]), false);\nfunction needContext(proxy, names) {\n const { isScriptable , isIndexable } = _descriptors(proxy);\n for (const prop of names){\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if (scriptable && (isFunction(value) || hasFunction(value)) || indexable && isArray(value)) {\n return true;\n }\n }\n return false;\n}\n\nvar version = \"4.4.0\";\n\nconst KNOWN_POSITIONS = [\n 'top',\n 'bottom',\n 'left',\n 'right',\n 'chartArea'\n];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';\n}\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1];\n };\n}\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n chart.notifyPlugins('afterRender');\n callback(animationOptions && animationOptions.onComplete, [\n context\n ], chart);\n}\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callback(animationOptions && animationOptions.onProgress, [\n context\n ], chart);\n}\n function getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n item = item[0];\n }\n if (item && item.canvas) {\n item = item.canvas;\n }\n return item;\n}\nconst instances = {};\nconst getChart = (key)=>{\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c)=>c.canvas === canvas).pop();\n};\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys){\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n function determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\nfunction getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\nfunction getDatasetArea(meta, chartArea) {\n const { xScale , yScale } = meta;\n if (xScale && yScale) {\n return {\n left: getSizeForArea(xScale, chartArea, 'left'),\n right: getSizeForArea(xScale, chartArea, 'right'),\n top: getSizeForArea(yScale, chartArea, 'top'),\n bottom: getSizeForArea(yScale, chartArea, 'bottom')\n };\n }\n return chartArea;\n}\nclass Chart {\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n constructor(item, userConfig){\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error('Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' + ' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.');\n }\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce((mode)=>this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n instances[this.id] = this;\n if (!context || !canvas) {\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n get aspectRatio() {\n const { options: { aspectRatio , maintainAspectRatio } , width , height , _aspectRatio } = this;\n if (!isNullOrUndef(aspectRatio)) {\n return aspectRatio;\n }\n if (maintainAspectRatio && _aspectRatio) {\n return _aspectRatio;\n }\n return height ? width / height : null;\n }\n get data() {\n return this.config.data;\n }\n set data(data) {\n this.config.data = data;\n }\n get options() {\n return this._options;\n }\n set options(options) {\n this.config.options = options;\n }\n get registry() {\n return registry;\n }\n _initialize() {\n this.notifyPlugins('beforeInit');\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n this.bindEvents();\n this.notifyPlugins('afterInit');\n return this;\n }\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n stop() {\n animator.stop(this);\n return this;\n }\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {\n width,\n height\n };\n }\n }\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n this.notifyPlugins('resize', {\n size: newSize\n });\n callback(options.onResize, [\n this,\n newSize\n ], this);\n if (this.attached) {\n if (this._doResize(mode)) {\n this.render();\n }\n }\n }\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n each(scalesOptions, (axisOptions, axisID)=>{\n axisOptions.id = axisID;\n });\n }\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id)=>{\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n if (scaleOpts) {\n items = items.concat(Object.keys(scaleOpts).map((id)=>{\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n }));\n }\n each(items, (item)=>{\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n scale.init(scaleOptions, options);\n });\n each(updated, (hasUpdated, id)=>{\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n each(scales, (scale)=>{\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n metasets.sort((a, b)=>a.index - b.index);\n if (numMeta > numData) {\n for(let i = numData; i < numMeta; ++i){\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n _removeUnreferencedMetasets() {\n const { _metasets: metasets , data: { datasets } } = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index)=>{\n if (datasets.filter((x)=>x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n this._removeUnreferencedMetasets();\n for(i = 0, ilen = datasets.length; i < ilen; i++){\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const { datasetElementType , dataElementType } = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n this._updateMetasets();\n return newControllers;\n }\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex)=>{\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n update(mode) {\n const config = this.config;\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n this._plugins.invalidate();\n if (this.notifyPlugins('beforeUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n const newControllers = this.buildOrUpdateControllers();\n this.notifyPlugins('beforeElementsUpdate');\n let minPadding = 0;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; i++){\n const { controller } = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n if (!animsDisabled) {\n each(newControllers, (controller)=>{\n controller.reset();\n });\n }\n this._updateDatasets(mode);\n this.notifyPlugins('afterUpdate', {\n mode\n });\n this._layers.sort(compare2Level('z', '_idx'));\n const { _active , _lastEvent } = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n this.render();\n }\n _updateScales() {\n each(this.scales, (scale)=>{\n layouts.removeBox(this, scale);\n });\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n this.unbindEvents();\n this.bindEvents();\n }\n }\n _updateHiddenIndices() {\n const { _hiddenIndices } = this;\n const changes = this._getUniformDataChanges() || [];\n for (const { method , start , count } of changes){\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx)=>new Set(_dataChanges.filter((c)=>c[0] === idx).map((c, i)=>i + ',' + c.splice(1).join(',')));\n const changeSet = makeSet(0);\n for(let i = 1; i < datasetCount; i++){\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet).map((c)=>c.split(',')).map((a)=>({\n method: a[1],\n start: +a[2],\n count: +a[3]\n }));\n }\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {\n cancelable: true\n }) === false) {\n return;\n }\n layouts.update(this, this.width, this.height, minPadding);\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n this._layers = [];\n each(this.boxes, (box)=>{\n if (noArea && box.position === 'chartArea') {\n return;\n }\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n this._layers.forEach((item, index)=>{\n item._idx = index;\n });\n this.notifyPlugins('afterLayout');\n }\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this.getDatasetMeta(i).controller.configure();\n }\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this._updateDataset(i, isFunction(mode) ? mode({\n datasetIndex: i\n }) : mode);\n }\n this.notifyPlugins('afterDatasetsUpdate', {\n mode\n });\n }\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {\n meta,\n index,\n mode,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n meta.controller._update(mode);\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n render() {\n if (this.notifyPlugins('beforeRender', {\n cancelable: true\n }) === false) {\n return;\n }\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({\n chart: this\n });\n }\n }\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const { width , height } = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n if (this.notifyPlugins('beforeDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const layers = this._layers;\n for(i = 0; i < layers.length && layers[i].z <= 0; ++i){\n layers[i].draw(this.chartArea);\n }\n this._drawDatasets();\n for(; i < layers.length; ++i){\n layers[i].draw(this.chartArea);\n }\n this.notifyPlugins('afterDraw');\n }\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n return result;\n }\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const metasets = this.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n this._drawDataset(metasets[i]);\n }\n this.notifyPlugins('afterDatasetsDraw');\n }\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta, this.chartArea);\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n meta.controller.draw();\n if (useClip) {\n unclipArea(ctx);\n }\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n return [];\n }\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter((x)=>x && x._dataset === dataset).pop();\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n return meta;\n }\n getContext() {\n return this.$context || (this.$context = createContext(null, {\n chart: this,\n type: 'chart'\n }));\n }\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n const meta = this.getDatasetMeta(datasetIndex);\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n anims.update(meta, {\n visible\n });\n this.update((ctx)=>ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n for(i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this._destroyDatasetMeta(i);\n }\n }\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const { canvas , ctx } = this;\n this._stop();\n this.config.clearCache();\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n delete instances[this.id];\n this.notifyPlugins('afterDestroy');\n }\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const listener = (e, x, y)=>{\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n each(this.options.events, (type)=>_add(type, listener));\n }\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener)=>{\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n const listener = (width, height)=>{\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n let detached;\n const attached = ()=>{\n _remove('attach', attached);\n this.attached = true;\n this.resize();\n _add('resize', listener);\n _add('detach', detached);\n };\n detached = ()=>{\n this.attached = false;\n _remove('resize', listener);\n this._stop();\n this._resize(0, 0);\n _add('attach', attached);\n };\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n unbindEvents() {\n each(this._listeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n each(this._responsiveListeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n if (changed) {\n this._active = active;\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter((p)=>p.plugin.id === pluginId).length === 1;\n }\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin)=>(plugin.options.events || this.options.events).includes(e.native.type);\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n const changed = this._handleEvent(e, replay, args.inChartArea);\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n if (changed || args.changed) {\n this.render();\n }\n return this;\n }\n _handleEvent(e, replay, inChartArea) {\n const { _active: lastActive = [] , options } = this;\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n if (inChartArea) {\n this._lastEvent = null;\n callback(options.onHover, [\n e,\n active,\n this\n ], this);\n if (isClick) {\n callback(options.onClick, [\n e,\n active,\n this\n ], this);\n }\n }\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n this._lastEvent = lastEvent;\n return changed;\n }\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart)=>chart._plugins.invalidate());\n}\n\nfunction clipArc(ctx, element, endAngle) {\n const { startAngle , pixelMargin , x , y , outerRadius , innerRadius } = element;\n let angleMargin = pixelMargin / outerRadius;\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, [\n 'outerStart',\n 'outerEnd',\n 'innerStart',\n 'innerEnd'\n ]);\n}\n/**\n * Parse border radius from the provided options\n */ function parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val)=>{\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit)\n };\n}\n/**\n * Convert (r, 𝜃) to (x, y)\n */ function rThetaToXY(r, theta, x, y) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta)\n };\n}\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */ function pathArc(ctx, element, offset, spacing, end, circular) {\n const { x , y , startAngle: start , pixelMargin , innerRadius: innerR } = element;\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n let spacingOffset = 0;\n const alpha = end - start;\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const { outerStart , outerEnd , innerStart , innerEnd } = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n ctx.beginPath();\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2;\n ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true);\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n ctx.closePath();\n}\nfunction drawArc(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference } = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\nfunction drawBorder(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference , options } = element;\n const { borderWidth , borderJoinStyle , borderDash , borderDashOffset } = options;\n const inner = options.borderAlign === 'inner';\n if (!borderWidth) {\n return;\n }\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\nclass ArcElement extends Element {\n static id = 'arc';\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n static descriptors = {\n _scriptable: true,\n _indexable: (name)=>name !== 'borderDash'\n };\n circumference;\n endAngle;\n fullCircles;\n innerRadius;\n outerRadius;\n pixelMargin;\n startAngle;\n constructor(cfg){\n super();\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(chartX, chartY, useFinalPosition) {\n const point = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n const { angle , distance } = getAngleFromPoint(point, {\n x: chartX,\n y: chartY\n });\n const { startAngle , endAngle , innerRadius , outerRadius , circumference } = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n return betweenAngles && withinRadius;\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , startAngle , endAngle , innerRadius , outerRadius } = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ], useFinalPosition);\n const { offset , spacing } = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n tooltipPosition(useFinalPosition) {\n return this.getCenterPoint(useFinalPosition);\n }\n draw(ctx) {\n const { options , circumference } = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = options.borderAlign === 'inner' ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n ctx.save();\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n ctx.restore();\n }\n}\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\n function getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n return lineTo;\n}\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const { start: paramsStart = 0 , end: paramsEnd = count - 1 } = params;\n const { start: segmentStart , end: segmentEnd } = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n function pathSegment(ctx, line, segment, params) {\n const { points , options } = line;\n const { count , start , loop , ilen } = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n let { move =true , reverse } = params || {};\n let i, point, prev;\n for(i = 0; i <= ilen; ++i){\n point = points[(start + (reverse ? ilen - i : i)) % count];\n if (point.skip) {\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n prev = point;\n }\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n return !!loop;\n}\n function fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const { count , start , ilen } = pathVars(points, segment, params);\n const { move =true , reverse } = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n const pointIndex = (index)=>(start + (reverse ? ilen - index : index)) % count;\n const drawX = ()=>{\n if (minY !== maxY) {\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n ctx.lineTo(avgX, lastY);\n }\n };\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n for(i = 0; i <= ilen; ++i){\n point = points[pointIndex(i)];\n if (point.skip) {\n continue;\n }\n const x = point.x;\n const y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n ctx.lineTo(x, y);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n lastY = y;\n }\n drawX();\n}\n function _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n function _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n return _pointInLine;\n}\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\nfunction strokePathDirect(ctx, line, start, count) {\n const { segments , options } = line;\n const segmentMethod = _getSegmentMethod(line);\n for (const segment of segments){\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {\n start,\n end: start + count - 1\n })) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\nconst usePath2D = typeof Path2D === 'function';\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\nclass LineElement extends Element {\n static id = 'line';\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n static descriptors = {\n _scriptable: true,\n _indexable: (name)=>name !== 'borderDash' && name !== 'fill'\n };\n constructor(cfg){\n super();\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n get points() {\n return this._points;\n }\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {\n property,\n start: value,\n end: value\n });\n if (!segments.length) {\n return;\n }\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for(i = 0, ilen = segments.length; i < ilen; ++i){\n const { start , end } = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n start = start || 0;\n count = count || this.points.length - start;\n for (const segment of segments){\n loop &= segmentMethod(ctx, this, segment, {\n start,\n end: start + count - 1\n });\n }\n return !!loop;\n }\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n if (points.length && options.borderWidth) {\n ctx.save();\n draw(ctx, this, start, count);\n ctx.restore();\n }\n if (this.animated) {\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n\nfunction inRange$1(el, pos, axis, useFinalPosition) {\n const options = el.options;\n const { [axis]: value } = el.getProps([\n axis\n ], useFinalPosition);\n return Math.abs(pos - value) < options.radius + options.hitRadius;\n}\nclass PointElement extends Element {\n static id = 'point';\n parsed;\n skip;\n stop;\n /**\n * @type {any}\n */ static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n /**\n * @type {any}\n */ static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n const options = this.options;\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange$1(this, mouseX, 'x', useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange$1(this, mouseY, 'y', useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n size(options) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n draw(ctx, area) {\n const options = this.options;\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n\nfunction getBarBounds(bar, useFinalPosition) {\n const { x , y , base , width , height } = bar.getProps([\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ], useFinalPosition);\n let left, right, top, bottom, half;\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n return {\n left,\n top,\n right,\n bottom\n };\n}\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\nfunction parseBorderRadius(bar, maxW, maxH) {\n const { enableBorderRadius } = bar.getProps([\n 'enableBorderRadius'\n ]);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n const enableBorder = enableBorderRadius || isObject(value);\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))\n }\n }\n };\n}\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n return bounds && (skipX || _isBetween(x, bounds.left, bounds.right)) && (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n function addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\nclass BarElement extends Element {\n static id = 'bar';\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n draw(ctx) {\n const { inflateAmount , options: { borderColor , backgroundColor } } = this;\n const { inner , outer } = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n ctx.save();\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , base , horizontal } = this.getProps([\n 'x',\n 'y',\n 'base',\n 'horizontal'\n ], useFinalPosition);\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n\nvar elements = /*#__PURE__*/Object.freeze({\n__proto__: null,\nArcElement: ArcElement,\nBarElement: BarElement,\nLineElement: LineElement,\nPointElement: PointElement\n});\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)',\n 'rgb(255, 99, 132)',\n 'rgb(255, 159, 64)',\n 'rgb(255, 205, 86)',\n 'rgb(75, 192, 192)',\n 'rgb(153, 102, 255)',\n 'rgb(201, 203, 207)' // grey\n];\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map((color)=>color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\nfunction getBorderColor(i) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\nfunction getBackgroundColor(i) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\nfunction colorizeDefaultDataset(dataset, i) {\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n return ++i;\n}\nfunction colorizeDoughnutDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>getBorderColor(i++));\n return i;\n}\nfunction colorizePolarAreaDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>getBackgroundColor(i++));\n return i;\n}\nfunction getColorizer(chart) {\n let i = 0;\n return (dataset, datasetIndex)=>{\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n if (controller instanceof DoughnutController) {\n i = colorizeDoughnutDataset(dataset, i);\n } else if (controller instanceof PolarAreaController) {\n i = colorizePolarAreaDataset(dataset, i);\n } else if (controller) {\n i = colorizeDefaultDataset(dataset, i);\n }\n };\n}\nfunction containsColorsDefinitions(descriptors) {\n let k;\n for(k in descriptors){\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n return false;\n}\nfunction containsColorsDefinition(descriptor) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\nvar plugin_colors = {\n id: 'colors',\n defaults: {\n enabled: true,\n forceOverride: false\n },\n beforeLayout (chart, _args, options) {\n if (!options.enabled) {\n return;\n }\n const { data: { datasets } , options: chartOptions } = chart.config;\n const { elements } = chartOptions;\n if (!options.forceOverride && (containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || elements && containsColorsDefinitions(elements))) {\n return;\n }\n const colorizer = getColorizer(chart);\n datasets.forEach(colorizer);\n }\n};\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n const samples = options.samples || availableWidth;\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n const decimated = [];\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n decimated[sampledIndex++] = data[a];\n for(i = 0; i < samples - 2; i++){\n let avgX = 0;\n let avgY = 0;\n let j;\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n for(j = avgRangeStart; j < avgRangeEnd; j++){\n avgX += data[j].x;\n avgY += data[j].y;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const { x: pointAx , y: pointAy } = data[a];\n maxArea = area = -1;\n for(j = rangeOffs; j < rangeTo; j++){\n area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy));\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n decimated[sampledIndex++] = data[endIndex];\n return decimated;\n}\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n for(i = start; i < start + count; ++i){\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n const lastIndex = i - 1;\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n if (i > 0 && lastIndex !== startIndex) {\n decimated.push(data[lastIndex]);\n }\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n return decimated;\n}\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data\n });\n }\n}\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset)=>{\n cleanDecimatedDataset(dataset);\n });\n}\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n let start = 0;\n let count;\n const { iScale } = meta;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n return {\n start,\n count\n };\n}\nvar plugin_decimation = {\n id: 'decimation',\n defaults: {\n algorithm: 'min-max',\n enabled: false\n },\n beforeElementsUpdate: (chart, args, options)=>{\n if (!options.enabled) {\n cleanDecimatedData(chart);\n return;\n }\n const availableWidth = chart.width;\n chart.data.datasets.forEach((dataset, datasetIndex)=>{\n const { _data , indexAxis } = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n if (resolve([\n indexAxis,\n chart.options.indexAxis\n ]) === 'y') {\n return;\n }\n if (!meta.controller.supportsDecimation) {\n return;\n }\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n return;\n }\n if (chart.options.parsing) {\n return;\n }\n let { start , count } = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n cleanDecimatedDataset(dataset);\n return;\n }\n if (isNullOrUndef(_data)) {\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n let decimated;\n switch(options.algorithm){\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n dataset._decimated = decimated;\n });\n },\n destroy (chart) {\n cleanDecimatedData(chart);\n }\n};\n\nfunction _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n for (const segment of segments){\n let { start , end } = segment;\n end = _findSegmentEnd(start, end, points);\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n if (!target.segments) {\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n const targetSegments = _boundSegments(target, bounds);\n for (const tgt of targetSegments){\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n for (const fillSource of fillSources){\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\nfunction _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {\n property,\n start,\n end\n };\n}\nfunction _pointsFromSegments(boundary, line) {\n const { x =null , y =null } = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({ start , end })=>{\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({\n x: first.x,\n y\n });\n points.push({\n x: last.x,\n y\n });\n } else if (x !== null) {\n points.push({\n x,\n y: first.y\n });\n points.push({\n x,\n y: last.y\n });\n }\n });\n return points;\n}\nfunction _findSegmentEnd(start, end, points) {\n for(; end > start; end--){\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n\nfunction _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n if (isArray(boundary)) {\n _loop = true;\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n return points.length ? new LineElement({\n points,\n options: {\n tension: 0\n },\n _loop,\n _fullLoop: _loop\n }) : null;\n}\nfunction _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n\nfunction _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [\n index\n ];\n let target;\n if (!propagate) {\n return fill;\n }\n while(fill !== false && visited.indexOf(fill) === -1){\n if (!isNumberFinite(fill)) {\n return fill;\n }\n target = sources[fill];\n if (!target) {\n return false;\n }\n if (target.visible) {\n return fill;\n }\n visited.push(fill);\n fill = target.fill;\n }\n return false;\n}\n function _decodeFill(line, index, count) {\n const fill = parseFillOption(line);\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n let target = parseFloat(fill);\n if (isNumberFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n return [\n 'origin',\n 'start',\n 'end',\n 'stack',\n 'shape'\n ].indexOf(fill) >= 0 && fill;\n}\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n return target;\n}\n function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n function _getTargetValue(fill, scale, startValue) {\n let value;\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n function parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n if (fill === false || fill === null) {\n return false;\n }\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n\nfunction _buildStackLine(source) {\n const { scale , index , line } = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({\n x: null,\n y: scale.bottom\n }, line));\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n for(let j = segment.start; j <= segment.end; j++){\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({\n points,\n options: {}\n });\n}\n function getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n for(let i = 0; i < metas.length; i++){\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n function addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for(let j = 0; j < linesBelow.length; j++){\n const line = linesBelow[j];\n const { first , last , point } = findPoint(line, sourcePoint, 'x');\n if (!point || first && last) {\n continue;\n }\n if (first) {\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n break;\n }\n }\n }\n points.push(...postponed);\n}\n function findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {\n first,\n last,\n point\n };\n}\n\nclass simpleArc {\n constructor(opts){\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n pathSegment(ctx, bounds, opts) {\n const { x , y , radius } = this;\n bounds = bounds || {\n start: 0,\n end: TAU\n };\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n interpolate(point) {\n const { x , y , radius } = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n\nfunction _getTarget(source) {\n const { chart , fill , line } = source;\n if (isNumberFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n if (fill === 'shape') {\n return true;\n }\n const boundary = computeBoundary(source);\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n return _createBoundaryLine(boundary, line);\n}\n function getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\nfunction computeLinearBoundary(source) {\n const { scale ={} , fill } = source;\n const pixel = _getTargetPixel(fill, scale);\n if (isNumberFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n return null;\n}\nfunction computeCircularBoundary(source) {\n const { scale , fill } = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n for(let i = 0; i < length; ++i){\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\nfunction _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const { line , scale , axis } = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const { above =color , below =color } = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {\n line,\n target,\n above,\n below,\n area,\n scale,\n axis\n });\n unclipArea(ctx);\n }\n}\nfunction doFill(ctx, cfg) {\n const { line , target , above , below , area , scale } = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n ctx.save();\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {\n line,\n target,\n color: above,\n scale,\n property\n });\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {\n line,\n target,\n color: below,\n scale,\n property\n });\n ctx.restore();\n}\nfunction clipVertical(ctx, target, clipY) {\n const { segments , points } = target;\n let first = true;\n let lineLoop = false;\n ctx.beginPath();\n for (const segment of segments){\n const { start , end } = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {\n move: lineLoop\n });\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\nfunction fill(ctx, cfg) {\n const { line , target , property , color , scale } = cfg;\n const segments = _segments(line, target, property);\n for (const { source: src , target: tgt , start , end } of segments){\n const { style: { backgroundColor =color } = {} } = src;\n const notShape = target !== true;\n ctx.save();\n ctx.fillStyle = backgroundColor;\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n ctx.beginPath();\n const lineLoop = !!line.pathSegment(ctx, src);\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n const targetLoop = !!target.pathSegment(ctx, tgt, {\n move: lineLoop,\n reverse: true\n });\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n ctx.restore();\n }\n}\nfunction clipBounds(ctx, scale, bounds) {\n const { top , bottom } = scale.chart.chartArea;\n const { property , start , end } = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\nvar index = {\n id: 'filler',\n afterDatasetsUpdate (chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n for(i = 0; i < count; ++i){\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line\n };\n }\n meta.$filler = source;\n sources.push(source);\n }\n for(i = 0; i < count; ++i){\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n beforeDraw (chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n beforeDatasetsDraw (chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n const metasets = chart.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n beforeDatasetDraw (chart, args, options) {\n const source = args.meta.$filler;\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n\nconst getBoxSize = (labelOpts, fontSize)=>{\n let { boxHeight =fontSize , boxWidth =fontSize } = labelOpts;\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\nconst itemsEqual = (a, b)=>a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass Legend extends Element {\n constructor(config){\n super();\n this._added = false;\n this.legendHitBoxes = [];\n this._hoveredItem = null;\n this.doughnutMode = false;\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = callback(labelOpts.generateLabels, [\n this.chart\n ], this) || [];\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item)=>labelOpts.filter(item, this.chart.data));\n }\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b)=>labelOpts.sort(a, b, this.chart.data));\n }\n if (this.options.reverse) {\n legendItems.reverse();\n }\n this.legendItems = legendItems;\n }\n fit() {\n const { options , ctx } = this;\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const { boxWidth , itemHeight } = getBoxSize(labelOpts, fontSize);\n let width, height;\n ctx.font = labelFont.string;\n if (this.isHorizontal()) {\n width = this.maxWidth;\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight;\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const { ctx , maxWidth , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const lineWidths = this.lineWidths = [\n 0\n ];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i)=>{\n const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n hitboxes[i] = {\n left: 0,\n top,\n row,\n width: itemWidth,\n height: itemHeight\n };\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n return totalHeight;\n }\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const { ctx , maxHeight , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n let left = 0;\n let col = 0;\n this.legendItems.forEach((legendItem, i)=>{\n const { itemWidth , itemHeight } = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n hitboxes[i] = {\n left,\n top: currentColHeight,\n col,\n width: itemWidth,\n height: itemHeight\n };\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n totalWidth += currentColWidth;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n return totalWidth;\n }\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const { legendHitBoxes: hitboxes , options: { align , labels: { padding } , rtl } } = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes){\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes){\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n this._draw();\n unclipArea(ctx);\n }\n }\n _draw() {\n const { options: opts , columnSizes , lineWidths , ctx } = this;\n const { align , labels: labelOpts } = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const { padding } = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n this.drawTitle();\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n const { boxWidth , boxHeight , itemHeight } = getBoxSize(labelOpts, fontSize);\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n ctx.save();\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n if (labelOpts.usePointStyle) {\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n ctx.beginPath();\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n ctx.restore();\n };\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n overrideTextDirection(this.ctx, opts.textDirection);\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i)=>{\n ctx.strokeStyle = legendItem.fontColor;\n ctx.fillStyle = legendItem.fontColor;\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n rtlHelper.setWidth(this.width);\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n const realX = rtlHelper.x(x);\n drawLegendBox(realX, y, legendItem);\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n fillText(rtlHelper.x(x), y, legendItem);\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n if (!titleOpts.display) {\n return;\n }\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n let left = this.left;\n let maxWidth = this.width;\n if (this.isHorizontal()) {\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n const maxHeight = this.columnSizes.reduce((acc, size)=>Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n const x = _alignStartEnd(position, left, left + maxWidth);\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n if (_isBetween(x, this.left, this.right) && _isBetween(y, this.top, this.bottom)) {\n lh = this.legendHitBoxes;\n for(i = 0; i < lh.length; ++i){\n hitBox = lh[i];\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width) && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n return this.legendItems[i];\n }\n }\n }\n return null;\n }\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n callback(opts.onLeave, [\n e,\n previous,\n this\n ], this);\n }\n this._hoveredItem = hoveredItem;\n if (hoveredItem && !sameItem) {\n callback(opts.onHover, [\n e,\n hoveredItem,\n this\n ], this);\n }\n } else if (hoveredItem) {\n callback(opts.onClick, [\n e,\n hoveredItem,\n this\n ], this);\n }\n }\n}\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {\n itemWidth,\n itemHeight\n };\n}\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b)=>a.length > b.length ? a : b);\n }\n return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width;\n}\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\nvar plugin_legend = {\n id: 'legend',\n _element: Legend,\n start (chart, _args, options) {\n const legend = chart.legend = new Legend({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n stop (chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n beforeUpdate (chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n afterUpdate (chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n afterEvent (chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n onClick (e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n onHover: null,\n onLeave: null,\n labels: {\n color: (ctx)=>ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n generateLabels (chart) {\n const datasets = chart.data.datasets;\n const { labels: { usePointStyle , pointStyle , textAlign , color , useBorderRadius , borderRadius } } = chart.legend.options;\n return chart._getSortedDatasetMetas().map((meta)=>{\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n title: {\n color: (ctx)=>ctx.chart.options.color,\n display: false,\n position: 'center',\n text: ''\n }\n },\n descriptors: {\n _scriptable: (name)=>!name.startsWith('on'),\n labels: {\n _scriptable: (name)=>![\n 'generateLabels',\n 'filter',\n 'sort'\n ].includes(name)\n }\n }\n};\n\nclass Title extends Element {\n constructor(config){\n super();\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight) {\n const opts = this.options;\n this.left = 0;\n this.top = 0;\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n _drawArgs(offset) {\n const { top , left , bottom , right , options } = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n }\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n if (!opts.display) {\n return;\n }\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const { titleX , titleY , maxWidth , rotation } = this._drawArgs(offset);\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n}\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\nvar plugin_title = {\n id: 'title',\n _element: Title,\n start (chart, _args, options) {\n createTitle(chart, options);\n },\n stop (chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n beforeUpdate (chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold'\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst map = new WeakMap();\nvar plugin_subtitle = {\n id: 'subtitle',\n start (chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n stop (chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n beforeUpdate (chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal'\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst positioners = {\n average (items) {\n if (!items.length) {\n return false;\n }\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n return {\n x: x / count,\n y: y / count\n };\n },\n nearest (items, eventPosition) {\n if (!items.length) {\n return false;\n }\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n return {\n x,\n y\n };\n }\n};\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n return base;\n}\n function splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n function createTooltipItem(chart, item) {\n const { element , datasetIndex , index } = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const { label , value } = controller.getLabelAndValue(index);\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n function getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const { body , footer , title } = tooltip;\n const { boxWidth , boxHeight } = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n let combinedBodyLength = body.reduce((count, bodyItem)=>count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;\n }\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n ctx.save();\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;\n each(body, (bodyItem)=>{\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n widthPadding = 0;\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n ctx.restore();\n width += padding.width;\n return {\n width,\n height\n };\n}\nfunction determineYAlign(chart, size) {\n const { y , height } = size;\n if (y < height / 2) {\n return 'top';\n } else if (y > chart.height - height / 2) {\n return 'bottom';\n }\n return 'center';\n}\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const { x , width } = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\nfunction determineXAlign(chart, options, size, yAlign) {\n const { x , width } = size;\n const { width: chartWidth , chartArea: { left , right } } = chart;\n let xAlign = 'center';\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n return xAlign;\n}\n function determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\nfunction alignX(size, xAlign) {\n let { x , width } = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= width / 2;\n }\n return x;\n}\nfunction alignY(size, yAlign, paddingAndSize) {\n let { y , height } = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= height / 2;\n }\n return y;\n}\n function getBackgroundPoint(options, size, alignment, chart) {\n const { caretSize , caretPadding , cornerRadius } = options;\n const { xAlign , yAlign } = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n return align === 'center' ? tooltip.x + tooltip.width / 2 : align === 'right' ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;\n}\n function getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\nconst defaultCallbacks = {\n beforeTitle: noop,\n title (tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n return '';\n },\n afterTitle: noop,\n beforeBody: noop,\n beforeLabel: noop,\n label (tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n let label = tooltipItem.dataset.label || '';\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0\n };\n },\n labelTextColor () {\n return this.options.bodyColor;\n },\n labelPointStyle (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation\n };\n },\n afterLabel: noop,\n afterBody: noop,\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n function invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n return result;\n}\nclass Tooltip extends Element {\n static positioners = positioners;\n constructor(config){\n super();\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n if (cached) {\n return cached;\n }\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n return animations;\n }\n getContext() {\n return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n getTitle(context, options) {\n const { callbacks } = options;\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n return lines;\n }\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems));\n }\n getBody(tooltipItems, options) {\n const { callbacks } = options;\n const bodyItems = [];\n each(tooltipItems, (context)=>{\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n bodyItems.push(bodyItem);\n });\n return bodyItems;\n }\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems));\n }\n getFooter(tooltipItems, options) {\n const { callbacks } = options;\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n return lines;\n }\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n for(i = 0, len = active.length; i < len; ++i){\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array)=>options.filter(element, index, array, data));\n }\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b)=>options.itemSort(a, b, data));\n }\n each(tooltipItems, (context)=>{\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n if (changed && options.external) {\n options.external.call(this, {\n chart: this.chart,\n tooltip: this,\n replay\n });\n }\n }\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n getCaretPosition(tooltipPoint, size, options) {\n const { xAlign , yAlign } = this;\n const { caretSize , cornerRadius } = options;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n const { x: ptX , y: ptY } = tooltipPoint;\n const { width , height } = size;\n let x1, x2, x3, y1, y2, y3;\n if (yAlign === 'center') {\n y2 = ptY + height / 2;\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {\n x1,\n x2,\n x3,\n y1,\n y2,\n y3\n };\n }\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.titleAlign, options);\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing;\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing;\n }\n }\n }\n }\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const { boxHeight , boxWidth } = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2,\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1;\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = toTRBLCorners(labelColor.borderRadius);\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n ctx.fillStyle = this.labelTextColors[i];\n }\n drawBody(pt, ctx, options) {\n const { body } = this;\n const { bodySpacing , bodyAlign , displayColors , boxHeight , boxWidth , boxPadding } = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right' ? bodyAlign === 'center' ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;\n for(i = 0, ilen = body.length; i < ilen; ++i){\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n lines = bodyItem.lines;\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n for(j = 0, jlen = lines.length; j < jlen; ++j){\n fillLineOfText(lines[j]);\n bodyLineHeight = bodyFont.lineHeight;\n }\n each(bodyItem.after, fillLineOfText);\n }\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing;\n }\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n footerFont = toFont(options.footerFont);\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n drawBackground(pt, ctx, tooltipSize, options) {\n const { xAlign , yAlign } = this;\n const { x , y } = pt;\n const { width , height } = tooltipSize;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(options.cornerRadius);\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n _willRender() {\n return !!this.opacity;\n }\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n if (!opacity) {\n return;\n }\n this._updateAnimationTarget(options);\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n const padding = toPadding(options.padding);\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n this.drawBackground(pt, ctx, tooltipSize, options);\n overrideTextDirection(ctx, options.textDirection);\n pt.y += padding.top;\n this.drawTitle(pt, ctx, options);\n this.drawBody(pt, ctx, options);\n this.drawFooter(pt, ctx, options);\n restoreTextDirection(ctx, options.textDirection);\n ctx.restore();\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.chart.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n const positionChanged = this._positionChanged(active, e);\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n if (changed) {\n this._active = active;\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n this.update(true, replay);\n }\n }\n return changed;\n }\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n if (options.reverse) {\n active.reverse();\n }\n return active;\n }\n _positionChanged(active, e) {\n const { caretX , caretY , options } = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\nvar plugin_tooltip = {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n afterInit (chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({\n chart,\n options\n });\n }\n },\n beforeUpdate (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n reset (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n afterDraw (chart) {\n const tooltip = chart.tooltip;\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n if (chart.notifyPlugins('beforeTooltipDraw', {\n ...args,\n cancelable: true\n }) === false) {\n return;\n }\n tooltip.draw(chart.ctx);\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n afterEvent (chart, args) {\n if (chart.tooltip) {\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n args.changed = true;\n }\n }\n },\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold'\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {},\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold'\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts)=>opts.bodyFont.size,\n boxWidth: (ctx, opts)=>opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart'\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'width',\n 'height',\n 'caretX',\n 'caretY'\n ]\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n descriptors: {\n _scriptable: (name)=>name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n additionalOptionScopes: [\n 'interaction'\n ]\n};\n\nvar plugins = /*#__PURE__*/Object.freeze({\n__proto__: null,\nColors: plugin_colors,\nDecimation: plugin_decimation,\nFiller: index,\nLegend: plugin_legend,\nSubTitle: plugin_subtitle,\nTitle: plugin_title,\nTooltip: plugin_tooltip\n});\n\nconst addIfString = (labels, raw, index, addedLabels)=>{\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({\n index,\n label: raw\n });\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\nconst validIndex = (index, max)=>index === null ? null : _limitValue(Math.round(index), 0, max);\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\nclass CategoryScale extends Scale {\n static id = 'category';\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n constructor(cfg){\n super(cfg);\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const { index , label } of added){\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n determineDataLimits() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this.getMinMax(true);\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1);\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n for(let value = min; value <= max; value++){\n ticks.push({\n value\n });\n }\n return ticks;\n }\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n configure() {\n super.configure();\n if (!this.isHorizontal()) {\n this._reversePixels = !this._reversePixels;\n }\n }\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n getBasePixel() {\n return this.bottom;\n }\n}\n\nfunction generateTicks$1(generationOptions, dataRange) {\n const ticks = [];\n const MIN_SPACING = 1e-14;\n const { bounds , step , min , max , precision , count , maxTicks , maxDigits , includeBounds } = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const { min: rmin , max: rmax } = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [\n {\n value: rmin\n },\n {\n value: rmax\n }\n ];\n }\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n if (!isNullOrUndef(precision)) {\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n numSpaces = (niceMax - niceMin) / spacing;\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n const decimalPlaces = Math.max(_decimalPlaces(spacing), _decimalPlaces(niceMin));\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({\n value: min\n });\n if (niceMin < min) {\n j++;\n }\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n for(; j < numSpaces; ++j){\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) {\n break;\n }\n ticks.push({\n value: tickValue\n });\n }\n if (maxDefined && includeBounds && niceMax !== max) {\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({\n value: max\n });\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({\n value: niceMax\n });\n }\n return ticks;\n}\nfunction relativeLabelSize(value, minSpacing, { horizontal , minRotation }) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\nclass LinearScaleBase extends Scale {\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._endValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n return +raw;\n }\n handleTickRangeOptions() {\n const { beginAtZero } = this.options;\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n setMax(max + offset);\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n getTickLimit() {\n const tickOpts = this.options.ticks;\n let { maxTicksLimit , stepSize } = tickOpts;\n let maxTicks;\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n return maxTicks;\n }\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks$1(numericGeneratorOptions, dataRange);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n super.configure();\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n\nclass LinearScale extends LinearScaleBase {\n static id = 'linear';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? min : 0;\n this.max = isNumberFinite(max) ? max : 1;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n\nconst log10Floor = (v)=>Math.floor(log10(v));\nconst changeExponent = (v, m)=>Math.pow(10, log10Floor(v) + m);\nfunction isMajor(tickVal) {\n const remain = tickVal / Math.pow(10, log10Floor(tickVal));\n return remain === 1;\n}\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while(steps(min, max, rangeExp) > 10){\n rangeExp++;\n }\n while(steps(min, max, rangeExp) < 10){\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n function generateTicks(generationOptions, { min , max }) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while(value < max){\n ticks.push({\n value,\n major: isMajor(value),\n significand\n });\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({\n value: lastTick,\n major: isMajor(lastTick),\n significand\n });\n return ticks;\n}\nclass LogarithmicScale extends Scale {\n static id = 'logarithmic';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [\n raw,\n index\n ]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isNumberFinite(value) && value > 0 ? value : null;\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? Math.max(0, min) : null;\n this.max = isNumberFinite(max) ? Math.max(0, max) : null;\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n if (this._zero && this.min !== this._suggestedMin && !isNumberFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n this.handleTickRangeOptions();\n }\n handleTickRangeOptions() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (min === max) {\n if (min <= 0) {\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n setMax(changeExponent(min, +1));\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const opts = this.options;\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n getLabelForValue(value) {\n return value === undefined ? '0' : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n configure() {\n const start = this.min;\n super.configure();\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min ? 0 : (log10(value) - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [\n label\n ];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - size / 2,\n end: pos + size / 2\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n return {\n start: pos,\n end: pos + size\n };\n}\n function fitWithPointLabels(scale) {\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n for(let i = 0; i < valueCount; i++){\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b);\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\nfunction createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const { extra , additionalAngle , padding , size } = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n visible: true,\n x: pointLabelPosition.x,\n y,\n textAlign,\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\nfunction isNotOverlapped(item, area) {\n if (!area) {\n return true;\n }\n const { left , top , right , bottom } = item;\n const apexesInArea = _isPointInArea({\n x: left,\n y: top\n }, area) || _isPointInArea({\n x: left,\n y: bottom\n }, area) || _isPointInArea({\n x: right,\n y: top\n }, area) || _isPointInArea({\n x: right,\n y: bottom\n }, area);\n return !apexesInArea;\n}\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const { centerPointLabels , display } = opts.pointLabels;\n const itemOpts = {\n extra: getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? PI / valueCount : 0\n };\n let area;\n for(let i = 0; i < valueCount; i++){\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n const item = createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === 'auto') {\n item.visible = isNotOverlapped(item, area);\n if (item.visible) {\n area = item;\n }\n }\n }\n return items;\n}\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n return 'right';\n}\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= w / 2;\n }\n return x;\n}\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= h / 2;\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\nfunction drawPointLabelBox(ctx, opts, item) {\n const { left , top , right , bottom } = item;\n const { backdropColor } = opts;\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(opts.borderRadius);\n const padding = toPadding(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n}\nfunction drawPointLabels(scale, labelCount) {\n const { ctx , options: { pointLabels } } = scale;\n for(let i = labelCount - 1; i >= 0; i--){\n const item = scale._pointLabelItems[i];\n if (!item.visible) {\n continue;\n }\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = toFont(optsAtIndex.font);\n const { x , y , textAlign } = item;\n renderText(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n });\n }\n}\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const { ctx } = scale;\n if (circular) {\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n for(let i = 1; i < labelCount; i++){\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n const { color , lineWidth } = gridLineOpts;\n if (!circular && !labelCount || !color || !lineWidth || radius < 0) {\n return;\n }\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\nclass RadialLinearScale extends LinearScaleBase {\n static id = 'radialLinear';\n static defaults = {\n display: true,\n animate: true,\n position: 'chartArea',\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n grid: {\n circular: false\n },\n startAngle: 0,\n ticks: {\n showLabelBackdrop: true,\n callback: Ticks.formatters.numeric\n },\n pointLabels: {\n backdropColor: undefined,\n backdropPadding: 2,\n display: true,\n font: {\n size: 10\n },\n callback (label) {\n return label;\n },\n padding: 5,\n centerPointLabels: false\n }\n };\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n constructor(cfg){\n super(cfg);\n this.xCenter = undefined;\n this.yCenter = undefined;\n this.drawingArea = undefined;\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n setDimensions() {\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(false);\n this.min = isNumberFinite(min) && !isNaN(min) ? min : 0;\n this.max = isNumberFinite(max) && !isNaN(max) ? max : 0;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n this._pointLabels = this.getLabels().map((value, index)=>{\n const label = callback(this.options.pointLabels.callback, [\n value,\n index\n ], this);\n return label || label === 0 ? label : '';\n }).filter((v, i)=>this.chart.getDataVisibility(i));\n }\n fit() {\n const opts = this.options;\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n getPointLabelPosition(index) {\n const { left , top , right , bottom } = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom\n };\n }\n drawBackground() {\n const { backgroundColor , grid: { circular } } = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const { angleLines , grid , border } = opts;\n const labelCount = this._pointLabels.length;\n let i, offset, position;\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n if (grid.display) {\n this.ticks.forEach((tick, index)=>{\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n if (angleLines.display) {\n ctx.save();\n for(i = labelCount - 1; i >= 0; i--){\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const { color , lineWidth } = optsAtIndex;\n if (!lineWidth || !color) {\n continue;\n }\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n ctx.restore();\n }\n }\n drawBorder() {}\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n if (!tickOpts.display) {\n return;\n }\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n this.ticks.forEach((tick, index)=>{\n if (index === 0 && !opts.reverse) {\n return;\n }\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height);\n }\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth\n });\n });\n ctx.restore();\n }\n drawTitle() {}\n}\n\nconst INTERVALS = {\n millisecond: {\n common: true,\n size: 1,\n steps: 1000\n },\n second: {\n common: true,\n size: 1000,\n steps: 60\n },\n minute: {\n common: true,\n size: 60000,\n steps: 60\n },\n hour: {\n common: true,\n size: 3600000,\n steps: 24\n },\n day: {\n common: true,\n size: 86400000,\n steps: 30\n },\n week: {\n common: false,\n size: 604800000,\n steps: 4\n },\n month: {\n common: true,\n size: 2.628e9,\n steps: 12\n },\n quarter: {\n common: false,\n size: 7.884e9,\n steps: 4\n },\n year: {\n common: true,\n size: 3.154e10\n }\n};\n const UNITS = /* #__PURE__ */ Object.keys(INTERVALS);\n function sorter(a, b) {\n return a - b;\n}\n function parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n const adapter = scale._adapter;\n const { parser , round , isoWeekday } = scale._parseOpts;\n let value = input;\n if (typeof parser === 'function') {\n value = parser(value);\n }\n if (!isNumberFinite(value)) {\n value = typeof parser === 'string' ? adapter.parse(value, parser) : adapter.parse(value);\n }\n if (value === null) {\n return null;\n }\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, 'isoWeek', isoWeekday) : adapter.startOf(value, round);\n }\n return +value;\n}\n function determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n for(let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i){\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n return UNITS[ilen - 1];\n}\n function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for(let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--){\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n function determineMajorUnit(unit) {\n for(let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i){\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n function addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const { lo , hi } = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n function setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n for(major = first; major <= last; major = +adapter.add(major, 1, majorUnit)){\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n function ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n const map = {};\n const ilen = values.length;\n let i, value;\n for(i = 0; i < ilen; ++i){\n value = values[i];\n map[value] = i;\n ticks.push({\n value,\n major: false\n });\n }\n return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass TimeScale extends Scale {\n static id = 'time';\n static defaults = {\n bounds: 'data',\n adapters: {},\n time: {\n parser: false,\n unit: false,\n round: false,\n isoWeekday: false,\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n source: 'auto',\n callback: false,\n major: {\n enabled: false\n }\n }\n };\n constructor(props){\n super(props);\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n this._unit = 'day';\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n adapter.init(opts);\n mergeIf(time.displayFormats, adapter.formats());\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n super.init(scaleOpts);\n this._normalized = opts.normalized;\n }\n parse(raw, index) {\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n if (!minDefined || !maxDefined) {\n _applyBounds(this._getLabelBounds());\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {\n min,\n max\n };\n }\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n const min = this.min;\n const max = this.max;\n const ticks = _filterBetween(timestamps, min, max);\n this._unit = timeOpts.unit || (tickOpts.autoSkip ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n if (options.reverse) {\n ticks.reverse();\n }\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n afterAutoSkip() {\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map((tick)=>+tick.value));\n }\n }\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n this._offsets = {\n start,\n end,\n factor: 1 / (start + 1 + end)\n };\n }\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for(time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++){\n addTick(ticks, time, timestamps);\n }\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n return Object.keys(ticks).sort(sorter).map((x)=>+x);\n }\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n if (formatter) {\n return callback(formatter, [\n time,\n index,\n ticks\n ], this);\n }\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n generateTickLabels(ticks) {\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n return {\n w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,\n h: tickLabelWidth * sinRotation + tickFontSize * cosRotation\n };\n }\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [\n exampleTime\n ], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const metas = this.getMatchingVisibleMetas();\n if (this._normalized && metas.length) {\n return this._cache.data = metas[0].controller.getAllParsedValues(this);\n }\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n return this._cache.data = this.normalize(timestamps);\n }\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const labels = this.getLabels();\n for(i = 0, ilen = labels.length; i < ilen; ++i){\n timestamps.push(parse(this, labels[i]));\n }\n return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);\n }\n normalize(values) {\n return _arrayUnique(values.sort(sorter));\n }\n}\n\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({ lo , hi } = _lookupByKey(table, 'pos', val));\n }\n ({ pos: prevSource , time: prevTarget } = table[lo]);\n ({ pos: nextSource , time: nextTarget } = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({ lo , hi } = _lookupByKey(table, 'time', val));\n }\n ({ time: prevSource , pos: prevTarget } = table[lo]);\n ({ time: nextSource , pos: nextTarget } = table[hi]);\n }\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass TimeSeriesScale extends TimeScale {\n static id = 'timeseries';\n static defaults = TimeScale.defaults;\n constructor(props){\n super(props);\n this._table = [];\n this._minPos = undefined;\n this._tableRange = undefined;\n }\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n buildLookupTable(timestamps) {\n const { min , max } = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n for(i = 0, ilen = timestamps.length; i < ilen; ++i){\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n if (items.length < 2) {\n return [\n {\n time: min,\n pos: 0\n },\n {\n time: max,\n pos: 1\n }\n ];\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({\n time: curr,\n pos: i / (ilen - 1)\n });\n }\n }\n return table;\n }\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) {\n timestamps.splice(0, 0, min);\n }\n if (!timestamps.includes(max) || timestamps.length === 1) {\n timestamps.push(max);\n }\n return timestamps.sort((a, b)=>a - b);\n }\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n if (timestamps.length) {\n return timestamps;\n }\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n return timestamps;\n }\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\n\nvar scales = /*#__PURE__*/Object.freeze({\n__proto__: null,\nCategoryScale: CategoryScale,\nLinearScale: LinearScale,\nLogarithmicScale: LogarithmicScale,\nRadialLinearScale: RadialLinearScale,\nTimeScale: TimeScale,\nTimeSeriesScale: TimeSeriesScale\n});\n\nconst registerables = [\n controllers,\n elements,\n plugins,\n scales\n];\n\nexport { Animation, Animations, ArcElement, BarController, BarElement, BasePlatform, BasicPlatform, BubbleController, CategoryScale, Chart, plugin_colors as Colors, DatasetController, plugin_decimation as Decimation, DomPlatform, DoughnutController, Element, index as Filler, Interaction, plugin_legend as Legend, LineController, LineElement, LinearScale, LogarithmicScale, PieController, PointElement, PolarAreaController, RadarController, RadialLinearScale, Scale, ScatterController, plugin_subtitle as SubTitle, Ticks, TimeScale, TimeSeriesScale, plugin_title as Title, plugin_tooltip as Tooltip, adapters as _adapters, _detectPlatform, animator, controllers, defaults, elements, layouts, plugins, registerables, registry, scales };\n//# sourceMappingURL=chart.js.map\n","import {requestAnimFrame} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('./core.animation.js').default } Animation\n * @typedef { import('./core.controller.js').default } Chart\n */\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is export for typedoc\n */\nexport class Animator {\n constructor() {\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n\n /**\n\t * @private\n\t */\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n\n callbacks.forEach(fn => fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n\n /**\n\t * @private\n\t */\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n\n this._request = requestAnimFrame.call(window, () => {\n this._update();\n this._request = null;\n\n if (this._running) {\n this._refresh();\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _update(date = Date.now()) {\n let remaining = 0;\n\n this._charts.forEach((anims, chart) => {\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n\n for (; i >= 0; --i) {\n item = items[i];\n\n if (item._active) {\n if (item._total > anims.duration) {\n // if the animation has been updated and its duration prolonged,\n // update to total duration of current animations run (for progress event)\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n // Remove the item by replacing it with last item and removing the last\n // A lot faster than splice.\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n\n remaining += items.length;\n });\n\n this._lastDate = date;\n\n if (remaining === 0) {\n this._running = false;\n }\n }\n\n /**\n\t * @private\n\t */\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} event - event name\n\t * @param {Function} cb - callback\n\t */\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n\n /**\n\t * Add animations\n\t * @param {Chart} chart\n\t * @param {Animation[]} items - animations\n\t */\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n\n /**\n\t * Counts number of active animations for the chart\n\t * @param {Chart} chart\n\t */\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n\n /**\n\t * Start animating (all charts)\n\t * @param {Chart} chart\n\t */\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n\n /**\n\t * Stop all animations for the chart\n\t * @param {Chart} chart\n\t */\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n\n for (; i >= 0; --i) {\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n\n /**\n\t * Remove chart from Animator\n\t * @param {Chart} chart\n\t */\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Animator();\n","import effects from '../helpers/helpers.easing.js';\nimport {resolve} from '../helpers/helpers.options.js';\nimport {color as helpersColor} from '../helpers/helpers.color.js';\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean(from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n /**\n * @param {string} from\n * @param {string} to\n * @param {number} factor\n */\n color(from, to, factor) {\n const c0 = helpersColor(from || transparent);\n const c1 = c0.valid && helpersColor(to || transparent);\n return c1 && c1.valid\n ? c1.mix(c0, factor).hexString()\n : to;\n },\n number(from, to, factor) {\n return from + (to - from) * factor;\n }\n};\n\nexport default class Animation {\n constructor(cfg, target, prop, to) {\n const currentValue = target[prop];\n\n to = resolve([cfg.to, to, currentValue, cfg.from]);\n const from = resolve([cfg.from, currentValue, to]);\n\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n\n active() {\n return this._active;\n }\n\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([cfg.to, to, currentValue, cfg.from]);\n this._from = resolve([cfg.from, currentValue, to]);\n }\n }\n\n cancel() {\n if (this._active) {\n // update current evaluated value, for smoother animations\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n\n this._active = from !== to && (loop || (elapsed < duration));\n\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n\n factor = (elapsed / duration) % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n\n this._target[prop] = this._fn(from, to, factor);\n }\n\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej) => {\n promises.push({res, rej});\n });\n }\n\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for (let i = 0; i < promises.length; i++) {\n promises[i][method]();\n }\n }\n}\n","import animator from './core.animator.js';\nimport Animation from './core.animation.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isObject} from '../helpers/helpers.core.js';\n\nexport default class Animations {\n constructor(chart, config) {\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n\n Object.getOwnPropertyNames(config).forEach(key => {\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions) {\n resolved[option] = cfg[option];\n }\n\n (isArray(cfg.properties) && cfg.properties || [key]).forEach((prop) => {\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n\n /**\n\t * Utility to handle animation of `options`.\n\t * @private\n\t */\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n // Going to shared options:\n // After all animations are done, assign the shared options object to the element\n // So any new updates to the shared options are observed\n awaitAll(target.options.$animations, newOptions).then(() => {\n target.options = newOptions;\n }, () => {\n // rejected, noop\n });\n }\n\n return animations;\n }\n\n /**\n\t * @private\n\t */\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n\n for (i = props.length - 1; i >= 0; --i) {\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n\n if (animation) {\n if (cfg && animation.active()) {\n // There is an existing active animation, let's update that\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n // not animated, set directly to new value\n target[prop] = value;\n continue;\n }\n\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n\n\n /**\n\t * Update `target` properties to new values, using configured animations\n\t * @param {object} target - object to update\n\t * @param {object} values - new target properties\n\t * @returns {boolean|undefined} - `true` if animations were started\n\t **/\n update(target, values) {\n if (this._properties.size === 0) {\n // Nothing is animated, just apply the new values.\n Object.assign(target, values);\n return;\n }\n\n const animations = this._createAnimations(target, values);\n\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\n\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for (let i = 0; i < keys.length; i++) {\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n // @ts-ignore\n return Promise.all(running);\n}\n\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n // Going from shared options to distinct one:\n // Create new options object containing the old shared values and start updating that.\n target.options = options = Object.assign({}, options, {$shared: false, $animations: {}});\n }\n return options;\n}\n","import Animations from './core.animations.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isFinite, isObject, valueOrDefault, resolveObjectKey, defined} from '../helpers/helpers.core.js';\nimport {listenArrayEvents, unlistenArrayEvents} from '../helpers/helpers.collection.js';\nimport {createContext, sign} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('./core.scale.js').default } Scale\n */\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\n\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\n\nfunction toClip(value) {\n let t, r, b, l;\n\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\n\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n keys.push(metasets[i].index);\n }\n return keys;\n}\n\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n\n if (value === null) {\n return;\n }\n\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) {\n value += otherValue;\n }\n }\n return value;\n}\n\nfunction convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\n\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || (stacked === undefined && meta.stack !== undefined);\n}\n\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\n\nfunction getUserBounds(scale) {\n const {min, max, minDefined, maxDefined} = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\n\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\n\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {\n const value = stack[meta.index];\n if ((positive && value > 0) || (!positive && value < 0)) {\n return meta.index;\n }\n }\n\n return null;\n}\n\nfunction updateStacks(controller, parsed) {\n const {chart, _cachedMeta: meta} = controller;\n const stacks = chart._stacks || (chart._stacks = {}); // map structure is {stackKey: {datasetIndex: value}}\n const {iScale, vScale, index: datasetIndex} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n\n for (let i = 0; i < ilen; ++i) {\n const item = parsed[i];\n const {[iAxis]: index, [vAxis]: value} = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\n\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter(key => scales[key].axis === axis).shift();\n}\n\nfunction createDatasetContext(parent, index) {\n return createContext(parent,\n {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n }\n );\n}\n\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\n\nfunction clearStacks(meta, items) {\n // Not using meta.index here, because it might be already updated if the dataset changed location\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n\n items = items || meta._parsed;\n for (const parsed of items) {\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n delete stacks[axis]._visualValues[datasetIndex];\n }\n }\n}\n\nconst isDirectUpdateMode = (mode) => mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked\n && {keys: getSortedDatasetIndices(chart, true), values: null};\n\nexport default class DatasetController {\n\n /**\n * @type {any}\n */\n static defaults = {};\n\n /**\n * Element type used to generate a meta dataset (e.g. Chart.element.LineElement).\n */\n static datasetElementType = null;\n\n /**\n * Element type used to generate a meta data (e.g. Chart.element.PointElement).\n */\n static dataElementType = null;\n\n /**\n\t * @param {Chart} chart\n\t * @param {number} datasetIndex\n\t */\n constructor(chart, datasetIndex) {\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n /** @type {boolean | object} */\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n\n this.initialize();\n }\n\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n 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\");\n }\n }\n\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n\n const chooseId = (axis, x, y, r) => axis === 'x' ? x : axis === 'r' ? r : y;\n\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n\n /**\n\t * @param {string} scaleID\n\t * @return {Scale}\n\t */\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n\n /**\n\t * @private\n\t */\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale\n ? meta.vScale\n : meta.iScale;\n }\n\n reset() {\n this._update('reset');\n }\n\n /**\n\t * @private\n\t */\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n\n /**\n\t * @private\n\t */\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n\n // In order to correctly handle data addition/deletion animation (and thus simulate\n // real-time charts), we need to monitor these data modifications and synchronize\n // the internal metadata accordingly.\n\n if (isObject(data)) {\n this._data = convertObjectDataToArray(data);\n } else if (_data !== data) {\n if (_data) {\n // This case happens when the user replaced the data array instance.\n unlistenArrayEvents(_data, this);\n // Discard old parsed data and stacks\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n\n addElements() {\n const meta = this._cachedMeta;\n\n this._dataCheck();\n\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n\n this._dataCheck();\n\n // make sure cached _stacked status is current\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n\n // detect change in stack option\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n // remove values from old stack\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n\n // Re-sync meta data in case the user replaced the data array or if we missed\n // any updates and so make sure that we handle number of datapoints changing.\n this._resyncElements(resetNewElements);\n\n // if stack changed, update stack values for the whole dataset\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n }\n }\n\n /**\n\t * Merges user-supplied and default dataset-level options\n\t * @private\n\t */\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n\n /**\n\t * @param {number} start\n\t * @param {number} count\n\t */\n parse(start, count) {\n const {_cachedMeta: meta, _data: data} = this;\n const {iScale, _stacked} = meta;\n const iAxis = iScale.axis;\n\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n\n const isNotInOrderComparedToPrev = () => cur[iAxis] === null || (prev && cur[iAxis] < prev[iAxis]);\n for (i = 0; i < count; ++i) {\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n\n /**\n\t * Parse array of primitive values\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [1,3,4]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {xScale0: 0, yScale0: 1}\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [[1,2],[3,4]]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {x: 0, y: 1}\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [{x:1, y:5}, {x:2, y:10}]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id. _custom is optional\n\t * Example: {xScale0: 0, yScale0: 1, _custom: {r: 10, foo: 'bar'}}\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n\n /**\n\t * @protected\n\t */\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n\n /**\n\t * @protected\n\t */\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return applyStack(stack, value, meta.index, {mode});\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n\n /**\n\t * @protected\n\t */\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n const {min: otherMin, max: otherMax} = getUserBounds(otherScale);\n let i, parsed;\n\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n\n for (i = 0; i < ilen; ++i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n // if the data is sorted, we don't need to check further from this end of array\n break;\n }\n }\n if (sorted) {\n // in the sorted case, find first non-skipped value from other end of array\n for (i = ilen - 1; i >= 0; --i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n\n for (i = 0, ilen = parsed.length; i < ilen; ++i) {\n value = parsed[i][scale.axis];\n if (isFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return false;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n\n /**\n\t * @private\n\t */\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {} // eslint-disable-line no-unused-vars\n\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || (elements.length - start);\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n\n for (i = start; i < start + count; ++i) {\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n\n for (i = 0; i < active.length; ++i) {\n active[i].draw(ctx, area);\n }\n }\n\n /**\n\t * Returns a set of predefined style properties that should be used to represent the dataset\n\t * or the data if the index is specified\n\t * @param {number} index - data index\n\t * @param {boolean} [active] - true if hover\n\t * @return {object} style object\n\t */\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset\n ? this.resolveDatasetElementOptions(mode)\n : this.resolveDataElementOptions(index || 0, mode);\n }\n\n /**\n\t * @protected\n\t */\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context ||\n (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context ||\n (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n\n /**\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n\n /**\n\t * @private\n\t */\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [`${elementType}Hover`, 'hover', elementType, ''] : [elementType, ''];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n // context is provided as a function, and is called only if needed,\n // so we don't create a context for each element if not needed.\n const context = () => this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n\n if (values.$shared) {\n // `$shared` indicates this set of options can be shared between multiple elements.\n // Sharing is used to reduce number of properties to change during animation.\n values.$shared = sharing;\n\n // We cache options by `mode`, which can be 'active' for example. This enables us\n // to have the 'active' element options and 'default' options to switch between\n // when interacting.\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n\n return values;\n }\n\n\n /**\n\t * @private\n\t */\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n\n /**\n\t * Utility for getting the options object shared between elements\n\t * @protected\n\t */\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n\n /**\n\t * Utility for determining if `options` should be included in the updated properties\n\t * @protected\n\t */\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n\n /**\n * @todo v4, rename to getSharedOptions and remove excess functions\n */\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || (sharedOptions !== previouslySharedOptions);\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {sharedOptions, includeOptions};\n }\n\n /**\n\t * Utility for updating an element with new properties, using animations when appropriate.\n\t * @protected\n\t */\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n\n /**\n\t * Utility to animate the shared options, that are potentially affecting multiple elements.\n\t * @protected\n\t */\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n\n /**\n\t * @private\n\t */\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n // When going from active to inactive, we need to update to the shared options.\n // This way the once hovered element will end up with the same original shared options instance, after animation.\n options: (!active && this.getSharedOptions(options)) || options\n });\n }\n\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n\n /**\n\t * @private\n\t */\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n\n /**\n\t * @private\n\t */\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n\n /**\n\t * @private\n\t */\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n\n // Apply changes detected through array listeners\n for (const [method, arg1, arg2] of this._syncList) {\n this[method](arg1, arg2);\n }\n this._syncList = [];\n\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n\n if (count) {\n // TODO: It is not optimal to always parse the old data\n // This is done because we are not detecting direct assignments:\n // chart.data.datasets[0].data[5] = 10;\n // chart.data.datasets[0].data[5].y = 10;\n this.parse(0, count);\n }\n\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n\n /**\n\t * @private\n\t */\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n\n const move = (arr) => {\n arr.length += count;\n for (i = arr.length - 1; i >= end; i--) {\n arr[i] = arr[i - count];\n }\n };\n move(data);\n\n for (i = start; i < end; ++i) {\n data[i] = new this.dataElementType();\n }\n\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n\n updateElements(element, start, count, mode) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @private\n\t */\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n\n /**\n\t * @private\n */\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([this.index, ...args]);\n }\n\n _onDataPush() {\n const count = arguments.length;\n this._sync(['_insertElements', this.getDataset().data.length - count, count]);\n }\n\n _onDataPop() {\n this._sync(['_removeElements', this._cachedMeta.data.length - 1, 1]);\n }\n\n _onDataShift() {\n this._sync(['_removeElements', 0, 1]);\n }\n\n _onDataSplice(start, count) {\n if (count) {\n this._sync(['_removeElements', start, count]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync(['_insertElements', start, newCount]);\n }\n }\n\n _onDataUnshift() {\n this._sync(['_insertElements', 0, arguments.length]);\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {\n _arrayUnique, isArray, isNullOrUndef,\n valueOrDefault, resolveObjectKey, sign, defined\n} from '../helpers/index.js';\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n\n for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));\n }\n return scale._cache.$bar;\n}\n\n/**\n * Computes the \"optimal\" sample size to maintain bars equally sized while preventing overlap.\n * @private\n */\nfunction computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = () => {\n if (curr === 32767 || curr === -32768) {\n // Ignore truncated pixels\n return;\n }\n if (defined(prev)) {\n // curr - prev === 0 is ignored\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n\n for (i = 0, ilen = values.length; i < ilen; ++i) {\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n\n prev = undefined;\n for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) {\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n\n return min;\n}\n\n/**\n * Computes an \"ideal\" category based on the absolute bar thickness or, if undefined or null,\n * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This\n * mode currently always generates bars equally sized (until we introduce scriptable options?).\n * @private\n */\nfunction computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n // When bar thickness is enforced, category and bar percentages are ignored.\n // Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n // and deprecate barPercentage since this value is ignored when thickness is absolute.\n size = thickness * stackCount;\n ratio = 1;\n }\n\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - (size / 2)\n };\n}\n\n/**\n * Computes an \"optimal\" category that globally arranges bars side by side (no gap when\n * percentage options are 1), based on the previous and following categories. This mode\n * generates bars with different widths when data are not evenly spaced.\n * @private\n */\nfunction computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n\n if (prev === null) {\n // first data: its size is double based on the next point or,\n // if it's also the last data, we use the scale size.\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n\n if (next === null) {\n // last data: its size is also double based on the previous point.\n next = curr + curr - prev;\n }\n\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\n\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n\n // Store `barEnd` (furthest away from origin) as parsed value,\n // to make stacking straight forward\n item[vScale.axis] = barEnd;\n\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\n\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\n\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n\n for (i = start, ilen = start + count; i < ilen; ++i) {\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\n\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\n\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\n\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {start, end, reverse, top, bottom};\n}\n\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n\n if (edge === true) {\n properties.borderSkipped = {top: true, right: true, bottom: true, left: true};\n return;\n }\n\n const {start, end, reverse, top, bottom} = borderProps(properties);\n\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\n\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\n\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\n\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\n\nfunction setInflateAmount(properties, {inflateAmount}, ratio) {\n properties.inflateAmount = inflateAmount === 'auto'\n ? ratio === 1 ? 0.33 : 0\n : inflateAmount;\n}\n\nexport default class BarController extends DatasetController {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'base', 'width', 'height']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true,\n }\n }\n };\n\n\n /**\n\t * Overriding primitive data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding array data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding object data parsing since we support mixed primitive/array\n\t * value-scale data for float bars\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n // float bar: only one end of the bar is considered by `super`\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const {iScale, vScale} = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom)\n ? '[' + custom.start + ', ' + custom.end + ']'\n : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n\n initialize() {\n this.enableOptionSharing = true;\n\n super.initialize();\n\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const {index, _cachedMeta: {vScale}} = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n\n for (let i = start; i < start + count; i++) {\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {base, head: base} : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index === stack._top || index === stack._bottom),\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n\n /**\n\t * Returns the stacks based on groups and bar visibility.\n\t * @param {number} [last] - The dataset index\n\t * @param {number} [dataIndex] - The data index of the ruler\n\t * @returns {string[]} The list of stack IDs\n\t * @private\n\t */\n _getStacks(last, dataIndex) {\n const {iScale} = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type)\n .filter(meta => meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n\n const skipNull = (meta) => {\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n\n for (const meta of metasets) {\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n\n // stacked | meta.stack\n // | found | not found | undefined\n // false | x | x | x\n // true | | x |\n // undefined | | x | x\n if (stacked === false || stacks.indexOf(meta.stack) === -1 ||\n\t\t\t\t(stacked === undefined && meta.stack === undefined)) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n\n // No stacks? that means there is no visible data. Let's still initialize an `undefined`\n // stack where possible invisible bars will be located.\n // https://github.com/chartjs/Chart.js/issues/6368\n if (!stacks.length) {\n stacks.push(undefined);\n }\n\n return stacks;\n }\n\n /**\n\t * Returns the effective number of stacks based on groups and bar visibility.\n\t * @private\n\t */\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n\n /**\n\t * Returns the stack index for the given dataset based on groups and bar visibility.\n\t * @param {number} [datasetIndex] - The dataset index\n\t * @param {string} [name] - The stack name to find\n * @param {number} [dataIndex]\n\t * @returns {number} The stack index\n\t * @private\n\t */\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = (name !== undefined)\n ? stacks.indexOf(name)\n : -1; // indexOf returns -1 if element is not present\n\n return (index === -1)\n ? stacks.length - 1\n : index;\n }\n\n /**\n\t * @private\n\t */\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n\n for (i = 0, ilen = meta.data.length; i < ilen; ++i) {\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n // bar thickness ratio used for non-grouped bars\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n\n /**\n\t * Note: pixel values are not clamped to the scale area.\n\t * @private\n\t */\n _calculateBarValuePixels(index) {\n const {_cachedMeta: {vScale, _stacked, index: datasetIndex}, options: {base: baseValue, minBarLength}} = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n\n if (length !== value) {\n start = length - value;\n length = value;\n }\n\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n // bars crossing origin are not stacked\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n // When not visible, no height\n head = base;\n }\n\n size = head - base;\n\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n\n if (_stacked && !floating) {\n // visual data coordinates after applying minBarLength\n parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n }\n\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n\n /**\n\t * @private\n\t */\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex'\n ? computeFlexCategoryTraits(index, ruler, options, stackCount)\n : computeFitCategoryTraits(index, ruler, options, stackCount);\n\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n // For non-grouped bar charts, exact pixel values are used\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n\n for (; i < ilen; ++i) {\n if (this.getParsed(i)[vScale.axis] !== null) {\n rects[i].draw(this._ctx);\n }\n }\n }\n\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {valueOrDefault} from '../helpers/helpers.core.js';\n\nexport default class BubbleController extends DatasetController {\n\n static id = 'bubble';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'borderWidth', 'radius']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n\n /**\n\t * Parse array of primitive values\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n\n update(mode) {\n const points = this._cachedMeta.data;\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n\n if (reset) {\n properties.options.radius = 0;\n }\n }\n\n this.updateElement(point, i, properties, mode);\n }\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n\n // In case values were cached (and thus frozen), we need to clone the values\n if (values.$shared) {\n values = Object.assign({}, values, {$shared: false});\n }\n\n // Custom radius resolution\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n\n return values;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isObject, resolveObjectKey, toPercentage, toDimension, valueOrDefault} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {toRadians, PI, TAU, HALF_PI, _angleBetween} from '../helpers/helpers.math.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n // If the chart's circumference isn't a full circle, calculate size as a ratio of the width/height of the arc\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {ratioX, ratioY, offsetX, offsetY};\n}\n\nexport default class DoughnutController extends DatasetController {\n\n static id = 'doughnut';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n // Boolean - Whether we animate the rotation of the Doughnut\n animateRotate: true,\n // Boolean - Whether we animate scaling the Doughnut from the centre\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['circumference', 'endAngle', 'innerRadius', 'outerRadius', 'startAngle', 'x', 'y', 'offset', 'borderWidth', 'spacing']\n },\n },\n // The percentage of the chart that we cut out of the middle.\n cutout: '50%',\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%',\n\n // Spacing between arcs\n spacing: 0,\n\n indexAxis: 'r',\n };\n\n static descriptors = {\n _scriptable: (name) => name !== 'spacing',\n _indexable: (name) => name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash'),\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n // Need to override these to give a nice default\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n\n linkScales() {}\n\n /**\n\t * Override data parsing, since we are not using scales\n\t */\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i) => +data[i];\n\n if (isObject(data[start])) {\n const {key = 'value'} = this._parsing;\n getter = (i) => +resolveObjectKey(data[i], key);\n }\n\n let i, ilen;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n meta._parsed[i] = getter(i);\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n\n /**\n\t * @private\n\t */\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n\n /**\n\t * Get the maximal rotation & circumference extents\n\t * across all visible datasets.\n\t */\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n\n for (let i = 0; i < this.chart.data.datasets.length; ++i) {\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n\n return {\n rotation: min,\n circumference: max - min,\n };\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {\n const chart = this.chart;\n const {chartArea} = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n\n // Compute the maximal rotation & circumference limits.\n // If we only consider our dataset, this can cause problems when two datasets\n // are both less than a circle with different rotations (starting angles)\n const {circumference, rotation} = this._getRotationExtents();\n const {ratioX, ratioY, offsetX, offsetY} = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n\n meta.total = this.calculateTotal();\n\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @private\n */\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if ((reset && opts.animation.animateRotate) || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n\n for (i = 0; i < start; ++i) {\n startAngle += this._circumference(i, reset);\n }\n\n for (i = start; i < start + count; ++i) {\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n\n for (i = 0; i < metaData.length; i++) {\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n\n return total;\n }\n\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n\n if (!arcs) {\n // Find the outmost visible dataset\n for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n\n if (!arcs) {\n return 0;\n }\n\n for (i = 0, ilen = arcs.length; i < ilen; ++i) {\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n\n getMaxOffset(arcs) {\n let max = 0;\n\n for (let i = 0, ilen = arcs.length; i < ilen; ++i) {\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n\n /**\n\t * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly\n\t * @private\n\t */\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n\n for (let i = 0; i < datasetIndex; ++i) {\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n\n return ringWeightOffset;\n }\n\n /**\n\t * @private\n\t */\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n\n /**\n\t * Returns the sum of all visible data set weights.\n\t * @private\n\t */\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class LineController extends DatasetController {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n\n showLine: true,\n spanGaps: false,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n },\n _value_: {\n type: 'linear',\n },\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {dataset: line, data: points = [], _dataset} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = 0; i < pointsCount; ++i) {\n const point = points[i];\n const properties = directUpdate ? point : {};\n\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {toRadians, PI, formatNumber, _parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class PolarAreaController extends DatasetController {\n\n static id = 'polarArea';\n\n /**\n * @type {any}\n */\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'startAngle', 'endAngle', 'innerRadius', 'outerRadius']\n },\n },\n indexAxis: 'r',\n startAngle: 0,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const arcs = this._cachedMeta.data;\n\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @protected\n */\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n\n meta.data.forEach((element, index) => {\n const parsed = this.getParsed(index).r;\n\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n\n return range;\n }\n\n /**\n\t * @private\n\t */\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? (outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n\n this.outerRadius = outerRadius - (radiusLength * this.index);\n this.innerRadius = this.outerRadius - radiusLength;\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n\n const defaultAngle = 360 / this.countVisibleElements();\n\n for (i = 0; i < start; ++i) {\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for (i = start; i < start + count; i++) {\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n\n meta.data.forEach((element, index) => {\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n\n return count;\n }\n\n /**\n\t * @private\n\t */\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index)\n ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle)\n : 0;\n }\n}\n","import DoughnutController from './controller.doughnut.js';\n\n// Pie charts are Doughnut chart with different defaults\nexport default class PieController extends DoughnutController {\n\n static id = 'pie';\n\n /**\n * @type {any}\n */\n static defaults = {\n // The percentage of the chart that we cut out of the middle.\n cutout: 0,\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%'\n };\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {_parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class RadarController extends DatasetController {\n\n static id = 'radar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n },\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n scales: {\n r: {\n type: 'radialLinear',\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n\n // Update Line\n line.points = points;\n // In resize mode only point locations change, so no need to set the points or options.\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n\n this.updateElement(line, undefined, properties, mode);\n }\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class ScatterController extends DatasetController {\n\n static id = 'scatter';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n\n interaction: {\n mode: 'point'\n },\n\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {data: points = []} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n if (this.options.showLine) {\n\n // https://github.com/chartjs/Chart.js/issues/11333\n if (!this.datasetElementType) {\n this.addElements();\n }\n const {dataset: line, _dataset} = meta;\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n } else if (this.datasetElementType) {\n // https://github.com/chartjs/Chart.js/issues/11333\n delete meta.dataset;\n this.datasetElementType = false;\n }\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n addElements() {\n const {showLine} = this.options;\n\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n\n super.addElements();\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = start; i < start + count; ++i) {\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n\n if (!this.options.showLine) {\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n\n if (!data.length) {\n return border;\n }\n\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n","/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartOptions} from '../types/index.js';\n\nexport type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';\n\nexport interface DateAdapter {\n readonly options: T;\n /**\n * Will called with chart options after adapter creation.\n */\n init(this: DateAdapter, chartOptions: ChartOptions): void;\n /**\n * Returns a map of time formats for the supported formatting units defined\n * in Unit as well as 'datetime' representing a detailed date/time string.\n */\n formats(this: DateAdapter): Record;\n /**\n * Parses the given `value` and return the associated timestamp.\n * @param value - the value to parse (usually comes from the data)\n * @param [format] - the expected data format\n */\n parse(this: DateAdapter, value: unknown, format?: TimeUnit): number | null;\n /**\n * Returns the formatted date in the specified `format` for a given `timestamp`.\n * @param timestamp - the timestamp to format\n * @param format - the date/time token\n */\n format(this: DateAdapter, timestamp: number, format: TimeUnit): string;\n /**\n * Adds the specified `amount` of `unit` to the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param amount - the amount to add\n * @param unit - the unit as string\n */\n add(this: DateAdapter, timestamp: number, amount: number, unit: TimeUnit): number;\n /**\n * Returns the number of `unit` between the given timestamps.\n * @param a - the input timestamp (reference)\n * @param b - the timestamp to subtract\n * @param unit - the unit as string\n */\n diff(this: DateAdapter, a: number, b: number, unit: TimeUnit): number;\n /**\n * Returns start of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n * @param [weekday] - the ISO day of the week with 1 being Monday\n * and 7 being Sunday (only needed if param *unit* is `isoWeek`).\n */\n startOf(this: DateAdapter, timestamp: number, unit: TimeUnit | 'isoWeek', weekday?: number): number;\n /**\n * Returns end of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n */\n endOf(this: DateAdapter, timestamp: number, unit: TimeUnit | 'isoWeek'): number;\n}\n\nfunction abstract(): T {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */\nclass DateAdapterBase implements DateAdapter {\n\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */\n static override(\n members: Partial, 'options'>>\n ) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n\n readonly options: AnyObject;\n\n constructor(options: AnyObject) {\n this.options = options || {};\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n\n formats(): Record {\n return abstract();\n }\n\n parse(): number | null {\n return abstract();\n }\n\n format(): string {\n return abstract();\n }\n\n add(): number {\n return abstract();\n }\n\n diff(): number {\n return abstract();\n }\n\n startOf(): number {\n return abstract();\n }\n\n endOf(): number {\n return abstract();\n }\n}\n\nexport default {\n _date: DateAdapterBase\n};\n","import {_lookupByKey, _rlookupByKey} from '../helpers/helpers.collection.js';\nimport {getRelativePosition} from '../helpers/helpers.dom.js';\nimport {_angleBetween, getAngleFromPoint} from '../helpers/helpers.math.js';\nimport {_isPointInArea} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef {{axis?: string, intersect?: boolean, includeInvisible?: boolean}} InteractionOptions\n * @typedef {{datasetIndex: number, index: number, element: import('./core.element.js').default}} InteractionItem\n * @typedef { import('../types/index.js').Point } Point\n */\n\n/**\n * Helper function to do binary search when possible\n * @param {object} metaset - the dataset meta\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {number} value - the value to find\n * @param {boolean} [intersect] - should the element intersect\n * @returns {{lo:number, hi:number}} indices to search data array between\n */\nfunction binarySearch(metaset, axis, value, intersect) {\n const {controller, data, _sorted} = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n // _sharedOptions indicates that each element has equal options -> equal proportions\n // So we can do a ranged binary search based on the range of first element and\n // be confident to get the full range of indices that can intersect with the value.\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {lo: start.lo, hi: end.hi};\n }\n }\n }\n // Default to all elements, when binary search can not be used.\n return {lo: 0, hi: data.length - 1};\n}\n\n/**\n * Helper function to select candidate elements for interaction\n * @param {Chart} chart - the chart\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {function} handler - the callback to execute for each visible item\n * @param {boolean} [intersect] - consider intersecting items\n */\nfunction evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for (let i = 0, ilen = metasets.length; i < ilen; ++i) {\n const {index, data} = metasets[i];\n const {lo, hi} = binarySearch(metasets[i], axis, value, intersect);\n for (let j = lo; j <= hi; ++j) {\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n\n/**\n * Get a distance metric function for two points based on the\n * axis mode setting\n * @param {string} axis - the axis mode. x|y|xy|r\n */\nfunction getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n\n/**\n * Helper function to get the items that intersect the event position\n * @param {Chart} chart - the chart\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({element, datasetIndex, index});\n }\n };\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a radial chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n\n function evaluationFunc(element, datasetIndex, index) {\n const {startAngle, endAngle} = element.getProps(['startAngle', 'endAngle'], useFinalPosition);\n const {angle} = getAngleFromPoint(element, {x: position.x, y: position.y});\n\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a cartesian chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [{element, datasetIndex, index}];\n minDistance = distance;\n } else if (distance === minDistance) {\n // Can have multiple items at the same distance in which case we sort by size\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position considering all visible items in the chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n\n return axis === 'r' && !intersect\n ? getNearestRadialItems(chart, position, axis, useFinalPosition)\n : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n\n/**\n * Helper function to get the items matching along the given X or Y axis\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis to match\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index) => {\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({element, datasetIndex, index});\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n\n // If we want to trigger on an intersect and we don't have any items\n // that intersect the position, return nothing\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n\n/**\n * Contains interaction related functions\n * @namespace Chart.Interaction\n */\nexport default {\n // Part of the public API to facilitate developers creating their own modes\n evaluateInteractionItems,\n\n // Helper function for different modes\n modes: {\n /**\n\t\t * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\n\t\t * @function Chart.Interaction.modes.index\n\t\t * @since v2.4.0\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n index(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n // Default axis for index mode is 'x' to match old behaviour\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible)\n : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n\n if (!items.length) {\n return [];\n }\n\n chart.getSortedVisibleDatasetMetas().forEach((meta) => {\n const index = items[0].index;\n const element = meta.data[index];\n\n // don't count items that are skipped (null data)\n if (element && !element.skip) {\n elements.push({element, datasetIndex: meta.index, index});\n }\n });\n\n return elements;\n },\n\n /**\n\t\t * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect is false, we find the nearest item and return the items in that dataset\n\t\t * @function Chart.Interaction.modes.dataset\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n dataset(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) :\n getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for (let i = 0; i < data.length; ++i) {\n items.push({element: data[i], datasetIndex, index: i});\n }\n }\n\n return items;\n },\n\n /**\n\t\t * Point mode returns all elements that hit test based on the event position\n\t\t * of the event\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n point(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * nearest mode returns the element closest to the point\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n nearest(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * x mode returns the elements that hit-test at the current x coordinate\n\t\t * @function Chart.Interaction.modes.x\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n x(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n\n /**\n\t\t * y mode returns the elements that hit-test at the current y coordinate\n\t\t * @function Chart.Interaction.modes.y\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n y(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n","import {defined, each, isObject} from '../helpers/helpers.core.js';\nimport {toPadding} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n */\n\nconst STATIC_POSITIONS = ['left', 'top', 'right', 'bottom'];\n\nfunction filterByPosition(array, position) {\n return array.filter(v => v.pos === position);\n}\n\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter(v => STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\n\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b) => {\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ?\n v0.index - v1.index :\n v0.weight - v1.weight;\n });\n}\n\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n\n for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\n box = boxes[i];\n ({position: pos, options: {stack, stackWeight = 1}} = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && (pos + stack),\n stackWeight\n });\n }\n return layoutBoxes;\n}\n\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts) {\n const {stack, pos, stackWeight} = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {count: 0, placed: 0, weight: 0, size: 0});\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n\n/**\n * store dimensions used instead of available chartArea in fitBoxes\n **/\nfunction setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const {vBoxMaxWidth, hBoxMaxHeight} = params;\n let i, ilen, layout;\n for (i = 0, ilen = layouts.length; i < ilen; ++i) {\n layout = layouts[i];\n const {fullSize} = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\n\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter(wrap => wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\n\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\n\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\n\nfunction updateDims(chartArea, params, layout, stacks) {\n const {pos, box} = layout;\n const maxPadding = chartArea.maxPadding;\n\n // dynamically placed boxes size is not considered\n if (!isObject(pos)) {\n if (layout.size) {\n // this layout was already counted for, lets first reduce old size\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {size: 0, count: 1};\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n\n // return booleans on the changes per direction\n return layout.horizontal\n ? {same: widthChanged, other: heightChanged}\n : {same: heightChanged, other: widthChanged};\n}\n\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\n\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function marginForPositions(positions) {\n const margin = {left: 0, top: 0, right: 0, bottom: 0};\n positions.forEach((pos) => {\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n\n return horizontal\n ? marginForPositions(['left', 'right'])\n : marginForPositions(['top', 'bottom']);\n}\n\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n\n for (i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i) {\n layout = boxes[i];\n box = layout.box;\n\n box.update(\n layout.width || chartArea.w,\n layout.height || chartArea.h,\n getMargins(layout.horizontal, chartArea)\n );\n const {same, other} = updateDims(chartArea, params, layout, stacks);\n\n // Dimensions changed and there were non full width boxes before this\n // -> we have to refit those\n refit |= same && refitBoxes.length;\n\n // Chart area changed in the opposite direction\n changed = changed || other;\n\n if (!box.fullSize) { // fullSize boxes don't need to be re-fitted in any case\n refitBoxes.push(layout);\n }\n }\n\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\n\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\n\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let {x, y} = chartArea;\n\n for (const layout of boxes) {\n const box = layout.box;\n const stack = stacks[layout.stack] || {count: 1, placed: 0, weight: 1};\n const weight = (layout.stackWeight / stack.weight) || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n\n chartArea.x = x;\n chartArea.y = y;\n}\n\n/**\n * @interface LayoutItem\n * @typedef {object} LayoutItem\n * @prop {string} position - The position of the item in the chart layout. Possible values are\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\n * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area\n * @prop {boolean} fullSize - if true, and the item is horizontal, then push vertical boxes down\n * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\n * @prop {function} update - Takes two parameters: width and height. Returns size of item\n * @prop {function} draw - Draws the element\n * @prop {function} [getPadding] - Returns an object with padding on the edges\n * @prop {number} width - Width of item. Must be valid after update()\n * @prop {number} height - Height of item. Must be valid after update()\n * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update\n * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update\n * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update\n * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\n */\n\n// The layout service is very self explanatory. It's responsible for the layout within a chart.\n// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\n// It is this service's responsibility of carrying out that layout.\nexport default {\n\n /**\n\t * Register a box to a chart.\n\t * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\n\t * @param {Chart} chart - the chart to use\n\t * @param {LayoutItem} item - the item to add to be laid out\n\t */\n addBox(chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n\n // initialize item with default values\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n // @ts-ignore\n item._layers = item._layers || function() {\n return [{\n z: 0,\n draw(chartArea) {\n item.draw(chartArea);\n }\n }];\n };\n\n chart.boxes.push(item);\n },\n\n /**\n\t * Remove a layoutItem from a chart\n\t * @param {Chart} chart - the chart to remove the box from\n\t * @param {LayoutItem} layoutItem - the item to remove from the layout\n\t */\n removeBox(chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n\n /**\n\t * Sets (or updates) options on the given `item`.\n\t * @param {Chart} chart - the chart in which the item lives (or will be added to)\n\t * @param {LayoutItem} item - the item to configure with the given options\n\t * @param {object} options - the new item options.\n\t */\n configure(chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n\n /**\n\t * Fits boxes of the given chart into the given size by having each box measure itself\n\t * then running a fitting algorithm\n\t * @param {Chart} chart - the chart\n\t * @param {number} width - the width to fit into\n\t * @param {number} height - the height to fit into\n * @param {number} minPadding - minimum padding required for each side of chart area\n\t */\n update(chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n\n // Before any changes are made, notify boxes that an update is about to being\n // This is used to clear any cached data (e.g. scale limits)\n each(chart.boxes, box => {\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n\n // Essentially we now have any number of boxes on each of the 4 sides.\n // Our canvas looks like the following.\n // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\n // B1 is the bottom axis\n // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\n // These locations are single-box locations only, when trying to register a chartArea location that is already taken,\n // an error will be thrown.\n //\n // |----------------------------------------------------|\n // | T1 (Full Width) |\n // |----------------------------------------------------|\n // | | | T2 | |\n // | |----|-------------------------------------|----|\n // | | | C1 | | C2 | |\n // | | |----| |----| |\n // | | | | |\n // | L1 | L2 | ChartArea (C0) | R1 |\n // | | | | |\n // | | |----| |----| |\n // | | | C3 | | C4 | |\n // | |----|-------------------------------------|----|\n // | | | B1 | |\n // |----------------------------------------------------|\n // | B2 (Full Width) |\n // |----------------------------------------------------|\n //\n\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>\n wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n\n // First fit the fullSize boxes, to reduce probability of re-fitting.\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n\n // Then fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n\n // Then fit horizontal boxes\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n // if the area changed, re-fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n\n handleMaxPadding(chartArea);\n\n // Finally place the boxes to correct coordinates\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n\n // Move to opposite side of chart\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w,\n };\n\n // Finally update boxes in chartArea (radial scale for example)\n each(boxes.chartArea, (layout) => {\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {left: 0, top: 0, right: 0, bottom: 0});\n });\n }\n};\n","\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\n/**\n * Abstract class that allows abstracting platform dependencies away from the chart.\n */\nexport default class BasePlatform {\n /**\n\t * Called at chart construction time, returns a context2d instance implementing\n\t * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.\n\t * @param {HTMLCanvasElement} canvas - The canvas from which to acquire context (platform specific)\n\t * @param {number} [aspectRatio] - The chart options\n\t */\n acquireContext(canvas, aspectRatio) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Called at chart destruction time, releases any resources associated to the context\n\t * previously returned by the acquireContext() method.\n\t * @param {CanvasRenderingContext2D} context - The context2d instance\n\t * @returns {boolean} true if the method succeeded, else false\n\t */\n releaseContext(context) { // eslint-disable-line no-unused-vars\n return false;\n }\n\n /**\n\t * Registers the specified listener on the given chart.\n\t * @param {Chart} chart - Chart from which to listen for event\n\t * @param {string} type - The ({@link ChartEvent}) type to listen for\n\t * @param {function} listener - Receives a notification (an object that implements\n\t * the {@link ChartEvent} interface) when an event of the specified type occurs.\n\t */\n addEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Removes the specified listener previously registered with addEventListener.\n\t * @param {Chart} chart - Chart from which to remove the listener\n\t * @param {string} type - The ({@link ChartEvent}) type to remove\n\t * @param {function} listener - The listener function to remove from the event target.\n\t */\n removeEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @returns {number} the current devicePixelRatio of the device this platform is connected to.\n\t */\n getDevicePixelRatio() {\n return 1;\n }\n\n /**\n\t * Returns the maximum size in pixels of given canvas element.\n\t * @param {HTMLCanvasElement} element\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @returns {boolean} true if the canvas is attached to the platform, false if not.\n\t */\n isAttached(canvas) { // eslint-disable-line no-unused-vars\n return true;\n }\n\n /**\n * Updates config with platform specific requirements\n * @param {import('../core/core.config.js').default} config\n */\n updateConfig(config) { // eslint-disable-line no-unused-vars\n // no-op\n }\n}\n","/**\n * Platform fallback implementation (minimal).\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\n */\n\nimport BasePlatform from './platform.base.js';\n\n/**\n * Platform class for charts without access to the DOM or to many element properties\n * This platform is used by default for any chart passed an OffscreenCanvas.\n * @extends BasePlatform\n */\nexport default class BasicPlatform extends BasePlatform {\n acquireContext(item) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n","/**\n * Chart.Platform implementation for targeting a web browser\n */\n\nimport BasePlatform from './platform.base.js';\nimport {_getParentNode, getRelativePosition, supportsEventListenerOptions, readUsedSize, getMaximumSize} from '../helpers/helpers.dom.js';\nimport {throttled} from '../helpers/helpers.extras.js';\nimport {isNullOrUndef} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nconst EXPANDO_KEY = '$chartjs';\n\n/**\n * DOM event types -> Chart.js event types.\n * Note: only events with different types are mapped.\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\n */\nconst EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\n\nconst isNullOrEmpty = value => value === null || value === '';\n/**\n * Initializes the canvas style and render size without modifying the canvas display size,\n * since responsiveness is handled by the controller.resize() method. The config is used\n * to determine the aspect ratio to apply in case no explicit height has been specified.\n * @param {HTMLCanvasElement} canvas\n * @param {number} [aspectRatio]\n */\nfunction initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n\n // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\n // returns null or '' if no explicit value has been set to the canvas attribute.\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n\n // Chart.js modifies some canvas values that we want to restore on destroy\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n\n // Force canvas to display as block to avoid extra space caused by inline\n // elements, which would interfere with the responsive resize process.\n // https://github.com/chartjs/Chart.js/issues/2538\n style.display = style.display || 'block';\n // Include possible borders in the size\n style.boxSizing = style.boxSizing || 'border-box';\n\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n // If no explicit render height and style height, let's apply the aspect ratio,\n // which one can be specified by the user but also by charts as default option\n // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n\n return canvas;\n}\n\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\n// https://github.com/chartjs/Chart.js/issues/4287\nconst eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\n\nfunction addListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n}\n\nfunction removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\n\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const {x, y} = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null,\n };\n}\n\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList) {\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\n\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\n\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart) => {\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\n\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\n\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\n\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height) => {\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n // If the container size shrank during chart resize, let's assume\n // scrollbar appeared. So we resize again with the scrollbar visible -\n // effectively making chart smaller and the scrollbar hidden again.\n // Because we are inside `throttled`, and currently `ticking`, scroll\n // events are ignored during this whole 2 resize process.\n // If we assumed wrong and something else happened, we are resizing\n // twice in a frame (potential performance issue)\n listener();\n }\n }, window);\n\n // @ts-ignore until https://github.com/microsoft/TypeScript/issues/37861 implemented\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n // When its container's display is set to 'none' the callback will be called with a\n // size of (0, 0), which will cause the chart to lose its original height, so skip\n // resizing in such case.\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n\n return observer;\n}\n\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\n\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event) => {\n // This case can occur if the chart is destroyed while waiting\n // for the throttled function to occur. We prevent crashes by checking\n // for a destroyed chart\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n\n addListener(canvas, type, proxy);\n\n return proxy;\n}\n\n/**\n * Platform class for charts that can access the DOM and global window/document properties\n * @extends BasePlatform\n */\nexport default class DomPlatform extends BasePlatform {\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [aspectRatio]\n\t * @return {CanvasRenderingContext2D|null}\n\t */\n acquireContext(canvas, aspectRatio) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n\n // `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the canvas is\n // inside an iframe or when running in a protected environment. We could guess the\n // types from their toString() value but let's keep things flexible and assume it's\n // a sufficient condition if the canvas has a context2D which has canvas as `canvas`.\n // https://github.com/chartjs/Chart.js/issues/3887\n // https://github.com/chartjs/Chart.js/issues/4102\n // https://github.com/chartjs/Chart.js/issues/4152\n if (context && context.canvas === canvas) {\n // Load platform resources on first chart creation, to make it possible to\n // import the library before setting platform options.\n initCanvas(canvas, aspectRatio);\n return context;\n }\n\n return null;\n }\n\n /**\n\t * @param {CanvasRenderingContext2D} context\n\t */\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n\n const initial = canvas[EXPANDO_KEY].initial;\n ['height', 'width'].forEach((prop) => {\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n\n const style = initial.style || {};\n Object.keys(style).forEach((key) => {\n canvas.style[key] = style[key];\n });\n\n // The canvas render size might have been changed (and thus the state stack discarded),\n // we can't use save() and restore() to restore the initial state. So make sure that at\n // least the canvas context is reset to the default state by setting the canvas width.\n // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html\n // eslint-disable-next-line no-self-assign\n canvas.width = canvas.width;\n\n delete canvas[EXPANDO_KEY];\n return true;\n }\n\n /**\n\t *\n\t * @param {Chart} chart\n\t * @param {string} type\n\t * @param {function} listener\n\t */\n addEventListener(chart, type, listener) {\n // Can have only one listener per type, so make sure previous is removed\n this.removeEventListener(chart, type);\n\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} type\n\t */\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n\n if (!proxy) {\n return;\n }\n\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t */\n isAttached(canvas) {\n const container = _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n","import {_isDomSupported} from '../helpers/index.js';\nimport BasePlatform from './platform.base.js';\nimport BasicPlatform from './platform.basic.js';\nimport DomPlatform from './platform.dom.js';\n\nexport function _detectPlatform(canvas) {\n if (!_isDomSupported() || (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas)) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nexport {BasePlatform, BasicPlatform, DomPlatform};\n","import type {AnyObject} from '../types/basic.js';\nimport type {Point} from '../types/geometric.js';\nimport type {Animation} from '../types/animation.js';\nimport {isNumber} from '../helpers/helpers.math.js';\n\nexport default class Element {\n\n static defaults = {};\n static defaultRoutes = undefined;\n\n x: number;\n y: number;\n active = false;\n options: O;\n $animations: Record;\n\n tooltipPosition(useFinalPosition: boolean): Point {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y} as Point;\n }\n\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n\n /**\n * Gets the current or final value of each prop. Can return extra properties (whole object).\n * @param props - properties to get\n * @param [final] - get the final value (animation target)\n */\n getProps

(props: P, final?: boolean): Pick;\n getProps

(props: P[], final?: boolean): Partial>;\n getProps(props: string[], final?: boolean): Partial> {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this as Record;\n }\n const ret: Record = {};\n props.forEach((prop) => {\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop as string];\n });\n return ret;\n }\n}\n","import {isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\nimport {_factorize} from '../helpers/helpers.math.js';\n\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a subset of ticks to be plotted to avoid overlapping labels.\n * @param {import('./core.scale.js').default} scale\n * @param {Tick[]} ticks\n * @return {Tick[]}\n * @private\n */\nexport function autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n\n // If there are too many major ticks to display them all\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\n\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n\n/**\n * @param {number[]} majorIndices\n * @param {Tick[]} ticks\n * @param {number} ticksLimit\n */\nfunction calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n\n // If the major ticks are evenly spaced apart, place the minor ticks\n // so that they divide the major ticks into even chunks\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n\n const factors = _factorize(evenMajorSpacing);\n for (let i = 0, ilen = factors.length - 1; i < ilen; i++) {\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n\n/**\n * @param {Tick[]} ticks\n */\nfunction getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number[]} majorIndices\n * @param {number} spacing\n */\nfunction skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n\n spacing = Math.ceil(spacing);\n for (i = 0; i < ticks.length; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number} spacing\n * @param {number} [majorStart]\n * @param {number} [majorEnd]\n */\nfunction skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n\n next = start;\n\n while (next < 0) {\n count++;\n next = Math.round(start + count * spacing);\n }\n\n for (i = Math.max(start, 0); i < end; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n\n\n/**\n * @param {number[]} arr\n */\nfunction getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n\n if (len < 2) {\n return false;\n }\n\n for (diff = arr[0], i = 1; i < len; ++i) {\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n","import Element from './core.element.js';\nimport {_alignPixel, _measureText, renderText, clipArea, unclipArea} from '../helpers/helpers.canvas.js';\nimport {callback as call, each, finiteOrDefault, isArray, isFinite, isNullOrUndef, isObject, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toDegrees, toRadians, _int16Range, _limitValue, HALF_PI} from '../helpers/helpers.math.js';\nimport {_alignStartEnd, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {createContext, toFont, toPadding, _addGrace} from '../helpers/helpers.options.js';\nimport {autoSkip} from './core.scale.autoskip.js';\n\nconst reverseAlign = (align) => align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset) => edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit) => Math.min(maxTicksLimit || ticksLength, ticksLength);\n\n/**\n * @typedef { import('../types/index.js').Chart } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a new array containing numItems from arr\n * @param {any[]} arr\n * @param {number} numItems\n */\nfunction sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n\n for (; i < len; i += increment) {\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @param {boolean} offsetGridLines\n */\nfunction getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n\n // Return undefined if the pixel is out of the range\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n\n/**\n * @param {object} caches\n * @param {number} length\n */\nfunction garbageCollect(caches, length) {\n each(caches, (cache) => {\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for (i = 0; i < gcLen; ++i) {\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n\n/**\n * @param {object} options\n */\nfunction getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n\n/**\n * @param {object} options\n */\nfunction getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n\n return (lines * font.lineHeight) + padding.height;\n}\n\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\n\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\n\nfunction titleAlign(align, position, reverse) {\n /** @type {CanvasTextAlign} */\n let ret = _toLeftRightCenter(align);\n if ((reverse && position !== 'right') || (!reverse && position === 'right')) {\n ret = reverseAlign(ret);\n }\n return ret;\n}\n\nfunction titleArgs(scale, offset, position, align) {\n const {top, left, bottom, right, chart} = scale;\n const {chartArea, scales} = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {titleX, titleY, maxWidth, rotation};\n}\n\nexport default class Scale extends Element {\n\n // eslint-disable-next-line max-statements\n constructor(cfg) {\n super();\n\n /** @type {string} */\n this.id = cfg.id;\n /** @type {string} */\n this.type = cfg.type;\n /** @type {any} */\n this.options = undefined;\n /** @type {CanvasRenderingContext2D} */\n this.ctx = cfg.ctx;\n /** @type {Chart} */\n this.chart = cfg.chart;\n\n // implements box\n /** @type {number} */\n this.top = undefined;\n /** @type {number} */\n this.bottom = undefined;\n /** @type {number} */\n this.left = undefined;\n /** @type {number} */\n this.right = undefined;\n /** @type {number} */\n this.width = undefined;\n /** @type {number} */\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n /** @type {number} */\n this.maxWidth = undefined;\n /** @type {number} */\n this.maxHeight = undefined;\n /** @type {number} */\n this.paddingTop = undefined;\n /** @type {number} */\n this.paddingBottom = undefined;\n /** @type {number} */\n this.paddingLeft = undefined;\n /** @type {number} */\n this.paddingRight = undefined;\n\n // scale-specific properties\n /** @type {string=} */\n this.axis = undefined;\n /** @type {number=} */\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n /** @type {Tick[]} */\n this.ticks = [];\n /** @type {object[]|null} */\n this._gridLineItems = null;\n /** @type {object[]|null} */\n this._labelItems = null;\n /** @type {object|null} */\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n /** @type {number} */\n this._startPixel = undefined;\n /** @type {number} */\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n\n /**\n\t * @param {any} options\n\t * @since 3.0\n\t */\n init(options) {\n this.options = options.setContext(this.getContext());\n\n this.axis = options.axis;\n\n // parse min/max value, so we can properly determine min/max for other scales\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n\n /**\n\t * Parse a supported input value to internal representation.\n\t * @param {*} raw\n\t * @param {number} [index]\n\t * @since 3.0\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n return raw;\n }\n\n /**\n\t * @return {{min: number, max: number, minDefined: boolean, maxDefined: boolean}}\n\t * @protected\n\t * @since 3.0\n\t */\n getUserBounds() {\n let {_userMin, _userMax, _suggestedMin, _suggestedMax} = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isFinite(_userMin),\n maxDefined: isFinite(_userMax)\n };\n }\n\n /**\n\t * @param {boolean} canStack\n\t * @return {{min: number, max: number}}\n\t * @protected\n\t * @since 3.0\n\t */\n getMinMax(canStack) {\n // eslint-disable-next-line prefer-const\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n let range;\n\n if (minDefined && maxDefined) {\n return {min, max};\n }\n\n const metas = this.getMatchingVisibleMetas();\n for (let i = 0, ilen = metas.length; i < ilen; ++i) {\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n\n // Make sure min <= max when only min or max is defined by user and the data is outside that range\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n\n /**\n\t * Get the padding needed for the scale\n\t * @return {{top: number, left: number, bottom: number, right: number}} the necessary padding\n\t * @private\n\t */\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n\n /**\n\t * Returns the scale tick objects\n\t * @return {Tick[]}\n\t * @since 2.7\n\t */\n getTicks() {\n return this.ticks;\n }\n\n /**\n\t * @return {string[]}\n\t */\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n\n /**\n * @return {import('../types.js').LabelItem[]}\n */\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n\n // When a new layout is created, reset the data limits cache\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n\n // These methods are ordered by lifecycle. Utilities then follow.\n // Any function defined here is inherited by all scale types.\n // Any function can be extended by the scale type\n\n beforeUpdate() {\n call(this.options.beforeUpdate, [this]);\n }\n\n /**\n\t * @param {number} maxWidth - the max width in pixels\n\t * @param {number} maxHeight - the max height in pixels\n\t * @param {{top: number, left: number, bottom: number, right: number}} margins - the space between the edge of the other scales and edge of the chart\n\t * This space comes from two sources:\n\t * - padding - space that's required to show the labels at the edges of the scale\n\t * - thickness of scales or legends in another orientation\n\t */\n update(maxWidth, maxHeight, margins) {\n const {beginAtZero, grace, ticks: tickOpts} = this.options;\n const sampleSize = tickOpts.sampleSize;\n\n // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n this.beforeUpdate();\n\n // Absorb the master measurements\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n\n // Dimensions\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n\n this._maxLength = this.isHorizontal()\n ? this.width + margins.left + margins.right\n : this.height + margins.top + margins.bottom;\n\n // Data min/max\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n\n this.beforeBuildTicks();\n\n this.ticks = this.buildTicks() || [];\n\n // Allow modification of ticks in callback.\n this.afterBuildTicks();\n\n // Compute tick rotation and fit using a sampled subset of labels\n // We generally don't need to compute the size of every single label for determining scale size\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n\n // configure is called twice, once here, once from core.controller.updateLayout.\n // Here we haven't been positioned yet, but dimensions are correct.\n // Variables set in configure are needed for calculateLabelRotation, and\n // it's ok that coordinates are not correct there, only dimensions matter.\n this.configure();\n\n // Tick Rotation\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation(); // Preconditions: number of ticks and sizes of largest labels must be calculated beforehand\n this.afterCalculateLabelRotation();\n\n // Auto-skip\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n\n if (samplingEnabled) {\n // Generate labels using all non-skipped ticks\n this._convertTicksToLabels(this.ticks);\n }\n\n this.beforeFit();\n this.fit(); // Preconditions: label rotation and label sizes must be calculated beforehand\n this.afterFit();\n\n // IMPORTANT: after this point, we consider that `this.ticks` will NEVER change!\n\n this.afterUpdate();\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n // by default vertical scales are from bottom to top, so pixels are reversed\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n\n afterUpdate() {\n call(this.options.afterUpdate, [this]);\n }\n\n //\n\n beforeSetDimensions() {\n call(this.options.beforeSetDimensions, [this]);\n }\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n if (this.isHorizontal()) {\n // Reset position before calculating rotation\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n\n // Reset position before calculating rotation\n this.top = 0;\n this.bottom = this.height;\n }\n\n // Reset padding\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n call(this.options.afterSetDimensions, [this]);\n }\n\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n call(this.options[name], [this]);\n }\n\n // Data limits\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n\n //\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n /**\n\t * @return {object[]} the ticks\n\t */\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n\n beforeTickToLabelConversion() {\n call(this.options.beforeTickToLabelConversion, [this]);\n }\n /**\n\t * Convert ticks to label strings\n\t * @param {Tick[]} ticks\n\t */\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n tick = ticks[i];\n tick.label = call(tickOpts.callback, [tick.value, i, ticks], this);\n }\n }\n afterTickToLabelConversion() {\n call(this.options.afterTickToLabelConversion, [this]);\n }\n\n //\n\n beforeCalculateLabelRotation() {\n call(this.options.beforeCalculateLabelRotation, [this]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n\n // Estimate the width of each grid based on the canvas width, the maximum\n // label width and the number of tick intervals\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n\n // Allow 3 pixels x2 padding either side for label readability\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid)\n\t\t\t\t- tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(\n Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),\n Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))\n ));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n call(this.options.afterCalculateLabelRotation, [this]);\n }\n afterAutoSkip() {}\n\n //\n\n beforeFit() {\n call(this.options.beforeFit, [this]);\n }\n fit() {\n // Reset\n const minSize = {\n width: 0,\n height: 0\n };\n\n const {chart, options: {ticks: tickOpts, title: titleOpts, grid: gridOpts}} = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight; // fill all the height\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n\n // Don't bother fitting the ticks if we are not showing the labels\n if (tickOpts.display && this.ticks.length) {\n const {first, last, widest, highest} = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n\n if (isHorizontal) {\n // A horizontal axis is more constrained by the height.\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n // A vertical axis is more constrained by the width. Labels are the\n // dominant factor here, so get that length first and account for padding\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n\n this._handleMargins();\n\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n\n _calculatePadding(first, last, sin, cos) {\n const {ticks: {align, padding}, position} = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n\n // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned\n // which means that the right padding is dominated by the font height\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n\n // Adjust padding taking into account changes in offsets\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n\n /**\n\t * Handle margins and padding interactions\n\t * @private\n\t */\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n\n afterFit() {\n call(this.options.afterFit, [this]);\n }\n\n // Shared Methods\n /**\n\t * @return {boolean}\n\t */\n isHorizontal() {\n const {axis, position} = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n /**\n\t * @return {boolean}\n\t */\n isFullSize() {\n return this.options.fullSize;\n }\n\n /**\n\t * @param {Tick[]} ticks\n\t * @private\n\t */\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n\n this.generateTickLabels(ticks);\n\n // Ticks should be skipped when callback returns null or undef, so lets remove those.\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n\n this.afterTickToLabelConversion();\n }\n\n /**\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n\n return labelSizes;\n }\n\n /**\n\t * Returns {width, height, offset} objects for the first, last, widest, highest tick\n\t * labels where offset indicates the anchor point offset from the top in pixels.\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const {ctx, _longestTextCache: caches} = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n\n for (i = 0; i < length; i += increment) {\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n // if it is an array let's measure each element\n for (j = 0, jlen = label.length; j < jlen; ++j) {\n nestedLabel = /** @type {string} */ (label[j]);\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n\n const valueAt = (idx) => ({width: widths[idx] || 0, height: heights[idx] || 0});\n\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights,\n };\n }\n\n /**\n\t * Used to get the label to display in the tooltip for the given value\n\t * @param {*} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value;\n }\n\n /**\n\t * Returns the location of the given data point. Value can either be an index or a numerical value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {*} value\n\t * @param {number} [index]\n\t * @return {number}\n\t */\n getPixelForValue(value, index) { // eslint-disable-line no-unused-vars\n return NaN;\n }\n\n /**\n\t * Used to get the data value from a given pixel. This is the inverse of getPixelForValue\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} pixel\n\t * @return {*}\n\t */\n getValueForPixel(pixel) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Returns the location of the tick at the given index\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} index\n\t * @return {number}\n\t */\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n /**\n\t * Utility for getting the pixel location of a percentage of scale\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} decimal\n\t * @return {number}\n\t */\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n\n /**\n\t * Returns the pixel for the minimum chart value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @return {number}\n\t */\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n\n /**\n\t * @return {number}\n\t */\n getBaseValue() {\n const {min, max} = this;\n\n return min < 0 && max < 0 ? max :\n min > 0 && max > 0 ? min :\n 0;\n }\n\n /**\n\t * @protected\n\t */\n getContext(index) {\n const ticks = this.ticks || [];\n\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context ||\n\t\t\t\t(tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context ||\n\t\t\t(this.$context = createScaleContext(this.chart.getContext(), this));\n }\n\n /**\n\t * @return {number}\n\t * @private\n\t */\n _tickSize() {\n const optionTicks = this.options.ticks;\n\n // Calculate space needed by label in axis direction.\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n\n // Calculate space needed for 1 tick in axis direction.\n return this.isHorizontal()\n ? h * cos > w * sin ? w / cos : h / sin\n : h * sin < w * cos ? h / cos : w / sin;\n }\n\n /**\n\t * @return {boolean}\n\t * @private\n\t */\n _isVisible() {\n const display = this.options.display;\n\n if (display !== 'auto') {\n return !!display;\n }\n\n return this.getMatchingVisibleMetas().length > 0;\n }\n\n /**\n\t * @private\n\t */\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const {grid, position, border} = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for (i = 0; i < ticksLength; i += step) {\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n\n lineValue = getPixelForGridLine(this, i, offset);\n\n // Skip if the pixel is out of the range\n if (lineValue === undefined) {\n continue;\n }\n\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset,\n });\n }\n\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n\n return items;\n }\n\n /**\n\t * @private\n\t */\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const {position, ticks: optionTicks} = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const {align, crossAlign, padding, mirror} = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = ((chartArea.top + chartArea.bottom) / 2) + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = ((chartArea.left + chartArea.right) / 2) - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n\n const labelSizes = this._getLabelSizes();\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n label = tick.label;\n\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n\n if (isHorizontal) {\n x = pixel;\n\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += (lineHeight / 2) * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n\n let backdrop;\n\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n\n switch (textBaseline) {\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n default:\n break;\n }\n\n switch (textAlign) {\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n default:\n break;\n }\n\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n\n color: optsAtIndex.backdropColor,\n };\n }\n\n items.push({\n label,\n font,\n textOffset,\n options: {\n rotation,\n color,\n strokeColor,\n strokeWidth,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [x, y],\n backdrop,\n }\n });\n }\n\n return items;\n }\n\n _getXAxisLabelAlignment() {\n const {position, ticks} = this.options;\n const rotation = -toRadians(this.labelRotation);\n\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n\n let align = 'center';\n\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n\n return align;\n }\n\n _getYAxisLabelAlignment(tl) {\n const {position, ticks: {crossAlign, mirror, padding}} = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n\n let textAlign;\n let x;\n\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += (widest / 2);\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n\n return {textAlign, x};\n }\n\n /**\n\t * @private\n\t */\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n\n const chart = this.chart;\n const position = this.options.position;\n\n if (position === 'left' || position === 'right') {\n return {top: 0, left: this.left, bottom: chart.height, right: this.right};\n } if (position === 'top' || position === 'bottom') {\n return {top: this.top, left: 0, bottom: this.bottom, right: chart.width};\n }\n }\n\n /**\n * @protected\n */\n drawBackground() {\n const {ctx, options: {backgroundColor}, left, top, width, height} = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex(t => t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n\n const drawLine = (p1, p2, style) => {\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n\n if (grid.display) {\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n const item = items[i];\n\n if (grid.drawOnChartArea) {\n drawLine(\n {x: item.x1, y: item.y1},\n {x: item.x2, y: item.y2},\n item\n );\n }\n\n if (grid.drawTicks) {\n drawLine(\n {x: item.tx1, y: item.ty1},\n {x: item.tx2, y: item.ty2},\n {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n }\n );\n }\n }\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {\n const {chart, ctx, options: {border, grid}} = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n\n if (!optionTicks.display) {\n return;\n }\n\n const ctx = this.ctx;\n\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n\n const items = this.getLabelItems(chartArea);\n for (const item of items) {\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n\n if (area) {\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const {ctx, options: {position, title, reverse}} = this;\n\n if (!title.display) {\n return;\n }\n\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n\n const {titleX, titleY, maxWidth, rotation} = titleArgs(this, offset, position, align);\n\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n\n /**\n\t * @return {object[]}\n\t * @private\n\t */\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n // backward compatibility: draw has been overridden by custom scale\n return [{\n z: tz,\n draw: (chartArea) => {\n this.draw(chartArea);\n }\n }];\n }\n\n return [{\n z: gz,\n draw: (chartArea) => {\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n }, {\n z: bz,\n draw: () => {\n this.drawBorder();\n }\n }, {\n z: tz,\n draw: (chartArea) => {\n this.drawLabels(chartArea);\n }\n }];\n }\n\n /**\n\t * Returns visible dataset metas that are attached to this scale\n\t * @param {string} [type] - if specified, also filter by dataset type\n\t * @return {object[]}\n\t */\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n\n /**\n\t * @param {number} index\n\t * @return {object}\n\t * @protected\n \t */\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n\n /**\n * @protected\n */\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n","import {merge} from '../helpers/index.js';\nimport defaults, {overrides} from './core.defaults.js';\n\n/**\n * @typedef {{id: string, defaults: any, overrides?: any, defaultRoutes: any}} IChartComponent\n */\n\nexport default class TypedRegistry {\n constructor(type, scope, override) {\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n\n /**\n\t * @param {IChartComponent} item\n\t * @returns {string} The scope where items defaults were registered to.\n\t */\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n\n if (isIChartComponent(proto)) {\n // Make sure the parent is registered and note the scope where its defaults are.\n parentScope = this.register(proto);\n }\n\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n\n if (id in items) {\n // already registered\n return scope;\n }\n\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n\n return scope;\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object?}\n\t */\n get(id) {\n return this.items[id];\n }\n\n /**\n\t * @param {IChartComponent} item\n\t */\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n\n if (id in items) {\n delete items[id];\n }\n\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\n\nfunction registerDefaults(item, scope, parentScope) {\n // Inherit the parent's defaults and keep existing defaults\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n\n defaults.set(scope, itemDefaults);\n\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\n\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach(property => {\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [scope].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\n\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n","import DatasetController from './core.datasetController.js';\nimport Element from './core.element.js';\nimport Scale from './core.scale.js';\nimport TypedRegistry from './core.typedRegistry.js';\nimport {each, callback as call, _capitalize} from '../helpers/helpers.core.js';\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Registry {\n constructor() {\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n // Order is important, Scale has Element in prototype chain,\n // so Scales must be before Elements. Plugins are a fallback, so not listed here.\n this._typedRegistries = [this.controllers, this.scales, this.elements];\n }\n\n /**\n\t * @param {...any} args\n\t */\n add(...args) {\n this._each('register', args);\n }\n\n remove(...args) {\n this._each('unregister', args);\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof DatasetController}\n\t */\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Element}\n\t */\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object}\n\t */\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Scale}\n\t */\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n\n /**\n\t * @private\n\t */\n _each(method, args, typedRegistry) {\n [...args].forEach(arg => {\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || (reg === this.plugins && arg.id)) {\n this._exec(method, reg, arg);\n } else {\n // Handle loopable args\n // Use case:\n // import * as plugins from './plugins.js';\n // Chart.register(plugins);\n each(arg, item => {\n // If there are mixed types in the loopable, make sure those are\n // registered in correct registry\n // Use case: (treemap exporting controller, elements etc)\n // import * as treemap from 'chartjs-chart-treemap.js';\n // Chart.register(treemap);\n\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n call(component['before' + camelMethod], [], component); // beforeRegister / beforeUnregister\n registry[method](component);\n call(component['after' + camelMethod], [], component); // afterRegister / afterUnregister\n }\n\n /**\n\t * @private\n\t */\n _getRegistryForType(type) {\n for (let i = 0; i < this._typedRegistries.length; i++) {\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n // plugins is the fallback registry\n return this.plugins;\n }\n\n /**\n\t * @private\n\t */\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Registry();\n","import registry from './core.registry.js';\nimport {callback as callCallback, isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../plugins/plugin.tooltip.js').default } Tooltip\n */\n\n/**\n * @callback filterCallback\n * @param {{plugin: object, options: object}} value\n * @param {number} [index]\n * @param {array} [array]\n * @param {object} [thisArg]\n * @return {boolean}\n */\n\n\nexport default class PluginService {\n constructor() {\n this._init = [];\n }\n\n /**\n\t * Calls enabled plugins for `chart` on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {Chart} chart - The chart instance for which plugins should be called.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {object} [args] - Extra arguments to apply to the hook call.\n * @param {filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n\n /**\n\t * @private\n\t */\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors) {\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [chart, args, descriptor.options];\n if (callCallback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n\n return true;\n }\n\n invalidate() {\n // When plugins are registered, there is the possibility of a double\n // invalidate situation. In this case, we only want to invalidate once.\n // If we invalidate multiple times, the `_oldCache` is lost and all of the\n // plugins are restarted without being correctly stopped.\n // See https://github.com/chartjs/Chart.js/issues/8147\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n\n const descriptors = this._cache = this._createDescriptors(chart);\n\n this._notifyStateChanges(chart);\n\n return descriptors;\n }\n\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n // options === false => all plugins are disabled\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b) => a.filter(x => !b.some(y => x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\n\n/**\n * @param {import('./core.config.js').default} config\n */\nfunction allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for (let i = 0; i < keys.length; i++) {\n plugins.push(registry.getPlugin(keys[i]));\n }\n\n const local = config.plugins || [];\n for (let i = 0; i < local.length; i++) {\n const plugin = local[i];\n\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n\n return {plugins, localIds};\n}\n\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\n\nfunction createDescriptors(chart, {plugins, localIds}, options, all) {\n const result = [];\n const context = chart.getContext();\n\n for (const plugin of plugins) {\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {plugin, local: localIds[id]}, opts, context)\n });\n }\n\n return result;\n}\n\nfunction pluginOpts(config, {plugin, local}, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n // make sure plugin defaults are in scopes for local (not registered) plugins\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [''], {\n // These are just defaults that plugins can override\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n","import defaults, {overrides, descriptors} from './core.defaults.js';\nimport {mergeIf, resolveObjectKey, isArray, isFunction, valueOrDefault, isObject} from '../helpers/helpers.core.js';\nimport {_attachContext, _createResolver, _descriptors} from '../helpers/helpers.config.js';\n\nexport function getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\n\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\n\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\n\nfunction idMatchesAxis(id) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n}\n\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\n\nexport function determineAxis(id, ...scaleOptions) {\n if (idMatchesAxis(id)) {\n return id;\n }\n for (const opts of scaleOptions) {\n const axis = opts.axis\n || axisFromPosition(opts.position)\n || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n if (axis) {\n return axis;\n }\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\n\nfunction getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + 'AxisID'] === id) {\n return {axis};\n }\n}\n\nfunction retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d) => d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) {\n return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n }\n }\n return {};\n}\n\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {scales: {}};\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n\n // First figure out first scale id's per axis.\n Object.keys(configScales).forEach(id => {\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [{axis}, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]);\n });\n\n // Then merge dataset defaults to scale configs\n config.data.datasets.forEach(dataset => {\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach(defaultID => {\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [{axis}, configScales[id], defaultScaleOptions[defaultID]]);\n });\n });\n\n // apply scale defaults, if not overridden by dataset defaults\n Object.keys(scales).forEach(key => {\n const scale = scales[key];\n mergeIf(scale, [defaults.scales[scale.type], defaults.scale]);\n });\n\n return scales;\n}\n\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\n\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\n\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n\n initOptions(config);\n\n return config;\n}\n\nconst keyCache = new Map();\nconst keysCached = new Set();\n\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\n\nconst addIfFound = (set, obj, key) => {\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\n\nexport default class Config {\n constructor(config) {\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n\n get platform() {\n return this._config.platform;\n }\n\n get type() {\n return this._config.type;\n }\n\n set type(type) {\n this._config.type = type;\n }\n\n get data() {\n return this._config.data;\n }\n\n set data(data) {\n this._config.data = initData(data);\n }\n\n get options() {\n return this._config.options;\n }\n\n set options(options) {\n this._config.options = options;\n }\n\n get plugins() {\n return this._config.plugins;\n }\n\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n\n /**\n * Returns the option scope keys for resolving dataset options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @return {string[][]}\n */\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType,\n () => [[\n `datasets.${datasetType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the option scope keys for resolving dataset animation options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @param {string} transition\n * @return {string[][]}\n */\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`,\n () => [\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`,\n ],\n // The following are used for looking up the `animations` and `animation` keys\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n\n /**\n * Returns the options scope keys for resolving element options that belong\n * to an dataset. These keys do not include the dataset itself, because it\n * is not under options.\n * @param {string} datasetType\n * @param {string} elementType\n * @return {string[][]}\n */\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`,\n () => [[\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the options scope keys for resolving plugin options.\n * @param {{id: string, additionalOptionScopes?: string[]}} plugin\n * @return {string[][]}\n */\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`,\n () => [[\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || [],\n ]]);\n }\n\n /**\n * @private\n */\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n\n /**\n * Resolves the objects from options and defaults for option value resolution.\n * @param {object} mainScope - The main scope object for options\n * @param {string[][]} keyLists - The arrays of keys in resolution order\n * @param {boolean} [resetCache] - reset the cache for this mainScope\n */\n getOptionScopes(mainScope, keyLists, resetCache) {\n const {options, type} = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n\n const scopes = new Set();\n\n keyLists.forEach(keys => {\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach(key => addIfFound(scopes, mainScope, key));\n }\n keys.forEach(key => addIfFound(scopes, options, key));\n keys.forEach(key => addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach(key => addIfFound(scopes, defaults, key));\n keys.forEach(key => addIfFound(scopes, descriptors, key));\n });\n\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n\n /**\n * Returns the option scopes for resolving chart options\n * @return {object[]}\n */\n chartOptionScopes() {\n const {options, type} = this;\n\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {}, // https://github.com/chartjs/Chart.js/issues/8531\n {type},\n defaults,\n descriptors\n ];\n }\n\n /**\n * @param {object[]} scopes\n * @param {string[]} names\n * @param {function|object} context\n * @param {string[]} [prefixes]\n * @return {object}\n */\n resolveNamedOptions(scopes, names, context, prefixes = ['']) {\n const result = {$shared: true};\n const {resolver, subPrefixes} = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n // subResolver is passed to scriptable options. It should not resolve to hover options.\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n\n for (const prop of names) {\n result[prop] = options[prop];\n }\n return result;\n }\n\n /**\n * @param {object[]} scopes\n * @param {object} [context]\n * @param {string[]} [prefixes]\n * @param {{scriptable: boolean, indexable: boolean, allKeys?: boolean}} [descriptorDefaults]\n */\n createResolver(scopes, context, prefixes = [''], descriptorDefaults) {\n const {resolver} = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context)\n ? _attachContext(resolver, context, undefined, descriptorDefaults)\n : resolver;\n }\n}\n\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter(p => !p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\n\nconst hasFunction = value => isObject(value)\n && Object.getOwnPropertyNames(value).reduce((acc, key) => acc || isFunction(value[key]), false);\n\nfunction needContext(proxy, names) {\n const {isScriptable, isIndexable} = _descriptors(proxy);\n\n for (const prop of names) {\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if ((scriptable && (isFunction(value) || hasFunction(value)))\n || (indexable && isArray(value))) {\n return true;\n }\n }\n return false;\n}\n","import animator from './core.animator.js';\nimport defaults, {overrides} from './core.defaults.js';\nimport Interaction from './core.interaction.js';\nimport layouts from './core.layouts.js';\nimport {_detectPlatform} from '../platform/index.js';\nimport PluginService from './core.plugins.js';\nimport registry from './core.registry.js';\nimport Config, {determineAxis, getIndexAxis} from './core.config.js';\nimport {retinaScale, _isDomSupported} from '../helpers/helpers.dom.js';\nimport {each, callback as callCallback, uid, valueOrDefault, _elementsEqual, isNullOrUndef, setsEqual, defined, isFunction, _isClickEvent} from '../helpers/helpers.core.js';\nimport {clearCanvas, clipArea, createContext, unclipArea, _isPointInArea} from '../helpers/index.js';\n// @ts-ignore\nimport {version} from '../../package.json';\nimport {debounce} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').Point } Point\n */\n\nconst KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || (KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x');\n}\n\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1]\n ? a[l2] - b[l2]\n : a[l1] - b[l1];\n };\n}\n\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n\n chart.notifyPlugins('afterRender');\n callCallback(animationOptions && animationOptions.onComplete, [context], chart);\n}\n\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callCallback(animationOptions && animationOptions.onProgress, [context], chart);\n}\n\n/**\n * Chart.js can take a string id of a canvas element, a 2d context, or a canvas element itself.\n * Attempt to unwrap the item passed into the chart constructor so that it is a canvas element (if possible).\n */\nfunction getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n // Support for array based queries (such as jQuery)\n item = item[0];\n }\n\n if (item && item.canvas) {\n // Support for any object associated to a canvas (including a context2d)\n item = item.canvas;\n }\n return item;\n}\n\nconst instances = {};\nconst getChart = (key) => {\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c) => c.canvas === canvas).pop();\n};\n\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys) {\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n\n/**\n * @param {ChartEvent} e\n * @param {ChartEvent|null} lastEvent\n * @param {boolean} inChartArea\n * @param {boolean} isClick\n * @returns {ChartEvent|null}\n */\nfunction determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\n\nfunction getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\n\nfunction getDatasetArea(meta, chartArea) {\n const {xScale, yScale} = meta;\n if (xScale && yScale) {\n return {\n left: getSizeForArea(xScale, chartArea, 'left'),\n right: getSizeForArea(xScale, chartArea, 'right'),\n top: getSizeForArea(yScale, chartArea, 'top'),\n bottom: getSizeForArea(yScale, chartArea, 'bottom')\n };\n }\n return chartArea;\n}\n\nclass Chart {\n\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n\n // eslint-disable-next-line max-statements\n constructor(item, userConfig) {\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error(\n 'Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' +\n\t\t\t\t' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.'\n );\n }\n\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n // Store the previously used aspect ratio to determine if a resize\n // is needed during updates. Do this after _options is set since\n // aspectRatio uses a getter\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n /** @type {?{attach?: function, detach?: function, resize?: function}} */\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce(mode => this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n\n // Add the chart instance to the global namespace\n instances[this.id] = this;\n\n if (!context || !canvas) {\n // The given item is not a compatible context2d element, let's return before finalizing\n // the chart initialization but after setting basic chart / controller properties that\n // can help to figure out that the chart is not valid (e.g chart.canvas !== null);\n // https://github.com/chartjs/Chart.js/issues/2807\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n\n get aspectRatio() {\n const {options: {aspectRatio, maintainAspectRatio}, width, height, _aspectRatio} = this;\n if (!isNullOrUndef(aspectRatio)) {\n // If aspectRatio is defined in options, use that.\n return aspectRatio;\n }\n\n if (maintainAspectRatio && _aspectRatio) {\n // If maintainAspectRatio is truthly and we had previously determined _aspectRatio, use that\n return _aspectRatio;\n }\n\n // Calculate\n return height ? width / height : null;\n }\n\n get data() {\n return this.config.data;\n }\n\n set data(data) {\n this.config.data = data;\n }\n\n get options() {\n return this._options;\n }\n\n set options(options) {\n this.config.options = options;\n }\n\n get registry() {\n return registry;\n }\n\n /**\n\t * @private\n\t */\n _initialize() {\n // Before init plugin notification\n this.notifyPlugins('beforeInit');\n\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n\n this.bindEvents();\n\n // After init plugin notification\n this.notifyPlugins('afterInit');\n\n return this;\n }\n\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n\n stop() {\n animator.stop(this);\n return this;\n }\n\n /**\n\t * Resize the chart to its container or to explicit dimensions.\n\t * @param {number} [width]\n\t * @param {number} [height]\n\t */\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {width, height};\n }\n }\n\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n\n this.notifyPlugins('resize', {size: newSize});\n\n callCallback(options.onResize, [this, newSize], this);\n\n if (this.attached) {\n if (this._doResize(mode)) {\n // The resize update is delayed, only draw without updating.\n this.render();\n }\n }\n }\n\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n\n each(scalesOptions, (axisOptions, axisID) => {\n axisOptions.id = axisID;\n });\n }\n\n /**\n\t * Builds a map of scale ID to scale object for future lookup.\n\t */\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id) => {\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n\n if (scaleOpts) {\n items = items.concat(\n Object.keys(scaleOpts).map((id) => {\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n })\n );\n }\n\n each(items, (item) => {\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n\n scale.init(scaleOptions, options);\n });\n // clear up discarded scales\n each(updated, (hasUpdated, id) => {\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n\n each(scales, (scale) => {\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n\n /**\n\t * @private\n\t */\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n\n metasets.sort((a, b) => a.index - b.index);\n if (numMeta > numData) {\n for (let i = numData; i < numMeta; ++i) {\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n\n /**\n\t * @private\n\t */\n _removeUnreferencedMetasets() {\n const {_metasets: metasets, data: {datasets}} = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index) => {\n if (datasets.filter(x => x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n\n this._removeUnreferencedMetasets();\n\n for (i = 0, ilen = datasets.length; i < ilen; i++) {\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const {datasetElementType, dataElementType} = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n\n this._updateMetasets();\n return newControllers;\n }\n\n /**\n\t * Reset the elements of all datasets\n\t * @private\n\t */\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex) => {\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n\n /**\n\t* Resets the chart back to its state before the initial animation\n\t*/\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n\n update(mode) {\n const config = this.config;\n\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n\n // plugins options references might have change, let's invalidate the cache\n // https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\n this._plugins.invalidate();\n\n if (this.notifyPlugins('beforeUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n // Make sure dataset controllers are updated and new controllers are reset\n const newControllers = this.buildOrUpdateControllers();\n\n this.notifyPlugins('beforeElementsUpdate');\n\n // Make sure all dataset controllers have correct meta data counts\n let minPadding = 0;\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; i++) {\n const {controller} = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n // New controllers will be reset after the layout pass, so we only want to modify\n // elements added to new datasets\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n\n // Only reset the controllers if we have animations\n if (!animsDisabled) {\n // Can only reset the new controllers after the scales have been updated\n // Reset is done to get the starting point for the initial animation\n each(newControllers, (controller) => {\n controller.reset();\n });\n }\n\n this._updateDatasets(mode);\n\n // Do this before render so that any plugins that need final scale updates can use it\n this.notifyPlugins('afterUpdate', {mode});\n\n this._layers.sort(compare2Level('z', '_idx'));\n\n // Replay last event from before update, or set hover styles on active elements\n const {_active, _lastEvent} = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n\n this.render();\n }\n\n /**\n * @private\n */\n _updateScales() {\n each(this.scales, (scale) => {\n layouts.removeBox(this, scale);\n });\n\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n\n /**\n * @private\n */\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n // The configured events have changed. Rebind.\n this.unbindEvents();\n this.bindEvents();\n }\n }\n\n /**\n * @private\n */\n _updateHiddenIndices() {\n const {_hiddenIndices} = this;\n const changes = this._getUniformDataChanges() || [];\n for (const {method, start, count} of changes) {\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n\n /**\n * @private\n */\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx) => new Set(\n _dataChanges\n .filter(c => c[0] === idx)\n .map((c, i) => i + ',' + c.splice(1).join(','))\n );\n\n const changeSet = makeSet(0);\n for (let i = 1; i < datasetCount; i++) {\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet)\n .map(c => c.split(','))\n .map(a => ({method: a[1], start: +a[2], count: +a[3]}));\n }\n\n /**\n\t * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`\n\t * hook, in which case, plugins will not be called on `afterLayout`.\n\t * @private\n\t */\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {cancelable: true}) === false) {\n return;\n }\n\n layouts.update(this, this.width, this.height, minPadding);\n\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n\n this._layers = [];\n each(this.boxes, (box) => {\n if (noArea && box.position === 'chartArea') {\n // Skip drawing and configuring chartArea boxes when chartArea is zero or negative\n return;\n }\n\n // configure is called twice, once in core.scale.update and once here.\n // Here the boxes are fully updated and at their final positions.\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n\n this._layers.forEach((item, index) => {\n item._idx = index;\n });\n\n this.notifyPlugins('afterLayout');\n }\n\n /**\n\t * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.\n\t * @private\n\t */\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this.getDatasetMeta(i).controller.configure();\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);\n }\n\n this.notifyPlugins('afterDatasetsUpdate', {mode});\n }\n\n /**\n\t * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetUpdate`.\n\t * @private\n\t */\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {meta, index, mode, cancelable: true};\n\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n\n meta.controller._update(mode);\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n\n render() {\n if (this.notifyPlugins('beforeRender', {cancelable: true}) === false) {\n return;\n }\n\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({chart: this});\n }\n }\n\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const {width, height} = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n\n if (this.notifyPlugins('beforeDraw', {cancelable: true}) === false) {\n return;\n }\n\n // Because of plugin hooks (before/afterDatasetsDraw), datasets can't\n // currently be part of layers. Instead, we draw\n // layers <= 0 before(default, backward compat), and the rest after\n const layers = this._layers;\n for (i = 0; i < layers.length && layers[i].z <= 0; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this._drawDatasets();\n\n // Rest of layers\n for (; i < layers.length; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this.notifyPlugins('afterDraw');\n }\n\n /**\n\t * @private\n\t */\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n\n return result;\n }\n\n /**\n\t * Gets the visible dataset metas in drawing order\n\t * @return {object[]}\n\t */\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n\n /**\n\t * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetsDraw`.\n\t * @private\n\t */\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {cancelable: true}) === false) {\n return;\n }\n\n const metasets = this.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n this._drawDataset(metasets[i]);\n }\n\n this.notifyPlugins('afterDatasetsDraw');\n }\n\n /**\n\t * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetDraw`.\n\t * @private\n\t */\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta, this.chartArea);\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n\n meta.controller.draw();\n\n if (useClip) {\n unclipArea(ctx);\n }\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n\n /**\n * Checks whether the given point is in the chart area.\n * @param {Point} point - in relative coordinates (see, e.g., getRelativePosition)\n * @returns {boolean}\n */\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n\n return [];\n }\n\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter(x => x && x._dataset === dataset).pop();\n\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\t\t\t// See isDatasetVisible() comment\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n\n return meta;\n }\n\n getContext() {\n return this.$context || (this.$context = createContext(null, {chart: this, type: 'chart'}));\n }\n\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n\n const meta = this.getDatasetMeta(datasetIndex);\n\n // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,\n // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n\n /**\n\t * @private\n\t */\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n // Animate visible state, so hide animation can be seen. This could be handled better if update / updateDataset returned a Promise.\n anims.update(meta, {visible});\n this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n\n /**\n\t * @private\n\t */\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n\n for (i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._destroyDatasetMeta(i);\n }\n }\n\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const {canvas, ctx} = this;\n\n this._stop();\n this.config.clearCache();\n\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n\n delete instances[this.id];\n\n this.notifyPlugins('afterDestroy');\n }\n\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n\n /**\n\t * @private\n\t */\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n\n /**\n * @private\n */\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n\n const listener = (e, x, y) => {\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n\n each(this.options.events, (type) => _add(type, listener));\n }\n\n /**\n * @private\n */\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener) => {\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n\n const listener = (width, height) => {\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n\n let detached; // eslint-disable-line prefer-const\n const attached = () => {\n _remove('attach', attached);\n\n this.attached = true;\n this.resize();\n\n _add('resize', listener);\n _add('detach', detached);\n };\n\n detached = () => {\n this.attached = false;\n\n _remove('resize', listener);\n\n // Stop animating and remove metasets, so when re-attached, the animations start from beginning.\n this._stop();\n this._resize(0, 0);\n\n _add('attach', attached);\n };\n\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n\n /**\n\t * @private\n\t */\n unbindEvents() {\n each(this._listeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n\n each(this._responsiveListeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n\n /**\n\t * Get active (hovered) elements\n\t * @returns array\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active (hovered) elements\n\t * @param {array} activeElements New active data points\n\t */\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n\n if (changed) {\n this._active = active;\n // Make sure we don't use the previous mouse event to override the active elements in update.\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n\n /**\n\t * Calls enabled plugins on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {Object} [args] - Extra arguments to apply to the hook call.\n * @param {import('./core.plugins.js').filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n\n /**\n * Check if a plugin with the specific ID is registered and enabled\n * @param {string} pluginId - The ID of the plugin of which to check if it is enabled\n * @returns {boolean}\n */\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter(p => p.plugin.id === pluginId).length === 1;\n }\n\n /**\n\t * @private\n\t */\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b) => a.filter(x => !b.some(y => x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n\n /**\n\t * @private\n\t */\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type);\n\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n\n const changed = this._handleEvent(e, replay, args.inChartArea);\n\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n\n if (changed || args.changed) {\n this.render();\n }\n\n return this;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e the event to handle\n\t * @param {boolean} [replay] - true if the event was replayed by `update`\n * @param {boolean} [inChartArea] - true if the event is inside chartArea\n\t * @return {boolean} true if the chart needs to re-render\n\t * @private\n\t */\n _handleEvent(e, replay, inChartArea) {\n const {_active: lastActive = [], options} = this;\n\n // If the event is replayed from `update`, we should evaluate with the final positions.\n //\n // The `replay`:\n // It's the last event (excluding click) that has occurred before `update`.\n // So mouse has not moved. It's also over the chart, because there is a `replay`.\n //\n // The why:\n // If animations are active, the elements haven't moved yet compared to state before update.\n // But if they will, we are activating the elements that would be active, if this check\n // was done after the animations have completed. => \"final positions\".\n // If there is no animations, the \"final\" and \"current\" positions are equal.\n // This is done so we do not have to evaluate the active elements each animation frame\n // - it would be expensive.\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n\n if (inChartArea) {\n // Set _lastEvent to null while we are processing the event handlers.\n // This prevents recursion if the handler calls chart.update()\n this._lastEvent = null;\n\n // Invoke onHover hook\n callCallback(options.onHover, [e, active, this], this);\n\n if (isClick) {\n callCallback(options.onClick, [e, active, this], this);\n }\n }\n\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n\n this._lastEvent = lastEvent;\n\n return changed;\n }\n\n /**\n * @param {ChartEvent} e - The event\n * @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements\n * @param {boolean} inChartArea - Is the envent inside chartArea\n * @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after animation) element positions\n * @returns {import('../types/index.js').ActiveElement[]} - The active elements\n * @pravate\n */\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n return lastActive;\n }\n\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\n\n// @ts-ignore\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart) => chart._plugins.invalidate());\n}\n\nexport default Chart;\n","import Element from '../core/core.element.js';\nimport {_angleBetween, getAngleFromPoint, TAU, HALF_PI, valueOrDefault} from '../helpers/index.js';\nimport {PI, _isBetween, _limitValue} from '../helpers/helpers.math.js';\nimport {_readValueToProps} from '../helpers/helpers.options.js';\nimport type {ArcOptions, Point} from '../types/index.js';\n\n\nfunction clipArc(ctx: CanvasRenderingContext2D, element: ArcElement, endAngle: number) {\n const {startAngle, pixelMargin, x, y, outerRadius, innerRadius} = element;\n let angleMargin = pixelMargin / outerRadius;\n\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\n\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, ['outerStart', 'outerEnd', 'innerStart', 'innerEnd']);\n}\n\n/**\n * Parse border radius from the provided options\n */\nfunction parseBorderRadius(arc: ArcElement, innerRadius: number, outerRadius: number, angleDelta: number) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val) => {\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit),\n };\n}\n\n/**\n * Convert (r, 𝜃) to (x, y)\n */\nfunction rThetaToXY(r: number, theta: number, x: number, y: number) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta),\n };\n}\n\n\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */\nfunction pathArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n end: number,\n circular: boolean,\n) {\n const {x, y, startAngle: start, pixelMargin, innerRadius: innerR} = element;\n\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n\n let spacingOffset = 0;\n const alpha = end - start;\n\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? (alpha * avNogSpacingRadius) / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const {outerStart, outerEnd, innerStart, innerEnd} = parseBorderRadius(element, innerRadius, outerRadius, endAngle - startAngle);\n\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n\n ctx.beginPath();\n\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = ((endAngle - (innerEnd / innerRadius)) + (startAngle + (innerStart / innerRadius))) / 2;\n ctx.arc(x, y, innerRadius, endAngle - (innerEnd / innerRadius), innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + (innerStart / innerRadius), true);\n\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n\n ctx.closePath();\n}\n\nfunction drawArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference} = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\n\nfunction drawBorder(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference, options} = element;\n const {borderWidth, borderJoinStyle, borderDash, borderDashOffset} = options;\n const inner = options.borderAlign === 'inner';\n\n if (!borderWidth) {\n return;\n }\n\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\n\nexport interface ArcProps extends Point {\n startAngle: number;\n endAngle: number;\n innerRadius: number;\n outerRadius: number;\n circumference: number;\n}\n\nexport default class ArcElement extends Element {\n\n static id = 'arc';\n\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true,\n };\n\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash'\n };\n\n circumference: number;\n endAngle: number;\n fullCircles: number;\n innerRadius: number;\n outerRadius: number;\n pixelMargin: number;\n startAngle: number;\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(chartX: number, chartY: number, useFinalPosition: boolean) {\n const point = this.getProps(['x', 'y'], useFinalPosition);\n const {angle, distance} = getAngleFromPoint(point, {x: chartX, y: chartY});\n const {startAngle, endAngle, innerRadius, outerRadius, circumference} = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n\n return (betweenAngles && withinRadius);\n }\n\n getCenterPoint(useFinalPosition: boolean) {\n const {x, y, startAngle, endAngle, innerRadius, outerRadius} = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ], useFinalPosition);\n const {offset, spacing} = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n\n tooltipPosition(useFinalPosition: boolean) {\n return this.getCenterPoint(useFinalPosition);\n }\n\n draw(ctx: CanvasRenderingContext2D) {\n const {options, circumference} = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = (options.borderAlign === 'inner') ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n\n ctx.save();\n\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n\n ctx.restore();\n }\n}\n","import Element from '../core/core.element.js';\nimport {_bezierInterpolation, _pointInLine, _steppedInterpolation} from '../helpers/helpers.interpolation.js';\nimport {_computeSegments, _boundSegments} from '../helpers/helpers.segment.js';\nimport {_steppedLineTo, _bezierCurveTo} from '../helpers/helpers.canvas.js';\nimport {_updateBezierControlPoints} from '../helpers/helpers.curve.js';\nimport {valueOrDefault} from '../helpers/index.js';\n\n/**\n * @typedef { import('./element.point.js').default } PointElement\n */\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\n\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @returns {any}\n */\nfunction getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n\n return lineTo;\n}\n\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const {start: paramsStart = 0, end: paramsEnd = count - 1} = params;\n const {start: segmentStart, end: segmentEnd} = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction pathSegment(ctx, line, segment, params) {\n const {points, options} = line;\n const {count, start, loop, ilen} = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n // eslint-disable-next-line prefer-const\n let {move = true, reverse} = params || {};\n let i, point, prev;\n\n for (i = 0; i <= ilen; ++i) {\n point = points[(start + (reverse ? ilen - i : i)) % count];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n prev = point;\n }\n\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n return !!loop;\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const {count, start, ilen} = pathVars(points, segment, params);\n const {move = true, reverse} = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n\n const pointIndex = (index) => (start + (reverse ? ilen - index : index)) % count;\n const drawX = () => {\n if (minY !== maxY) {\n // Draw line to maxY and minY, using the average x-coordinate\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n // Line to y-value of last point in group. So the line continues\n // from correct position. Not using move, to have solid path.\n ctx.lineTo(avgX, lastY);\n }\n };\n\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n\n for (i = 0; i <= ilen; ++i) {\n point = points[pointIndex(i)];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n }\n\n const x = point.x;\n const y = point.y;\n const truncX = x | 0; // truncated x-coordinate\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n // Draw line to next x-position, using the first (or only)\n // y-value in that group\n ctx.lineTo(x, y);\n\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n // Keep track of the last y-value in group\n lastY = y;\n }\n drawX();\n}\n\n/**\n * @param {LineElement} line - the line\n * @returns {function}\n * @private\n */\nfunction _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n\n/**\n * @private\n */\nfunction _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n\n return _pointInLine;\n}\n\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\n\nfunction strokePathDirect(ctx, line, start, count) {\n const {segments, options} = line;\n const segmentMethod = _getSegmentMethod(line);\n\n for (const segment of segments) {\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {start, end: start + count - 1})) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\n\nconst usePath2D = typeof Path2D === 'function';\n\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\n\nexport default class LineElement extends Element {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0,\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash' && name !== 'fill',\n };\n\n\n constructor(cfg) {\n super();\n\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n\n get points() {\n return this._points;\n }\n\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n\n /**\n\t * First non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n\n /**\n\t * Last non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n\n /**\n\t * Interpolate a point in this line at the same value on `property` as\n\t * the reference `point` provided\n\t * @param {PointElement} point - the reference point\n\t * @param {string} property - the property to match on\n\t * @returns {PointElement|undefined}\n\t */\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {property, start: value, end: value});\n\n if (!segments.length) {\n return;\n }\n\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for (i = 0, ilen = segments.length; i < ilen; ++i) {\n const {start, end} = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n\n /**\n\t * Append a segment of this line to current path.\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} segment\n\t * @param {number} segment.start - start index of the segment, referring the points array\n \t * @param {number} segment.end - end index of the segment, referring the points array\n \t * @param {boolean} segment.loop - indicates that the segment is a loop\n\t * @param {object} params\n\t * @param {boolean} params.move - move to starting point (vs line to it)\n\t * @param {boolean} params.reverse - path the segment from end to start\n\t * @param {number} params.start - limit segment to points starting from `start` index\n\t * @param {number} params.end - limit segment to points ending at `start` + `count` index\n\t * @returns {undefined|boolean} - true if the segment is a full loop (path should be closed)\n\t */\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n\n /**\n\t * Append all segments of this line to current path.\n\t * @param {CanvasRenderingContext2D|Path2D} ctx\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t * @returns {undefined|boolean} - true if line is a full loop (path should be closed)\n\t */\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n\n start = start || 0;\n count = count || (this.points.length - start);\n\n for (const segment of segments) {\n loop &= segmentMethod(ctx, this, segment, {start, end: start + count - 1});\n }\n return !!loop;\n }\n\n /**\n\t * Draw\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} chartArea\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t */\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n\n if (points.length && options.borderWidth) {\n ctx.save();\n\n draw(ctx, this, start, count);\n\n ctx.restore();\n }\n\n if (this.animated) {\n // When line is animated, the control points and path are not cached.\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n","import Element from '../core/core.element.js';\nimport {drawPoint, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport type {\n CartesianParsedData,\n ChartArea,\n Point,\n PointHoverOptions,\n PointOptions,\n} from '../types/index.js';\n\nfunction inRange(el: PointElement, pos: number, axis: 'x' | 'y', useFinalPosition?: boolean) {\n const options = el.options;\n const {[axis]: value} = el.getProps([axis], useFinalPosition);\n\n return (Math.abs(pos - value) < options.radius + options.hitRadius);\n}\n\nexport type PointProps = Point\n\nexport default class PointElement extends Element {\n\n static id = 'point';\n\n parsed: CartesianParsedData;\n skip?: boolean;\n stop?: boolean;\n\n /**\n * @type {any}\n */\n static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean) {\n const options = this.options;\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return ((Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2)) < Math.pow(options.hitRadius + options.radius, 2));\n }\n\n inXRange(mouseX: number, useFinalPosition?: boolean) {\n return inRange(this, mouseX, 'x', useFinalPosition);\n }\n\n inYRange(mouseY: number, useFinalPosition?: boolean) {\n return inRange(this, mouseY, 'y', useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition?: boolean) {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y};\n }\n\n size(options?: Partial) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n\n draw(ctx: CanvasRenderingContext2D, area: ChartArea) {\n const options = this.options;\n\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n","import Element from '../core/core.element.js';\nimport {isObject, _isBetween, _limitValue} from '../helpers/index.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {toTRBL, toTRBLCorners} from '../helpers/helpers.options.js';\n\n/** @typedef {{ x: number, y: number, base: number, horizontal: boolean, width: number, height: number }} BarProps */\n\n/**\n * Helper function to get the bounds of the bar regardless of the orientation\n * @param {BarElement} bar the bar\n * @param {boolean} [useFinalPosition]\n * @return {object} bounds of the bar\n * @private\n */\nfunction getBarBounds(bar, useFinalPosition) {\n const {x, y, base, width, height} = /** @type {BarProps} */ (bar.getProps(['x', 'y', 'base', 'width', 'height'], useFinalPosition));\n\n let left, right, top, bottom, half;\n\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n\n return {left, top, right, bottom};\n}\n\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\n\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\n\nfunction parseBorderRadius(bar, maxW, maxH) {\n const {enableBorderRadius} = bar.getProps(['enableBorderRadius']);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n\n // If the value is an object, assume the user knows what they are doing\n // and apply as directed.\n const enableBorder = enableBorderRadius || isObject(value);\n\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\n\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)),\n }\n }\n };\n}\n\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n\n return bounds\n\t\t&& (skipX || _isBetween(x, bounds.left, bounds.right))\n\t\t&& (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\n\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n\n/**\n * Add a path of a rectangle to the current sub-path\n * @param {CanvasRenderingContext2D} ctx Context\n * @param {*} rect Bounding rect\n */\nfunction addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\n\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\n\nexport default class BarElement extends Element {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n draw(ctx) {\n const {inflateAmount, options: {borderColor, backgroundColor}} = this;\n const {inner, outer} = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n\n ctx.save();\n\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n\n ctx.restore();\n }\n\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition) {\n const {x, y, base, horizontal} = /** @type {BarProps} */ (this.getProps(['x', 'y', 'base', 'horizontal'], useFinalPosition));\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n","import {DoughnutController, PolarAreaController} from '../index.js';\nimport type {Chart, ChartDataset} from '../types.js';\n\nexport interface ColorsPluginOptions {\n enabled?: boolean;\n forceOverride?: boolean;\n}\n\ninterface ColorsDescriptor {\n backgroundColor?: unknown;\n borderColor?: unknown;\n}\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)', // blue\n 'rgb(255, 99, 132)', // red\n 'rgb(255, 159, 64)', // orange\n 'rgb(255, 205, 86)', // yellow\n 'rgb(75, 192, 192)', // green\n 'rgb(153, 102, 255)', // purple\n 'rgb(201, 203, 207)' // grey\n];\n\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map(color => color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\n\nfunction getBorderColor(i: number) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\n\nfunction getBackgroundColor(i: number) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\n\nfunction colorizeDefaultDataset(dataset: ChartDataset, i: number) {\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n\n return ++i;\n}\n\nfunction colorizeDoughnutDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBorderColor(i++));\n\n return i;\n}\n\nfunction colorizePolarAreaDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBackgroundColor(i++));\n\n return i;\n}\n\nfunction getColorizer(chart: Chart) {\n let i = 0;\n\n return (dataset: ChartDataset, datasetIndex: number) => {\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n\n if (controller instanceof DoughnutController) {\n i = colorizeDoughnutDataset(dataset, i);\n } else if (controller instanceof PolarAreaController) {\n i = colorizePolarAreaDataset(dataset, i);\n } else if (controller) {\n i = colorizeDefaultDataset(dataset, i);\n }\n };\n}\n\nfunction containsColorsDefinitions(\n descriptors: ColorsDescriptor[] | Record\n) {\n let k: number | string;\n\n for (k in descriptors) {\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction containsColorsDefinition(\n descriptor: ColorsDescriptor\n) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\n\nexport default {\n id: 'colors',\n\n defaults: {\n enabled: true,\n forceOverride: false\n } as ColorsPluginOptions,\n\n beforeLayout(chart: Chart, _args, options: ColorsPluginOptions) {\n if (!options.enabled) {\n return;\n }\n\n const {\n data: {datasets},\n options: chartOptions\n } = chart.config;\n const {elements} = chartOptions;\n\n if (!options.forceOverride && (containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || (elements && containsColorsDefinitions(elements)))) {\n return;\n }\n\n const colorizer = getColorizer(chart);\n\n datasets.forEach(colorizer);\n }\n};\n","import {_limitValue, _lookupByKey, isNullOrUndef, resolve} from '../helpers/index.js';\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n /**\n * Implementation of the Largest Triangle Three Buckets algorithm.\n *\n * This implementation is based on the original implementation by Sveinn Steinarsson\n * in https://github.com/sveinn-steinarsson/flot-downsample/blob/master/jquery.flot.downsample.js\n *\n * The original implementation is MIT licensed.\n */\n const samples = options.samples || availableWidth;\n // There are less points than the threshold, returning the whole array\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n\n const decimated = [];\n\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n // Starting from offset\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n\n decimated[sampledIndex++] = data[a];\n\n for (i = 0; i < samples - 2; i++) {\n let avgX = 0;\n let avgY = 0;\n let j;\n\n // Adding offset\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n\n for (j = avgRangeStart; j < avgRangeEnd; j++) {\n avgX += data[j].x;\n avgY += data[j].y;\n }\n\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n\n // Adding offset\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const {x: pointAx, y: pointAy} = data[a];\n\n // Note that this is changed from the original algorithm which initializes these\n // values to 1. The reason for this change is that if the area is small, nextA\n // would never be set and thus a crash would occur in the next loop as `a` would become\n // `undefined`. Since the area is always positive, but could be 0 in the case of a flat trace,\n // initializing with a negative number is the correct solution.\n maxArea = area = -1;\n\n for (j = rangeOffs; j < rangeTo; j++) {\n area = 0.5 * Math.abs(\n (pointAx - avgX) * (data[j].y - pointAy) -\n (pointAx - data[j].x) * (avgY - pointAy)\n );\n\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n\n // Include the last point\n decimated[sampledIndex++] = data[endIndex];\n\n return decimated;\n}\n\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n\n for (i = start; i < start + count; ++i) {\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n // Use point.x here because we're computing the average data `x` value\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n // Push up to 4 points, 3 for the last interval and the first point for this interval\n const lastIndex = i - 1;\n\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n // The interval is defined by 4 points: start, min, max, end.\n // The starting point is already considered at this point, so we need to determine which\n // of the other points to add. We need to sort these points to ensure the decimated data\n // is still sorted and then ensure there are no duplicates.\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX,\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n\n // lastIndex === startIndex will occur when a range has only 1 point which could\n // happen with very uneven data\n if (i > 0 && lastIndex !== startIndex) {\n // Last point in the previous interval\n decimated.push(data[lastIndex]);\n }\n\n // Start of the new interval\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n\n return decimated;\n}\n\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data,\n });\n }\n}\n\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset) => {\n cleanDecimatedDataset(dataset);\n });\n}\n\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n\n let start = 0;\n let count;\n\n const {iScale} = meta;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n\n return {start, count};\n}\n\nexport default {\n id: 'decimation',\n\n defaults: {\n algorithm: 'min-max',\n enabled: false,\n },\n\n beforeElementsUpdate: (chart, args, options) => {\n if (!options.enabled) {\n // The decimation plugin may have been previously enabled. Need to remove old `dataset._data` handlers\n cleanDecimatedData(chart);\n return;\n }\n\n // Assume the entire chart is available to show a few more points than needed\n const availableWidth = chart.width;\n\n chart.data.datasets.forEach((dataset, datasetIndex) => {\n const {_data, indexAxis} = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n\n if (resolve([indexAxis, chart.options.indexAxis]) === 'y') {\n // Decimation is only supported for lines that have an X indexAxis\n return;\n }\n\n if (!meta.controller.supportsDecimation) {\n // Only line datasets are supported\n return;\n }\n\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n // Only linear interpolation is supported\n return;\n }\n\n if (chart.options.parsing) {\n // Plugin only supports data that does not need parsing\n return;\n }\n\n let {start, count} = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n // No decimation is required until we are above this threshold\n cleanDecimatedDataset(dataset);\n return;\n }\n\n if (isNullOrUndef(_data)) {\n // First time we are seeing this dataset\n // We override the 'data' property with a setter that stores the\n // raw data in _data, but reads the decimated data from _decimated\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n\n // Point the chart to the decimated data\n let decimated;\n switch (options.algorithm) {\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n\n dataset._decimated = decimated;\n });\n },\n\n destroy(chart) {\n cleanDecimatedData(chart);\n }\n};\n","import {_boundSegment, _boundSegments, _normalizeAngle} from '../../helpers/index.js';\n\nexport function _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n\n for (const segment of segments) {\n let {start, end} = segment;\n end = _findSegmentEnd(start, end, points);\n\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n\n if (!target.segments) {\n // Special case for boundary not supporting `segments` (simpleArc)\n // Bounds are provided as `target` for partial circle, or undefined for full circle\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n\n // Get all segments from `target` that intersect the bounds of current segment of `line`\n const targetSegments = _boundSegments(target, bounds);\n\n for (const tgt of targetSegments) {\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n\n for (const fillSource of fillSources) {\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\n\nexport function _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {property, start, end};\n}\n\nexport function _pointsFromSegments(boundary, line) {\n const {x = null, y = null} = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({start, end}) => {\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({x: first.x, y});\n points.push({x: last.x, y});\n } else if (x !== null) {\n points.push({x, y: first.y});\n points.push({x, y: last.y});\n }\n });\n return points;\n}\n\nexport function _findSegmentEnd(start, end, points) {\n for (;end > start; end--) {\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\n\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {isArray} from '../../helpers/index.js';\nimport {_pointsFromSegments} from './filler.segment.js';\n\n/**\n * @param {PointElement[] | { x: number; y: number; }} boundary\n * @param {LineElement} line\n * @return {LineElement?}\n */\nexport function _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n\n if (isArray(boundary)) {\n _loop = true;\n // @ts-ignore\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n\n return points.length ? new LineElement({\n points,\n options: {tension: 0},\n _loop,\n _fullLoop: _loop\n }) : null;\n}\n\nexport function _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n","import {isObject, isFinite, valueOrDefault} from '../../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.line.js').default } LineElement\n * @typedef { import('../../types/index.js').FillTarget } FillTarget\n * @typedef { import('../../types/index.js').ComplexFillTarget } ComplexFillTarget\n */\n\nexport function _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [index];\n let target;\n\n if (!propagate) {\n return fill;\n }\n\n while (fill !== false && visited.indexOf(fill) === -1) {\n if (!isFinite(fill)) {\n return fill;\n }\n\n target = sources[fill];\n if (!target) {\n return false;\n }\n\n if (target.visible) {\n return fill;\n }\n\n visited.push(fill);\n fill = target.fill;\n }\n\n return false;\n}\n\n/**\n * @param {LineElement} line\n * @param {number} index\n * @param {number} count\n */\nexport function _decodeFill(line, index, count) {\n /** @type {string | {value: number}} */\n const fill = parseFillOption(line);\n\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n\n let target = parseFloat(fill);\n\n if (isFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n\n return ['origin', 'start', 'end', 'stack', 'shape'].indexOf(fill) >= 0 && fill;\n}\n\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n\n return target;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @returns {number | null}\n */\nexport function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n // @ts-ignore\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @param {number} startValue\n * @returns {number | undefined}\n */\nexport function _getTargetValue(fill, scale, startValue) {\n let value;\n\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n // @ts-ignore\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n\n/**\n * @param {LineElement} line\n */\nfunction parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n\n if (fill === false || fill === null) {\n return false;\n }\n\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {_isBetween} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\n\n/**\n * @param {{ chart: Chart; scale: Scale; index: number; line: LineElement; }} source\n * @return {LineElement}\n */\nexport function _buildStackLine(source) {\n const {scale, index, line} = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({x: null, y: scale.bottom}, line));\n\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n for (let j = segment.start; j <= segment.end; j++) {\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({points, options: {}});\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @return {LineElement[]}\n */\nfunction getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n\n for (let i = 0; i < metas.length; i++) {\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n\n/**\n * @param {PointElement[]} points\n * @param {PointElement} sourcePoint\n * @param {LineElement[]} linesBelow\n */\nfunction addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for (let j = 0; j < linesBelow.length; j++) {\n const line = linesBelow[j];\n const {first, last, point} = findPoint(line, sourcePoint, 'x');\n\n if (!point || (first && last)) {\n continue;\n }\n if (first) {\n // First point of an segment -> need to add another point before this,\n // from next line below.\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n // In the middle of an segment, no need to add more points.\n break;\n }\n }\n }\n points.push(...postponed);\n}\n\n/**\n * @param {LineElement} line\n * @param {PointElement} sourcePoint\n * @param {string} property\n * @returns {{point?: PointElement, first?: boolean, last?: boolean}}\n */\nfunction findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {first, last, point};\n}\n","import {TAU} from '../../helpers/index.js';\n\n// TODO: use elements.ArcElement instead\nexport class simpleArc {\n constructor(opts) {\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n\n pathSegment(ctx, bounds, opts) {\n const {x, y, radius} = this;\n bounds = bounds || {start: 0, end: TAU};\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n\n interpolate(point) {\n const {x, y, radius} = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n","import {isFinite} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\nimport {_getTargetPixel, _getTargetValue} from './filler.options.js';\nimport {_buildStackLine} from './filler.target.stack.js';\nimport {simpleArc} from './simpleArc.js';\n\n/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nexport function _getTarget(source) {\n const {chart, fill, line} = source;\n\n if (isFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n\n if (fill === 'shape') {\n return true;\n }\n\n const boundary = computeBoundary(source);\n\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n\n return _createBoundaryLine(boundary, line);\n}\n\n/**\n * @param {Chart} chart\n * @param {number} index\n */\nfunction getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\n\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\n\n\nfunction computeLinearBoundary(source) {\n const {scale = {}, fill} = source;\n const pixel = _getTargetPixel(fill, scale);\n\n if (isFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n\n return null;\n}\n\nfunction computeCircularBoundary(source) {\n const {scale, fill} = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n\n for (let i = 0; i < length; ++i) {\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\n","import {clipArea, unclipArea} from '../../helpers/index.js';\nimport {_findSegmentEnd, _getBounds, _segments} from './filler.segment.js';\nimport {_getTarget} from './filler.target.js';\n\nexport function _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const {line, scale, axis} = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const {above = color, below = color} = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {line, target, above, below, area, scale, axis});\n unclipArea(ctx);\n }\n}\n\nfunction doFill(ctx, cfg) {\n const {line, target, above, below, area, scale} = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n\n ctx.save();\n\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {line, target, color: above, scale, property});\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {line, target, color: below, scale, property});\n\n ctx.restore();\n}\n\nfunction clipVertical(ctx, target, clipY) {\n const {segments, points} = target;\n let first = true;\n let lineLoop = false;\n\n ctx.beginPath();\n for (const segment of segments) {\n const {start, end} = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {move: lineLoop});\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\n\nfunction fill(ctx, cfg) {\n const {line, target, property, color, scale} = cfg;\n const segments = _segments(line, target, property);\n\n for (const {source: src, target: tgt, start, end} of segments) {\n const {style: {backgroundColor = color} = {}} = src;\n const notShape = target !== true;\n\n ctx.save();\n ctx.fillStyle = backgroundColor;\n\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n\n ctx.beginPath();\n\n const lineLoop = !!line.pathSegment(ctx, src);\n\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n\n const targetLoop = !!target.pathSegment(ctx, tgt, {move: lineLoop, reverse: true});\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n\n ctx.restore();\n }\n}\n\nfunction clipBounds(ctx, scale, bounds) {\n const {top, bottom} = scale.chart.chartArea;\n const {property, start, end} = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\n\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\n","/**\n * Plugin based on discussion from the following Chart.js issues:\n * @see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569\n * @see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897\n */\n\nimport LineElement from '../../elements/element.line.js';\nimport {_drawfill} from './filler.drawing.js';\nimport {_shouldApplyFill} from './filler.helper.js';\nimport {_decodeFill, _resolveTarget} from './filler.options.js';\n\nexport default {\n id: 'filler',\n\n afterDatasetsUpdate(chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n\n for (i = 0; i < count; ++i) {\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line,\n };\n }\n\n meta.$filler = source;\n sources.push(source);\n }\n\n for (i = 0; i < count; ++i) {\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n\n beforeDraw(chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n\n beforeDatasetsDraw(chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n\n const metasets = chart.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n\n beforeDatasetDraw(chart, args, options) {\n const source = args.meta.$filler;\n\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n","import defaults from '../core/core.defaults.js';\nimport Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {addRoundedRectPath, drawPointLegend, renderText} from '../helpers/helpers.canvas.js';\nimport {\n _isBetween,\n callback as call,\n clipArea,\n getRtlAdapter,\n overrideTextDirection,\n restoreTextDirection,\n toFont,\n toPadding,\n unclipArea,\n valueOrDefault,\n} from '../helpers/index.js';\nimport {_alignStartEnd, _textX, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {toTRBLCorners} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n */\n\nconst getBoxSize = (labelOpts, fontSize) => {\n let {boxHeight = fontSize, boxWidth = fontSize} = labelOpts;\n\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\n\nconst itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\n\nexport class Legend extends Element {\n\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this._added = false;\n\n // Contains hit boxes for each dataset (in dataset order)\n this.legendHitBoxes = [];\n\n /**\n \t\t * @private\n \t\t */\n this._hoveredItem = null;\n\n // Are we in doughnut mode which has a different data type\n this.doughnutMode = false;\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = call(labelOpts.generateLabels, [this.chart], this) || [];\n\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));\n }\n\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, this.chart.data));\n }\n\n if (this.options.reverse) {\n legendItems.reverse();\n }\n\n this.legendItems = legendItems;\n }\n\n fit() {\n const {options, ctx} = this;\n\n // The legend may not be displayed for a variety of reasons including\n // the fact that the defaults got set to `false`.\n // When the legend is not displayed, there are no guarantees that the options\n // are correctly formatted so we need to bail out as early as possible.\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const {boxWidth, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n let width, height;\n\n ctx.font = labelFont.string;\n\n if (this.isHorizontal()) {\n width = this.maxWidth; // fill all the width\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight; // fill all the height\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n\n /**\n\t * @private\n\t */\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const {ctx, maxWidth, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one\n const lineWidths = this.lineWidths = [0];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i) => {\n const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n\n hitboxes[i] = {left: 0, top, row, width: itemWidth, height: itemHeight};\n\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n\n return totalHeight;\n }\n\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const {ctx, maxHeight, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n\n let left = 0;\n let col = 0;\n\n this.legendItems.forEach((legendItem, i) => {\n const {itemWidth, itemHeight} = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n\n // If too tall, go to new column\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n\n // Store the hitbox width and height here. Final position will be updated in `draw`\n hitboxes[i] = {left, top: currentColHeight, col, width: itemWidth, height: itemHeight};\n\n // Get max width\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n\n totalWidth += currentColWidth;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n\n return totalWidth;\n }\n\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const {legendHitBoxes: hitboxes, options: {align, labels: {padding}, rtl}} = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes) {\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes) {\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n\n this._draw();\n\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @private\n\t */\n _draw() {\n const {options: opts, columnSizes, lineWidths, ctx} = this;\n const {align, labels: labelOpts} = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const {padding} = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n\n this.drawTitle();\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n\n const {boxWidth, boxHeight, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n // current position\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n\n // Set the ctx for the box\n ctx.save();\n\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n\n if (labelOpts.usePointStyle) {\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n\n // Draw pointStyle as legend symbol\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n // Draw box as legend symbol\n // Adjust position when boxHeight < fontSize (want it centered)\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n\n ctx.beginPath();\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n\n ctx.restore();\n };\n\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + (itemHeight / 2), labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n\n // Horizontal\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n\n overrideTextDirection(this.ctx, opts.textDirection);\n\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i) => {\n ctx.strokeStyle = legendItem.fontColor; // for strikethrough effect\n ctx.fillStyle = legendItem.fontColor; // render in correct colour\n\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n\n rtlHelper.setWidth(this.width);\n\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n\n const realX = rtlHelper.x(x);\n\n drawLegendBox(realX, y, legendItem);\n\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n\n // Fill the actual label\n fillText(rtlHelper.x(x), y, legendItem);\n\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n\n if (!titleOpts.display) {\n return;\n }\n\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n\n // These defaults are used when the legend is vertical.\n // When horizontal, they are computed below.\n let left = this.left;\n let maxWidth = this.width;\n\n if (this.isHorizontal()) {\n // Move left / right so that the title is above the legend lines\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n // Move down so that the title is above the legend stack in every alignment\n const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n\n // Now that we know the left edge of the inner legend box, compute the correct\n // X coordinate from the title alignment\n const x = _alignStartEnd(position, left, left + maxWidth);\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n\n /**\n\t * @private\n\t */\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n\n /**\n\t * @private\n\t */\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n\n if (_isBetween(x, this.left, this.right)\n && _isBetween(y, this.top, this.bottom)) {\n // See if we are touching one of the dataset boxes\n lh = this.legendHitBoxes;\n for (i = 0; i < lh.length; ++i) {\n hitBox = lh[i];\n\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width)\n && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n // Touching an element\n return this.legendItems[i];\n }\n }\n }\n\n return null;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t */\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n\n // Chart event already has relative position in it\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n call(opts.onLeave, [e, previous, this], this);\n }\n\n this._hoveredItem = hoveredItem;\n\n if (hoveredItem && !sameItem) {\n call(opts.onHover, [e, hoveredItem, this], this);\n }\n } else if (hoveredItem) {\n call(opts.onClick, [e, hoveredItem, this], this);\n }\n }\n}\n\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {itemWidth, itemHeight};\n}\n\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b) => a.length > b.length ? a : b);\n }\n return boxWidth + (labelFont.size / 2) + ctx.measureText(legendItemText).width;\n}\n\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\n\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\n\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\n\nexport default {\n id: 'legend',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Legend,\n\n start(chart, _args, options) {\n const legend = chart.legend = new Legend({ctx: chart.ctx, options, chart});\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n\n stop(chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n\n // During the beforeUpdate step, the layout configuration needs to run\n // This ensures that if the legend position changes (via an option update)\n // the layout system respects the change. See https://github.com/chartjs/Chart.js/issues/7527\n beforeUpdate(chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n\n // The labels need to be built after datasets are updated to ensure that colors\n // and other styling are correct. See https://github.com/chartjs/Chart.js/issues/6968\n afterUpdate(chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n\n\n afterEvent(chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n\n // a callback that will handle\n onClick(e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n\n onHover: null,\n onLeave: null,\n\n labels: {\n color: (ctx) => ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n // Generates labels shown in the legend\n // Valid properties to return:\n // text : text to display\n // fillStyle : fill of coloured box\n // strokeStyle: stroke of coloured box\n // hidden : if this legend item refers to a hidden item\n // lineCap : cap style for line\n // lineDash\n // lineDashOffset :\n // lineJoin :\n // lineWidth :\n generateLabels(chart) {\n const datasets = chart.data.datasets;\n const {labels: {usePointStyle, pointStyle, textAlign, color, useBorderRadius, borderRadius}} = chart.legend.options;\n\n return chart._getSortedDatasetMetas().map((meta) => {\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n\n // Below is extra data used for toggling the datasets\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n\n title: {\n color: (ctx) => ctx.chart.options.color,\n display: false,\n position: 'center',\n text: '',\n }\n },\n\n descriptors: {\n _scriptable: (name) => !name.startsWith('on'),\n labels: {\n _scriptable: (name) => !['generateLabels', 'filter', 'sort'].includes(name),\n }\n },\n};\n","import Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {PI, isArray, toPadding, toFont} from '../helpers/index.js';\nimport {_toLeftRightCenter, _alignStartEnd} from '../helpers/helpers.extras.js';\nimport {renderText} from '../helpers/helpers.canvas.js';\n\nexport class Title extends Element {\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight) {\n const opts = this.options;\n\n this.left = 0;\n this.top = 0;\n\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n\n _drawArgs(offset) {\n const {top, left, bottom, right, options} = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {titleX, titleY, maxWidth, rotation};\n }\n\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n\n if (!opts.display) {\n return;\n }\n\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const {titleX, titleY, maxWidth, rotation} = this._drawArgs(offset);\n\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n}\n\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\n\nexport default {\n id: 'title',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Title,\n\n start(chart, _args, options) {\n createTitle(chart, options);\n },\n\n stop(chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n\n beforeUpdate(chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold',\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000 // by default greater than legend (1000) to be above\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import {Title} from './plugin.title.js';\nimport layouts from '../core/core.layouts.js';\n\nconst map = new WeakMap();\n\nexport default {\n id: 'subtitle',\n\n start(chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n\n stop(chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n\n beforeUpdate(chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal',\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500 // by default greater than legend (1000) and smaller than title (2000)\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import Animations from '../core/core.animations.js';\nimport Element from '../core/core.element.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {each, noop, isNullOrUndef, isArray, _elementsEqual, isObject} from '../helpers/helpers.core.js';\nimport {toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\nimport {getRtlAdapter, overrideTextDirection, restoreTextDirection} from '../helpers/helpers.rtl.js';\nimport {distanceBetweenPoints, _limitValue} from '../helpers/helpers.math.js';\nimport {createContext, drawPoint} from '../helpers/index.js';\n\n/**\n * @typedef { import('../platform/platform.base.js').Chart } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').ActiveElement } ActiveElement\n * @typedef { import('../core/core.interaction.js').InteractionItem } InteractionItem\n */\n\nconst positioners = {\n /**\n\t * Average mode places the tooltip at the average position of the elements shown\n\t */\n average(items) {\n if (!items.length) {\n return false;\n }\n\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n\n return {\n x: x / count,\n y: y / count\n };\n },\n\n /**\n\t * Gets the tooltip position nearest of the item nearest to the event position\n\t */\n nearest(items, eventPosition) {\n if (!items.length) {\n return false;\n }\n\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n\n return {\n x,\n y\n };\n }\n};\n\n// Helper to push or concat based on if the 2nd parameter is an array or not\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n}\n\n/**\n * Returns array of strings split by newline\n * @param {*} str - The value to split by newline.\n * @returns {string|string[]} value if newline present - Returned from String split() method\n * @function\n */\nfunction splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n\n\n/**\n * Private helper to create a tooltip item model\n * @param {Chart} chart\n * @param {ActiveElement} item - {element, index, datasetIndex} to create the tooltip item for\n * @return new tooltip item\n */\nfunction createTooltipItem(chart, item) {\n const {element, datasetIndex, index} = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const {label, value} = controller.getLabelAndValue(index);\n\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n\n/**\n * Get the size of the tooltip\n */\nfunction getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const {body, footer, title} = tooltip;\n const {boxWidth, boxHeight} = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n\n // Count of all lines in the body\n let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight\n\t\t\t+ (titleLineCount - 1) * options.titleSpacing\n\t\t\t+ options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n // Body lines may include some extra height depending on boxHeight\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight\n\t\t\t+ (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight\n\t\t\t+ (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop\n\t\t\t+ footerLineCount * footerFont.lineHeight\n\t\t\t+ (footerLineCount - 1) * options.footerSpacing;\n }\n\n // Title width\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n\n ctx.save();\n\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n\n // Body width\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n\n // Body lines may include some extra width due to the color box\n widthPadding = options.displayColors ? (boxWidth + 2 + options.boxPadding) : 0;\n each(body, (bodyItem) => {\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n\n // Reset back to 0\n widthPadding = 0;\n\n // Footer width\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n\n ctx.restore();\n\n // Add padding\n width += padding.width;\n\n return {width, height};\n}\n\nfunction determineYAlign(chart, size) {\n const {y, height} = size;\n\n if (y < height / 2) {\n return 'top';\n } else if (y > (chart.height - height / 2)) {\n return 'bottom';\n }\n return 'center';\n}\n\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const {x, width} = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\n\nfunction determineXAlign(chart, options, size, yAlign) {\n const {x, width} = size;\n const {width: chartWidth, chartArea: {left, right}} = chart;\n let xAlign = 'center';\n\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n\n return xAlign;\n}\n\n/**\n * Helper to get the alignment of a tooltip given the size\n */\nfunction determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\n\nfunction alignX(size, xAlign) {\n let {x, width} = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= (width / 2);\n }\n return x;\n}\n\nfunction alignY(size, yAlign, paddingAndSize) {\n // eslint-disable-next-line prefer-const\n let {y, height} = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= (height / 2);\n }\n return y;\n}\n\n/**\n * Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment\n */\nfunction getBackgroundPoint(options, size, alignment, chart) {\n const {caretSize, caretPadding, cornerRadius} = options;\n const {xAlign, yAlign} = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\n\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n\n return align === 'center'\n ? tooltip.x + tooltip.width / 2\n : align === 'right'\n ? tooltip.x + tooltip.width - padding.right\n : tooltip.x + padding.left;\n}\n\n/**\n * Helper to build before and after body lines\n */\nfunction getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\n\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\n\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\n\nconst defaultCallbacks = {\n // Args are: (tooltipItems, data)\n beforeTitle: noop,\n title(tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n\n return '';\n },\n afterTitle: noop,\n\n // Args are: (tooltipItems, data)\n beforeBody: noop,\n\n // Args are: (tooltipItem, data)\n beforeLabel: noop,\n label(tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n\n let label = tooltipItem.dataset.label || '';\n\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0,\n };\n },\n labelTextColor() {\n return this.options.bodyColor;\n },\n labelPointStyle(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation,\n };\n },\n afterLabel: noop,\n\n // Args are: (tooltipItems, data)\n afterBody: noop,\n\n // Args are: (tooltipItems, data)\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n\n/**\n * Invoke callback from object with context and arguments.\n * If callback returns `undefined`, then will be invoked default callback.\n * @param {Record} callbacks\n * @param {keyof typeof defaultCallbacks} name\n * @param {*} ctx\n * @param {*} arg\n * @returns {any}\n */\nfunction invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n\n return result;\n}\n\nexport class Tooltip extends Element {\n\n /**\n * @namespace Chart.Tooltip.positioners\n */\n static positioners = positioners;\n\n constructor(config) {\n super();\n\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n // TODO: V4, make this private, rename to `_labelStyles`, and combine with `labelPointStyles`\n // and `labelTextColors` to create a single variable\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n\n /**\n\t * @private\n\t */\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n\n if (cached) {\n return cached;\n }\n\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n\n return animations;\n }\n\n /**\n\t * @protected\n\t */\n getContext() {\n return this.$context ||\n\t\t\t(this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n\n getTitle(context, options) {\n const {callbacks} = options;\n\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n\n return lines;\n }\n\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems)\n );\n }\n\n getBody(tooltipItems, options) {\n const {callbacks} = options;\n const bodyItems = [];\n\n each(tooltipItems, (context) => {\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n\n bodyItems.push(bodyItem);\n });\n\n return bodyItems;\n }\n\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems)\n );\n }\n\n // Get the footer and beforeFooter and afterFooter lines\n getFooter(tooltipItems, options) {\n const {callbacks} = options;\n\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n\n return lines;\n }\n\n /**\n\t * @private\n\t */\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n\n for (i = 0, len = active.length; i < len; ++i) {\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n\n // If the user provided a filter function, use it to modify the tooltip items\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array) => options.filter(element, index, array, data));\n }\n\n // If the user provided a sorting function, use it to modify the tooltip items\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b) => options.itemSort(a, b, data));\n }\n\n // Determine colors for boxes\n each(tooltipItems, (context) => {\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n\n if (changed && options.external) {\n options.external.call(this, {chart: this.chart, tooltip: this, replay});\n }\n }\n\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n\n getCaretPosition(tooltipPoint, size, options) {\n const {xAlign, yAlign} = this;\n const {caretSize, cornerRadius} = options;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n const {x: ptX, y: ptY} = tooltipPoint;\n const {width, height} = size;\n let x1, x2, x3, y1, y2, y3;\n\n if (yAlign === 'center') {\n y2 = ptY + (height / 2);\n\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n\n // Left draws bottom -> top, this y1 is on the bottom\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n\n // Right draws top -> bottom, thus y1 is on the top\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + (caretSize);\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n\n // Top draws left -> right, thus x1 is on the left\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n\n // Bottom draws right -> left, thus x1 is on the right\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {x1, x2, x3, y1, y2, y3};\n }\n\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.titleAlign, options);\n\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing; // Line Height and spacing\n\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing\n }\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const {boxHeight, boxWidth} = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2, // fit the circle in the box\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n\n // Fill the point with white so that colours merge nicely if the opacity is < 1\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n\n // Draw the point\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n // Border\n ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : (labelColor.borderWidth || 1); // TODO, v4 remove fallback\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n\n // Fill a white rect so that colours merge nicely if the opacity is < 1\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = toTRBLCorners(labelColor.borderRadius);\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n ctx.fill();\n ctx.stroke();\n\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n // Normal rect\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n\n // restore fillStyle\n ctx.fillStyle = this.labelTextColors[i];\n }\n\n drawBody(pt, ctx, options) {\n const {body} = this;\n const {bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding} = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n\n // Before body lines\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right'\n ? bodyAlign === 'center' ? (boxWidth / 2 + boxPadding) : (boxWidth + 2 + boxPadding)\n : 0;\n\n // Draw body lines now\n for (i = 0, ilen = body.length; i < ilen; ++i) {\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n\n lines = bodyItem.lines;\n // Draw Legend-like boxes if needed\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n\n for (j = 0, jlen = lines.length; j < jlen; ++j) {\n fillLineOfText(lines[j]);\n // Reset for any lines that don't include colorbox\n bodyLineHeight = bodyFont.lineHeight;\n }\n\n each(bodyItem.after, fillLineOfText);\n }\n\n // Reset back to 0 for after body\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n\n // After body lines\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing; // Remove last body spacing\n }\n\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n\n footerFont = toFont(options.footerFont);\n\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n\n drawBackground(pt, ctx, tooltipSize, options) {\n const {xAlign, yAlign} = this;\n const {x, y} = pt;\n const {width, height} = tooltipSize;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(options.cornerRadius);\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n\n ctx.fill();\n\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n\n /**\n\t * Update x/y animation targets when _active elements are animating too\n\t * @private\n\t */\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n\n /**\n * Determine if the tooltip will draw anything\n * @returns {boolean} True if the tooltip will render\n */\n _willRender() {\n return !!this.opacity;\n }\n\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n\n if (!opacity) {\n return;\n }\n\n this._updateAnimationTarget(options);\n\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n\n // IE11/Edge does not like very small opacities, so snap to 0\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n\n const padding = toPadding(options.padding);\n\n // Truthy/falsey value for empty tooltip\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n\n // Draw Background\n this.drawBackground(pt, ctx, tooltipSize, options);\n\n overrideTextDirection(ctx, options.textDirection);\n\n pt.y += padding.top;\n\n // Titles\n this.drawTitle(pt, ctx, options);\n\n // Body\n this.drawBody(pt, ctx, options);\n\n // Footer\n this.drawFooter(pt, ctx, options);\n\n restoreTextDirection(ctx, options.textDirection);\n\n ctx.restore();\n }\n }\n\n /**\n\t * Get active elements in the tooltip\n\t * @returns {Array} Array of elements that are active in the tooltip\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active elements in the tooltip\n\t * @param {array} activeElements Array of active datasetIndex/index pairs.\n\t * @param {object} eventPosition Synthetic event position used in positioning\n\t */\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.chart.getDatasetMeta(datasetIndex);\n\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {boolean} true if the tooltip changed\n\t */\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n\n // When there are multiple items shown, but the tooltip position is nearest mode\n // an update may need to be made because our position may have changed even though\n // the items are the same as before.\n const positionChanged = this._positionChanged(active, e);\n\n // Remember Last Actives\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n\n // Only handle target event on tooltip change\n if (changed) {\n this._active = active;\n\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n\n this.update(true, replay);\n }\n }\n\n return changed;\n }\n\n /**\n\t * Helper for determining the active elements for event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {InteractionItem[]} lastActive - Previously active elements\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {InteractionItem[]} - Active elements\n\t * @private\n\t */\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n return lastActive;\n }\n\n // Find Active Elements for tooltips\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n\n if (options.reverse) {\n active.reverse();\n }\n\n return active;\n }\n\n /**\n\t * Determine if the active elements + event combination changes the\n\t * tooltip position\n\t * @param {array} active - Active elements\n\t * @param {ChartEvent} e - Event that triggered the position change\n\t * @returns {boolean} True if the position has changed\n\t */\n _positionChanged(active, e) {\n const {caretX, caretY, options} = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\n\nexport default {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n\n afterInit(chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({chart, options});\n }\n },\n\n beforeUpdate(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n reset(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n afterDraw(chart) {\n const tooltip = chart.tooltip;\n\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n\n if (chart.notifyPlugins('beforeTooltipDraw', {...args, cancelable: true}) === false) {\n return;\n }\n\n tooltip.draw(chart.ctx);\n\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n\n afterEvent(chart, args) {\n if (chart.tooltip) {\n // If the event is replayed from `update`, we should evaluate with the final positions.\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n // notify chart about the change, so it will render\n args.changed = true;\n }\n }\n },\n\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold',\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {\n },\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold',\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts) => opts.bodyFont.size,\n boxWidth: (ctx, opts) => opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart',\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'width', 'height', 'caretX', 'caretY'],\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n\n descriptors: {\n _scriptable: (name) => name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false,\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n\n // Resolve additionally from `interaction` options and defaults.\n additionalOptionScopes: ['interaction']\n};\n","import Scale from '../core/core.scale.js';\nimport {isNullOrUndef, valueOrDefault, _limitValue} from '../helpers/index.js';\n\nconst addIfString = (labels, raw, index, addedLabels) => {\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({index, label: raw});\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\n\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\n\nconst validIndex = (index, max) => index === null ? null : _limitValue(Math.round(index), 0, max);\n\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\n\nexport default class CategoryScale extends Scale {\n\n static id = 'category';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const {index, label} of added) {\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index\n : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n\n determineDataLimits() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this.getMinMax(true);\n\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n\n // If we are viewing some subset of labels, slice the original array\n labels = (min === 0 && max === labels.length - 1) ? labels : labels.slice(min, max + 1);\n\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n\n for (let value = min; value <= max; value++) {\n ticks.push({value});\n }\n return ticks;\n }\n\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n super.configure();\n\n if (!this.isHorizontal()) {\n // For backward compatibility, vertical category scale reverse is inverted.\n this._reversePixels = !this._reversePixels;\n }\n }\n\n // Used to get data value locations. Value can either be an index or a numerical value\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n // Must override base implementation because it calls getPixelForValue\n // and category scale can have duplicate values\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n\n getBasePixel() {\n return this.bottom;\n }\n}\n","import {isNullOrUndef} from '../helpers/helpers.core.js';\nimport {almostEquals, almostWhole, niceNum, _decimalPlaces, _setMinAndMaxByKey, sign, toRadians} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\n\n/**\n * Generate a set of linear ticks for an axis\n * 1. If generationOptions.min, generationOptions.max, and generationOptions.step are defined:\n * if (max - min) / step is an integer, ticks are generated as [min, min + step, ..., max]\n * Note that the generationOptions.maxCount setting is respected in this scenario\n *\n * 2. If generationOptions.min, generationOptions.max, and generationOptions.count is defined\n * spacing = (max - min) / count\n * Ticks are generated as [min, min + spacing, ..., max]\n *\n * 3. If generationOptions.count is defined\n * spacing = (niceMax - niceMin) / count\n *\n * 4. Compute optimal spacing of ticks using niceNum algorithm\n *\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, dataRange) {\n const ticks = [];\n // To get a \"nice\" value for the tick spacing, we will use the appropriately named\n // \"nice number\" algorithm. See https://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks\n // for details.\n\n const MIN_SPACING = 1e-14;\n const {bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds} = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const {min: rmin, max: rmax} = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n\n // Beyond MIN_SPACING floating point numbers being to lose precision\n // such that we can't do the math necessary to generate ticks\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [{value: rmin}, {value: rmax}];\n }\n\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n // If the calculated num of spaces exceeds maxNumSpaces, recalculate it\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n\n if (!isNullOrUndef(precision)) {\n // If the user specified a precision, round to that number of decimal places\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n // Case 1: If min, max and stepSize are set and they make an evenly spaced scale use it.\n // spacing = step;\n // numSpaces = (max - min) / spacing;\n // Note that we round here to handle the case where almostWhole translated an FP error\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n // Cases 2 & 3, we have a count specified. Handle optional user defined edges to the range.\n // Sometimes these are no-ops, but it makes the code a lot clearer\n // and when a user defined range is specified, we want the correct ticks\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n // Case 4\n numSpaces = (niceMax - niceMin) / spacing;\n\n // If very close to our rounded value, use it.\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n\n // The spacing will have changed in cases 1, 2, and 3 so the factor cannot be computed\n // until this point\n const decimalPlaces = Math.max(\n _decimalPlaces(spacing),\n _decimalPlaces(niceMin)\n );\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({value: min});\n\n if (niceMin < min) {\n j++; // Skip niceMin\n }\n // If the next nice tick is close to min, skip it\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n\n for (; j < numSpaces; ++j) {\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) {\n break;\n }\n ticks.push({value: tickValue});\n }\n\n if (maxDefined && includeBounds && niceMax !== max) {\n // If the previous tick is too close to max, replace it with max, else add max\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({value: max});\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({value: niceMax});\n }\n\n return ticks;\n}\n\nfunction relativeLabelSize(value, minSpacing, {horizontal, minRotation}) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\n\nexport default class LinearScaleBase extends Scale {\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n /** @type {number} */\n this._endValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n\n return +raw;\n }\n\n handleTickRangeOptions() {\n const {beginAtZero} = this.options;\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n\n setMax(max + offset);\n\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n\n getTickLimit() {\n const tickOpts = this.options.ticks;\n // eslint-disable-next-line prefer-const\n let {maxTicksLimit, stepSize} = tickOpts;\n let maxTicks;\n\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n\n return maxTicks;\n }\n\n /**\n\t * @protected\n\t */\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n // Figure out what the max number of ticks we can support it is based on the size of\n // the axis area. For now, we say that the minimum tick spacing in pixels must be 40\n // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n // the graph. Make sure we always have at least 2 ticks\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks(numericGeneratorOptions, dataRange);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n\n super.configure();\n\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n","import {isFinite} from '../helpers/helpers.core.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {toRadians} from '../helpers/index.js';\n\nexport default class LinearScale extends LinearScaleBase {\n\n static id = 'linear';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? min : 0;\n this.max = isFinite(max) ? max : 1;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n \t */\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n\n // Utils\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n","import {finiteOrDefault, isFinite} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {_setMinAndMaxByKey, log10} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\n\nconst log10Floor = v => Math.floor(log10(v));\nconst changeExponent = (v, m) => Math.pow(10, log10Floor(v) + m);\n\nfunction isMajor(tickVal) {\n const remain = tickVal / (Math.pow(10, log10Floor(tickVal)));\n return remain === 1;\n}\n\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\n\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while (steps(min, max, rangeExp) > 10) {\n rangeExp++;\n }\n while (steps(min, max, rangeExp) < 10) {\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n\n\n/**\n * Generate a set of logarithmic ticks\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, {min, max}) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while (value < max) {\n ticks.push({value, major: isMajor(value), significand});\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({value: lastTick, major: isMajor(lastTick), significand});\n\n return ticks;\n}\n\nexport default class LogarithmicScale extends Scale {\n\n static id = 'logarithmic';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [raw, index]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isFinite(value) && value > 0 ? value : null;\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? Math.max(0, min) : null;\n this.max = isFinite(max) ? Math.max(0, max) : null;\n\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n\n // if data has `0` in it or `beginAtZero` is true, min (non zero) value is at bottom\n // of scale, and it does not equal suggestedMin, lower the min bound by one exp.\n if (this._zero && this.min !== this._suggestedMin && !isFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n\n this.handleTickRangeOptions();\n }\n\n handleTickRangeOptions() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (min === max) {\n if (min <= 0) { // includes null\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n\n setMax(changeExponent(min, +1));\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const opts = this.options;\n\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value === undefined\n ? '0'\n : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const start = this.min;\n\n super.configure();\n\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min\n ? 0\n : (log10(value) - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n","import defaults from '../core/core.defaults.js';\nimport {_longestText, addRoundedRectPath, renderText, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport {HALF_PI, TAU, toDegrees, toRadians, _normalizeAngle, PI} from '../helpers/helpers.math.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {valueOrDefault, isArray, isFinite, callback as callCallback, isNullOrUndef} from '../helpers/helpers.core.js';\nimport {createContext, toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\n\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [label];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\n\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - (size / 2),\n end: pos + (size / 2)\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n\n return {\n start: pos,\n end: pos + size\n };\n}\n\n/**\n * Helper function to fit a radial linear scale with point labels\n */\nfunction fitWithPointLabels(scale) {\n\n // Right, this is really confusing and there is a lot of maths going on here\n // The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n //\n // Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n //\n // Solution:\n //\n // We assume the radius of the polygon is half the size of the canvas at first\n // at each index we check if the text overlaps.\n //\n // Where it does, we store that angle and that index.\n //\n // After finding the largest index and angle we calculate how much we need to remove\n // from the shape radius to move the point inwards by that x.\n //\n // We average the left and right distances to get the maximum shape radius that can fit in the box\n // along with labels.\n //\n // Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n // on each side, removing that from the size, halving it and adding the left x protrusion width.\n //\n // This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n // and position it in the most space efficient manner\n //\n // https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n\n // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n\n for (let i = 0; i < valueCount; i++) {\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n\n scale.setCenterPoint(\n orig.l - limits.l,\n limits.r - orig.r,\n orig.t - limits.t,\n limits.b - orig.b\n );\n\n // Now that text size is determined, compute the full positions\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\n\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\n\nfunction createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const {extra, additionalAngle, padding, size} = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n // if to draw or overlapped\n visible: true,\n\n // Text position\n x: pointLabelPosition.x,\n y,\n\n // Text rendering data\n textAlign,\n\n // Bounding box\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\n\nfunction isNotOverlapped(item, area) {\n if (!area) {\n return true;\n }\n const {left, top, right, bottom} = item;\n const apexesInArea = _isPointInArea({x: left, y: top}, area) || _isPointInArea({x: left, y: bottom}, area) ||\n _isPointInArea({x: right, y: top}, area) || _isPointInArea({x: right, y: bottom}, area);\n return !apexesInArea;\n}\n\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const {centerPointLabels, display} = opts.pointLabels;\n const itemOpts = {\n extra: getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? PI / valueCount : 0\n };\n let area;\n\n for (let i = 0; i < valueCount; i++) {\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n\n const item = createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === 'auto') {\n item.visible = isNotOverlapped(item, area);\n if (item.visible) {\n area = item;\n }\n }\n }\n return items;\n}\n\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n\n return 'right';\n}\n\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= (w / 2);\n }\n return x;\n}\n\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= (h / 2);\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\n\nfunction drawPointLabelBox(ctx, opts, item) {\n const {left, top, right, bottom} = item;\n const {backdropColor} = opts;\n\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(opts.borderRadius);\n const padding = toPadding(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n}\n\nfunction drawPointLabels(scale, labelCount) {\n const {ctx, options: {pointLabels}} = scale;\n\n for (let i = labelCount - 1; i >= 0; i--) {\n const item = scale._pointLabelItems[i];\n if (!item.visible) {\n // overlapping\n continue;\n }\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = toFont(optsAtIndex.font);\n const {x, y, textAlign} = item;\n\n renderText(\n ctx,\n scale._pointLabels[i],\n x,\n y + (plFont.lineHeight / 2),\n plFont,\n {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n }\n );\n }\n}\n\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const {ctx} = scale;\n if (circular) {\n // Draw circular arcs between the points\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n // Draw straight lines connecting each index\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n\n for (let i = 1; i < labelCount; i++) {\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\n\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n\n const {color, lineWidth} = gridLineOpts;\n\n if ((!circular && !labelCount) || !color || !lineWidth || radius < 0) {\n return;\n }\n\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\n\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\n\nexport default class RadialLinearScale extends LinearScaleBase {\n\n static id = 'radialLinear';\n\n /**\n * @type {any}\n */\n static defaults = {\n display: true,\n\n // Boolean - Whether to animate scaling the chart from the centre\n animate: true,\n position: 'chartArea',\n\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n\n grid: {\n circular: false\n },\n\n startAngle: 0,\n\n // label settings\n ticks: {\n // Boolean - Show a backdrop to the scale label\n showLabelBackdrop: true,\n\n callback: Ticks.formatters.numeric\n },\n\n pointLabels: {\n backdropColor: undefined,\n\n // Number - The backdrop padding above & below the label in pixels\n backdropPadding: 2,\n\n // Boolean - if true, show point labels\n display: true,\n\n // Number - Point label font size in pixels\n font: {\n size: 10\n },\n\n // Function - Used to convert point labels\n callback(label) {\n return label;\n },\n\n // Number - Additionl padding between scale and pointLabel\n padding: 5,\n\n // Boolean - if true, center point labels to slices in polar chart\n centerPointLabels: false\n }\n };\n\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.xCenter = undefined;\n /** @type {number} */\n this.yCenter = undefined;\n /** @type {number} */\n this.drawingArea = undefined;\n /** @type {string[]} */\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(false);\n\n this.min = isFinite(min) && !isNaN(min) ? min : 0;\n this.max = isFinite(max) && !isNaN(max) ? max : 0;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n\t */\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n\n // Point labels\n this._pointLabels = this.getLabels()\n .map((value, index) => {\n const label = callCallback(this.options.pointLabels.callback, [value, index], this);\n return label || label === 0 ? label : '';\n })\n .filter((v, i) => this.chart.getDataVisibility(i));\n }\n\n fit() {\n const opts = this.options;\n\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n\n // Take into account half font size + the yPadding of the top value\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n\n getPointLabelPosition(index) {\n const {left, top, right, bottom} = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom,\n };\n }\n\n /**\n\t * @protected\n\t */\n drawBackground() {\n const {backgroundColor, grid: {circular}} = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const {angleLines, grid, border} = opts;\n const labelCount = this._pointLabels.length;\n\n let i, offset, position;\n\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n\n if (grid.display) {\n this.ticks.forEach((tick, index) => {\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n\n if (angleLines.display) {\n ctx.save();\n\n for (i = labelCount - 1; i >= 0; i--) {\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const {color, lineWidth} = optsAtIndex;\n\n if (!lineWidth || !color) {\n continue;\n }\n\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {}\n\n /**\n\t * @protected\n\t */\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n if (!tickOpts.display) {\n return;\n }\n\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n\n this.ticks.forEach((tick, index) => {\n if (index === 0 && !opts.reverse) {\n return;\n }\n\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(\n -width / 2 - padding.left,\n -offset - tickFont.size / 2 - padding.top,\n width + padding.width,\n tickFont.size + padding.height\n );\n }\n\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth,\n });\n });\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {}\n}\n","import adapters from '../core/core.adapters.js';\nimport {callback as call, isFinite, isNullOrUndef, mergeIf, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toRadians, isNumber, _limitValue} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {_arrayUnique, _filterBetween, _lookup} from '../helpers/helpers.collection.js';\n\n/**\n * @typedef { import('../core/core.adapters.js').TimeUnit } Unit\n * @typedef {{common: boolean, size: number, steps?: number}} Interval\n * @typedef { import('../core/core.adapters.js').DateAdapter } DateAdapter\n */\n\n/**\n * @type {Object}\n */\nconst INTERVALS = {\n millisecond: {common: true, size: 1, steps: 1000},\n second: {common: true, size: 1000, steps: 60},\n minute: {common: true, size: 60000, steps: 60},\n hour: {common: true, size: 3600000, steps: 24},\n day: {common: true, size: 86400000, steps: 30},\n week: {common: false, size: 604800000, steps: 4},\n month: {common: true, size: 2.628e9, steps: 12},\n quarter: {common: false, size: 7.884e9, steps: 4},\n year: {common: true, size: 3.154e10}\n};\n\n/**\n * @type {Unit[]}\n */\nconst UNITS = /** @type Unit[] */ /* #__PURE__ */ (Object.keys(INTERVALS));\n\n/**\n * @param {number} a\n * @param {number} b\n */\nfunction sorter(a, b) {\n return a - b;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {*} input\n * @return {number}\n */\nfunction parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n\n const adapter = scale._adapter;\n const {parser, round, isoWeekday} = scale._parseOpts;\n let value = input;\n\n if (typeof parser === 'function') {\n value = parser(value);\n }\n\n // Only parse if it's not a timestamp already\n if (!isFinite(value)) {\n value = typeof parser === 'string'\n ? adapter.parse(value, /** @type {Unit} */ (parser))\n : adapter.parse(value);\n }\n\n if (value === null) {\n return null;\n }\n\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true)\n ? adapter.startOf(value, 'isoWeek', isoWeekday)\n : adapter.startOf(value, round);\n }\n\n return +value;\n}\n\n/**\n * Figures out what unit results in an appropriate number of auto-generated ticks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @param {number} capacity\n * @return {object}\n */\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n\n for (let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n\n return UNITS[ilen - 1];\n}\n\n/**\n * Figures out what unit to format a set of ticks with\n * @param {TimeScale} scale\n * @param {number} numTicks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @return {Unit}\n */\nfunction determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for (let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n\n/**\n * @param {Unit} unit\n * @return {object}\n */\nfunction determineMajorUnit(unit) {\n for (let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n\n/**\n * @param {object} ticks\n * @param {number} time\n * @param {number[]} [timestamps] - if defined, snap to these timestamps\n */\nfunction addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const {lo, hi} = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n\n/**\n * @param {TimeScale} scale\n * @param {object[]} ticks\n * @param {object} map\n * @param {Unit} majorUnit\n * @return {object[]}\n */\nfunction setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n\n for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {number[]} values\n * @param {Unit|undefined} [majorUnit]\n * @return {object[]}\n */\nfunction ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n /** @type {Object} */\n const map = {};\n const ilen = values.length;\n let i, value;\n\n for (i = 0; i < ilen; ++i) {\n value = values[i];\n map[value] = i;\n\n ticks.push({\n value,\n major: false\n });\n }\n\n // We set the major ticks separately from the above loop because calling startOf for every tick\n // is expensive when there is a large number of ticks\n return (ilen === 0 || !majorUnit) ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\n\nexport default class TimeScale extends Scale {\n\n static id = 'time';\n\n /**\n * @type {any}\n */\n static defaults = {\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 2.7.0\n */\n bounds: 'data',\n\n adapters: {},\n time: {\n parser: false, // false == a pattern string from or a custom callback that converts its argument to a timestamp\n unit: false, // false == automatic or override with week, month, year, etc.\n round: false, // none, or override with week, month, year, etc.\n isoWeekday: false, // override week start day\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n /**\n * Ticks generation input values:\n * - 'auto': generates \"optimal\" ticks based on scale size and time options.\n * - 'data': generates ticks from data (including labels from data {t|x|y} objects).\n * - 'labels': generates ticks from user given `data.labels` values ONLY.\n * @see https://github.com/chartjs/Chart.js/pull/4507\n * @since 2.7.0\n */\n source: 'auto',\n\n callback: false,\n\n major: {\n enabled: false\n }\n }\n };\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {{data: number[], labels: number[], all: number[]}} */\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n\n /** @type {Unit} */\n this._unit = 'day';\n /** @type {Unit=} */\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n /** @type {DateAdapter} */\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n\n adapter.init(opts);\n\n // Backward compatibility: before introducing adapter, `displayFormats` was\n // supposed to contain *all* unit/string pairs but this can't be resolved\n // when loading the scale (adapters are loaded afterward), so let's populate\n // missing formats on update\n mergeIf(time.displayFormats, adapter.formats());\n\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n\n super.init(scaleOpts);\n\n this._normalized = opts.normalized;\n }\n\n /**\n\t * @param {*} raw\n\t * @param {number?} [index]\n\t * @return {number}\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n // eslint-disable-next-line prefer-const\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n\n /**\n\t\t * @param {object} bounds\n\t\t */\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n\n // If we have user provided `min` and `max` labels / data bounds can be ignored\n if (!minDefined || !maxDefined) {\n // Labels are always considered, when user did not force bounds\n _applyBounds(this._getLabelBounds());\n\n // If `bounds` is `'ticks'` and `ticks.source` is `'labels'`,\n // data bounds are ignored (and don't need to be determined)\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n\n min = isFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n\n // Make sure that max is strictly higher than min (required by the timeseries lookup table)\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n\n /**\n\t * @private\n\t */\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {min, max};\n }\n\n /**\n\t * @return {object[]}\n\t */\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n\n const min = this.min;\n const max = this.max;\n\n const ticks = _filterBetween(timestamps, min, max);\n\n // PRIVATE\n // determineUnitForFormatting relies on the number of ticks so we don't use it when\n // autoSkip is enabled because we don't yet know what the final number of ticks will be\n this._unit = timeOpts.unit || (tickOpts.autoSkip\n ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min))\n : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined\n : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n\n if (options.reverse) {\n ticks.reverse();\n }\n\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n\n afterAutoSkip() {\n // Offsets for bar charts need to be handled with the auto skipped\n // ticks. Once ticks have been skipped, we re-compute the offsets.\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map(tick => +tick.value));\n }\n }\n\n /**\n\t * Returns the start and end offsets from edges in the form of {start, end}\n\t * where each value is a relative width to the scale and ranges between 0 and 1.\n\t * They add extra margins on the both sides by scaling down the original scale.\n\t * Offsets are added when the `offset` option is true.\n\t * @param {number[]} timestamps\n\t * @protected\n\t */\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n\n this._offsets = {start, end, factor: 1 / (start + 1 + end)};\n }\n\n /**\n\t * Generates a maximum of `capacity` timestamps between min and max, rounded to the\n\t * `minor` unit using the given scale time `options`.\n\t * Important: this method can return ticks outside the min and max range, it's the\n\t * responsibility of the calling code to clamp values if needed.\n\t * @protected\n\t */\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n // @ts-ignore\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n\n // For 'week' unit, handle the first day of week option\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n\n // Align first ticks on unit\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n\n // Prevent browser from freezing in case user options request millions of milliseconds\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) {\n addTick(ticks, time, timestamps);\n }\n\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n\n // @ts-ignore\n return Object.keys(ticks).sort(sorter).map(x => +x);\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n\n /**\n\t * @param {number} value\n\t * @param {string|undefined} format\n\t * @return {string}\n\t */\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n\n /**\n\t * Function to format an individual tick mark\n\t * @param {number} time\n\t * @param {number} index\n\t * @param {object[]} ticks\n\t * @param {string|undefined} [format]\n\t * @return {string}\n\t * @private\n\t */\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n\n if (formatter) {\n return call(formatter, [time, index, ticks], this);\n }\n\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n\n /**\n\t * @param {object[]} ticks\n\t */\n generateTickLabels(ticks) {\n let i, ilen, tick;\n\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n\n /**\n\t * @param {string} label\n\t * @return {{w:number, h:number}}\n\t * @private\n\t */\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n\n return {\n w: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation),\n h: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation)\n };\n }\n\n /**\n\t * @param {number} exampleTime\n\t * @return {number}\n\t * @private\n\t */\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n\n // pick the longest format (milliseconds) for guesstimation\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [exampleTime], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n // subtract 1 - if offset then there's one less label than tick\n // if not offset then one half label padding is added to each end leaving room for one less label\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n\n /**\n\t * @protected\n\t */\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const metas = this.getMatchingVisibleMetas();\n\n if (this._normalized && metas.length) {\n return (this._cache.data = metas[0].controller.getAllParsedValues(this));\n }\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n\n return (this._cache.data = this.normalize(timestamps));\n }\n\n /**\n\t * @protected\n\t */\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const labels = this.getLabels();\n for (i = 0, ilen = labels.length; i < ilen; ++i) {\n timestamps.push(parse(this, labels[i]));\n }\n\n return (this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps));\n }\n\n /**\n\t * @param {number[]} values\n\t * @protected\n\t */\n normalize(values) {\n // It seems to be somewhat faster to do sorting first\n return _arrayUnique(values.sort(sorter));\n }\n}\n","import TimeScale from './scale.time.js';\nimport {_lookupByKey} from '../helpers/helpers.collection.js';\n\n/**\n * Linearly interpolates the given source `val` using the table. If value is out of bounds, values\n * at edges are used for the interpolation.\n * @param {object} table\n * @param {number} val\n * @param {boolean} [reverse] lookup time based on position instead of vice versa\n * @return {object}\n */\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({lo, hi} = _lookupByKey(table, 'pos', val));\n }\n ({pos: prevSource, time: prevTarget} = table[lo]);\n ({pos: nextSource, time: nextTarget} = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({lo, hi} = _lookupByKey(table, 'time', val));\n }\n ({time: prevSource, pos: prevTarget} = table[lo]);\n ({time: nextSource, pos: nextTarget} = table[hi]);\n }\n\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\n\nclass TimeSeriesScale extends TimeScale {\n\n static id = 'timeseries';\n\n /**\n * @type {any}\n */\n static defaults = TimeScale.defaults;\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {object[]} */\n this._table = [];\n /** @type {number} */\n this._minPos = undefined;\n /** @type {number} */\n this._tableRange = undefined;\n }\n\n /**\n\t * @protected\n\t */\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n\n /**\n\t * Returns an array of {time, pos} objects used to interpolate a specific `time` or position\n\t * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is\n\t * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other\n\t * extremity (left + width or top + height). Note that it would be more optimized to directly\n\t * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need\n\t * to create the lookup table. The table ALWAYS contains at least two items: min and max.\n\t * @param {number[]} timestamps\n\t * @return {object[]}\n\t * @protected\n\t */\n buildLookupTable(timestamps) {\n const {min, max} = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n\n for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n\n if (items.length < 2) {\n // In case there is less that 2 timestamps between min and max, the scale is defined by min and max\n return [\n {time: min, pos: 0},\n {time: max, pos: 1}\n ];\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n\n // only add points that breaks the scale linearity\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({time: curr, pos: i / (ilen - 1)});\n }\n }\n return table;\n }\n\n /**\n * Generates all timestamps defined in the data.\n * Important: this method can return ticks outside the min and max range, it's the\n * responsibility of the calling code to clamp values if needed.\n * @protected\n */\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) {\n timestamps.splice(0, 0, min);\n }\n if (!timestamps.includes(max) || timestamps.length === 1) {\n timestamps.push(max);\n }\n return timestamps.sort((a, b) => a - b);\n }\n\n /**\n\t * Returns all timestamps\n\t * @return {number[]}\n\t * @private\n\t */\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n // If combining labels and data (data might not contain all labels),\n // we need to recheck uniqueness and sort\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n\n return timestamps;\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\n\nexport default TimeSeriesScale;\n","export * from './controllers/index.js';\nexport * from './core/index.js';\nexport * from './elements/index.js';\nexport * from './platform/index.js';\nexport * from './plugins/index.js';\nexport * from './scales/index.js';\n\nimport * as controllers from './controllers/index.js';\nimport * as elements from './elements/index.js';\nimport * as plugins from './plugins/index.js';\nimport * as scales from './scales/index.js';\n\nexport {\n controllers,\n elements,\n plugins,\n scales,\n};\n\nexport const registerables = [\n controllers,\n elements,\n plugins,\n scales,\n];\n","export function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });\n } else obj[key] = value;\n\n return obj;\n}\nexport { _define_property as _ };\n","/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */\nimport { Color } from '@kurkle/color';\n\n/**\n * @namespace Chart.helpers\n */ /**\n * An empty function that can be used, for example, for optional callback.\n */ function noop() {\n/* noop */ }\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */ const uid = (()=>{\n let id = 0;\n return ()=>id++;\n})();\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isNullOrUndef(value) {\n return value === null || typeof value === 'undefined';\n}\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */ function isArray(value) {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isObject(value) {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */ function isNumberFinite(value) {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */ function finiteOrDefault(value, defaultValue) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */ function valueOrDefault(value, defaultValue) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\nconst toPercentage = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 : +value / dimension;\nconst toDimension = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 * dimension : +value;\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */ function callback(fn, args, thisArg) {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\nfunction each(loopable, fn, thisArg, reverse) {\n let i, len, keys;\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for(i = len - 1; i >= 0; i--){\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */ function _elementsEqual(a0, a1) {\n let i, ilen, v0, v1;\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n for(i = 0, ilen = a0.length; i < ilen; ++i){\n v0 = a0[i];\n v1 = a1[i];\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n return true;\n}\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */ function clone(source) {\n if (isArray(source)) {\n return source.map(clone);\n }\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n for(; k < klen; ++k){\n target[keys[k]] = clone(source[keys[k]]);\n }\n return target;\n }\n return source;\n}\nfunction isValidKey(key) {\n return [\n '__proto__',\n 'prototype',\n 'constructor'\n ].indexOf(key) === -1;\n}\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */ function _merger(key, target, source, options) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone(sval);\n }\n}\nfunction merge(target, source, options) {\n const sources = isArray(source) ? source : [\n source\n ];\n const ilen = sources.length;\n if (!isObject(target)) {\n return target;\n }\n options = options || {};\n const merger = options.merger || _merger;\n let current;\n for(let i = 0; i < ilen; ++i){\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n const keys = Object.keys(current);\n for(let k = 0, klen = keys.length; k < klen; ++k){\n merger(keys[k], target, current, options);\n }\n }\n return target;\n}\nfunction mergeIf(target, source) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge(target, source, {\n merger: _mergerIf\n });\n}\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */ function _mergerIf(key, target, source) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone(sval);\n }\n}\n/**\n * @private\n */ function _deprecated(scope, value, previous, current) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous + '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': (v)=>v,\n // default resolvers\n x: (o)=>o.x,\n y: (o)=>o.y\n};\n/**\n * @private\n */ function _splitKey(key) {\n const parts = key.split('.');\n const keys = [];\n let tmp = '';\n for (const part of parts){\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\nfunction _getKeyResolver(key) {\n const keys = _splitKey(key);\n return (obj)=>{\n for (const k of keys){\n if (k === '') {\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\nfunction resolveObjectKey(obj, key) {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n/**\n * @private\n */ function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst defined = (value)=>typeof value !== 'undefined';\nconst isFunction = (value)=>typeof value === 'function';\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nconst setsEqual = (a, b)=>{\n if (a.size !== b.size) {\n return false;\n }\n for (const item of a){\n if (!b.has(item)) {\n return false;\n }\n }\n return true;\n};\n/**\n * @param e - The event\n * @private\n */ function _isClickEvent(e) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */ const PI = Math.PI;\nconst TAU = 2 * PI;\nconst PITAU = TAU + PI;\nconst INFINITY = Number.POSITIVE_INFINITY;\nconst RAD_PER_DEG = PI / 180;\nconst HALF_PI = PI / 2;\nconst QUARTER_PI = PI / 4;\nconst TWO_THIRDS_PI = PI * 2 / 3;\nconst log10 = Math.log10;\nconst sign = Math.sign;\nfunction almostEquals(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n}\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */ function niceNum(range) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */ function _factorize(value) {\n const result = [];\n const sqrt = Math.sqrt(value);\n let i;\n for(i = 1; i < sqrt; i++){\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) {\n result.push(sqrt);\n }\n result.sort((a, b)=>a - b).pop();\n return result;\n}\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction almostWhole(x, epsilon) {\n const rounded = Math.round(x);\n return rounded - epsilon <= x && rounded + epsilon >= x;\n}\n/**\n * @private\n */ function _setMinAndMaxByKey(array, target, property) {\n let i, ilen, value;\n for(i = 0, ilen = array.length; i < ilen; i++){\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\nfunction toRadians(degrees) {\n return degrees * (PI / 180);\n}\nfunction toDegrees(radians) {\n return radians * (180 / PI);\n}\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */ function _decimalPlaces(x) {\n if (!isNumberFinite(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while(Math.round(x * e) / e !== x){\n e *= 10;\n p++;\n }\n return p;\n}\n// Gets the angle from vertical upright to the point about a centre.\nfunction getAngleFromPoint(centrePoint, anglePoint) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n if (angle < -0.5 * PI) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\nfunction distanceBetweenPoints(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */ function _angleDiff(a, b) {\n return (a - b + PITAU) % TAU - PI;\n}\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */ function _normalizeAngle(a) {\n return (a % TAU + TAU) % TAU;\n}\n/**\n * @private\n */ function _angleBetween(angle, start, end, sameAngleIsFullCircle) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle;\n}\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */ function _limitValue(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n/**\n * @param {number} value\n * @private\n */ function _int16Range(value) {\n return _limitValue(value, -32768, 32767);\n}\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */ function _isBetween(value, start, end, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n\nfunction _lookup(table, value, cmp) {\n cmp = cmp || ((index)=>table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid;\n while(hi - lo > 1){\n mid = lo + hi >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return {\n lo,\n hi\n };\n}\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */ const _lookupByKey = (table, key, value, last)=>_lookup(table, value, last ? (index)=>{\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n } : (index)=>table[index][key] < value);\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */ const _rlookupByKey = (table, key, value)=>_lookup(table, value, (index)=>table[index][key] >= value);\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */ function _filterBetween(values, min, max) {\n let start = 0;\n let end = values.length;\n while(start < end && values[start] < min){\n start++;\n }\n while(end > start && values[end - 1] > max){\n end--;\n }\n return start > 0 || end < values.length ? values.slice(start, end) : values;\n}\nconst arrayEvents = [\n 'push',\n 'pop',\n 'shift',\n 'splice',\n 'unshift'\n];\nfunction listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [\n listener\n ]\n }\n });\n arrayEvents.forEach((key)=>{\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value (...args) {\n const res = base.apply(this, args);\n array._chartjs.listeners.forEach((object)=>{\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n return res;\n }\n });\n });\n}\nfunction unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n if (listeners.length > 0) {\n return;\n }\n arrayEvents.forEach((key)=>{\n delete array[key];\n });\n delete array._chartjs;\n}\n/**\n * @param items\n */ function _arrayUnique(items) {\n const set = new Set(items);\n if (set.size === items.length) {\n return items;\n }\n return Array.from(set);\n}\n\nfunction fontString(pixelSize, fontStyle, fontFamily) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n/**\n* Request animation polyfill\n*/ const requestAnimFrame = function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}();\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */ function throttled(fn, thisArg) {\n let argsToUse = [];\n let ticking = false;\n return function(...args) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, ()=>{\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n/**\n * Debounces calling `fn` for `delay` ms\n */ function debounce(fn, delay) {\n let timeout;\n return function(...args) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */ const _toLeftRightCenter = (align)=>align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */ const _alignStartEnd = (align, start, end)=>align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */ const _textX = (align, left, right, rtl)=>{\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n/**\n * Return start and count of visible points.\n * @private\n */ function _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {\n const pointCount = points.length;\n let start = 0;\n let count = pointCount;\n if (meta._sorted) {\n const { iScale , _parsed } = meta;\n const axis = iScale.axis;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(Math.min(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, axis, min).lo, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1), start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n return {\n start,\n count\n };\n}\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */ function _scaleRangesChanged(meta) {\n const { xScale , yScale , _scaleRanges } = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n\nconst atEdge = (t)=>t === 0 || t === 1;\nconst elasticIn = (t, s, p)=>-(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t, s, p)=>Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */ const effects = {\n linear: (t)=>t,\n easeInQuad: (t)=>t * t,\n easeOutQuad: (t)=>-t * (t - 2),\n easeInOutQuad: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1),\n easeInCubic: (t)=>t * t * t,\n easeOutCubic: (t)=>(t -= 1) * t * t + 1,\n easeInOutCubic: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2),\n easeInQuart: (t)=>t * t * t * t,\n easeOutQuart: (t)=>-((t -= 1) * t * t * t - 1),\n easeInOutQuart: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2),\n easeInQuint: (t)=>t * t * t * t * t,\n easeOutQuint: (t)=>(t -= 1) * t * t * t * t + 1,\n easeInOutQuint: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2),\n easeInSine: (t)=>-Math.cos(t * HALF_PI) + 1,\n easeOutSine: (t)=>Math.sin(t * HALF_PI),\n easeInOutSine: (t)=>-0.5 * (Math.cos(PI * t) - 1),\n easeInExpo: (t)=>t === 0 ? 0 : Math.pow(2, 10 * (t - 1)),\n easeOutExpo: (t)=>t === 1 ? 1 : -Math.pow(2, -10 * t) + 1,\n easeInOutExpo: (t)=>atEdge(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n easeInCirc: (t)=>t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1),\n easeOutCirc: (t)=>Math.sqrt(1 - (t -= 1) * t),\n easeInOutCirc: (t)=>(t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n easeInElastic: (t)=>atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n easeOutElastic: (t)=>atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n easeInOutElastic (t) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t : t < 0.5 ? 0.5 * elasticIn(t * 2, s, p) : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n easeInBack (t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n easeOutBack (t) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n easeInOutBack (t) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);\n },\n easeInBounce: (t)=>1 - effects.easeOutBounce(1 - t),\n easeOutBounce (t) {\n const m = 7.5625;\n const d = 2.75;\n if (t < 1 / d) {\n return m * t * t;\n }\n if (t < 2 / d) {\n return m * (t -= 1.5 / d) * t + 0.75;\n }\n if (t < 2.5 / d) {\n return m * (t -= 2.25 / d) * t + 0.9375;\n }\n return m * (t -= 2.625 / d) * t + 0.984375;\n },\n easeInOutBounce: (t)=>t < 0.5 ? effects.easeInBounce(t * 2) * 0.5 : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5\n};\n\nfunction isPatternOrGradient(value) {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n return false;\n}\nfunction color(value) {\n return isPatternOrGradient(value) ? value : new Color(value);\n}\nfunction getHoverColor(value) {\n return isPatternOrGradient(value) ? value : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n\nconst numbers = [\n 'x',\n 'y',\n 'borderWidth',\n 'radius',\n 'tension'\n];\nconst colors = [\n 'color',\n 'borderColor',\n 'backgroundColor'\n];\nfunction applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined\n });\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name)=>name !== 'onProgress' && name !== 'onComplete' && name !== 'fn'\n });\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n }\n });\n defaults.describe('animations', {\n _fallback: 'animation'\n });\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0\n }\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: (v)=>v | 0\n }\n }\n }\n });\n}\n\nfunction applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n\nconst intlCache = new Map();\nfunction getNumberFormat(locale, options) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\nfunction formatNumber(num, locale, options) {\n return getNumberFormat(locale, options).format(num);\n}\n\nconst formatters = {\n values (value) {\n return isArray(value) ? value : '' + value;\n },\n numeric (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue;\n if (ticks.length > 1) {\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n delta = calculateDelta(tickValue, ticks);\n }\n const logDelta = log10(Math.abs(delta));\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n const options = {\n notation,\n minimumFractionDigits: numDecimal,\n maximumFractionDigits: numDecimal\n };\n Object.assign(options, this.options.ticks.format);\n return formatNumber(tickValue, locale, options);\n },\n logarithmic (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || tickValue / Math.pow(10, Math.floor(log10(tickValue)));\n if ([\n 1,\n 2,\n 3,\n 5,\n 10,\n 15\n ].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n};\nfunction calculateDelta(tickValue, ticks) {\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n var Ticks = {\n formatters\n};\n\nfunction applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n bounds: 'ticks',\n clip: true,\n grace: 0,\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options)=>options.lineWidth,\n tickColor: (_ctx, options)=>options.color,\n offset: false\n },\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n title: {\n display: false,\n text: '',\n padding: {\n top: 4,\n bottom: 4\n }\n },\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2\n }\n });\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name)=>!name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name)=>name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash'\n });\n defaults.describe('scales', {\n _fallback: 'scale'\n });\n defaults.describe('scale.ticks', {\n _scriptable: (name)=>name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name)=>name !== 'backdropPadding'\n });\n}\n\nconst overrides = Object.create(null);\nconst descriptors = Object.create(null);\n function getScope$1(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for(let i = 0, n = keys.length; i < n; ++i){\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope$1(root, scope), values);\n }\n return merge(getScope$1(root, ''), scope);\n}\n class Defaults {\n constructor(_descriptors, _appliers){\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context)=>context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options)=>getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options)=>getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options)=>getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n set(scope, values) {\n return set(this, scope, values);\n }\n get(scope) {\n return getScope$1(this, scope);\n }\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n override(scope, values) {\n return set(overrides, scope, values);\n }\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope$1(this, scope);\n const targetScopeObject = getScope$1(this, targetScope);\n const privateName = '_' + name;\n Object.defineProperties(scopeObject, {\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n [name]: {\n enumerable: true,\n get () {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set (value) {\n this[privateName] = value;\n }\n }\n });\n }\n apply(appliers) {\n appliers.forEach((apply)=>apply(this));\n }\n}\nvar defaults = /* #__PURE__ */ new Defaults({\n _scriptable: (name)=>!name.startsWith('on'),\n _indexable: (name)=>name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false\n }\n}, [\n applyAnimationsDefaults,\n applyLayoutsDefaults,\n applyScaleDefaults\n]);\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */ function toFontString(font) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n return (font.style ? font.style + ' ' : '') + (font.weight ? font.weight + ' ' : '') + font.size + 'px ' + font.family;\n}\n/**\n * @private\n */ function _measureText(ctx, data, gc, longest, string) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n/**\n * @private\n */ // eslint-disable-next-line complexity\nfunction _longestText(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n ctx.save();\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i, j, jlen, thing, nestedThing;\n for(i = 0; i < ilen; i++){\n thing = arrayOfThings[i];\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !isArray(thing)) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for(j = 0, jlen = thing.length; j < jlen; j++){\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n ctx.restore();\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for(i = 0; i < gcLen; i++){\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */ function _alignPixel(chart, pixel, width) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n/**\n * Clears the entire canvas.\n */ function clearCanvas(canvas, ctx) {\n ctx = ctx || canvas.getContext('2d');\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\nfunction drawPoint(ctx, options, x, y) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n drawPointLegend(ctx, options, x, y, null);\n}\n// eslint-disable-next-line complexity\nfunction drawPointLegend(ctx, options, x, y, w) {\n let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n ctx.beginPath();\n switch(style){\n // Default includes circle\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n /* falls through */ case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n /* falls through */ case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */ function _isPointInArea(point, area, margin) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;\n}\nfunction clipArea(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\nfunction unclipArea(ctx) {\n ctx.restore();\n}\n/**\n * @private\n */ function _steppedLineTo(ctx, previous, target, flip, mode) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n/**\n * @private\n */ function _bezierCurveTo(ctx, previous, target, flip) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y);\n}\nfunction setRenderOpts(ctx, opts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\nfunction decorateText(ctx, x, y, line, opts) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */ const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\nfunction drawBackdrop(ctx, opts) {\n const oldColor = ctx.fillStyle;\n ctx.fillStyle = opts.color;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n/**\n * Render text onto the canvas\n */ function renderText(ctx, text, x, y, font, opts = {}) {\n const lines = isArray(text) ? text : [\n text\n ];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i, line;\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n for(i = 0; i < lines.length; ++i){\n line = lines[i];\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n y += Number(font.lineHeight);\n }\n ctx.restore();\n}\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */ function addRoundedRectPath(ctx, rect) {\n const { x , y , w , h , radius } = rect;\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n/**\n * @alias Chart.helpers.options\n * @namespace\n */ /**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */ function toLineHeight(value, size) {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n value = +matches[2];\n switch(matches[3]){\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n }\n return size * value;\n}\nconst numberOrZero = (v)=>+v || 0;\nfunction _readValueToProps(value, props) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value) ? objProps ? (prop)=>valueOrDefault(value[prop], value[props[prop]]) : (prop)=>value[prop] : ()=>value;\n for (const prop of keys){\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */ function toTRBL(value) {\n return _readValueToProps(value, {\n top: 'y',\n right: 'x',\n bottom: 'y',\n left: 'x'\n });\n}\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */ function toTRBLCorners(value) {\n return _readValueToProps(value, [\n 'topLeft',\n 'topRight',\n 'bottomLeft',\n 'bottomRight'\n ]);\n}\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */ function toPadding(value) {\n const obj = toTRBL(value);\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n return obj;\n}\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */ function toFont(options, fallback) {\n options = options || {};\n fallback = fallback || defaults.font;\n let size = valueOrDefault(options.size, fallback.size);\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n font.string = toFontString(font);\n return font;\n}\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */ function resolve(inputs, context, index, info) {\n let cacheable = true;\n let i, ilen, value;\n for(i = 0, ilen = inputs.length; i < ilen; ++i){\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */ function _addGrace(minmax, grace, beginAtZero) {\n const { min , max } = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value, add)=>beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\nfunction createContext(parentContext, context) {\n return Object.assign(Object.create(parentContext), context);\n}\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */ function _createResolver(scopes, prefixes = [\n ''\n], rootScopes, fallback, getTarget = ()=>scopes[0]) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === 'undefined') {\n fallback = _resolve('_fallback', scopes);\n }\n const cache = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope)=>_createResolver([\n scope,\n ...scopes\n ], prefixes, finalRootScopes, fallback)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop) {\n return _cached(target, prop, ()=>_resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys (target) {\n return getKeysFromAllScopes(target);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n });\n}\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */ function _attachContext(proxy, context, subProxy, descriptorDefaults) {\n const cache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx)=>_attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope)=>_attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop, receiver) {\n return _cached(target, prop, ()=>_resolveWithContext(target, prop, receiver));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? {\n enumerable: true,\n configurable: true\n } : undefined : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(proxy);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return Reflect.has(proxy, prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys () {\n return Reflect.ownKeys(proxy);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n });\n}\n/**\n * @private\n */ function _descriptors(proxy, defaults = {\n scriptable: true,\n indexable: true\n}) {\n const { _scriptable =defaults.scriptable , _indexable =defaults.indexable , _allKeys =defaults.allKeys } = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : ()=>_scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : ()=>_indexable\n };\n}\nconst readKey = (prefix, name)=>prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop, value)=>isObject(value) && prop !== 'adapters' && (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction _cached(target, prop, resolve) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) {\n return target[prop];\n }\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\nfunction _resolveWithContext(target, prop, receiver) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n let value = _proxy[prop]; // resolve from proxy\n // resolve with context\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n // if the resolved value is an object, create a sub resolver for it\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\nfunction _resolveScriptable(prop, getValue, target, receiver) {\n const { _proxy , _context , _subProxy , _stack } = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n // When scriptable option returns an object, create a resolver on that.\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\nfunction _resolveArray(prop, value, target, isIndexable) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n return value[_context.index % value.length];\n } else if (isObject(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter((s)=>s !== arr);\n value = [];\n for (const item of arr){\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\nfunction resolveFallback(fallback, prop, value) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\nconst getScope = (key, parent)=>key === true ? parent : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\nfunction addScopes(set, parentScopes, key, parentFallback, value) {\n for (const parent of parentScopes){\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n }\n } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n }\n return false;\n}\nfunction createSubResolver(parentScopes, resolver, prop, value) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [\n ...parentScopes,\n ...rootScopes\n ];\n const set = new Set();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (typeof fallback !== 'undefined' && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [\n ''\n ], rootScopes, fallback, ()=>subGetTarget(resolver, prop, value));\n}\nfunction addScopesFromKey(set, allScopes, key, fallback, item) {\n while(key){\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\nfunction subGetTarget(resolver, prop, value) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n // For array of objects, the object is used to store updated values\n return value;\n }\n return target || {};\n}\nfunction _resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n let value;\n for (const prefix of prefixes){\n value = _resolve(readKey(prefix, prop), scopes);\n if (typeof value !== 'undefined') {\n return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value;\n }\n }\n}\nfunction _resolve(key, scopes) {\n for (const scope of scopes){\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n}\nfunction getKeysFromAllScopes(target) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\nfunction resolveKeysFromAllScopes(scopes) {\n const set = new Set();\n for (const scope of scopes){\n for (const key of Object.keys(scope).filter((k)=>!k.startsWith('_'))){\n set.add(key);\n }\n }\n return Array.from(set);\n}\nfunction _parseObjectDataRadialScale(meta, data, start, count) {\n const { iScale } = meta;\n const { key ='r' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n\nconst EPSILON = Number.EPSILON || 1e-14;\nconst getPoint = (points, i)=>i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis)=>indexAxis === 'x' ? 'y' : 'x';\nfunction splineCurve(firstPoint, middlePoint, afterPoint, t) {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n // This function must also respect \"skipped\" points\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n/**\n * Adjust tangents to ensure monotonic properties\n */ function monotoneAdjust(points, deltaK, mK) {\n const pointsLen = points.length;\n let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen - 1; ++i){\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\nfunction monotoneCompute(points, mK, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */ function splineCurveMonotone(points, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK = Array(pointsLen).fill(0);\n const mK = Array(pointsLen);\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : sign(deltaK[i - 1]) !== sign(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n monotoneAdjust(points, deltaK, mK);\n monotoneCompute(points, mK, indexAxis);\n}\nfunction capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n}\nfunction capBezierPoints(points, area) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for(i = 0, ilen = points.length; i < ilen; ++i){\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n/**\n * @private\n */ function _updateBezierControlPoints(points, options, area, loop, indexAxis) {\n let i, ilen, point, controlPoints;\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt)=>!pt.skip);\n }\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for(i = 0, ilen = points.length; i < ilen; ++i){\n point = points[i];\n controlPoints = splineCurve(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension);\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */ /**\n * @private\n */ function _isDomSupported() {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n/**\n * @private\n */ function _getParentNode(domNode) {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = parent.host;\n }\n return parent;\n}\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */ function parseMaxStyle(styleValue, node, parentProperty) {\n let valueInPixels;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n return valueInPixels;\n}\nconst getComputedStyle = (element)=>element.ownerDocument.defaultView.getComputedStyle(element, null);\nfunction getStyle(el, property) {\n return getComputedStyle(el).getPropertyValue(property);\n}\nconst positions = [\n 'top',\n 'right',\n 'bottom',\n 'left'\n];\nfunction getPositionedStyle(styles, style, suffix) {\n const result = {};\n suffix = suffix ? '-' + suffix : '';\n for(let i = 0; i < 4; i++){\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\nconst useOffsetPos = (x, y, target)=>(x > 0 || y > 0) && (!target || !target.shadowRoot);\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */ function getCanvasPosition(e, canvas) {\n const touches = e.touches;\n const source = touches && touches.length ? touches[0] : e;\n const { offsetX , offsetY } = source;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {\n x,\n y,\n box\n };\n}\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */ function getRelativePosition(event, chart) {\n if ('native' in event) {\n return event;\n }\n const { canvas , currentDevicePixelRatio } = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const { x , y , box } = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n let { width , height } = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\nfunction getContainerSize(canvas, width, height) {\n let maxWidth, maxHeight;\n if (width === undefined || height === undefined) {\n const container = _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\nconst round1 = (v)=>Math.round(v * 10) / 10;\n// eslint-disable-next-line complexity\nfunction getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let { width , height } = containerSize;\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n return {\n width,\n height\n };\n}\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */ function retinaScale(chart, forceRatio, forceStyle) {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n const canvas = chart.canvas;\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */ const supportsEventListenerOptions = function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive () {\n passiveSupported = true;\n return false;\n }\n };\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}();\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */ function readUsedSize(element, property) {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n\n/**\n * @private\n */ function _pointInLine(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n/**\n * @private\n */ function _steppedInterpolation(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y : mode === 'after' ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y\n };\n}\n/**\n * @private\n */ function _bezierInterpolation(p1, p2, t, mode) {\n const cp1 = {\n x: p1.cp2x,\n y: p1.cp2y\n };\n const cp2 = {\n x: p2.cp1x,\n y: p2.cp1y\n };\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n\nconst getRightToLeftAdapter = function(rectX, width) {\n return {\n x (x) {\n return rectX + rectX + width - x;\n },\n setWidth (w) {\n width = w;\n },\n textAlign (align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus (x, value) {\n return x - value;\n },\n leftForLtr (x, itemWidth) {\n return x - itemWidth;\n }\n };\n};\nconst getLeftToRightAdapter = function() {\n return {\n x (x) {\n return x;\n },\n setWidth (w) {},\n textAlign (align) {\n return align;\n },\n xPlus (x, value) {\n return x + value;\n },\n leftForLtr (x, _itemWidth) {\n return x;\n }\n };\n};\nfunction getRtlAdapter(rtl, rectX, width) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\nfunction overrideTextDirection(ctx, direction) {\n let style, original;\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction')\n ];\n style.setProperty('direction', direction, 'important');\n ctx.prevTextDirection = original;\n }\n}\nfunction restoreTextDirection(ctx, original) {\n if (original !== undefined) {\n delete ctx.prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle\n };\n }\n return {\n between: _isBetween,\n compare: (a, b)=>a - b,\n normalize: (x)=>x\n };\n}\nfunction normalizeSegment({ start , end , count , loop , style }) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\nfunction getSegment(segment, points, bounds) {\n const { property , start: startBound , end: endBound } = bounds;\n const { between , normalize } = propertyFn(property);\n const count = points.length;\n let { start , end , loop } = segment;\n let i, ilen;\n if (loop) {\n start += count;\n end += count;\n for(i = 0, ilen = count; i < ilen; ++i){\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n if (end < start) {\n end += count;\n }\n return {\n start,\n end,\n loop,\n style: segment.style\n };\n}\n function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [\n segment\n ];\n }\n const { property , start: startBound , end: endBound } = bounds;\n const count = points.length;\n const { compare , between , normalize } = propertyFn(property);\n const { start , end , loop , style } = getSegment(segment, points, bounds);\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n const startIsBefore = ()=>between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = ()=>compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = ()=>inside || startIsBefore();\n const shouldStop = ()=>!inside || endIsBefore();\n for(let i = start, prev = start; i <= end; ++i){\n point = points[i % count];\n if (point.skip) {\n continue;\n }\n value = normalize(point[property]);\n if (value === prevValue) {\n continue;\n }\n inside = between(value, startBound, endBound);\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({\n start: subStart,\n end: i,\n loop,\n count,\n style\n }));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n if (subStart !== null) {\n result.push(normalizeSegment({\n start: subStart,\n end,\n loop,\n count,\n style\n }));\n }\n return result;\n}\n function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n for(let i = 0; i < segments.length; i++){\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n function findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n if (loop && !spanGaps) {\n while(start < count && !points[start].skip){\n start++;\n }\n }\n while(start < count && points[start].skip){\n start++;\n }\n start %= count;\n if (loop) {\n end += start;\n }\n while(end > start && points[end % count].skip){\n end--;\n }\n end %= count;\n return {\n start,\n end\n };\n}\n function solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n for(end = start + 1; end <= max; ++end){\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({\n start: start % count,\n end: (end - 1) % count,\n loop\n });\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n if (last !== null) {\n result.push({\n start: start % count,\n end: last % count,\n loop\n });\n }\n return result;\n}\n function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n if (!count) {\n return [];\n }\n const loop = !!line._loop;\n const { start , end } = findStartAndEnd(points, count, loop, spanGaps);\n if (spanGaps === true) {\n return splitByStyles(line, [\n {\n start,\n end,\n loop\n }\n ], points, segmentOptions);\n }\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n function splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n function doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const { _datasetIndex: datasetIndex , options: { spanGaps } } = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n s += count;\n while(points[s % count].skip){\n s -= dir;\n }\n while(points[e % count].skip){\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({\n start: s % count,\n end: e % count,\n loop: l,\n style: st\n });\n prevStyle = st;\n start = e % count;\n }\n }\n for (const segment of segments){\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for(i = start + 1; i <= segment.end; i++){\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n return result;\n}\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\nfunction styleChanged(style, prevStyle) {\n if (!prevStyle) {\n return false;\n }\n const cache = [];\n const replacer = function(key, value) {\n if (!isPatternOrGradient(value)) {\n return value;\n }\n if (!cache.includes(value)) {\n cache.push(value);\n }\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n\nexport { unclipArea as $, _rlookupByKey as A, _lookupByKey as B, _isPointInArea as C, getAngleFromPoint as D, toPadding as E, each as F, getMaximumSize as G, HALF_PI as H, _getParentNode as I, readUsedSize as J, supportsEventListenerOptions as K, throttled as L, _isDomSupported as M, _factorize as N, finiteOrDefault as O, PI as P, callback as Q, _addGrace as R, _limitValue as S, TAU as T, toDegrees as U, _measureText as V, _int16Range as W, _alignPixel as X, clipArea as Y, renderText as Z, _arrayUnique as _, resolve as a, fontString as a$, toFont as a0, _toLeftRightCenter as a1, _alignStartEnd as a2, overrides as a3, merge as a4, _capitalize as a5, descriptors as a6, isFunction as a7, _attachContext as a8, _createResolver as a9, overrideTextDirection as aA, _textX as aB, restoreTextDirection as aC, drawPointLegend as aD, distanceBetweenPoints as aE, noop as aF, _setMinAndMaxByKey as aG, niceNum as aH, almostWhole as aI, almostEquals as aJ, _decimalPlaces as aK, Ticks as aL, log10 as aM, _longestText as aN, _filterBetween as aO, _lookup as aP, isPatternOrGradient as aQ, getHoverColor as aR, clone as aS, _merger as aT, _mergerIf as aU, _deprecated as aV, _splitKey as aW, toFontString as aX, splineCurve as aY, splineCurveMonotone as aZ, getStyle as a_, _descriptors as aa, mergeIf as ab, uid as ac, debounce as ad, retinaScale as ae, clearCanvas as af, setsEqual as ag, _elementsEqual as ah, _isClickEvent as ai, _isBetween as aj, _readValueToProps as ak, _updateBezierControlPoints as al, _computeSegments as am, _boundSegments as an, _steppedInterpolation as ao, _bezierInterpolation as ap, _pointInLine as aq, _steppedLineTo as ar, _bezierCurveTo as as, drawPoint as at, addRoundedRectPath as au, toTRBL as av, toTRBLCorners as aw, _boundSegment as ax, _normalizeAngle as ay, getRtlAdapter as az, isArray as b, toLineHeight as b0, PITAU as b1, INFINITY as b2, RAD_PER_DEG as b3, QUARTER_PI as b4, TWO_THIRDS_PI as b5, _angleDiff as b6, color as c, defaults as d, effects as e, resolveObjectKey as f, isNumberFinite as g, defined as h, isObject as i, createContext as j, isNullOrUndef as k, listenArrayEvents as l, toPercentage as m, toDimension as n, formatNumber as o, _angleBetween as p, _getStartAndCountOfVisiblePoints as q, requestAnimFrame as r, sign as s, toRadians as t, unlistenArrayEvents as u, valueOrDefault as v, _scaleRangesChanged as w, isNumber as x, _parseObjectDataRadialScale as y, getRelativePosition as z };\n//# sourceMappingURL=helpers.segment.js.map\n","/**\n * @namespace Chart.helpers\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ActiveDataPoint, ChartEvent} from '../types/index.js';\n\n/**\n * An empty function that can be used, for example, for optional callback.\n */\nexport function noop() {\n /* noop */\n}\n\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */\nexport const uid = (() => {\n let id = 0;\n return () => id++;\n})();\n\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isNullOrUndef(value: unknown): value is null | undefined {\n return value === null || typeof value === 'undefined';\n}\n\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */\nexport function isArray(value: unknown): value is T[] {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isObject(value: unknown): value is AnyObject {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */\nfunction isNumberFinite(value: unknown): value is number {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\nexport {\n isNumberFinite as isFinite,\n};\n\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */\nexport function finiteOrDefault(value: unknown, defaultValue: number) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */\nexport function valueOrDefault(value: T | undefined, defaultValue: T) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\n\nexport const toPercentage = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100\n : +value / dimension;\n\nexport const toDimension = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100 * dimension\n : +value;\n\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */\nexport function callback R, TA, R>(\n fn: T | undefined,\n args: unknown[],\n thisArg?: TA\n): R | undefined {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\n\n/**\n * Note(SB) for performance sake, this method should only be used when loopable type\n * is unknown or in none intensive code (not called often and small loopable). Else\n * it's preferable to use a regular for() loop and save extra function calls.\n * @param loopable - The object or array to be iterated.\n * @param fn - The function to call for each item.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n * @param [reverse] - If true, iterates backward on the loopable.\n */\nexport function each(\n loopable: Record,\n fn: (this: TA, v: T, i: string) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each(\n loopable: T[],\n fn: (this: TA, v: T, i: number) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each(\n loopable: T[] | Record,\n fn: (this: TA, v: T, i: any) => void,\n thisArg?: TA,\n reverse?: boolean\n) {\n let i: number, len: number, keys: string[];\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for (i = len - 1; i >= 0; i--) {\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */\nexport function _elementsEqual(a0: ActiveDataPoint[], a1: ActiveDataPoint[]) {\n let i: number, ilen: number, v0: ActiveDataPoint, v1: ActiveDataPoint;\n\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n\n for (i = 0, ilen = a0.length; i < ilen; ++i) {\n v0 = a0[i];\n v1 = a1[i];\n\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */\nexport function clone(source: T): T {\n if (isArray(source)) {\n return source.map(clone) as unknown as T;\n }\n\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n\n for (; k < klen; ++k) {\n target[keys[k]] = clone(source[keys[k]]);\n }\n\n return target;\n }\n\n return source;\n}\n\nfunction isValidKey(key: string) {\n return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;\n}\n\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */\nexport function _merger(key: string, target: AnyObject, source: AnyObject, options: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone(sval);\n }\n}\n\nexport interface MergeOptions {\n merger?: (key: string, target: AnyObject, source: AnyObject, options?: AnyObject) => void;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` with the given `options`.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @param [options] - Merging options:\n * @param [options.merger] - The merge method (key, target, source, options)\n * @returns The `target` object.\n */\nexport function merge(target: T, source: [], options?: MergeOptions): T;\nexport function merge(target: T, source: S1, options?: MergeOptions): T & S1;\nexport function merge(target: T, source: [S1], options?: MergeOptions): T & S1;\nexport function merge(target: T, source: [S1, S2], options?: MergeOptions): T & S1 & S2;\nexport function merge(target: T, source: [S1, S2, S3], options?: MergeOptions): T & S1 & S2 & S3;\nexport function merge(\n target: T,\n source: [S1, S2, S3, S4],\n options?: MergeOptions\n): T & S1 & S2 & S3 & S4;\nexport function merge(target: T, source: AnyObject[], options?: MergeOptions): AnyObject;\nexport function merge(target: T, source: AnyObject[], options?: MergeOptions): AnyObject {\n const sources = isArray(source) ? source : [source];\n const ilen = sources.length;\n\n if (!isObject(target)) {\n return target as AnyObject;\n }\n\n options = options || {};\n const merger = options.merger || _merger;\n let current: AnyObject;\n\n for (let i = 0; i < ilen; ++i) {\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n\n const keys = Object.keys(current);\n for (let k = 0, klen = keys.length; k < klen; ++k) {\n merger(keys[k], target, current, options as AnyObject);\n }\n }\n\n return target;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` *only* if not defined in target.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @returns The `target` object.\n */\nexport function mergeIf(target: T, source: []): T;\nexport function mergeIf(target: T, source: S1): T & S1;\nexport function mergeIf(target: T, source: [S1]): T & S1;\nexport function mergeIf(target: T, source: [S1, S2]): T & S1 & S2;\nexport function mergeIf(target: T, source: [S1, S2, S3]): T & S1 & S2 & S3;\nexport function mergeIf(target: T, source: [S1, S2, S3, S4]): T & S1 & S2 & S3 & S4;\nexport function mergeIf(target: T, source: AnyObject[]): AnyObject;\nexport function mergeIf(target: T, source: AnyObject[]): AnyObject {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge(target, source, {merger: _mergerIf});\n}\n\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */\nexport function _mergerIf(key: string, target: AnyObject, source: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone(sval);\n }\n}\n\n/**\n * @private\n */\nexport function _deprecated(scope: string, value: unknown, previous: string, current: string) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous +\n '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': v => v,\n // default resolvers\n x: o => o.x,\n y: o => o.y\n};\n\n/**\n * @private\n */\nexport function _splitKey(key: string) {\n const parts = key.split('.');\n const keys: string[] = [];\n let tmp = '';\n for (const part of parts) {\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\n\nfunction _getKeyResolver(key: string) {\n const keys = _splitKey(key);\n return obj => {\n for (const k of keys) {\n if (k === '') {\n // For backward compatibility:\n // Chart.helpers.core resolveObjectKey should break at empty key\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\n\nexport function resolveObjectKey(obj: AnyObject, key: string): any {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n\n/**\n * @private\n */\nexport function _capitalize(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n\nexport const defined = (value: unknown) => typeof value !== 'undefined';\n\nexport const isFunction = (value: unknown): value is (...args: any[]) => any => typeof value === 'function';\n\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nexport const setsEqual = (a: Set, b: Set) => {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const item of a) {\n if (!b.has(item)) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * @param e - The event\n * @private\n */\nexport function _isClickEvent(e: ChartEvent) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n","import type {Point} from '../types/geometric.js';\nimport {isFinite as isFiniteNumber} from './helpers.core.js';\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */\n\nexport const PI = Math.PI;\nexport const TAU = 2 * PI;\nexport const PITAU = TAU + PI;\nexport const INFINITY = Number.POSITIVE_INFINITY;\nexport const RAD_PER_DEG = PI / 180;\nexport const HALF_PI = PI / 2;\nexport const QUARTER_PI = PI / 4;\nexport const TWO_THIRDS_PI = PI * 2 / 3;\n\nexport const log10 = Math.log10;\nexport const sign = Math.sign;\n\nexport function almostEquals(x: number, y: number, epsilon: number) {\n return Math.abs(x - y) < epsilon;\n}\n\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */\nexport function niceNum(range: number) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */\nexport function _factorize(value: number) {\n const result: number[] = [];\n const sqrt = Math.sqrt(value);\n let i: number;\n\n for (i = 1; i < sqrt; i++) {\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) { // if value is a square number\n result.push(sqrt);\n }\n\n result.sort((a, b) => a - b).pop();\n return result;\n}\n\nexport function isNumber(n: unknown): n is number {\n return !isNaN(parseFloat(n as string)) && isFinite(n as number);\n}\n\nexport function almostWhole(x: number, epsilon: number) {\n const rounded = Math.round(x);\n return ((rounded - epsilon) <= x) && ((rounded + epsilon) >= x);\n}\n\n/**\n * @private\n */\nexport function _setMinAndMaxByKey(\n array: Record[],\n target: { min: number, max: number },\n property: string\n) {\n let i: number, ilen: number, value: number;\n\n for (i = 0, ilen = array.length; i < ilen; i++) {\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\n\nexport function toRadians(degrees: number) {\n return degrees * (PI / 180);\n}\n\nexport function toDegrees(radians: number) {\n return radians * (180 / PI);\n}\n\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */\nexport function _decimalPlaces(x: number) {\n if (!isFiniteNumber(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while (Math.round(x * e) / e !== x) {\n e *= 10;\n p++;\n }\n return p;\n}\n\n// Gets the angle from vertical upright to the point about a centre.\nexport function getAngleFromPoint(\n centrePoint: Point,\n anglePoint: Point\n) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n\n if (angle < (-0.5 * PI)) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\n\nexport function distanceBetweenPoints(pt1: Point, pt2: Point) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */\nexport function _angleDiff(a: number, b: number) {\n return (a - b + PITAU) % TAU - PI;\n}\n\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */\nexport function _normalizeAngle(a: number) {\n return (a % TAU + TAU) % TAU;\n}\n\n/**\n * @private\n */\nexport function _angleBetween(angle: number, start: number, end: number, sameAngleIsFullCircle?: boolean) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || (sameAngleIsFullCircle && s === e)\n || (angleToStart > angleToEnd && startToAngle < endToAngle);\n}\n\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */\nexport function _limitValue(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\n/**\n * @param {number} value\n * @private\n */\nexport function _int16Range(value: number) {\n return _limitValue(value, -32768, 32767);\n}\n\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */\nexport function _isBetween(value: number, start: number, end: number, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n","import {_capitalize} from './helpers.core.js';\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param value - value to find\n * @param cmp\n * @private\n */\nexport function _lookup(\n table: number[],\n value: number,\n cmp?: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup(\n table: T[],\n value: number,\n cmp: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup(\n table: unknown[],\n value: number,\n cmp?: (value: number) => boolean\n) {\n cmp = cmp || ((index) => table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid: number;\n\n while (hi - lo > 1) {\n mid = (lo + hi) >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n\n return {lo, hi};\n}\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */\nexport const _lookupByKey = (\n table: Record[],\n key: string,\n value: number,\n last?: boolean\n) =>\n _lookup(table, value, last\n ? index => {\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n }\n : index => table[index][key] < value);\n\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */\nexport const _rlookupByKey = (\n table: Record[],\n key: string,\n value: number\n) =>\n _lookup(table, value, index => table[index][key] >= value);\n\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */\nexport function _filterBetween(values: number[], min: number, max: number) {\n let start = 0;\n let end = values.length;\n\n while (start < end && values[start] < min) {\n start++;\n }\n while (end > start && values[end - 1] > max) {\n end--;\n }\n\n return start > 0 || end < values.length\n ? values.slice(start, end)\n : values;\n}\n\nconst arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'] as const;\n\nexport interface ArrayListener {\n _onDataPush?(...item: T[]): void;\n _onDataPop?(): void;\n _onDataShift?(): void;\n _onDataSplice?(index: number, deleteCount: number, ...items: T[]): void;\n _onDataUnshift?(...item: T[]): void;\n}\n\n/**\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\n * called on the '_onData*' callbacks (e.g. _onDataPush, etc.) with same arguments.\n */\nexport function listenArrayEvents(array: T[], listener: ArrayListener): void;\nexport function listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n\n arrayEvents.forEach((key) => {\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value(...args) {\n const res = base.apply(this, args);\n\n array._chartjs.listeners.forEach((object) => {\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n\n return res;\n }\n });\n });\n}\n\n\n/**\n * Removes the given array event listener and cleanup extra attached properties (such as\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\n */\nexport function unlistenArrayEvents(array: T[], listener: ArrayListener): void;\nexport function unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n\n if (listeners.length > 0) {\n return;\n }\n\n arrayEvents.forEach((key) => {\n delete array[key];\n });\n\n delete array._chartjs;\n}\n\n/**\n * @param items\n */\nexport function _arrayUnique(items: T[]) {\n const set = new Set(items);\n\n if (set.size === items.length) {\n return items;\n }\n\n return Array.from(set);\n}\n","import type {ChartMeta, PointElement} from '../types/index.js';\n\nimport {_limitValue} from './helpers.math.js';\nimport {_lookupByKey} from './helpers.collection.js';\n\nexport function fontString(pixelSize: number, fontStyle: string, fontFamily: string) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n\n/**\n* Request animation polyfill\n*/\nexport const requestAnimFrame = (function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}());\n\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */\nexport function throttled>(\n fn: (...args: TArgs) => void,\n thisArg: any,\n) {\n let argsToUse = [] as TArgs;\n let ticking = false;\n\n return function(...args: TArgs) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, () => {\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n\n/**\n * Debounces calling `fn` for `delay` ms\n */\nexport function debounce>(fn: (...args: TArgs) => void, delay: number) {\n let timeout;\n return function(...args: TArgs) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */\nexport const _toLeftRightCenter = (align: 'start' | 'end' | 'center') => align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */\nexport const _alignStartEnd = (align: 'start' | 'end' | 'center', start: number, end: number) => align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */\nexport const _textX = (align: 'left' | 'right' | 'center', left: number, right: number, rtl: boolean) => {\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n\n/**\n * Return start and count of visible points.\n * @private\n */\nexport function _getStartAndCountOfVisiblePoints(meta: ChartMeta<'line' | 'scatter'>, points: PointElement[], animationsDisabled: boolean) {\n const pointCount = points.length;\n\n let start = 0;\n let count = pointCount;\n\n if (meta._sorted) {\n const {iScale, _parsed} = meta;\n const axis = iScale.axis;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(Math.min(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, axis, min).lo,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo),\n 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1),\n start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n\n return {start, count};\n}\n\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */\nexport function _scaleRangesChanged(meta) {\n const {xScale, yScale, _scaleRanges} = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min\n\t\t|| _scaleRanges.xmax !== xScale.max\n\t\t|| _scaleRanges.ymin !== yScale.min\n\t\t|| _scaleRanges.ymax !== yScale.max;\n\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n","import {PI, TAU, HALF_PI} from './helpers.math.js';\n\nconst atEdge = (t: number) => t === 0 || t === 1;\nconst elasticIn = (t: number, s: number, p: number) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t: number, s: number, p: number) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */\nconst effects = {\n linear: (t: number) => t,\n\n easeInQuad: (t: number) => t * t,\n\n easeOutQuad: (t: number) => -t * (t - 2),\n\n easeInOutQuad: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t\n : -0.5 * ((--t) * (t - 2) - 1),\n\n easeInCubic: (t: number) => t * t * t,\n\n easeOutCubic: (t: number) => (t -= 1) * t * t + 1,\n\n easeInOutCubic: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t\n : 0.5 * ((t -= 2) * t * t + 2),\n\n easeInQuart: (t: number) => t * t * t * t,\n\n easeOutQuart: (t: number) => -((t -= 1) * t * t * t - 1),\n\n easeInOutQuart: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t\n : -0.5 * ((t -= 2) * t * t * t - 2),\n\n easeInQuint: (t: number) => t * t * t * t * t,\n\n easeOutQuint: (t: number) => (t -= 1) * t * t * t * t + 1,\n\n easeInOutQuint: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t * t\n : 0.5 * ((t -= 2) * t * t * t * t + 2),\n\n easeInSine: (t: number) => -Math.cos(t * HALF_PI) + 1,\n\n easeOutSine: (t: number) => Math.sin(t * HALF_PI),\n\n easeInOutSine: (t: number) => -0.5 * (Math.cos(PI * t) - 1),\n\n easeInExpo: (t: number) => (t === 0) ? 0 : Math.pow(2, 10 * (t - 1)),\n\n easeOutExpo: (t: number) => (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1,\n\n easeInOutExpo: (t: number) => atEdge(t) ? t : t < 0.5\n ? 0.5 * Math.pow(2, 10 * (t * 2 - 1))\n : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n\n easeInCirc: (t: number) => (t >= 1) ? t : -(Math.sqrt(1 - t * t) - 1),\n\n easeOutCirc: (t: number) => Math.sqrt(1 - (t -= 1) * t),\n\n easeInOutCirc: (t: number) => ((t /= 0.5) < 1)\n ? -0.5 * (Math.sqrt(1 - t * t) - 1)\n : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n\n easeInElastic: (t: number) => atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n\n easeOutElastic: (t: number) => atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n\n easeInOutElastic(t: number) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t :\n t < 0.5\n ? 0.5 * elasticIn(t * 2, s, p)\n : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n\n easeInBack(t: number) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n\n easeOutBack(t: number) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n\n easeInOutBack(t: number) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n },\n\n easeInBounce: (t: number) => 1 - effects.easeOutBounce(1 - t),\n\n easeOutBounce(t: number) {\n const m = 7.5625;\n const d = 2.75;\n if (t < (1 / d)) {\n return m * t * t;\n }\n if (t < (2 / d)) {\n return m * (t -= (1.5 / d)) * t + 0.75;\n }\n if (t < (2.5 / d)) {\n return m * (t -= (2.25 / d)) * t + 0.9375;\n }\n return m * (t -= (2.625 / d)) * t + 0.984375;\n },\n\n easeInOutBounce: (t: number) => (t < 0.5)\n ? effects.easeInBounce(t * 2) * 0.5\n : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5,\n} as const;\n\nexport type EasingFunction = keyof typeof effects\n\nexport default effects;\n","import {Color} from '@kurkle/color';\n\nexport function isPatternOrGradient(value: unknown): value is CanvasPattern | CanvasGradient {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n\n return false;\n}\n\nexport function color(value: CanvasGradient): CanvasGradient;\nexport function color(value: CanvasPattern): CanvasPattern;\nexport function color(\n value:\n | string\n | { r: number; g: number; b: number; a: number }\n | [number, number, number]\n | [number, number, number, number]\n): Color;\nexport function color(value) {\n return isPatternOrGradient(value) ? value : new Color(value);\n}\n\nexport function getHoverColor(value: CanvasGradient): CanvasGradient;\nexport function getHoverColor(value: CanvasPattern): CanvasPattern;\nexport function getHoverColor(value: string): string;\nexport function getHoverColor(value) {\n return isPatternOrGradient(value)\n ? value\n : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n","const numbers = ['x', 'y', 'borderWidth', 'radius', 'tension'];\nconst colors = ['color', 'borderColor', 'backgroundColor'];\n\nexport function applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined,\n });\n\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name) => name !== 'onProgress' && name !== 'onComplete' && name !== 'fn',\n });\n\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n },\n });\n\n defaults.describe('animations', {\n _fallback: 'animation',\n });\n\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0 // show immediately\n },\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: v => v | 0 // for keeping the dataset visible all the way through the animation\n },\n }\n }\n });\n}\n","export function applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n","\nconst intlCache = new Map();\n\nfunction getNumberFormat(locale: string, options?: Intl.NumberFormatOptions) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\n\nexport function formatNumber(num: number, locale: string, options?: Intl.NumberFormatOptions) {\n return getNumberFormat(locale, options).format(num);\n}\n","import {isArray} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {log10} from '../helpers/helpers.math.js';\n\n/**\n * Namespace to hold formatters for different types of ticks\n * @namespace Chart.Ticks.formatters\n */\nconst formatters = {\n /**\n * Formatter for value labels\n * @method Chart.Ticks.formatters.values\n * @param value the value to display\n * @return {string|string[]} the label to display\n */\n values(value) {\n return isArray(value) ? /** @type {string[]} */ (value) : '' + value;\n },\n\n /**\n * Formatter for numeric ticks\n * @method Chart.Ticks.formatters.numeric\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n numeric(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0'; // never show decimal places for 0\n }\n\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue; // This is used when there are less than 2 ticks as the tick interval.\n\n if (ticks.length > 1) {\n // all ticks are small or there huge numbers; use scientific notation\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n\n delta = calculateDelta(tickValue, ticks);\n }\n\n const logDelta = log10(Math.abs(delta));\n\n // When datasets have values approaching Number.MAX_VALUE, the tick calculations might result in\n // infinity and eventually NaN. Passing NaN for minimumFractionDigits or maximumFractionDigits\n // will make the number formatter throw. So instead we check for isNaN and use a fallback value.\n //\n // toFixed has a max of 20 decimal places\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n\n const options = {notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal};\n Object.assign(options, this.options.ticks.format);\n\n return formatNumber(tickValue, locale, options);\n },\n\n\n /**\n * Formatter for logarithmic ticks\n * @method Chart.Ticks.formatters.logarithmic\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n logarithmic(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || (tickValue / (Math.pow(10, Math.floor(log10(tickValue)))));\n if ([1, 2, 3, 5, 10, 15].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n\n};\n\n\nfunction calculateDelta(tickValue, ticks) {\n // Figure out how many digits to show\n // The space between the first two ticks might be smaller than normal spacing\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n\n // If we have a number like 2.5 as the delta, figure out how many decimal places we need\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n // not an integer\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n\n/**\n * Namespace to hold static tick generation functions\n * @namespace Chart.Ticks\n */\nexport default {formatters};\n","import Ticks from './core.ticks.js';\n\nexport function applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 3.0.0\n */\n bounds: 'ticks',\n\n clip: true,\n\n /**\n * Addition grace added to max and reduced from min data value.\n * @since 3.0.0\n */\n grace: 0,\n\n // grid line settings\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options) => options.lineWidth,\n tickColor: (_ctx, options) => options.color,\n offset: false,\n },\n\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n\n // scale title\n title: {\n // display property\n display: false,\n\n // actual label\n text: '',\n\n // top/bottom padding\n padding: {\n top: 4,\n bottom: 4\n }\n },\n\n // label settings\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2,\n }\n });\n\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name) => !name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name) => name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash',\n });\n\n defaults.describe('scales', {\n _fallback: 'scale',\n });\n\n defaults.describe('scale.ticks', {\n _scriptable: (name) => name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name) => name !== 'backdropPadding',\n });\n}\n","import {getHoverColor} from '../helpers/helpers.color.js';\nimport {isObject, merge, valueOrDefault} from '../helpers/helpers.core.js';\nimport {applyAnimationsDefaults} from './core.animations.defaults.js';\nimport {applyLayoutsDefaults} from './core.layouts.defaults.js';\nimport {applyScaleDefaults} from './core.scale.defaults.js';\n\nexport const overrides = Object.create(null);\nexport const descriptors = Object.create(null);\n\n/**\n * @param {object} node\n * @param {string} key\n * @return {object}\n */\nfunction getScope(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for (let i = 0, n = keys.length; i < n; ++i) {\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\n\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope(root, scope), values);\n }\n return merge(getScope(root, ''), scope);\n}\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Defaults {\n constructor(_descriptors, _appliers) {\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options) => getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n set(scope, values) {\n return set(this, scope, values);\n }\n\n /**\n\t * @param {string} scope\n\t */\n get(scope) {\n return getScope(this, scope);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n\n override(scope, values) {\n return set(overrides, scope, values);\n }\n\n /**\n\t * Routes the named defaults to fallback to another scope/name.\n\t * This routing is useful when those target values, like defaults.color, are changed runtime.\n\t * If the values would be copied, the runtime change would not take effect. By routing, the\n\t * fallback is evaluated at each access, so its always up to date.\n\t *\n\t * Example:\n\t *\n\t * \tdefaults.route('elements.arc', 'backgroundColor', '', 'color')\n\t * - reads the backgroundColor from defaults.color when undefined locally\n\t *\n\t * @param {string} scope Scope this route applies to.\n\t * @param {string} name Property name that should be routed to different namespace when not defined here.\n\t * @param {string} targetScope The namespace where those properties should be routed to.\n\t * Empty string ('') is the root of defaults.\n\t * @param {string} targetName The target name in the target scope the property should be routed to.\n\t */\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope(this, scope);\n const targetScopeObject = getScope(this, targetScope);\n const privateName = '_' + name;\n\n Object.defineProperties(scopeObject, {\n // A private property is defined to hold the actual value, when this property is set in its scope (set in the setter)\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n // The actual property is defined as getter/setter so we can do the routing when value is not locally set.\n [name]: {\n enumerable: true,\n get() {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set(value) {\n this[privateName] = value;\n }\n }\n });\n }\n\n apply(appliers) {\n appliers.forEach((apply) => apply(this));\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Defaults({\n _scriptable: (name) => !name.startsWith('on'),\n _indexable: (name) => name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false,\n }\n}, [applyAnimationsDefaults, applyLayoutsDefaults, applyScaleDefaults]);\n","import type {\n Chart,\n Point,\n FontSpec,\n CanvasFontSpec,\n PointStyle,\n RenderTextOpts,\n BackdropOptions\n} from '../types/index.js';\nimport type {\n TRBL,\n SplinePoint,\n RoundedRect,\n TRBLCorners\n} from '../types/geometric.js';\nimport {isArray, isNullOrUndef} from './helpers.core.js';\nimport {PI, TAU, HALF_PI, QUARTER_PI, TWO_THIRDS_PI, RAD_PER_DEG} from './helpers.math.js';\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */\nexport function toFontString(font: FontSpec) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n\n return (font.style ? font.style + ' ' : '')\n\t\t+ (font.weight ? font.weight + ' ' : '')\n\t\t+ font.size + 'px '\n\t\t+ font.family;\n}\n\n/**\n * @private\n */\nexport function _measureText(\n ctx: CanvasRenderingContext2D,\n data: Record,\n gc: string[],\n longest: number,\n string: string\n) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n\ntype Thing = string | undefined | null\ntype Things = (Thing | Thing[])[]\n\n/**\n * @private\n */\n// eslint-disable-next-line complexity\nexport function _longestText(\n ctx: CanvasRenderingContext2D,\n font: string,\n arrayOfThings: Things,\n cache?: {data?: Record, garbageCollect?: string[], font?: string}\n) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n\n ctx.save();\n\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i: number, j: number, jlen: number, thing: Thing | Thing[], nestedThing: Thing | Thing[];\n for (i = 0; i < ilen; i++) {\n thing = arrayOfThings[i];\n\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !isArray(thing)) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for (j = 0, jlen = thing.length; j < jlen; j++) {\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n\n ctx.restore();\n\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for (i = 0; i < gcLen; i++) {\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */\nexport function _alignPixel(chart: Chart, pixel: number, width: number) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n\n/**\n * Clears the entire canvas.\n */\nexport function clearCanvas(canvas: HTMLCanvasElement, ctx?: CanvasRenderingContext2D) {\n ctx = ctx || canvas.getContext('2d');\n\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\n\nexport interface DrawPointOptions {\n pointStyle: PointStyle;\n rotation?: number;\n radius: number;\n borderWidth: number;\n}\n\nexport function drawPoint(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number\n) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n drawPointLegend(ctx, options, x, y, null);\n}\n\n// eslint-disable-next-line complexity\nexport function drawPointLegend(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number,\n w: number\n) {\n let type: string, xOffset: number, yOffset: number, size: number, cornerRadius: number, width: number, xOffsetW: number, yOffsetW: number;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n\n ctx.beginPath();\n\n switch (style) {\n // Default includes circle\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n /* falls through */\n case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n /* falls through */\n case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */\nexport function _isPointInArea(\n point: Point,\n area: TRBL,\n margin?: number\n) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n\n return !area || (point && point.x > area.left - margin && point.x < area.right + margin &&\n\t\tpoint.y > area.top - margin && point.y < area.bottom + margin);\n}\n\nexport function clipArea(ctx: CanvasRenderingContext2D, area: TRBL) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\n\nexport function unclipArea(ctx: CanvasRenderingContext2D) {\n ctx.restore();\n}\n\n/**\n * @private\n */\nexport function _steppedLineTo(\n ctx: CanvasRenderingContext2D,\n previous: Point,\n target: Point,\n flip?: boolean,\n mode?: string\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @private\n */\nexport function _bezierCurveTo(\n ctx: CanvasRenderingContext2D,\n previous: SplinePoint,\n target: SplinePoint,\n flip?: boolean\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(\n flip ? previous.cp1x : previous.cp2x,\n flip ? previous.cp1y : previous.cp2y,\n flip ? target.cp2x : target.cp1x,\n flip ? target.cp2y : target.cp1y,\n target.x,\n target.y);\n}\n\nfunction setRenderOpts(ctx: CanvasRenderingContext2D, opts: RenderTextOpts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\n\nfunction decorateText(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n line: string,\n opts: RenderTextOpts\n) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */\n const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\n\nfunction drawBackdrop(ctx: CanvasRenderingContext2D, opts: BackdropOptions) {\n const oldColor = ctx.fillStyle;\n\n ctx.fillStyle = opts.color as string;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n\n/**\n * Render text onto the canvas\n */\nexport function renderText(\n ctx: CanvasRenderingContext2D,\n text: string | string[],\n x: number,\n y: number,\n font: CanvasFontSpec,\n opts: RenderTextOpts = {}\n) {\n const lines = isArray(text) ? text : [text];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i: number, line: string;\n\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n\n for (i = 0; i < lines.length; ++i) {\n line = lines[i];\n\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n\n y += Number(font.lineHeight);\n }\n\n ctx.restore();\n}\n\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */\nexport function addRoundedRectPath(\n ctx: CanvasRenderingContext2D,\n rect: RoundedRect & { radius: TRBLCorners }\n) {\n const {x, y, w, h, radius} = rect;\n\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\n","import defaults from '../core/core.defaults.js';\nimport {isArray, isObject, toDimension, valueOrDefault} from './helpers.core.js';\nimport {toFontString} from './helpers.canvas.js';\nimport type {ChartArea, FontSpec, Point} from '../types/index.js';\nimport type {TRBL, TRBLCorners} from '../types/geometric.js';\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n\n/**\n * @alias Chart.helpers.options\n * @namespace\n */\n/**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */\nexport function toLineHeight(value: number | string, size: number): number {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n\n value = +matches[2];\n\n switch (matches[3]) {\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n default:\n break;\n }\n\n return size * value;\n}\n\nconst numberOrZero = (v: unknown) => +v || 0;\n\n/**\n * @param value\n * @param props\n */\nexport function _readValueToProps(value: number | Record, props: K[]): Record;\nexport function _readValueToProps(value: number | Record, props: Record): Record;\nexport function _readValueToProps(value: number | Record, props: string[] | Record) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value)\n ? objProps\n ? prop => valueOrDefault(value[prop], value[props[prop]])\n : prop => value[prop]\n : () => value;\n\n for (const prop of keys) {\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */\nexport function toTRBL(value: number | TRBL | Point) {\n return _readValueToProps(value, {top: 'y', right: 'x', bottom: 'y', left: 'x'});\n}\n\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */\nexport function toTRBLCorners(value: number | TRBLCorners) {\n return _readValueToProps(value, ['topLeft', 'topRight', 'bottomLeft', 'bottomRight']);\n}\n\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */\nexport function toPadding(value?: number | TRBL): ChartArea {\n const obj = toTRBL(value) as ChartArea;\n\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n\n return obj;\n}\n\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */\n\nexport function toFont(options: Partial, fallback?: Partial) {\n options = options || {};\n fallback = fallback || defaults.font as FontSpec;\n\n let size = valueOrDefault(options.size, fallback.size);\n\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n\n font.string = toFontString(font);\n return font;\n}\n\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */\nexport function resolve(inputs: Array, context?: object, index?: number, info?: { cacheable: boolean }) {\n let cacheable = true;\n let i: number, ilen: number, value: unknown;\n\n for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */\nexport function _addGrace(minmax: { min: number; max: number; }, grace: number | string, beginAtZero: boolean) {\n const {min, max} = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value: number, add: number) => beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\n\n/**\n * Create a context inheriting parentContext\n * @param parentContext\n * @param context\n * @returns\n */\nexport function createContext(parentContext: null, context: T): T;\nexport function createContext(parentContext: P, context: T): P & T;\nexport function createContext(parentContext: object, context: object) {\n return Object.assign(Object.create(parentContext), context);\n}\n","/* eslint-disable @typescript-eslint/no-use-before-define */\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartMeta} from '../types/index.js';\nimport type {\n ResolverObjectKey,\n ResolverCache,\n ResolverProxy,\n DescriptorDefaults,\n Descriptor,\n ContextCache,\n ContextProxy\n} from './helpers.config.types.js';\nimport {isArray, isFunction, isObject, resolveObjectKey, _capitalize} from './helpers.core.js';\n\nexport * from './helpers.config.types.js';\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */\nexport function _createResolver<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n scopes: T,\n prefixes = [''],\n rootScopes?: R,\n fallback?: ResolverObjectKey,\n getTarget = () => scopes[0]\n) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === 'undefined') {\n fallback = _resolve('_fallback', scopes);\n }\n const cache: ResolverCache = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope: AnyObject) => _createResolver([scope, ...scopes], prefixes, finalRootScopes, fallback),\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop: string) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string) {\n return _cached(target, prop,\n () => _resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop: string) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys(target) {\n return getKeysFromAllScopes(target);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop: string, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n }) as ResolverProxy;\n}\n\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */\nexport function _attachContext<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n proxy: ResolverProxy,\n context: AnyObject,\n subProxy?: ResolverProxy,\n descriptorDefaults?: DescriptorDefaults\n) {\n const cache: ContextCache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx: AnyObject) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope: AnyObject) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string, receiver) {\n return _cached(target, prop,\n () => _resolveWithContext(target, prop, receiver));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return target._descriptors.allKeys\n ? Reflect.has(proxy, prop) ? {enumerable: true, configurable: true} : undefined\n : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(proxy);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop) {\n return Reflect.has(proxy, prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys() {\n return Reflect.ownKeys(proxy);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n }) as ContextProxy;\n}\n\n/**\n * @private\n */\nexport function _descriptors(\n proxy: ResolverCache,\n defaults: DescriptorDefaults = {scriptable: true, indexable: true}\n): Descriptor {\n const {_scriptable = defaults.scriptable, _indexable = defaults.indexable, _allKeys = defaults.allKeys} = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : () => _indexable\n };\n}\n\nconst readKey = (prefix: string, name: string) => prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop: string, value: unknown) => isObject(value) && prop !== 'adapters' &&\n (Object.getPrototypeOf(value) === null || value.constructor === Object);\n\nfunction _cached(\n target: AnyObject,\n prop: string,\n resolve: () => unknown\n) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) {\n return target[prop];\n }\n\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\n\nfunction _resolveWithContext(\n target: ContextCache,\n prop: string,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n let value = _proxy[prop]; // resolve from proxy\n\n // resolve with context\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n // if the resolved value is an object, create a sub resolver for it\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\n\nfunction _resolveScriptable(\n prop: string,\n getValue: (ctx: AnyObject, sub: AnyObject) => unknown,\n target: ContextCache,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _stack} = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n // When scriptable option returns an object, create a resolver on that.\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\n\nfunction _resolveArray(\n prop: string,\n value: unknown[],\n target: ContextCache,\n isIndexable: (key: string) => boolean\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n\n if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n return value[_context.index % value.length];\n } else if (isObject(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter(s => s !== arr);\n value = [];\n for (const item of arr) {\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\n\nfunction resolveFallback(\n fallback: ResolverObjectKey | ((prop: ResolverObjectKey, value: unknown) => ResolverObjectKey),\n prop: ResolverObjectKey,\n value: unknown\n) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\n\nconst getScope = (key: ResolverObjectKey, parent: AnyObject) => key === true ? parent\n : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\n\nfunction addScopes(\n set: Set,\n parentScopes: AnyObject[],\n key: ResolverObjectKey,\n parentFallback: ResolverObjectKey,\n value: unknown\n) {\n for (const parent of parentScopes) {\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n }\n } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n }\n return false;\n}\n\nfunction createSubResolver(\n parentScopes: AnyObject[],\n resolver: ResolverCache,\n prop: ResolverObjectKey,\n value: unknown\n) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [...parentScopes, ...rootScopes];\n const set = new Set();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (typeof fallback !== 'undefined' && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [''], rootScopes, fallback,\n () => subGetTarget(resolver, prop as string, value));\n}\n\nfunction addScopesFromKey(\n set: Set,\n allScopes: AnyObject[],\n key: ResolverObjectKey,\n fallback: ResolverObjectKey,\n item: unknown\n) {\n while (key) {\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\n\nfunction subGetTarget(\n resolver: ResolverCache,\n prop: string,\n value: unknown\n) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n // For array of objects, the object is used to store updated values\n return value;\n }\n return target || {};\n}\n\nfunction _resolveWithPrefixes(\n prop: string,\n prefixes: string[],\n scopes: AnyObject[],\n proxy: ResolverProxy\n) {\n let value: unknown;\n for (const prefix of prefixes) {\n value = _resolve(readKey(prefix, prop), scopes);\n if (typeof value !== 'undefined') {\n return needsSubResolver(prop, value)\n ? createSubResolver(scopes, proxy, prop, value)\n : value;\n }\n }\n}\n\nfunction _resolve(key: string, scopes: AnyObject[]) {\n for (const scope of scopes) {\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n}\n\nfunction getKeysFromAllScopes(target: ResolverCache) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\n\nfunction resolveKeysFromAllScopes(scopes: AnyObject[]) {\n const set = new Set();\n for (const scope of scopes) {\n for (const key of Object.keys(scope).filter(k => !k.startsWith('_'))) {\n set.add(key);\n }\n }\n return Array.from(set);\n}\n\nexport function _parseObjectDataRadialScale(\n meta: ChartMeta<'line' | 'scatter'>,\n data: AnyObject[],\n start: number,\n count: number\n) {\n const {iScale} = meta;\n const {key = 'r'} = this._parsing;\n const parsed = new Array<{r: unknown}>(count);\n let i: number, ilen: number, index: number, item: AnyObject;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n","import {almostEquals, distanceBetweenPoints, sign} from './helpers.math.js';\nimport {_isPointInArea} from './helpers.canvas.js';\nimport type {ChartArea} from '../types/index.js';\nimport type {SplinePoint} from '../types/geometric.js';\n\nconst EPSILON = Number.EPSILON || 1e-14;\n\ntype OptionalSplinePoint = SplinePoint | false\nconst getPoint = (points: SplinePoint[], i: number): OptionalSplinePoint => i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis: 'x' | 'y') => indexAxis === 'x' ? 'y' : 'x';\n\nexport function splineCurve(\n firstPoint: SplinePoint,\n middlePoint: SplinePoint,\n afterPoint: SplinePoint,\n t: number\n): {\n previous: SplinePoint\n next: SplinePoint\n } {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n\n // This function must also respect \"skipped\" points\n\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n\n/**\n * Adjust tangents to ensure monotonic properties\n */\nfunction monotoneAdjust(points: SplinePoint[], deltaK: number[], mK: number[]) {\n const pointsLen = points.length;\n\n let alphaK: number, betaK: number, tauK: number, squaredMagnitude: number, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n for (let i = 0; i < pointsLen - 1; ++i) {\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\n\nfunction monotoneCompute(points: SplinePoint[], mK: number[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta: number, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (let i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */\nexport function splineCurveMonotone(points: SplinePoint[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK: number[] = Array(pointsLen).fill(0);\n const mK: number[] = Array(pointsLen);\n\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i]\n : !pointAfter ? deltaK[i - 1]\n : (sign(deltaK[i - 1]) !== sign(deltaK[i])) ? 0\n : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n\n monotoneAdjust(points, deltaK, mK);\n\n monotoneCompute(points, mK, indexAxis);\n}\n\nfunction capControlPoint(pt: number, min: number, max: number) {\n return Math.max(Math.min(pt, max), min);\n}\n\nfunction capBezierPoints(points: SplinePoint[], area: ChartArea) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n\n/**\n * @private\n */\nexport function _updateBezierControlPoints(\n points: SplinePoint[],\n options,\n area: ChartArea,\n loop: boolean,\n indexAxis: 'x' | 'y'\n) {\n let i: number, ilen: number, point: SplinePoint, controlPoints: ReturnType;\n\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt) => !pt.skip);\n }\n\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n point = points[i];\n controlPoints = splineCurve(\n prev,\n point,\n points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen],\n options.tension\n );\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n","import type {ChartArea, Scale} from '../types/index.js';\nimport type Chart from '../core/core.controller.js';\nimport type {ChartEvent} from '../types.js';\nimport {INFINITY} from './helpers.math.js';\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */\n\n/**\n * @private\n */\nexport function _isDomSupported(): boolean {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * @private\n */\nexport function _getParentNode(domNode: HTMLCanvasElement): HTMLCanvasElement {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = (parent as ShadowRoot).host;\n }\n return parent as HTMLCanvasElement;\n}\n\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */\n\nfunction parseMaxStyle(styleValue: string | number, node: HTMLElement, parentProperty: string) {\n let valueInPixels: number;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = (valueInPixels / 100) * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n\n return valueInPixels;\n}\n\nconst getComputedStyle = (element: HTMLElement): CSSStyleDeclaration =>\n element.ownerDocument.defaultView.getComputedStyle(element, null);\n\nexport function getStyle(el: HTMLElement, property: string): string {\n return getComputedStyle(el).getPropertyValue(property);\n}\n\nconst positions = ['top', 'right', 'bottom', 'left'];\nfunction getPositionedStyle(styles: CSSStyleDeclaration, style: string, suffix?: string): ChartArea {\n const result = {} as ChartArea;\n suffix = suffix ? '-' + suffix : '';\n for (let i = 0; i < 4; i++) {\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\n\nconst useOffsetPos = (x: number, y: number, target: HTMLElement | EventTarget) =>\n (x > 0 || y > 0) && (!target || !(target as HTMLElement).shadowRoot);\n\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */\nfunction getCanvasPosition(\n e: Event | TouchEvent | MouseEvent,\n canvas: HTMLCanvasElement\n): {\n x: number;\n y: number;\n box: boolean;\n } {\n const touches = (e as TouchEvent).touches;\n const source = (touches && touches.length ? touches[0] : e) as MouseEvent;\n const {offsetX, offsetY} = source as MouseEvent;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {x, y, box};\n}\n\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */\n\nexport function getRelativePosition(\n event: Event | ChartEvent | TouchEvent | MouseEvent,\n chart: Chart\n): { x: number; y: number } {\n if ('native' in event) {\n return event;\n }\n\n const {canvas, currentDevicePixelRatio} = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const {x, y, box} = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n\n let {width, height} = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\n\nfunction getContainerSize(canvas: HTMLCanvasElement, width: number, height: number): Partial {\n let maxWidth: number, maxHeight: number;\n\n if (width === undefined || height === undefined) {\n const container = _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\n\nconst round1 = (v: number) => Math.round(v * 10) / 10;\n\n// eslint-disable-next-line complexity\nexport function getMaximumSize(\n canvas: HTMLCanvasElement,\n bbWidth?: number,\n bbHeight?: number,\n aspectRatio?: number\n): { width: number; height: number } {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let {width, height} = containerSize;\n\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n\n return {width, height};\n}\n\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */\nexport function retinaScale(\n chart: Chart,\n forceRatio: number,\n forceStyle?: boolean\n): boolean | void {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n\n const canvas = chart.canvas;\n\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || (!canvas.style.height && !canvas.style.width))) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n\n if (chart.currentDevicePixelRatio !== pixelRatio\n || canvas.height !== deviceHeight\n || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */\nexport const supportsEventListenerOptions = (function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive() { // This function will be called when the browser attempts to access the passive property.\n passiveSupported = true;\n return false;\n }\n } as EventListenerOptions;\n\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}());\n\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */\n\nexport function readUsedSize(\n element: HTMLElement,\n property: 'width' | 'height'\n): number | undefined {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n","import type {Point, SplinePoint} from '../types/geometric.js';\n\n/**\n * @private\n */\nexport function _pointInLine(p1: Point, p2: Point, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n\n/**\n * @private\n */\nexport function _steppedInterpolation(\n p1: Point,\n p2: Point,\n t: number, mode: 'middle' | 'after' | unknown\n) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y\n : mode === 'after' ? t < 1 ? p1.y : p2.y\n : t > 0 ? p2.y : p1.y\n };\n}\n\n/**\n * @private\n */\nexport function _bezierInterpolation(p1: SplinePoint, p2: SplinePoint, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n const cp1 = {x: p1.cp2x, y: p1.cp2y};\n const cp2 = {x: p2.cp1x, y: p2.cp1y};\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n","export interface RTLAdapter {\n x(x: number): number;\n setWidth(w: number): void;\n textAlign(align: 'center' | 'left' | 'right'): 'center' | 'left' | 'right';\n xPlus(x: number, value: number): number;\n leftForLtr(x: number, itemWidth: number): number;\n}\n\nconst getRightToLeftAdapter = function(rectX: number, width: number): RTLAdapter {\n return {\n x(x) {\n return rectX + rectX + width - x;\n },\n setWidth(w) {\n width = w;\n },\n textAlign(align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus(x, value) {\n return x - value;\n },\n leftForLtr(x, itemWidth) {\n return x - itemWidth;\n },\n };\n};\n\nconst getLeftToRightAdapter = function(): RTLAdapter {\n return {\n x(x) {\n return x;\n },\n setWidth(w) { // eslint-disable-line no-unused-vars\n },\n textAlign(align) {\n return align;\n },\n xPlus(x, value) {\n return x + value;\n },\n leftForLtr(x, _itemWidth) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return x;\n },\n };\n};\n\nexport function getRtlAdapter(rtl: boolean, rectX: number, width: number) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\n\nexport function overrideTextDirection(ctx: CanvasRenderingContext2D, direction: 'ltr' | 'rtl') {\n let style: CSSStyleDeclaration, original: [string, string];\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction'),\n ];\n\n style.setProperty('direction', direction, 'important');\n (ctx as { prevTextDirection?: [string, string] }).prevTextDirection = original;\n }\n}\n\nexport function restoreTextDirection(ctx: CanvasRenderingContext2D, original?: [string, string]) {\n if (original !== undefined) {\n delete (ctx as { prevTextDirection?: [string, string] }).prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n","import {_angleBetween, _angleDiff, _isBetween, _normalizeAngle} from './helpers.math.js';\nimport {createContext} from './helpers.options.js';\nimport {isPatternOrGradient} from './helpers.color.js';\n\n/**\n * @typedef { import('../elements/element.line.js').default } LineElement\n * @typedef { import('../elements/element.point.js').default } PointElement\n * @typedef {{start: number, end: number, loop: boolean, style?: any}} Segment\n */\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle,\n };\n }\n return {\n between: _isBetween,\n compare: (a, b) => a - b,\n normalize: x => x\n };\n}\n\nfunction normalizeSegment({start, end, count, loop, style}) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\n\nfunction getSegment(segment, points, bounds) {\n const {property, start: startBound, end: endBound} = bounds;\n const {between, normalize} = propertyFn(property);\n const count = points.length;\n // eslint-disable-next-line prefer-const\n let {start, end, loop} = segment;\n let i, ilen;\n\n if (loop) {\n start += count;\n end += count;\n for (i = 0, ilen = count; i < ilen; ++i) {\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n\n if (end < start) {\n end += count;\n }\n return {start, end, loop, style: segment.style};\n}\n\n/**\n * Returns the sub-segment(s) of a line segment that fall in the given bounds\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} [segment.style] - segment style\n * @param {PointElement[]} points - the points that this segment refers to\n * @param {object} [bounds]\n * @param {string} bounds.property - the property of a `PointElement` we are bounding. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the property\n * @param {number} bounds.end - end value of the property\n * @private\n **/\nexport function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [segment];\n }\n\n const {property, start: startBound, end: endBound} = bounds;\n const count = points.length;\n const {compare, between, normalize} = propertyFn(property);\n const {start, end, loop, style} = getSegment(segment, points, bounds);\n\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n\n const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = () => inside || startIsBefore();\n const shouldStop = () => !inside || endIsBefore();\n\n for (let i = start, prev = start; i <= end; ++i) {\n point = points[i % count];\n\n if (point.skip) {\n continue;\n }\n\n value = normalize(point[property]);\n\n if (value === prevValue) {\n continue;\n }\n\n inside = between(value, startBound, endBound);\n\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({start: subStart, end: i, loop, count, style}));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n\n if (subStart !== null) {\n result.push(normalizeSegment({start: subStart, end, loop, count, style}));\n }\n\n return result;\n}\n\n\n/**\n * Returns the segments of the line that are inside given bounds\n * @param {LineElement} line\n * @param {object} [bounds]\n * @param {string} bounds.property - the property we are bounding with. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the `property`\n * @param {number} bounds.end - end value of the `property`\n * @private\n */\nexport function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n\n for (let i = 0; i < segments.length; i++) {\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n\n/**\n * Find start and end index of a line.\n */\nfunction findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n\n if (loop && !spanGaps) {\n // loop and not spanning gaps, first find a gap to start from\n while (start < count && !points[start].skip) {\n start++;\n }\n }\n\n // find first non skipped point (after the first gap possibly)\n while (start < count && points[start].skip) {\n start++;\n }\n\n // if we looped to count, start needs to be 0\n start %= count;\n\n if (loop) {\n // loop will go past count, if start > 0\n end += start;\n }\n\n while (end > start && points[end % count].skip) {\n end--;\n }\n\n // end could be more than count, normalize\n end %= count;\n\n return {start, end};\n}\n\n/**\n * Compute solid segments from Points, when spanGaps === false\n * @param {PointElement[]} points - the points\n * @param {number} start - start index\n * @param {number} max - max index (can go past count on a loop)\n * @param {boolean} loop - boolean indicating that this would be a loop if no gaps are found\n */\nfunction solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n\n for (end = start + 1; end <= max; ++end) {\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({start: start % count, end: (end - 1) % count, loop});\n // @ts-ignore\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n\n if (last !== null) {\n result.push({start: start % count, end: last % count, loop});\n }\n\n return result;\n}\n\n/**\n * Compute the continuous segments that define the whole line\n * There can be skipped points within a segment, if spanGaps is true.\n * @param {LineElement} line\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n * @private\n */\nexport function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n\n if (!count) {\n return [];\n }\n\n const loop = !!line._loop;\n const {start, end} = findStartAndEnd(points, count, loop, spanGaps);\n\n if (spanGaps === true) {\n return splitByStyles(line, [{start, end, loop}], points, segmentOptions);\n }\n\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n\n/**\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n\n/**\n * @param {LineElement} line\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const {_datasetIndex: datasetIndex, options: {spanGaps}} = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n // Style can not start/end on a skipped point, adjust indices accordingly\n s += count;\n while (points[s % count].skip) {\n s -= dir;\n }\n while (points[e % count].skip) {\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({start: s % count, end: e % count, loop: l, style: st});\n prevStyle = st;\n start = e % count;\n }\n }\n\n for (const segment of segments) {\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for (i = start + 1; i <= segment.end; i++) {\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n\n return result;\n}\n\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\n\nfunction styleChanged(style, prevStyle) {\n if (!prevStyle) {\n return false;\n }\n const cache = [];\n const replacer = function(key, value) {\n if (!isPatternOrGradient(value)) {\n return value;\n }\n if (!cache.includes(value)) {\n cache.push(value);\n }\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n","/*!\n * @kurkle/color v0.3.2\n * https://github.com/kurkle/color#readme\n * (c) 2023 Jukka Kurkela\n * Released under the MIT License\n */\nfunction round(v) {\n return v + 0.5 | 0;\n}\nconst lim = (v, l, h) => Math.max(Math.min(v, h), l);\nfunction p2b(v) {\n return lim(round(v * 2.55), 0, 255);\n}\nfunction b2p(v) {\n return lim(round(v / 2.55), 0, 100);\n}\nfunction n2b(v) {\n return lim(round(v * 255), 0, 255);\n}\nfunction b2n(v) {\n return lim(round(v / 2.55) / 100, 0, 1);\n}\nfunction n2p(v) {\n return lim(round(v * 100), 0, 100);\n}\n\nconst map$1 = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15};\nconst hex = [...'0123456789ABCDEF'];\nconst h1 = b => hex[b & 0xF];\nconst h2 = b => hex[(b & 0xF0) >> 4] + hex[b & 0xF];\nconst eq = b => ((b & 0xF0) >> 4) === (b & 0xF);\nconst isShort = v => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);\nfunction hexParse(str) {\n var len = str.length;\n var ret;\n if (str[0] === '#') {\n if (len === 4 || len === 5) {\n ret = {\n r: 255 & map$1[str[1]] * 17,\n g: 255 & map$1[str[2]] * 17,\n b: 255 & map$1[str[3]] * 17,\n a: len === 5 ? map$1[str[4]] * 17 : 255\n };\n } else if (len === 7 || len === 9) {\n ret = {\n r: map$1[str[1]] << 4 | map$1[str[2]],\n g: map$1[str[3]] << 4 | map$1[str[4]],\n b: map$1[str[5]] << 4 | map$1[str[6]],\n a: len === 9 ? (map$1[str[7]] << 4 | map$1[str[8]]) : 255\n };\n }\n }\n return ret;\n}\nconst alpha = (a, f) => a < 255 ? f(a) : '';\nfunction hexString(v) {\n var f = isShort(v) ? h1 : h2;\n return v\n ? '#' + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f)\n : undefined;\n}\n\nconst HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction hsl2rgbn(h, s, l) {\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [f(0), f(8), f(4)];\n}\nfunction hsv2rgbn(h, s, v) {\n const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n return [f(5), f(3), f(1)];\n}\nfunction hwb2rgbn(h, w, b) {\n const rgb = hsl2rgbn(h, 1, 0.5);\n let i;\n if (w + b > 1) {\n i = 1 / (w + b);\n w *= i;\n b *= i;\n }\n for (i = 0; i < 3; i++) {\n rgb[i] *= 1 - w - b;\n rgb[i] += w;\n }\n return rgb;\n}\nfunction hueValue(r, g, b, d, max) {\n if (r === max) {\n return ((g - b) / d) + (g < b ? 6 : 0);\n }\n if (g === max) {\n return (b - r) / d + 2;\n }\n return (r - g) / d + 4;\n}\nfunction rgb2hsl(v) {\n const range = 255;\n const r = v.r / range;\n const g = v.g / range;\n const b = v.b / range;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s, d;\n if (max !== min) {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = hueValue(r, g, b, d, max);\n h = h * 60 + 0.5;\n }\n return [h | 0, s || 0, l];\n}\nfunction calln(f, a, b, c) {\n return (\n Array.isArray(a)\n ? f(a[0], a[1], a[2])\n : f(a, b, c)\n ).map(n2b);\n}\nfunction hsl2rgb(h, s, l) {\n return calln(hsl2rgbn, h, s, l);\n}\nfunction hwb2rgb(h, w, b) {\n return calln(hwb2rgbn, h, w, b);\n}\nfunction hsv2rgb(h, s, v) {\n return calln(hsv2rgbn, h, s, v);\n}\nfunction hue(h) {\n return (h % 360 + 360) % 360;\n}\nfunction hueParse(str) {\n const m = HUE_RE.exec(str);\n let a = 255;\n let v;\n if (!m) {\n return;\n }\n if (m[5] !== v) {\n a = m[6] ? p2b(+m[5]) : n2b(+m[5]);\n }\n const h = hue(+m[2]);\n const p1 = +m[3] / 100;\n const p2 = +m[4] / 100;\n if (m[1] === 'hwb') {\n v = hwb2rgb(h, p1, p2);\n } else if (m[1] === 'hsv') {\n v = hsv2rgb(h, p1, p2);\n } else {\n v = hsl2rgb(h, p1, p2);\n }\n return {\n r: v[0],\n g: v[1],\n b: v[2],\n a: a\n };\n}\nfunction rotate(v, deg) {\n var h = rgb2hsl(v);\n h[0] = hue(h[0] + deg);\n h = hsl2rgb(h);\n v.r = h[0];\n v.g = h[1];\n v.b = h[2];\n}\nfunction hslString(v) {\n if (!v) {\n return;\n }\n const a = rgb2hsl(v);\n const h = a[0];\n const s = n2p(a[1]);\n const l = n2p(a[2]);\n return v.a < 255\n ? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`\n : `hsl(${h}, ${s}%, ${l}%)`;\n}\n\nconst map = {\n x: 'dark',\n Z: 'light',\n Y: 're',\n X: 'blu',\n W: 'gr',\n V: 'medium',\n U: 'slate',\n A: 'ee',\n T: 'ol',\n S: 'or',\n B: 'ra',\n C: 'lateg',\n D: 'ights',\n R: 'in',\n Q: 'turquois',\n E: 'hi',\n P: 'ro',\n O: 'al',\n N: 'le',\n M: 'de',\n L: 'yello',\n F: 'en',\n K: 'ch',\n G: 'arks',\n H: 'ea',\n I: 'ightg',\n J: 'wh'\n};\nconst names$1 = {\n OiceXe: 'f0f8ff',\n antiquewEte: 'faebd7',\n aqua: 'ffff',\n aquamarRe: '7fffd4',\n azuY: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '0',\n blanKedOmond: 'ffebcd',\n Xe: 'ff',\n XeviTet: '8a2be2',\n bPwn: 'a52a2a',\n burlywood: 'deb887',\n caMtXe: '5f9ea0',\n KartYuse: '7fff00',\n KocTate: 'd2691e',\n cSO: 'ff7f50',\n cSnflowerXe: '6495ed',\n cSnsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: 'ffff',\n xXe: '8b',\n xcyan: '8b8b',\n xgTMnPd: 'b8860b',\n xWay: 'a9a9a9',\n xgYF: '6400',\n xgYy: 'a9a9a9',\n xkhaki: 'bdb76b',\n xmagFta: '8b008b',\n xTivegYF: '556b2f',\n xSange: 'ff8c00',\n xScEd: '9932cc',\n xYd: '8b0000',\n xsOmon: 'e9967a',\n xsHgYF: '8fbc8f',\n xUXe: '483d8b',\n xUWay: '2f4f4f',\n xUgYy: '2f4f4f',\n xQe: 'ced1',\n xviTet: '9400d3',\n dAppRk: 'ff1493',\n dApskyXe: 'bfff',\n dimWay: '696969',\n dimgYy: '696969',\n dodgerXe: '1e90ff',\n fiYbrick: 'b22222',\n flSOwEte: 'fffaf0',\n foYstWAn: '228b22',\n fuKsia: 'ff00ff',\n gaRsbSo: 'dcdcdc',\n ghostwEte: 'f8f8ff',\n gTd: 'ffd700',\n gTMnPd: 'daa520',\n Way: '808080',\n gYF: '8000',\n gYFLw: 'adff2f',\n gYy: '808080',\n honeyMw: 'f0fff0',\n hotpRk: 'ff69b4',\n RdianYd: 'cd5c5c',\n Rdigo: '4b0082',\n ivSy: 'fffff0',\n khaki: 'f0e68c',\n lavFMr: 'e6e6fa',\n lavFMrXsh: 'fff0f5',\n lawngYF: '7cfc00',\n NmoncEffon: 'fffacd',\n ZXe: 'add8e6',\n ZcSO: 'f08080',\n Zcyan: 'e0ffff',\n ZgTMnPdLw: 'fafad2',\n ZWay: 'd3d3d3',\n ZgYF: '90ee90',\n ZgYy: 'd3d3d3',\n ZpRk: 'ffb6c1',\n ZsOmon: 'ffa07a',\n ZsHgYF: '20b2aa',\n ZskyXe: '87cefa',\n ZUWay: '778899',\n ZUgYy: '778899',\n ZstAlXe: 'b0c4de',\n ZLw: 'ffffe0',\n lime: 'ff00',\n limegYF: '32cd32',\n lRF: 'faf0e6',\n magFta: 'ff00ff',\n maPon: '800000',\n VaquamarRe: '66cdaa',\n VXe: 'cd',\n VScEd: 'ba55d3',\n VpurpN: '9370db',\n VsHgYF: '3cb371',\n VUXe: '7b68ee',\n VsprRggYF: 'fa9a',\n VQe: '48d1cc',\n VviTetYd: 'c71585',\n midnightXe: '191970',\n mRtcYam: 'f5fffa',\n mistyPse: 'ffe4e1',\n moccasR: 'ffe4b5',\n navajowEte: 'ffdead',\n navy: '80',\n Tdlace: 'fdf5e6',\n Tive: '808000',\n TivedBb: '6b8e23',\n Sange: 'ffa500',\n SangeYd: 'ff4500',\n ScEd: 'da70d6',\n pOegTMnPd: 'eee8aa',\n pOegYF: '98fb98',\n pOeQe: 'afeeee',\n pOeviTetYd: 'db7093',\n papayawEp: 'ffefd5',\n pHKpuff: 'ffdab9',\n peru: 'cd853f',\n pRk: 'ffc0cb',\n plum: 'dda0dd',\n powMrXe: 'b0e0e6',\n purpN: '800080',\n YbeccapurpN: '663399',\n Yd: 'ff0000',\n Psybrown: 'bc8f8f',\n PyOXe: '4169e1',\n saddNbPwn: '8b4513',\n sOmon: 'fa8072',\n sandybPwn: 'f4a460',\n sHgYF: '2e8b57',\n sHshell: 'fff5ee',\n siFna: 'a0522d',\n silver: 'c0c0c0',\n skyXe: '87ceeb',\n UXe: '6a5acd',\n UWay: '708090',\n UgYy: '708090',\n snow: 'fffafa',\n sprRggYF: 'ff7f',\n stAlXe: '4682b4',\n tan: 'd2b48c',\n teO: '8080',\n tEstN: 'd8bfd8',\n tomato: 'ff6347',\n Qe: '40e0d0',\n viTet: 'ee82ee',\n JHt: 'f5deb3',\n wEte: 'ffffff',\n wEtesmoke: 'f5f5f5',\n Lw: 'ffff00',\n LwgYF: '9acd32'\n};\nfunction unpack() {\n const unpacked = {};\n const keys = Object.keys(names$1);\n const tkeys = Object.keys(map);\n let i, j, k, ok, nk;\n for (i = 0; i < keys.length; i++) {\n ok = nk = keys[i];\n for (j = 0; j < tkeys.length; j++) {\n k = tkeys[j];\n nk = nk.replace(k, map[k]);\n }\n k = parseInt(names$1[ok], 16);\n unpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];\n }\n return unpacked;\n}\n\nlet names;\nfunction nameParse(str) {\n if (!names) {\n names = unpack();\n names.transparent = [0, 0, 0, 0];\n }\n const a = names[str.toLowerCase()];\n return a && {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length === 4 ? a[3] : 255\n };\n}\n\nconst RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction rgbParse(str) {\n const m = RGB_RE.exec(str);\n let a = 255;\n let r, g, b;\n if (!m) {\n return;\n }\n if (m[7] !== r) {\n const v = +m[7];\n a = m[8] ? p2b(v) : lim(v * 255, 0, 255);\n }\n r = +m[1];\n g = +m[3];\n b = +m[5];\n r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));\n g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));\n b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\nfunction rgbString(v) {\n return v && (\n v.a < 255\n ? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`\n : `rgb(${v.r}, ${v.g}, ${v.b})`\n );\n}\n\nconst to = v => v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst from = v => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction interpolate(rgb1, rgb2, t) {\n const r = from(b2n(rgb1.r));\n const g = from(b2n(rgb1.g));\n const b = from(b2n(rgb1.b));\n return {\n r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),\n g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),\n b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),\n a: rgb1.a + t * (rgb2.a - rgb1.a)\n };\n}\n\nfunction modHSL(v, i, ratio) {\n if (v) {\n let tmp = rgb2hsl(v);\n tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n tmp = hsl2rgb(tmp);\n v.r = tmp[0];\n v.g = tmp[1];\n v.b = tmp[2];\n }\n}\nfunction clone(v, proto) {\n return v ? Object.assign(proto || {}, v) : v;\n}\nfunction fromObject(input) {\n var v = {r: 0, g: 0, b: 0, a: 255};\n if (Array.isArray(input)) {\n if (input.length >= 3) {\n v = {r: input[0], g: input[1], b: input[2], a: 255};\n if (input.length > 3) {\n v.a = n2b(input[3]);\n }\n }\n } else {\n v = clone(input, {r: 0, g: 0, b: 0, a: 1});\n v.a = n2b(v.a);\n }\n return v;\n}\nfunction functionParse(str) {\n if (str.charAt(0) === 'r') {\n return rgbParse(str);\n }\n return hueParse(str);\n}\nclass Color {\n constructor(input) {\n if (input instanceof Color) {\n return input;\n }\n const type = typeof input;\n let v;\n if (type === 'object') {\n v = fromObject(input);\n } else if (type === 'string') {\n v = hexParse(input) || nameParse(input) || functionParse(input);\n }\n this._rgb = v;\n this._valid = !!v;\n }\n get valid() {\n return this._valid;\n }\n get rgb() {\n var v = clone(this._rgb);\n if (v) {\n v.a = b2n(v.a);\n }\n return v;\n }\n set rgb(obj) {\n this._rgb = fromObject(obj);\n }\n rgbString() {\n return this._valid ? rgbString(this._rgb) : undefined;\n }\n hexString() {\n return this._valid ? hexString(this._rgb) : undefined;\n }\n hslString() {\n return this._valid ? hslString(this._rgb) : undefined;\n }\n mix(color, weight) {\n if (color) {\n const c1 = this.rgb;\n const c2 = color.rgb;\n let w2;\n const p = weight === w2 ? 0.5 : weight;\n const w = 2 * p - 1;\n const a = c1.a - c2.a;\n const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n w2 = 1 - w1;\n c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n c1.a = p * c1.a + (1 - p) * c2.a;\n this.rgb = c1;\n }\n return this;\n }\n interpolate(color, t) {\n if (color) {\n this._rgb = interpolate(this._rgb, color._rgb, t);\n }\n return this;\n }\n clone() {\n return new Color(this.rgb);\n }\n alpha(a) {\n this._rgb.a = n2b(a);\n return this;\n }\n clearer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 - ratio;\n return this;\n }\n greyscale() {\n const rgb = this._rgb;\n const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n rgb.r = rgb.g = rgb.b = val;\n return this;\n }\n opaquer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 + ratio;\n return this;\n }\n negate() {\n const v = this._rgb;\n v.r = 255 - v.r;\n v.g = 255 - v.g;\n v.b = 255 - v.b;\n return this;\n }\n lighten(ratio) {\n modHSL(this._rgb, 2, ratio);\n return this;\n }\n darken(ratio) {\n modHSL(this._rgb, 2, -ratio);\n return this;\n }\n saturate(ratio) {\n modHSL(this._rgb, 1, ratio);\n return this;\n }\n desaturate(ratio) {\n modHSL(this._rgb, 1, -ratio);\n return this;\n }\n rotate(deg) {\n rotate(this._rgb, deg);\n return this;\n }\n}\n\nfunction index_esm(input) {\n return new Color(input);\n}\n\nexport { Color, b2n, b2p, index_esm as default, hexParse, hexString, hsl2rgb, hslString, hsv2rgb, hueParse, hwb2rgb, lim, n2b, n2p, nameParse, p2b, rgb2hsl, rgbParse, rgbString, rotate, round };\n","/**!\n * Sortable 1.15.1\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n return target;\n}\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n return _typeof(obj);\n}\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = _objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.1\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction matches( /**HTMLElement*/el, /**String*/selector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n return false;\n}\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n return null;\n}\nvar R_SPACE = /\\s+/g;\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\nfunction css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n } while (!selfOnly && (el = el.parentNode));\n }\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n return list;\n }\n return [];\n}\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect();\n\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n } while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n\n/**\r\n * Returns the content rect of the element (bounding rect minus border and padding)\r\n * @param {HTMLElement} el \r\n */\nfunction getContentRect(el) {\n var rect = getRect(el);\n var paddingLeft = parseInt(css(el, 'padding-left')),\n paddingTop = parseInt(css(el, 'padding-top')),\n paddingRight = parseInt(css(el, 'padding-right')),\n paddingBottom = parseInt(css(el, 'padding-bottom'));\n rect.top += paddingTop + parseInt(css(el, 'border-top-width'));\n rect.left += paddingLeft + parseInt(css(el, 'border-left-width'));\n // Client Width/Height includes padding only\n rect.width = el.clientWidth - paddingLeft - paddingRight;\n rect.height = el.clientHeight - paddingTop - paddingBottom;\n rect.bottom = rect.top + rect.height;\n rect.right = rect.left + rect.width;\n return rect;\n}\n\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n\n /* jshint boss:true */\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n currentChild++;\n }\n i++;\n }\n return null;\n}\n\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n return last || null;\n}\n\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */\nfunction index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) {\n return -1;\n }\n\n /* jshint boss:true */\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n return index;\n}\n\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n return [offsetLeft, offsetTop];\n}\n\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n } while (elem = elem.parentNode);\n return getWindowScrollingElement();\n}\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n return dst;\n}\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar _throttleTimeout;\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);\n\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&\n // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n }\n\n // if fromRect != toRect: animate\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) {\n time = _this.options.animation;\n }\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction repaint(target) {\n return target.offsetWidth;\n}\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n\n // Add default options from plugin\n _extends(defaults, initialized.defaults);\n });\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\n ghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n\n _silent = false,\n savedInputChecked = [];\n\n/** @const */\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\n supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return;\n // false when <= IE11\n if (IE11OrLess) {\n return false;\n }\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n }(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n },\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n },\n /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n },\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n },\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n },\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n };\n\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[expando]._onDragOver(event);\n }\n }\n};\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n this.el = el; // root element\n this.options = options = _extends({}, options);\n\n // Export instance\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults);\n\n // Set default options\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n _prepareGroup(options);\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n }\n\n // Bind events\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n sortables.push(this.el);\n\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n\n // Add animation state manager\n _extends(this, AnimationStateManager());\n}\nSortable.prototype = /** @lends Sortable.prototype */{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {\n if (!evt.cancelable) return;\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n _saveInputCheckedState(el);\n\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if (dragEl) {\n return;\n }\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n }\n\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) {\n return;\n }\n\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n target = closest(target, options.draggable, el, false);\n if (target && target.animated) {\n return;\n }\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n }\n\n // Get the index of the dragged element within its parent\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable);\n\n // Check filter\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n }\n\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n }\n\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n\n // Drag start event\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n });\n\n // Chosen item\n toggleClass(dragEl, options.chosenClass, true);\n };\n\n // Disable \"draggable\"\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop);\n\n // Make dragEl draggable (must be before delay for FireFox)\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n pluginEvent('delayStart', this, {\n evt: evt\n });\n\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n awaitingDragStarted = false;\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n var options = this.options;\n\n // Apply effect\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost();\n\n // Drag start event\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n _hideGhostForTarget();\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n target = parent; // store last element\n }\n /* jshint boss:true */ while (parent = parent.parentNode);\n }\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n\n // only set the status to dragging, when we are actually dragging\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n this._onDragStart(evt, true);\n }\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options;\n\n // Position absolutely\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl);\n\n // Set transform-origin\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n pluginEvent('setupClone', this);\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n this._hideClone();\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n }\n\n // #1143: IFrame support workaround\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n _this._hideClone();\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true);\n\n // Set proper drop events\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n on(document, 'drop', _this);\n\n // #1276 fix:\n css(dragEl, 'transform', 'translateZ(0)');\n }\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver( /**Event*/evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n if (_silent) return;\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n\n // Capture animation state\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n _this.captureAnimationState();\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n }\n\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n }\n\n // Animation\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n\n // Null lastTarget if it is not inside a previously swapped element\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n }\n\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n\n // Do not detect for empty insert if already inserted\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n\n // Call when dragEl has been inserted\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n if (revert) {\n parentEl = rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent('revert');\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n return completed(true);\n }\n var elLastChild = lastChild(el, options.draggable);\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n }\n\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n if (target) {\n targetRect = getRect(target);\n }\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n if (firstChild === dragEl) {\n return completed(false);\n }\n target = firstChild;\n targetRect = getRect(target);\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n }\n\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n parentEl = dragEl.parentNode; // actualization\n\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n changed();\n return completed(true);\n }\n }\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop( /**Event*/evt) {\n var el = this.el,\n options = this.options;\n\n // Get the index of the dragged element within its parent\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode;\n\n // Get again after plugin event\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n if (Sortable.eventCanceled) {\n this._nulling();\n return;\n }\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n _cancelNextTick(this.cloneId);\n _cancelNextTick(this._dragStartId);\n\n // Unbind events\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n css(dragEl, 'transform', '');\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n _disableDraggable(dragEl);\n dragEl.style['will-change'] = '';\n\n // Remove classes\n // ghostClass is added in dragStarted\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n toggleClass(dragEl, this.options.chosenClass, false);\n\n // Drag stop event\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n // Remove event\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // drag from one list and drop into another\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent( /**Event*/evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n break;\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n _globalDragOver(evt);\n }\n break;\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n for (; i < n; i++) {\n el = children[i];\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n return;\n }\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return;\n\n // show clone at dragEl or original position\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\nfunction _globalDragOver( /**Event*/evt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n evt.cancelable && evt.preventDefault();\n}\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n return retVal;\n}\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\nfunction _unsilent() {\n _silent = false;\n}\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var sortableContentRect = getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX < sortableContentRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < sortableContentRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction _ghostIsLast(evt, vertical, sortable) {\n var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var sortableContentRect = getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX > sortableContentRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > sortableContentRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n return 0;\n}\n\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n while (i--) {\n sum += str.charCodeAt(i);\n }\n return sum.toString(36);\n}\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n}\n\n// Fixed #973:\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n}\n\n// Export utils\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\nSortable.get = function (element) {\n return element[expando];\n};\n\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n};\n\n// Export\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt;\n\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback);\n\n // Listener for pointer element change\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn;\n\n // New scroll root, set scrollEl\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n var layersOut = 0;\n var currentParent = scrollEl;\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n }\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction Revert() {}\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n this.sortable.animateAll();\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\nfunction Remove() {}\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\n multiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\n folding = false,\n // Folding any other time\n dragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n dataTransfer.setData('Text', data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n });\n\n // Sort multi-drag elements\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n\n sortable.captureAnimationState();\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n }\n\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute);\n\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n }\n\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n activeSortable._showClone(sortable);\n\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children;\n\n // Multi-drag selection\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n }\n\n // Multi-drag drop\n if (dragStarted && this.isMultiDrag) {\n folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n multiDragIndex++;\n });\n\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent('update');\n dispatchSortableEvent('sort');\n }\n }\n }\n\n // Must be done after capturing individual rects (scroll bar)\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n multiDragSortable = toSortable;\n }\n\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return;\n\n // Only deselect if selection is in this sortable\n if (multiDragSortable !== this.sortable) return;\n\n // Only deselect if target is not item in this sortable\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n multiDragSortable = sortable;\n }\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n\n // multiDragElements will already be sorted if folding\n var newIndex;\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n return key;\n }\n }\n });\n}\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","export async function animationFrame(): Promise {\n return new Promise((resolve) => {\n requestAnimationFrame(resolve);\n });\n}\n","import {\n Model,\n ModelElementObject,\n ModelElementId,\n ModelElementArray,\n ModelRecord,\n} from './model';\n\nconst stockIds = [\n 'capacityOfNewlyProducedPhones',\n 'capacityOfRecycledMaterials',\n 'capacityOfRefurbishedPhones',\n 'capacityOfRepairedPhones',\n 'phonesInUse',\n 'supplyOfBrokenPhones',\n 'supplyOfDisposedPhones',\n 'supplyOfHibernatingPhones',\n 'supplyOfNewlyProducedPhones',\n 'supplyOfRecycledMaterials',\n 'supplyOfRefurbishedPhones',\n 'supplyOfRepairedPhones',\n] as const;\n\nconst flowIds = [\n 'abandon',\n 'acquireNewlyProduced',\n 'acquireRefurbished',\n 'acquireRepaired',\n 'acquireUsed',\n 'capacityOfNewlyProducedPhonesAdjustment',\n 'capacityOfRecycledMaterialsAdjustment',\n 'capacityOfRefurbishedPhonesAdjustment',\n 'disposeBroken',\n 'disposeHibernating',\n 'goBroken',\n 'landfill',\n 'produceFromNaturalResources',\n 'produceFromRecycledMaterials',\n 'recycle',\n 'refurbish',\n 'repair',\n 'repairShopCapcityAdjustment',\n] as const;\n\nconst variableIds = [\n 'demandForNaturalResources',\n 'demandForNewlyProducedPhones',\n 'demandForPhones',\n 'demandForRecycledMaterials',\n 'demandForRefurbishedPhones',\n 'demandForRefurbishment',\n 'demandForRepairedPhones',\n 'demandForReusedPhones',\n 'inflowIncentiveSumForPhonesInUse',\n 'phoneGoal',\n 'phonesInUseExcess',\n 'recycleDemand',\n 'repairDemand',\n 'resourceDemand',\n 'supplyOfBrokenPhonesForDisposal',\n 'supplyOfBrokenPhonesForRepair',\n 'supplyOfDisposedPhonesForLandfilling',\n 'supplyOfDisposedPhonesForRecycling',\n] as const;\n\nconst parameterIds = [\n 'abandonExcessRate',\n 'abandonRate',\n 'acquireRate',\n 'breakRate',\n 'capacityAdjustmentRate',\n 'disposeIncentive',\n 'disposeRate',\n 'durability',\n 'landfillIncentive',\n 'landfillRate',\n 'naturalResourcesIncentive',\n 'newPhoneProductionRate',\n 'newlyProducedPhoneIncentive',\n 'numberOfUsers',\n 'phonesPerUserGoal',\n 'recycleRate',\n 'recyclingIncentive',\n 'refurbishmentIncentive',\n 'refurbishmentRate',\n 'repairIncentive',\n 'repairRate',\n 'reuseIncentive',\n] as const;\n\ntype StockIds = typeof stockIds;\ntype StockId = ModelElementId;\ntype Stocks = ModelElementObject;\ntype StockArray = ModelElementArray;\n\ntype FlowIds = typeof flowIds;\ntype FlowId = ModelElementId;\ntype Flows = ModelElementObject;\ntype FlowArray = ModelElementArray;\n\ntype VariableIds = typeof variableIds;\ntype VariableId = ModelElementId;\ntype Variables = ModelElementObject;\ntype VariableArray = ModelElementArray;\n\ntype ParameterIds = typeof parameterIds;\ntype ParameterId = ModelElementId;\ntype Parameters = ModelElementObject;\ntype ParameterArray = ModelElementArray;\n\ntype Record = ModelRecord;\n\nclass CircularEconomyModel extends Model<\n StockIds,\n FlowIds,\n VariableIds,\n ParameterIds\n> {\n public static readonly initialStocks: Readonly = {\n capacityOfNewlyProducedPhones: 0,\n capacityOfRecycledMaterials: 0,\n capacityOfRefurbishedPhones: 0,\n capacityOfRepairedPhones: 0,\n phonesInUse: 0,\n supplyOfBrokenPhones: 0,\n supplyOfDisposedPhones: 0,\n supplyOfHibernatingPhones: 0,\n supplyOfNewlyProducedPhones: 0,\n supplyOfRecycledMaterials: 0,\n supplyOfRefurbishedPhones: 0,\n supplyOfRepairedPhones: 0,\n };\n\n public static readonly defaultParameters: Readonly = {\n abandonExcessRate: 0.5,\n abandonRate: 0.1,\n acquireRate: 1,\n breakRate: 0.1,\n capacityAdjustmentRate: 0.1,\n disposeIncentive: 0.5,\n disposeRate: 0.5,\n durability: 1,\n landfillIncentive: 0.5,\n landfillRate: 1,\n naturalResourcesIncentive: 0.5,\n newPhoneProductionRate: 0.5,\n newlyProducedPhoneIncentive: 0.82,\n numberOfUsers: 1000000,\n phonesPerUserGoal: 1,\n recycleRate: 1,\n recyclingIncentive: 0.89,\n refurbishmentIncentive: 0.5,\n refurbishmentRate: 1,\n repairIncentive: 0.5,\n repairRate: 1,\n reuseIncentive: 0.86,\n };\n\n constructor() {\n super(stockIds, flowIds, variableIds, parameterIds);\n }\n\n // eslint-disable-next-line class-methods-use-this\n public evaluate(stocks: Stocks, parameters: Parameters, t: number): Record {\n const {\n capacityOfNewlyProducedPhones,\n capacityOfRecycledMaterials,\n capacityOfRefurbishedPhones,\n capacityOfRepairedPhones,\n phonesInUse,\n supplyOfBrokenPhones,\n supplyOfDisposedPhones,\n supplyOfHibernatingPhones,\n supplyOfNewlyProducedPhones,\n supplyOfRecycledMaterials,\n supplyOfRefurbishedPhones,\n supplyOfRepairedPhones,\n } = stocks;\n const {\n abandonExcessRate,\n abandonRate,\n acquireRate,\n breakRate,\n capacityAdjustmentRate,\n disposeIncentive,\n disposeRate,\n durability,\n landfillIncentive,\n landfillRate,\n naturalResourcesIncentive,\n newPhoneProductionRate,\n newlyProducedPhoneIncentive,\n numberOfUsers,\n phonesPerUserGoal,\n recycleRate,\n recyclingIncentive,\n refurbishmentIncentive,\n refurbishmentRate,\n repairIncentive,\n repairRate,\n reuseIncentive,\n } = parameters;\n\n const phoneGoal = numberOfUsers * phonesPerUserGoal;\n const phonesInUseExcess = Math.max(phonesInUse - phoneGoal, 0);\n const abandon =\n abandonRate * phonesInUse + abandonExcessRate * phonesInUseExcess;\n const inflowIncentiveSumForPhonesInUse =\n reuseIncentive +\n repairIncentive +\n refurbishmentIncentive +\n newlyProducedPhoneIncentive;\n const demandForPhones = Math.max(0, phoneGoal - phonesInUse);\n const demandForNewlyProducedPhones =\n (newlyProducedPhoneIncentive / inflowIncentiveSumForPhonesInUse) *\n demandForPhones;\n const acquireNewlyProduced =\n acquireRate *\n Math.min(supplyOfNewlyProducedPhones, demandForNewlyProducedPhones);\n const demandForRefurbishedPhones =\n (refurbishmentIncentive / inflowIncentiveSumForPhonesInUse) *\n demandForPhones;\n const acquireRefurbished =\n acquireRate *\n Math.min(demandForRefurbishedPhones, supplyOfRefurbishedPhones);\n const demandForRepairedPhones =\n (repairIncentive / inflowIncentiveSumForPhonesInUse) * demandForPhones;\n const acquireRepaired =\n acquireRate * Math.min(demandForRepairedPhones, supplyOfRepairedPhones);\n const demandForReusedPhones =\n (reuseIncentive / inflowIncentiveSumForPhonesInUse) * demandForPhones;\n const acquireUsed =\n acquireRate * Math.min(supplyOfHibernatingPhones, demandForReusedPhones);\n const capacityOfNewlyProducedPhonesAdjustment =\n capacityAdjustmentRate *\n (demandForNewlyProducedPhones - capacityOfNewlyProducedPhones);\n const resourceDemand = Math.max(\n capacityOfNewlyProducedPhones - supplyOfNewlyProducedPhones,\n 0,\n );\n const demandForRecycledMaterials =\n (recyclingIncentive / (naturalResourcesIncentive + recyclingIncentive)) *\n resourceDemand;\n const capacityOfRecycledMaterialsAdjustment =\n capacityAdjustmentRate *\n (demandForRecycledMaterials - capacityOfRecycledMaterials);\n const capacityOfRefurbishedPhonesAdjustment =\n capacityAdjustmentRate *\n (demandForRefurbishedPhones - capacityOfRefurbishedPhones);\n const supplyOfBrokenPhonesForDisposal =\n (disposeIncentive / (repairIncentive + disposeIncentive)) *\n supplyOfBrokenPhones;\n const disposeBroken = disposeRate * supplyOfBrokenPhonesForDisposal;\n const disposeHibernating = disposeRate * supplyOfHibernatingPhones;\n const goBroken = (breakRate / durability) * phonesInUse;\n const supplyOfDisposedPhonesForLandfilling =\n (landfillIncentive / (recyclingIncentive + landfillIncentive)) *\n supplyOfDisposedPhones;\n const landfill = landfillRate * supplyOfDisposedPhonesForLandfilling;\n const demandForNaturalResources =\n (naturalResourcesIncentive /\n (naturalResourcesIncentive + recyclingIncentive)) *\n resourceDemand;\n const produceFromNaturalResources =\n newPhoneProductionRate * demandForNaturalResources;\n const produceFromRecycledMaterials =\n newPhoneProductionRate *\n Math.min(demandForRecycledMaterials, supplyOfRecycledMaterials);\n const supplyOfDisposedPhonesForRecycling =\n (recyclingIncentive / (recyclingIncentive + landfillIncentive)) *\n supplyOfDisposedPhones;\n const recycleDemand = Math.max(\n capacityOfRecycledMaterials - supplyOfRecycledMaterials,\n 0,\n );\n const recycle =\n recycleRate * Math.min(supplyOfDisposedPhonesForRecycling, recycleDemand);\n const demandForRefurbishment = Math.max(\n capacityOfRefurbishedPhones - supplyOfRefurbishedPhones,\n 0,\n );\n const refurbish =\n refurbishmentRate *\n Math.min(supplyOfHibernatingPhones, demandForRefurbishment);\n const repairDemand = Math.max(\n capacityOfRepairedPhones - supplyOfRepairedPhones,\n 0,\n );\n const repair = repairRate * Math.min(supplyOfBrokenPhones, repairDemand);\n const repairShopCapcityAdjustment =\n capacityAdjustmentRate *\n (demandForRepairedPhones - capacityOfRepairedPhones);\n const supplyOfBrokenPhonesForRepair =\n (repairIncentive / (repairIncentive + disposeIncentive)) *\n supplyOfBrokenPhones;\n\n const variables = {\n demandForNaturalResources,\n demandForNewlyProducedPhones,\n demandForPhones,\n demandForRecycledMaterials,\n demandForRefurbishedPhones,\n demandForRefurbishment,\n demandForRepairedPhones,\n demandForReusedPhones,\n inflowIncentiveSumForPhonesInUse,\n phoneGoal,\n phonesInUseExcess,\n recycleDemand,\n repairDemand,\n resourceDemand,\n supplyOfBrokenPhonesForDisposal,\n supplyOfBrokenPhonesForRepair,\n supplyOfDisposedPhonesForLandfilling,\n supplyOfDisposedPhonesForRecycling,\n };\n const flows = {\n abandon,\n acquireNewlyProduced,\n acquireRefurbished,\n acquireRepaired,\n acquireUsed,\n capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhonesAdjustment,\n disposeBroken,\n disposeHibernating,\n goBroken,\n landfill,\n produceFromNaturalResources,\n produceFromRecycledMaterials,\n recycle,\n refurbish,\n repair,\n repairShopCapcityAdjustment,\n };\n\n return { t, stocks, parameters, variables, flows };\n }\n\n // eslint-disable-next-line class-methods-use-this\n public accumulateFlowsPerStock(flows: Flows): Stocks {\n const {\n abandon,\n acquireNewlyProduced,\n acquireRefurbished,\n acquireRepaired,\n acquireUsed,\n capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhonesAdjustment,\n disposeBroken,\n disposeHibernating,\n goBroken,\n landfill,\n produceFromNaturalResources,\n produceFromRecycledMaterials,\n recycle,\n refurbish,\n repair,\n repairShopCapcityAdjustment,\n } = flows;\n\n const flowPerStock: Stocks = {\n capacityOfNewlyProducedPhones: capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterials: capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhones: capacityOfRefurbishedPhonesAdjustment,\n capacityOfRepairedPhones: repairShopCapcityAdjustment,\n phonesInUse:\n acquireNewlyProduced +\n acquireRefurbished +\n acquireRepaired +\n acquireUsed -\n (abandon + goBroken),\n supplyOfBrokenPhones: goBroken - (disposeBroken + repair),\n supplyOfDisposedPhones:\n disposeBroken + disposeHibernating - (landfill + recycle),\n supplyOfHibernatingPhones:\n abandon - (acquireUsed + disposeHibernating + refurbish),\n supplyOfNewlyProducedPhones:\n produceFromNaturalResources +\n produceFromRecycledMaterials -\n acquireNewlyProduced,\n supplyOfRecycledMaterials: recycle - produceFromRecycledMaterials,\n supplyOfRefurbishedPhones: refurbish - acquireRefurbished,\n supplyOfRepairedPhones: repair - acquireRepaired,\n };\n\n return flowPerStock;\n }\n}\nexport type {\n StockIds,\n StockId,\n Stocks,\n StockArray,\n FlowIds,\n FlowId,\n Flows,\n FlowArray,\n VariableIds,\n VariableId,\n Variables,\n VariableArray,\n ParameterIds,\n ParameterId,\n Parameters,\n ParameterArray,\n Record,\n};\n\nexport default CircularEconomyModel;\n","import {\n step,\n FlowEvaluator,\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n} from './box-model/box-model';\nimport type {\n ConvertTupleToUnion,\n ConvertTupleToObject,\n ConvertTupleItemType,\n} from './util/type-helpers';\n\ntype ModelElementIds = readonly string[];\ntype ModelElementId = ConvertTupleToUnion;\ntype ModelElementObject = ConvertTupleToObject<\n I,\n number\n>;\ntype ModelElementArray = ConvertTupleItemType<\n I,\n number\n>;\n\ntype ModelRecord<\n S extends ModelElementIds,\n F extends ModelElementIds,\n V extends ModelElementIds,\n P extends ModelElementIds,\n> = {\n t: number;\n stocks: ModelElementObject;\n flows: ModelElementObject;\n variables: ModelElementObject;\n parameters: ModelElementObject

;\n};\n\nabstract class Model<\n S extends ModelElementIds,\n F extends ModelElementIds,\n V extends ModelElementIds,\n P extends ModelElementIds,\n> {\n public static elementIds = [\n 'stocks',\n 'parameters',\n 'variables',\n 'flows',\n ] as const;\n\n public readonly stockIds: S;\n\n public readonly flowIds: F;\n\n public readonly variableIds: V;\n\n public readonly parameterIds: P;\n\n protected constructor(\n stocksIds: S,\n flowIds: F,\n variableIds: V,\n parameterIds: P,\n ) {\n this.stockIds = stocksIds;\n this.flowIds = flowIds;\n this.variableIds = variableIds;\n this.parameterIds = parameterIds;\n }\n\n public static elementObjectToArray(\n ids: I,\n object: Readonly>,\n ): ModelElementArray {\n return ids.map(\n (id: ModelElementId) => object[id],\n ) as ModelElementArray;\n }\n\n public static arrayToElementObject(\n ids: I,\n array: readonly [...ModelElementArray],\n ): ModelElementObject {\n const result: Partial> = {};\n for (let i = 0; i < ids.length; i += 1) {\n const id: ModelElementId = ids[i];\n result[id] = array[i];\n }\n return result as ModelElementObject;\n }\n\n public stocksToStockArray(\n stocks: Readonly>,\n ): ModelElementArray {\n return Model.elementObjectToArray(this.stockIds, stocks);\n }\n\n public stockArrayToStocks(\n stockArray: readonly [...ModelElementArray],\n ): ModelElementObject {\n return Model.arrayToElementObject(this.stockIds, stockArray);\n }\n\n public flowsToFlowArray(\n flows: Readonly>,\n ): ModelElementArray {\n return Model.elementObjectToArray(this.flowIds, flows);\n }\n\n public flowArrayToFlows(\n flowArray: readonly [...ModelElementArray],\n ): ModelElementObject {\n return Model.arrayToElementObject(this.flowIds, flowArray);\n }\n\n public variablesToVariableArray(\n variables: Readonly>,\n ): ModelElementArray {\n return Model.elementObjectToArray(this.variableIds, variables);\n }\n\n public variableArrayToVariables(\n variableArray: readonly [...ModelElementArray],\n ): ModelElementObject {\n return Model.arrayToElementObject(this.variableIds, variableArray);\n }\n\n public parametersToParameterArray(\n parameters: Readonly>,\n ): ModelElementArray

{\n return Model.elementObjectToArray(this.parameterIds, parameters);\n }\n\n public parameterArrayToParameters(\n parameterArray: readonly [...ModelElementArray

],\n ): ModelElementObject

{\n return Model.arrayToElementObject(this.parameterIds, parameterArray);\n }\n\n public abstract evaluate(\n stocks: ModelElementObject,\n parameters: ModelElementObject

,\n t: number,\n ): ModelRecord;\n\n public abstract accumulateFlowsPerStock(\n flows: ModelElementObject,\n ): ModelElementObject;\n\n public evaluateFlowPerStock(\n stocks: ModelElementObject,\n parameters: ModelElementObject

,\n t: number,\n ): ModelElementObject {\n const { flows } = this.evaluate(stocks, parameters, t);\n return this.accumulateFlowsPerStock(flows);\n }\n\n public createFlowEvaluator(\n parameters: Readonly>,\n ): FlowEvaluator> {\n const result = (\n stocksArray: IntegrationEngineInputArray>,\n t: number,\n ): IntegrationEngineOutputArray> => {\n const stocks = this.stockArrayToStocks(stocksArray);\n const flowsPerStock = this.evaluateFlowPerStock(stocks, parameters, t);\n const flowPerStockArray = this.stocksToStockArray(flowsPerStock);\n return flowPerStockArray;\n };\n return result;\n }\n\n public step(\n stocks: Readonly>,\n t: number,\n h: number,\n flowEvaluator: FlowEvaluator>,\n ): ModelElementObject {\n const stocksArray: ModelElementArray = this.stocksToStockArray(stocks);\n const newStocksArray = step>(\n stocksArray,\n t,\n h,\n flowEvaluator,\n );\n return this.stockArrayToStocks(newStocksArray);\n }\n}\n\nexport type {\n ModelElementIds,\n ModelElementId,\n ModelElementObject,\n ModelElementArray,\n ModelRecord,\n};\n\nexport { Model };\n","import type { FlowEvaluator, ConvergenceCriterion } from './types';\nimport { step as stepImpl, converge as convergeImpl } from './engine';\nimport {\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n IVPIntegrator,\n} from './types';\n\nfunction step5(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray {\n return stepImpl(stocksAtT, t, h, computeFlows, integrator);\n}\n\nfunction step6(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray {\n const mutableFlowsAtT: IntegrationEngineOutputArray = [...flowsAtT];\n const getFlows: FlowEvaluator = (y, x) =>\n x === t ? mutableFlowsAtT : computeFlows(y, x);\n return stepImpl(stocksAtT, t, h, getFlows, integrator);\n}\n\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray;\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray;\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n tOrFlowsAtT: number | IntegrationEngineInputArray,\n tOrH: number,\n hOrComputeFlows: number | FlowEvaluator,\n computeFlowsOrIntegrator?: FlowEvaluator | IVPIntegrator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray {\n if (typeof tOrFlowsAtT === 'number')\n return step5(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as FlowEvaluator,\n computeFlowsOrIntegrator as IVPIntegrator,\n );\n\n return step6(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as number,\n computeFlowsOrIntegrator as FlowEvaluator,\n integrator as IVPIntegrator,\n );\n}\n\nfunction converge6(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C {\n return convergeImpl(stocksAtT, t, h, computeFlows, criterion, integrator);\n}\n\nfunction converge7(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C {\n const mutableFlowsAtT: IntegrationEngineOutputArray = [...flowsAtT];\n const getFlows: FlowEvaluator = (y, x) =>\n x === t ? mutableFlowsAtT : computeFlows(y, x);\n return convergeImpl(stocksAtT, t, h, getFlows, criterion, integrator);\n}\n\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C;\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C;\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n tOrFlowsAtT: number | IntegrationEngineInputArray,\n tOrH: number,\n hOrComputeFlows: number | FlowEvaluator,\n computeFlowsOrCriterion: FlowEvaluator | ConvergenceCriterion,\n criterionOrIntegrator?: ConvergenceCriterion | IVPIntegrator,\n integrator?: IVPIntegrator,\n): C {\n if (typeof tOrFlowsAtT === 'number')\n return converge6(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as FlowEvaluator,\n computeFlowsOrCriterion as ConvergenceCriterion,\n criterionOrIntegrator as IVPIntegrator,\n );\n\n return converge7(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as number,\n computeFlowsOrCriterion as FlowEvaluator,\n criterionOrIntegrator as ConvergenceCriterion,\n integrator as IVPIntegrator,\n );\n}\n\nexport type {\n FlowEvaluator,\n ConvergenceCriterion,\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n};\nexport { step, converge };\n","import {\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n FlowEvaluator,\n IVPIntegrator,\n ConvergenceCriterion,\n} from './types';\nimport { rk4 } from './ode';\n\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n getFlows: FlowEvaluator,\n integrator: IVPIntegrator = rk4,\n): IntegrationEngineOutputArray {\n return integrator(stocksAtT, t, h, getFlows);\n}\n\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n getFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator: IVPIntegrator = rk4,\n): C {\n let iterations = 0;\n let { userdata, done } = criterion(stocksAtT, t, undefined, iterations);\n\n if (!done) {\n let newT = t;\n let newStocks: IntegrationEngineOutputArray | undefined;\n\n do {\n newStocks = integrator(newStocks ?? stocksAtT, newT, h, getFlows);\n newT += h;\n iterations += 1;\n ({ userdata, done } = criterion(newStocks, newT, userdata, iterations));\n } while (!done);\n }\n\n return userdata;\n}\n\nexport type { FlowEvaluator, ConvergenceCriterion };\nexport { step, converge };\n","import {\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n} from './types';\n\nexport function euler(\n y: IntegrationEngineInputArray,\n x: number,\n h: number,\n derivatives: (\n y: IntegrationEngineInputArray,\n x: number,\n ) => IntegrationEngineOutputArray,\n): IntegrationEngineOutputArray {\n const n: number = y.length;\n const dydx = derivatives(y, x);\n const yTemp = dydx; // Reuse array for result to avoid allocation and GC\n for (let i = 0; i < n; i += 1) yTemp[i] = y[i] + h * dydx[i];\n return yTemp;\n}\n\nexport function rk4(\n y: IntegrationEngineInputArray,\n x: number,\n h: number,\n derivatives: (\n y: IntegrationEngineInputArray,\n x: number,\n ) => IntegrationEngineOutputArray,\n): IntegrationEngineOutputArray {\n const n: number = y.length;\n\n const dydx = derivatives(y, x);\n const yTemp = new Array(n) as IntegrationEngineOutputArray;\n\n const h2 = h / 2.0;\n const h6 = h / 6.0;\n const xhh = x + h2;\n\n for (let i = 0; i < n; i += 1) yTemp[i] = y[i] + h2 * dydx[i];\n let dydxTemp = derivatives(yTemp, xhh);\n\n for (let i = 0; i < n; i += 1) yTemp[i] = y[i] + h2 * dydxTemp[i];\n const dydxM = derivatives(yTemp, xhh);\n\n for (let i = 0; i < n; i += 1) {\n yTemp[i] = y[i] + h * dydxM[i];\n dydxM[i] += dydxTemp[i];\n }\n dydxTemp = derivatives(yTemp, x + h);\n\n for (let i = 0; i < n; i += 1)\n yTemp[i] = y[i] + h6 * (dydx[i] + dydxTemp[i] + 2.0 * dydxM[i]);\n return yTemp;\n}\n","import type {\n ModelElementIds,\n ModelElementArray,\n ModelElementObject,\n ModelRecord,\n} from './model';\nimport { Model } from './model';\n\nimport { FlowEvaluator } from './box-model/types';\n\nclass ModelSimulator<\n S extends ModelElementIds,\n F extends ModelElementIds,\n V extends ModelElementIds,\n P extends ModelElementIds,\n> {\n public readonly model: Model;\n\n public readonly parameters: ModelElementObject

;\n\n public record: ModelRecord;\n\n public h: number;\n\n protected flowPerStockCache: {\n t: number;\n value: readonly [...ModelElementArray];\n } | null;\n\n protected flowEvaluator: FlowEvaluator>;\n\n protected flowEvaluatorWithCache: FlowEvaluator>;\n\n constructor(\n model: Model,\n stocks: ModelElementObject,\n parameters: ModelElementObject

,\n t: number,\n h: number,\n ) {\n this.model = model;\n this.parameters = parameters;\n this.flowPerStockCache = null;\n this.record = this.model.evaluate(stocks, parameters, t);\n this.h = h;\n this.flowEvaluator = this.model.createFlowEvaluator(parameters);\n this.flowEvaluatorWithCache = this.evaluateFlowPerStockWithCache.bind(this);\n }\n\n protected evaluateFlowPerStockWithCache(\n stockArray: readonly [...ModelElementArray],\n t: number,\n ): [...ModelElementArray] {\n if (this.flowPerStockCache !== null && this.flowPerStockCache.t === t)\n return [...this.flowPerStockCache.value];\n\n return this.flowEvaluator(stockArray, t);\n }\n\n step(): ModelRecord {\n const { stocks, parameters, t } = this.record;\n const newStocks = this.model.step(\n stocks,\n t,\n this.h,\n this.flowEvaluatorWithCache,\n );\n const newRecord = this.model.evaluate(newStocks, parameters, t + this.h);\n this.flowPerStockCache = {\n t: newRecord.t,\n value: this.model.stocksToStockArray(\n this.model.accumulateFlowsPerStock(newRecord.flows),\n ),\n };\n this.record = newRecord;\n return newRecord;\n }\n}\n\nexport default ModelSimulator;\n","import kebabCase from 'lodash/kebabCase';\n\nimport { ModelElementObject } from './model';\nimport CircularEconomyModel, { Record } from './circular-economy-model';\nimport { loadSvg } from './util/load-svg';\nimport { guardedQuerySelector } from './util/guarded-query-selectors';\n\nconst svgUrl = new URL('../svg/model.svg', import.meta.url);\n\nconst mainFlowIds = [\n 'abandon',\n 'acquireNewlyProduced',\n 'acquireRefurbished',\n 'acquireRepaired',\n 'acquireUsed',\n 'disposeBroken',\n 'disposeHibernating',\n 'goBroken',\n 'landfill',\n 'produceFromNaturalResources',\n 'produceFromRecycledMaterials',\n 'recycle',\n 'refurbish',\n 'repair',\n] as const;\n\ntype MainFlowIds = typeof mainFlowIds;\n\nconst flowVizSigns: ModelElementObject = {\n abandon: +1,\n acquireNewlyProduced: -1,\n acquireRefurbished: -1,\n acquireRepaired: -1,\n acquireUsed: -1,\n disposeBroken: -1,\n disposeHibernating: -1,\n goBroken: -1,\n landfill: -1,\n produceFromNaturalResources: -1,\n produceFromRecycledMaterials: -1,\n recycle: -1,\n refurbish: -1,\n repair: -1,\n};\n\nexport default class Visualization {\n protected readonly model: CircularEconomyModel;\n\n public readonly element: HTMLDivElement;\n\n protected readonly svg: SVGSVGElement;\n\n protected constructor(model: CircularEconomyModel, svg: SVGSVGElement) {\n this.model = model;\n this.svg = svg;\n\n this.element = document.createElement('div');\n this.element.append(this.svg);\n }\n\n protected updateSvgFlows(deltaMs: DOMHighResTimeStamp, record: Record) {\n const { flows } = record;\n const flowVizScale = 5.0 / record.parameters.numberOfUsers;\n const dashGap = 20;\n mainFlowIds.forEach((id) => {\n const flow = flows[id];\n const flowVizSign = flowVizSigns[id];\n const elementId = `${kebabCase(id)}-flow`;\n const element = guardedQuerySelector(\n this.svg,\n `#${elementId}`,\n SVGPathElement,\n );\n const lastDashOffset = parseFloat(\n element.getAttribute('stroke-dashoffset') ?? '0',\n );\n // The dash offset step must not be small compared to the dash gap.\n // Otherwise, the flow animation may appear to move backwards.\n const dashOffsetStep = Math.max(\n -0.3 * dashGap,\n Math.min(flowVizSign * (deltaMs * flow) * flowVizScale, 0.1 * dashGap),\n );\n const dashOffset =\n (Number.isNaN(lastDashOffset) ? 0 : lastDashOffset) + dashOffsetStep;\n\n element.setAttribute('stroke-dashoffset', `${dashOffset}`);\n element.setAttribute('stroke-dasharray', `0 ${dashGap}`);\n });\n }\n\n protected updateSvgStocks(deltaMs: DOMHighResTimeStamp, record: Record) {\n const { stocks } = record;\n const stockVizScale = 50000.0 / record.parameters.numberOfUsers;\n this.model.stockIds.forEach((id) => {\n const elementId = kebabCase(id);\n const element = this.svg.getElementById(elementId);\n if (element === null) {\n throw new Error(\n `SVG element with id ${elementId} for stock ${id} not found.`,\n );\n }\n if (!(element instanceof SVGCircleElement)) {\n throw new Error(\n `Stock element for stock ${id} with id ${elementId} is not an SVG circle element.`,\n );\n }\n const stock = stocks[id];\n const radius = Math.sqrt((stock * stockVizScale) / Math.PI);\n element.setAttribute('r', `${radius}`);\n });\n }\n\n protected updateSvg(deltaMs: DOMHighResTimeStamp, record: Record) {\n this.updateSvgFlows(deltaMs, record);\n this.updateSvgStocks(deltaMs, record);\n }\n\n public update(deltaMs: DOMHighResTimeStamp, record: Record) {\n this.updateSvg(deltaMs, record);\n }\n\n public static prepareSvg(model: CircularEconomyModel, svg: SVGSVGElement) {\n const createSVGElement = (tagName: string) =>\n svg.ownerDocument.createElementNS('http://www.w3.org/2000/svg', tagName);\n\n svg.classList.add('model-visualization');\n svg.querySelectorAll('circle, rect, path, text').forEach((element) => {\n element.removeAttribute('style');\n });\n\n const elementsToRemove = [...svg.children];\n\n const labelLayer = createSVGElement('g');\n labelLayer.classList.add('labels');\n\n const supplyLayer = createSVGElement('g');\n supplyLayer.classList.add('supplies');\n\n const capacityLayer = createSVGElement('g');\n capacityLayer.classList.add('capacities');\n\n const flowLayer = createSVGElement('g');\n flowLayer.classList.add('flows');\n svg.append(capacityLayer, flowLayer, supplyLayer, labelLayer);\n\n svg.querySelectorAll('text').forEach((baseElement) => {\n const clone = baseElement.cloneNode(true) as SVGTextElement;\n clone.classList.add('label');\n labelLayer.append(clone);\n });\n\n svg.querySelectorAll('rect').forEach((baseElement) => {\n const clone = baseElement.cloneNode(false) as SVGRectElement;\n clone.classList.add('capacity');\n capacityLayer.append(clone);\n });\n\n model.stockIds\n .filter((id) => id.startsWith('supplyOf'))\n .forEach((id) => {\n const baseElementId = kebabCase(id.replace(/^supplyOf/, ''));\n const baseElement = guardedQuerySelector(\n svg,\n `#${baseElementId}`,\n SVGGeometryElement,\n );\n\n const clone = baseElement.cloneNode(false) as SVGGeometryElement;\n clone.id = `supply-of-${baseElement.id}`;\n clone.classList.add('stock', 'supply');\n supplyLayer.append(clone);\n });\n const phonesInUse = guardedQuerySelector(\n svg,\n '#phones-in-use',\n SVGGeometryElement,\n );\n const phonesInUseClone = phonesInUse.cloneNode(false) as SVGGeometryElement;\n supplyLayer.append(phonesInUseClone);\n\n model.stockIds\n .filter((id) => id.startsWith('capacityOf'))\n .forEach((id) => {\n const baseElementId = kebabCase(id.replace(/^capacityOf/, ''));\n const baseElement = guardedQuerySelector(\n svg,\n `#${baseElementId}`,\n SVGGeometryElement,\n );\n\n const clone = baseElement.cloneNode(false) as SVGGeometryElement;\n clone.id = `capacity-of-${baseElementId}`;\n clone.classList.add('stock', 'capacity');\n capacityLayer.append(clone);\n });\n mainFlowIds.forEach((id) => {\n const baseElementId = kebabCase(id);\n const baseElement = guardedQuerySelector(\n svg,\n `#${baseElementId}`,\n SVGGeometryElement,\n );\n\n const edge = baseElement.cloneNode(false) as SVGGeometryElement;\n edge.id = `${baseElementId}-edge`;\n edge.removeAttribute('style');\n edge.classList.add('flow', 'edge');\n flowLayer.append(edge);\n\n const flow = baseElement.cloneNode(false) as SVGGeometryElement;\n flow.id = `${baseElementId}-flow`;\n flow.removeAttribute('style');\n flow.classList.add('flow', 'anim-edge');\n flowLayer.append(flow);\n });\n\n elementsToRemove.forEach((element) => element.remove());\n }\n\n public static async create(model: CircularEconomyModel) {\n const svg = await loadSvg(svgUrl);\n this.prepareSvg(model, svg);\n return new Visualization(model, svg);\n }\n}\n","var createCompounder = require('./_createCompounder');\n\n/**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\nvar kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n});\n\nmodule.exports = kebabCase;\n","var arrayReduce = require('./_arrayReduce'),\n deburr = require('./deburr'),\n words = require('./words');\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\";\n\n/** Used to match apostrophes. */\nvar reApos = RegExp(rsApos, 'g');\n\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\nfunction createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n}\n\nmodule.exports = createCompounder;\n","/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduce;\n","var deburrLetter = require('./_deburrLetter'),\n toString = require('./toString');\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */\nvar reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n/** Used to compose unicode character classes. */\nvar rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;\n\n/** Used to compose unicode capture groups. */\nvar rsCombo = '[' + rsComboRange + ']';\n\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\nvar reComboMark = RegExp(rsCombo, 'g');\n\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\nfunction deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n}\n\nmodule.exports = deburr;\n","var basePropertyOf = require('./_basePropertyOf');\n\n/** Used to map Latin Unicode letters to basic Latin letters. */\nvar deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n};\n\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\nvar deburrLetter = basePropertyOf(deburredLetters);\n\nmodule.exports = deburrLetter;\n","/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = basePropertyOf;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var asciiWords = require('./_asciiWords'),\n hasUnicodeWord = require('./_hasUnicodeWord'),\n toString = require('./toString'),\n unicodeWords = require('./_unicodeWords');\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\nfunction words(string, pattern, guard) {\n string = toString(string);\n pattern = guard ? undefined : pattern;\n\n if (pattern === undefined) {\n return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);\n }\n return string.match(pattern) || [];\n}\n\nmodule.exports = words;\n","/** Used to match words composed of alphanumeric characters. */\nvar reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction asciiWords(string) {\n return string.match(reAsciiWord) || [];\n}\n\nmodule.exports = asciiWords;\n","/** Used to detect strings that need a more robust regexp to match words. */\nvar reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\nfunction hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n}\n\nmodule.exports = hasUnicodeWord;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\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',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\",\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;\n\n/** Used to match complex or compound words. */\nvar reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n].join('|'), 'g');\n\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n}\n\nmodule.exports = unicodeWords;\n","/**\n * Loads an external SVG file and returns the DOM tree of its first element.\n *\n * @param {string|URL} uri\n * @param {boolean} clearStyles\n * If true removes the style elements from the file\n * @return {Promise}\n */\nexport async function loadSvg(uri: string | URL, clearStyles = true) {\n const response = await fetch(uri);\n if (response.status < 200 || response.status >= 300) {\n throw new Error(\n `Server returned status ${response.status} (${\n response.statusText\n }) loading ${new URL(uri).href}.`,\n );\n }\n const svgText = await response.text();\n const div = document.createElement('div');\n div.innerHTML = svgText;\n const svgDoc = div.querySelector('svg');\n if (svgDoc === null) {\n throw new Error(`No SVG element found in ${new URL(uri).href}.`);\n }\n\n if (clearStyles) {\n svgDoc.querySelectorAll('style')?.forEach((s) => s.remove());\n }\n\n return svgDoc;\n}\n","export function guardedQuerySelector(\n elem: Element | Document,\n selector: string,\n type: { new (...args: unknown[]): T },\n): T {\n const result = elem.querySelector(selector);\n if (result === null) {\n throw new Error(`No element found matching selector ${selector}.`);\n }\n if (!(result instanceof type)) {\n throw new Error(\n `Element matching selector ${selector} has the wrong type.`,\n );\n }\n return result;\n}\n\nexport function guardedQuerySelectorAll(\n elem: Element | Document,\n selector: string,\n type: { new (...args: unknown[]): T },\n): NodeListOf {\n const results = elem.querySelectorAll(selector);\n results.forEach((result) => {\n if (!(result instanceof type)) {\n throw new Error(\n `An element matching selector ${selector} has the wrong type.`,\n );\n }\n });\n\n return results as NodeListOf;\n}\n","module.exports = require('./helpers/bundle-url').getBundleURL('kdWl4') + \"model.f8e270f6.svg\";","export async function documentReady() {\n return new Promise((resolve) => {\n const state = document.readyState;\n if (state === 'complete' || state === 'interactive') {\n setTimeout(resolve, 0);\n }\n\n document.addEventListener('DOMContentLoaded', () => resolve());\n });\n}\n","import isVarName from '../util/is-var-name';\n\nimport FunctionParameterTransform, {\n PararameterTransformFunction,\n} from './function-parameter-transform';\nimport { ModelElementIds, ModelElementObject } from '../model';\n\nexport default class ScriptedParameterTransform<\n P extends ModelElementIds,\n> extends FunctionParameterTransform

{\n public readonly script: string;\n\n constructor(i18nKey: string, parameterIds: P, script: string) {\n super(\n i18nKey,\n ScriptedParameterTransform.createFunction(parameterIds, script),\n );\n this.script = script;\n }\n\n static createFunction

(\n parameterIds: P,\n script: string,\n ): PararameterTransformFunction

{\n parameterIds.forEach((parameterId) => {\n if (!isVarName(parameterId)) {\n throw new Error(\n `Parameter name '${parameterId}' can not be used as a variable`,\n );\n }\n });\n\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const wrappedScript = new Function(script).toString();\n\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const func = new Function(\n `{ ${parameterIds.join(', ')} }`,\n `(${wrappedScript})(); return { ${parameterIds.join(', ')} }`,\n ) as PararameterTransformFunction

;\n\n return >(parameters: T) => {\n const transformedParameters = func(parameters);\n Object.assign(parameters, transformedParameters);\n return parameters;\n };\n }\n}\n","export default function isVarName(str: unknown): boolean {\n if (typeof str !== 'string') {\n return false;\n }\n\n if (str.trim() !== str) {\n return false;\n }\n\n if (str.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/) === null) {\n return false;\n }\n\n return true;\n}\n","import ParameterTransform from './parameter-transform';\nimport { ModelElementIds, ModelElementObject } from '../model';\n\nexport type PararameterTransformFunction

= <\n T extends ModelElementObject

,\n>(\n parameters: T,\n) => T;\n\nexport default class FunctionParameterTransform<\n P extends ModelElementIds,\n> extends ParameterTransform

{\n protected readonly callable: PararameterTransformFunction

;\n\n constructor(i18nKey: string, callable: PararameterTransformFunction

) {\n super(i18nKey);\n this.callable = callable;\n }\n\n applyTo>(parameters: T): T {\n this.callable(parameters);\n return parameters;\n }\n}\n","import type { ModelElementIds, ModelElementObject } from '../model';\n\nexport default abstract class ParameterTransform

{\n public readonly i18nKey: string;\n\n protected constructor(i18nKey: string) {\n this.i18nKey = i18nKey;\n }\n\n abstract applyTo>(parameters: T): T;\n}\n"],"names":["$d892378a320191c0$var$names","id","callback","$parcel$global","globalThis","self","window","global","$parcel$interopDefault","a","__esModule","default","$parcel$modules","$parcel$inits","parcelRequire","exports","init","module","call","err","Error","code","register","parcelRegister","Constructor","protoProps","staticProps","$08030b30a83dd10b$var$isDeepEqual","$08030b30a83dd10b$var$isDeepStrictEqual","$bYqme","$08030b30a83dd10b$var$_typeof","o","Symbol","iterator","constructor","prototype","$08030b30a83dd10b$var$_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","$08030b30a83dd10b$var$_toPropertyKey","arg","key","$08030b30a83dd10b$var$_toPrimitive","input","hint","prim","toPrimitive","undefined","res","TypeError","String","Number","$08030b30a83dd10b$var$_require$codes","$idZmf","codes","$08030b30a83dd10b$var$ERR_AMBIGUOUS_ARGUMENT","ERR_AMBIGUOUS_ARGUMENT","$08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE","ERR_INVALID_ARG_TYPE","$08030b30a83dd10b$var$ERR_INVALID_ARG_VALUE","ERR_INVALID_ARG_VALUE","$08030b30a83dd10b$var$ERR_INVALID_RETURN_VALUE","ERR_INVALID_RETURN_VALUE","$08030b30a83dd10b$var$ERR_MISSING_ARGS","ERR_MISSING_ARGS","$dfdGN","$5d0kT","$08030b30a83dd10b$var$inspect","inspect","$08030b30a83dd10b$require$_require$types","types","$08030b30a83dd10b$var$isPromise","isPromise","$08030b30a83dd10b$var$isRegExp","isRegExp","$08030b30a83dd10b$var$objectAssign","$08030b30a83dd10b$var$objectIs","$08030b30a83dd10b$var$RegExpPrototypeTest","$08030b30a83dd10b$var$lazyLoadComparison","comparison","isDeepEqual","isDeepStrictEqual","$08030b30a83dd10b$var$warned","$08030b30a83dd10b$var$assert","$08030b30a83dd10b$var$ok","$08030b30a83dd10b$var$NO_EXCEPTION_SENTINEL","$08030b30a83dd10b$var$innerFail","obj","message","$08030b30a83dd10b$var$innerOk","fn","argLen","value","generatedMessage","actual","expected","operator","stackStartFn","_len","arguments","args","Array","_key","apply","concat","fail","$08030b30a83dd10b$var$fail","internalMessage","argsLen","warn","emitWarning","console","bind","errArgs","AssertionError","ok","equal","notEqual","deepEqual","notDeepEqual","deepStrictEqual","notDeepStrictEqual","$08030b30a83dd10b$var$notDeepStrictEqual","strictEqual","notStrictEqual","$08030b30a83dd10b$var$Comparison","Comparison","keys","_this","$08030b30a83dd10b$var$_classCallCheck","instance","forEach","$08030b30a83dd10b$var$expectedException","msg","name","push","$08030b30a83dd10b$var$compareExceptionKey","isPrototypeOf","$08030b30a83dd10b$var$getActual","e","$08030b30a83dd10b$var$checkIsPromise","then","catch","$08030b30a83dd10b$var$waitForActual","promiseFn","Promise","resolve","resultPromise","$08030b30a83dd10b$var$expectsError","error","details","fnType","$08030b30a83dd10b$var$expectsNoError","$08030b30a83dd10b$var$internalMatch","string","regexp","fnName","match","throws","_len2","_key2","rejects","_len3","_key3","result","doesNotThrow","_len4","_key4","doesNotReject","_len5","_key5","ifError","newErr","origStack","stack","tmp2","split","shift","tmp1","pos","indexOf","slice","join","doesNotMatch","strict","$08030b30a83dd10b$var$strict","_len6","_key6","$8b79be5a44896e9e$var$cachedSetTimeout","$8b79be5a44896e9e$var$cachedClearTimeout","$8b79be5a44896e9e$var$currentQueue","$8b79be5a44896e9e$var$process","$8b79be5a44896e9e$var$defaultSetTimout","$8b79be5a44896e9e$var$defaultClearTimeout","$8b79be5a44896e9e$var$runTimeout","fun","setTimeout","clearTimeout","$8b79be5a44896e9e$var$queue","$8b79be5a44896e9e$var$draining","$8b79be5a44896e9e$var$queueIndex","$8b79be5a44896e9e$var$cleanUpNextTick","$8b79be5a44896e9e$var$drainQueue","timeout","len","run","$8b79be5a44896e9e$var$runClearTimeout","marker","$8b79be5a44896e9e$var$Item","array","$8b79be5a44896e9e$var$noop","nextTick","title","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","$d44909437516936e$var$_typeof","$d44909437516936e$var$_defineProperties","$d44909437516936e$var$_toPropertyKey","$d44909437516936e$var$_toPrimitive","$d44909437516936e$var$_setPrototypeOf","p","setPrototypeOf","__proto__","$d44909437516936e$var$_getPrototypeOf","getPrototypeOf","get","$d44909437516936e$export$e45cb6485273080e","set","v","$d44909437516936e$var$assert","$d44909437516936e$var$util","$d44909437516936e$var$codes","$d44909437516936e$var$createErrorType","Base","NodeError","_Base","$d44909437516936e$var$_inherits","subClass","superClass","create","hasNativeReflectConstruct","_super","$d44909437516936e$var$_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","valueOf","Super","NewTarget","$d44909437516936e$var$_possibleConstructorReturn","$d44909437516936e$var$_assertThisInitialized","ReferenceError","arg1","arg2","arg3","$d44909437516936e$var$_classCallCheck","$d44909437516936e$var$oneOf","thing","isArray","map","search","str","substr","determiner","replace","this_len","substring","start","type","$d44909437516936e$var$includes","reason","inspected","RangeError","$3cae6d5803bad4b3$var$getOwnPropertyDescriptors","getOwnPropertyDescriptors","descriptors","getOwnPropertyDescriptor","$3cae6d5803bad4b3$var$formatRegExp","format","f","$3cae6d5803bad4b3$var$isString","objects","$3cae6d5803bad4b3$var$inspect","x","JSON","stringify","_","$3cae6d5803bad4b3$var$isNull","$3cae6d5803bad4b3$var$isObject","deprecate","noDeprecation","warned","throwDeprecation","traceDeprecation","trace","$3cae6d5803bad4b3$var$debugs","$3cae6d5803bad4b3$var$debugEnvRegex","opts","ctx","seen","stylize","$3cae6d5803bad4b3$var$stylizeNoColor","depth","colors","$3cae6d5803bad4b3$var$isBoolean","showHidden","_extend","$3cae6d5803bad4b3$var$isUndefined","customInspect","$3cae6d5803bad4b3$var$stylizeWithColor","$3cae6d5803bad4b3$var$formatValue","styleType","style","styles","recurseTimes","$3cae6d5803bad4b3$var$isFunction","base","braces","numLinesEst","hash","output","ret","primitive","$3cae6d5803bad4b3$var$formatPrimitive","simple","$3cae6d5803bad4b3$var$isNumber","visibleKeys","val","idx","getOwnPropertyNames","$3cae6d5803bad4b3$var$isError","$3cae6d5803bad4b3$var$formatError","$3cae6d5803bad4b3$var$isRegExp","RegExp","toString","$3cae6d5803bad4b3$var$isDate","Date","$3cae6d5803bad4b3$var$isArray","toUTCString","$3cae6d5803bad4b3$var$formatArray","l","$3cae6d5803bad4b3$var$hasOwnProperty","$3cae6d5803bad4b3$var$formatProperty","pop","reduce","prev","cur","desc","line","ar","re","$3cae6d5803bad4b3$var$objectToString","d","$3cae6d5803bad4b3$var$pad","n","debuglog","toUpperCase","test","pid","isBoolean","isNull","isNullOrUndefined","isNumber","isString","isSymbol","isUndefined","isObject","isDate","isError","isNativeError","isFunction","isPrimitive","isBuffer","$3cae6d5803bad4b3$var$months","prop","hasOwnProperty","log","time","getHours","getMinutes","getSeconds","getDate","getMonth","inherits","origin","add","$3cae6d5803bad4b3$var$kCustomPromisifiedSymbol","$3cae6d5803bad4b3$var$callbackifyOnRejected","cb","newReason","promisify","original","promiseResolve","promiseReject","promise","reject","defineProperties","custom","callbackify","callbackified","maybeCb","rej","$hQsBH","$lCUJL","$iVfsl","$6n4Tb","$d2e6ca9e43aacb42$var$uncurryThis","$d2e6ca9e43aacb42$var$BigIntSupported","BigInt","$d2e6ca9e43aacb42$var$SymbolSupported","$d2e6ca9e43aacb42$var$ObjectToString","$d2e6ca9e43aacb42$var$numberValue","$d2e6ca9e43aacb42$var$stringValue","$d2e6ca9e43aacb42$var$booleanValue","$d2e6ca9e43aacb42$var$bigIntValue","$d2e6ca9e43aacb42$var$symbolValue","$d2e6ca9e43aacb42$var$checkBoxedPrimitive","prototypeValueOf","$d2e6ca9e43aacb42$var$isMapToString","$d2e6ca9e43aacb42$var$isSetToString","$d2e6ca9e43aacb42$var$isWeakMapToString","$d2e6ca9e43aacb42$var$isWeakSetToString","$d2e6ca9e43aacb42$var$isArrayBufferToString","$d2e6ca9e43aacb42$var$isArrayBuffer","ArrayBuffer","working","$d2e6ca9e43aacb42$var$isDataViewToString","$d2e6ca9e43aacb42$var$isDataView","DataView","isArgumentsObject","isGeneratorFunction","isTypedArray","isArrayBufferView","isView","isUint8Array","isUint8ClampedArray","isUint16Array","isUint32Array","isInt8Array","isInt16Array","isInt32Array","isFloat32Array","isFloat64Array","isBigInt64Array","isBigUint64Array","Map","isMap","Set","isSet","WeakMap","isWeakMap","WeakSet","isWeakSet","isArrayBuffer","isDataView","$d2e6ca9e43aacb42$var$SharedArrayBufferCopy","SharedArrayBuffer","$d2e6ca9e43aacb42$var$isSharedArrayBufferToString","$d2e6ca9e43aacb42$var$isSharedArrayBuffer","$d2e6ca9e43aacb42$var$isNumberObject","$d2e6ca9e43aacb42$var$isStringObject","$d2e6ca9e43aacb42$var$isBooleanObject","$d2e6ca9e43aacb42$var$isBigIntObject","$d2e6ca9e43aacb42$var$isSymbolObject","isSharedArrayBuffer","isAsyncFunction","isMapIterator","isSetIterator","isGeneratorObject","isWebAssemblyCompiledModule","isNumberObject","isStringObject","isBooleanObject","isBigIntObject","isSymbolObject","isBoxedPrimitive","isAnyArrayBuffer","Uint8Array","method","$cfdd7bc16a6f0391$var$hasToStringTag","$cfdd7bc16a6f0391$var$$toString","$9rEHq","$cfdd7bc16a6f0391$var$isStandardArguments","toStringTag","$cfdd7bc16a6f0391$var$isLegacyArguments","callee","$cfdd7bc16a6f0391$var$supportsStandardArguments","isLegacyArguments","$iswqS","getOwnPropertySymbols","sym","symObj","syms","propertyIsEnumerable","$cbV5a","$6gXjj","$6e0634b5d975b0a1$var$$indexOf","allowMissing","intrinsic","$8e02ca77d270b092$var$$SyntaxError","SyntaxError","$8e02ca77d270b092$var$$Function","Function","$8e02ca77d270b092$var$$TypeError","$8e02ca77d270b092$var$getEvalledConstructor","expressionSyntax","$8e02ca77d270b092$var$$gOPD","$8e02ca77d270b092$var$throwTypeError","$8e02ca77d270b092$var$ThrowTypeError","calleeThrows","gOPDthrows","$8e02ca77d270b092$var$hasSymbols","$8e02ca77d270b092$var$hasProto","$8e02ca77d270b092$var$getProto","$8e02ca77d270b092$var$needsEval","$8e02ca77d270b092$var$TypedArray","$8e02ca77d270b092$var$INTRINSICS","AggregateError","Atomics","BigInt64Array","BigUint64Array","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","isNaN","Math","parseFloat","parseInt","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakRef","$8e02ca77d270b092$var$errorProto","$8e02ca77d270b092$var$doEval","doEval","gen","$8e02ca77d270b092$var$LEGACY_ALIASES","$eSJCt","$hhJZr","$8e02ca77d270b092$var$$concat","$8e02ca77d270b092$var$$spliceApply","splice","$8e02ca77d270b092$var$$replace","$8e02ca77d270b092$var$$strSlice","$8e02ca77d270b092$var$$exec","exec","$8e02ca77d270b092$var$rePropName","$8e02ca77d270b092$var$reEscapeChar","$8e02ca77d270b092$var$stringToPath","first","last","number","quote","subString","$8e02ca77d270b092$var$getBaseIntrinsic","alias","intrinsicName","parts","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","$d8964bbb1743abbb$var$origSymbol","$4287230ea792b293$var$test","foo","$4287230ea792b293$var$$Object","$7uTAw","$5756745b39df06db$var$toStr","$5756745b39df06db$var$max","max","$5756745b39df06db$var$concatty","b","arr","j","$5756745b39df06db$var$slicy","arrLike","offset","$5756745b39df06db$var$joiny","joiner","that","bound","$5756745b39df06db$var$ERROR_MESSAGE","boundLength","boundArgs","Empty","$c957b2d89cf0941a$var$call","$c957b2d89cf0941a$var$$hasOwn","$8wQgk","$49123e876306bb42$var$$TypeError","$49123e876306bb42$var$$apply","$49123e876306bb42$var$$call","$49123e876306bb42$var$$reflectApply","$49123e876306bb42$var$$defineProperty","$49123e876306bb42$var$$max","originalFunction","func","$49123e876306bb42$var$applyBind","$dEYu7","$6359da1a4da0c32b$var$hasDescriptors","$lpldP","$6359da1a4da0c32b$var$$TypeError","$6359da1a4da0c32b$var$$floor","loose","functionLengthIsConfigurable","functionLengthIsWritable","$9f1dedcd246e3ad0$var$hasPropertyDescriptors","$9f1dedcd246e3ad0$var$$defineProperty","$9f1dedcd246e3ad0$var$$SyntaxError","$9f1dedcd246e3ad0$var$$TypeError","property","nonEnumerable","nonWritable","nonConfigurable","$bc65a1d1be87ac6b$var$$defineProperty","$bc65a1d1be87ac6b$var$hasPropertyDescriptors","hasArrayLengthDefineBug","$f95c650c3c50a0b9$var$$gOPD","$fbe9286b8c5d6014$var$GeneratorFunction","$fbe9286b8c5d6014$var$toStr","$fbe9286b8c5d6014$var$fnToStr","$fbe9286b8c5d6014$var$isFnRegex","$fbe9286b8c5d6014$var$hasToStringTag","$fbe9286b8c5d6014$var$getProto","$fbe9286b8c5d6014$var$getGeneratorFunc","generatorFunc","$e6WPe","$i6TQG","$dc698a21108030ad$var$$toString","$dc698a21108030ad$var$hasToStringTag","$dc698a21108030ad$var$g","$dc698a21108030ad$var$typedArrays","$dc698a21108030ad$var$$slice","$dc698a21108030ad$var$getPrototypeOf","$dc698a21108030ad$var$$indexOf","$dc698a21108030ad$var$cache","typedArray","proto","$dc698a21108030ad$var$tryTypedArrays","found","getter","$dc698a21108030ad$var$trySlices","tag","$liz7M","$a45f41b45e745637$var$toStr","$a45f41b45e745637$var$hasOwnProperty","$a45f41b45e745637$var$forEachArray","receiver","$a45f41b45e745637$var$forEachString","charAt","$a45f41b45e745637$var$forEachObject","object","k","list","thisArg","$f8168662f23765f9$var$badArrayLike","$f8168662f23765f9$var$isCallableMarker","$f8168662f23765f9$var$fnToStr","$f8168662f23765f9$var$reflectApply","$f8168662f23765f9$var$constructorRegex","$f8168662f23765f9$var$isES6ClassFn","fnStr","$f8168662f23765f9$var$tryFunctionObject","$f8168662f23765f9$var$toStr","$f8168662f23765f9$var$hasToStringTag","$f8168662f23765f9$var$isIE68","$f8168662f23765f9$var$isDDA","document","$f8168662f23765f9$var$all","all","strClass","$d2f41beb2623cba4$var$possibleNames","$d2f41beb2623cba4$var$g","out","copy","fill","readUInt8","ctor","superCtor","super_","TempCtor","$9a474b7dcd09c5ab$var$ownKeys","r","t","filter","$9a474b7dcd09c5ab$var$_objectSpread","$9a474b7dcd09c5ab$var$_toPropertyKey","$9a474b7dcd09c5ab$var$_defineProperties","$9a474b7dcd09c5ab$var$_toPrimitive","$9a474b7dcd09c5ab$var$_typeof","$9a474b7dcd09c5ab$var$_possibleConstructorReturn","$9a474b7dcd09c5ab$var$_assertThisInitialized","$9a474b7dcd09c5ab$var$_wrapNativeSuper","Class","_cache","has","Wrapper","$9a474b7dcd09c5ab$var$_construct","$9a474b7dcd09c5ab$var$_getPrototypeOf","$9a474b7dcd09c5ab$var$_setPrototypeOf","Parent","$9a474b7dcd09c5ab$var$_isNativeReflectConstruct","$9a474b7dcd09c5ab$var$inspect","$9a474b7dcd09c5ab$var$ERR_INVALID_ARG_TYPE","$9a474b7dcd09c5ab$var$endsWith","$9a474b7dcd09c5ab$var$blue","$9a474b7dcd09c5ab$var$green","$9a474b7dcd09c5ab$var$red","$9a474b7dcd09c5ab$var$white","$9a474b7dcd09c5ab$var$kReadableOperator","strictEqualObject","notStrictEqualObject","notIdentical","$9a474b7dcd09c5ab$var$copyError","source","$9a474b7dcd09c5ab$var$inspectValue","compact","maxArrayLength","Infinity","breakLength","showProxy","sorted","getters","$9a474b7dcd09c5ab$var$AssertionError","_Error","_inspect$custom","$9a474b7dcd09c5ab$var$_inherits","options","$9a474b7dcd09c5ab$var$_classCallCheck","limit","stackTraceLimit","stderr","isTTY","getColorDepth","$9a474b7dcd09c5ab$var$createErrDiff","other","lastPos","end","skipped","actualInspected","actualLines","expectedLines","indicator","inputLength","columns","$9a474b7dcd09c5ab$var$repeat","count","floor","maxCount","maxLines","_actualLines","printedLines","skippedMsg","expectedLine","actualLine","divergingLines","_res","knownOperators","captureStackTrace","$4pa7q","$411c56e62e13ea6c$var$lacksProperEnumerationOrder","assign","letters","$411c56e62e13ea6c$var$assignHasPendingExceptions","preventExtensions","thrower","$dOa0R","$3351589ec22f2476$var$hasSymbols","$3351589ec22f2476$var$toObject","$3351589ec22f2476$var$$push","$3351589ec22f2476$var$$propIsEnumerable","$3351589ec22f2476$var$originalGetSymbols","source1","to","s","from","getSymbols","nextKey","propValue","$a0d7b63dfc6f5323$var$slice","$1ie2q","$a0d7b63dfc6f5323$var$origKeys","$a0d7b63dfc6f5323$var$keysShim","$a0d7b63dfc6f5323$var$originalKeys","shim","$0f125c9239cfced8$var$toStr","isArgs","$115fb06b4e6cce1c$var$keysShim","$115fb06b4e6cce1c$var$has","$115fb06b4e6cce1c$var$toStr","$115fb06b4e6cce1c$var$isArgs","$115fb06b4e6cce1c$var$isEnumerable","$115fb06b4e6cce1c$var$hasDontEnumBug","$115fb06b4e6cce1c$var$hasProtoEnumBug","$115fb06b4e6cce1c$var$dontEnums","$115fb06b4e6cce1c$var$equalsConstructorPrototype","$115fb06b4e6cce1c$var$excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","$115fb06b4e6cce1c$var$hasAutomationEqualityBug","$115fb06b4e6cce1c$var$equalsConstructorPrototypeIfNotBuggy","isArguments","theKeys","skipProto","skipConstructor","$hcnrk","is","$c855bd4e3973b6ef$var$numberIsNaN","$c0f15dcd943db777$var$_slicedToArray","$c0f15dcd943db777$var$_arrayWithHoles","$c0f15dcd943db777$var$_iterableToArrayLimit","u","next","done","return","$c0f15dcd943db777$var$_unsupportedIterableToArray","minLen","$c0f15dcd943db777$var$_arrayLikeToArray","$c0f15dcd943db777$var$_nonIterableRest","arr2","$c0f15dcd943db777$var$_typeof","$c0f15dcd943db777$var$regexFlagsSupported","flags","$c0f15dcd943db777$var$arrayFromSet","$c0f15dcd943db777$var$arrayFromMap","$c0f15dcd943db777$var$objectIs","$c0f15dcd943db777$var$objectGetOwnPropertySymbols","$c0f15dcd943db777$var$numberIsNaN","$c0f15dcd943db777$var$uncurryThis","$c0f15dcd943db777$var$hasOwnProperty","$c0f15dcd943db777$var$propertyIsEnumerable","$c0f15dcd943db777$var$objectToString","$c0f15dcd943db777$require$_require$types","$c0f15dcd943db777$var$isAnyArrayBuffer","$c0f15dcd943db777$var$isArrayBufferView","$c0f15dcd943db777$var$isDate","$c0f15dcd943db777$var$isMap","$c0f15dcd943db777$var$isRegExp","$c0f15dcd943db777$var$isSet","$c0f15dcd943db777$var$isNativeError","$c0f15dcd943db777$var$isBoxedPrimitive","$c0f15dcd943db777$var$isNumberObject","$c0f15dcd943db777$var$isStringObject","$c0f15dcd943db777$var$isBooleanObject","$c0f15dcd943db777$var$isBigIntObject","$c0f15dcd943db777$var$isSymbolObject","$c0f15dcd943db777$var$isFloat32Array","$c0f15dcd943db777$var$isFloat64Array","$c0f15dcd943db777$var$isNonIndex","charCodeAt","$c0f15dcd943db777$var$getOwnNonIndexProperties","$c0f15dcd943db777$var$compare","y","min","$c0f15dcd943db777$var$ONLY_ENUMERABLE","$c0f15dcd943db777$var$innerDeepEqual","val1","val2","memos","val1Tag","keys1","keys2","$c0f15dcd943db777$var$keyCheck","getTime","$c0f15dcd943db777$var$areSimilarFloatArrays","byteLength","buffer","byteOffset","_keys","_keys2","size","buf1","buf2","$c0f15dcd943db777$var$getEnumerables","iterationType","aKeys","bKeys","symbolKeysA","symbolKeysB","_symbolKeysB","position","val2MemoA","val2MemoB","areEq","$c0f15dcd943db777$var$objEquiv","$c0f15dcd943db777$var$setEquiv","memo","aValues","$c0f15dcd943db777$var$setMightHaveLoosePrim","altValue","$c0f15dcd943db777$var$findLooseMatchingPrimitives","bValues","_i","_val","$c0f15dcd943db777$var$setHasEqualElement","$c0f15dcd943db777$var$mapEquiv","aEntries","_aEntries$i","item1","item2","$c0f15dcd943db777$var$mapMightHaveLoosePrim","item","curB","bEntries","_i2","_bEntries$_i","$c0f15dcd943db777$var$mapHasEqualEntry","keysA","delete","setValues","key1","key2","$eh8QP","$2bLwM","$3QoWE","$9ee575a850970206$var$polyfill","getPolyfill","implementation","$a64984d95ac93f0f$var$hasSymbols","$a64984d95ac93f0f$var$toStr","$a64984d95ac93f0f$var$concat","$a64984d95ac93f0f$var$supportsDescriptors","$a64984d95ac93f0f$var$defineProperty","predicate","$a64984d95ac93f0f$var$defineProperties","predicates","supportsDescriptors","polyfill","$k6E7V","$8ZPJ8","$gKbkx","$28112f95a033d6f5$var$polyfill","NaN","$GE7rZ","$00f31ca755459a2b$export$1e71eb4bef00f6b0","$d892378a320191c0$export$2077e0241d6afd3c","$d892378a320191c0$export$837ba5c449269406","h","$d892378a320191c0$export$bcc6e673dfa14d36","$d892378a320191c0$export$ed9bd8dcaeba14f6","$d892378a320191c0$export$dbf961a8d278dbef","$d892378a320191c0$export$aa35ef1f24408ab9","$d892378a320191c0$var$map$1","A","B","C","D","E","F","c","$d892378a320191c0$var$hex","$d892378a320191c0$var$h1","$d892378a320191c0$var$h2","$d892378a320191c0$var$eq","$d892378a320191c0$var$isShort","g","$d892378a320191c0$var$alpha","$d892378a320191c0$var$HUE_RE","$d892378a320191c0$var$hsl2rgbn","$d892378a320191c0$var$hsv2rgbn","$d892378a320191c0$var$hwb2rgbn","w","rgb","$d892378a320191c0$export$b5ba70b240f8f7f","$d892378a320191c0$var$calln","$d892378a320191c0$var$hue","$d892378a320191c0$var$map","Z","Y","X","W","V","U","T","S","R","Q","P","O","N","M","L","K","G","H","I","J","$d892378a320191c0$var$names$1","OiceXe","antiquewEte","aqua","aquamarRe","azuY","beige","bisque","black","blanKedOmond","Xe","XeviTet","bPwn","burlywood","caMtXe","KartYuse","KocTate","cSO","cSnflowerXe","cSnsilk","crimson","cyan","xXe","xcyan","xgTMnPd","xWay","xgYF","xgYy","xkhaki","xmagFta","xTivegYF","xSange","xScEd","xYd","xsOmon","xsHgYF","xUXe","xUWay","xUgYy","xQe","xviTet","dAppRk","dApskyXe","dimWay","dimgYy","dodgerXe","fiYbrick","flSOwEte","foYstWAn","fuKsia","gaRsbSo","ghostwEte","gTd","gTMnPd","Way","gYF","gYFLw","gYy","honeyMw","hotpRk","RdianYd","Rdigo","ivSy","khaki","lavFMr","lavFMrXsh","lawngYF","NmoncEffon","ZXe","ZcSO","Zcyan","ZgTMnPdLw","ZWay","ZgYF","ZgYy","ZpRk","ZsOmon","ZsHgYF","ZskyXe","ZUWay","ZUgYy","ZstAlXe","ZLw","lime","limegYF","lRF","magFta","maPon","VaquamarRe","VXe","VScEd","VpurpN","VsHgYF","VUXe","VsprRggYF","VQe","VviTetYd","midnightXe","mRtcYam","mistyPse","moccasR","navajowEte","navy","Tdlace","Tive","TivedBb","Sange","SangeYd","ScEd","pOegTMnPd","pOegYF","pOeQe","pOeviTetYd","papayawEp","pHKpuff","peru","pRk","plum","powMrXe","purpN","YbeccapurpN","Yd","Psybrown","PyOXe","saddNbPwn","sOmon","sandybPwn","sHgYF","sHshell","siFna","silver","skyXe","UXe","UWay","UgYy","snow","sprRggYF","stAlXe","tan","teO","tEstN","tomato","Qe","viTet","JHt","wEte","wEtesmoke","Lw","LwgYF","$d892378a320191c0$var$RGB_RE","$d892378a320191c0$var$to","pow","$d892378a320191c0$var$from","$d892378a320191c0$var$modHSL","ratio","tmp","$d892378a320191c0$var$clone","$d892378a320191c0$var$fromObject","$d892378a320191c0$export$892596cec99bc70e","valid","_valid","_rgb","rgbString","hexString","hslString","$d892378a320191c0$export$a197af1c58e6260c","mix","color","weight","w2","c1","c2","w1","interpolate","$d892378a320191c0$var$interpolate","rgb1","rgb2","clone","alpha","clearer","greyscale","opaquer","negate","lighten","darken","saturate","desaturate","rotate","deg","$d892378a320191c0$export$625a38b961e8b5e9","$d892378a320191c0$export$b2f06b640faad956","$d892378a320191c0$var$unpack","nk","unpacked","tkeys","transparent","toLowerCase","$d892378a320191c0$export$91aedb20f296e541","m","$d892378a320191c0$export$5e91288c399be4f9","p1","p2","$c4d1694fa24f1a71$export$cf2f7c5792f80b46","$c4d1694fa24f1a71$export$2219238a014317b0","$c4d1694fa24f1a71$export$342063e11d6c3cad","$c4d1694fa24f1a71$export$8b22cf2602fb60ce","$c4d1694fa24f1a71$export$23f2a1d2818174ef","$c4d1694fa24f1a71$export$39b482c5e57630a8","$c4d1694fa24f1a71$export$c4ce752e73470fba","defaultValue","$c4d1694fa24f1a71$export$90a7f3efeed30595","$c4d1694fa24f1a71$export$953cecd6e717a553","dimension","endsWith","$c4d1694fa24f1a71$export$7ccc53e8f1e7dfc5","$c4d1694fa24f1a71$export$3722cfe417b6ed86","$c4d1694fa24f1a71$export$d66501df72047452","loopable","reverse","$c4d1694fa24f1a71$export$995eb9fca571757","a0","a1","ilen","v0","v1","datasetIndex","index","$c4d1694fa24f1a71$export$d377dcb2b61d6c4e","klen","$c4d1694fa24f1a71$var$isValidKey","$c4d1694fa24f1a71$export$667d3bf0c5f83305","tval","sval","$c4d1694fa24f1a71$export$efca4cbe5dd06740","current","sources","merger","$c4d1694fa24f1a71$export$555508cbc6add439","$c4d1694fa24f1a71$export$317a3d46287192d8","$c4d1694fa24f1a71$var$keyResolvers","$c4d1694fa24f1a71$export$2d1720544b23b823","resolver","$c4d1694fa24f1a71$var$_getKeyResolver","$c4d1694fa24f1a71$export$9d0e2d13d04f7070","$c4d1694fa24f1a71$export$a8550f7dbe79f93a","$c4d1694fa24f1a71$export$dda1d9f60106f0e9","$c4d1694fa24f1a71$export$a93c5207d687da10","$c4d1694fa24f1a71$export$ee7c8ad385a60b7b","$c4d1694fa24f1a71$export$56c0d5a1e737357d","PI","$c4d1694fa24f1a71$export$971d5caa766a69d7","$c4d1694fa24f1a71$export$d29e374196577086","$c4d1694fa24f1a71$export$2ec5befb9e6c97d4","POSITIVE_INFINITY","$c4d1694fa24f1a71$export$53c86fa97d611818","$c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd","$c4d1694fa24f1a71$export$39c1cc7c062529d4","$c4d1694fa24f1a71$export$7a0bdf7d4a91ea88","$c4d1694fa24f1a71$export$9f4f30ee63539e24","log10","$c4d1694fa24f1a71$export$2408f22a0fab9ae5","sign","$c4d1694fa24f1a71$export$a05254e7c3aeba6e","epsilon","abs","$c4d1694fa24f1a71$export$a33b77bbdbb8366c","range","roundedRange","round","niceRange","fraction","niceFraction","$c4d1694fa24f1a71$export$d141bba7fdc215a3","$c4d1694fa24f1a71$export$53a70dd1ebbae346","$c4d1694fa24f1a71$export$625550452a3fa3ec","degrees","$c4d1694fa24f1a71$export$23ebac1979863676","$c4d1694fa24f1a71$export$96f57966bedc81b4","centrePoint","anglePoint","distanceFromXCenter","distanceFromYCenter","angle","atan2","distance","sqrt","$c4d1694fa24f1a71$export$158acd800e1ef08b","pt1","pt2","$c4d1694fa24f1a71$export$c18d01048907ea92","$c4d1694fa24f1a71$export$28f7fcd39efa255","$c4d1694fa24f1a71$export$ffb5f4729a158638","sameAngleIsFullCircle","angleToStart","angleToEnd","startToAngle","endToAngle","$c4d1694fa24f1a71$export$25ce5a424b770e84","$c4d1694fa24f1a71$export$3b513254972cfc9c","$c4d1694fa24f1a71$export$2ed0fc6709e59212","table","cmp","mid","hi","lo","$c4d1694fa24f1a71$export$ef35774e6d314e91","ti","$c4d1694fa24f1a71$export$ebd11618f299a286","$c4d1694fa24f1a71$var$arrayEvents","$c4d1694fa24f1a71$export$3b14a55fb2447963","listener","stub","_chartjs","$c4d1694fa24f1a71$export$71511d61b312f219","items","$c4d1694fa24f1a71$export$43caf9889c228507","requestAnimationFrame","$c4d1694fa24f1a71$export$61196ced6d74a310","argsToUse","ticking","$c4d1694fa24f1a71$export$3c2fa207a37baaea","align","$c4d1694fa24f1a71$export$ce26c07117d59d6a","$c4d1694fa24f1a71$export$9d398bebfec1c039","left","right","rtl","$c4d1694fa24f1a71$export$9e5f44173e64f162","meta","points","animationsDisabled","pointCount","_sorted","iScale","_parsed","axis","minDefined","maxDefined","getUserBounds","getPixelForValue","$c4d1694fa24f1a71$export$efccba1c4a2ef57b","xScale","yScale","_scaleRanges","newRanges","xmin","xmax","ymin","ymax","changed","$c4d1694fa24f1a71$var$atEdge","$c4d1694fa24f1a71$var$elasticIn","sin","$c4d1694fa24f1a71$var$elasticOut","$c4d1694fa24f1a71$export$f1e1789686576879","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","cos","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce","$c4d1694fa24f1a71$export$f96d196f7728bb5","$c4d1694fa24f1a71$export$db3b6bfb95261072","$c4d1694fa24f1a71$export$738ab4df8bf92ae9","$c4d1694fa24f1a71$var$numbers","$c4d1694fa24f1a71$var$colors","$c4d1694fa24f1a71$var$intlCache","$c4d1694fa24f1a71$export$ae1af26003f05816","num","locale","$c4d1694fa24f1a71$var$getNumberFormat","cacheKey","formatter","Intl","NumberFormat","$c4d1694fa24f1a71$var$formatters","values","numeric","tickValue","ticks","notation","chart","delta","maxTick","logDelta","numDecimal","minimumFractionDigits","maximumFractionDigits","logarithmic","remain","significand","includes","$c4d1694fa24f1a71$export$91477dc880baac21","formatters","$c4d1694fa24f1a71$export$6559d589eb85fbb6","$c4d1694fa24f1a71$export$2e2af4578d910ddf","$c4d1694fa24f1a71$var$getScope$1","node","$c4d1694fa24f1a71$var$set","root","scope","$c4d1694fa24f1a71$export$4368d992c4eafac0","describe","override","route","targetScope","targetName","scopeObject","targetScopeObject","privateName","local","appliers","_descriptors","_appliers","animation","backgroundColor","borderColor","datasets","devicePixelRatio","context","platform","getDevicePixelRatio","elements","events","font","family","lineHeight","hover","hoverBackgroundColor","hoverBorderColor","hoverColor","indexAxis","interaction","mode","intersect","includeInvisible","maintainAspectRatio","onHover","onClick","parsing","plugins","responsive","scale","scales","showLine","drawActiveElementsOnTop","_scriptable","startsWith","_indexable","_fallback","defaults","delay","duration","easing","loop","properties","numbers","active","resize","show","animations","visible","hide","autoPadding","padding","top","bottom","display","beginAtZero","bounds","clip","grace","grid","lineWidth","drawOnChartArea","drawTicks","tickLength","tickWidth","_ctx","tickColor","border","dash","dashOffset","width","text","minRotation","maxRotation","mirror","textStrokeWidth","textStrokeColor","autoSkip","autoSkipPadding","labelOffset","minor","major","crossAlign","showLabelBackdrop","backdropColor","backdropPadding","$c4d1694fa24f1a71$export$e7c866399fa523f5","data","gc","longest","textWidth","measureText","$c4d1694fa24f1a71$export$78acf4525d8a74c4","pixel","currentDevicePixelRatio","halfWidth","$c4d1694fa24f1a71$export$c9170ad7d4cd7e57","canvas","getContext","save","resetTransform","clearRect","height","restore","$c4d1694fa24f1a71$export$493d36ec626b6698","$c4d1694fa24f1a71$export$24baa2b76016ce0e","xOffset","yOffset","cornerRadius","xOffsetW","yOffsetW","pointStyle","rotation","radius","rad","translate","drawImage","beginPath","ellipse","arc","closePath","moveTo","lineTo","SQRT1_2","rect","borderWidth","stroke","$c4d1694fa24f1a71$export$e7094788287c5e9b","point","area","margin","$c4d1694fa24f1a71$export$8743009a87fcb00f","$c4d1694fa24f1a71$export$3d8c2f653ac9d0b9","$c4d1694fa24f1a71$export$d24c54395ce0c509","previous","flip","midpoint","$c4d1694fa24f1a71$export$6554612db691658e","bezierCurveTo","cp1x","cp2x","cp1y","cp2y","$c4d1694fa24f1a71$export$dc98b0b04f4c7758","lines","strokeWidth","strokeColor","translation","fillStyle","textAlign","textBaseline","backdrop","$c4d1694fa24f1a71$var$drawBackdrop","oldColor","fillRect","strokeStyle","strokeText","maxWidth","fillText","$c4d1694fa24f1a71$var$decorateText","strikethrough","underline","metrics","actualBoundingBoxLeft","actualBoundingBoxRight","actualBoundingBoxAscent","actualBoundingBoxDescent","yDecoration","decorationWidth","$c4d1694fa24f1a71$export$1fbe638ecf81657e","topLeft","bottomLeft","bottomRight","topRight","$c4d1694fa24f1a71$var$LINE_HEIGHT","$c4d1694fa24f1a71$var$FONT_STYLE","$c4d1694fa24f1a71$var$numberOrZero","$c4d1694fa24f1a71$export$21579262ef46735b","objProps","read","$c4d1694fa24f1a71$export$d66dc83d8cfc8dd","$c4d1694fa24f1a71$export$92108d983e8ee699","$c4d1694fa24f1a71$export$a9c23c6ac3fc3eca","$c4d1694fa24f1a71$export$34aec0b863436764","fallback","$c4d1694fa24f1a71$export$8c78c7c36408ea29","matches","$c4d1694fa24f1a71$export$407448d2b89b1813","inputs","info","cacheable","$c4d1694fa24f1a71$export$35e795649ee09318","parentContext","$c4d1694fa24f1a71$export$a9c996f45e5784d0","scopes","prefixes","rootScopes","getTarget","finalRootScopes","$c4d1694fa24f1a71$var$_resolve","cache","_cacheable","_scopes","_rootScopes","_getTarget","deleteProperty","$c4d1694fa24f1a71$var$_cached","$c4d1694fa24f1a71$var$_resolveWithPrefixes","proxy","prefix","$c4d1694fa24f1a71$var$readKey","$c4d1694fa24f1a71$var$needsSubResolver","$c4d1694fa24f1a71$var$createSubResolver","$c4d1694fa24f1a71$var$getKeysFromAllScopes","ownKeys","storage","_storage","$c4d1694fa24f1a71$export$c3950d9923825c02","subProxy","descriptorDefaults","_proxy","_context","_subProxy","_stack","$c4d1694fa24f1a71$export$7910e0436ed8d1de","setContext","$c4d1694fa24f1a71$var$_resolveWithContext","isScriptable","$c4d1694fa24f1a71$var$_resolveScriptable","getValue","$c4d1694fa24f1a71$var$_resolveArray","isIndexable","allKeys","scriptable","indexable","_allKeys","$c4d1694fa24f1a71$var$getScope","parent","parentScopes","allScopes","$c4d1694fa24f1a71$var$addScopesFromKey","$c4d1694fa24f1a71$var$subGetTarget","$c4d1694fa24f1a71$var$addScopes","parentFallback","$c4d1694fa24f1a71$var$resolveKeysFromAllScopes","$c4d1694fa24f1a71$export$4a5767248b18ef41","_parsing","parsed","parse","$c4d1694fa24f1a71$var$EPSILON","EPSILON","$c4d1694fa24f1a71$var$getPoint","skip","$c4d1694fa24f1a71$var$getValueAxis","$c4d1694fa24f1a71$var$capControlPoint","pt","$c4d1694fa24f1a71$export$3a1a48c8f6ef640e","$c4d1694fa24f1a71$export$9bb611d729802a56","domNode","parentNode","host","$c4d1694fa24f1a71$var$parseMaxStyle","styleValue","parentProperty","valueInPixels","$c4d1694fa24f1a71$var$getComputedStyle","element","ownerDocument","defaultView","getComputedStyle","$c4d1694fa24f1a71$var$positions","$c4d1694fa24f1a71$var$getPositionedStyle","suffix","$c4d1694fa24f1a71$var$useOffsetPos","shadowRoot","$c4d1694fa24f1a71$export$df995fae86a55f06","event","borderBox","boxSizing","paddings","borders","box","$c4d1694fa24f1a71$var$getCanvasPosition","touches","offsetX","offsetY","getBoundingClientRect","clientX","clientY","$c4d1694fa24f1a71$var$round1","$c4d1694fa24f1a71$export$f787f51d84a910ad","forceRatio","forceStyle","pixelRatio","deviceHeight","deviceWidth","setTransform","$c4d1694fa24f1a71$export$3466f893ebf79586","passiveSupported","passive","addEventListener","removeEventListener","$c4d1694fa24f1a71$export$b4171a6734a65d42","getPropertyValue","$c4d1694fa24f1a71$export$8a5498727ef6be21","$c4d1694fa24f1a71$export$7a38258bbe170828","$c4d1694fa24f1a71$export$2f6ca3d3b1f80bf5","cp1","cp2","$c4d1694fa24f1a71$export$3d12bd131bb975d1","rectX","setWidth","xPlus","leftForLtr","itemWidth","_itemWidth","$c4d1694fa24f1a71$export$91c6e00c14e7e6fd","direction","getPropertyPriority","setProperty","prevTextDirection","$c4d1694fa24f1a71$export$890c4ad488842ce7","$c4d1694fa24f1a71$var$propertyFn","between","compare","normalize","$c4d1694fa24f1a71$var$normalizeSegment","$c4d1694fa24f1a71$export$9fa96a7d116ea3ce","segment","prevValue","startBound","endBound","$c4d1694fa24f1a71$var$getSegment","inside","subStart","startIsBefore","endIsBefore","shouldStart","shouldStop","$c4d1694fa24f1a71$export$306ddfe3a8403e2","segments","sub","$c4d1694fa24f1a71$var$splitByStyles","segmentOptions","$c4d1694fa24f1a71$var$doSplitByStyles","chartContext","_chart","baseStyle","$c4d1694fa24f1a71$var$readStyle","_datasetIndex","spanGaps","prevStyle","addStyle","st","$c4d1694fa24f1a71$var$styleChanged","replacer","p0","p0DataIndex","p1DataIndex","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","$dfc006ada1995968$export$a424a0aa8f687495","_notify","anims","date","callbacks","numSteps","initial","currentStep","_refresh","_request","_running","_update","now","remaining","_charts","running","draw","_active","_total","tick","_lastDate","_getAnims","charts","complete","progress","listen","acc","_duration","stop","cancel","remove","$dfc006ada1995968$var$transparent","$dfc006ada1995968$var$interpolators","boolean","factor","c0","$dfc006ada1995968$export$c35d437ae5945fcd","update","cfg","currentValue","_target","_prop","elapsed","_start","_loop","_to","_from","_easing","_fn","wait","promises","_promises","resolved","$dfc006ada1995968$export$8ab227dac26677d","configure","config","animationOptions","animatedProps","_properties","option","_animateOptions","newOptions","$dfc006ada1995968$var$resolveTargetOptions","$shared","$animations","_createAnimations","$dfc006ada1995968$var$awaitAll","anim","$dfc006ada1995968$var$scaleClip","allowedOverflow","$dfc006ada1995968$var$getSortedDatasetIndices","filterVisible","metasets","_getSortedDatasetMetas","$dfc006ada1995968$var$applyStack","dsIndex","otherValue","singleMode","$dfc006ada1995968$var$isStacked","stacked","$dfc006ada1995968$var$getLastIndexInStack","vScale","positive","getMatchingVisibleMetas","$dfc006ada1995968$var$updateStacks","controller","_cachedMeta","stacks","_stacks","iAxis","vAxis","indexScale","valueScale","itemStacks","$dfc006ada1995968$var$getOrCreateStack","stackKey","indexValue","subStack","_top","_bottom","visualValues","_visualValues","$dfc006ada1995968$var$getFirstScaleId","$dfc006ada1995968$var$clearStacks","$dfc006ada1995968$var$isDirectUpdateMode","$dfc006ada1995968$var$cloneIfNotShared","cached","shared","$dfc006ada1995968$var$createStack","canStack","hidden","_stacked","$dfc006ada1995968$export$75572ec5c55b4048","initialize","linkScales","addElements","isPluginEnabled","updateIndex","dataset","getDataset","chooseId","xid","xAxisID","yid","yAxisID","rid","rAxisID","iid","iAxisID","vid","vAxisID","getScaleForId","rScale","getMeta","getDatasetMeta","scaleID","_getOtherScale","reset","_destroy","_data","_dataCheck","$dfc006ada1995968$var$convertObjectDataToArray","adata","isExtensible","_syncList","datasetElementType","buildOrUpdateElements","resetNewElements","stackChanged","oldStacked","_resyncElements","scopeKeys","datasetScopeKeys","_type","getOptionScopes","createResolver","_cachedDataOpts","parseArrayData","parseObjectData","parsePrimitiveData","isNotInOrderComparedToPrev","labels","getLabels","singleScale","xAxisKey","yAxisKey","getParsed","getDataElement","applyStack","updateRangeFromParsed","parsedValue","getMinMax","otherScale","NEGATIVE_INFINITY","otherMin","otherMax","$dfc006ada1995968$var$getUserBounds","_skip","getAllParsedValues","getMaxOverflow","getLabelAndValue","label","getLabelForValue","_clip","$dfc006ada1995968$var$defaultClip","disabled","chartArea","_drawStart","_drawCount","getStyle","resolveDatasetElementOptions","resolveDataElementOptions","$context","dataIndex","raw","_resolveElementOptions","dataElementType","elementType","sharing","enableOptionSharing","datasetElementScopeKeys","names","resolveNamedOptions","freeze","_resolveAnimations","transition","datasetAnimationScopeKeys","getSharedOptions","_sharedOptions","includeOptions","sharedOptions","_animationsDisabled","_getSharedOptions","firstOpts","previouslySharedOptions","updateSharedOptions","updateElement","_setStyle","removeHoverStyle","setHoverStyle","_removeDatasetHoverStyle","_setDatasetHoverStyle","numMeta","numData","_insertElements","_removeElements","move","updateElements","removed","_sync","_dataChanges","_onDataPush","_onDataPop","_onDataShift","_onDataSplice","newCount","_onDataUnshift","_objectData","supportsDecimation","$dfc006ada1995968$var$parseValue","entry","$dfc006ada1995968$var$parseFloatBar","startValue","endValue","barStart","barEnd","_custom","$dfc006ada1995968$var$parseArrayOrPrimitive","$dfc006ada1995968$var$isFloatBar","$dfc006ada1995968$var$parseEdge","edge","orig","$dfc006ada1995968$var$startEnd","$dfc006ada1995968$export$e97d5dc64e999004","iAxisKey","vAxisKey","bars","getBasePixel","horizontal","isHorizontal","ruler","_getRuler","vpixels","head","_calculateBarValuePixels","ipixels","_calculateBarIndexPixels","enableBorderRadius","center","$dfc006ada1995968$var$setBorderSkipped","borderSkipped","$dfc006ada1995968$var$setInflateAmount","inflateAmount","_getStacks","grouped","skipNull","_getStackCount","_getStackIndex","pixels","barThickness","$dfc006ada1995968$var$computeMinSampleSize","curr","$dfc006ada1995968$var$getAllScaleValues","$bar","visibleMetas","sort","_length","updateMinAndPrev","getPixelForTick","_startPixel","_endPixel","stackCount","categoryPercentage","barPercentage","baseValue","minBarLength","actualBase","floating","getDataVisibility","startPixel","getPixelForDecimal","endPixel","getValueForPixel","halfGrid","getLineWidthForValue","maxBarThickness","$dfc006ada1995968$var$computeFlexCategoryTraits","percent","chunk","$dfc006ada1995968$var$computeFitCategoryTraits","thickness","stackIndex","rects","_index_","_value_","$dfc006ada1995968$export$19b5c4773f17abe","iPixel","vPixel","$dfc006ada1995968$export$e04603e7d8b77172","_getRotation","_getCircumference","circumference","_getRotationExtents","isDatasetVisible","arcs","spacing","getMaxBorderWidth","getMaxOffset","maxSize","cutout","chartWeight","_getRingWeight","ratioX","ratioY","$dfc006ada1995968$var$getRatioAndOffset","endAngle","startAngle","startX","startY","endX","endY","calcMax","calcMin","maxX","maxY","minX","minY","maxHeight","outerRadius","innerRadius","radiusLength","_getVisibleDatasetWeightTotal","total","calculateTotal","_getRingWeightOffset","_circumference","animateRotate","calculateCircumference","animationOpts","centerX","centerY","animateScale","metaData","borderAlign","hoverBorderWidth","hoverOffset","ringWeightOffset","aspectRatio","legend","generateLabels","fontColor","legendItem","toggleDataVisibility","$dfc006ada1995968$export$3c9b5d28c11cbfd0","_dataset","_decimated","animated","maxGapLength","directUpdate","pointsCount","prevParsed","nullData","firstPoint","lastPoint","updateControlPoints","$dfc006ada1995968$export$2a270b3a0d973c85","_updateRadius","minSize","cutoutPercentage","getVisibleDatasetCount","xCenter","yCenter","datasetStartAngle","getIndexAngle","defaultAngle","countVisibleElements","_computeAngle","getDistanceFromCenterForValue","angleLines","circular","pointLabels","$dfc006ada1995968$export$b21a3f1286706191","$dfc006ada1995968$export$48dbc6ac651bf8be","_fullLoop","pointPosition","getPointPositionForValue","$dfc006ada1995968$export$b2f2bae6713db87","registry","getElement","$dfc006ada1995968$export$a6506504f799c5d5","BarController","BubbleController","DoughnutController","LineController","PieController","PolarAreaController","RadarController","ScatterController","$dfc006ada1995968$var$abstract","$dfc006ada1995968$var$DateAdapterBase","members","formats","diff","startOf","endOf","$dfc006ada1995968$export$f32766ea09ec8bc4","_date","$dfc006ada1995968$var$evaluateInteractionItems","handler","getSortedVisibleDatasetMetas","$dfc006ada1995968$var$binarySearch","metaset","lookupMethod","_reversePixels","el","getRange","$dfc006ada1995968$var$getIntersectItems","useFinalPosition","isPointInArea","inRange","$dfc006ada1995968$var$getNearestItems","$dfc006ada1995968$var$getNearestCartesianItems","distanceMetric","$dfc006ada1995968$var$getDistanceMetricForAxis","useX","useY","deltaX","deltaY","minDistance","getCenterPoint","pointInArea","getProps","$dfc006ada1995968$var$getAxisItems","rangeMethod","intersectsItem","$dfc006ada1995968$export$a13296960cae0384","modes","nearest","$dfc006ada1995968$var$STATIC_POSITIONS","$dfc006ada1995968$var$filterByPosition","$dfc006ada1995968$var$filterDynamicPositionByAxis","$dfc006ada1995968$var$sortByWeight","$dfc006ada1995968$var$getCombinedMax","maxPadding","$dfc006ada1995968$var$updateMaxPadding","boxPadding","$dfc006ada1995968$var$fitBoxes","boxes","params","layout","refit","refitBoxes","$dfc006ada1995968$var$getMargins","positions","same","$dfc006ada1995968$var$updateDims","getPadding","newWidth","outerWidth","newHeight","outerHeight","widthChanged","heightChanged","fullSize","$dfc006ada1995968$var$setBoxDims","$dfc006ada1995968$var$placeBoxes","userPadding","placed","stackWeight","$dfc006ada1995968$export$1ecca0613f5e56d2","addBox","_layers","z","removeBox","layoutItem","minPadding","availableWidth","availableHeight","$dfc006ada1995968$var$buildLayoutBoxes","layoutBoxes","$dfc006ada1995968$var$wrapBoxes","wrap","centerHorizontal","centerVertical","leftAndTop","rightAndBottom","vertical","verticalBoxes","horizontalBoxes","beforeLayout","visibleVerticalBoxCount","vBoxMaxWidth","hBoxMaxHeight","$dfc006ada1995968$var$setLayoutDims","layouts","$dfc006ada1995968$var$buildStacks","$dfc006ada1995968$var$handleMaxPadding","updatePos","change","$dfc006ada1995968$export$7b1aeb87f31f7da8","acquireContext","releaseContext","getMaximumSize","isAttached","updateConfig","$dfc006ada1995968$export$a40a96b24b46cf35","$dfc006ada1995968$var$EXPANDO_KEY","$dfc006ada1995968$var$EVENT_TYPES","touchstart","touchmove","touchend","pointerenter","pointerdown","pointermove","pointerup","pointerleave","pointerout","$dfc006ada1995968$var$isNullOrEmpty","$dfc006ada1995968$var$eventListenerOptions","$dfc006ada1995968$var$removeListener","$dfc006ada1995968$var$nodeListContains","nodeList","contains","$dfc006ada1995968$var$createAttachObserver","observer","MutationObserver","entries","trigger","addedNodes","removedNodes","observe","childList","subtree","$dfc006ada1995968$var$createDetachObserver","$dfc006ada1995968$var$drpListeningCharts","$dfc006ada1995968$var$oldDevicePixelRatio","$dfc006ada1995968$var$onWindowResize","dpr","$dfc006ada1995968$var$createResizeObserver","container","clientWidth","ResizeObserver","contentRect","$dfc006ada1995968$var$releaseObserver","disconnect","$dfc006ada1995968$var$createProxyAndListen","$dfc006ada1995968$var$fromNativeEvent","native","$dfc006ada1995968$var$addListener","$dfc006ada1995968$export$f02da7f882cf6b2e","$dfc006ada1995968$var$initCanvas","renderHeight","getAttribute","renderWidth","displayWidth","displayHeight","removeAttribute","setAttribute","proxies","$proxies","handlers","attach","detach","bbWidth","bbHeight","margins","containerSize","$c4d1694fa24f1a71$var$getContainerSize","containerStyle","containerBorder","containerPadding","clientHeight","maintainHeight","isConnected","$dfc006ada1995968$export$db77ccec0bb4ccac","tooltipPosition","hasValue","final","$dfc006ada1995968$var$skip","newTicks","majorStart","majorEnd","ceil","$dfc006ada1995968$var$reverseAlign","$dfc006ada1995968$var$offsetFromEdge","$dfc006ada1995968$var$getTicksLimit","ticksLength","maxTicksLimit","$dfc006ada1995968$var$sample","numItems","increment","$dfc006ada1995968$var$getTickMarkLength","$dfc006ada1995968$var$getTitleHeight","$dfc006ada1995968$export$d60cfc58d3c358b6","_userMin","_userMax","_suggestedMin","suggestedMin","_suggestedMax","suggestedMax","metas","paddingLeft","paddingTop","paddingRight","paddingBottom","getTicks","xLabels","yLabels","getLabelItems","_labelItems","_computeLabelItems","_dataLimitsCached","beforeUpdate","tickOpts","sampleSize","_margins","_labelSizes","_gridLineItems","beforeSetDimensions","setDimensions","afterSetDimensions","_maxLength","beforeDataLimits","determineDataLimits","afterDataLimits","_range","minmax","keepZero","beforeBuildTicks","buildTicks","afterBuildTicks","samplingEnabled","_convertTicksToLabels","beforeCalculateLabelRotation","calculateLabelRotation","afterCalculateLabelRotation","$dfc006ada1995968$var$autoSkip","determinedMaxTicks","$dfc006ada1995968$var$determineMaxTicks","_tickSize","maxScale","maxChart","ticksLimit","majorIndices","enabled","$dfc006ada1995968$var$getMajorIndices","numMajorIndices","$dfc006ada1995968$var$skipMajors","$dfc006ada1995968$var$calculateSpacing","evenMajorSpacing","$dfc006ada1995968$var$getEvenSpacing","factors","avgMajorSpacing","afterAutoSkip","beforeFit","fit","afterFit","afterUpdate","reversePixels","_alignToPixels","alignToPixels","_callHooks","notifyPlugins","beforeTickToLabelConversion","generateTickLabels","afterTickToLabelConversion","maxLabelDiagonal","numTicks","labelRotation","_isVisible","labelSizes","_getLabelSizes","maxLabelWidth","widest","maxLabelHeight","highest","radians","asin","titleOpts","gridOpts","titleHeight","tickPadding","angleRadians","labelHeight","labelWidth","_calculatePadding","_handleMargins","isRotated","labelsBelowTicks","offsetLeft","offsetRight","isFullSize","_computeLabelSizes","jlen","tickFont","fontString","nestedLabel","_longestTextCache","caches","widths","heights","widestLabelSize","highestLabelSize","_resolveTickFontOptions","gcLen","valueAt","decimal","getDecimalForPixel","getBaseValue","optionTicks","rot","_computeGridLineItems","borderValue","lineValue","alignedLineValue","tx1","ty1","tx2","ty2","x1","y1","x2","y2","tl","borderOpts","axisWidth","axisHalfWidth","alignBorderValue","positionAxisID","step","optsAtIndex","optsAtIndexBorder","lineColor","tickBorderDash","tickBorderDashOffset","$dfc006ada1995968$var$getPixelForGridLine","offsetGridLines","validIndex","_ticksLength","_borderValue","lineCount","textOffset","tickAndPadding","hTickAndPadding","_getXAxisLabelAlignment","_getYAxisLabelAlignment","halfCount","tickTextAlign","labelPadding","_computeLabelArea","drawBackground","findIndex","drawGrid","drawLine","setLineDash","lineDashOffset","drawBorder","lastLineWidth","drawLabels","renderTextOptions","drawTitle","titleX","titleY","$dfc006ada1995968$var$titleArgs","tz","gz","bz","axisID","_maxDigits","fontSize","$dfc006ada1995968$var$TypedRegistry","isForType","parentScope","$dfc006ada1995968$var$registerDefaults","itemDefaults","defaultRoutes","$dfc006ada1995968$var$routeDefaults","routes","propertyParts","sourceName","sourceScope","overrides","unregister","$dfc006ada1995968$export$4bb7493d241fd8a5","_each","addControllers","controllers","addPlugins","addScales","getController","_get","getPlugin","getScale","removeControllers","removeElements","removePlugins","removeScales","typedRegistry","reg","_getRegistryForType","_exec","itemReg","component","camelMethod","_typedRegistries","$dfc006ada1995968$var$PluginService","notify","hook","_init","_createDescriptors","plugin","cancelable","invalidate","_oldCache","_notifyStateChanges","$dfc006ada1995968$var$allPlugins","localIds","$dfc006ada1995968$var$createDescriptors","$dfc006ada1995968$var$pluginOpts","pluginScopeKeys","previousDescriptors","some","$dfc006ada1995968$var$getIndexAxis","datasetDefaults","datasetOptions","$dfc006ada1995968$var$idMatchesAxis","$dfc006ada1995968$var$determineAxis","scaleOptions","$dfc006ada1995968$var$getAxisFromDataset","$dfc006ada1995968$var$initOptions","$dfc006ada1995968$var$mergeScaleConfig","chartDefaults","configScales","chartIndexAxis","scaleConf","$dfc006ada1995968$var$retrieveAxisFromDatasets","boundDs","defaultId","defaultScaleOptions","defaultID","$dfc006ada1995968$var$initData","$dfc006ada1995968$var$keyCache","$dfc006ada1995968$var$keysCached","$dfc006ada1995968$var$cachedKeys","generate","$dfc006ada1995968$var$addIfFound","$dfc006ada1995968$var$Config","_config","clearCache","_scopeCache","clear","_resolverCache","datasetType","additionalOptionScopes","_cachedScopes","mainScope","resetCache","keyLists","chartOptionScopes","subPrefixes","$dfc006ada1995968$var$getResolver","$dfc006ada1995968$var$needContext","$dfc006ada1995968$var$hasFunction","subResolver","resolverCache","$dfc006ada1995968$var$KNOWN_POSITIONS","$dfc006ada1995968$var$positionIsHorizontal","$dfc006ada1995968$var$compare2Level","l1","l2","$dfc006ada1995968$var$onAnimationsComplete","onComplete","$dfc006ada1995968$var$onAnimationProgress","onProgress","$dfc006ada1995968$var$getCanvas","getElementById","$dfc006ada1995968$var$instances","$dfc006ada1995968$var$getChart","$dfc006ada1995968$var$getSizeForArea","field","$dfc006ada1995968$export$acaa6426d77a227e","$dfc006ada1995968$var$invalidatePlugins","_aspectRatio","_options","_initialize","bindEvents","_resizeBeforeDraw","_resize","newSize","newRatio","onResize","attached","_doResize","render","ensureScalesHaveIDs","scalesOptions","axisOptions","buildOrUpdateScales","scaleOpts","updated","isRadial","dposition","dtype","scaleType","scaleClass","hasUpdated","_updateMetasets","_metasets","_destroyDatasetMeta","_sortedMetasets","_removeUnreferencedMetasets","buildOrUpdateControllers","newControllers","order","ControllerClass","_resetElements","animsDisabled","_updateScales","_checkEventBindings","_updateHiddenIndices","_plugins","_minPadding","_updateLayout","_updateDatasets","_lastEvent","_eventHandler","_updateHoverStyles","existingEvents","_listeners","newEvents","_responsiveListeners","unbindEvents","_hiddenIndices","changes","_getUniformDataChanges","$dfc006ada1995968$var$moveNumericKeys","intKey","datasetCount","makeSet","changeSet","noArea","_idx","_updateDataset","layers","_drawDatasets","_drawDataset","useClip","$dfc006ada1995968$var$getDatasetArea","getElementsAtEventForMode","setDatasetVisibility","_updateVisibility","_stop","destroy","toBase64Image","toDataURL","bindUserEvents","bindResponsiveEvents","_add","detached","_remove","updateHoverStyle","getActiveElements","setActiveElements","activeElements","lastActive","pluginId","replay","hoverOptions","deactivated","activated","inChartArea","eventFilter","_handleEvent","lastEvent","_getActiveElements","isClick","userConfig","initialCanvas","existingChart","OffscreenCanvas","resizeDelay","instances","$dfc006ada1995968$var$rThetaToXY","theta","$dfc006ada1995968$var$pathArc","pixelMargin","innerR","spacingOffset","noSpacingOuterRadius","avNogSpacingRadius","noSpacingInnerRadius","beta","angleOffset","outerStart","outerEnd","innerStart","innerEnd","$dfc006ada1995968$var$parseBorderRadius$1","angleDelta","borderRadius","halfThickness","innerLimit","computeOuterLimit","outerArcLimit","outerStartAdjustedRadius","outerEndAdjustedRadius","outerStartAdjustedAngle","outerEndAdjustedAngle","innerStartAdjustedRadius","innerEndAdjustedRadius","innerStartAdjustedAngle","innerEndAdjustedAngle","outerMidAdjustedAngle","pCenter","p4","innerMidAdjustedAngle","p8","outerStartX","outerStartY","outerEndX","outerEndY","$dfc006ada1995968$export$d48203c759d6a1fc","chartX","chartY","rAdjust","betweenAngles","withinRadius","halfAngle","halfRadius","fullCircles","fix","radiusOffset","$dfc006ada1995968$var$drawArc","$dfc006ada1995968$var$drawBorder","inner","lineJoin","$dfc006ada1995968$var$clipArc","angleMargin","$dfc006ada1995968$var$setStyle","lineCap","$dfc006ada1995968$var$lineTo","$dfc006ada1995968$var$pathVars","paramsStart","paramsEnd","segmentStart","segmentEnd","$dfc006ada1995968$var$pathSegment","lineMethod","stepped","tension","cubicInterpolationMode","$dfc006ada1995968$var$fastPathSegment","prevX","lastY","avgX","countX","pointIndex","drawX","truncX","$dfc006ada1995968$var$_getSegmentMethod","useFastPath","$dfc006ada1995968$var$usePath2D","Path2D","$dfc006ada1995968$export$55e463fa7bcd3469","_pointsUpdated","controlPoints","$c4d1694fa24f1a71$export$527e9aa3390079e9","pointBefore","pointCurrent","valueAxis","pointsLen","deltaK","mK","pointAfter","slopeDelta","$c4d1694fa24f1a71$var$monotoneAdjust","alphaK","betaK","tauK","squaredMagnitude","$c4d1694fa24f1a71$var$monotoneCompute","$c4d1694fa24f1a71$export$e171bab687b50e0","middlePoint","afterPoint","d01","d12","s01","s12","fa","fb","capBezierPoints","$c4d1694fa24f1a71$var$capBezierPoints","inArea","inAreaPrev","inAreaNext","_points","_segments","_path","$c4d1694fa24f1a71$var$findStartAndEnd","completeLoop","$c4d1694fa24f1a71$var$solidSegments","_interpolate","interpolated","pathSegment","segmentMethod","path","$dfc006ada1995968$var$draw","$dfc006ada1995968$var$strokePathWithCache","$dfc006ada1995968$var$strokePathDirect","$dfc006ada1995968$var$inRange$1","hitRadius","$dfc006ada1995968$export$bd159b522b230b7a","mouseX","mouseY","inXRange","inYRange","hoverRadius","$dfc006ada1995968$var$getBarBounds","bar","half","$dfc006ada1995968$var$skipOrLimit","$dfc006ada1995968$var$inRange","skipX","skipY","$dfc006ada1995968$var$addNormalRectPath","$dfc006ada1995968$var$inflateRect","amount","refRect","$dfc006ada1995968$export$a16ed71bf4b07672","outer","$dfc006ada1995968$var$boundingRects","$dfc006ada1995968$var$parseBorderWidth","maxW","maxH","$dfc006ada1995968$var$parseBorderRadius","maxR","enableBorder","addRectPath","$dfc006ada1995968$var$hasRadius","$dfc006ada1995968$export$7a5d735b2ab6389d","ArcElement","BarElement","LineElement","PointElement","$dfc006ada1995968$var$BORDER_COLORS","$dfc006ada1995968$var$BACKGROUND_COLORS","$dfc006ada1995968$var$getBorderColor","$dfc006ada1995968$var$getBackgroundColor","$dfc006ada1995968$var$containsColorsDefinitions","$dfc006ada1995968$var$cleanDecimatedDataset","$dfc006ada1995968$var$cleanDecimatedData","$dfc006ada1995968$var$_getBounds","$dfc006ada1995968$var$_findSegmentEnd","$dfc006ada1995968$var$_getEdge","$dfc006ada1995968$var$_createBoundaryLine","boundary","$dfc006ada1995968$var$_pointsFromSegments","linePoints","$dfc006ada1995968$var$_shouldApplyFill","$dfc006ada1995968$var$simpleArc","$dfc006ada1995968$var$_drawfill","$dfc006ada1995968$var$_getTarget","$dfc006ada1995968$var$getLineByIndex","$dfc006ada1995968$var$_buildStackLine","sourcePoints","linesBelow","$dfc006ada1995968$var$getLinesBelow","below","unshift","$dfc006ada1995968$var$addPointsBelow","sourcePoint","postponed","$dfc006ada1995968$var$findPoint","pointValue","firstValue","lastValue","$dfc006ada1995968$var$computeBoundary","$dfc006ada1995968$var$computeCircularBoundary","$dfc006ada1995968$var$computeLinearBoundary","lineOpts","fillOption","above","$dfc006ada1995968$var$doFill","$dfc006ada1995968$var$clipVertical","$dfc006ada1995968$var$fill","clipY","lineLoop","$dfc006ada1995968$var$_segments","tpoints","targetSegments","tgt","subBounds","fillSources","fillSource","src","notShape","$dfc006ada1995968$var$clipBounds","$dfc006ada1995968$var$interpolatedLineTo","targetLoop","interpolatedPoint","$dfc006ada1995968$var$getBoxSize","labelOpts","boxHeight","boxWidth","usePointStyle","pointStyleWidth","itemHeight","$dfc006ada1995968$var$itemsEqual","$dfc006ada1995968$var$Legend","buildLabels","legendItems","labelFont","_computeTitleHeight","_fitRows","_fitCols","hitboxes","legendHitBoxes","lineWidths","totalHeight","row","_itemHeight","columnSizes","heightLimit","totalWidth","currentColWidth","currentColHeight","col","$dfc006ada1995968$var$calculateItemSize","fontLineHeight","legendItemText","$dfc006ada1995968$var$calculateLegendItemHeight","adjustHitBoxes","rtlHelper","hitbox","_draw","cursor","defaultColor","halfFontSize","drawLegendBox","lineDash","drawOptions","SQRT2","yBoxTop","xBoxLeft","textDirection","realX","titleFont","titlePadding","topPaddingPlusHalfFontSize","_getLegendItemAt","hitBox","lh","handleEvent","onLeave","hoveredItem","_hoveredItem","sameItem","_added","doughnutMode","$dfc006ada1995968$var$Title","_padding","textSize","_drawArgs","fontOpts","$dfc006ada1995968$var$map","$dfc006ada1995968$var$positioners","average","eventPosition","nearestElement","tp","$dfc006ada1995968$var$pushOrConcat","toPush","$dfc006ada1995968$var$splitNewlines","$dfc006ada1995968$var$getTooltipSize","tooltip","body","footer","bodyFont","footerFont","titleLineCount","footerLineCount","bodyLineItemCount","combinedBodyLength","bodyItem","before","after","beforeBody","afterBody","titleSpacing","titleMarginBottom","bodyLineHeight","displayColors","bodySpacing","footerMarginTop","footerSpacing","widthPadding","maxLineWidth","$dfc006ada1995968$var$determineAlignment","yAlign","$dfc006ada1995968$var$determineYAlign","xAlign","$dfc006ada1995968$var$determineXAlign","chartWidth","$dfc006ada1995968$var$doesNotFitWithAlign","caret","caretSize","caretPadding","$dfc006ada1995968$var$getBackgroundPoint","alignment","paddingAndSize","$dfc006ada1995968$var$alignX","$dfc006ada1995968$var$alignY","$dfc006ada1995968$var$getAlignedX","$dfc006ada1995968$var$overrideCallbacks","$dfc006ada1995968$var$defaultCallbacks","beforeTitle","tooltipItems","labelCount","afterTitle","beforeLabel","tooltipItem","formattedValue","labelColor","labelTextColor","bodyColor","labelPointStyle","afterLabel","beforeFooter","afterFooter","$dfc006ada1995968$var$invokeCallbackWithFallback","$dfc006ada1995968$var$Tooltip","_cachedAnimations","_tooltipItems","getTitle","getBeforeBody","getBody","bodyItems","scoped","getAfterBody","getFooter","_createItems","labelColors","labelPointStyles","labelTextColors","$dfc006ada1995968$var$createTooltipItem","itemSort","dataPoints","_eventPosition","_size","positionAndSize","backgroundPoint","opacity","caretX","caretY","external","drawCaret","tooltipPoint","caretPosition","getCaretPosition","x3","y3","ptX","ptY","titleAlign","titleColor","_drawColorBox","colorX","rtlColorX","yOffSet","colorY","multiKeyBackground","outerX","innerX","strokeRect","drawBody","textColor","bodyAlign","xLinePadding","fillLineOfText","bodyAlignForCalculation","drawFooter","footerAlign","footerColor","tooltipSize","quadraticCurveTo","_updateAnimationTarget","animX","animY","_willRender","hasTooltipContent","globalAlpha","positionChanged","_positionChanged","_ignoreReplayEvents","$dfc006ada1995968$export$8b3ca321c77fdea6","Colors","forceOverride","_args","chartOptions","colorizer","Decimation","algorithm","beforeElementsUpdate","decimated","xAxis","$dfc006ada1995968$var$getStartAndCountOfVisiblePointsSimplified","threshold","$dfc006ada1995968$var$lttbDecimation","maxAreaPoint","maxArea","nextA","samples","bucketWidth","sampledIndex","endIndex","avgY","avgRangeStart","avgRangeEnd","avgRangeLength","rangeOffs","rangeTo","pointAx","pointAy","$dfc006ada1995968$var$minMaxDecimation","minIndex","maxIndex","startIndex","xMin","xMax","dx","lastIndex","intermediateIndex1","intermediateIndex2","Filler","afterDatasetsUpdate","$dfc006ada1995968$var$_decodeFill","firstCh","$dfc006ada1995968$var$parseFillOption","$filler","$dfc006ada1995968$var$_resolveTarget","propagate","visited","beforeDraw","drawTime","beforeDatasetsDraw","beforeDatasetDraw","Legend","_element","afterEvent","ci","useBorderRadius","SubTitle","Title","$dfc006ada1995968$var$createTitle","titleBlock","Tooltip","positioners","afterInit","afterDraw","$dfc006ada1995968$var$addIfString","addedLabels","$dfc006ada1995968$var$validIndex","$dfc006ada1995968$var$_getLabelForValue","$dfc006ada1995968$export$29e663ba4d09fe7","added","_addedLabels","$dfc006ada1995968$var$findOrAddLabel","lastIndexOf","_valueRange","_startValue","$dfc006ada1995968$var$relativeLabelSize","minSpacing","$dfc006ada1995968$var$LinearScaleBase","handleTickRangeOptions","setMin","setMax","minSign","maxSign","getTickLimit","maxTicks","stepSize","computeTickLimit","numericGeneratorOptions","precision","maxDigits","includeBounds","dataRange","$dfc006ada1995968$var$generateTicks$1","generationOptions","niceMin","niceMax","numSpaces","unit","maxSpaces","rmin","rmax","countDefined","rounded","decimalPlaces","_endValue","$dfc006ada1995968$export$e7f4e5e8656f0b93","$dfc006ada1995968$var$log10Floor","$dfc006ada1995968$var$changeExponent","$dfc006ada1995968$var$isMajor","tickVal","$dfc006ada1995968$var$steps","rangeExp","rangeStep","$dfc006ada1995968$export$85295eaf7cb3ac3e","_zero","$dfc006ada1995968$var$generateTicks","minExp","exp","$dfc006ada1995968$var$startExp","lastTick","$dfc006ada1995968$var$getTickBackdropHeight","$dfc006ada1995968$var$determineLimits","$dfc006ada1995968$var$pathRadiusLine","getPointPosition","$dfc006ada1995968$export$cfafc36d95386d38","drawingArea","_pointLabels","$dfc006ada1995968$var$fitWithPointLabels","limits","valueCount","pointLabelOpts","additionalAngle","centerPointLabels","getPointLabelContext","plFont","arrayOfThings","nestedThing","garbageCollect","hLimits","vLimits","$dfc006ada1995968$var$updateLimits","setCenterPoint","_pointLabelItems","$dfc006ada1995968$var$buildPointLabelItems","itemOpts","extra","$dfc006ada1995968$var$createPointLabelItem","outerDistance","pointLabelPosition","$dfc006ada1995968$var$isNotOverlapped","apexesInArea","leftMovement","rightMovement","topMovement","bottomMovement","angleMultiplier","scalingFactor","getValueForDistanceFromCenter","scaledDistance","pointLabel","distanceFromCenter","getBasePosition","getPointLabelPosition","$dfc006ada1995968$var$drawPointLabels","$dfc006ada1995968$var$drawPointLabelBox","backdropLeft","backdropTop","backdropWidth","backdropHeight","$dfc006ada1995968$var$drawRadiusLine","gridLineOpts","animate","$dfc006ada1995968$var$INTERVALS","millisecond","common","steps","second","minute","hour","day","week","month","quarter","year","$dfc006ada1995968$var$UNITS","$dfc006ada1995968$var$sorter","$dfc006ada1995968$var$parse","adapter","_adapter","parser","isoWeekday","_parseOpts","$dfc006ada1995968$var$determineUnitForAutoTicks","minUnit","capacity","interval","MAX_SAFE_INTEGER","$dfc006ada1995968$var$addTick","timestamps","timestamp","$dfc006ada1995968$var$ticksFromTimestamps","majorUnit","$dfc006ada1995968$var$setMajorTicks","$dfc006ada1995968$export$a894c72689ff3ec","adapters","displayFormats","_normalized","normalized","_applyBounds","_getLabelBounds","getLabelTimestamps","timeOpts","_generate","_unit","_getLabelCapacity","$dfc006ada1995968$var$determineUnitForFormatting","_majorUnit","$dfc006ada1995968$var$determineMajorUnit","initOffsets","offsetAfterAutoskip","getDecimalForValue","_offsets","weekday","hasWeekday","getDataTimestamps","tooltipFormat","datetime","fmt","_tickFormatFunction","minorFormat","majorFormat","offsets","_getLabelSize","ticksOpts","tickLabelWidth","cosRotation","sinRotation","tickFontSize","exampleTime","exampleLabel","$dfc006ada1995968$var$interpolate","prevSource","nextSource","prevTarget","nextTarget","span","$dfc006ada1995968$export$85df64a8eb6dc986","_getTimestampsForTable","_table","buildLookupTable","_minPos","_tableRange","$dfc006ada1995968$export$bcac1c16f1530ec2","CategoryScale","LinearScale","LogarithmicScale","RadialLinearScale","TimeScale","TimeSeriesScale","$c8f95463ff5f043e$var$ownKeys","enumerableOnly","symbols","$c8f95463ff5f043e$var$_objectSpread2","$c8f95463ff5f043e$var$_typeof","$c8f95463ff5f043e$var$_extends","$c8f95463ff5f043e$var$userAgent","pattern","navigator","userAgent","$c8f95463ff5f043e$var$IE11OrLess","$c8f95463ff5f043e$var$Edge","$c8f95463ff5f043e$var$FireFox","$c8f95463ff5f043e$var$Safari","$c8f95463ff5f043e$var$IOS","$c8f95463ff5f043e$var$ChromeForAndroid","$c8f95463ff5f043e$var$captureMode","capture","$c8f95463ff5f043e$var$on","$c8f95463ff5f043e$var$off","$c8f95463ff5f043e$var$matches","selector","msMatchesSelector","webkitMatchesSelector","$c8f95463ff5f043e$var$closest","includeCTX","nodeType","$c8f95463ff5f043e$var$R_SPACE","$c8f95463ff5f043e$var$toggleClass","state","classList","className","$c8f95463ff5f043e$var$css","currentStyle","$c8f95463ff5f043e$var$matrix","selfOnly","appliedTransforms","transform","matrixFn","DOMMatrix","WebKitCSSMatrix","CSSMatrix","MSCSSMatrix","$c8f95463ff5f043e$var$find","tagName","getElementsByTagName","$c8f95463ff5f043e$var$getWindowScrollingElement","scrollingElement","documentElement","$c8f95463ff5f043e$var$getRect","relativeToContainingBlock","relativeToNonStaticParent","undoScale","elRect","innerHeight","innerWidth","containerRect","elMatrix","scaleX","scaleY","$c8f95463ff5f043e$var$getContentRect","$c8f95463ff5f043e$var$isScrolledPast","elSide","parentSide","$c8f95463ff5f043e$var$getParentAutoScrollElement","elSideVal","parentSideVal","$c8f95463ff5f043e$var$getChild","childNum","includeDragEl","currentChild","children","$c8f95463ff5f043e$export$31b3ca70d8f57423","ghost","dragged","draggable","$c8f95463ff5f043e$var$lastChild","lastElementChild","previousElementSibling","$c8f95463ff5f043e$var$index","nodeName","$c8f95463ff5f043e$var$getRelativeScrollOffset","offsetTop","winScroller","scrollLeft","scrollTop","includeSelf","elem","gotSelf","scrollWidth","scrollHeight","elemCSS","overflowX","overflowY","$c8f95463ff5f043e$var$isRectEqual","rect1","rect2","$c8f95463ff5f043e$var$throttle","ms","$c8f95463ff5f043e$var$_throttleTimeout","$c8f95463ff5f043e$var$scrollBy","$c8f95463ff5f043e$var$clone","Polymer","$","jQuery","Zepto","dom","cloneNode","$c8f95463ff5f043e$var$expando","$c8f95463ff5f043e$var$plugins","$c8f95463ff5f043e$var$defaults","initializeByDefault","$c8f95463ff5f043e$var$PluginManager","mount","pluginName","pluginEvent","eventName","sortable","evt","eventCanceled","eventNameGlobal","initializePlugins","initialized","modified","modifyOption","getEventProperties","eventProperties","modifiedValue","optionListeners","$c8f95463ff5f043e$var$_excluded","$c8f95463ff5f043e$var$pluginEvent","_ref","originalEvent","$c8f95463ff5f043e$var$_objectWithoutProperties","excluded","$c8f95463ff5f043e$var$_objectWithoutPropertiesLoose","sourceKeys","sourceSymbolKeys","dragEl","$c8f95463ff5f043e$var$dragEl","parentEl","$c8f95463ff5f043e$var$parentEl","ghostEl","$c8f95463ff5f043e$var$ghostEl","rootEl","$c8f95463ff5f043e$var$rootEl","nextEl","$c8f95463ff5f043e$var$nextEl","lastDownEl","$c8f95463ff5f043e$var$lastDownEl","cloneEl","$c8f95463ff5f043e$var$cloneEl","cloneHidden","$c8f95463ff5f043e$var$cloneHidden","dragStarted","$c8f95463ff5f043e$var$moved","putSortable","$c8f95463ff5f043e$var$putSortable","activeSortable","oldIndex","$c8f95463ff5f043e$var$oldIndex","oldDraggableIndex","$c8f95463ff5f043e$var$oldDraggableIndex","newIndex","$c8f95463ff5f043e$var$newIndex","newDraggableIndex","$c8f95463ff5f043e$var$newDraggableIndex","hideGhostForTarget","$c8f95463ff5f043e$var$_hideGhostForTarget","unhideGhostForTarget","$c8f95463ff5f043e$var$_unhideGhostForTarget","cloneNowHidden","cloneNowShown","dispatchSortableEvent","$c8f95463ff5f043e$var$_dispatchEvent","$c8f95463ff5f043e$var$dispatchEvent","targetEl","toEl","fromEl","extraEventProperties","onName","CustomEvent","createEvent","initEvent","bubbles","pullMode","lastPutMode","allEventProperties","dispatchEvent","$c8f95463ff5f043e$var$activeGroup","$c8f95463ff5f043e$var$tapEvt","$c8f95463ff5f043e$var$touchEvt","$c8f95463ff5f043e$var$lastDx","$c8f95463ff5f043e$var$lastDy","$c8f95463ff5f043e$var$tapDistanceLeft","$c8f95463ff5f043e$var$tapDistanceTop","$c8f95463ff5f043e$var$lastTarget","$c8f95463ff5f043e$var$lastDirection","$c8f95463ff5f043e$var$targetMoveDistance","$c8f95463ff5f043e$var$ghostRelativeParent","$c8f95463ff5f043e$var$awaitingDragStarted","$c8f95463ff5f043e$var$ignoreNextClick","$c8f95463ff5f043e$var$sortables","$c8f95463ff5f043e$var$pastFirstInvertThresh","$c8f95463ff5f043e$var$isCircumstantialInvert","$c8f95463ff5f043e$var$ghostRelativeParentInitialScroll","$c8f95463ff5f043e$var$_silent","$c8f95463ff5f043e$var$savedInputChecked","$c8f95463ff5f043e$var$documentExists","$c8f95463ff5f043e$var$CSSFloatProperty","$c8f95463ff5f043e$var$supportDraggable","createElement","$c8f95463ff5f043e$var$supportCssPointerEvents","cssText","pointerEvents","$c8f95463ff5f043e$var$_detectDirection","elCSS","elWidth","borderLeftWidth","borderRightWidth","child1","child2","firstChildCSS","secondChildCSS","firstChildWidth","marginLeft","marginRight","secondChildWidth","flexDirection","gridTemplateColumns","touchingSideChild2","$c8f95463ff5f043e$var$_dragElInRowColumn","dragRect","targetRect","dragElS1Opp","dragElS2Opp","dragElOppLength","targetS1Opp","targetS2Opp","targetOppLength","$c8f95463ff5f043e$var$_detectNearestEmptySortable","emptyInsertThreshold","insideHorizontally","insideVertically","$c8f95463ff5f043e$var$_prepareGroup","toFn","pull","sameGroup","group","otherGroup","originalGroup","checkPull","checkPut","put","revertClone","preventDefault","stopPropagation","stopImmediatePropagation","$c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent","_onDragOver","$c8f95463ff5f043e$var$_checkOutsideTargetEl","_isOutsideThisEl","animationCallbackId","animationStates","store","handle","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","ghostClass","chosenClass","dragClass","ignore","preventOnFilter","setData","dataTransfer","textContent","dropBubble","dragoverBubble","dataIdAttr","delayOnTouchOnly","touchStartThreshold","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","nativeDraggable","_onTapStart","captureAnimationState","child","fromRect","thisAnimationDuration","childMatrix","addAnimationState","removeAnimationState","$c8f95463ff5f043e$var$indexOfObject","animateAll","animating","animationTime","toRect","prevFromRect","prevToRect","animatingRect","targetMatrix","animationResetTimer","currentRect","translateX","translateY","animatingX","animatingY","forRepaintDummy","offsetWidth","$c8f95463ff5f043e$var$_onMove","willInsertAfter","retVal","onMoveFn","onMove","draggedRect","related","relatedRect","$c8f95463ff5f043e$var$_disableDraggable","$c8f95463ff5f043e$var$_unsilent","$c8f95463ff5f043e$var$_nextTick","$c8f95463ff5f043e$var$_cancelNextTick","_getDirection","touch","pointerType","originalTarget","composedPath","$c8f95463ff5f043e$var$_saveInputCheckedState","checked","button","isContentEditable","criteria","trim","_prepareDragStart","dragStartFn","nextSibling","_lastX","_lastY","_onDrop","_disableDelayedDragEvents","_triggerDragStart","_disableDelayedDrag","_delayedDragTouchMoveHandler","_dragStartTimer","_onTouchMove","_onDragStart","selection","empty","getSelection","removeAllRanges","_dragStarted","_appendGhost","_nulling","_emulateDragOver","elementFromPoint","inserted","ghostMatrix","relativeScrollOffset","$c8f95463ff5f043e$var$PositionGhostAbsolutely","dy","cssMatrix","appendChild","_hideClone","cloneId","insertBefore","_loopId","setInterval","effectAllowed","_dragStartId","revert","isOwner","canSort","fromSortable","completedFired","dragOverEvent","_ignoreWhileAnimating","completed","elLastChild","$c8f95463ff5f043e$var$_ghostIsLast","lastElRect","sortableContentRect","firstElRect","firstChild","sibling","targetBeforeFirstSwap","differentLevel","differentRowCol","side1","scrolledPastTop","scrollBefore","$c8f95463ff5f043e$var$_getSwapDirection","isLastTarget","mouseOnAxis","targetLength","targetS1","targetS2","invert","dragIndex","nextElementSibling","moveVector","insertion","_showClone","_offMoveEvents","_offUpEvents","clearInterval","removeChild","dropEffect","toArray","$c8f95463ff5f043e$var$_generateId","href","sum","useAnimation","closest","querySelectorAll","utils","css","find","extend","dst","throttle","toggleClass","cancelNextTick","detectDirection","getChild","$c8f95463ff5f043e$var$scrollEl","$c8f95463ff5f043e$var$scrollRootEl","$c8f95463ff5f043e$var$lastAutoScrollX","$c8f95463ff5f043e$var$lastAutoScrollY","$c8f95463ff5f043e$var$touchEvt$1","$c8f95463ff5f043e$var$pointerElemChangedInterval","$c8f95463ff5f043e$var$autoScrolls","$c8f95463ff5f043e$var$scrolling","$c8f95463ff5f043e$var$clearAutoScrolls","autoScroll","$c8f95463ff5f043e$var$clearPointerElemChangedInterval","$c8f95463ff5f043e$var$autoScroll","isFallback","scroll","scrollCustomFn","sens","scrollSensitivity","speed","scrollSpeed","scrollThisInstance","scrollFn","layersOut","currentParent","canScrollX","canScrollY","scrollPosX","scrollPosY","vx","vy","layer","scrollOffsetY","scrollOffsetX","bubbleScroll","$c8f95463ff5f043e$var$drop","toSortable","changedTouches","onSpill","$c8f95463ff5f043e$var$Revert","$c8f95463ff5f043e$var$Remove","$918fc77ea978604c$export$1402cba6a733f33a","$a5e7d2d106c3fea1$export$926181dbdeb3ce30","derivatives","dydx","yTemp","h2","h6","xhh","dydxTemp","dydxM","$12561087c4c3e6ef$export$35d34bc0ed591a92","stocksAtT","getFlows","integrator","dragStart","_ref2","_ref3","drop","_ref4","parentSortable","AutoScroll","forceAutoScrollFallback","_handleAutoScroll","_handleFallbackAutoScroll","dragOverCompleted","dragOverBubble","nulling","ogElemScroller","newElem","$ca4792769be6b7d6$export$a1edc412be3e1841","elementObjectToArray","ids","arrayToElementObject","stocksToStockArray","stocks","stockIds","stockArrayToStocks","stockArray","flowsToFlowArray","flows","flowIds","flowArrayToFlows","flowArray","variablesToVariableArray","variables","variableIds","variableArrayToVariables","variableArray","parametersToParameterArray","parameters","parameterIds","parameterArrayToParameters","parameterArray","evaluateFlowPerStock","evaluate","accumulateFlowsPerStock","createFlowEvaluator","stocksArray","flowsPerStock","flowPerStockArray","flowEvaluator","computeFlowsOrIntegrator","newStocksArray","$77c357198c6cf64b$var$step6","flowsAtT","computeFlows","mutableFlowsAtT","stocksIds","elementIds","$995a1f169f5e286f$var$stockIds","$995a1f169f5e286f$var$flowIds","$995a1f169f5e286f$var$variableIds","$995a1f169f5e286f$var$parameterIds","$995a1f169f5e286f$var$CircularEconomyModel","capacityOfNewlyProducedPhones","capacityOfRecycledMaterials","capacityOfRefurbishedPhones","capacityOfRepairedPhones","phonesInUse","supplyOfBrokenPhones","supplyOfDisposedPhones","supplyOfHibernatingPhones","supplyOfNewlyProducedPhones","supplyOfRecycledMaterials","supplyOfRefurbishedPhones","supplyOfRepairedPhones","abandonExcessRate","abandonRate","acquireRate","breakRate","capacityAdjustmentRate","disposeIncentive","disposeRate","durability","landfillIncentive","landfillRate","naturalResourcesIncentive","newPhoneProductionRate","newlyProducedPhoneIncentive","numberOfUsers","phonesPerUserGoal","recycleRate","recyclingIncentive","refurbishmentIncentive","refurbishmentRate","repairIncentive","repairRate","reuseIncentive","phoneGoal","phonesInUseExcess","inflowIncentiveSumForPhonesInUse","demandForPhones","demandForNewlyProducedPhones","demandForRefurbishedPhones","demandForRepairedPhones","demandForReusedPhones","resourceDemand","demandForRecycledMaterials","supplyOfBrokenPhonesForDisposal","supplyOfDisposedPhonesForLandfilling","demandForNaturalResources","supplyOfDisposedPhonesForRecycling","recycleDemand","demandForRefurbishment","repairDemand","supplyOfBrokenPhonesForRepair","abandon","acquireNewlyProduced","acquireRefurbished","acquireRepaired","acquireUsed","capacityOfNewlyProducedPhonesAdjustment","capacityOfRecycledMaterialsAdjustment","capacityOfRefurbishedPhonesAdjustment","disposeBroken","disposeHibernating","goBroken","landfill","produceFromNaturalResources","produceFromRecycledMaterials","recycle","refurbish","repair","repairShopCapcityAdjustment","initialStocks","defaultParameters","$2495d722a6806b18$export$2e2bcd8739ae039","evaluateFlowPerStockWithCache","flowPerStockCache","record","newStocks","model","flowEvaluatorWithCache","newRecord","$c87ac678829b8e5f$exports","$1b7ff3cd61804da8$exports","iteratee","accumulator","initAccum","$1f2a8327a9c6cd40$exports","$22d081411f8ece61$exports","$cbf1cd6f0a53572d$exports","$ee44123cee6ab817$exports","$e5d1c83d06342727$exports","$8ae6ebea7b194487$exports","$5c41b9a5519f3a64$exports","$d6b32571b971a536$var$freeSelf","$d6b32571b971a536$exports","$19ec4e0dcd973343$exports","$80ba2d19709662a3$exports","$f2239ecfa31470ab$exports","$a72fb30b329d5697$exports","$cc11b91eeb6cba09$exports","$cc11b91eeb6cba09$var$objectProto","$cc11b91eeb6cba09$var$hasOwnProperty","$cc11b91eeb6cba09$var$nativeObjectToString","$cc11b91eeb6cba09$var$symToStringTag","unmasked","$34878bff9c6a1b5d$exports","$34878bff9c6a1b5d$var$nativeObjectToString","$34878bff9c6a1b5d$var$objectProto","$a72fb30b329d5697$var$symToStringTag","$12765be2afa50e71$exports","$e5d1c83d06342727$var$INFINITY","$e5d1c83d06342727$var$symbolProto","$e5d1c83d06342727$var$symbolToString","$e5d1c83d06342727$var$baseToString","$1f2a8327a9c6cd40$var$reLatin","$1f2a8327a9c6cd40$var$reComboMark","$31925c2e0b1bffc8$exports","$9589882a1b02d2bd$exports","$9589882a1b02d2bd$var$reAsciiWord","$5f3800a21019ebc5$exports","$5f3800a21019ebc5$var$reHasUnicodeWord","$59413fe1d37c7fe4$exports","$59413fe1d37c7fe4$var$rsAstralRange","$59413fe1d37c7fe4$var$rsDingbatRange","$59413fe1d37c7fe4$var$rsLowerRange","$59413fe1d37c7fe4$var$rsUpperRange","$59413fe1d37c7fe4$var$rsBreakRange","$59413fe1d37c7fe4$var$rsMathOpRange","$59413fe1d37c7fe4$var$rsApos","$59413fe1d37c7fe4$var$rsBreak","$59413fe1d37c7fe4$var$rsLower","$59413fe1d37c7fe4$var$rsMisc","$59413fe1d37c7fe4$var$rsRegional","$59413fe1d37c7fe4$var$rsSurrPair","$59413fe1d37c7fe4$var$rsUpper","$59413fe1d37c7fe4$var$rsMiscLower","$59413fe1d37c7fe4$var$rsOptContrLower","$59413fe1d37c7fe4$var$rsOptContrUpper","$59413fe1d37c7fe4$var$reOptMod","$59413fe1d37c7fe4$var$rsModifier","$59413fe1d37c7fe4$var$rsOptVar","$59413fe1d37c7fe4$var$rsOptJoin","$59413fe1d37c7fe4$var$rsEmoji","$59413fe1d37c7fe4$var$reUnicodeWord","$59413fe1d37c7fe4$var$rsMiscUpper","guard","$08c10a8642478998$var$reApos","$22519adc90afc1c6$export$b6a2e78b63791dfa","uri","clearStyles","_svgDoc_querySelectorAll","response","fetch","status","statusText","URL","svgText","div","innerHTML","svgDoc","querySelector","$853946bed0db7ade$export$99496351b147462","word","$eaf19eafa3312639$exports","getBundleURL","$fee6658e550852f2$var$svgUrl","$fee6658e550852f2$var$mainFlowIds","$fee6658e550852f2$var$flowVizSigns","$fee6658e550852f2$export$2e2bcd8739ae039","updateSvgFlows","deltaMs","flowVizScale","_element_getAttribute","flow","flowVizSign","elementId","svg","SVGPathElement","lastDashOffset","updateSvgStocks","stockVizScale","SVGCircleElement","stock","updateSvg","prepareSvg","createSVGElement","createElementNS","elementsToRemove","labelLayer","supplyLayer","capacityLayer","flowLayer","append","baseElement","baseElementId","SVGGeometryElement","phonesInUseClone","$eeb33a528debb3be$export$3e2b244719956741","readyState","$279b597edf84dcbf$export$2e2bcd8739ae039","i18nKey","$0d00df7a0e9c1179$export$2e2bcd8739ae039","applyTo","callable","$c66a53d1ef21207e$export$2e2bcd8739ae039","createFunction","script","parameterId","wrappedScript","transformedParameters","$157dc5a8c12caacb$var$init","modelSimulator","availableParameterTransformsContainer","HTMLElement","activeParameterTransformsContainer","availableParameterTransforms","updateParameters","parameterTransform","backupParameters","distinctParameters","getDistinctParameters","removeOnSpill","onSort","parameterTransforms","dummyElement","parameterTransformElement","idElement","HTMLInputElement","scriptElement","HTMLTextAreaElement","circularityIndex","circularityIndexElement","userSatisfaction","userSatisfactionElement","visualization","toChartRecord","prepend","initialChartRecord","chartCanvas","stepSimulation","updateIndices","circularityIndexTarget","innerText","toFixed","userSatisfactionTarget","chartRecord","runCheckBox","loopSimulation","lastTimeMs","currentTimeMs","circularEconomy","Animator","requestAnimFrame","interpolators","helpersColor","Animation","effects","Animations","resolveTargetOptions","awaitAll","animator","scaleClip","defaultClip","toClip","getSortedDatasetIndices","convertObjectDataToArray","isStacked","getStackKey","getOrCreateStack","getLastIndexInStack","updateStacks","getFirstScaleId","createDatasetContext","createContext","createDataContext","clearStacks","isDirectUpdateMode","cloneIfNotShared","createStack","DatasetController","valueOrDefault","unlistenArrayEvents","listenArrayEvents","resolveObjectKey","defined","getAllScaleValues","_arrayUnique","computeMinSampleSize","computeFitCategoryTraits","isNullOrUndef","computeFlexCategoryTraits","parseFloatBar","parseValue","parseArrayOrPrimitive","isFloatBar","barSign","borderProps","setBorderSkipped","parseEdge","swap","startEnd","v2","setInflateAmount","getRatioAndOffset","TAU","_angleBetween","HALF_PI","toRadians","toPercentage","maxRadius","toDimension","formatNumber","_getStartAndCountOfVisiblePoints","_scaleRangesChanged","_parseObjectDataRadialScale","abstract","DateAdapterBase","binarySearch","_rlookupByKey","_lookupByKey","evaluateInteractionItems","getDistanceMetricForAxis","getIntersectItems","evaluationFunc","_isPointInArea","getNearestRadialItems","getAngleFromPoint","getNearestCartesianItems","getNearestItems","getAxisItems","getRelativePosition","STATIC_POSITIONS","filterByPosition","filterDynamicPositionByAxis","sortByWeight","wrapBoxes","buildStacks","setLayoutDims","buildLayoutBoxes","getCombinedMax","updateMaxPadding","updateDims","handleMaxPadding","getMargins","marginForPositions","fitBoxes","setBoxDims","placeBoxes","toPadding","each","BasePlatform","BasicPlatform","EXPANDO_KEY","EVENT_TYPES","isNullOrEmpty","initCanvas","readUsedSize","eventListenerOptions","supportsEventListenerOptions","fromNativeEvent","nodeListContains","createAttachObserver","createDetachObserver","drpListeningCharts","oldDevicePixelRatio","onWindowResize","listenDevicePixelRatioChanges","unlistenDevicePixelRatioChanges","createResizeObserver","_getParentNode","throttled","releaseObserver","createProxyAndListen","DomPlatform","_detectPlatform","_isDomSupported","Element","determineMaxTicks","getMajorIndices","skipMajors","calculateSpacing","getEvenSpacing","_factorize","reverseAlign","offsetFromEdge","getTicksLimit","sample","getPixelForGridLine","getTickMarkLength","getTitleHeight","toFont","createScaleContext","createTickContext","_toLeftRightCenter","titleArgs","_alignStartEnd","Scale","finiteOrDefault","_addGrace","_limitValue","toDegrees","_measureText","_int16Range","_alignPixel","clipArea","renderText","unclipArea","TypedRegistry","isIChartComponent","registerDefaults","merge","routeDefaults","Registry","_capitalize","PluginService","callCallback","allPlugins","createDescriptors","getOpts","pluginOpts","getIndexAxis","getAxisFromDefaultScaleID","getDefaultScaleIDFromAxis","idMatchesAxis","axisFromPosition","determineAxis","getAxisFromDataset","retrieveAxisFromDatasets","mergeScaleConfig","mergeIf","initOptions","initData","initConfig","keyCache","keysCached","cachedKeys","addIfFound","Config","getResolver","needContext","_attachContext","_createResolver","hasFunction","KNOWN_POSITIONS","positionIsHorizontal","compare2Level","onAnimationsComplete","onAnimationProgress","getCanvas","getChart","moveNumericKeys","determineLastEvent","getSizeForArea","getDatasetArea","Chart","invalidatePlugins","uid","debounce","retinaScale","clearCanvas","setsEqual","Interaction","_elementsEqual","_isClickEvent","clipArc","toRadiusCorners","_readValueToProps","parseBorderRadius","rThetaToXY","pathArc","adjustedAngle","drawArc","_isBetween","setStyle","getLineMethod","_steppedLineTo","_bezierCurveTo","pathVars","outside","fastPathSegment","_getSegmentMethod","_getInterpolationMethod","_steppedInterpolation","_bezierInterpolation","_pointInLine","strokePathWithCache","strokePathDirect","usePath2D","_updateBezierControlPoints","_computeSegments","_boundSegments","drawPoint","getBarBounds","skipOrLimit","parseBorderWidth","toTRBL","toTRBLCorners","boundingRects","skipBoth","hasRadius","addNormalRectPath","inflateRect","addRoundedRectPath","BORDER_COLORS","BACKGROUND_COLORS","getBorderColor","getBackgroundColor","colorizeDefaultDataset","colorizeDoughnutDataset","colorizePolarAreaDataset","getColorizer","containsColorsDefinitions","containsColorsDefinition","lttbDecimation","minMaxDecimation","cleanDecimatedDataset","cleanDecimatedData","getStartAndCountOfVisiblePointsSimplified","_findSegmentEnd","_getBounds","_boundSegment","_getEdge","_normalizeAngle","_pointsFromSegments","_createBoundaryLine","_shouldApplyFill","_resolveTarget","_decodeFill","parseFillOption","decodeTargetIndex","_getTargetPixel","_getTargetValue","_buildStackLine","getLinesBelow","addPointsBelow","findPoint","simpleArc","getLineByIndex","computeBoundary","computeCircularBoundary","computeLinearBoundary","_drawfill","doFill","clipVertical","clipBounds","interpolatedLineTo","getBoxSize","itemsEqual","calculateItemSize","getRtlAdapter","drawPointLegend","overrideTextDirection","_textX","calculateLegendItemHeight","restoreTextDirection","isListened","calculateItemWidth","calculateItemHeight","createTitle","distanceBetweenPoints","pushOrConcat","splitNewlines","createTooltipItem","getTooltipSize","determineYAlign","doesNotFitWithAlign","determineXAlign","determineAlignment","alignX","alignY","getBackgroundPoint","getAlignedX","getBeforeAfterBodyLines","createTooltipContext","overrideCallbacks","defaultCallbacks","noop","invokeCallbackWithFallback","addIfString","findOrAddLabel","_getLabelForValue","generateTicks","MIN_SPACING","niceNum","almostWhole","almostEquals","_decimalPlaces","relativeLabelSize","LinearScaleBase","_setMinAndMaxByKey","Ticks","log10Floor","changeExponent","isMajor","startExp","getTickBackdropHeight","measureLabelSize","_longestText","determineLimits","fitWithPointLabels","updateLimits","buildPointLabelItems","createPointLabelItem","yForAngle","getTextAlignForAngle","leftForTextAlign","isNotOverlapped","drawPointLabelBox","drawPointLabels","pathRadiusLine","drawRadiusLine","createPointLabelContext","INTERVALS","UNITS","sorter","determineUnitForAutoTicks","determineUnitForFormatting","determineMajorUnit","addTick","_lookup","setMajorTicks","ticksFromTimestamps","_filterBetween","registerables","isNumberFinite","isValidKey","_merger","_mergerIf","_deprecated","keyResolvers","_splitKey","_getKeyResolver","PITAU","INFINITY","RAD_PER_DEG","QUARTER_PI","TWO_THIRDS_PI","isFiniteNumber","radialDistanceFromCenter","_angleDiff","arrayEvents","pixelSize","fontStyle","fontFamily","check","atEdge","elasticIn","elasticOut","isPatternOrGradient","Color","getHoverColor","applyAnimationsDefaults","applyLayoutsDefaults","intlCache","getNumberFormat","calculateDelta","applyScaleDefaults","getScope","Defaults","toFontString","setRenderOpts","decorateText","drawBackdrop","LINE_HEIGHT","FONT_STYLE","toLineHeight","numberOrZero","_resolve","_cached","_resolveWithPrefixes","getKeysFromAllScopes","_resolveWithContext","readKey","needsSubResolver","_resolveScriptable","_resolveArray","createSubResolver","resolveFallback","addScopes","addScopesFromKey","subGetTarget","resolveKeysFromAllScopes","getPoint","getValueAxis","splineCurve","monotoneAdjust","monotoneCompute","splineCurveMonotone","capControlPoint","parseMaxStyle","getPositionedStyle","useOffsetPos","getCanvasPosition","getContainerSize","round1","getRightToLeftAdapter","getLeftToRightAdapter","propertyFn","normalizeSegment","getSegment","findStartAndEnd","solidSegments","splitByStyles","doSplitByStyles","readStyle","styleChanged"],"version":3,"file":"index.7e1ba3ae.js.map"} \ No newline at end of file +{"mappings":"C,A,e2HuXI,EpBrWEC,E,I+BDoB,E,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,S,E,C,E,O,G,E,U,C,E,O,C,C,C,I,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C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AK4B,CAAA,EA3CJ,GA4CxB,EAAwB,SAAS,CAAG,CAAC,EAAG,AAAA,CAAA,AAAmB,IAAnB,CAAmB,EAAK,OAAO,CACrE,GACA,CAAC,CAAC,AACN,EAMgB,GAEd,IAAM,EAAc,EAAc,EAClC,6BAA4B;AAC5B,EAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAG,EAAY,GAAG,CAAC,AAAC,GAAQ,EAAI,KAAK,EAEhE,EAAM,MAAM,GAEZ,EAAc,MAAM,CAAC,EAAS,EAAe,CAAC,CAAE,EAClD,CAEA,IAAI,EAAU,CAAA,EACR,EAAc,SAAS,cAAc,CAAC,OAG5C,eAAe,IACb,EAAU,CAAA,EACV,IAAI,EAAyC,KAE7C,KAAO,EAAY,OAAO,EAAE,CAC1B,4CAA4C;AAC5C,IAAM,EAAgB,MAAM,AAAA,KACtB,EAAU,AAAe,OAAf,EAAsB,EAAI,EAAgB,EAC1D,EAAe,GACf,EAAa,CACf,CACA,EAAU,CAAA,CACZ,OAdA,AAAA,CAAA,EAAA,EAAA,MAAK,AAAL,EAAO,AAAgB,OAAhB,EAAsB,0BAgB7B,EAAY,gBAAgB,CAAC,QAAS,KAC/B,GACH,IAAiB,KAAK,CAAC,AAAC,IACtB,MAAM,CACR,EACJ,GAEA,EAAe,GAEgC,CAC7C,MAAA,EACA,eAAA,EACA,oBAAA,CACF,CAGF,CAQA,OAAO,eAAe,CAAG,AAAA,KAAgB,IAAI,CAAC,G,G,4D","sources":["","node_modules/assert/build/assert.js","node_modules/process/browser.js","node_modules/assert/build/internal/errors.js","node_modules/util/util.js","node_modules/util/support/types.js","node_modules/is-arguments/index.js","node_modules/has-tostringtag/shams.js","node_modules/has-symbols/shams.js","node_modules/call-bind/callBound.js","node_modules/get-intrinsic/index.js","node_modules/has-symbols/index.js","node_modules/has-proto/index.js","node_modules/function-bind/index.js","node_modules/function-bind/implementation.js","node_modules/hasown/index.js","node_modules/call-bind/index.js","node_modules/set-function-length/index.js","node_modules/define-data-property/index.js","node_modules/has-property-descriptors/index.js","node_modules/gopd/index.js","node_modules/is-generator-function/index.js","node_modules/which-typed-array/index.js","node_modules/for-each/index.js","node_modules/is-callable/index.js","node_modules/available-typed-arrays/index.js","node_modules/is-typed-array/index.js","node_modules/util/support/isBufferBrowser.js","node_modules/inherits/inherits_browser.js","node_modules/assert/build/internal/assert/assertion_error.js","node_modules/object.assign/polyfill.js","node_modules/object.assign/implementation.js","node_modules/object-keys/index.js","node_modules/object-keys/isArguments.js","node_modules/object-keys/implementation.js","node_modules/object-is/polyfill.js","node_modules/object-is/implementation.js","node_modules/assert/build/internal/util/comparisons.js","node_modules/object-is/index.js","node_modules/define-properties/index.js","node_modules/object-is/shim.js","node_modules/is-nan/index.js","node_modules/is-nan/implementation.js","node_modules/is-nan/polyfill.js","node_modules/is-nan/shim.js","src/ts/index.ts","node_modules/chart.js/auto/auto.js","node_modules/chart.js/dist/chart.js","node_modules/chart.js/src/core/core.animator.js","node_modules/chart.js/src/core/core.animation.js","node_modules/chart.js/src/core/core.animations.js","node_modules/chart.js/src/core/core.datasetController.js","node_modules/chart.js/src/controllers/controller.bar.js","node_modules/chart.js/src/controllers/controller.bubble.js","node_modules/chart.js/src/controllers/controller.doughnut.js","node_modules/chart.js/src/controllers/controller.line.js","node_modules/chart.js/src/controllers/controller.polarArea.js","node_modules/chart.js/src/controllers/controller.pie.js","node_modules/chart.js/src/controllers/controller.radar.js","node_modules/chart.js/src/controllers/controller.scatter.js","node_modules/chart.js/src/core/core.adapters.ts","node_modules/chart.js/src/core/core.interaction.js","node_modules/chart.js/src/core/core.layouts.js","node_modules/chart.js/src/platform/platform.base.js","node_modules/chart.js/src/platform/platform.basic.js","node_modules/chart.js/src/platform/platform.dom.js","node_modules/chart.js/src/platform/index.js","node_modules/chart.js/src/core/core.element.ts","node_modules/chart.js/src/core/core.scale.autoskip.js","node_modules/chart.js/src/core/core.scale.js","node_modules/chart.js/src/core/core.typedRegistry.js","node_modules/chart.js/src/core/core.registry.js","node_modules/chart.js/src/core/core.plugins.js","node_modules/chart.js/src/core/core.config.js","node_modules/chart.js/src/core/core.controller.js","node_modules/chart.js/src/elements/element.arc.ts","node_modules/chart.js/src/elements/element.line.js","node_modules/chart.js/src/elements/element.point.ts","node_modules/chart.js/src/elements/element.bar.js","node_modules/chart.js/src/plugins/plugin.colors.ts","node_modules/chart.js/src/plugins/plugin.decimation.js","node_modules/chart.js/src/plugins/plugin.filler/filler.segment.js","node_modules/chart.js/src/plugins/plugin.filler/filler.helper.js","node_modules/chart.js/src/plugins/plugin.filler/filler.options.js","node_modules/chart.js/src/plugins/plugin.filler/filler.target.stack.js","node_modules/chart.js/src/plugins/plugin.filler/simpleArc.js","node_modules/chart.js/src/plugins/plugin.filler/filler.target.js","node_modules/chart.js/src/plugins/plugin.filler/filler.drawing.js","node_modules/chart.js/src/plugins/plugin.filler/index.js","node_modules/chart.js/src/plugins/plugin.legend.js","node_modules/chart.js/src/plugins/plugin.title.js","node_modules/chart.js/src/plugins/plugin.subtitle.js","node_modules/chart.js/src/plugins/plugin.tooltip.js","node_modules/chart.js/src/scales/scale.category.js","node_modules/chart.js/src/scales/scale.linearbase.js","node_modules/chart.js/src/scales/scale.linear.js","node_modules/chart.js/src/scales/scale.logarithmic.js","node_modules/chart.js/src/scales/scale.radialLinear.js","node_modules/chart.js/src/scales/scale.time.js","node_modules/chart.js/src/scales/scale.timeseries.js","node_modules/chart.js/src/index.ts","node_modules/@swc/helpers/esm/_define_property.js","node_modules/chart.js/dist/chunks/helpers.segment.js","node_modules/chart.js/src/helpers/helpers.core.ts","node_modules/chart.js/src/helpers/helpers.math.ts","node_modules/chart.js/src/helpers/helpers.collection.ts","node_modules/chart.js/src/helpers/helpers.extras.ts","node_modules/chart.js/src/helpers/helpers.easing.ts","node_modules/chart.js/src/helpers/helpers.color.ts","node_modules/chart.js/src/core/core.animations.defaults.js","node_modules/chart.js/src/core/core.layouts.defaults.js","node_modules/chart.js/src/helpers/helpers.intl.ts","node_modules/chart.js/src/core/core.ticks.js","node_modules/chart.js/src/core/core.scale.defaults.js","node_modules/chart.js/src/core/core.defaults.js","node_modules/chart.js/src/helpers/helpers.canvas.ts","node_modules/chart.js/src/helpers/helpers.options.ts","node_modules/chart.js/src/helpers/helpers.config.ts","node_modules/chart.js/src/helpers/helpers.curve.ts","node_modules/chart.js/src/helpers/helpers.dom.ts","node_modules/chart.js/src/helpers/helpers.interpolation.ts","node_modules/chart.js/src/helpers/helpers.rtl.ts","node_modules/chart.js/src/helpers/helpers.segment.js","node_modules/@kurkle/color/dist/color.esm.js","node_modules/sortablejs/modular/sortable.esm.js","src/ts/util/animation-frame.ts","src/ts/circular-economy-model.ts","src/ts/model.ts","src/ts/box-model/box-model.ts","src/ts/box-model/engine.ts","src/ts/box-model/ode.ts","src/ts/model-simulator.ts","src/ts/visualization.ts","node_modules/lodash/kebabCase.js","node_modules/lodash/_createCompounder.js","node_modules/lodash/_arrayReduce.js","node_modules/lodash/deburr.js","node_modules/lodash/_deburrLetter.js","node_modules/lodash/_basePropertyOf.js","node_modules/lodash/toString.js","node_modules/lodash/_baseToString.js","node_modules/lodash/_Symbol.js","node_modules/lodash/_root.js","node_modules/lodash/_freeGlobal.js","node_modules/lodash/_arrayMap.js","node_modules/lodash/isArray.js","node_modules/lodash/isSymbol.js","node_modules/lodash/_baseGetTag.js","node_modules/lodash/_getRawTag.js","node_modules/lodash/_objectToString.js","node_modules/lodash/isObjectLike.js","node_modules/lodash/words.js","node_modules/lodash/_asciiWords.js","node_modules/lodash/_hasUnicodeWord.js","node_modules/lodash/_unicodeWords.js","src/ts/util/load-svg.ts","src/ts/util/guarded-query-selectors.ts","node_modules/@parcel/runtime-js/lib/runtime-76f357baab7f9b6d.js","src/ts/util/document-ready.ts","src/ts/parameter-transform/scripted-parameter-transform.ts","src/ts/util/is-var-name.ts","src/ts/parameter-transform/function-parameter-transform.ts","src/ts/parameter-transform/parameter-transform.ts"],"sourcesContent":["(function () {\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec7f3\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec7f3\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"cgw1K\", function(module, exports) {\n// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar $2fLxs = parcelRequire(\"2fLxs\");\n\"use strict\";\nfunction $8edfd2951adbea03$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $8edfd2951adbea03$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $8edfd2951adbea03$var$_typeof(o);\n}\nfunction $8edfd2951adbea03$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, $8edfd2951adbea03$var$_toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction $8edfd2951adbea03$var$_createClass(Constructor, protoProps, staticProps) {\n if (protoProps) $8edfd2951adbea03$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $8edfd2951adbea03$var$_defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction $8edfd2951adbea03$var$_toPropertyKey(arg) {\n var key = $8edfd2951adbea03$var$_toPrimitive(arg, \"string\");\n return $8edfd2951adbea03$var$_typeof(key) === \"symbol\" ? key : String(key);\n}\nfunction $8edfd2951adbea03$var$_toPrimitive(input, hint) {\n if ($8edfd2951adbea03$var$_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if ($8edfd2951adbea03$var$_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction $8edfd2951adbea03$var$_classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\n\nvar $fgTSu = parcelRequire(\"fgTSu\");\nvar $8edfd2951adbea03$var$_require$codes = $fgTSu.codes, $8edfd2951adbea03$var$ERR_AMBIGUOUS_ARGUMENT = $8edfd2951adbea03$var$_require$codes.ERR_AMBIGUOUS_ARGUMENT, $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE = $8edfd2951adbea03$var$_require$codes.ERR_INVALID_ARG_TYPE, $8edfd2951adbea03$var$ERR_INVALID_ARG_VALUE = $8edfd2951adbea03$var$_require$codes.ERR_INVALID_ARG_VALUE, $8edfd2951adbea03$var$ERR_INVALID_RETURN_VALUE = $8edfd2951adbea03$var$_require$codes.ERR_INVALID_RETURN_VALUE, $8edfd2951adbea03$var$ERR_MISSING_ARGS = $8edfd2951adbea03$var$_require$codes.ERR_MISSING_ARGS;\n\nvar $7aMwq = parcelRequire(\"7aMwq\");\n\nvar $gQylu = parcelRequire(\"gQylu\");\nvar $8edfd2951adbea03$var$inspect = $gQylu.inspect;\n\nvar $gQylu = parcelRequire(\"gQylu\");\nvar $8edfd2951adbea03$require$_require$types = $gQylu.types;\nvar $8edfd2951adbea03$var$isPromise = $8edfd2951adbea03$require$_require$types.isPromise, $8edfd2951adbea03$var$isRegExp = $8edfd2951adbea03$require$_require$types.isRegExp;\n\nvar $8edfd2951adbea03$var$objectAssign = (parcelRequire(\"8D6gL\"))();\n\nvar $8edfd2951adbea03$var$objectIs = (parcelRequire(\"bxl1N\"))();\n\nvar $8edfd2951adbea03$var$RegExpPrototypeTest = (parcelRequire(\"3e3ab\"))(\"RegExp.prototype.test\");\nvar $8edfd2951adbea03$var$errorCache = new Map();\nvar $8edfd2951adbea03$var$isDeepEqual;\nvar $8edfd2951adbea03$var$isDeepStrictEqual;\nvar $8edfd2951adbea03$var$parseExpressionAt;\nvar $8edfd2951adbea03$var$findNodeAround;\nvar $8edfd2951adbea03$var$decoder;\n\nfunction $8edfd2951adbea03$var$lazyLoadComparison() {\n var comparison = (parcelRequire(\"2DPC6\"));\n $8edfd2951adbea03$var$isDeepEqual = comparison.isDeepEqual;\n $8edfd2951adbea03$var$isDeepStrictEqual = comparison.isDeepStrictEqual;\n}\n// Escape control characters but not \\n and \\t to keep the line breaks and\n// indentation intact.\n// eslint-disable-next-line no-control-regex\nvar $8edfd2951adbea03$var$escapeSequencesRegExp = /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/g;\nvar $8edfd2951adbea03$var$meta = [\n \"\\\\u0000\",\n \"\\\\u0001\",\n \"\\\\u0002\",\n \"\\\\u0003\",\n \"\\\\u0004\",\n \"\\\\u0005\",\n \"\\\\u0006\",\n \"\\\\u0007\",\n \"\\\\b\",\n \"\",\n \"\",\n \"\\\\u000b\",\n \"\\\\f\",\n \"\",\n \"\\\\u000e\",\n \"\\\\u000f\",\n \"\\\\u0010\",\n \"\\\\u0011\",\n \"\\\\u0012\",\n \"\\\\u0013\",\n \"\\\\u0014\",\n \"\\\\u0015\",\n \"\\\\u0016\",\n \"\\\\u0017\",\n \"\\\\u0018\",\n \"\\\\u0019\",\n \"\\\\u001a\",\n \"\\\\u001b\",\n \"\\\\u001c\",\n \"\\\\u001d\",\n \"\\\\u001e\",\n \"\\\\u001f\"\n];\nvar $8edfd2951adbea03$var$escapeFn = function escapeFn(str) {\n return $8edfd2951adbea03$var$meta[str.charCodeAt(0)];\n};\nvar $8edfd2951adbea03$var$warned = false;\n// The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\nvar $8edfd2951adbea03$var$assert = module.exports = $8edfd2951adbea03$var$ok;\nvar $8edfd2951adbea03$var$NO_EXCEPTION_SENTINEL = {};\n// All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\nfunction $8edfd2951adbea03$var$innerFail(obj) {\n if (obj.message instanceof Error) throw obj.message;\n throw new $7aMwq(obj);\n}\nfunction $8edfd2951adbea03$var$fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length;\n var internalMessage;\n if (argsLen === 0) internalMessage = \"Failed\";\n else if (argsLen === 1) {\n message = actual;\n actual = undefined;\n } else {\n if ($8edfd2951adbea03$var$warned === false) {\n $8edfd2951adbea03$var$warned = true;\n var warn = $2fLxs.emitWarning ? $2fLxs.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n if (argsLen === 2) operator = \"!=\";\n }\n if (message instanceof Error) throw message;\n var errArgs = {\n actual: actual,\n expected: expected,\n operator: operator === undefined ? \"fail\" : operator,\n stackStartFn: stackStartFn || $8edfd2951adbea03$var$fail\n };\n if (message !== undefined) errArgs.message = message;\n var err = new $7aMwq(errArgs);\n if (internalMessage) {\n err.message = internalMessage;\n err.generatedMessage = true;\n }\n throw err;\n}\n$8edfd2951adbea03$var$assert.fail = $8edfd2951adbea03$var$fail;\n// The AssertionError is defined in internal/error.\n$8edfd2951adbea03$var$assert.AssertionError = $7aMwq;\nfunction $8edfd2951adbea03$var$innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = false;\n if (argLen === 0) {\n generatedMessage = true;\n message = \"No value argument passed to `assert.ok()`\";\n } else if (message instanceof Error) throw message;\n var err = new $7aMwq({\n actual: value,\n expected: true,\n message: message,\n operator: \"==\",\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\n// Pure assertion tests whether a value is truthy, as determined\n// by !!value.\nfunction $8edfd2951adbea03$var$ok() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];\n $8edfd2951adbea03$var$innerOk.apply(void 0, [\n $8edfd2951adbea03$var$ok,\n args.length\n ].concat(args));\n}\n$8edfd2951adbea03$var$assert.ok = $8edfd2951adbea03$var$ok;\n// The equality assertion tests shallow, coercive equality with ==.\n/* eslint-disable no-restricted-properties */ $8edfd2951adbea03$var$assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n // eslint-disable-next-line eqeqeq\n if (actual != expected) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"==\",\n stackStartFn: equal\n });\n};\n// The non-equality assertion tests for whether two objects are not\n// equal with !=.\n$8edfd2951adbea03$var$assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n // eslint-disable-next-line eqeqeq\n if (actual == expected) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n};\n// The equivalence assertion tests a deep equality relation.\n$8edfd2951adbea03$var$assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($8edfd2951adbea03$var$isDeepEqual === undefined) $8edfd2951adbea03$var$lazyLoadComparison();\n if (!$8edfd2951adbea03$var$isDeepEqual(actual, expected)) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n};\n// The non-equivalence assertion tests for any deep inequality.\n$8edfd2951adbea03$var$assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($8edfd2951adbea03$var$isDeepEqual === undefined) $8edfd2951adbea03$var$lazyLoadComparison();\n if ($8edfd2951adbea03$var$isDeepEqual(actual, expected)) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n};\n/* eslint-enable */ $8edfd2951adbea03$var$assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($8edfd2951adbea03$var$isDeepEqual === undefined) $8edfd2951adbea03$var$lazyLoadComparison();\n if (!$8edfd2951adbea03$var$isDeepStrictEqual(actual, expected)) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n};\n$8edfd2951adbea03$var$assert.notDeepStrictEqual = $8edfd2951adbea03$var$notDeepStrictEqual;\nfunction $8edfd2951adbea03$var$notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($8edfd2951adbea03$var$isDeepEqual === undefined) $8edfd2951adbea03$var$lazyLoadComparison();\n if ($8edfd2951adbea03$var$isDeepStrictEqual(actual, expected)) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: $8edfd2951adbea03$var$notDeepStrictEqual\n });\n}\n$8edfd2951adbea03$var$assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!$8edfd2951adbea03$var$objectIs(actual, expected)) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n};\n$8edfd2951adbea03$var$assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($8edfd2951adbea03$var$objectIs(actual, expected)) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n};\nvar $8edfd2951adbea03$var$Comparison = /*#__PURE__*/ $8edfd2951adbea03$var$_createClass(function Comparison(obj, keys, actual) {\n var _this = this;\n $8edfd2951adbea03$var$_classCallCheck(this, Comparison);\n keys.forEach(function(key) {\n if (key in obj) {\n if (actual !== undefined && typeof actual[key] === \"string\" && $8edfd2951adbea03$var$isRegExp(obj[key]) && $8edfd2951adbea03$var$RegExpPrototypeTest(obj[key], actual[key])) _this[key] = actual[key];\n else _this[key] = obj[key];\n }\n });\n});\nfunction $8edfd2951adbea03$var$compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !$8edfd2951adbea03$var$isDeepStrictEqual(actual[key], expected[key])) {\n if (!message) {\n // Create placeholder objects to create a nice output.\n var a = new $8edfd2951adbea03$var$Comparison(actual, keys);\n var b = new $8edfd2951adbea03$var$Comparison(expected, keys, actual);\n var err = new $7aMwq({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n err.actual = actual;\n err.expected = expected;\n err.operator = fn.name;\n throw err;\n }\n $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n}\nfunction $8edfd2951adbea03$var$expectedException(actual, expected, msg, fn) {\n if (typeof expected !== \"function\") {\n if ($8edfd2951adbea03$var$isRegExp(expected)) return $8edfd2951adbea03$var$RegExpPrototypeTest(expected, actual);\n // assert.doesNotThrow does not accept objects.\n if (arguments.length === 2) throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE(\"expected\", [\n \"Function\",\n \"RegExp\"\n ], expected);\n // Handle primitives properly.\n if ($8edfd2951adbea03$var$_typeof(actual) !== \"object\" || actual === null) {\n var err = new $7aMwq({\n actual: actual,\n expected: expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n err.operator = fn.name;\n throw err;\n }\n var keys = Object.keys(expected);\n // Special handle errors to make sure the name and the message are compared\n // as well.\n if (expected instanceof Error) keys.push(\"name\", \"message\");\n else if (keys.length === 0) throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n if ($8edfd2951adbea03$var$isDeepEqual === undefined) $8edfd2951adbea03$var$lazyLoadComparison();\n keys.forEach(function(key) {\n if (typeof actual[key] === \"string\" && $8edfd2951adbea03$var$isRegExp(expected[key]) && $8edfd2951adbea03$var$RegExpPrototypeTest(expected[key], actual[key])) return;\n $8edfd2951adbea03$var$compareExceptionKey(actual, expected, key, msg, keys, fn);\n });\n return true;\n }\n // Guard instanceof against arrow functions as they don't have a prototype.\n if (expected.prototype !== undefined && actual instanceof expected) return true;\n if (Error.isPrototypeOf(expected)) return false;\n return expected.call({}, actual) === true;\n}\nfunction $8edfd2951adbea03$var$getActual(fn) {\n if (typeof fn !== \"function\") throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return $8edfd2951adbea03$var$NO_EXCEPTION_SENTINEL;\n}\nfunction $8edfd2951adbea03$var$checkIsPromise(obj) {\n // Accept native ES6 promises and promises that are implemented in a similar\n // way. Do not accept thenables that use a function as `obj` and that have no\n // `catch` handler.\n // TODO: thenables are checked up until they have the correct methods,\n // but according to documentation, the `then` method should receive\n // the `fulfill` and `reject` arguments as well or it may be never resolved.\n return $8edfd2951adbea03$var$isPromise(obj) || obj !== null && $8edfd2951adbea03$var$_typeof(obj) === \"object\" && typeof obj.then === \"function\" && typeof obj.catch === \"function\";\n}\nfunction $8edfd2951adbea03$var$waitForActual(promiseFn) {\n return Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn === \"function\") {\n // Return a rejected promise if `promiseFn` throws synchronously.\n resultPromise = promiseFn();\n // Fail in case no promise is returned.\n if (!$8edfd2951adbea03$var$checkIsPromise(resultPromise)) throw new $8edfd2951adbea03$var$ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if ($8edfd2951adbea03$var$checkIsPromise(promiseFn)) resultPromise = promiseFn;\n else throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE(\"promiseFn\", [\n \"Function\",\n \"Promise\"\n ], promiseFn);\n return Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return $8edfd2951adbea03$var$NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n}\nfunction $8edfd2951adbea03$var$expectsError(stackStartFn, actual, error, message) {\n if (typeof error === \"string\") {\n if (arguments.length === 4) throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE(\"error\", [\n \"Object\",\n \"Error\",\n \"Function\",\n \"RegExp\"\n ], error);\n if ($8edfd2951adbea03$var$_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error) throw new $8edfd2951adbea03$var$ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error) throw new $8edfd2951adbea03$var$ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error;\n error = undefined;\n } else if (error != null && $8edfd2951adbea03$var$_typeof(error) !== \"object\" && typeof error !== \"function\") throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE(\"error\", [\n \"Object\",\n \"Error\",\n \"Function\",\n \"RegExp\"\n ], error);\n if (actual === $8edfd2951adbea03$var$NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n if (error && error.name) details += \" (\".concat(error.name, \")\");\n details += message ? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" ? \"rejection\" : \"exception\";\n $8edfd2951adbea03$var$innerFail({\n actual: undefined,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn: stackStartFn\n });\n }\n if (error && !$8edfd2951adbea03$var$expectedException(actual, error, message, stackStartFn)) throw actual;\n}\nfunction $8edfd2951adbea03$var$expectsNoError(stackStartFn, actual, error, message) {\n if (actual === $8edfd2951adbea03$var$NO_EXCEPTION_SENTINEL) return;\n if (typeof error === \"string\") {\n message = error;\n error = undefined;\n }\n if (!error || $8edfd2951adbea03$var$expectedException(actual, error)) {\n var details = message ? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"doesNotReject\" ? \"rejection\" : \"exception\";\n $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, \"\\n\") + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn: stackStartFn\n });\n }\n throw actual;\n}\n$8edfd2951adbea03$var$assert.throws = function throws(promiseFn) {\n for(var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++)args[_key2 - 1] = arguments[_key2];\n $8edfd2951adbea03$var$expectsError.apply(void 0, [\n throws,\n $8edfd2951adbea03$var$getActual(promiseFn)\n ].concat(args));\n};\n$8edfd2951adbea03$var$assert.rejects = function rejects(promiseFn) {\n for(var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++)args[_key3 - 1] = arguments[_key3];\n return $8edfd2951adbea03$var$waitForActual(promiseFn).then(function(result) {\n return $8edfd2951adbea03$var$expectsError.apply(void 0, [\n rejects,\n result\n ].concat(args));\n });\n};\n$8edfd2951adbea03$var$assert.doesNotThrow = function doesNotThrow(fn) {\n for(var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++)args[_key4 - 1] = arguments[_key4];\n $8edfd2951adbea03$var$expectsNoError.apply(void 0, [\n doesNotThrow,\n $8edfd2951adbea03$var$getActual(fn)\n ].concat(args));\n};\n$8edfd2951adbea03$var$assert.doesNotReject = function doesNotReject(fn) {\n for(var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++)args[_key5 - 1] = arguments[_key5];\n return $8edfd2951adbea03$var$waitForActual(fn).then(function(result) {\n return $8edfd2951adbea03$var$expectsNoError.apply(void 0, [\n doesNotReject,\n result\n ].concat(args));\n });\n};\n$8edfd2951adbea03$var$assert.ifError = function ifError(err) {\n if (err !== null && err !== undefined) {\n var message = \"ifError got unwanted exception: \";\n if ($8edfd2951adbea03$var$_typeof(err) === \"object\" && typeof err.message === \"string\") {\n if (err.message.length === 0 && err.constructor) message += err.constructor.name;\n else message += err.message;\n } else message += $8edfd2951adbea03$var$inspect(err);\n var newErr = new $7aMwq({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message: message,\n stackStartFn: ifError\n });\n // Make sure we actually have a stack trace!\n var origStack = err.stack;\n if (typeof origStack === \"string\") {\n // This will remove any duplicated frames from the error frames taken\n // from within `ifError` and add the original error frames to the newly\n // created ones.\n var tmp2 = origStack.split(\"\\n\");\n tmp2.shift();\n // Filter all frames existing in err.stack.\n var tmp1 = newErr.stack.split(\"\\n\");\n for(var i = 0; i < tmp2.length; i++){\n // Find the first occurrence of the frame.\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n // Only keep new frames.\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(\"\\n\"), \"\\n\").concat(tmp2.join(\"\\n\"));\n }\n throw newErr;\n }\n};\n// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a871df3dfb8ea663ef5e1f8f62701ec51384ecb\nfunction $8edfd2951adbea03$var$internalMatch(string, regexp, message, fn, fnName) {\n if (!$8edfd2951adbea03$var$isRegExp(regexp)) throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE(\"regexp\", \"RegExp\", regexp);\n var match = fnName === \"match\";\n if (typeof string !== \"string\" || $8edfd2951adbea03$var$RegExpPrototypeTest(regexp, string) !== match) {\n if (message instanceof Error) throw message;\n var generatedMessage = !message;\n // 'The input was expected to not match the regular expression ' +\n message = message || (typeof string !== \"string\" ? 'The \"string\" argument must be of type string. Received type ' + \"\".concat($8edfd2951adbea03$var$_typeof(string), \" (\").concat($8edfd2951adbea03$var$inspect(string), \")\") : (match ? \"The input did not match the regular expression \" : \"The input was expected to not match the regular expression \") + \"\".concat($8edfd2951adbea03$var$inspect(regexp), \". Input:\\n\\n\").concat($8edfd2951adbea03$var$inspect(string), \"\\n\"));\n var err = new $7aMwq({\n actual: string,\n expected: regexp,\n message: message,\n operator: fnName,\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\n$8edfd2951adbea03$var$assert.match = function match(string, regexp, message) {\n $8edfd2951adbea03$var$internalMatch(string, regexp, message, match, \"match\");\n};\n$8edfd2951adbea03$var$assert.doesNotMatch = function doesNotMatch(string, regexp, message) {\n $8edfd2951adbea03$var$internalMatch(string, regexp, message, doesNotMatch, \"doesNotMatch\");\n};\n// Expose a strict only variant of assert\nfunction $8edfd2951adbea03$var$strict() {\n for(var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++)args[_key6] = arguments[_key6];\n $8edfd2951adbea03$var$innerOk.apply(void 0, [\n $8edfd2951adbea03$var$strict,\n args.length\n ].concat(args));\n}\n$8edfd2951adbea03$var$assert.strict = $8edfd2951adbea03$var$objectAssign($8edfd2951adbea03$var$strict, $8edfd2951adbea03$var$assert, {\n equal: $8edfd2951adbea03$var$assert.strictEqual,\n deepEqual: $8edfd2951adbea03$var$assert.deepStrictEqual,\n notEqual: $8edfd2951adbea03$var$assert.notStrictEqual,\n notDeepEqual: $8edfd2951adbea03$var$assert.notDeepStrictEqual\n});\n$8edfd2951adbea03$var$assert.strict.strict = $8edfd2951adbea03$var$assert.strict;\n\n});\nparcelRegister(\"2fLxs\", function(module, exports) {\n// shim for using process in browser\nvar $1a41dbb141a3c8c6$var$process = module.exports = {};\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\nvar $1a41dbb141a3c8c6$var$cachedSetTimeout;\nvar $1a41dbb141a3c8c6$var$cachedClearTimeout;\nfunction $1a41dbb141a3c8c6$var$defaultSetTimout() {\n throw new Error(\"setTimeout has not been defined\");\n}\nfunction $1a41dbb141a3c8c6$var$defaultClearTimeout() {\n throw new Error(\"clearTimeout has not been defined\");\n}\n(function() {\n try {\n if (typeof setTimeout === \"function\") $1a41dbb141a3c8c6$var$cachedSetTimeout = setTimeout;\n else $1a41dbb141a3c8c6$var$cachedSetTimeout = $1a41dbb141a3c8c6$var$defaultSetTimout;\n } catch (e) {\n $1a41dbb141a3c8c6$var$cachedSetTimeout = $1a41dbb141a3c8c6$var$defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === \"function\") $1a41dbb141a3c8c6$var$cachedClearTimeout = clearTimeout;\n else $1a41dbb141a3c8c6$var$cachedClearTimeout = $1a41dbb141a3c8c6$var$defaultClearTimeout;\n } catch (e) {\n $1a41dbb141a3c8c6$var$cachedClearTimeout = $1a41dbb141a3c8c6$var$defaultClearTimeout;\n }\n})();\nfunction $1a41dbb141a3c8c6$var$runTimeout(fun) {\n if ($1a41dbb141a3c8c6$var$cachedSetTimeout === setTimeout) //normal enviroments in sane situations\n return setTimeout(fun, 0);\n // if setTimeout wasn't available but was latter defined\n if (($1a41dbb141a3c8c6$var$cachedSetTimeout === $1a41dbb141a3c8c6$var$defaultSetTimout || !$1a41dbb141a3c8c6$var$cachedSetTimeout) && setTimeout) {\n $1a41dbb141a3c8c6$var$cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return $1a41dbb141a3c8c6$var$cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return $1a41dbb141a3c8c6$var$cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return $1a41dbb141a3c8c6$var$cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\nfunction $1a41dbb141a3c8c6$var$runClearTimeout(marker) {\n if ($1a41dbb141a3c8c6$var$cachedClearTimeout === clearTimeout) //normal enviroments in sane situations\n return clearTimeout(marker);\n // if clearTimeout wasn't available but was latter defined\n if (($1a41dbb141a3c8c6$var$cachedClearTimeout === $1a41dbb141a3c8c6$var$defaultClearTimeout || !$1a41dbb141a3c8c6$var$cachedClearTimeout) && clearTimeout) {\n $1a41dbb141a3c8c6$var$cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return $1a41dbb141a3c8c6$var$cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return $1a41dbb141a3c8c6$var$cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return $1a41dbb141a3c8c6$var$cachedClearTimeout.call(this, marker);\n }\n }\n}\nvar $1a41dbb141a3c8c6$var$queue = [];\nvar $1a41dbb141a3c8c6$var$draining = false;\nvar $1a41dbb141a3c8c6$var$currentQueue;\nvar $1a41dbb141a3c8c6$var$queueIndex = -1;\nfunction $1a41dbb141a3c8c6$var$cleanUpNextTick() {\n if (!$1a41dbb141a3c8c6$var$draining || !$1a41dbb141a3c8c6$var$currentQueue) return;\n $1a41dbb141a3c8c6$var$draining = false;\n if ($1a41dbb141a3c8c6$var$currentQueue.length) $1a41dbb141a3c8c6$var$queue = $1a41dbb141a3c8c6$var$currentQueue.concat($1a41dbb141a3c8c6$var$queue);\n else $1a41dbb141a3c8c6$var$queueIndex = -1;\n if ($1a41dbb141a3c8c6$var$queue.length) $1a41dbb141a3c8c6$var$drainQueue();\n}\nfunction $1a41dbb141a3c8c6$var$drainQueue() {\n if ($1a41dbb141a3c8c6$var$draining) return;\n var timeout = $1a41dbb141a3c8c6$var$runTimeout($1a41dbb141a3c8c6$var$cleanUpNextTick);\n $1a41dbb141a3c8c6$var$draining = true;\n var len = $1a41dbb141a3c8c6$var$queue.length;\n while(len){\n $1a41dbb141a3c8c6$var$currentQueue = $1a41dbb141a3c8c6$var$queue;\n $1a41dbb141a3c8c6$var$queue = [];\n while(++$1a41dbb141a3c8c6$var$queueIndex < len)if ($1a41dbb141a3c8c6$var$currentQueue) $1a41dbb141a3c8c6$var$currentQueue[$1a41dbb141a3c8c6$var$queueIndex].run();\n $1a41dbb141a3c8c6$var$queueIndex = -1;\n len = $1a41dbb141a3c8c6$var$queue.length;\n }\n $1a41dbb141a3c8c6$var$currentQueue = null;\n $1a41dbb141a3c8c6$var$draining = false;\n $1a41dbb141a3c8c6$var$runClearTimeout(timeout);\n}\n$1a41dbb141a3c8c6$var$process.nextTick = function(fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) for(var i = 1; i < arguments.length; i++)args[i - 1] = arguments[i];\n $1a41dbb141a3c8c6$var$queue.push(new $1a41dbb141a3c8c6$var$Item(fun, args));\n if ($1a41dbb141a3c8c6$var$queue.length === 1 && !$1a41dbb141a3c8c6$var$draining) $1a41dbb141a3c8c6$var$runTimeout($1a41dbb141a3c8c6$var$drainQueue);\n};\n// v8 likes predictible objects\nfunction $1a41dbb141a3c8c6$var$Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\n$1a41dbb141a3c8c6$var$Item.prototype.run = function() {\n this.fun.apply(null, this.array);\n};\n$1a41dbb141a3c8c6$var$process.title = \"browser\";\n$1a41dbb141a3c8c6$var$process.browser = true;\n$1a41dbb141a3c8c6$var$process.env = {};\n$1a41dbb141a3c8c6$var$process.argv = [];\n$1a41dbb141a3c8c6$var$process.version = \"\"; // empty string to avoid regexp issues\n$1a41dbb141a3c8c6$var$process.versions = {};\nfunction $1a41dbb141a3c8c6$var$noop() {}\n$1a41dbb141a3c8c6$var$process.on = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.addListener = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.once = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.off = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.removeListener = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.removeAllListeners = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.emit = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.prependListener = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.prependOnceListener = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.listeners = function(name) {\n return [];\n};\n$1a41dbb141a3c8c6$var$process.binding = function(name) {\n throw new Error(\"process.binding is not supported\");\n};\n$1a41dbb141a3c8c6$var$process.cwd = function() {\n return \"/\";\n};\n$1a41dbb141a3c8c6$var$process.chdir = function(dir) {\n throw new Error(\"process.chdir is not supported\");\n};\n$1a41dbb141a3c8c6$var$process.umask = function() {\n return 0;\n};\n\n});\n\nparcelRegister(\"fgTSu\", function(module, exports) {\n\n$parcel$export(module.exports, \"codes\", function () { return $b1e3b1d2b38bd4b2$export$e45cb6485273080e; }, function (v) { return $b1e3b1d2b38bd4b2$export$e45cb6485273080e = v; });\n// Currently in sync with Node.js lib/internal/errors.js\n// https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f\n/* eslint node-core/documented-errors: \"error\" */ /* eslint node-core/alphabetize-errors: \"error\" */ /* eslint node-core/prefer-util-format-errors: \"error\" */ var $b1e3b1d2b38bd4b2$export$e45cb6485273080e;\n\"use strict\";\n// The whole point behind this internal module is to allow Node.js to no\n// longer be forced to treat every error message change as a semver-major\n// change. The NodeError classes here all expose a `code` property whose\n// value statically and permanently identifies the error. While the error\n// message may change, the code should not.\nfunction $b1e3b1d2b38bd4b2$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $b1e3b1d2b38bd4b2$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $b1e3b1d2b38bd4b2$var$_typeof(o);\n}\nfunction $b1e3b1d2b38bd4b2$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, $b1e3b1d2b38bd4b2$var$_toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction $b1e3b1d2b38bd4b2$var$_createClass(Constructor, protoProps, staticProps) {\n if (protoProps) $b1e3b1d2b38bd4b2$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $b1e3b1d2b38bd4b2$var$_defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction $b1e3b1d2b38bd4b2$var$_toPropertyKey(arg) {\n var key = $b1e3b1d2b38bd4b2$var$_toPrimitive(arg, \"string\");\n return $b1e3b1d2b38bd4b2$var$_typeof(key) === \"symbol\" ? key : String(key);\n}\nfunction $b1e3b1d2b38bd4b2$var$_toPrimitive(input, hint) {\n if ($b1e3b1d2b38bd4b2$var$_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if ($b1e3b1d2b38bd4b2$var$_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction $b1e3b1d2b38bd4b2$var$_classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction $b1e3b1d2b38bd4b2$var$_inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) throw new TypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) $b1e3b1d2b38bd4b2$var$_setPrototypeOf(subClass, superClass);\n}\nfunction $b1e3b1d2b38bd4b2$var$_setPrototypeOf(o, p) {\n $b1e3b1d2b38bd4b2$var$_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return $b1e3b1d2b38bd4b2$var$_setPrototypeOf(o, p);\n}\nfunction $b1e3b1d2b38bd4b2$var$_createSuper(Derived) {\n var hasNativeReflectConstruct = $b1e3b1d2b38bd4b2$var$_isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = $b1e3b1d2b38bd4b2$var$_getPrototypeOf(Derived), result;\n if (hasNativeReflectConstruct) {\n var NewTarget = $b1e3b1d2b38bd4b2$var$_getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else result = Super.apply(this, arguments);\n return $b1e3b1d2b38bd4b2$var$_possibleConstructorReturn(this, result);\n };\n}\nfunction $b1e3b1d2b38bd4b2$var$_possibleConstructorReturn(self, call) {\n if (call && ($b1e3b1d2b38bd4b2$var$_typeof(call) === \"object\" || typeof call === \"function\")) return call;\n else if (call !== void 0) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return $b1e3b1d2b38bd4b2$var$_assertThisInitialized(self);\n}\nfunction $b1e3b1d2b38bd4b2$var$_assertThisInitialized(self) {\n if (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n}\nfunction $b1e3b1d2b38bd4b2$var$_isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n}\nfunction $b1e3b1d2b38bd4b2$var$_getPrototypeOf(o) {\n $b1e3b1d2b38bd4b2$var$_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return $b1e3b1d2b38bd4b2$var$_getPrototypeOf(o);\n}\nvar $b1e3b1d2b38bd4b2$var$codes = {};\n// Lazy loaded\nvar $b1e3b1d2b38bd4b2$var$assert;\nvar $b1e3b1d2b38bd4b2$var$util;\nfunction $b1e3b1d2b38bd4b2$var$createErrorType(code, message, Base) {\n if (!Base) Base = Error;\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === \"string\") return message;\n else return message(arg1, arg2, arg3);\n }\n var NodeError = /*#__PURE__*/ function(_Base) {\n $b1e3b1d2b38bd4b2$var$_inherits(NodeError, _Base);\n var _super = $b1e3b1d2b38bd4b2$var$_createSuper(NodeError);\n function NodeError(arg1, arg2, arg3) {\n var _this;\n $b1e3b1d2b38bd4b2$var$_classCallCheck(this, NodeError);\n _this = _super.call(this, getMessage(arg1, arg2, arg3));\n _this.code = code;\n return _this;\n }\n return $b1e3b1d2b38bd4b2$var$_createClass(NodeError);\n }(Base);\n $b1e3b1d2b38bd4b2$var$codes[code] = NodeError;\n}\n// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\nfunction $b1e3b1d2b38bd4b2$var$oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function(i) {\n return String(i);\n });\n if (len > 2) return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1];\n else if (len === 2) return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n else return \"of \".concat(thing, \" \").concat(expected[0]);\n } else return \"of \".concat(thing, \" \").concat(String(expected));\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\nfunction $b1e3b1d2b38bd4b2$var$startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction $b1e3b1d2b38bd4b2$var$endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) this_len = str.length;\n return str.substring(this_len - search.length, this_len) === search;\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\nfunction $b1e3b1d2b38bd4b2$var$includes(str, search, start) {\n if (typeof start !== \"number\") start = 0;\n if (start + search.length > str.length) return false;\n else return str.indexOf(search, start) !== -1;\n}\n$b1e3b1d2b38bd4b2$var$createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError);\n\n$b1e3b1d2b38bd4b2$var$createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n if ($b1e3b1d2b38bd4b2$var$assert === undefined) $b1e3b1d2b38bd4b2$var$assert = (parcelRequire(\"cgw1K\"));\n $b1e3b1d2b38bd4b2$var$assert(typeof name === \"string\", \"'name' must be a string\");\n // determiner: 'must be' or 'must not be'\n var determiner;\n if (typeof expected === \"string\" && $b1e3b1d2b38bd4b2$var$startsWith(expected, \"not \")) {\n determiner = \"must not be\";\n expected = expected.replace(/^not /, \"\");\n } else determiner = \"must be\";\n var msg;\n if ($b1e3b1d2b38bd4b2$var$endsWith(name, \" argument\")) // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat($b1e3b1d2b38bd4b2$var$oneOf(expected, \"type\"));\n else {\n var type = $b1e3b1d2b38bd4b2$var$includes(name, \".\") ? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat($b1e3b1d2b38bd4b2$var$oneOf(expected, \"type\"));\n }\n // TODO(BridgeAR): Improve the output by showing `null` and similar.\n msg += \". Received type \".concat($b1e3b1d2b38bd4b2$var$_typeof(actual));\n return msg;\n}, TypeError);\n\n$b1e3b1d2b38bd4b2$var$createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"is invalid\";\n if ($b1e3b1d2b38bd4b2$var$util === undefined) $b1e3b1d2b38bd4b2$var$util = (parcelRequire(\"gQylu\"));\n var inspected = $b1e3b1d2b38bd4b2$var$util.inspect(value);\n if (inspected.length > 128) inspected = \"\".concat(inspected.slice(0, 128), \"...\");\n return \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n}, TypeError, RangeError);\n$b1e3b1d2b38bd4b2$var$createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n if (value && value.constructor && value.constructor.name) type = \"instance of \".concat(value.constructor.name);\n else type = \"type \".concat($b1e3b1d2b38bd4b2$var$_typeof(value));\n return \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n}, TypeError);\n\n$b1e3b1d2b38bd4b2$var$createErrorType(\"ERR_MISSING_ARGS\", function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];\n if ($b1e3b1d2b38bd4b2$var$assert === undefined) $b1e3b1d2b38bd4b2$var$assert = (parcelRequire(\"cgw1K\"));\n $b1e3b1d2b38bd4b2$var$assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \";\n var len = args.length;\n args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n });\n switch(len){\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \");\n msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n}, TypeError);\n$b1e3b1d2b38bd4b2$export$e45cb6485273080e = $b1e3b1d2b38bd4b2$var$codes;\n\n});\nparcelRegister(\"gQylu\", function(module, exports) {\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar $2fLxs = parcelRequire(\"2fLxs\");\nvar $c43c250226d47bfa$var$getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for(var i = 0; i < keys.length; i++)descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n return descriptors;\n};\nvar $c43c250226d47bfa$var$formatRegExp = /%[sdj%]/g;\nmodule.exports.format = function(f) {\n if (!$c43c250226d47bfa$var$isString(f)) {\n var objects = [];\n for(var i = 0; i < arguments.length; i++)objects.push($c43c250226d47bfa$var$inspect(arguments[i]));\n return objects.join(\" \");\n }\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace($c43c250226d47bfa$var$formatRegExp, function(x) {\n if (x === \"%%\") return \"%\";\n if (i >= len) return x;\n switch(x){\n case \"%s\":\n return String(args[i++]);\n case \"%d\":\n return Number(args[i++]);\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return \"[Circular]\";\n }\n default:\n return x;\n }\n });\n for(var x = args[i]; i < len; x = args[++i])if ($c43c250226d47bfa$var$isNull(x) || !$c43c250226d47bfa$var$isObject(x)) str += \" \" + x;\n else str += \" \" + $c43c250226d47bfa$var$inspect(x);\n return str;\n};\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nmodule.exports.deprecate = function(fn, msg) {\n if (typeof $2fLxs !== \"undefined\" && $2fLxs.noDeprecation === true) return fn;\n // Allow for deprecating things in the process of starting up.\n if (typeof $2fLxs === \"undefined\") return function() {\n return module.exports.deprecate(fn, msg).apply(this, arguments);\n };\n var warned = false;\n function deprecated() {\n if (!warned) {\n if ($2fLxs.throwDeprecation) throw new Error(msg);\n else if ($2fLxs.traceDeprecation) console.trace(msg);\n else console.error(msg);\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n return deprecated;\n};\nvar $c43c250226d47bfa$var$debugs = {};\nvar $c43c250226d47bfa$var$debugEnvRegex = /^$/;\nvar $c43c250226d47bfa$var$debugEnv;\nmodule.exports.debuglog = function(set) {\n set = set.toUpperCase();\n if (!$c43c250226d47bfa$var$debugs[set]) {\n if ($c43c250226d47bfa$var$debugEnvRegex.test(set)) {\n var pid = $2fLxs.pid;\n $c43c250226d47bfa$var$debugs[set] = function() {\n var msg = module.exports.format.apply(module.exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else $c43c250226d47bfa$var$debugs[set] = function() {};\n }\n return $c43c250226d47bfa$var$debugs[set];\n};\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */ /* legacy: obj, showHidden, depth, colors*/ function $c43c250226d47bfa$var$inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: $c43c250226d47bfa$var$stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if ($c43c250226d47bfa$var$isBoolean(opts)) // legacy...\n ctx.showHidden = opts;\n else if (opts) // got an \"options\" object\n module.exports._extend(ctx, opts);\n // set default options\n if ($c43c250226d47bfa$var$isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if ($c43c250226d47bfa$var$isUndefined(ctx.depth)) ctx.depth = 2;\n if ($c43c250226d47bfa$var$isUndefined(ctx.colors)) ctx.colors = false;\n if ($c43c250226d47bfa$var$isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = $c43c250226d47bfa$var$stylizeWithColor;\n return $c43c250226d47bfa$var$formatValue(ctx, obj, ctx.depth);\n}\nmodule.exports.inspect = $c43c250226d47bfa$var$inspect;\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\n$c43c250226d47bfa$var$inspect.colors = {\n \"bold\": [\n 1,\n 22\n ],\n \"italic\": [\n 3,\n 23\n ],\n \"underline\": [\n 4,\n 24\n ],\n \"inverse\": [\n 7,\n 27\n ],\n \"white\": [\n 37,\n 39\n ],\n \"grey\": [\n 90,\n 39\n ],\n \"black\": [\n 30,\n 39\n ],\n \"blue\": [\n 34,\n 39\n ],\n \"cyan\": [\n 36,\n 39\n ],\n \"green\": [\n 32,\n 39\n ],\n \"magenta\": [\n 35,\n 39\n ],\n \"red\": [\n 31,\n 39\n ],\n \"yellow\": [\n 33,\n 39\n ]\n};\n// Don't use 'blue' not visible on cmd.exe\n$c43c250226d47bfa$var$inspect.styles = {\n \"special\": \"cyan\",\n \"number\": \"yellow\",\n \"boolean\": \"yellow\",\n \"undefined\": \"grey\",\n \"null\": \"bold\",\n \"string\": \"green\",\n \"date\": \"magenta\",\n // \"name\": intentionally not styling\n \"regexp\": \"red\"\n};\nfunction $c43c250226d47bfa$var$stylizeWithColor(str, styleType) {\n var style = $c43c250226d47bfa$var$inspect.styles[styleType];\n if (style) return \"\\x1b[\" + $c43c250226d47bfa$var$inspect.colors[style][0] + \"m\" + str + \"\\x1b[\" + $c43c250226d47bfa$var$inspect.colors[style][1] + \"m\";\n else return str;\n}\nfunction $c43c250226d47bfa$var$stylizeNoColor(str, styleType) {\n return str;\n}\nfunction $c43c250226d47bfa$var$arrayToHash(array) {\n var hash = {};\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n return hash;\n}\nfunction $c43c250226d47bfa$var$formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect && value && $c43c250226d47bfa$var$isFunction(value.inspect) && // Filter out the util module, it's inspect function is special\n value.inspect !== module.exports.inspect && // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!$c43c250226d47bfa$var$isString(ret)) ret = $c43c250226d47bfa$var$formatValue(ctx, ret, recurseTimes);\n return ret;\n }\n // Primitive types cannot have properties\n var primitive = $c43c250226d47bfa$var$formatPrimitive(ctx, value);\n if (primitive) return primitive;\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = $c43c250226d47bfa$var$arrayToHash(keys);\n if (ctx.showHidden) keys = Object.getOwnPropertyNames(value);\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if ($c43c250226d47bfa$var$isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0)) return $c43c250226d47bfa$var$formatError(value);\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if ($c43c250226d47bfa$var$isFunction(value)) {\n var name = value.name ? \": \" + value.name : \"\";\n return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n }\n if ($c43c250226d47bfa$var$isRegExp(value)) return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n if ($c43c250226d47bfa$var$isDate(value)) return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n if ($c43c250226d47bfa$var$isError(value)) return $c43c250226d47bfa$var$formatError(value);\n }\n var base = \"\", array = false, braces = [\n \"{\",\n \"}\"\n ];\n // Make Array say that they are Array\n if ($c43c250226d47bfa$var$isArray(value)) {\n array = true;\n braces = [\n \"[\",\n \"]\"\n ];\n }\n // Make functions say that they are functions\n if ($c43c250226d47bfa$var$isFunction(value)) {\n var n = value.name ? \": \" + value.name : \"\";\n base = \" [Function\" + n + \"]\";\n }\n // Make RegExps say that they are RegExps\n if ($c43c250226d47bfa$var$isRegExp(value)) base = \" \" + RegExp.prototype.toString.call(value);\n // Make dates with properties first say the date\n if ($c43c250226d47bfa$var$isDate(value)) base = \" \" + Date.prototype.toUTCString.call(value);\n // Make error with message first say the error\n if ($c43c250226d47bfa$var$isError(value)) base = \" \" + $c43c250226d47bfa$var$formatError(value);\n if (keys.length === 0 && (!array || value.length == 0)) return braces[0] + base + braces[1];\n if (recurseTimes < 0) {\n if ($c43c250226d47bfa$var$isRegExp(value)) return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n else return ctx.stylize(\"[Object]\", \"special\");\n }\n ctx.seen.push(value);\n var output;\n if (array) output = $c43c250226d47bfa$var$formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n else output = keys.map(function(key) {\n return $c43c250226d47bfa$var$formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n ctx.seen.pop();\n return $c43c250226d47bfa$var$reduceToSingleString(output, base, braces);\n}\nfunction $c43c250226d47bfa$var$formatPrimitive(ctx, value) {\n if ($c43c250226d47bfa$var$isUndefined(value)) return ctx.stylize(\"undefined\", \"undefined\");\n if ($c43c250226d47bfa$var$isString(value)) {\n var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return ctx.stylize(simple, \"string\");\n }\n if ($c43c250226d47bfa$var$isNumber(value)) return ctx.stylize(\"\" + value, \"number\");\n if ($c43c250226d47bfa$var$isBoolean(value)) return ctx.stylize(\"\" + value, \"boolean\");\n // For some reason typeof null is \"object\", so special case here.\n if ($c43c250226d47bfa$var$isNull(value)) return ctx.stylize(\"null\", \"null\");\n}\nfunction $c43c250226d47bfa$var$formatError(value) {\n return \"[\" + Error.prototype.toString.call(value) + \"]\";\n}\nfunction $c43c250226d47bfa$var$formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for(var i = 0, l = value.length; i < l; ++i)if ($c43c250226d47bfa$var$hasOwnProperty(value, String(i))) output.push($c43c250226d47bfa$var$formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));\n else output.push(\"\");\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) output.push($c43c250226d47bfa$var$formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));\n });\n return output;\n}\nfunction $c43c250226d47bfa$var$formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n };\n if (desc.get) {\n if (desc.set) str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n else str = ctx.stylize(\"[Getter]\", \"special\");\n } else if (desc.set) str = ctx.stylize(\"[Setter]\", \"special\");\n if (!$c43c250226d47bfa$var$hasOwnProperty(visibleKeys, key)) name = \"[\" + key + \"]\";\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if ($c43c250226d47bfa$var$isNull(recurseTimes)) str = $c43c250226d47bfa$var$formatValue(ctx, desc.value, null);\n else str = $c43c250226d47bfa$var$formatValue(ctx, desc.value, recurseTimes - 1);\n if (str.indexOf(\"\\n\") > -1) {\n if (array) str = str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\").slice(2);\n else str = \"\\n\" + str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\");\n }\n } else str = ctx.stylize(\"[Circular]\", \"special\");\n }\n if ($c43c250226d47bfa$var$isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) return str;\n name = JSON.stringify(\"\" + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.slice(1, -1);\n name = ctx.stylize(name, \"name\");\n } else {\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, \"string\");\n }\n }\n return name + \": \" + str;\n}\nfunction $c43c250226d47bfa$var$reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf(\"\\n\") >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, \"\").length + 1;\n }, 0);\n if (length > 60) return braces[0] + (base === \"\" ? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n \") + \" \" + braces[1];\n return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n}\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nmodule.exports.types = (parcelRequire(\"dIzU8\"));\nfunction $c43c250226d47bfa$var$isArray(ar) {\n return Array.isArray(ar);\n}\nmodule.exports.isArray = $c43c250226d47bfa$var$isArray;\nfunction $c43c250226d47bfa$var$isBoolean(arg) {\n return typeof arg === \"boolean\";\n}\nmodule.exports.isBoolean = $c43c250226d47bfa$var$isBoolean;\nfunction $c43c250226d47bfa$var$isNull(arg) {\n return arg === null;\n}\nmodule.exports.isNull = $c43c250226d47bfa$var$isNull;\nfunction $c43c250226d47bfa$var$isNullOrUndefined(arg) {\n return arg == null;\n}\nmodule.exports.isNullOrUndefined = $c43c250226d47bfa$var$isNullOrUndefined;\nfunction $c43c250226d47bfa$var$isNumber(arg) {\n return typeof arg === \"number\";\n}\nmodule.exports.isNumber = $c43c250226d47bfa$var$isNumber;\nfunction $c43c250226d47bfa$var$isString(arg) {\n return typeof arg === \"string\";\n}\nmodule.exports.isString = $c43c250226d47bfa$var$isString;\nfunction $c43c250226d47bfa$var$isSymbol(arg) {\n return typeof arg === \"symbol\";\n}\nmodule.exports.isSymbol = $c43c250226d47bfa$var$isSymbol;\nfunction $c43c250226d47bfa$var$isUndefined(arg) {\n return arg === void 0;\n}\nmodule.exports.isUndefined = $c43c250226d47bfa$var$isUndefined;\nfunction $c43c250226d47bfa$var$isRegExp(re) {\n return $c43c250226d47bfa$var$isObject(re) && $c43c250226d47bfa$var$objectToString(re) === \"[object RegExp]\";\n}\nmodule.exports.isRegExp = $c43c250226d47bfa$var$isRegExp;\nmodule.exports.types.isRegExp = $c43c250226d47bfa$var$isRegExp;\nfunction $c43c250226d47bfa$var$isObject(arg) {\n return typeof arg === \"object\" && arg !== null;\n}\nmodule.exports.isObject = $c43c250226d47bfa$var$isObject;\nfunction $c43c250226d47bfa$var$isDate(d) {\n return $c43c250226d47bfa$var$isObject(d) && $c43c250226d47bfa$var$objectToString(d) === \"[object Date]\";\n}\nmodule.exports.isDate = $c43c250226d47bfa$var$isDate;\nmodule.exports.types.isDate = $c43c250226d47bfa$var$isDate;\nfunction $c43c250226d47bfa$var$isError(e) {\n return $c43c250226d47bfa$var$isObject(e) && ($c43c250226d47bfa$var$objectToString(e) === \"[object Error]\" || e instanceof Error);\n}\nmodule.exports.isError = $c43c250226d47bfa$var$isError;\nmodule.exports.types.isNativeError = $c43c250226d47bfa$var$isError;\nfunction $c43c250226d47bfa$var$isFunction(arg) {\n return typeof arg === \"function\";\n}\nmodule.exports.isFunction = $c43c250226d47bfa$var$isFunction;\nfunction $c43c250226d47bfa$var$isPrimitive(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || // ES6 symbol\n typeof arg === \"undefined\";\n}\nmodule.exports.isPrimitive = $c43c250226d47bfa$var$isPrimitive;\n\nmodule.exports.isBuffer = (parcelRequire(\"1qVfH\"));\nfunction $c43c250226d47bfa$var$objectToString(o) {\n return Object.prototype.toString.call(o);\n}\nfunction $c43c250226d47bfa$var$pad(n) {\n return n < 10 ? \"0\" + n.toString(10) : n.toString(10);\n}\nvar $c43c250226d47bfa$var$months = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n];\n// 26 Feb 16:19:34\nfunction $c43c250226d47bfa$var$timestamp() {\n var d = new Date();\n var time = [\n $c43c250226d47bfa$var$pad(d.getHours()),\n $c43c250226d47bfa$var$pad(d.getMinutes()),\n $c43c250226d47bfa$var$pad(d.getSeconds())\n ].join(\":\");\n return [\n d.getDate(),\n $c43c250226d47bfa$var$months[d.getMonth()],\n time\n ].join(\" \");\n}\n// log is just a thin wrapper to console.log that prepends a timestamp\nmodule.exports.log = function() {\n console.log(\"%s - %s\", $c43c250226d47bfa$var$timestamp(), module.exports.format.apply(module.exports, arguments));\n};\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */ module.exports.inherits = (parcelRequire(\"9TvxW\"));\nmodule.exports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !$c43c250226d47bfa$var$isObject(add)) return origin;\n var keys = Object.keys(add);\n var i = keys.length;\n while(i--)origin[keys[i]] = add[keys[i]];\n return origin;\n};\nfunction $c43c250226d47bfa$var$hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\nvar $c43c250226d47bfa$var$kCustomPromisifiedSymbol = typeof Symbol !== \"undefined\" ? Symbol(\"util.promisify.custom\") : undefined;\nmodule.exports.promisify = function promisify(original) {\n if (typeof original !== \"function\") throw new TypeError('The \"original\" argument must be of type Function');\n if ($c43c250226d47bfa$var$kCustomPromisifiedSymbol && original[$c43c250226d47bfa$var$kCustomPromisifiedSymbol]) {\n var fn = original[$c43c250226d47bfa$var$kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\") throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n Object.defineProperty(fn, $c43c250226d47bfa$var$kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: false,\n writable: false,\n configurable: true\n });\n return fn;\n }\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function(resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n var args = [];\n for(var i = 0; i < arguments.length; i++)args.push(arguments[i]);\n args.push(function(err, value) {\n if (err) promiseReject(err);\n else promiseResolve(value);\n });\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n if ($c43c250226d47bfa$var$kCustomPromisifiedSymbol) Object.defineProperty(fn, $c43c250226d47bfa$var$kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: false,\n writable: false,\n configurable: true\n });\n return Object.defineProperties(fn, $c43c250226d47bfa$var$getOwnPropertyDescriptors(original));\n};\nmodule.exports.promisify.custom = $c43c250226d47bfa$var$kCustomPromisifiedSymbol;\nfunction $c43c250226d47bfa$var$callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\nfunction $c43c250226d47bfa$var$callbackify(original) {\n if (typeof original !== \"function\") throw new TypeError('The \"original\" argument must be of type Function');\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for(var i = 0; i < arguments.length; i++)args.push(arguments[i]);\n var maybeCb = args.pop();\n if (typeof maybeCb !== \"function\") throw new TypeError(\"The last argument must be of type Function\");\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args).then(function(ret) {\n $2fLxs.nextTick(cb.bind(null, null, ret));\n }, function(rej) {\n $2fLxs.nextTick($c43c250226d47bfa$var$callbackifyOnRejected.bind(null, rej, cb));\n });\n }\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified, $c43c250226d47bfa$var$getOwnPropertyDescriptors(original));\n return callbackified;\n}\nmodule.exports.callbackify = $c43c250226d47bfa$var$callbackify;\n\n});\nparcelRegister(\"dIzU8\", function(module, exports) {\n// Currently in sync with Node.js lib/internal/util/types.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\"use strict\";\n\nvar $avzh7 = parcelRequire(\"avzh7\");\n\nvar $9mPZQ = parcelRequire(\"9mPZQ\");\n\nvar $6Sxxf = parcelRequire(\"6Sxxf\");\n\nvar $bbrRm = parcelRequire(\"bbrRm\");\nfunction $9fcb3c45d02987bb$var$uncurryThis(f) {\n return f.call.bind(f);\n}\nvar $9fcb3c45d02987bb$var$BigIntSupported = typeof BigInt !== \"undefined\";\nvar $9fcb3c45d02987bb$var$SymbolSupported = typeof Symbol !== \"undefined\";\nvar $9fcb3c45d02987bb$var$ObjectToString = $9fcb3c45d02987bb$var$uncurryThis(Object.prototype.toString);\nvar $9fcb3c45d02987bb$var$numberValue = $9fcb3c45d02987bb$var$uncurryThis(Number.prototype.valueOf);\nvar $9fcb3c45d02987bb$var$stringValue = $9fcb3c45d02987bb$var$uncurryThis(String.prototype.valueOf);\nvar $9fcb3c45d02987bb$var$booleanValue = $9fcb3c45d02987bb$var$uncurryThis(Boolean.prototype.valueOf);\nif ($9fcb3c45d02987bb$var$BigIntSupported) var $9fcb3c45d02987bb$var$bigIntValue = $9fcb3c45d02987bb$var$uncurryThis(BigInt.prototype.valueOf);\nif ($9fcb3c45d02987bb$var$SymbolSupported) var $9fcb3c45d02987bb$var$symbolValue = $9fcb3c45d02987bb$var$uncurryThis(Symbol.prototype.valueOf);\nfunction $9fcb3c45d02987bb$var$checkBoxedPrimitive(value, prototypeValueOf) {\n if (typeof value !== \"object\") return false;\n try {\n prototypeValueOf(value);\n return true;\n } catch (e) {\n return false;\n }\n}\nmodule.exports.isArgumentsObject = $avzh7;\nmodule.exports.isGeneratorFunction = $9mPZQ;\nmodule.exports.isTypedArray = $bbrRm;\n// Taken from here and modified for better browser support\n// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js\nfunction $9fcb3c45d02987bb$var$isPromise(input) {\n return typeof Promise !== \"undefined\" && input instanceof Promise || input !== null && typeof input === \"object\" && typeof input.then === \"function\" && typeof input.catch === \"function\";\n}\nmodule.exports.isPromise = $9fcb3c45d02987bb$var$isPromise;\nfunction $9fcb3c45d02987bb$var$isArrayBufferView(value) {\n if (typeof ArrayBuffer !== \"undefined\" && ArrayBuffer.isView) return ArrayBuffer.isView(value);\n return $bbrRm(value) || $9fcb3c45d02987bb$var$isDataView(value);\n}\nmodule.exports.isArrayBufferView = $9fcb3c45d02987bb$var$isArrayBufferView;\nfunction $9fcb3c45d02987bb$var$isUint8Array(value) {\n return $6Sxxf(value) === \"Uint8Array\";\n}\nmodule.exports.isUint8Array = $9fcb3c45d02987bb$var$isUint8Array;\nfunction $9fcb3c45d02987bb$var$isUint8ClampedArray(value) {\n return $6Sxxf(value) === \"Uint8ClampedArray\";\n}\nmodule.exports.isUint8ClampedArray = $9fcb3c45d02987bb$var$isUint8ClampedArray;\nfunction $9fcb3c45d02987bb$var$isUint16Array(value) {\n return $6Sxxf(value) === \"Uint16Array\";\n}\nmodule.exports.isUint16Array = $9fcb3c45d02987bb$var$isUint16Array;\nfunction $9fcb3c45d02987bb$var$isUint32Array(value) {\n return $6Sxxf(value) === \"Uint32Array\";\n}\nmodule.exports.isUint32Array = $9fcb3c45d02987bb$var$isUint32Array;\nfunction $9fcb3c45d02987bb$var$isInt8Array(value) {\n return $6Sxxf(value) === \"Int8Array\";\n}\nmodule.exports.isInt8Array = $9fcb3c45d02987bb$var$isInt8Array;\nfunction $9fcb3c45d02987bb$var$isInt16Array(value) {\n return $6Sxxf(value) === \"Int16Array\";\n}\nmodule.exports.isInt16Array = $9fcb3c45d02987bb$var$isInt16Array;\nfunction $9fcb3c45d02987bb$var$isInt32Array(value) {\n return $6Sxxf(value) === \"Int32Array\";\n}\nmodule.exports.isInt32Array = $9fcb3c45d02987bb$var$isInt32Array;\nfunction $9fcb3c45d02987bb$var$isFloat32Array(value) {\n return $6Sxxf(value) === \"Float32Array\";\n}\nmodule.exports.isFloat32Array = $9fcb3c45d02987bb$var$isFloat32Array;\nfunction $9fcb3c45d02987bb$var$isFloat64Array(value) {\n return $6Sxxf(value) === \"Float64Array\";\n}\nmodule.exports.isFloat64Array = $9fcb3c45d02987bb$var$isFloat64Array;\nfunction $9fcb3c45d02987bb$var$isBigInt64Array(value) {\n return $6Sxxf(value) === \"BigInt64Array\";\n}\nmodule.exports.isBigInt64Array = $9fcb3c45d02987bb$var$isBigInt64Array;\nfunction $9fcb3c45d02987bb$var$isBigUint64Array(value) {\n return $6Sxxf(value) === \"BigUint64Array\";\n}\nmodule.exports.isBigUint64Array = $9fcb3c45d02987bb$var$isBigUint64Array;\nfunction $9fcb3c45d02987bb$var$isMapToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object Map]\";\n}\n$9fcb3c45d02987bb$var$isMapToString.working = typeof Map !== \"undefined\" && $9fcb3c45d02987bb$var$isMapToString(new Map());\nfunction $9fcb3c45d02987bb$var$isMap(value) {\n if (typeof Map === \"undefined\") return false;\n return $9fcb3c45d02987bb$var$isMapToString.working ? $9fcb3c45d02987bb$var$isMapToString(value) : value instanceof Map;\n}\nmodule.exports.isMap = $9fcb3c45d02987bb$var$isMap;\nfunction $9fcb3c45d02987bb$var$isSetToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object Set]\";\n}\n$9fcb3c45d02987bb$var$isSetToString.working = typeof Set !== \"undefined\" && $9fcb3c45d02987bb$var$isSetToString(new Set());\nfunction $9fcb3c45d02987bb$var$isSet(value) {\n if (typeof Set === \"undefined\") return false;\n return $9fcb3c45d02987bb$var$isSetToString.working ? $9fcb3c45d02987bb$var$isSetToString(value) : value instanceof Set;\n}\nmodule.exports.isSet = $9fcb3c45d02987bb$var$isSet;\nfunction $9fcb3c45d02987bb$var$isWeakMapToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object WeakMap]\";\n}\n$9fcb3c45d02987bb$var$isWeakMapToString.working = typeof WeakMap !== \"undefined\" && $9fcb3c45d02987bb$var$isWeakMapToString(new WeakMap());\nfunction $9fcb3c45d02987bb$var$isWeakMap(value) {\n if (typeof WeakMap === \"undefined\") return false;\n return $9fcb3c45d02987bb$var$isWeakMapToString.working ? $9fcb3c45d02987bb$var$isWeakMapToString(value) : value instanceof WeakMap;\n}\nmodule.exports.isWeakMap = $9fcb3c45d02987bb$var$isWeakMap;\nfunction $9fcb3c45d02987bb$var$isWeakSetToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object WeakSet]\";\n}\n$9fcb3c45d02987bb$var$isWeakSetToString.working = typeof WeakSet !== \"undefined\" && $9fcb3c45d02987bb$var$isWeakSetToString(new WeakSet());\nfunction $9fcb3c45d02987bb$var$isWeakSet(value) {\n return $9fcb3c45d02987bb$var$isWeakSetToString(value);\n}\nmodule.exports.isWeakSet = $9fcb3c45d02987bb$var$isWeakSet;\nfunction $9fcb3c45d02987bb$var$isArrayBufferToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object ArrayBuffer]\";\n}\n$9fcb3c45d02987bb$var$isArrayBufferToString.working = typeof ArrayBuffer !== \"undefined\" && $9fcb3c45d02987bb$var$isArrayBufferToString(new ArrayBuffer());\nfunction $9fcb3c45d02987bb$var$isArrayBuffer(value) {\n if (typeof ArrayBuffer === \"undefined\") return false;\n return $9fcb3c45d02987bb$var$isArrayBufferToString.working ? $9fcb3c45d02987bb$var$isArrayBufferToString(value) : value instanceof ArrayBuffer;\n}\nmodule.exports.isArrayBuffer = $9fcb3c45d02987bb$var$isArrayBuffer;\nfunction $9fcb3c45d02987bb$var$isDataViewToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object DataView]\";\n}\n$9fcb3c45d02987bb$var$isDataViewToString.working = typeof ArrayBuffer !== \"undefined\" && typeof DataView !== \"undefined\" && $9fcb3c45d02987bb$var$isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1));\nfunction $9fcb3c45d02987bb$var$isDataView(value) {\n if (typeof DataView === \"undefined\") return false;\n return $9fcb3c45d02987bb$var$isDataViewToString.working ? $9fcb3c45d02987bb$var$isDataViewToString(value) : value instanceof DataView;\n}\nmodule.exports.isDataView = $9fcb3c45d02987bb$var$isDataView;\n// Store a copy of SharedArrayBuffer in case it's deleted elsewhere\nvar $9fcb3c45d02987bb$var$SharedArrayBufferCopy = typeof SharedArrayBuffer !== \"undefined\" ? SharedArrayBuffer : undefined;\nfunction $9fcb3c45d02987bb$var$isSharedArrayBufferToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object SharedArrayBuffer]\";\n}\nfunction $9fcb3c45d02987bb$var$isSharedArrayBuffer(value) {\n if (typeof $9fcb3c45d02987bb$var$SharedArrayBufferCopy === \"undefined\") return false;\n if (typeof $9fcb3c45d02987bb$var$isSharedArrayBufferToString.working === \"undefined\") $9fcb3c45d02987bb$var$isSharedArrayBufferToString.working = $9fcb3c45d02987bb$var$isSharedArrayBufferToString(new $9fcb3c45d02987bb$var$SharedArrayBufferCopy());\n return $9fcb3c45d02987bb$var$isSharedArrayBufferToString.working ? $9fcb3c45d02987bb$var$isSharedArrayBufferToString(value) : value instanceof $9fcb3c45d02987bb$var$SharedArrayBufferCopy;\n}\nmodule.exports.isSharedArrayBuffer = $9fcb3c45d02987bb$var$isSharedArrayBuffer;\nfunction $9fcb3c45d02987bb$var$isAsyncFunction(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object AsyncFunction]\";\n}\nmodule.exports.isAsyncFunction = $9fcb3c45d02987bb$var$isAsyncFunction;\nfunction $9fcb3c45d02987bb$var$isMapIterator(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object Map Iterator]\";\n}\nmodule.exports.isMapIterator = $9fcb3c45d02987bb$var$isMapIterator;\nfunction $9fcb3c45d02987bb$var$isSetIterator(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object Set Iterator]\";\n}\nmodule.exports.isSetIterator = $9fcb3c45d02987bb$var$isSetIterator;\nfunction $9fcb3c45d02987bb$var$isGeneratorObject(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object Generator]\";\n}\nmodule.exports.isGeneratorObject = $9fcb3c45d02987bb$var$isGeneratorObject;\nfunction $9fcb3c45d02987bb$var$isWebAssemblyCompiledModule(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object WebAssembly.Module]\";\n}\nmodule.exports.isWebAssemblyCompiledModule = $9fcb3c45d02987bb$var$isWebAssemblyCompiledModule;\nfunction $9fcb3c45d02987bb$var$isNumberObject(value) {\n return $9fcb3c45d02987bb$var$checkBoxedPrimitive(value, $9fcb3c45d02987bb$var$numberValue);\n}\nmodule.exports.isNumberObject = $9fcb3c45d02987bb$var$isNumberObject;\nfunction $9fcb3c45d02987bb$var$isStringObject(value) {\n return $9fcb3c45d02987bb$var$checkBoxedPrimitive(value, $9fcb3c45d02987bb$var$stringValue);\n}\nmodule.exports.isStringObject = $9fcb3c45d02987bb$var$isStringObject;\nfunction $9fcb3c45d02987bb$var$isBooleanObject(value) {\n return $9fcb3c45d02987bb$var$checkBoxedPrimitive(value, $9fcb3c45d02987bb$var$booleanValue);\n}\nmodule.exports.isBooleanObject = $9fcb3c45d02987bb$var$isBooleanObject;\nfunction $9fcb3c45d02987bb$var$isBigIntObject(value) {\n return $9fcb3c45d02987bb$var$BigIntSupported && $9fcb3c45d02987bb$var$checkBoxedPrimitive(value, $9fcb3c45d02987bb$var$bigIntValue);\n}\nmodule.exports.isBigIntObject = $9fcb3c45d02987bb$var$isBigIntObject;\nfunction $9fcb3c45d02987bb$var$isSymbolObject(value) {\n return $9fcb3c45d02987bb$var$SymbolSupported && $9fcb3c45d02987bb$var$checkBoxedPrimitive(value, $9fcb3c45d02987bb$var$symbolValue);\n}\nmodule.exports.isSymbolObject = $9fcb3c45d02987bb$var$isSymbolObject;\nfunction $9fcb3c45d02987bb$var$isBoxedPrimitive(value) {\n return $9fcb3c45d02987bb$var$isNumberObject(value) || $9fcb3c45d02987bb$var$isStringObject(value) || $9fcb3c45d02987bb$var$isBooleanObject(value) || $9fcb3c45d02987bb$var$isBigIntObject(value) || $9fcb3c45d02987bb$var$isSymbolObject(value);\n}\nmodule.exports.isBoxedPrimitive = $9fcb3c45d02987bb$var$isBoxedPrimitive;\nfunction $9fcb3c45d02987bb$var$isAnyArrayBuffer(value) {\n return typeof Uint8Array !== \"undefined\" && ($9fcb3c45d02987bb$var$isArrayBuffer(value) || $9fcb3c45d02987bb$var$isSharedArrayBuffer(value));\n}\nmodule.exports.isAnyArrayBuffer = $9fcb3c45d02987bb$var$isAnyArrayBuffer;\n[\n \"isProxy\",\n \"isExternal\",\n \"isModuleNamespaceObject\"\n].forEach(function(method) {\n Object.defineProperty(module.exports, method, {\n enumerable: false,\n value: function() {\n throw new Error(method + \" is not supported in userland\");\n }\n });\n});\n\n});\nparcelRegister(\"avzh7\", function(module, exports) {\n\"use strict\";\n\nvar $7a682982bd21c890$var$hasToStringTag = (parcelRequire(\"goA1T\"))();\n\nvar $3e3ab = parcelRequire(\"3e3ab\");\nvar $7a682982bd21c890$var$$toString = $3e3ab(\"Object.prototype.toString\");\nvar $7a682982bd21c890$var$isStandardArguments = function isArguments(value) {\n if ($7a682982bd21c890$var$hasToStringTag && value && typeof value === \"object\" && Symbol.toStringTag in value) return false;\n return $7a682982bd21c890$var$$toString(value) === \"[object Arguments]\";\n};\nvar $7a682982bd21c890$var$isLegacyArguments = function isArguments(value) {\n if ($7a682982bd21c890$var$isStandardArguments(value)) return true;\n return value !== null && typeof value === \"object\" && typeof value.length === \"number\" && value.length >= 0 && $7a682982bd21c890$var$$toString(value) !== \"[object Array]\" && $7a682982bd21c890$var$$toString(value.callee) === \"[object Function]\";\n};\nvar $7a682982bd21c890$var$supportsStandardArguments = function() {\n return $7a682982bd21c890$var$isStandardArguments(arguments);\n}();\n$7a682982bd21c890$var$isStandardArguments.isLegacyArguments = $7a682982bd21c890$var$isLegacyArguments; // for tests\nmodule.exports = $7a682982bd21c890$var$supportsStandardArguments ? $7a682982bd21c890$var$isStandardArguments : $7a682982bd21c890$var$isLegacyArguments;\n\n});\nparcelRegister(\"goA1T\", function(module, exports) {\n\"use strict\";\n\nvar $grYrm = parcelRequire(\"grYrm\");\nmodule.exports = function hasToStringTagShams() {\n return $grYrm() && !!Symbol.toStringTag;\n};\n\n});\nparcelRegister(\"grYrm\", function(module, exports) {\n\"use strict\";\n/* eslint complexity: [2, 18], max-statements: [2, 33] */ module.exports = function hasSymbols() {\n if (typeof Symbol !== \"function\" || typeof Object.getOwnPropertySymbols !== \"function\") return false;\n if (typeof Symbol.iterator === \"symbol\") return true;\n var obj = {};\n var sym = Symbol(\"test\");\n var symObj = Object(sym);\n if (typeof sym === \"string\") return false;\n if (Object.prototype.toString.call(sym) !== \"[object Symbol]\") return false;\n if (Object.prototype.toString.call(symObj) !== \"[object Symbol]\") return false;\n // temp disabled per https://github.com/ljharb/object.assign/issues/17\n // if (sym instanceof Symbol) { return false; }\n // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n // if (!(symObj instanceof Symbol)) { return false; }\n // if (typeof Symbol.prototype.toString !== 'function') { return false; }\n // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n var symVal = 42;\n obj[sym] = symVal;\n for(sym in obj)return false;\n // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n if (typeof Object.keys === \"function\" && Object.keys(obj).length !== 0) return false;\n if (typeof Object.getOwnPropertyNames === \"function\" && Object.getOwnPropertyNames(obj).length !== 0) return false;\n var syms = Object.getOwnPropertySymbols(obj);\n if (syms.length !== 1 || syms[0] !== sym) return false;\n if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) return false;\n if (typeof Object.getOwnPropertyDescriptor === \"function\") {\n var descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n if (descriptor.value !== symVal || descriptor.enumerable !== true) return false;\n }\n return true;\n};\n\n});\n\n\nparcelRegister(\"3e3ab\", function(module, exports) {\n\"use strict\";\n\nvar $2VTxt = parcelRequire(\"2VTxt\");\n\nvar $70X2U = parcelRequire(\"70X2U\");\nvar $2595220fe67fde3d$var$$indexOf = $70X2U($2VTxt(\"String.prototype.indexOf\"));\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n var intrinsic = $2VTxt(name, !!allowMissing);\n if (typeof intrinsic === \"function\" && $2595220fe67fde3d$var$$indexOf(name, \".prototype.\") > -1) return $70X2U(intrinsic);\n return intrinsic;\n};\n\n});\nparcelRegister(\"2VTxt\", function(module, exports) {\n\"use strict\";\nvar $222bfc848c4c2d20$var$undefined1;\nvar $222bfc848c4c2d20$var$$SyntaxError = SyntaxError;\nvar $222bfc848c4c2d20$var$$Function = Function;\nvar $222bfc848c4c2d20$var$$TypeError = TypeError;\n// eslint-disable-next-line consistent-return\nvar $222bfc848c4c2d20$var$getEvalledConstructor = function(expressionSyntax) {\n try {\n return $222bfc848c4c2d20$var$$Function('\"use strict\"; return (' + expressionSyntax + \").constructor;\")();\n } catch (e) {}\n};\nvar $222bfc848c4c2d20$var$$gOPD = Object.getOwnPropertyDescriptor;\nif ($222bfc848c4c2d20$var$$gOPD) try {\n $222bfc848c4c2d20$var$$gOPD({}, \"\");\n} catch (e) {\n $222bfc848c4c2d20$var$$gOPD = null; // this is IE 8, which has a broken gOPD\n}\nvar $222bfc848c4c2d20$var$throwTypeError = function() {\n throw new $222bfc848c4c2d20$var$$TypeError();\n};\nvar $222bfc848c4c2d20$var$ThrowTypeError = $222bfc848c4c2d20$var$$gOPD ? function() {\n try {\n // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n arguments.callee; // IE 8 does not throw here\n return $222bfc848c4c2d20$var$throwTypeError;\n } catch (calleeThrows) {\n try {\n // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n return $222bfc848c4c2d20$var$$gOPD(arguments, \"callee\").get;\n } catch (gOPDthrows) {\n return $222bfc848c4c2d20$var$throwTypeError;\n }\n }\n}() : $222bfc848c4c2d20$var$throwTypeError;\n\nvar $222bfc848c4c2d20$var$hasSymbols = (parcelRequire(\"dk94G\"))();\n\nvar $222bfc848c4c2d20$var$hasProto = (parcelRequire(\"2GNOT\"))();\nvar $222bfc848c4c2d20$var$getProto = Object.getPrototypeOf || ($222bfc848c4c2d20$var$hasProto ? function(x) {\n return x.__proto__;\n} // eslint-disable-line no-proto\n : null);\nvar $222bfc848c4c2d20$var$needsEval = {};\nvar $222bfc848c4c2d20$var$TypedArray = typeof Uint8Array === \"undefined\" || !$222bfc848c4c2d20$var$getProto ? undefined : $222bfc848c4c2d20$var$getProto(Uint8Array);\nvar $222bfc848c4c2d20$var$INTRINSICS = {\n \"%AggregateError%\": typeof AggregateError === \"undefined\" ? undefined : AggregateError,\n \"%Array%\": Array,\n \"%ArrayBuffer%\": typeof ArrayBuffer === \"undefined\" ? undefined : ArrayBuffer,\n \"%ArrayIteratorPrototype%\": $222bfc848c4c2d20$var$hasSymbols && $222bfc848c4c2d20$var$getProto ? $222bfc848c4c2d20$var$getProto([][Symbol.iterator]()) : undefined,\n \"%AsyncFromSyncIteratorPrototype%\": undefined,\n \"%AsyncFunction%\": $222bfc848c4c2d20$var$needsEval,\n \"%AsyncGenerator%\": $222bfc848c4c2d20$var$needsEval,\n \"%AsyncGeneratorFunction%\": $222bfc848c4c2d20$var$needsEval,\n \"%AsyncIteratorPrototype%\": $222bfc848c4c2d20$var$needsEval,\n \"%Atomics%\": typeof Atomics === \"undefined\" ? undefined : Atomics,\n \"%BigInt%\": typeof BigInt === \"undefined\" ? undefined : BigInt,\n \"%BigInt64Array%\": typeof BigInt64Array === \"undefined\" ? undefined : BigInt64Array,\n \"%BigUint64Array%\": typeof BigUint64Array === \"undefined\" ? undefined : BigUint64Array,\n \"%Boolean%\": Boolean,\n \"%DataView%\": typeof DataView === \"undefined\" ? undefined : DataView,\n \"%Date%\": Date,\n \"%decodeURI%\": decodeURI,\n \"%decodeURIComponent%\": decodeURIComponent,\n \"%encodeURI%\": encodeURI,\n \"%encodeURIComponent%\": encodeURIComponent,\n \"%Error%\": Error,\n \"%eval%\": eval,\n \"%EvalError%\": EvalError,\n \"%Float32Array%\": typeof Float32Array === \"undefined\" ? undefined : Float32Array,\n \"%Float64Array%\": typeof Float64Array === \"undefined\" ? undefined : Float64Array,\n \"%FinalizationRegistry%\": typeof FinalizationRegistry === \"undefined\" ? undefined : FinalizationRegistry,\n \"%Function%\": $222bfc848c4c2d20$var$$Function,\n \"%GeneratorFunction%\": $222bfc848c4c2d20$var$needsEval,\n \"%Int8Array%\": typeof Int8Array === \"undefined\" ? undefined : Int8Array,\n \"%Int16Array%\": typeof Int16Array === \"undefined\" ? undefined : Int16Array,\n \"%Int32Array%\": typeof Int32Array === \"undefined\" ? undefined : Int32Array,\n \"%isFinite%\": isFinite,\n \"%isNaN%\": isNaN,\n \"%IteratorPrototype%\": $222bfc848c4c2d20$var$hasSymbols && $222bfc848c4c2d20$var$getProto ? $222bfc848c4c2d20$var$getProto($222bfc848c4c2d20$var$getProto([][Symbol.iterator]())) : undefined,\n \"%JSON%\": typeof JSON === \"object\" ? JSON : undefined,\n \"%Map%\": typeof Map === \"undefined\" ? undefined : Map,\n \"%MapIteratorPrototype%\": typeof Map === \"undefined\" || !$222bfc848c4c2d20$var$hasSymbols || !$222bfc848c4c2d20$var$getProto ? undefined : $222bfc848c4c2d20$var$getProto(new Map()[Symbol.iterator]()),\n \"%Math%\": Math,\n \"%Number%\": Number,\n \"%Object%\": Object,\n \"%parseFloat%\": parseFloat,\n \"%parseInt%\": parseInt,\n \"%Promise%\": typeof Promise === \"undefined\" ? undefined : Promise,\n \"%Proxy%\": typeof Proxy === \"undefined\" ? undefined : Proxy,\n \"%RangeError%\": RangeError,\n \"%ReferenceError%\": ReferenceError,\n \"%Reflect%\": typeof Reflect === \"undefined\" ? undefined : Reflect,\n \"%RegExp%\": RegExp,\n \"%Set%\": typeof Set === \"undefined\" ? undefined : Set,\n \"%SetIteratorPrototype%\": typeof Set === \"undefined\" || !$222bfc848c4c2d20$var$hasSymbols || !$222bfc848c4c2d20$var$getProto ? undefined : $222bfc848c4c2d20$var$getProto(new Set()[Symbol.iterator]()),\n \"%SharedArrayBuffer%\": typeof SharedArrayBuffer === \"undefined\" ? undefined : SharedArrayBuffer,\n \"%String%\": String,\n \"%StringIteratorPrototype%\": $222bfc848c4c2d20$var$hasSymbols && $222bfc848c4c2d20$var$getProto ? $222bfc848c4c2d20$var$getProto(\"\"[Symbol.iterator]()) : undefined,\n \"%Symbol%\": $222bfc848c4c2d20$var$hasSymbols ? Symbol : undefined,\n \"%SyntaxError%\": $222bfc848c4c2d20$var$$SyntaxError,\n \"%ThrowTypeError%\": $222bfc848c4c2d20$var$ThrowTypeError,\n \"%TypedArray%\": $222bfc848c4c2d20$var$TypedArray,\n \"%TypeError%\": $222bfc848c4c2d20$var$$TypeError,\n \"%Uint8Array%\": typeof Uint8Array === \"undefined\" ? undefined : Uint8Array,\n \"%Uint8ClampedArray%\": typeof Uint8ClampedArray === \"undefined\" ? undefined : Uint8ClampedArray,\n \"%Uint16Array%\": typeof Uint16Array === \"undefined\" ? undefined : Uint16Array,\n \"%Uint32Array%\": typeof Uint32Array === \"undefined\" ? undefined : Uint32Array,\n \"%URIError%\": URIError,\n \"%WeakMap%\": typeof WeakMap === \"undefined\" ? undefined : WeakMap,\n \"%WeakRef%\": typeof WeakRef === \"undefined\" ? undefined : WeakRef,\n \"%WeakSet%\": typeof WeakSet === \"undefined\" ? undefined : WeakSet\n};\nif ($222bfc848c4c2d20$var$getProto) try {\n null.error; // eslint-disable-line no-unused-expressions\n} catch (e) {\n // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n var $222bfc848c4c2d20$var$errorProto = $222bfc848c4c2d20$var$getProto($222bfc848c4c2d20$var$getProto(e));\n $222bfc848c4c2d20$var$INTRINSICS[\"%Error.prototype%\"] = $222bfc848c4c2d20$var$errorProto;\n}\nvar $222bfc848c4c2d20$var$doEval = function doEval(name) {\n var value;\n if (name === \"%AsyncFunction%\") value = $222bfc848c4c2d20$var$getEvalledConstructor(\"async function () {}\");\n else if (name === \"%GeneratorFunction%\") value = $222bfc848c4c2d20$var$getEvalledConstructor(\"function* () {}\");\n else if (name === \"%AsyncGeneratorFunction%\") value = $222bfc848c4c2d20$var$getEvalledConstructor(\"async function* () {}\");\n else if (name === \"%AsyncGenerator%\") {\n var fn = doEval(\"%AsyncGeneratorFunction%\");\n if (fn) value = fn.prototype;\n } else if (name === \"%AsyncIteratorPrototype%\") {\n var gen = doEval(\"%AsyncGenerator%\");\n if (gen && $222bfc848c4c2d20$var$getProto) value = $222bfc848c4c2d20$var$getProto(gen.prototype);\n }\n $222bfc848c4c2d20$var$INTRINSICS[name] = value;\n return value;\n};\nvar $222bfc848c4c2d20$var$LEGACY_ALIASES = {\n \"%ArrayBufferPrototype%\": [\n \"ArrayBuffer\",\n \"prototype\"\n ],\n \"%ArrayPrototype%\": [\n \"Array\",\n \"prototype\"\n ],\n \"%ArrayProto_entries%\": [\n \"Array\",\n \"prototype\",\n \"entries\"\n ],\n \"%ArrayProto_forEach%\": [\n \"Array\",\n \"prototype\",\n \"forEach\"\n ],\n \"%ArrayProto_keys%\": [\n \"Array\",\n \"prototype\",\n \"keys\"\n ],\n \"%ArrayProto_values%\": [\n \"Array\",\n \"prototype\",\n \"values\"\n ],\n \"%AsyncFunctionPrototype%\": [\n \"AsyncFunction\",\n \"prototype\"\n ],\n \"%AsyncGenerator%\": [\n \"AsyncGeneratorFunction\",\n \"prototype\"\n ],\n \"%AsyncGeneratorPrototype%\": [\n \"AsyncGeneratorFunction\",\n \"prototype\",\n \"prototype\"\n ],\n \"%BooleanPrototype%\": [\n \"Boolean\",\n \"prototype\"\n ],\n \"%DataViewPrototype%\": [\n \"DataView\",\n \"prototype\"\n ],\n \"%DatePrototype%\": [\n \"Date\",\n \"prototype\"\n ],\n \"%ErrorPrototype%\": [\n \"Error\",\n \"prototype\"\n ],\n \"%EvalErrorPrototype%\": [\n \"EvalError\",\n \"prototype\"\n ],\n \"%Float32ArrayPrototype%\": [\n \"Float32Array\",\n \"prototype\"\n ],\n \"%Float64ArrayPrototype%\": [\n \"Float64Array\",\n \"prototype\"\n ],\n \"%FunctionPrototype%\": [\n \"Function\",\n \"prototype\"\n ],\n \"%Generator%\": [\n \"GeneratorFunction\",\n \"prototype\"\n ],\n \"%GeneratorPrototype%\": [\n \"GeneratorFunction\",\n \"prototype\",\n \"prototype\"\n ],\n \"%Int8ArrayPrototype%\": [\n \"Int8Array\",\n \"prototype\"\n ],\n \"%Int16ArrayPrototype%\": [\n \"Int16Array\",\n \"prototype\"\n ],\n \"%Int32ArrayPrototype%\": [\n \"Int32Array\",\n \"prototype\"\n ],\n \"%JSONParse%\": [\n \"JSON\",\n \"parse\"\n ],\n \"%JSONStringify%\": [\n \"JSON\",\n \"stringify\"\n ],\n \"%MapPrototype%\": [\n \"Map\",\n \"prototype\"\n ],\n \"%NumberPrototype%\": [\n \"Number\",\n \"prototype\"\n ],\n \"%ObjectPrototype%\": [\n \"Object\",\n \"prototype\"\n ],\n \"%ObjProto_toString%\": [\n \"Object\",\n \"prototype\",\n \"toString\"\n ],\n \"%ObjProto_valueOf%\": [\n \"Object\",\n \"prototype\",\n \"valueOf\"\n ],\n \"%PromisePrototype%\": [\n \"Promise\",\n \"prototype\"\n ],\n \"%PromiseProto_then%\": [\n \"Promise\",\n \"prototype\",\n \"then\"\n ],\n \"%Promise_all%\": [\n \"Promise\",\n \"all\"\n ],\n \"%Promise_reject%\": [\n \"Promise\",\n \"reject\"\n ],\n \"%Promise_resolve%\": [\n \"Promise\",\n \"resolve\"\n ],\n \"%RangeErrorPrototype%\": [\n \"RangeError\",\n \"prototype\"\n ],\n \"%ReferenceErrorPrototype%\": [\n \"ReferenceError\",\n \"prototype\"\n ],\n \"%RegExpPrototype%\": [\n \"RegExp\",\n \"prototype\"\n ],\n \"%SetPrototype%\": [\n \"Set\",\n \"prototype\"\n ],\n \"%SharedArrayBufferPrototype%\": [\n \"SharedArrayBuffer\",\n \"prototype\"\n ],\n \"%StringPrototype%\": [\n \"String\",\n \"prototype\"\n ],\n \"%SymbolPrototype%\": [\n \"Symbol\",\n \"prototype\"\n ],\n \"%SyntaxErrorPrototype%\": [\n \"SyntaxError\",\n \"prototype\"\n ],\n \"%TypedArrayPrototype%\": [\n \"TypedArray\",\n \"prototype\"\n ],\n \"%TypeErrorPrototype%\": [\n \"TypeError\",\n \"prototype\"\n ],\n \"%Uint8ArrayPrototype%\": [\n \"Uint8Array\",\n \"prototype\"\n ],\n \"%Uint8ClampedArrayPrototype%\": [\n \"Uint8ClampedArray\",\n \"prototype\"\n ],\n \"%Uint16ArrayPrototype%\": [\n \"Uint16Array\",\n \"prototype\"\n ],\n \"%Uint32ArrayPrototype%\": [\n \"Uint32Array\",\n \"prototype\"\n ],\n \"%URIErrorPrototype%\": [\n \"URIError\",\n \"prototype\"\n ],\n \"%WeakMapPrototype%\": [\n \"WeakMap\",\n \"prototype\"\n ],\n \"%WeakSetPrototype%\": [\n \"WeakSet\",\n \"prototype\"\n ]\n};\n\nvar $l7UhJ = parcelRequire(\"l7UhJ\");\n\nvar $G9Faa = parcelRequire(\"G9Faa\");\nvar $222bfc848c4c2d20$var$$concat = $l7UhJ.call(Function.call, Array.prototype.concat);\nvar $222bfc848c4c2d20$var$$spliceApply = $l7UhJ.call(Function.apply, Array.prototype.splice);\nvar $222bfc848c4c2d20$var$$replace = $l7UhJ.call(Function.call, String.prototype.replace);\nvar $222bfc848c4c2d20$var$$strSlice = $l7UhJ.call(Function.call, String.prototype.slice);\nvar $222bfc848c4c2d20$var$$exec = $l7UhJ.call(Function.call, RegExp.prototype.exec);\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var $222bfc848c4c2d20$var$rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar $222bfc848c4c2d20$var$reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */ \nvar $222bfc848c4c2d20$var$stringToPath = function stringToPath(string) {\n var first = $222bfc848c4c2d20$var$$strSlice(string, 0, 1);\n var last = $222bfc848c4c2d20$var$$strSlice(string, -1);\n if (first === \"%\" && last !== \"%\") throw new $222bfc848c4c2d20$var$$SyntaxError(\"invalid intrinsic syntax, expected closing `%`\");\n else if (last === \"%\" && first !== \"%\") throw new $222bfc848c4c2d20$var$$SyntaxError(\"invalid intrinsic syntax, expected opening `%`\");\n var result = [];\n $222bfc848c4c2d20$var$$replace(string, $222bfc848c4c2d20$var$rePropName, function(match, number, quote, subString) {\n result[result.length] = quote ? $222bfc848c4c2d20$var$$replace(subString, $222bfc848c4c2d20$var$reEscapeChar, \"$1\") : number || match;\n });\n return result;\n};\n/* end adaptation */ var $222bfc848c4c2d20$var$getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n var intrinsicName = name;\n var alias;\n if ($G9Faa($222bfc848c4c2d20$var$LEGACY_ALIASES, intrinsicName)) {\n alias = $222bfc848c4c2d20$var$LEGACY_ALIASES[intrinsicName];\n intrinsicName = \"%\" + alias[0] + \"%\";\n }\n if ($G9Faa($222bfc848c4c2d20$var$INTRINSICS, intrinsicName)) {\n var value = $222bfc848c4c2d20$var$INTRINSICS[intrinsicName];\n if (value === $222bfc848c4c2d20$var$needsEval) value = $222bfc848c4c2d20$var$doEval(intrinsicName);\n if (typeof value === \"undefined\" && !allowMissing) throw new $222bfc848c4c2d20$var$$TypeError(\"intrinsic \" + name + \" exists, but is not available. Please file an issue!\");\n return {\n alias: alias,\n name: intrinsicName,\n value: value\n };\n }\n throw new $222bfc848c4c2d20$var$$SyntaxError(\"intrinsic \" + name + \" does not exist!\");\n};\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n if (typeof name !== \"string\" || name.length === 0) throw new $222bfc848c4c2d20$var$$TypeError(\"intrinsic name must be a non-empty string\");\n if (arguments.length > 1 && typeof allowMissing !== \"boolean\") throw new $222bfc848c4c2d20$var$$TypeError('\"allowMissing\" argument must be a boolean');\n if ($222bfc848c4c2d20$var$$exec(/^%?[^%]*%?$/, name) === null) throw new $222bfc848c4c2d20$var$$SyntaxError(\"`%` may not be present anywhere but at the beginning and end of the intrinsic name\");\n var parts = $222bfc848c4c2d20$var$stringToPath(name);\n var intrinsicBaseName = parts.length > 0 ? parts[0] : \"\";\n var intrinsic = $222bfc848c4c2d20$var$getBaseIntrinsic(\"%\" + intrinsicBaseName + \"%\", allowMissing);\n var intrinsicRealName = intrinsic.name;\n var value = intrinsic.value;\n var skipFurtherCaching = false;\n var alias = intrinsic.alias;\n if (alias) {\n intrinsicBaseName = alias[0];\n $222bfc848c4c2d20$var$$spliceApply(parts, $222bfc848c4c2d20$var$$concat([\n 0,\n 1\n ], alias));\n }\n for(var i = 1, isOwn = true; i < parts.length; i += 1){\n var part = parts[i];\n var first = $222bfc848c4c2d20$var$$strSlice(part, 0, 1);\n var last = $222bfc848c4c2d20$var$$strSlice(part, -1);\n if ((first === '\"' || first === \"'\" || first === \"`\" || last === '\"' || last === \"'\" || last === \"`\") && first !== last) throw new $222bfc848c4c2d20$var$$SyntaxError(\"property names with quotes must have matching quotes\");\n if (part === \"constructor\" || !isOwn) skipFurtherCaching = true;\n intrinsicBaseName += \".\" + part;\n intrinsicRealName = \"%\" + intrinsicBaseName + \"%\";\n if ($G9Faa($222bfc848c4c2d20$var$INTRINSICS, intrinsicRealName)) value = $222bfc848c4c2d20$var$INTRINSICS[intrinsicRealName];\n else if (value != null) {\n if (!(part in value)) {\n if (!allowMissing) throw new $222bfc848c4c2d20$var$$TypeError(\"base intrinsic for \" + name + \" exists, but the property is not available.\");\n return void 0;\n }\n if ($222bfc848c4c2d20$var$$gOPD && i + 1 >= parts.length) {\n var desc = $222bfc848c4c2d20$var$$gOPD(value, part);\n isOwn = !!desc;\n // By convention, when a data property is converted to an accessor\n // property to emulate a data property that does not suffer from\n // the override mistake, that accessor's getter is marked with\n // an `originalValue` property. Here, when we detect this, we\n // uphold the illusion by pretending to see that original data\n // property, i.e., returning the value rather than the getter\n // itself.\n if (isOwn && \"get\" in desc && !(\"originalValue\" in desc.get)) value = desc.get;\n else value = value[part];\n } else {\n isOwn = $G9Faa(value, part);\n value = value[part];\n }\n if (isOwn && !skipFurtherCaching) $222bfc848c4c2d20$var$INTRINSICS[intrinsicRealName] = value;\n }\n }\n return value;\n};\n\n});\nparcelRegister(\"dk94G\", function(module, exports) {\n\"use strict\";\nvar $9b342ea1c5e1f709$var$origSymbol = typeof Symbol !== \"undefined\" && Symbol;\n\nvar $grYrm = parcelRequire(\"grYrm\");\nmodule.exports = function hasNativeSymbols() {\n if (typeof $9b342ea1c5e1f709$var$origSymbol !== \"function\") return false;\n if (typeof Symbol !== \"function\") return false;\n if (typeof $9b342ea1c5e1f709$var$origSymbol(\"foo\") !== \"symbol\") return false;\n if (typeof Symbol(\"bar\") !== \"symbol\") return false;\n return $grYrm();\n};\n\n});\n\nparcelRegister(\"2GNOT\", function(module, exports) {\n\"use strict\";\nvar $1f56262e97e17693$var$test = {\n foo: {}\n};\nvar $1f56262e97e17693$var$$Object = Object;\nmodule.exports = function hasProto() {\n return ({\n __proto__: $1f56262e97e17693$var$test\n }).foo === $1f56262e97e17693$var$test.foo && !(({\n __proto__: null\n }) instanceof $1f56262e97e17693$var$$Object);\n};\n\n});\n\nparcelRegister(\"l7UhJ\", function(module, exports) {\n\"use strict\";\n\nvar $6LzS1 = parcelRequire(\"6LzS1\");\nmodule.exports = Function.prototype.bind || $6LzS1;\n\n});\nparcelRegister(\"6LzS1\", function(module, exports) {\n\"use strict\";\n/* eslint no-invalid-this: 1 */ var $4ed2f4f644981d90$var$ERROR_MESSAGE = \"Function.prototype.bind called on incompatible \";\nvar $4ed2f4f644981d90$var$toStr = Object.prototype.toString;\nvar $4ed2f4f644981d90$var$max = Math.max;\nvar $4ed2f4f644981d90$var$funcType = \"[object Function]\";\nvar $4ed2f4f644981d90$var$concatty = function concatty(a, b) {\n var arr = [];\n for(var i = 0; i < a.length; i += 1)arr[i] = a[i];\n for(var j = 0; j < b.length; j += 1)arr[j + a.length] = b[j];\n return arr;\n};\nvar $4ed2f4f644981d90$var$slicy = function slicy(arrLike, offset) {\n var arr = [];\n for(var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1)arr[j] = arrLike[i];\n return arr;\n};\nvar $4ed2f4f644981d90$var$joiny = function(arr, joiner) {\n var str = \"\";\n for(var i = 0; i < arr.length; i += 1){\n str += arr[i];\n if (i + 1 < arr.length) str += joiner;\n }\n return str;\n};\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== \"function\" || $4ed2f4f644981d90$var$toStr.apply(target) !== $4ed2f4f644981d90$var$funcType) throw new TypeError($4ed2f4f644981d90$var$ERROR_MESSAGE + target);\n var args = $4ed2f4f644981d90$var$slicy(arguments, 1);\n var bound;\n var binder = function() {\n if (this instanceof bound) {\n var result = target.apply(this, $4ed2f4f644981d90$var$concatty(args, arguments));\n if (Object(result) === result) return result;\n return this;\n }\n return target.apply(that, $4ed2f4f644981d90$var$concatty(args, arguments));\n };\n var boundLength = $4ed2f4f644981d90$var$max(0, target.length - args.length);\n var boundArgs = [];\n for(var i = 0; i < boundLength; i++)boundArgs[i] = \"$\" + i;\n bound = Function(\"binder\", \"return function (\" + $4ed2f4f644981d90$var$joiny(boundArgs, \",\") + \"){ return binder.apply(this,arguments); }\")(binder);\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n return bound;\n};\n\n});\n\n\nparcelRegister(\"G9Faa\", function(module, exports) {\n\"use strict\";\nvar $07eb6b366f8e40b5$var$call = Function.prototype.call;\nvar $07eb6b366f8e40b5$var$$hasOwn = Object.prototype.hasOwnProperty;\n\nvar $l7UhJ = parcelRequire(\"l7UhJ\");\n/** @type {(o: {}, p: PropertyKey) => p is keyof o} */ module.exports = $l7UhJ.call($07eb6b366f8e40b5$var$call, $07eb6b366f8e40b5$var$$hasOwn);\n\n});\n\n\nparcelRegister(\"70X2U\", function(module, exports) {\n\"use strict\";\n\nvar $l7UhJ = parcelRequire(\"l7UhJ\");\n\nvar $2VTxt = parcelRequire(\"2VTxt\");\n\nvar $5A9i6 = parcelRequire(\"5A9i6\");\nvar $0151647adf448d23$var$$TypeError = $2VTxt(\"%TypeError%\");\nvar $0151647adf448d23$var$$apply = $2VTxt(\"%Function.prototype.apply%\");\nvar $0151647adf448d23$var$$call = $2VTxt(\"%Function.prototype.call%\");\nvar $0151647adf448d23$var$$reflectApply = $2VTxt(\"%Reflect.apply%\", true) || $l7UhJ.call($0151647adf448d23$var$$call, $0151647adf448d23$var$$apply);\nvar $0151647adf448d23$var$$defineProperty = $2VTxt(\"%Object.defineProperty%\", true);\nvar $0151647adf448d23$var$$max = $2VTxt(\"%Math.max%\");\nif ($0151647adf448d23$var$$defineProperty) try {\n $0151647adf448d23$var$$defineProperty({}, \"a\", {\n value: 1\n });\n} catch (e) {\n // IE 8 has a broken defineProperty\n $0151647adf448d23$var$$defineProperty = null;\n}\nmodule.exports = function callBind(originalFunction) {\n if (typeof originalFunction !== \"function\") throw new $0151647adf448d23$var$$TypeError(\"a function is required\");\n var func = $0151647adf448d23$var$$reflectApply($l7UhJ, $0151647adf448d23$var$$call, arguments);\n return $5A9i6(func, 1 + $0151647adf448d23$var$$max(0, originalFunction.length - (arguments.length - 1)), true);\n};\nvar $0151647adf448d23$var$applyBind = function applyBind() {\n return $0151647adf448d23$var$$reflectApply($l7UhJ, $0151647adf448d23$var$$apply, arguments);\n};\nif ($0151647adf448d23$var$$defineProperty) $0151647adf448d23$var$$defineProperty(module.exports, \"apply\", {\n value: $0151647adf448d23$var$applyBind\n});\nelse module.exports.apply = $0151647adf448d23$var$applyBind;\n\n});\nparcelRegister(\"5A9i6\", function(module, exports) {\n\"use strict\";\n\nvar $2VTxt = parcelRequire(\"2VTxt\");\n\nvar $eHoge = parcelRequire(\"eHoge\");\n\nvar $4107858ba1a6bd6b$var$hasDescriptors = (parcelRequire(\"gkTZB\"))();\n\nvar $do5eO = parcelRequire(\"do5eO\");\nvar $4107858ba1a6bd6b$var$$TypeError = $2VTxt(\"%TypeError%\");\nvar $4107858ba1a6bd6b$var$$floor = $2VTxt(\"%Math.floor%\");\nmodule.exports = function setFunctionLength(fn, length) {\n if (typeof fn !== \"function\") throw new $4107858ba1a6bd6b$var$$TypeError(\"`fn` is not a function\");\n if (typeof length !== \"number\" || length < 0 || length > 0xFFFFFFFF || $4107858ba1a6bd6b$var$$floor(length) !== length) throw new $4107858ba1a6bd6b$var$$TypeError(\"`length` must be a positive 32-bit integer\");\n var loose = arguments.length > 2 && !!arguments[2];\n var functionLengthIsConfigurable = true;\n var functionLengthIsWritable = true;\n if (\"length\" in fn && $do5eO) {\n var desc = $do5eO(fn, \"length\");\n if (desc && !desc.configurable) functionLengthIsConfigurable = false;\n if (desc && !desc.writable) functionLengthIsWritable = false;\n }\n if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n if ($4107858ba1a6bd6b$var$hasDescriptors) $eHoge(fn, \"length\", length, true, true);\n else $eHoge(fn, \"length\", length);\n }\n return fn;\n};\n\n});\nparcelRegister(\"eHoge\", function(module, exports) {\n\"use strict\";\n\nvar $ab37e68af3e9e6be$var$hasPropertyDescriptors = (parcelRequire(\"gkTZB\"))();\n\nvar $2VTxt = parcelRequire(\"2VTxt\");\nvar $ab37e68af3e9e6be$var$$defineProperty = $ab37e68af3e9e6be$var$hasPropertyDescriptors && $2VTxt(\"%Object.defineProperty%\", true);\nif ($ab37e68af3e9e6be$var$$defineProperty) try {\n $ab37e68af3e9e6be$var$$defineProperty({}, \"a\", {\n value: 1\n });\n} catch (e) {\n // IE 8 has a broken defineProperty\n $ab37e68af3e9e6be$var$$defineProperty = false;\n}\nvar $ab37e68af3e9e6be$var$$SyntaxError = $2VTxt(\"%SyntaxError%\");\nvar $ab37e68af3e9e6be$var$$TypeError = $2VTxt(\"%TypeError%\");\n\nvar $do5eO = parcelRequire(\"do5eO\");\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */ module.exports = function defineDataProperty(obj, property, value) {\n if (!obj || typeof obj !== \"object\" && typeof obj !== \"function\") throw new $ab37e68af3e9e6be$var$$TypeError(\"`obj` must be an object or a function`\");\n if (typeof property !== \"string\" && typeof property !== \"symbol\") throw new $ab37e68af3e9e6be$var$$TypeError(\"`property` must be a string or a symbol`\");\n if (arguments.length > 3 && typeof arguments[3] !== \"boolean\" && arguments[3] !== null) throw new $ab37e68af3e9e6be$var$$TypeError(\"`nonEnumerable`, if provided, must be a boolean or null\");\n if (arguments.length > 4 && typeof arguments[4] !== \"boolean\" && arguments[4] !== null) throw new $ab37e68af3e9e6be$var$$TypeError(\"`nonWritable`, if provided, must be a boolean or null\");\n if (arguments.length > 5 && typeof arguments[5] !== \"boolean\" && arguments[5] !== null) throw new $ab37e68af3e9e6be$var$$TypeError(\"`nonConfigurable`, if provided, must be a boolean or null\");\n if (arguments.length > 6 && typeof arguments[6] !== \"boolean\") throw new $ab37e68af3e9e6be$var$$TypeError(\"`loose`, if provided, must be a boolean\");\n var nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n var nonWritable = arguments.length > 4 ? arguments[4] : null;\n var nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n var loose = arguments.length > 6 ? arguments[6] : false;\n /* @type {false | TypedPropertyDescriptor} */ var desc = !!$do5eO && $do5eO(obj, property);\n if ($ab37e68af3e9e6be$var$$defineProperty) $ab37e68af3e9e6be$var$$defineProperty(obj, property, {\n configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n value: value,\n writable: nonWritable === null && desc ? desc.writable : !nonWritable\n });\n else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n obj[property] = value; // eslint-disable-line no-param-reassign\n else throw new $ab37e68af3e9e6be$var$$SyntaxError(\"This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.\");\n};\n\n});\nparcelRegister(\"gkTZB\", function(module, exports) {\n\"use strict\";\n\nvar $2VTxt = parcelRequire(\"2VTxt\");\nvar $be49f289de13b757$var$$defineProperty = $2VTxt(\"%Object.defineProperty%\", true);\nvar $be49f289de13b757$var$hasPropertyDescriptors = function hasPropertyDescriptors() {\n if ($be49f289de13b757$var$$defineProperty) try {\n $be49f289de13b757$var$$defineProperty({}, \"a\", {\n value: 1\n });\n return true;\n } catch (e) {\n // IE 8 has a broken defineProperty\n return false;\n }\n return false;\n};\n$be49f289de13b757$var$hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n // node v0.6 has a bug where array lengths can be Set but not Defined\n if (!$be49f289de13b757$var$hasPropertyDescriptors()) return null;\n try {\n return $be49f289de13b757$var$$defineProperty([], \"length\", {\n value: 1\n }).length !== 1;\n } catch (e) {\n // In Firefox 4-22, defining length on an array throws an exception.\n return true;\n }\n};\nmodule.exports = $be49f289de13b757$var$hasPropertyDescriptors;\n\n});\n\nparcelRegister(\"do5eO\", function(module, exports) {\n\"use strict\";\n\nvar $2VTxt = parcelRequire(\"2VTxt\");\nvar $9bf19466cddb0914$var$$gOPD = $2VTxt(\"%Object.getOwnPropertyDescriptor%\", true);\nif ($9bf19466cddb0914$var$$gOPD) try {\n $9bf19466cddb0914$var$$gOPD([], \"length\");\n} catch (e) {\n // IE 8 has a broken gOPD\n $9bf19466cddb0914$var$$gOPD = null;\n}\nmodule.exports = $9bf19466cddb0914$var$$gOPD;\n\n});\n\n\n\n\n\n\nparcelRegister(\"9mPZQ\", function(module, exports) {\n\"use strict\";\nvar $6d1e808f9d1ac98b$var$toStr = Object.prototype.toString;\nvar $6d1e808f9d1ac98b$var$fnToStr = Function.prototype.toString;\nvar $6d1e808f9d1ac98b$var$isFnRegex = /^\\s*(?:function)?\\*/;\n\nvar $6d1e808f9d1ac98b$var$hasToStringTag = (parcelRequire(\"goA1T\"))();\nvar $6d1e808f9d1ac98b$var$getProto = Object.getPrototypeOf;\nvar $6d1e808f9d1ac98b$var$getGeneratorFunc = function() {\n if (!$6d1e808f9d1ac98b$var$hasToStringTag) return false;\n try {\n return Function(\"return function*() {}\")();\n } catch (e) {}\n};\nvar $6d1e808f9d1ac98b$var$GeneratorFunction;\nmodule.exports = function isGeneratorFunction(fn) {\n if (typeof fn !== \"function\") return false;\n if ($6d1e808f9d1ac98b$var$isFnRegex.test($6d1e808f9d1ac98b$var$fnToStr.call(fn))) return true;\n if (!$6d1e808f9d1ac98b$var$hasToStringTag) {\n var str = $6d1e808f9d1ac98b$var$toStr.call(fn);\n return str === \"[object GeneratorFunction]\";\n }\n if (!$6d1e808f9d1ac98b$var$getProto) return false;\n if (typeof $6d1e808f9d1ac98b$var$GeneratorFunction === \"undefined\") {\n var generatorFunc = $6d1e808f9d1ac98b$var$getGeneratorFunc();\n $6d1e808f9d1ac98b$var$GeneratorFunction = generatorFunc ? $6d1e808f9d1ac98b$var$getProto(generatorFunc) : false;\n }\n return $6d1e808f9d1ac98b$var$getProto(fn) === $6d1e808f9d1ac98b$var$GeneratorFunction;\n};\n\n});\n\nparcelRegister(\"6Sxxf\", function(module, exports) {\n\"use strict\";\n\nvar $98Y2N = parcelRequire(\"98Y2N\");\n\nvar $fHmwU = parcelRequire(\"fHmwU\");\n\nvar $70X2U = parcelRequire(\"70X2U\");\n\nvar $3e3ab = parcelRequire(\"3e3ab\");\n\nvar $do5eO = parcelRequire(\"do5eO\");\nvar $5021cc9e64bc53c4$var$$toString = $3e3ab(\"Object.prototype.toString\");\n\nvar $5021cc9e64bc53c4$var$hasToStringTag = (parcelRequire(\"goA1T\"))();\nvar $5021cc9e64bc53c4$var$g = typeof globalThis === \"undefined\" ? $parcel$global : globalThis;\nvar $5021cc9e64bc53c4$var$typedArrays = $fHmwU();\nvar $5021cc9e64bc53c4$var$$slice = $3e3ab(\"String.prototype.slice\");\nvar $5021cc9e64bc53c4$var$getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\nvar $5021cc9e64bc53c4$var$$indexOf = $3e3ab(\"Array.prototype.indexOf\", true) || function indexOf(array, value) {\n for(var i = 0; i < array.length; i += 1){\n if (array[i] === value) return i;\n }\n return -1;\n};\nvar $5021cc9e64bc53c4$var$cache = {\n __proto__: null\n};\nif ($5021cc9e64bc53c4$var$hasToStringTag && $do5eO && $5021cc9e64bc53c4$var$getPrototypeOf) $98Y2N($5021cc9e64bc53c4$var$typedArrays, function(typedArray) {\n var arr = new $5021cc9e64bc53c4$var$g[typedArray]();\n if (Symbol.toStringTag in arr) {\n var proto = $5021cc9e64bc53c4$var$getPrototypeOf(arr);\n var descriptor = $do5eO(proto, Symbol.toStringTag);\n if (!descriptor) {\n var superProto = $5021cc9e64bc53c4$var$getPrototypeOf(proto);\n descriptor = $do5eO(superProto, Symbol.toStringTag);\n }\n $5021cc9e64bc53c4$var$cache[\"$\" + typedArray] = $70X2U(descriptor.get);\n }\n});\nelse $98Y2N($5021cc9e64bc53c4$var$typedArrays, function(typedArray) {\n var arr = new $5021cc9e64bc53c4$var$g[typedArray]();\n var fn = arr.slice || arr.set;\n if (fn) $5021cc9e64bc53c4$var$cache[\"$\" + typedArray] = $70X2U(fn);\n});\nvar $5021cc9e64bc53c4$var$tryTypedArrays = function tryAllTypedArrays(value) {\n var found = false;\n $98Y2N($5021cc9e64bc53c4$var$cache, function(getter, typedArray) {\n if (!found) try {\n if (\"$\" + getter(value) === typedArray) found = $5021cc9e64bc53c4$var$$slice(typedArray, 1);\n } catch (e) {}\n });\n return found;\n};\nvar $5021cc9e64bc53c4$var$trySlices = function tryAllSlices(value) {\n var found = false;\n $98Y2N($5021cc9e64bc53c4$var$cache, function(getter, name) {\n if (!found) try {\n getter(value);\n found = $5021cc9e64bc53c4$var$$slice(name, 1);\n } catch (e) {}\n });\n return found;\n};\nmodule.exports = function whichTypedArray(value) {\n if (!value || typeof value !== \"object\") return false;\n if (!$5021cc9e64bc53c4$var$hasToStringTag) {\n var tag = $5021cc9e64bc53c4$var$$slice($5021cc9e64bc53c4$var$$toString(value), 8, -1);\n if ($5021cc9e64bc53c4$var$$indexOf($5021cc9e64bc53c4$var$typedArrays, tag) > -1) return tag;\n if (tag !== \"Object\") return false;\n // node < 0.6 hits here on real Typed Arrays\n return $5021cc9e64bc53c4$var$trySlices(value);\n }\n if (!$do5eO) return null;\n // unknown engine\n return $5021cc9e64bc53c4$var$tryTypedArrays(value);\n};\n\n});\nparcelRegister(\"98Y2N\", function(module, exports) {\n\"use strict\";\n\nvar $d13gJ = parcelRequire(\"d13gJ\");\nvar $6a836ff0bde6ce0d$var$toStr = Object.prototype.toString;\nvar $6a836ff0bde6ce0d$var$hasOwnProperty = Object.prototype.hasOwnProperty;\nvar $6a836ff0bde6ce0d$var$forEachArray = function forEachArray(array, iterator, receiver) {\n for(var i = 0, len = array.length; i < len; i++)if ($6a836ff0bde6ce0d$var$hasOwnProperty.call(array, i)) {\n if (receiver == null) iterator(array[i], i, array);\n else iterator.call(receiver, array[i], i, array);\n }\n};\nvar $6a836ff0bde6ce0d$var$forEachString = function forEachString(string, iterator, receiver) {\n for(var i = 0, len = string.length; i < len; i++)// no such thing as a sparse string.\n if (receiver == null) iterator(string.charAt(i), i, string);\n else iterator.call(receiver, string.charAt(i), i, string);\n};\nvar $6a836ff0bde6ce0d$var$forEachObject = function forEachObject(object, iterator, receiver) {\n for(var k in object)if ($6a836ff0bde6ce0d$var$hasOwnProperty.call(object, k)) {\n if (receiver == null) iterator(object[k], k, object);\n else iterator.call(receiver, object[k], k, object);\n }\n};\nvar $6a836ff0bde6ce0d$var$forEach = function forEach(list, iterator, thisArg) {\n if (!$d13gJ(iterator)) throw new TypeError(\"iterator must be a function\");\n var receiver;\n if (arguments.length >= 3) receiver = thisArg;\n if ($6a836ff0bde6ce0d$var$toStr.call(list) === \"[object Array]\") $6a836ff0bde6ce0d$var$forEachArray(list, iterator, receiver);\n else if (typeof list === \"string\") $6a836ff0bde6ce0d$var$forEachString(list, iterator, receiver);\n else $6a836ff0bde6ce0d$var$forEachObject(list, iterator, receiver);\n};\nmodule.exports = $6a836ff0bde6ce0d$var$forEach;\n\n});\nparcelRegister(\"d13gJ\", function(module, exports) {\n\"use strict\";\nvar $979de77de5cc0a8e$var$fnToStr = Function.prototype.toString;\nvar $979de77de5cc0a8e$var$reflectApply = typeof Reflect === \"object\" && Reflect !== null && Reflect.apply;\nvar $979de77de5cc0a8e$var$badArrayLike;\nvar $979de77de5cc0a8e$var$isCallableMarker;\nif (typeof $979de77de5cc0a8e$var$reflectApply === \"function\" && typeof Object.defineProperty === \"function\") try {\n $979de77de5cc0a8e$var$badArrayLike = Object.defineProperty({}, \"length\", {\n get: function() {\n throw $979de77de5cc0a8e$var$isCallableMarker;\n }\n });\n $979de77de5cc0a8e$var$isCallableMarker = {};\n // eslint-disable-next-line no-throw-literal\n $979de77de5cc0a8e$var$reflectApply(function() {\n throw 42;\n }, null, $979de77de5cc0a8e$var$badArrayLike);\n} catch (_) {\n if (_ !== $979de77de5cc0a8e$var$isCallableMarker) $979de77de5cc0a8e$var$reflectApply = null;\n}\nelse $979de77de5cc0a8e$var$reflectApply = null;\nvar $979de77de5cc0a8e$var$constructorRegex = /^\\s*class\\b/;\nvar $979de77de5cc0a8e$var$isES6ClassFn = function isES6ClassFunction(value) {\n try {\n var fnStr = $979de77de5cc0a8e$var$fnToStr.call(value);\n return $979de77de5cc0a8e$var$constructorRegex.test(fnStr);\n } catch (e) {\n return false; // not a function\n }\n};\nvar $979de77de5cc0a8e$var$tryFunctionObject = function tryFunctionToStr(value) {\n try {\n if ($979de77de5cc0a8e$var$isES6ClassFn(value)) return false;\n $979de77de5cc0a8e$var$fnToStr.call(value);\n return true;\n } catch (e) {\n return false;\n }\n};\nvar $979de77de5cc0a8e$var$toStr = Object.prototype.toString;\nvar $979de77de5cc0a8e$var$objectClass = \"[object Object]\";\nvar $979de77de5cc0a8e$var$fnClass = \"[object Function]\";\nvar $979de77de5cc0a8e$var$genClass = \"[object GeneratorFunction]\";\nvar $979de77de5cc0a8e$var$ddaClass = \"[object HTMLAllCollection]\"; // IE 11\nvar $979de77de5cc0a8e$var$ddaClass2 = \"[object HTML document.all class]\";\nvar $979de77de5cc0a8e$var$ddaClass3 = \"[object HTMLCollection]\"; // IE 9-10\nvar $979de77de5cc0a8e$var$hasToStringTag = typeof Symbol === \"function\" && !!Symbol.toStringTag; // better: use `has-tostringtag`\nvar $979de77de5cc0a8e$var$isIE68 = !(0 in [\n , \n]); // eslint-disable-line no-sparse-arrays, comma-spacing\nvar $979de77de5cc0a8e$var$isDDA = function isDocumentDotAll() {\n return false;\n};\nif (typeof document === \"object\") {\n // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n var $979de77de5cc0a8e$var$all = document.all;\n if ($979de77de5cc0a8e$var$toStr.call($979de77de5cc0a8e$var$all) === $979de77de5cc0a8e$var$toStr.call(document.all)) $979de77de5cc0a8e$var$isDDA = function isDocumentDotAll(value) {\n /* globals document: false */ // in IE 6-8, typeof document.all is \"object\" and it's truthy\n if (($979de77de5cc0a8e$var$isIE68 || !value) && (typeof value === \"undefined\" || typeof value === \"object\")) try {\n var str = $979de77de5cc0a8e$var$toStr.call(value);\n return (str === $979de77de5cc0a8e$var$ddaClass || str === $979de77de5cc0a8e$var$ddaClass2 || str === $979de77de5cc0a8e$var$ddaClass3 // opera 12.16\n || str === $979de77de5cc0a8e$var$objectClass // IE 6-8\n ) && value(\"\") == null; // eslint-disable-line eqeqeq\n } catch (e) {}\n return false;\n };\n}\nmodule.exports = $979de77de5cc0a8e$var$reflectApply ? function isCallable(value) {\n if ($979de77de5cc0a8e$var$isDDA(value)) return true;\n if (!value) return false;\n if (typeof value !== \"function\" && typeof value !== \"object\") return false;\n try {\n $979de77de5cc0a8e$var$reflectApply(value, null, $979de77de5cc0a8e$var$badArrayLike);\n } catch (e) {\n if (e !== $979de77de5cc0a8e$var$isCallableMarker) return false;\n }\n return !$979de77de5cc0a8e$var$isES6ClassFn(value) && $979de77de5cc0a8e$var$tryFunctionObject(value);\n} : function isCallable(value) {\n if ($979de77de5cc0a8e$var$isDDA(value)) return true;\n if (!value) return false;\n if (typeof value !== \"function\" && typeof value !== \"object\") return false;\n if ($979de77de5cc0a8e$var$hasToStringTag) return $979de77de5cc0a8e$var$tryFunctionObject(value);\n if ($979de77de5cc0a8e$var$isES6ClassFn(value)) return false;\n var strClass = $979de77de5cc0a8e$var$toStr.call(value);\n if (strClass !== $979de77de5cc0a8e$var$fnClass && strClass !== $979de77de5cc0a8e$var$genClass && !/^\\[object HTML/.test(strClass)) return false;\n return $979de77de5cc0a8e$var$tryFunctionObject(value);\n};\n\n});\n\n\nparcelRegister(\"fHmwU\", function(module, exports) {\n\"use strict\";\nvar $b6dc5923138db0e6$var$possibleNames = [\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Float32Array\",\n \"Float64Array\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\"\n];\nvar $b6dc5923138db0e6$var$g = typeof globalThis === \"undefined\" ? $parcel$global : globalThis;\nmodule.exports = function availableTypedArrays() {\n var out = [];\n for(var i = 0; i < $b6dc5923138db0e6$var$possibleNames.length; i++)if (typeof $b6dc5923138db0e6$var$g[$b6dc5923138db0e6$var$possibleNames[i]] === \"function\") out[out.length] = $b6dc5923138db0e6$var$possibleNames[i];\n return out;\n};\n\n});\n\n\nparcelRegister(\"bbrRm\", function(module, exports) {\n\"use strict\";\n\nvar $6Sxxf = parcelRequire(\"6Sxxf\");\nmodule.exports = function isTypedArray(value) {\n return !!$6Sxxf(value);\n};\n\n});\n\n\nparcelRegister(\"1qVfH\", function(module, exports) {\nmodule.exports = function isBuffer(arg) {\n return arg && typeof arg === \"object\" && typeof arg.copy === \"function\" && typeof arg.fill === \"function\" && typeof arg.readUInt8 === \"function\";\n};\n\n});\n\nparcelRegister(\"9TvxW\", function(module, exports) {\nif (typeof Object.create === \"function\") // implementation from standard node.js 'util' module\nmodule.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n};\nelse // old school shim for old browsers\nmodule.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function() {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n};\n\n});\n\n\n\nparcelRegister(\"7aMwq\", function(module, exports) {\n// Currently in sync with Node.js lib/internal/assert/assertion_error.js\n// https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c\n\nvar $2fLxs = parcelRequire(\"2fLxs\");\n\"use strict\";\nfunction $538f1b056a09a255$var$ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function(r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction $538f1b056a09a255$var$_objectSpread(e) {\n for(var r = 1; r < arguments.length; r++){\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? $538f1b056a09a255$var$ownKeys(Object(t), !0).forEach(function(r) {\n $538f1b056a09a255$var$_defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : $538f1b056a09a255$var$ownKeys(Object(t)).forEach(function(r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nfunction $538f1b056a09a255$var$_defineProperty(obj, key, value) {\n key = $538f1b056a09a255$var$_toPropertyKey(key);\n if (key in obj) Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n else obj[key] = value;\n return obj;\n}\nfunction $538f1b056a09a255$var$_classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction $538f1b056a09a255$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, $538f1b056a09a255$var$_toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction $538f1b056a09a255$var$_createClass(Constructor, protoProps, staticProps) {\n if (protoProps) $538f1b056a09a255$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $538f1b056a09a255$var$_defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction $538f1b056a09a255$var$_toPropertyKey(arg) {\n var key = $538f1b056a09a255$var$_toPrimitive(arg, \"string\");\n return $538f1b056a09a255$var$_typeof(key) === \"symbol\" ? key : String(key);\n}\nfunction $538f1b056a09a255$var$_toPrimitive(input, hint) {\n if ($538f1b056a09a255$var$_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if ($538f1b056a09a255$var$_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction $538f1b056a09a255$var$_inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) throw new TypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) $538f1b056a09a255$var$_setPrototypeOf(subClass, superClass);\n}\nfunction $538f1b056a09a255$var$_createSuper(Derived) {\n var hasNativeReflectConstruct = $538f1b056a09a255$var$_isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = $538f1b056a09a255$var$_getPrototypeOf(Derived), result;\n if (hasNativeReflectConstruct) {\n var NewTarget = $538f1b056a09a255$var$_getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else result = Super.apply(this, arguments);\n return $538f1b056a09a255$var$_possibleConstructorReturn(this, result);\n };\n}\nfunction $538f1b056a09a255$var$_possibleConstructorReturn(self, call) {\n if (call && ($538f1b056a09a255$var$_typeof(call) === \"object\" || typeof call === \"function\")) return call;\n else if (call !== void 0) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return $538f1b056a09a255$var$_assertThisInitialized(self);\n}\nfunction $538f1b056a09a255$var$_assertThisInitialized(self) {\n if (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n}\nfunction $538f1b056a09a255$var$_wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n $538f1b056a09a255$var$_wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !$538f1b056a09a255$var$_isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") throw new TypeError(\"Super expression must either be null or a function\");\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return $538f1b056a09a255$var$_construct(Class, arguments, $538f1b056a09a255$var$_getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return $538f1b056a09a255$var$_setPrototypeOf(Wrapper, Class);\n };\n return $538f1b056a09a255$var$_wrapNativeSuper(Class);\n}\nfunction $538f1b056a09a255$var$_construct(Parent, args, Class) {\n if ($538f1b056a09a255$var$_isNativeReflectConstruct()) $538f1b056a09a255$var$_construct = Reflect.construct.bind();\n else $538f1b056a09a255$var$_construct = function _construct(Parent, args, Class) {\n var a = [\n null\n ];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) $538f1b056a09a255$var$_setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n return $538f1b056a09a255$var$_construct.apply(null, arguments);\n}\nfunction $538f1b056a09a255$var$_isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n}\nfunction $538f1b056a09a255$var$_isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\nfunction $538f1b056a09a255$var$_setPrototypeOf(o, p) {\n $538f1b056a09a255$var$_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return $538f1b056a09a255$var$_setPrototypeOf(o, p);\n}\nfunction $538f1b056a09a255$var$_getPrototypeOf(o) {\n $538f1b056a09a255$var$_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return $538f1b056a09a255$var$_getPrototypeOf(o);\n}\nfunction $538f1b056a09a255$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $538f1b056a09a255$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $538f1b056a09a255$var$_typeof(o);\n}\n\nvar $gQylu = parcelRequire(\"gQylu\");\nvar $538f1b056a09a255$var$inspect = $gQylu.inspect;\n\nvar $fgTSu = parcelRequire(\"fgTSu\");\nvar $538f1b056a09a255$var$ERR_INVALID_ARG_TYPE = $fgTSu.codes.ERR_INVALID_ARG_TYPE;\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction $538f1b056a09a255$var$endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) this_len = str.length;\n return str.substring(this_len - search.length, this_len) === search;\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\nfunction $538f1b056a09a255$var$repeat(str, count) {\n count = Math.floor(count);\n if (str.length == 0 || count == 0) return \"\";\n var maxCount = str.length * count;\n count = Math.floor(Math.log(count) / Math.log(2));\n while(count){\n str += str;\n count--;\n }\n str += str.substring(0, maxCount - str.length);\n return str;\n}\nvar $538f1b056a09a255$var$blue = \"\";\nvar $538f1b056a09a255$var$green = \"\";\nvar $538f1b056a09a255$var$red = \"\";\nvar $538f1b056a09a255$var$white = \"\";\nvar $538f1b056a09a255$var$kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n};\n// Comparing short primitives should just show === / !== instead of using the\n// diff.\nvar $538f1b056a09a255$var$kMaxShortLength = 10;\nfunction $538f1b056a09a255$var$copyError(source) {\n var keys = Object.keys(source);\n var target = Object.create(Object.getPrototypeOf(source));\n keys.forEach(function(key) {\n target[key] = source[key];\n });\n Object.defineProperty(target, \"message\", {\n value: source.message\n });\n return target;\n}\nfunction $538f1b056a09a255$var$inspectValue(val) {\n // The util.inspect default values could be changed. This makes sure the\n // error messages contain the necessary information nevertheless.\n return $538f1b056a09a255$var$inspect(val, {\n compact: false,\n customInspect: false,\n depth: 1000,\n maxArrayLength: Infinity,\n // Assert compares only enumerable properties (with a few exceptions).\n showHidden: false,\n // Having a long line as error is better than wrapping the line for\n // comparison for now.\n // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we\n // have meta information about the inspected properties (i.e., know where\n // in what line the property starts and ends).\n breakLength: Infinity,\n // Assert does not detect proxies currently.\n showProxy: false,\n sorted: true,\n // Inspect getters as we also check them when comparing entries.\n getters: true\n });\n}\nfunction $538f1b056a09a255$var$createErrDiff(actual, expected, operator) {\n var other = \"\";\n var res = \"\";\n var lastPos = 0;\n var end = \"\";\n var skipped = false;\n var actualInspected = $538f1b056a09a255$var$inspectValue(actual);\n var actualLines = actualInspected.split(\"\\n\");\n var expectedLines = $538f1b056a09a255$var$inspectValue(expected).split(\"\\n\");\n var i = 0;\n var indicator = \"\";\n // In case both values are objects explicitly mark them as not reference equal\n // for the `strictEqual` operator.\n if (operator === \"strictEqual\" && $538f1b056a09a255$var$_typeof(actual) === \"object\" && $538f1b056a09a255$var$_typeof(expected) === \"object\" && actual !== null && expected !== null) operator = \"strictEqualObject\";\n // If \"actual\" and \"expected\" fit on a single line and they are not strictly\n // equal, check further special handling.\n if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n // If the character length of \"actual\" and \"expected\" together is less than\n // kMaxShortLength and if neither is an object and at least one of them is\n // not `zero`, use the strict equal comparison to visualize the output.\n if (inputLength <= $538f1b056a09a255$var$kMaxShortLength) {\n if (($538f1b056a09a255$var$_typeof(actual) !== \"object\" || actual === null) && ($538f1b056a09a255$var$_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0)) // -0 === +0\n return \"\".concat($538f1b056a09a255$var$kReadableOperator[operator], \"\\n\\n\") + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], \"\\n\");\n } else if (operator !== \"strictEqualObject\") {\n // If the stderr is a tty and the input length is lower than the current\n // columns per line, add a mismatch indicator below the output. If it is\n // not a tty, use a default value of 80 characters.\n var maxLength = $2fLxs.stderr && $2fLxs.stderr.isTTY ? $2fLxs.stderr.columns : 80;\n if (inputLength < maxLength) {\n while(actualLines[0][i] === expectedLines[0][i])i++;\n // Ignore the first characters.\n if (i > 2) {\n // Add position indicator for the first mismatch in case it is a\n // single line and the input length is less than the column length.\n indicator = \"\\n \".concat($538f1b056a09a255$var$repeat(\" \", i), \"^\");\n i = 0;\n }\n }\n }\n }\n // Remove all ending lines that match (this optimizes the output for\n // readability by reducing the number of total changed lines).\n var a = actualLines[actualLines.length - 1];\n var b = expectedLines[expectedLines.length - 1];\n while(a === b){\n if (i++ < 2) end = \"\\n \".concat(a).concat(end);\n else other = a;\n actualLines.pop();\n expectedLines.pop();\n if (actualLines.length === 0 || expectedLines.length === 0) break;\n a = actualLines[actualLines.length - 1];\n b = expectedLines[expectedLines.length - 1];\n }\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n // Strict equal with identical objects that are not identical by reference.\n // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() })\n if (maxLines === 0) {\n // We have to get the result again. The lines were all removed before.\n var _actualLines = actualInspected.split(\"\\n\");\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (_actualLines.length > 30) {\n _actualLines[26] = \"\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white);\n while(_actualLines.length > 27)_actualLines.pop();\n }\n return \"\".concat($538f1b056a09a255$var$kReadableOperator.notIdentical, \"\\n\\n\").concat(_actualLines.join(\"\\n\"), \"\\n\");\n }\n if (i > 3) {\n end = \"\\n\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white).concat(end);\n skipped = true;\n }\n if (other !== \"\") {\n end = \"\\n \".concat(other).concat(end);\n other = \"\";\n }\n var printedLines = 0;\n var msg = $538f1b056a09a255$var$kReadableOperator[operator] + \"\\n\".concat($538f1b056a09a255$var$green, \"+ actual\").concat($538f1b056a09a255$var$white, \" \").concat($538f1b056a09a255$var$red, \"- expected\").concat($538f1b056a09a255$var$white);\n var skippedMsg = \" \".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white, \" Lines skipped\");\n for(i = 0; i < maxLines; i++){\n // Only extra expected lines exist\n var cur = i - lastPos;\n if (actualLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(expectedLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(expectedLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the expected line to the cache.\n other += \"\\n\".concat($538f1b056a09a255$var$red, \"-\").concat($538f1b056a09a255$var$white, \" \").concat(expectedLines[i]);\n printedLines++;\n // Only extra actual lines exist\n } else if (expectedLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result.\n res += \"\\n\".concat($538f1b056a09a255$var$green, \"+\").concat($538f1b056a09a255$var$white, \" \").concat(actualLines[i]);\n printedLines++;\n // Lines diverge\n } else {\n var expectedLine = expectedLines[i];\n var actualLine = actualLines[i];\n // If the lines diverge, specifically check for lines that only diverge by\n // a trailing comma. In that case it is actually identical and we should\n // mark it as such.\n var divergingLines = actualLine !== expectedLine && (!$538f1b056a09a255$var$endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n // If the expected line has a trailing comma but is otherwise identical,\n // add a comma at the end of the actual line. Otherwise the output could\n // look weird as in:\n //\n // [\n // 1 // No comma at the end!\n // + 2\n // ]\n //\n if (divergingLines && $538f1b056a09a255$var$endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine) {\n divergingLines = false;\n actualLine += \",\";\n }\n if (divergingLines) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result and cache the expected diverging\n // line so consecutive diverging lines show up as +++--- and not +-+-+-.\n res += \"\\n\".concat($538f1b056a09a255$var$green, \"+\").concat($538f1b056a09a255$var$white, \" \").concat(actualLine);\n other += \"\\n\".concat($538f1b056a09a255$var$red, \"-\").concat($538f1b056a09a255$var$white, \" \").concat(expectedLine);\n printedLines += 2;\n // Lines are identical\n } else {\n // Add all cached information to the result before adding other things\n // and reset the cache.\n res += other;\n other = \"\";\n // If the last diverging line is exactly one line above or if it is the\n // very first line, add the line to the result.\n if (cur === 1 || i === 0) {\n res += \"\\n \".concat(actualLine);\n printedLines++;\n }\n }\n }\n // Inspected object to big (Show ~20 rows max)\n if (printedLines > 20 && i < maxLines - 2) return \"\".concat(msg).concat(skippedMsg, \"\\n\").concat(res, \"\\n\").concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white).concat(other, \"\\n\") + \"\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white);\n }\n return \"\".concat(msg).concat(skipped ? skippedMsg : \"\", \"\\n\").concat(res).concat(other).concat(end).concat(indicator);\n}\nvar $538f1b056a09a255$var$AssertionError = /*#__PURE__*/ function(_Error, _inspect$custom) {\n $538f1b056a09a255$var$_inherits(AssertionError, _Error);\n var _super = $538f1b056a09a255$var$_createSuper(AssertionError);\n function AssertionError(options) {\n var _this;\n $538f1b056a09a255$var$_classCallCheck(this, AssertionError);\n if ($538f1b056a09a255$var$_typeof(options) !== \"object\" || options === null) throw new $538f1b056a09a255$var$ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var message = options.message, operator = options.operator, stackStartFn = options.stackStartFn;\n var actual = options.actual, expected = options.expected;\n var limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n if (message != null) _this = _super.call(this, String(message));\n else {\n if ($2fLxs.stderr && $2fLxs.stderr.isTTY) {\n // Reset on each call to make sure we handle dynamically set environment\n // variables correct.\n if ($2fLxs.stderr && $2fLxs.stderr.getColorDepth && $2fLxs.stderr.getColorDepth() !== 1) {\n $538f1b056a09a255$var$blue = \"\\x1b[34m\";\n $538f1b056a09a255$var$green = \"\\x1b[32m\";\n $538f1b056a09a255$var$white = \"\\x1b[39m\";\n $538f1b056a09a255$var$red = \"\\x1b[31m\";\n } else {\n $538f1b056a09a255$var$blue = \"\";\n $538f1b056a09a255$var$green = \"\";\n $538f1b056a09a255$var$white = \"\";\n $538f1b056a09a255$var$red = \"\";\n }\n }\n // Prevent the error stack from being visible by duplicating the error\n // in a very close way to the original in case both sides are actually\n // instances of Error.\n if ($538f1b056a09a255$var$_typeof(actual) === \"object\" && actual !== null && $538f1b056a09a255$var$_typeof(expected) === \"object\" && expected !== null && \"stack\" in actual && actual instanceof Error && \"stack\" in expected && expected instanceof Error) {\n actual = $538f1b056a09a255$var$copyError(actual);\n expected = $538f1b056a09a255$var$copyError(expected);\n }\n if (operator === \"deepStrictEqual\" || operator === \"strictEqual\") _this = _super.call(this, $538f1b056a09a255$var$createErrDiff(actual, expected, operator));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n // In case the objects are equal but the operator requires unequal, show\n // the first object and say A equals B\n var base = $538f1b056a09a255$var$kReadableOperator[operator];\n var res = $538f1b056a09a255$var$inspectValue(actual).split(\"\\n\");\n // In case \"actual\" is an object, it should not be reference equal.\n if (operator === \"notStrictEqual\" && $538f1b056a09a255$var$_typeof(actual) === \"object\" && actual !== null) base = $538f1b056a09a255$var$kReadableOperator.notStrictEqualObject;\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (res.length > 30) {\n res[26] = \"\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white);\n while(res.length > 27)res.pop();\n }\n // Only print a single input.\n if (res.length === 1) _this = _super.call(this, \"\".concat(base, \" \").concat(res[0]));\n else _this = _super.call(this, \"\".concat(base, \"\\n\\n\").concat(res.join(\"\\n\"), \"\\n\"));\n } else {\n var _res = $538f1b056a09a255$var$inspectValue(actual);\n var other = \"\";\n var knownOperators = $538f1b056a09a255$var$kReadableOperator[operator];\n if (operator === \"notDeepEqual\" || operator === \"notEqual\") {\n _res = \"\".concat($538f1b056a09a255$var$kReadableOperator[operator], \"\\n\\n\").concat(_res);\n if (_res.length > 1024) _res = \"\".concat(_res.slice(0, 1021), \"...\");\n } else {\n other = \"\".concat($538f1b056a09a255$var$inspectValue(expected));\n if (_res.length > 512) _res = \"\".concat(_res.slice(0, 509), \"...\");\n if (other.length > 512) other = \"\".concat(other.slice(0, 509), \"...\");\n if (operator === \"deepEqual\" || operator === \"equal\") _res = \"\".concat(knownOperators, \"\\n\\n\").concat(_res, \"\\n\\nshould equal\\n\\n\");\n else other = \" \".concat(operator, \" \").concat(other);\n }\n _this = _super.call(this, \"\".concat(_res).concat(other));\n }\n }\n Error.stackTraceLimit = limit;\n _this.generatedMessage = !message;\n Object.defineProperty($538f1b056a09a255$var$_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: false,\n writable: true,\n configurable: true\n });\n _this.code = \"ERR_ASSERTION\";\n _this.actual = actual;\n _this.expected = expected;\n _this.operator = operator;\n if (Error.captureStackTrace) // eslint-disable-next-line no-restricted-syntax\n Error.captureStackTrace($538f1b056a09a255$var$_assertThisInitialized(_this), stackStartFn);\n // Create error message including the error code in the name.\n _this.stack;\n // Reset the name.\n _this.name = \"AssertionError\";\n return $538f1b056a09a255$var$_possibleConstructorReturn(_this);\n }\n $538f1b056a09a255$var$_createClass(AssertionError, [\n {\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: _inspect$custom,\n value: function value(recurseTimes, ctx) {\n // This limits the `actual` and `expected` property default inspection to\n // the minimum depth. Otherwise those values would be too verbose compared\n // to the actual error message which contains a combined view of these two\n // input values.\n return $538f1b056a09a255$var$inspect(this, $538f1b056a09a255$var$_objectSpread($538f1b056a09a255$var$_objectSpread({}, ctx), {}, {\n customInspect: false,\n depth: 0\n }));\n }\n }\n ]);\n return AssertionError;\n}(/*#__PURE__*/ $538f1b056a09a255$var$_wrapNativeSuper(Error), $538f1b056a09a255$var$inspect.custom);\nmodule.exports = $538f1b056a09a255$var$AssertionError;\n\n});\n\nparcelRegister(\"8D6gL\", function(module, exports) {\n\"use strict\";\n\nvar $8A6bc = parcelRequire(\"8A6bc\");\nvar $019f13f070986299$var$lacksProperEnumerationOrder = function() {\n if (!Object.assign) return false;\n /*\n\t * v8, specifically in node 4.x, has a bug with incorrect property enumeration order\n\t * note: this does not detect the bug unless there's 20 characters\n\t */ var str = \"abcdefghijklmnopqrst\";\n var letters = str.split(\"\");\n var map = {};\n for(var i = 0; i < letters.length; ++i)map[letters[i]] = letters[i];\n var obj = Object.assign({}, map);\n var actual = \"\";\n for(var k in obj)actual += k;\n return str !== actual;\n};\nvar $019f13f070986299$var$assignHasPendingExceptions = function() {\n if (!Object.assign || !Object.preventExtensions) return false;\n /*\n\t * Firefox 37 still has \"pending exception\" logic in its Object.assign implementation,\n\t * which is 72% slower than our shim, and Firefox 40's native implementation.\n\t */ var thrower = Object.preventExtensions({\n 1: 2\n });\n try {\n Object.assign(thrower, \"xy\");\n } catch (e) {\n return thrower[1] === \"y\";\n }\n return false;\n};\nmodule.exports = function getPolyfill() {\n if (!Object.assign) return $8A6bc;\n if ($019f13f070986299$var$lacksProperEnumerationOrder()) return $8A6bc;\n if ($019f13f070986299$var$assignHasPendingExceptions()) return $8A6bc;\n return Object.assign;\n};\n\n});\nparcelRegister(\"8A6bc\", function(module, exports) {\n\"use strict\";\n\nvar $gK6Se = parcelRequire(\"gK6Se\");\n\nvar $63f67aa80e2e6d42$var$hasSymbols = (parcelRequire(\"grYrm\"))();\n\nvar $3e3ab = parcelRequire(\"3e3ab\");\nvar $63f67aa80e2e6d42$var$toObject = Object;\nvar $63f67aa80e2e6d42$var$$push = $3e3ab(\"Array.prototype.push\");\nvar $63f67aa80e2e6d42$var$$propIsEnumerable = $3e3ab(\"Object.prototype.propertyIsEnumerable\");\nvar $63f67aa80e2e6d42$var$originalGetSymbols = $63f67aa80e2e6d42$var$hasSymbols ? Object.getOwnPropertySymbols : null;\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function assign(target, source1) {\n if (target == null) throw new TypeError(\"target must be an object\");\n var to = $63f67aa80e2e6d42$var$toObject(target); // step 1\n if (arguments.length === 1) return to; // step 2\n for(var s = 1; s < arguments.length; ++s){\n var from = $63f67aa80e2e6d42$var$toObject(arguments[s]); // step 3.a.i\n // step 3.a.ii:\n var keys = $gK6Se(from);\n var getSymbols = $63f67aa80e2e6d42$var$hasSymbols && (Object.getOwnPropertySymbols || $63f67aa80e2e6d42$var$originalGetSymbols);\n if (getSymbols) {\n var syms = getSymbols(from);\n for(var j = 0; j < syms.length; ++j){\n var key = syms[j];\n if ($63f67aa80e2e6d42$var$$propIsEnumerable(from, key)) $63f67aa80e2e6d42$var$$push(keys, key);\n }\n }\n // step 3.a.iii:\n for(var i = 0; i < keys.length; ++i){\n var nextKey = keys[i];\n if ($63f67aa80e2e6d42$var$$propIsEnumerable(from, nextKey)) {\n var propValue = from[nextKey]; // step 3.a.iii.2.a\n to[nextKey] = propValue; // step 3.a.iii.2.b\n }\n }\n }\n return to; // step 4\n};\n\n});\nparcelRegister(\"gK6Se\", function(module, exports) {\n\"use strict\";\nvar $c3064632e4f346e0$var$slice = Array.prototype.slice;\n\nvar $alwvH = parcelRequire(\"alwvH\");\nvar $c3064632e4f346e0$var$origKeys = Object.keys;\n\nvar $c3064632e4f346e0$var$keysShim = $c3064632e4f346e0$var$origKeys ? function keys(o) {\n return $c3064632e4f346e0$var$origKeys(o);\n} : (parcelRequire(\"2QCzs\"));\nvar $c3064632e4f346e0$var$originalKeys = Object.keys;\n$c3064632e4f346e0$var$keysShim.shim = function shimObjectKeys() {\n if (Object.keys) {\n var keysWorksWithArguments = function() {\n // Safari 5.0 bug\n var args = Object.keys(arguments);\n return args && args.length === arguments.length;\n }(1, 2);\n if (!keysWorksWithArguments) Object.keys = function keys(object) {\n if ($alwvH(object)) return $c3064632e4f346e0$var$originalKeys($c3064632e4f346e0$var$slice.call(object));\n return $c3064632e4f346e0$var$originalKeys(object);\n };\n } else Object.keys = $c3064632e4f346e0$var$keysShim;\n return Object.keys || $c3064632e4f346e0$var$keysShim;\n};\nmodule.exports = $c3064632e4f346e0$var$keysShim;\n\n});\nparcelRegister(\"alwvH\", function(module, exports) {\n\"use strict\";\nvar $7885156e7e68aa1f$var$toStr = Object.prototype.toString;\nmodule.exports = function isArguments(value) {\n var str = $7885156e7e68aa1f$var$toStr.call(value);\n var isArgs = str === \"[object Arguments]\";\n if (!isArgs) isArgs = str !== \"[object Array]\" && value !== null && typeof value === \"object\" && typeof value.length === \"number\" && value.length >= 0 && $7885156e7e68aa1f$var$toStr.call(value.callee) === \"[object Function]\";\n return isArgs;\n};\n\n});\n\nparcelRegister(\"2QCzs\", function(module, exports) {\n\"use strict\";\nvar $212e5b7e1daff425$var$keysShim;\n\nif (!Object.keys) {\n // modified from https://github.com/es-shims/es5-shim\n var $212e5b7e1daff425$var$has = Object.prototype.hasOwnProperty;\n var $212e5b7e1daff425$var$toStr = Object.prototype.toString;\n var $212e5b7e1daff425$var$isArgs = (parcelRequire(\"alwvH\")); // eslint-disable-line global-require\n var $212e5b7e1daff425$var$isEnumerable = Object.prototype.propertyIsEnumerable;\n var $212e5b7e1daff425$var$hasDontEnumBug = !$212e5b7e1daff425$var$isEnumerable.call({\n toString: null\n }, \"toString\");\n var $212e5b7e1daff425$var$hasProtoEnumBug = $212e5b7e1daff425$var$isEnumerable.call(function() {}, \"prototype\");\n var $212e5b7e1daff425$var$dontEnums = [\n \"toString\",\n \"toLocaleString\",\n \"valueOf\",\n \"hasOwnProperty\",\n \"isPrototypeOf\",\n \"propertyIsEnumerable\",\n \"constructor\"\n ];\n var $212e5b7e1daff425$var$equalsConstructorPrototype = function(o) {\n var ctor = o.constructor;\n return ctor && ctor.prototype === o;\n };\n var $212e5b7e1daff425$var$excludedKeys = {\n $applicationCache: true,\n $console: true,\n $external: true,\n $frame: true,\n $frameElement: true,\n $frames: true,\n $innerHeight: true,\n $innerWidth: true,\n $onmozfullscreenchange: true,\n $onmozfullscreenerror: true,\n $outerHeight: true,\n $outerWidth: true,\n $pageXOffset: true,\n $pageYOffset: true,\n $parent: true,\n $scrollLeft: true,\n $scrollTop: true,\n $scrollX: true,\n $scrollY: true,\n $self: true,\n $webkitIndexedDB: true,\n $webkitStorageInfo: true,\n $window: true\n };\n var $212e5b7e1daff425$var$hasAutomationEqualityBug = function() {\n /* global window */ if (typeof window === \"undefined\") return false;\n for(var k in window)try {\n if (!$212e5b7e1daff425$var$excludedKeys[\"$\" + k] && $212e5b7e1daff425$var$has.call(window, k) && window[k] !== null && typeof window[k] === \"object\") try {\n $212e5b7e1daff425$var$equalsConstructorPrototype(window[k]);\n } catch (e) {\n return true;\n }\n } catch (e) {\n return true;\n }\n return false;\n }();\n var $212e5b7e1daff425$var$equalsConstructorPrototypeIfNotBuggy = function(o) {\n /* global window */ if (typeof window === \"undefined\" || !$212e5b7e1daff425$var$hasAutomationEqualityBug) return $212e5b7e1daff425$var$equalsConstructorPrototype(o);\n try {\n return $212e5b7e1daff425$var$equalsConstructorPrototype(o);\n } catch (e) {\n return false;\n }\n };\n $212e5b7e1daff425$var$keysShim = function keys(object) {\n var isObject = object !== null && typeof object === \"object\";\n var isFunction = $212e5b7e1daff425$var$toStr.call(object) === \"[object Function]\";\n var isArguments = $212e5b7e1daff425$var$isArgs(object);\n var isString = isObject && $212e5b7e1daff425$var$toStr.call(object) === \"[object String]\";\n var theKeys = [];\n if (!isObject && !isFunction && !isArguments) throw new TypeError(\"Object.keys called on a non-object\");\n var skipProto = $212e5b7e1daff425$var$hasProtoEnumBug && isFunction;\n if (isString && object.length > 0 && !$212e5b7e1daff425$var$has.call(object, 0)) for(var i = 0; i < object.length; ++i)theKeys.push(String(i));\n if (isArguments && object.length > 0) for(var j = 0; j < object.length; ++j)theKeys.push(String(j));\n else {\n for(var name in object)if (!(skipProto && name === \"prototype\") && $212e5b7e1daff425$var$has.call(object, name)) theKeys.push(String(name));\n }\n if ($212e5b7e1daff425$var$hasDontEnumBug) {\n var skipConstructor = $212e5b7e1daff425$var$equalsConstructorPrototypeIfNotBuggy(object);\n for(var k = 0; k < $212e5b7e1daff425$var$dontEnums.length; ++k)if (!(skipConstructor && $212e5b7e1daff425$var$dontEnums[k] === \"constructor\") && $212e5b7e1daff425$var$has.call(object, $212e5b7e1daff425$var$dontEnums[k])) theKeys.push($212e5b7e1daff425$var$dontEnums[k]);\n }\n return theKeys;\n };\n}\nmodule.exports = $212e5b7e1daff425$var$keysShim;\n\n});\n\n\n\n\nparcelRegister(\"bxl1N\", function(module, exports) {\n\"use strict\";\n\nvar $bX2ce = parcelRequire(\"bX2ce\");\nmodule.exports = function getPolyfill() {\n return typeof Object.is === \"function\" ? Object.is : $bX2ce;\n};\n\n});\nparcelRegister(\"bX2ce\", function(module, exports) {\n\"use strict\";\nvar $8b36e887b63475ea$var$numberIsNaN = function(value) {\n return value !== value;\n};\nmodule.exports = function is(a, b) {\n if (a === 0 && b === 0) return 1 / a === 1 / b;\n if (a === b) return true;\n if ($8b36e887b63475ea$var$numberIsNaN(a) && $8b36e887b63475ea$var$numberIsNaN(b)) return true;\n return false;\n};\n\n});\n\n\nparcelRegister(\"2DPC6\", function(module, exports) {\n// Currently in sync with Node.js lib/internal/util/comparisons.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\"use strict\";\nfunction $1ec742ad58c16dc0$var$_slicedToArray(arr, i) {\n return $1ec742ad58c16dc0$var$_arrayWithHoles(arr) || $1ec742ad58c16dc0$var$_iterableToArrayLimit(arr, i) || $1ec742ad58c16dc0$var$_unsupportedIterableToArray(arr, i) || $1ec742ad58c16dc0$var$_nonIterableRest();\n}\nfunction $1ec742ad58c16dc0$var$_nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction $1ec742ad58c16dc0$var$_unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return $1ec742ad58c16dc0$var$_arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $1ec742ad58c16dc0$var$_arrayLikeToArray(o, minLen);\n}\nfunction $1ec742ad58c16dc0$var$_arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction $1ec742ad58c16dc0$var$_iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e, n, i, u, a = [], f = !0, o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for(; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally{\n try {\n if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n } finally{\n if (o) throw n;\n }\n }\n return a;\n }\n}\nfunction $1ec742ad58c16dc0$var$_arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction $1ec742ad58c16dc0$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $1ec742ad58c16dc0$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $1ec742ad58c16dc0$var$_typeof(o);\n}\nvar $1ec742ad58c16dc0$var$regexFlagsSupported = /a/g.flags !== undefined;\nvar $1ec742ad58c16dc0$var$arrayFromSet = function arrayFromSet(set) {\n var array = [];\n set.forEach(function(value) {\n return array.push(value);\n });\n return array;\n};\nvar $1ec742ad58c16dc0$var$arrayFromMap = function arrayFromMap(map) {\n var array = [];\n map.forEach(function(value, key) {\n return array.push([\n key,\n value\n ]);\n });\n return array;\n};\n\nvar $1ec742ad58c16dc0$var$objectIs = Object.is ? Object.is : (parcelRequire(\"fREgm\"));\nvar $1ec742ad58c16dc0$var$objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function() {\n return [];\n};\n\nvar $1ec742ad58c16dc0$var$numberIsNaN = Number.isNaN ? Number.isNaN : (parcelRequire(\"1SiBw\"));\nfunction $1ec742ad58c16dc0$var$uncurryThis(f) {\n return f.call.bind(f);\n}\nvar $1ec742ad58c16dc0$var$hasOwnProperty = $1ec742ad58c16dc0$var$uncurryThis(Object.prototype.hasOwnProperty);\nvar $1ec742ad58c16dc0$var$propertyIsEnumerable = $1ec742ad58c16dc0$var$uncurryThis(Object.prototype.propertyIsEnumerable);\nvar $1ec742ad58c16dc0$var$objectToString = $1ec742ad58c16dc0$var$uncurryThis(Object.prototype.toString);\n\nvar $gQylu = parcelRequire(\"gQylu\");\nvar $1ec742ad58c16dc0$require$_require$types = $gQylu.types;\nvar $1ec742ad58c16dc0$var$isAnyArrayBuffer = $1ec742ad58c16dc0$require$_require$types.isAnyArrayBuffer, $1ec742ad58c16dc0$var$isArrayBufferView = $1ec742ad58c16dc0$require$_require$types.isArrayBufferView, $1ec742ad58c16dc0$var$isDate = $1ec742ad58c16dc0$require$_require$types.isDate, $1ec742ad58c16dc0$var$isMap = $1ec742ad58c16dc0$require$_require$types.isMap, $1ec742ad58c16dc0$var$isRegExp = $1ec742ad58c16dc0$require$_require$types.isRegExp, $1ec742ad58c16dc0$var$isSet = $1ec742ad58c16dc0$require$_require$types.isSet, $1ec742ad58c16dc0$var$isNativeError = $1ec742ad58c16dc0$require$_require$types.isNativeError, $1ec742ad58c16dc0$var$isBoxedPrimitive = $1ec742ad58c16dc0$require$_require$types.isBoxedPrimitive, $1ec742ad58c16dc0$var$isNumberObject = $1ec742ad58c16dc0$require$_require$types.isNumberObject, $1ec742ad58c16dc0$var$isStringObject = $1ec742ad58c16dc0$require$_require$types.isStringObject, $1ec742ad58c16dc0$var$isBooleanObject = $1ec742ad58c16dc0$require$_require$types.isBooleanObject, $1ec742ad58c16dc0$var$isBigIntObject = $1ec742ad58c16dc0$require$_require$types.isBigIntObject, $1ec742ad58c16dc0$var$isSymbolObject = $1ec742ad58c16dc0$require$_require$types.isSymbolObject, $1ec742ad58c16dc0$var$isFloat32Array = $1ec742ad58c16dc0$require$_require$types.isFloat32Array, $1ec742ad58c16dc0$var$isFloat64Array = $1ec742ad58c16dc0$require$_require$types.isFloat64Array;\nfunction $1ec742ad58c16dc0$var$isNonIndex(key) {\n if (key.length === 0 || key.length > 10) return true;\n for(var i = 0; i < key.length; i++){\n var code = key.charCodeAt(i);\n if (code < 48 || code > 57) return true;\n }\n // The maximum size for an array is 2 ** 32 -1.\n return key.length === 10 && key >= Math.pow(2, 32);\n}\nfunction $1ec742ad58c16dc0$var$getOwnNonIndexProperties(value) {\n return Object.keys(value).filter($1ec742ad58c16dc0$var$isNonIndex).concat($1ec742ad58c16dc0$var$objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));\n}\n// Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */ function $1ec742ad58c16dc0$var$compare(a, b) {\n if (a === b) return 0;\n var x = a.length;\n var y = b.length;\n for(var i = 0, len = Math.min(x, y); i < len; ++i)if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n}\nvar $1ec742ad58c16dc0$var$ONLY_ENUMERABLE = undefined;\nvar $1ec742ad58c16dc0$var$kStrict = true;\nvar $1ec742ad58c16dc0$var$kLoose = false;\nvar $1ec742ad58c16dc0$var$kNoIterator = 0;\nvar $1ec742ad58c16dc0$var$kIsArray = 1;\nvar $1ec742ad58c16dc0$var$kIsSet = 2;\nvar $1ec742ad58c16dc0$var$kIsMap = 3;\n// Check if they have the same source and flags\nfunction $1ec742ad58c16dc0$var$areSimilarRegExps(a, b) {\n return $1ec742ad58c16dc0$var$regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);\n}\nfunction $1ec742ad58c16dc0$var$areSimilarFloatArrays(a, b) {\n if (a.byteLength !== b.byteLength) return false;\n for(var offset = 0; offset < a.byteLength; offset++){\n if (a[offset] !== b[offset]) return false;\n }\n return true;\n}\nfunction $1ec742ad58c16dc0$var$areSimilarTypedArrays(a, b) {\n if (a.byteLength !== b.byteLength) return false;\n return $1ec742ad58c16dc0$var$compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;\n}\nfunction $1ec742ad58c16dc0$var$areEqualArrayBuffers(buf1, buf2) {\n return buf1.byteLength === buf2.byteLength && $1ec742ad58c16dc0$var$compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;\n}\nfunction $1ec742ad58c16dc0$var$isEqualBoxedPrimitive(val1, val2) {\n if ($1ec742ad58c16dc0$var$isNumberObject(val1)) return $1ec742ad58c16dc0$var$isNumberObject(val2) && $1ec742ad58c16dc0$var$objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));\n if ($1ec742ad58c16dc0$var$isStringObject(val1)) return $1ec742ad58c16dc0$var$isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);\n if ($1ec742ad58c16dc0$var$isBooleanObject(val1)) return $1ec742ad58c16dc0$var$isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);\n if ($1ec742ad58c16dc0$var$isBigIntObject(val1)) return $1ec742ad58c16dc0$var$isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);\n return $1ec742ad58c16dc0$var$isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);\n}\n// Notes: Type tags are historical [[Class]] properties that can be set by\n// FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS\n// and retrieved using Object.prototype.toString.call(obj) in JS\n// See https://tc39.github.io/ecma262/#sec-object.prototype.tostring\n// for a list of tags pre-defined in the spec.\n// There are some unspecified tags in the wild too (e.g. typed array tags).\n// Since tags can be altered, they only serve fast failures\n//\n// Typed arrays and buffers are checked by comparing the content in their\n// underlying ArrayBuffer. This optimization requires that it's\n// reasonable to interpret their underlying memory in the same way,\n// which is checked by comparing their type tags.\n// (e.g. a Uint8Array and a Uint16Array with the same memory content\n// could still be different because they will be interpreted differently).\n//\n// For strict comparison, objects should have\n// a) The same built-in type tags\n// b) The same prototypes.\nfunction $1ec742ad58c16dc0$var$innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? $1ec742ad58c16dc0$var$objectIs(val1, val2) : true;\n }\n // Check more closely if val1 and val2 are equal.\n if (strict) {\n if ($1ec742ad58c16dc0$var$_typeof(val1) !== \"object\") return typeof val1 === \"number\" && $1ec742ad58c16dc0$var$numberIsNaN(val1) && $1ec742ad58c16dc0$var$numberIsNaN(val2);\n if ($1ec742ad58c16dc0$var$_typeof(val2) !== \"object\" || val1 === null || val2 === null) return false;\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) return false;\n } else {\n if (val1 === null || $1ec742ad58c16dc0$var$_typeof(val1) !== \"object\") {\n if (val2 === null || $1ec742ad58c16dc0$var$_typeof(val2) !== \"object\") // eslint-disable-next-line eqeqeq\n return val1 == val2;\n return false;\n }\n if (val2 === null || $1ec742ad58c16dc0$var$_typeof(val2) !== \"object\") return false;\n }\n var val1Tag = $1ec742ad58c16dc0$var$objectToString(val1);\n var val2Tag = $1ec742ad58c16dc0$var$objectToString(val2);\n if (val1Tag !== val2Tag) return false;\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) return false;\n var keys1 = $1ec742ad58c16dc0$var$getOwnNonIndexProperties(val1, $1ec742ad58c16dc0$var$ONLY_ENUMERABLE);\n var keys2 = $1ec742ad58c16dc0$var$getOwnNonIndexProperties(val2, $1ec742ad58c16dc0$var$ONLY_ENUMERABLE);\n if (keys1.length !== keys2.length) return false;\n return $1ec742ad58c16dc0$var$keyCheck(val1, val2, strict, memos, $1ec742ad58c16dc0$var$kIsArray, keys1);\n }\n // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n if (val1Tag === \"[object Object]\") {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!$1ec742ad58c16dc0$var$isMap(val1) && $1ec742ad58c16dc0$var$isMap(val2) || !$1ec742ad58c16dc0$var$isSet(val1) && $1ec742ad58c16dc0$var$isSet(val2)) return false;\n }\n if ($1ec742ad58c16dc0$var$isDate(val1)) {\n if (!$1ec742ad58c16dc0$var$isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) return false;\n } else if ($1ec742ad58c16dc0$var$isRegExp(val1)) {\n if (!$1ec742ad58c16dc0$var$isRegExp(val2) || !$1ec742ad58c16dc0$var$areSimilarRegExps(val1, val2)) return false;\n } else if ($1ec742ad58c16dc0$var$isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) return false;\n } else if ($1ec742ad58c16dc0$var$isArrayBufferView(val1)) {\n if (!strict && ($1ec742ad58c16dc0$var$isFloat32Array(val1) || $1ec742ad58c16dc0$var$isFloat64Array(val1))) {\n if (!$1ec742ad58c16dc0$var$areSimilarFloatArrays(val1, val2)) return false;\n } else if (!$1ec742ad58c16dc0$var$areSimilarTypedArrays(val1, val2)) return false;\n // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n var _keys = $1ec742ad58c16dc0$var$getOwnNonIndexProperties(val1, $1ec742ad58c16dc0$var$ONLY_ENUMERABLE);\n var _keys2 = $1ec742ad58c16dc0$var$getOwnNonIndexProperties(val2, $1ec742ad58c16dc0$var$ONLY_ENUMERABLE);\n if (_keys.length !== _keys2.length) return false;\n return $1ec742ad58c16dc0$var$keyCheck(val1, val2, strict, memos, $1ec742ad58c16dc0$var$kNoIterator, _keys);\n } else if ($1ec742ad58c16dc0$var$isSet(val1)) {\n if (!$1ec742ad58c16dc0$var$isSet(val2) || val1.size !== val2.size) return false;\n return $1ec742ad58c16dc0$var$keyCheck(val1, val2, strict, memos, $1ec742ad58c16dc0$var$kIsSet);\n } else if ($1ec742ad58c16dc0$var$isMap(val1)) {\n if (!$1ec742ad58c16dc0$var$isMap(val2) || val1.size !== val2.size) return false;\n return $1ec742ad58c16dc0$var$keyCheck(val1, val2, strict, memos, $1ec742ad58c16dc0$var$kIsMap);\n } else if ($1ec742ad58c16dc0$var$isAnyArrayBuffer(val1)) {\n if (!$1ec742ad58c16dc0$var$areEqualArrayBuffers(val1, val2)) return false;\n } else if ($1ec742ad58c16dc0$var$isBoxedPrimitive(val1) && !$1ec742ad58c16dc0$var$isEqualBoxedPrimitive(val1, val2)) return false;\n return $1ec742ad58c16dc0$var$keyCheck(val1, val2, strict, memos, $1ec742ad58c16dc0$var$kNoIterator);\n}\nfunction $1ec742ad58c16dc0$var$getEnumerables(val, keys) {\n return keys.filter(function(k) {\n return $1ec742ad58c16dc0$var$propertyIsEnumerable(val, k);\n });\n}\nfunction $1ec742ad58c16dc0$var$keyCheck(val1, val2, strict, memos, iterationType, aKeys) {\n // For all remaining Object pairs, including Array, objects and Maps,\n // equivalence is determined by having:\n // a) The same number of owned enumerable properties\n // b) The same set of keys/indexes (although not necessarily the same order)\n // c) Equivalent values for every corresponding key/index\n // d) For Sets and Maps, equal contents\n // Note: this accounts for both named and indexed properties on Arrays.\n if (arguments.length === 5) {\n aKeys = Object.keys(val1);\n var bKeys = Object.keys(val2);\n // The pair must have the same number of owned properties.\n if (aKeys.length !== bKeys.length) return false;\n }\n // Cheap key test\n var i = 0;\n for(; i < aKeys.length; i++){\n if (!$1ec742ad58c16dc0$var$hasOwnProperty(val2, aKeys[i])) return false;\n }\n if (strict && arguments.length === 5) {\n var symbolKeysA = $1ec742ad58c16dc0$var$objectGetOwnPropertySymbols(val1);\n if (symbolKeysA.length !== 0) {\n var count = 0;\n for(i = 0; i < symbolKeysA.length; i++){\n var key = symbolKeysA[i];\n if ($1ec742ad58c16dc0$var$propertyIsEnumerable(val1, key)) {\n if (!$1ec742ad58c16dc0$var$propertyIsEnumerable(val2, key)) return false;\n aKeys.push(key);\n count++;\n } else if ($1ec742ad58c16dc0$var$propertyIsEnumerable(val2, key)) return false;\n }\n var symbolKeysB = $1ec742ad58c16dc0$var$objectGetOwnPropertySymbols(val2);\n if (symbolKeysA.length !== symbolKeysB.length && $1ec742ad58c16dc0$var$getEnumerables(val2, symbolKeysB).length !== count) return false;\n } else {\n var _symbolKeysB = $1ec742ad58c16dc0$var$objectGetOwnPropertySymbols(val2);\n if (_symbolKeysB.length !== 0 && $1ec742ad58c16dc0$var$getEnumerables(val2, _symbolKeysB).length !== 0) return false;\n }\n }\n if (aKeys.length === 0 && (iterationType === $1ec742ad58c16dc0$var$kNoIterator || iterationType === $1ec742ad58c16dc0$var$kIsArray && val1.length === 0 || val1.size === 0)) return true;\n // Use memos to handle cycles.\n if (memos === undefined) memos = {\n val1: new Map(),\n val2: new Map(),\n position: 0\n };\n else {\n // We prevent up to two map.has(x) calls by directly retrieving the value\n // and checking for undefined. The map can only contain numbers, so it is\n // safe to check for undefined only.\n var val2MemoA = memos.val1.get(val1);\n if (val2MemoA !== undefined) {\n var val2MemoB = memos.val2.get(val2);\n if (val2MemoB !== undefined) return val2MemoA === val2MemoB;\n }\n memos.position++;\n }\n memos.val1.set(val1, memos.position);\n memos.val2.set(val2, memos.position);\n var areEq = $1ec742ad58c16dc0$var$objEquiv(val1, val2, strict, aKeys, memos, iterationType);\n memos.val1.delete(val1);\n memos.val2.delete(val2);\n return areEq;\n}\nfunction $1ec742ad58c16dc0$var$setHasEqualElement(set, val1, strict, memo) {\n // Go looking.\n var setValues = $1ec742ad58c16dc0$var$arrayFromSet(set);\n for(var i = 0; i < setValues.length; i++){\n var val2 = setValues[i];\n if ($1ec742ad58c16dc0$var$innerDeepEqual(val1, val2, strict, memo)) {\n // Remove the matching element to make sure we do not check that again.\n set.delete(val2);\n return true;\n }\n }\n return false;\n}\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using\n// Sadly it is not possible to detect corresponding values properly in case the\n// type is a string, number, bigint or boolean. The reason is that those values\n// can match lots of different string values (e.g., 1n == '+00001').\nfunction $1ec742ad58c16dc0$var$findLooseMatchingPrimitives(prim) {\n switch($1ec742ad58c16dc0$var$_typeof(prim)){\n case \"undefined\":\n return null;\n case \"object\":\n // Only pass in null as object!\n return undefined;\n case \"symbol\":\n return false;\n case \"string\":\n prim = +prim;\n // Loose equal entries exist only if the string is possible to convert to\n // a regular number and not NaN.\n // Fall through\n case \"number\":\n if ($1ec742ad58c16dc0$var$numberIsNaN(prim)) return false;\n }\n return true;\n}\nfunction $1ec742ad58c16dc0$var$setMightHaveLoosePrim(a, b, prim) {\n var altValue = $1ec742ad58c16dc0$var$findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n return b.has(altValue) && !a.has(altValue);\n}\nfunction $1ec742ad58c16dc0$var$mapMightHaveLoosePrim(a, b, prim, item, memo) {\n var altValue = $1ec742ad58c16dc0$var$findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n var curB = b.get(altValue);\n if (curB === undefined && !b.has(altValue) || !$1ec742ad58c16dc0$var$innerDeepEqual(item, curB, false, memo)) return false;\n return !a.has(altValue) && $1ec742ad58c16dc0$var$innerDeepEqual(item, curB, false, memo);\n}\nfunction $1ec742ad58c16dc0$var$setEquiv(a, b, strict, memo) {\n // This is a lazily initiated Set of entries which have to be compared\n // pairwise.\n var set = null;\n var aValues = $1ec742ad58c16dc0$var$arrayFromSet(a);\n for(var i = 0; i < aValues.length; i++){\n var val = aValues[i];\n // Note: Checking for the objects first improves the performance for object\n // heavy sets but it is a minor slow down for primitives. As they are fast\n // to check this improves the worst case scenario instead.\n if ($1ec742ad58c16dc0$var$_typeof(val) === \"object\" && val !== null) {\n if (set === null) set = new Set();\n // If the specified value doesn't exist in the second set its an not null\n // object (or non strict only: a not matching primitive) we'll need to go\n // hunting for something thats deep-(strict-)equal to it. To make this\n // O(n log n) complexity we have to copy these values in a new set first.\n set.add(val);\n } else if (!b.has(val)) {\n if (strict) return false;\n // Fast path to detect missing string, symbol, undefined and null values.\n if (!$1ec742ad58c16dc0$var$setMightHaveLoosePrim(a, b, val)) return false;\n if (set === null) set = new Set();\n set.add(val);\n }\n }\n if (set !== null) {\n var bValues = $1ec742ad58c16dc0$var$arrayFromSet(b);\n for(var _i = 0; _i < bValues.length; _i++){\n var _val = bValues[_i];\n // We have to check if a primitive value is already\n // matching and only if it's not, go hunting for it.\n if ($1ec742ad58c16dc0$var$_typeof(_val) === \"object\" && _val !== null) {\n if (!$1ec742ad58c16dc0$var$setHasEqualElement(set, _val, strict, memo)) return false;\n } else if (!strict && !a.has(_val) && !$1ec742ad58c16dc0$var$setHasEqualElement(set, _val, strict, memo)) return false;\n }\n return set.size === 0;\n }\n return true;\n}\nfunction $1ec742ad58c16dc0$var$mapHasEqualEntry(set, map, key1, item1, strict, memo) {\n // To be able to handle cases like:\n // Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']])\n // ... we need to consider *all* matching keys, not just the first we find.\n var setValues = $1ec742ad58c16dc0$var$arrayFromSet(set);\n for(var i = 0; i < setValues.length; i++){\n var key2 = setValues[i];\n if ($1ec742ad58c16dc0$var$innerDeepEqual(key1, key2, strict, memo) && $1ec742ad58c16dc0$var$innerDeepEqual(item1, map.get(key2), strict, memo)) {\n set.delete(key2);\n return true;\n }\n }\n return false;\n}\nfunction $1ec742ad58c16dc0$var$mapEquiv(a, b, strict, memo) {\n var set = null;\n var aEntries = $1ec742ad58c16dc0$var$arrayFromMap(a);\n for(var i = 0; i < aEntries.length; i++){\n var _aEntries$i = $1ec742ad58c16dc0$var$_slicedToArray(aEntries[i], 2), key = _aEntries$i[0], item1 = _aEntries$i[1];\n if ($1ec742ad58c16dc0$var$_typeof(key) === \"object\" && key !== null) {\n if (set === null) set = new Set();\n set.add(key);\n } else {\n // By directly retrieving the value we prevent another b.has(key) check in\n // almost all possible cases.\n var item2 = b.get(key);\n if (item2 === undefined && !b.has(key) || !$1ec742ad58c16dc0$var$innerDeepEqual(item1, item2, strict, memo)) {\n if (strict) return false;\n // Fast path to detect missing string, symbol, undefined and null\n // keys.\n if (!$1ec742ad58c16dc0$var$mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;\n if (set === null) set = new Set();\n set.add(key);\n }\n }\n }\n if (set !== null) {\n var bEntries = $1ec742ad58c16dc0$var$arrayFromMap(b);\n for(var _i2 = 0; _i2 < bEntries.length; _i2++){\n var _bEntries$_i = $1ec742ad58c16dc0$var$_slicedToArray(bEntries[_i2], 2), _key = _bEntries$_i[0], item = _bEntries$_i[1];\n if ($1ec742ad58c16dc0$var$_typeof(_key) === \"object\" && _key !== null) {\n if (!$1ec742ad58c16dc0$var$mapHasEqualEntry(set, a, _key, item, strict, memo)) return false;\n } else if (!strict && (!a.has(_key) || !$1ec742ad58c16dc0$var$innerDeepEqual(a.get(_key), item, false, memo)) && !$1ec742ad58c16dc0$var$mapHasEqualEntry(set, a, _key, item, false, memo)) return false;\n }\n return set.size === 0;\n }\n return true;\n}\nfunction $1ec742ad58c16dc0$var$objEquiv(a, b, strict, keys, memos, iterationType) {\n // Sets and maps don't have their entries accessible via normal object\n // properties.\n var i = 0;\n if (iterationType === $1ec742ad58c16dc0$var$kIsSet) {\n if (!$1ec742ad58c16dc0$var$setEquiv(a, b, strict, memos)) return false;\n } else if (iterationType === $1ec742ad58c16dc0$var$kIsMap) {\n if (!$1ec742ad58c16dc0$var$mapEquiv(a, b, strict, memos)) return false;\n } else if (iterationType === $1ec742ad58c16dc0$var$kIsArray) for(; i < a.length; i++){\n if ($1ec742ad58c16dc0$var$hasOwnProperty(a, i)) {\n if (!$1ec742ad58c16dc0$var$hasOwnProperty(b, i) || !$1ec742ad58c16dc0$var$innerDeepEqual(a[i], b[i], strict, memos)) return false;\n } else if ($1ec742ad58c16dc0$var$hasOwnProperty(b, i)) return false;\n else {\n // Array is sparse.\n var keysA = Object.keys(a);\n for(; i < keysA.length; i++){\n var key = keysA[i];\n if (!$1ec742ad58c16dc0$var$hasOwnProperty(b, key) || !$1ec742ad58c16dc0$var$innerDeepEqual(a[key], b[key], strict, memos)) return false;\n }\n if (keysA.length !== Object.keys(b).length) return false;\n return true;\n }\n }\n // The pair must have equivalent values for every corresponding key.\n // Possibly expensive deep test:\n for(i = 0; i < keys.length; i++){\n var _key2 = keys[i];\n if (!$1ec742ad58c16dc0$var$innerDeepEqual(a[_key2], b[_key2], strict, memos)) return false;\n }\n return true;\n}\nfunction $1ec742ad58c16dc0$var$isDeepEqual(val1, val2) {\n return $1ec742ad58c16dc0$var$innerDeepEqual(val1, val2, $1ec742ad58c16dc0$var$kLoose);\n}\nfunction $1ec742ad58c16dc0$var$isDeepStrictEqual(val1, val2) {\n return $1ec742ad58c16dc0$var$innerDeepEqual(val1, val2, $1ec742ad58c16dc0$var$kStrict);\n}\nmodule.exports = {\n isDeepEqual: $1ec742ad58c16dc0$var$isDeepEqual,\n isDeepStrictEqual: $1ec742ad58c16dc0$var$isDeepStrictEqual\n};\n\n});\nparcelRegister(\"fREgm\", function(module, exports) {\n\"use strict\";\n\nvar $8VOI3 = parcelRequire(\"8VOI3\");\n\nvar $70X2U = parcelRequire(\"70X2U\");\n\nvar $bX2ce = parcelRequire(\"bX2ce\");\n\nvar $bxl1N = parcelRequire(\"bxl1N\");\n\nvar $ePB6U = parcelRequire(\"ePB6U\");\nvar $b8cb099cb9d2d4c2$var$polyfill = $70X2U($bxl1N(), Object);\n$8VOI3($b8cb099cb9d2d4c2$var$polyfill, {\n getPolyfill: $bxl1N,\n implementation: $bX2ce,\n shim: $ePB6U\n});\nmodule.exports = $b8cb099cb9d2d4c2$var$polyfill;\n\n});\nparcelRegister(\"8VOI3\", function(module, exports) {\n\"use strict\";\n\nvar $gK6Se = parcelRequire(\"gK6Se\");\nvar $680afb7864027f81$var$hasSymbols = typeof Symbol === \"function\" && typeof Symbol(\"foo\") === \"symbol\";\nvar $680afb7864027f81$var$toStr = Object.prototype.toString;\nvar $680afb7864027f81$var$concat = Array.prototype.concat;\n\nvar $eHoge = parcelRequire(\"eHoge\");\nvar $680afb7864027f81$var$isFunction = function(fn) {\n return typeof fn === \"function\" && $680afb7864027f81$var$toStr.call(fn) === \"[object Function]\";\n};\n\nvar $680afb7864027f81$var$supportsDescriptors = (parcelRequire(\"gkTZB\"))();\nvar $680afb7864027f81$var$defineProperty = function(object, name, value, predicate) {\n if (name in object) {\n if (predicate === true) {\n if (object[name] === value) return;\n } else if (!$680afb7864027f81$var$isFunction(predicate) || !predicate()) return;\n }\n if ($680afb7864027f81$var$supportsDescriptors) $eHoge(object, name, value, true);\n else $eHoge(object, name, value);\n};\nvar $680afb7864027f81$var$defineProperties = function(object, map) {\n var predicates = arguments.length > 2 ? arguments[2] : {};\n var props = $gK6Se(map);\n if ($680afb7864027f81$var$hasSymbols) props = $680afb7864027f81$var$concat.call(props, Object.getOwnPropertySymbols(map));\n for(var i = 0; i < props.length; i += 1)$680afb7864027f81$var$defineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n};\n$680afb7864027f81$var$defineProperties.supportsDescriptors = !!$680afb7864027f81$var$supportsDescriptors;\nmodule.exports = $680afb7864027f81$var$defineProperties;\n\n});\n\nparcelRegister(\"ePB6U\", function(module, exports) {\n\"use strict\";\n\nvar $bxl1N = parcelRequire(\"bxl1N\");\n\nvar $8VOI3 = parcelRequire(\"8VOI3\");\nmodule.exports = function shimObjectIs() {\n var polyfill = $bxl1N();\n $8VOI3(Object, {\n is: polyfill\n }, {\n is: function testObjectIs() {\n return Object.is !== polyfill;\n }\n });\n return polyfill;\n};\n\n});\n\n\nparcelRegister(\"1SiBw\", function(module, exports) {\n\"use strict\";\n\nvar $70X2U = parcelRequire(\"70X2U\");\n\nvar $8VOI3 = parcelRequire(\"8VOI3\");\n\nvar $aS0hY = parcelRequire(\"aS0hY\");\n\nvar $03yTy = parcelRequire(\"03yTy\");\n\nvar $hK2wk = parcelRequire(\"hK2wk\");\nvar $15d943fc9df10d4c$var$polyfill = $70X2U($03yTy(), Number);\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ $8VOI3($15d943fc9df10d4c$var$polyfill, {\n getPolyfill: $03yTy,\n implementation: $aS0hY,\n shim: $hK2wk\n});\nmodule.exports = $15d943fc9df10d4c$var$polyfill;\n\n});\nparcelRegister(\"aS0hY\", function(module, exports) {\n\"use strict\";\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function isNaN(value) {\n return value !== value;\n};\n\n});\n\nparcelRegister(\"03yTy\", function(module, exports) {\n\"use strict\";\n\nvar $aS0hY = parcelRequire(\"aS0hY\");\nmodule.exports = function getPolyfill() {\n if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN(\"a\")) return Number.isNaN;\n return $aS0hY;\n};\n\n});\n\nparcelRegister(\"hK2wk\", function(module, exports) {\n\"use strict\";\n\nvar $8VOI3 = parcelRequire(\"8VOI3\");\n\nvar $03yTy = parcelRequire(\"03yTy\");\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function shimNumberIsNaN() {\n var polyfill = $03yTy();\n $8VOI3(Number, {\n isNaN: polyfill\n }, {\n isNaN: function testIsNaN() {\n return Number.isNaN !== polyfill;\n }\n });\n return polyfill;\n};\n\n});\n\n\n\n\n\nvar $cgw1K = parcelRequire(\"cgw1K\");\n/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */ function $d732417b6401265c$export$1e71eb4bef00f6b0(obj, key, value) {\n if (key in obj) Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n else obj[key] = value;\n return obj;\n}\n\n\n/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */ /*!\n * @kurkle/color v0.3.2\n * https://github.com/kurkle/color#readme\n * (c) 2023 Jukka Kurkela\n * Released under the MIT License\n */ function $96d3e3c23d8fed31$export$2077e0241d6afd3c(v) {\n return v + 0.5 | 0;\n}\nconst $96d3e3c23d8fed31$export$837ba5c449269406 = (v, l, h)=>Math.max(Math.min(v, h), l);\nfunction $96d3e3c23d8fed31$export$bcc6e673dfa14d36(v) {\n return $96d3e3c23d8fed31$export$837ba5c449269406($96d3e3c23d8fed31$export$2077e0241d6afd3c(v * 2.55), 0, 255);\n}\nfunction $96d3e3c23d8fed31$export$869b26d4e1bbdb63(v) {\n return $96d3e3c23d8fed31$export$837ba5c449269406($96d3e3c23d8fed31$export$2077e0241d6afd3c(v / 2.55), 0, 100);\n}\nfunction $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6(v) {\n return $96d3e3c23d8fed31$export$837ba5c449269406($96d3e3c23d8fed31$export$2077e0241d6afd3c(v * 255), 0, 255);\n}\nfunction $96d3e3c23d8fed31$export$dbf961a8d278dbef(v) {\n return $96d3e3c23d8fed31$export$837ba5c449269406($96d3e3c23d8fed31$export$2077e0241d6afd3c(v / 2.55) / 100, 0, 1);\n}\nfunction $96d3e3c23d8fed31$export$aa35ef1f24408ab9(v) {\n return $96d3e3c23d8fed31$export$837ba5c449269406($96d3e3c23d8fed31$export$2077e0241d6afd3c(v * 100), 0, 100);\n}\nconst $96d3e3c23d8fed31$var$map$1 = {\n 0: 0,\n 1: 1,\n 2: 2,\n 3: 3,\n 4: 4,\n 5: 5,\n 6: 6,\n 7: 7,\n 8: 8,\n 9: 9,\n A: 10,\n B: 11,\n C: 12,\n D: 13,\n E: 14,\n F: 15,\n a: 10,\n b: 11,\n c: 12,\n d: 13,\n e: 14,\n f: 15\n};\nconst $96d3e3c23d8fed31$var$hex = [\n ...\"0123456789ABCDEF\"\n];\nconst $96d3e3c23d8fed31$var$h1 = (b)=>$96d3e3c23d8fed31$var$hex[b & 0xF];\nconst $96d3e3c23d8fed31$var$h2 = (b)=>$96d3e3c23d8fed31$var$hex[(b & 0xF0) >> 4] + $96d3e3c23d8fed31$var$hex[b & 0xF];\nconst $96d3e3c23d8fed31$var$eq = (b)=>(b & 0xF0) >> 4 === (b & 0xF);\nconst $96d3e3c23d8fed31$var$isShort = (v)=>$96d3e3c23d8fed31$var$eq(v.r) && $96d3e3c23d8fed31$var$eq(v.g) && $96d3e3c23d8fed31$var$eq(v.b) && $96d3e3c23d8fed31$var$eq(v.a);\nfunction $96d3e3c23d8fed31$export$625a38b961e8b5e9(str) {\n var len = str.length;\n var ret;\n if (str[0] === \"#\") {\n if (len === 4 || len === 5) ret = {\n r: 255 & $96d3e3c23d8fed31$var$map$1[str[1]] * 17,\n g: 255 & $96d3e3c23d8fed31$var$map$1[str[2]] * 17,\n b: 255 & $96d3e3c23d8fed31$var$map$1[str[3]] * 17,\n a: len === 5 ? $96d3e3c23d8fed31$var$map$1[str[4]] * 17 : 255\n };\n else if (len === 7 || len === 9) ret = {\n r: $96d3e3c23d8fed31$var$map$1[str[1]] << 4 | $96d3e3c23d8fed31$var$map$1[str[2]],\n g: $96d3e3c23d8fed31$var$map$1[str[3]] << 4 | $96d3e3c23d8fed31$var$map$1[str[4]],\n b: $96d3e3c23d8fed31$var$map$1[str[5]] << 4 | $96d3e3c23d8fed31$var$map$1[str[6]],\n a: len === 9 ? $96d3e3c23d8fed31$var$map$1[str[7]] << 4 | $96d3e3c23d8fed31$var$map$1[str[8]] : 255\n };\n }\n return ret;\n}\nconst $96d3e3c23d8fed31$var$alpha = (a, f)=>a < 255 ? f(a) : \"\";\nfunction $96d3e3c23d8fed31$export$1b06654353ef9f67(v) {\n var f = $96d3e3c23d8fed31$var$isShort(v) ? $96d3e3c23d8fed31$var$h1 : $96d3e3c23d8fed31$var$h2;\n return v ? \"#\" + f(v.r) + f(v.g) + f(v.b) + $96d3e3c23d8fed31$var$alpha(v.a, f) : undefined;\n}\nconst $96d3e3c23d8fed31$var$HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction $96d3e3c23d8fed31$var$hsl2rgbn(h, s, l) {\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12)=>l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [\n f(0),\n f(8),\n f(4)\n ];\n}\nfunction $96d3e3c23d8fed31$var$hsv2rgbn(h, s, v) {\n const f = (n, k = (n + h / 60) % 6)=>v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n return [\n f(5),\n f(3),\n f(1)\n ];\n}\nfunction $96d3e3c23d8fed31$var$hwb2rgbn(h, w, b) {\n const rgb = $96d3e3c23d8fed31$var$hsl2rgbn(h, 1, 0.5);\n let i;\n if (w + b > 1) {\n i = 1 / (w + b);\n w *= i;\n b *= i;\n }\n for(i = 0; i < 3; i++){\n rgb[i] *= 1 - w - b;\n rgb[i] += w;\n }\n return rgb;\n}\nfunction $96d3e3c23d8fed31$var$hueValue(r, g, b, d, max) {\n if (r === max) return (g - b) / d + (g < b ? 6 : 0);\n if (g === max) return (b - r) / d + 2;\n return (r - g) / d + 4;\n}\nfunction $96d3e3c23d8fed31$export$b5ba70b240f8f7f(v) {\n const range = 255;\n const r = v.r / range;\n const g = v.g / range;\n const b = v.b / range;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s, d;\n if (max !== min) {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = $96d3e3c23d8fed31$var$hueValue(r, g, b, d, max);\n h = h * 60 + 0.5;\n }\n return [\n h | 0,\n s || 0,\n l\n ];\n}\nfunction $96d3e3c23d8fed31$var$calln(f, a, b, c) {\n return (Array.isArray(a) ? f(a[0], a[1], a[2]) : f(a, b, c)).map($96d3e3c23d8fed31$export$ed9bd8dcaeba14f6);\n}\nfunction $96d3e3c23d8fed31$export$4c15bd42559b811d(h, s, l) {\n return $96d3e3c23d8fed31$var$calln($96d3e3c23d8fed31$var$hsl2rgbn, h, s, l);\n}\nfunction $96d3e3c23d8fed31$export$e2710022c70fc9ee(h, w, b) {\n return $96d3e3c23d8fed31$var$calln($96d3e3c23d8fed31$var$hwb2rgbn, h, w, b);\n}\nfunction $96d3e3c23d8fed31$export$b785a357c84e4a04(h, s, v) {\n return $96d3e3c23d8fed31$var$calln($96d3e3c23d8fed31$var$hsv2rgbn, h, s, v);\n}\nfunction $96d3e3c23d8fed31$var$hue(h) {\n return (h % 360 + 360) % 360;\n}\nfunction $96d3e3c23d8fed31$export$5e91288c399be4f9(str) {\n const m = $96d3e3c23d8fed31$var$HUE_RE.exec(str);\n let a = 255;\n let v;\n if (!m) return;\n if (m[5] !== v) a = m[6] ? $96d3e3c23d8fed31$export$bcc6e673dfa14d36(+m[5]) : $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6(+m[5]);\n const h = $96d3e3c23d8fed31$var$hue(+m[2]);\n const p1 = +m[3] / 100;\n const p2 = +m[4] / 100;\n if (m[1] === \"hwb\") v = $96d3e3c23d8fed31$export$e2710022c70fc9ee(h, p1, p2);\n else if (m[1] === \"hsv\") v = $96d3e3c23d8fed31$export$b785a357c84e4a04(h, p1, p2);\n else v = $96d3e3c23d8fed31$export$4c15bd42559b811d(h, p1, p2);\n return {\n r: v[0],\n g: v[1],\n b: v[2],\n a: a\n };\n}\nfunction $96d3e3c23d8fed31$export$bb628a54ab399bc9(v, deg) {\n var h = $96d3e3c23d8fed31$export$b5ba70b240f8f7f(v);\n h[0] = $96d3e3c23d8fed31$var$hue(h[0] + deg);\n h = $96d3e3c23d8fed31$export$4c15bd42559b811d(h);\n v.r = h[0];\n v.g = h[1];\n v.b = h[2];\n}\nfunction $96d3e3c23d8fed31$export$a197af1c58e6260c(v) {\n if (!v) return;\n const a = $96d3e3c23d8fed31$export$b5ba70b240f8f7f(v);\n const h = a[0];\n const s = $96d3e3c23d8fed31$export$aa35ef1f24408ab9(a[1]);\n const l = $96d3e3c23d8fed31$export$aa35ef1f24408ab9(a[2]);\n return v.a < 255 ? `hsla(${h}, ${s}%, ${l}%, ${$96d3e3c23d8fed31$export$dbf961a8d278dbef(v.a)})` : `hsl(${h}, ${s}%, ${l}%)`;\n}\nconst $96d3e3c23d8fed31$var$map = {\n x: \"dark\",\n Z: \"light\",\n Y: \"re\",\n X: \"blu\",\n W: \"gr\",\n V: \"medium\",\n U: \"slate\",\n A: \"ee\",\n T: \"ol\",\n S: \"or\",\n B: \"ra\",\n C: \"lateg\",\n D: \"ights\",\n R: \"in\",\n Q: \"turquois\",\n E: \"hi\",\n P: \"ro\",\n O: \"al\",\n N: \"le\",\n M: \"de\",\n L: \"yello\",\n F: \"en\",\n K: \"ch\",\n G: \"arks\",\n H: \"ea\",\n I: \"ightg\",\n J: \"wh\"\n};\nconst $96d3e3c23d8fed31$var$names$1 = {\n OiceXe: \"f0f8ff\",\n antiquewEte: \"faebd7\",\n aqua: \"ffff\",\n aquamarRe: \"7fffd4\",\n azuY: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"0\",\n blanKedOmond: \"ffebcd\",\n Xe: \"ff\",\n XeviTet: \"8a2be2\",\n bPwn: \"a52a2a\",\n burlywood: \"deb887\",\n caMtXe: \"5f9ea0\",\n KartYuse: \"7fff00\",\n KocTate: \"d2691e\",\n cSO: \"ff7f50\",\n cSnflowerXe: \"6495ed\",\n cSnsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"ffff\",\n xXe: \"8b\",\n xcyan: \"8b8b\",\n xgTMnPd: \"b8860b\",\n xWay: \"a9a9a9\",\n xgYF: \"6400\",\n xgYy: \"a9a9a9\",\n xkhaki: \"bdb76b\",\n xmagFta: \"8b008b\",\n xTivegYF: \"556b2f\",\n xSange: \"ff8c00\",\n xScEd: \"9932cc\",\n xYd: \"8b0000\",\n xsOmon: \"e9967a\",\n xsHgYF: \"8fbc8f\",\n xUXe: \"483d8b\",\n xUWay: \"2f4f4f\",\n xUgYy: \"2f4f4f\",\n xQe: \"ced1\",\n xviTet: \"9400d3\",\n dAppRk: \"ff1493\",\n dApskyXe: \"bfff\",\n dimWay: \"696969\",\n dimgYy: \"696969\",\n dodgerXe: \"1e90ff\",\n fiYbrick: \"b22222\",\n flSOwEte: \"fffaf0\",\n foYstWAn: \"228b22\",\n fuKsia: \"ff00ff\",\n gaRsbSo: \"dcdcdc\",\n ghostwEte: \"f8f8ff\",\n gTd: \"ffd700\",\n gTMnPd: \"daa520\",\n Way: \"808080\",\n gYF: \"8000\",\n gYFLw: \"adff2f\",\n gYy: \"808080\",\n honeyMw: \"f0fff0\",\n hotpRk: \"ff69b4\",\n RdianYd: \"cd5c5c\",\n Rdigo: \"4b0082\",\n ivSy: \"fffff0\",\n khaki: \"f0e68c\",\n lavFMr: \"e6e6fa\",\n lavFMrXsh: \"fff0f5\",\n lawngYF: \"7cfc00\",\n NmoncEffon: \"fffacd\",\n ZXe: \"add8e6\",\n ZcSO: \"f08080\",\n Zcyan: \"e0ffff\",\n ZgTMnPdLw: \"fafad2\",\n ZWay: \"d3d3d3\",\n ZgYF: \"90ee90\",\n ZgYy: \"d3d3d3\",\n ZpRk: \"ffb6c1\",\n ZsOmon: \"ffa07a\",\n ZsHgYF: \"20b2aa\",\n ZskyXe: \"87cefa\",\n ZUWay: \"778899\",\n ZUgYy: \"778899\",\n ZstAlXe: \"b0c4de\",\n ZLw: \"ffffe0\",\n lime: \"ff00\",\n limegYF: \"32cd32\",\n lRF: \"faf0e6\",\n magFta: \"ff00ff\",\n maPon: \"800000\",\n VaquamarRe: \"66cdaa\",\n VXe: \"cd\",\n VScEd: \"ba55d3\",\n VpurpN: \"9370db\",\n VsHgYF: \"3cb371\",\n VUXe: \"7b68ee\",\n VsprRggYF: \"fa9a\",\n VQe: \"48d1cc\",\n VviTetYd: \"c71585\",\n midnightXe: \"191970\",\n mRtcYam: \"f5fffa\",\n mistyPse: \"ffe4e1\",\n moccasR: \"ffe4b5\",\n navajowEte: \"ffdead\",\n navy: \"80\",\n Tdlace: \"fdf5e6\",\n Tive: \"808000\",\n TivedBb: \"6b8e23\",\n Sange: \"ffa500\",\n SangeYd: \"ff4500\",\n ScEd: \"da70d6\",\n pOegTMnPd: \"eee8aa\",\n pOegYF: \"98fb98\",\n pOeQe: \"afeeee\",\n pOeviTetYd: \"db7093\",\n papayawEp: \"ffefd5\",\n pHKpuff: \"ffdab9\",\n peru: \"cd853f\",\n pRk: \"ffc0cb\",\n plum: \"dda0dd\",\n powMrXe: \"b0e0e6\",\n purpN: \"800080\",\n YbeccapurpN: \"663399\",\n Yd: \"ff0000\",\n Psybrown: \"bc8f8f\",\n PyOXe: \"4169e1\",\n saddNbPwn: \"8b4513\",\n sOmon: \"fa8072\",\n sandybPwn: \"f4a460\",\n sHgYF: \"2e8b57\",\n sHshell: \"fff5ee\",\n siFna: \"a0522d\",\n silver: \"c0c0c0\",\n skyXe: \"87ceeb\",\n UXe: \"6a5acd\",\n UWay: \"708090\",\n UgYy: \"708090\",\n snow: \"fffafa\",\n sprRggYF: \"ff7f\",\n stAlXe: \"4682b4\",\n tan: \"d2b48c\",\n teO: \"8080\",\n tEstN: \"d8bfd8\",\n tomato: \"ff6347\",\n Qe: \"40e0d0\",\n viTet: \"ee82ee\",\n JHt: \"f5deb3\",\n wEte: \"ffffff\",\n wEtesmoke: \"f5f5f5\",\n Lw: \"ffff00\",\n LwgYF: \"9acd32\"\n};\nfunction $96d3e3c23d8fed31$var$unpack() {\n const unpacked = {};\n const keys = Object.keys($96d3e3c23d8fed31$var$names$1);\n const tkeys = Object.keys($96d3e3c23d8fed31$var$map);\n let i, j, k, ok, nk;\n for(i = 0; i < keys.length; i++){\n ok = nk = keys[i];\n for(j = 0; j < tkeys.length; j++){\n k = tkeys[j];\n nk = nk.replace(k, $96d3e3c23d8fed31$var$map[k]);\n }\n k = parseInt($96d3e3c23d8fed31$var$names$1[ok], 16);\n unpacked[nk] = [\n k >> 16 & 0xFF,\n k >> 8 & 0xFF,\n k & 0xFF\n ];\n }\n return unpacked;\n}\nlet $96d3e3c23d8fed31$var$names;\nfunction $96d3e3c23d8fed31$export$b2f06b640faad956(str) {\n if (!$96d3e3c23d8fed31$var$names) {\n $96d3e3c23d8fed31$var$names = $96d3e3c23d8fed31$var$unpack();\n $96d3e3c23d8fed31$var$names.transparent = [\n 0,\n 0,\n 0,\n 0\n ];\n }\n const a = $96d3e3c23d8fed31$var$names[str.toLowerCase()];\n return a && {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length === 4 ? a[3] : 255\n };\n}\nconst $96d3e3c23d8fed31$var$RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction $96d3e3c23d8fed31$export$91aedb20f296e541(str) {\n const m = $96d3e3c23d8fed31$var$RGB_RE.exec(str);\n let a = 255;\n let r, g, b;\n if (!m) return;\n if (m[7] !== r) {\n const v = +m[7];\n a = m[8] ? $96d3e3c23d8fed31$export$bcc6e673dfa14d36(v) : $96d3e3c23d8fed31$export$837ba5c449269406(v * 255, 0, 255);\n }\n r = +m[1];\n g = +m[3];\n b = +m[5];\n r = 255 & (m[2] ? $96d3e3c23d8fed31$export$bcc6e673dfa14d36(r) : $96d3e3c23d8fed31$export$837ba5c449269406(r, 0, 255));\n g = 255 & (m[4] ? $96d3e3c23d8fed31$export$bcc6e673dfa14d36(g) : $96d3e3c23d8fed31$export$837ba5c449269406(g, 0, 255));\n b = 255 & (m[6] ? $96d3e3c23d8fed31$export$bcc6e673dfa14d36(b) : $96d3e3c23d8fed31$export$837ba5c449269406(b, 0, 255));\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\nfunction $96d3e3c23d8fed31$export$9595423f22cf925a(v) {\n return v && (v.a < 255 ? `rgba(${v.r}, ${v.g}, ${v.b}, ${$96d3e3c23d8fed31$export$dbf961a8d278dbef(v.a)})` : `rgb(${v.r}, ${v.g}, ${v.b})`);\n}\nconst $96d3e3c23d8fed31$var$to = (v)=>v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst $96d3e3c23d8fed31$var$from = (v)=>v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction $96d3e3c23d8fed31$var$interpolate(rgb1, rgb2, t) {\n const r = $96d3e3c23d8fed31$var$from($96d3e3c23d8fed31$export$dbf961a8d278dbef(rgb1.r));\n const g = $96d3e3c23d8fed31$var$from($96d3e3c23d8fed31$export$dbf961a8d278dbef(rgb1.g));\n const b = $96d3e3c23d8fed31$var$from($96d3e3c23d8fed31$export$dbf961a8d278dbef(rgb1.b));\n return {\n r: $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6($96d3e3c23d8fed31$var$to(r + t * ($96d3e3c23d8fed31$var$from($96d3e3c23d8fed31$export$dbf961a8d278dbef(rgb2.r)) - r))),\n g: $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6($96d3e3c23d8fed31$var$to(g + t * ($96d3e3c23d8fed31$var$from($96d3e3c23d8fed31$export$dbf961a8d278dbef(rgb2.g)) - g))),\n b: $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6($96d3e3c23d8fed31$var$to(b + t * ($96d3e3c23d8fed31$var$from($96d3e3c23d8fed31$export$dbf961a8d278dbef(rgb2.b)) - b))),\n a: rgb1.a + t * (rgb2.a - rgb1.a)\n };\n}\nfunction $96d3e3c23d8fed31$var$modHSL(v, i, ratio) {\n if (v) {\n let tmp = $96d3e3c23d8fed31$export$b5ba70b240f8f7f(v);\n tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n tmp = $96d3e3c23d8fed31$export$4c15bd42559b811d(tmp);\n v.r = tmp[0];\n v.g = tmp[1];\n v.b = tmp[2];\n }\n}\nfunction $96d3e3c23d8fed31$var$clone(v, proto) {\n return v ? Object.assign(proto || {}, v) : v;\n}\nfunction $96d3e3c23d8fed31$var$fromObject(input) {\n var v = {\n r: 0,\n g: 0,\n b: 0,\n a: 255\n };\n if (Array.isArray(input)) {\n if (input.length >= 3) {\n v = {\n r: input[0],\n g: input[1],\n b: input[2],\n a: 255\n };\n if (input.length > 3) v.a = $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6(input[3]);\n }\n } else {\n v = $96d3e3c23d8fed31$var$clone(input, {\n r: 0,\n g: 0,\n b: 0,\n a: 1\n });\n v.a = $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6(v.a);\n }\n return v;\n}\nfunction $96d3e3c23d8fed31$var$functionParse(str) {\n if (str.charAt(0) === \"r\") return $96d3e3c23d8fed31$export$91aedb20f296e541(str);\n return $96d3e3c23d8fed31$export$5e91288c399be4f9(str);\n}\nclass $96d3e3c23d8fed31$export$892596cec99bc70e {\n get valid() {\n return this._valid;\n }\n get rgb() {\n var v = $96d3e3c23d8fed31$var$clone(this._rgb);\n if (v) v.a = $96d3e3c23d8fed31$export$dbf961a8d278dbef(v.a);\n return v;\n }\n set rgb(obj) {\n this._rgb = $96d3e3c23d8fed31$var$fromObject(obj);\n }\n rgbString() {\n return this._valid ? $96d3e3c23d8fed31$export$9595423f22cf925a(this._rgb) : undefined;\n }\n hexString() {\n return this._valid ? $96d3e3c23d8fed31$export$1b06654353ef9f67(this._rgb) : undefined;\n }\n hslString() {\n return this._valid ? $96d3e3c23d8fed31$export$a197af1c58e6260c(this._rgb) : undefined;\n }\n mix(color, weight) {\n if (color) {\n const c1 = this.rgb;\n const c2 = color.rgb;\n let w2;\n const p = weight === w2 ? 0.5 : weight;\n const w = 2 * p - 1;\n const a = c1.a - c2.a;\n const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n w2 = 1 - w1;\n c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n c1.a = p * c1.a + (1 - p) * c2.a;\n this.rgb = c1;\n }\n return this;\n }\n interpolate(color, t) {\n if (color) this._rgb = $96d3e3c23d8fed31$var$interpolate(this._rgb, color._rgb, t);\n return this;\n }\n clone() {\n return new $96d3e3c23d8fed31$export$892596cec99bc70e(this.rgb);\n }\n alpha(a) {\n this._rgb.a = $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6(a);\n return this;\n }\n clearer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 - ratio;\n return this;\n }\n greyscale() {\n const rgb = this._rgb;\n const val = $96d3e3c23d8fed31$export$2077e0241d6afd3c(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n rgb.r = rgb.g = rgb.b = val;\n return this;\n }\n opaquer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 + ratio;\n return this;\n }\n negate() {\n const v = this._rgb;\n v.r = 255 - v.r;\n v.g = 255 - v.g;\n v.b = 255 - v.b;\n return this;\n }\n lighten(ratio) {\n $96d3e3c23d8fed31$var$modHSL(this._rgb, 2, ratio);\n return this;\n }\n darken(ratio) {\n $96d3e3c23d8fed31$var$modHSL(this._rgb, 2, -ratio);\n return this;\n }\n saturate(ratio) {\n $96d3e3c23d8fed31$var$modHSL(this._rgb, 1, ratio);\n return this;\n }\n desaturate(ratio) {\n $96d3e3c23d8fed31$var$modHSL(this._rgb, 1, -ratio);\n return this;\n }\n rotate(deg) {\n $96d3e3c23d8fed31$export$bb628a54ab399bc9(this._rgb, deg);\n return this;\n }\n constructor(input){\n if (input instanceof $96d3e3c23d8fed31$export$892596cec99bc70e) return input;\n const type = typeof input;\n let v;\n if (type === \"object\") v = $96d3e3c23d8fed31$var$fromObject(input);\n else if (type === \"string\") v = $96d3e3c23d8fed31$export$625a38b961e8b5e9(input) || $96d3e3c23d8fed31$export$b2f06b640faad956(input) || $96d3e3c23d8fed31$var$functionParse(input);\n this._rgb = v;\n this._valid = !!v;\n }\n}\nfunction $96d3e3c23d8fed31$export$2e2bcd8739ae039(input) {\n return new $96d3e3c23d8fed31$export$892596cec99bc70e(input);\n}\n\n\n/**\n * @namespace Chart.helpers\n */ /**\n * An empty function that can be used, for example, for optional callback.\n */ function $02b6f511cc6c123c$export$cf2f7c5792f80b46() {\n/* noop */ }\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */ const $02b6f511cc6c123c$export$2219238a014317b0 = (()=>{\n let id = 0;\n return ()=>id++;\n})();\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function $02b6f511cc6c123c$export$342063e11d6c3cad(value) {\n return value === null || typeof value === \"undefined\";\n}\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */ function $02b6f511cc6c123c$export$8b22cf2602fb60ce(value) {\n if (Array.isArray && Array.isArray(value)) return true;\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === \"[object\" && type.slice(-6) === \"Array]\") return true;\n return false;\n}\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function $02b6f511cc6c123c$export$23f2a1d2818174ef(value) {\n return value !== null && Object.prototype.toString.call(value) === \"[object Object]\";\n}\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */ function $02b6f511cc6c123c$export$39b482c5e57630a8(value) {\n return (typeof value === \"number\" || value instanceof Number) && isFinite(+value);\n}\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */ function $02b6f511cc6c123c$export$c4ce752e73470fba(value, defaultValue) {\n return $02b6f511cc6c123c$export$39b482c5e57630a8(value) ? value : defaultValue;\n}\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */ function $02b6f511cc6c123c$export$90a7f3efeed30595(value, defaultValue) {\n return typeof value === \"undefined\" ? defaultValue : value;\n}\nconst $02b6f511cc6c123c$export$953cecd6e717a553 = (value, dimension)=>typeof value === \"string\" && value.endsWith(\"%\") ? parseFloat(value) / 100 : +value / dimension;\nconst $02b6f511cc6c123c$export$7ccc53e8f1e7dfc5 = (value, dimension)=>typeof value === \"string\" && value.endsWith(\"%\") ? parseFloat(value) / 100 * dimension : +value;\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */ function $02b6f511cc6c123c$export$3722cfe417b6ed86(fn, args, thisArg) {\n if (fn && typeof fn.call === \"function\") return fn.apply(thisArg, args);\n}\nfunction $02b6f511cc6c123c$export$d66501df72047452(loopable, fn, thisArg, reverse) {\n let i, len, keys;\n if ($02b6f511cc6c123c$export$8b22cf2602fb60ce(loopable)) {\n len = loopable.length;\n if (reverse) for(i = len - 1; i >= 0; i--)fn.call(thisArg, loopable[i], i);\n else for(i = 0; i < len; i++)fn.call(thisArg, loopable[i], i);\n } else if ($02b6f511cc6c123c$export$23f2a1d2818174ef(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for(i = 0; i < len; i++)fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n}\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */ function $02b6f511cc6c123c$export$995eb9fca571757(a0, a1) {\n let i, ilen, v0, v1;\n if (!a0 || !a1 || a0.length !== a1.length) return false;\n for(i = 0, ilen = a0.length; i < ilen; ++i){\n v0 = a0[i];\n v1 = a1[i];\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) return false;\n }\n return true;\n}\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */ function $02b6f511cc6c123c$export$d377dcb2b61d6c4e(source) {\n if ($02b6f511cc6c123c$export$8b22cf2602fb60ce(source)) return source.map($02b6f511cc6c123c$export$d377dcb2b61d6c4e);\n if ($02b6f511cc6c123c$export$23f2a1d2818174ef(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n for(; k < klen; ++k)target[keys[k]] = $02b6f511cc6c123c$export$d377dcb2b61d6c4e(source[keys[k]]);\n return target;\n }\n return source;\n}\nfunction $02b6f511cc6c123c$var$isValidKey(key) {\n return [\n \"__proto__\",\n \"prototype\",\n \"constructor\"\n ].indexOf(key) === -1;\n}\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */ function $02b6f511cc6c123c$export$667d3bf0c5f83305(key, target, source, options) {\n if (!$02b6f511cc6c123c$var$isValidKey(key)) return;\n const tval = target[key];\n const sval = source[key];\n if ($02b6f511cc6c123c$export$23f2a1d2818174ef(tval) && $02b6f511cc6c123c$export$23f2a1d2818174ef(sval)) // eslint-disable-next-line @typescript-eslint/no-use-before-define\n $02b6f511cc6c123c$export$efca4cbe5dd06740(tval, sval, options);\n else target[key] = $02b6f511cc6c123c$export$d377dcb2b61d6c4e(sval);\n}\nfunction $02b6f511cc6c123c$export$efca4cbe5dd06740(target, source, options) {\n const sources = $02b6f511cc6c123c$export$8b22cf2602fb60ce(source) ? source : [\n source\n ];\n const ilen = sources.length;\n if (!$02b6f511cc6c123c$export$23f2a1d2818174ef(target)) return target;\n options = options || {};\n const merger = options.merger || $02b6f511cc6c123c$export$667d3bf0c5f83305;\n let current;\n for(let i = 0; i < ilen; ++i){\n current = sources[i];\n if (!$02b6f511cc6c123c$export$23f2a1d2818174ef(current)) continue;\n const keys = Object.keys(current);\n for(let k = 0, klen = keys.length; k < klen; ++k)merger(keys[k], target, current, options);\n }\n return target;\n}\nfunction $02b6f511cc6c123c$export$555508cbc6add439(target, source) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return $02b6f511cc6c123c$export$efca4cbe5dd06740(target, source, {\n merger: $02b6f511cc6c123c$export$317a3d46287192d8\n });\n}\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */ function $02b6f511cc6c123c$export$317a3d46287192d8(key, target, source) {\n if (!$02b6f511cc6c123c$var$isValidKey(key)) return;\n const tval = target[key];\n const sval = source[key];\n if ($02b6f511cc6c123c$export$23f2a1d2818174ef(tval) && $02b6f511cc6c123c$export$23f2a1d2818174ef(sval)) $02b6f511cc6c123c$export$555508cbc6add439(tval, sval);\n else if (!Object.prototype.hasOwnProperty.call(target, key)) target[key] = $02b6f511cc6c123c$export$d377dcb2b61d6c4e(sval);\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$1ee57be6f6687d2c(scope, value, previous, current) {\n if (value !== undefined) console.warn(scope + ': \"' + previous + '\" is deprecated. Please use \"' + current + '\" instead');\n}\n// resolveObjectKey resolver cache\nconst $02b6f511cc6c123c$var$keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n \"\": (v)=>v,\n // default resolvers\n x: (o)=>o.x,\n y: (o)=>o.y\n};\n/**\n * @private\n */ function $02b6f511cc6c123c$export$9d0e2d13d04f7070(key) {\n const parts = key.split(\".\");\n const keys = [];\n let tmp = \"\";\n for (const part of parts){\n tmp += part;\n if (tmp.endsWith(\"\\\\\")) tmp = tmp.slice(0, -1) + \".\";\n else {\n keys.push(tmp);\n tmp = \"\";\n }\n }\n return keys;\n}\nfunction $02b6f511cc6c123c$var$_getKeyResolver(key) {\n const keys = $02b6f511cc6c123c$export$9d0e2d13d04f7070(key);\n return (obj)=>{\n for (const k of keys){\n if (k === \"\") break;\n obj = obj && obj[k];\n }\n return obj;\n };\n}\nfunction $02b6f511cc6c123c$export$2d1720544b23b823(obj, key) {\n const resolver = $02b6f511cc6c123c$var$keyResolvers[key] || ($02b6f511cc6c123c$var$keyResolvers[key] = $02b6f511cc6c123c$var$_getKeyResolver(key));\n return resolver(obj);\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$a8550f7dbe79f93a(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst $02b6f511cc6c123c$export$dda1d9f60106f0e9 = (value)=>typeof value !== \"undefined\";\nconst $02b6f511cc6c123c$export$a93c5207d687da10 = (value)=>typeof value === \"function\";\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nconst $02b6f511cc6c123c$export$ee7c8ad385a60b7b = (a, b)=>{\n if (a.size !== b.size) return false;\n for (const item of a){\n if (!b.has(item)) return false;\n }\n return true;\n};\n/**\n * @param e - The event\n * @private\n */ function $02b6f511cc6c123c$export$f38c853ae54ed474(e) {\n return e.type === \"mouseup\" || e.type === \"click\" || e.type === \"contextmenu\";\n}\n/**\n * @alias Chart.helpers.math\n * @namespace\n */ const $02b6f511cc6c123c$export$56c0d5a1e737357d = Math.PI;\nconst $02b6f511cc6c123c$export$971d5caa766a69d7 = 2 * $02b6f511cc6c123c$export$56c0d5a1e737357d;\nconst $02b6f511cc6c123c$export$d29e374196577086 = $02b6f511cc6c123c$export$971d5caa766a69d7 + $02b6f511cc6c123c$export$56c0d5a1e737357d;\nconst $02b6f511cc6c123c$export$2ec5befb9e6c97d4 = Number.POSITIVE_INFINITY;\nconst $02b6f511cc6c123c$export$53c86fa97d611818 = $02b6f511cc6c123c$export$56c0d5a1e737357d / 180;\nconst $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd = $02b6f511cc6c123c$export$56c0d5a1e737357d / 2;\nconst $02b6f511cc6c123c$export$39c1cc7c062529d4 = $02b6f511cc6c123c$export$56c0d5a1e737357d / 4;\nconst $02b6f511cc6c123c$export$7a0bdf7d4a91ea88 = $02b6f511cc6c123c$export$56c0d5a1e737357d * 2 / 3;\nconst $02b6f511cc6c123c$export$9f4f30ee63539e24 = Math.log10;\nconst $02b6f511cc6c123c$export$2408f22a0fab9ae5 = Math.sign;\nfunction $02b6f511cc6c123c$export$a05254e7c3aeba6e(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n}\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */ function $02b6f511cc6c123c$export$a33b77bbdbb8366c(range) {\n const roundedRange = Math.round(range);\n range = $02b6f511cc6c123c$export$a05254e7c3aeba6e(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor($02b6f511cc6c123c$export$9f4f30ee63539e24(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */ function $02b6f511cc6c123c$export$a07804094c3ecf2d(value) {\n const result = [];\n const sqrt = Math.sqrt(value);\n let i;\n for(i = 1; i < sqrt; i++)if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n if (sqrt === (sqrt | 0)) result.push(sqrt);\n result.sort((a, b)=>a - b).pop();\n return result;\n}\nfunction $02b6f511cc6c123c$export$d141bba7fdc215a3(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction $02b6f511cc6c123c$export$b9a6b53f9be3734(x, epsilon) {\n const rounded = Math.round(x);\n return rounded - epsilon <= x && rounded + epsilon >= x;\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$53a70dd1ebbae346(array, target, property) {\n let i, ilen, value;\n for(i = 0, ilen = array.length; i < ilen; i++){\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\nfunction $02b6f511cc6c123c$export$625550452a3fa3ec(degrees) {\n return degrees * ($02b6f511cc6c123c$export$56c0d5a1e737357d / 180);\n}\nfunction $02b6f511cc6c123c$export$3a6d5c9ae78a2c08(radians) {\n return radians * (180 / $02b6f511cc6c123c$export$56c0d5a1e737357d);\n}\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */ function $02b6f511cc6c123c$export$23ebac1979863676(x) {\n if (!$02b6f511cc6c123c$export$39b482c5e57630a8(x)) return;\n let e = 1;\n let p = 0;\n while(Math.round(x * e) / e !== x){\n e *= 10;\n p++;\n }\n return p;\n}\n// Gets the angle from vertical upright to the point about a centre.\nfunction $02b6f511cc6c123c$export$96f57966bedc81b4(centrePoint, anglePoint) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n if (angle < -0.5 * $02b6f511cc6c123c$export$56c0d5a1e737357d) angle += $02b6f511cc6c123c$export$971d5caa766a69d7; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n return {\n angle: angle,\n distance: radialDistanceFromCenter\n };\n}\nfunction $02b6f511cc6c123c$export$158acd800e1ef08b(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */ function $02b6f511cc6c123c$export$c18d01048907ea92(a, b) {\n return (a - b + $02b6f511cc6c123c$export$d29e374196577086) % $02b6f511cc6c123c$export$971d5caa766a69d7 - $02b6f511cc6c123c$export$56c0d5a1e737357d;\n}\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */ function $02b6f511cc6c123c$export$28f7fcd39efa255(a) {\n return (a % $02b6f511cc6c123c$export$971d5caa766a69d7 + $02b6f511cc6c123c$export$971d5caa766a69d7) % $02b6f511cc6c123c$export$971d5caa766a69d7;\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$ffb5f4729a158638(angle, start, end, sameAngleIsFullCircle) {\n const a = $02b6f511cc6c123c$export$28f7fcd39efa255(angle);\n const s = $02b6f511cc6c123c$export$28f7fcd39efa255(start);\n const e = $02b6f511cc6c123c$export$28f7fcd39efa255(end);\n const angleToStart = $02b6f511cc6c123c$export$28f7fcd39efa255(s - a);\n const angleToEnd = $02b6f511cc6c123c$export$28f7fcd39efa255(e - a);\n const startToAngle = $02b6f511cc6c123c$export$28f7fcd39efa255(a - s);\n const endToAngle = $02b6f511cc6c123c$export$28f7fcd39efa255(a - e);\n return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle;\n}\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */ function $02b6f511cc6c123c$export$25ce5a424b770e84(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n/**\n * @param {number} value\n * @private\n */ function $02b6f511cc6c123c$export$71cec2538cb2c617(value) {\n return $02b6f511cc6c123c$export$25ce5a424b770e84(value, -32768, 32767);\n}\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */ function $02b6f511cc6c123c$export$3b513254972cfc9c(value, start, end, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\nfunction $02b6f511cc6c123c$export$2ed0fc6709e59212(table, value, cmp) {\n cmp = cmp || ((index)=>table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid;\n while(hi - lo > 1){\n mid = lo + hi >> 1;\n if (cmp(mid)) lo = mid;\n else hi = mid;\n }\n return {\n lo: lo,\n hi: hi\n };\n}\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */ const $02b6f511cc6c123c$export$ef35774e6d314e91 = (table, key, value, last)=>$02b6f511cc6c123c$export$2ed0fc6709e59212(table, value, last ? (index)=>{\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n } : (index)=>table[index][key] < value);\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */ const $02b6f511cc6c123c$export$ebd11618f299a286 = (table, key, value)=>$02b6f511cc6c123c$export$2ed0fc6709e59212(table, value, (index)=>table[index][key] >= value);\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */ function $02b6f511cc6c123c$export$c03999cb2f36933f(values, min, max) {\n let start = 0;\n let end = values.length;\n while(start < end && values[start] < min)start++;\n while(end > start && values[end - 1] > max)end--;\n return start > 0 || end < values.length ? values.slice(start, end) : values;\n}\nconst $02b6f511cc6c123c$var$arrayEvents = [\n \"push\",\n \"pop\",\n \"shift\",\n \"splice\",\n \"unshift\"\n];\nfunction $02b6f511cc6c123c$export$882b5998b3b9117c(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n Object.defineProperty(array, \"_chartjs\", {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [\n listener\n ]\n }\n });\n $02b6f511cc6c123c$var$arrayEvents.forEach((key)=>{\n const method = \"_onData\" + $02b6f511cc6c123c$export$a8550f7dbe79f93a(key);\n const base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value (...args) {\n const res = base.apply(this, args);\n array._chartjs.listeners.forEach((object)=>{\n if (typeof object[method] === \"function\") object[method](...args);\n });\n return res;\n }\n });\n });\n}\nfunction $02b6f511cc6c123c$export$3b14a55fb2447963(array, listener) {\n const stub = array._chartjs;\n if (!stub) return;\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) listeners.splice(index, 1);\n if (listeners.length > 0) return;\n $02b6f511cc6c123c$var$arrayEvents.forEach((key)=>{\n delete array[key];\n });\n delete array._chartjs;\n}\n/**\n * @param items\n */ function $02b6f511cc6c123c$export$71511d61b312f219(items) {\n const set = new Set(items);\n if (set.size === items.length) return items;\n return Array.from(set);\n}\nfunction $02b6f511cc6c123c$export$fef3dfd9bad05307(pixelSize, fontStyle, fontFamily) {\n return fontStyle + \" \" + pixelSize + \"px \" + fontFamily;\n}\n/**\n* Request animation polyfill\n*/ const $02b6f511cc6c123c$export$43caf9889c228507 = function() {\n if (typeof window === \"undefined\") return function(callback) {\n return callback();\n };\n return window.requestAnimationFrame;\n}();\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */ function $02b6f511cc6c123c$export$61196ced6d74a310(fn, thisArg) {\n let argsToUse = [];\n let ticking = false;\n return function(...args) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n $02b6f511cc6c123c$export$43caf9889c228507.call(window, ()=>{\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n/**\n * Debounces calling `fn` for `delay` ms\n */ function $02b6f511cc6c123c$export$4c3d22f3d993c33f(fn, delay) {\n let timeout;\n return function(...args) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else fn.apply(this, args);\n return delay;\n };\n}\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */ const $02b6f511cc6c123c$export$3c2fa207a37baaea = (align)=>align === \"start\" ? \"left\" : align === \"end\" ? \"right\" : \"center\";\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */ const $02b6f511cc6c123c$export$ce26c07117d59d6a = (align, start, end)=>align === \"start\" ? start : align === \"end\" ? end : (start + end) / 2;\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */ const $02b6f511cc6c123c$export$9d398bebfec1c039 = (align, left, right, rtl)=>{\n const check = rtl ? \"left\" : \"right\";\n return align === check ? right : align === \"center\" ? (left + right) / 2 : left;\n};\n/**\n * Return start and count of visible points.\n * @private\n */ function $02b6f511cc6c123c$export$9e5f44173e64f162(meta, points, animationsDisabled) {\n const pointCount = points.length;\n let start = 0;\n let count = pointCount;\n if (meta._sorted) {\n const { iScale: iScale, _parsed: _parsed } = meta;\n const axis = iScale.axis;\n const { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = iScale.getUserBounds();\n if (minDefined) start = $02b6f511cc6c123c$export$25ce5a424b770e84(Math.min($02b6f511cc6c123c$export$ef35774e6d314e91(_parsed, axis, min).lo, animationsDisabled ? pointCount : $02b6f511cc6c123c$export$ef35774e6d314e91(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1);\n if (maxDefined) count = $02b6f511cc6c123c$export$25ce5a424b770e84(Math.max($02b6f511cc6c123c$export$ef35774e6d314e91(_parsed, iScale.axis, max, true).hi + 1, animationsDisabled ? 0 : $02b6f511cc6c123c$export$ef35774e6d314e91(points, axis, iScale.getPixelForValue(max), true).hi + 1), start, pointCount) - start;\n else count = pointCount - start;\n }\n return {\n start: start,\n count: count\n };\n}\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */ function $02b6f511cc6c123c$export$efccba1c4a2ef57b(meta) {\n const { xScale: xScale, yScale: yScale, _scaleRanges: _scaleRanges } = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\nconst $02b6f511cc6c123c$var$atEdge = (t)=>t === 0 || t === 1;\nconst $02b6f511cc6c123c$var$elasticIn = (t, s, p)=>-(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * $02b6f511cc6c123c$export$971d5caa766a69d7 / p));\nconst $02b6f511cc6c123c$var$elasticOut = (t, s, p)=>Math.pow(2, -10 * t) * Math.sin((t - s) * $02b6f511cc6c123c$export$971d5caa766a69d7 / p) + 1;\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */ const $02b6f511cc6c123c$export$f1e1789686576879 = {\n linear: (t)=>t,\n easeInQuad: (t)=>t * t,\n easeOutQuad: (t)=>-t * (t - 2),\n easeInOutQuad: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1),\n easeInCubic: (t)=>t * t * t,\n easeOutCubic: (t)=>(t -= 1) * t * t + 1,\n easeInOutCubic: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2),\n easeInQuart: (t)=>t * t * t * t,\n easeOutQuart: (t)=>-((t -= 1) * t * t * t - 1),\n easeInOutQuart: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2),\n easeInQuint: (t)=>t * t * t * t * t,\n easeOutQuint: (t)=>(t -= 1) * t * t * t * t + 1,\n easeInOutQuint: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2),\n easeInSine: (t)=>-Math.cos(t * $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd) + 1,\n easeOutSine: (t)=>Math.sin(t * $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd),\n easeInOutSine: (t)=>-0.5 * (Math.cos($02b6f511cc6c123c$export$56c0d5a1e737357d * t) - 1),\n easeInExpo: (t)=>t === 0 ? 0 : Math.pow(2, 10 * (t - 1)),\n easeOutExpo: (t)=>t === 1 ? 1 : -Math.pow(2, -10 * t) + 1,\n easeInOutExpo: (t)=>$02b6f511cc6c123c$var$atEdge(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n easeInCirc: (t)=>t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1),\n easeOutCirc: (t)=>Math.sqrt(1 - (t -= 1) * t),\n easeInOutCirc: (t)=>(t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n easeInElastic: (t)=>$02b6f511cc6c123c$var$atEdge(t) ? t : $02b6f511cc6c123c$var$elasticIn(t, 0.075, 0.3),\n easeOutElastic: (t)=>$02b6f511cc6c123c$var$atEdge(t) ? t : $02b6f511cc6c123c$var$elasticOut(t, 0.075, 0.3),\n easeInOutElastic (t) {\n const s = 0.1125;\n const p = 0.45;\n return $02b6f511cc6c123c$var$atEdge(t) ? t : t < 0.5 ? 0.5 * $02b6f511cc6c123c$var$elasticIn(t * 2, s, p) : 0.5 + 0.5 * $02b6f511cc6c123c$var$elasticOut(t * 2 - 1, s, p);\n },\n easeInBack (t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n easeOutBack (t) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n easeInOutBack (t) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s));\n return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);\n },\n easeInBounce: (t)=>1 - $02b6f511cc6c123c$export$f1e1789686576879.easeOutBounce(1 - t),\n easeOutBounce (t) {\n const m = 7.5625;\n const d = 2.75;\n if (t < 1 / d) return m * t * t;\n if (t < 2 / d) return m * (t -= 1.5 / d) * t + 0.75;\n if (t < 2.5 / d) return m * (t -= 2.25 / d) * t + 0.9375;\n return m * (t -= 2.625 / d) * t + 0.984375;\n },\n easeInOutBounce: (t)=>t < 0.5 ? $02b6f511cc6c123c$export$f1e1789686576879.easeInBounce(t * 2) * 0.5 : $02b6f511cc6c123c$export$f1e1789686576879.easeOutBounce(t * 2 - 1) * 0.5 + 0.5\n};\nfunction $02b6f511cc6c123c$export$f96d196f7728bb5(value) {\n if (value && typeof value === \"object\") {\n const type = value.toString();\n return type === \"[object CanvasPattern]\" || type === \"[object CanvasGradient]\";\n }\n return false;\n}\nfunction $02b6f511cc6c123c$export$db3b6bfb95261072(value) {\n return $02b6f511cc6c123c$export$f96d196f7728bb5(value) ? value : new (0, $96d3e3c23d8fed31$export$892596cec99bc70e)(value);\n}\nfunction $02b6f511cc6c123c$export$738ab4df8bf92ae9(value) {\n return $02b6f511cc6c123c$export$f96d196f7728bb5(value) ? value : new (0, $96d3e3c23d8fed31$export$892596cec99bc70e)(value).saturate(0.5).darken(0.1).hexString();\n}\nconst $02b6f511cc6c123c$var$numbers = [\n \"x\",\n \"y\",\n \"borderWidth\",\n \"radius\",\n \"tension\"\n];\nconst $02b6f511cc6c123c$var$colors = [\n \"color\",\n \"borderColor\",\n \"backgroundColor\"\n];\nfunction $02b6f511cc6c123c$var$applyAnimationsDefaults(defaults) {\n defaults.set(\"animation\", {\n delay: undefined,\n duration: 1000,\n easing: \"easeOutQuart\",\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined\n });\n defaults.describe(\"animation\", {\n _fallback: false,\n _indexable: false,\n _scriptable: (name)=>name !== \"onProgress\" && name !== \"onComplete\" && name !== \"fn\"\n });\n defaults.set(\"animations\", {\n colors: {\n type: \"color\",\n properties: $02b6f511cc6c123c$var$colors\n },\n numbers: {\n type: \"number\",\n properties: $02b6f511cc6c123c$var$numbers\n }\n });\n defaults.describe(\"animations\", {\n _fallback: \"animation\"\n });\n defaults.set(\"transitions\", {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: \"transparent\"\n },\n visible: {\n type: \"boolean\",\n duration: 0\n }\n }\n },\n hide: {\n animations: {\n colors: {\n to: \"transparent\"\n },\n visible: {\n type: \"boolean\",\n easing: \"linear\",\n fn: (v)=>v | 0\n }\n }\n }\n });\n}\nfunction $02b6f511cc6c123c$var$applyLayoutsDefaults(defaults) {\n defaults.set(\"layout\", {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\nconst $02b6f511cc6c123c$var$intlCache = new Map();\nfunction $02b6f511cc6c123c$var$getNumberFormat(locale, options) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = $02b6f511cc6c123c$var$intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n $02b6f511cc6c123c$var$intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\nfunction $02b6f511cc6c123c$export$ae1af26003f05816(num, locale, options) {\n return $02b6f511cc6c123c$var$getNumberFormat(locale, options).format(num);\n}\nconst $02b6f511cc6c123c$var$formatters = {\n values (value) {\n return $02b6f511cc6c123c$export$8b22cf2602fb60ce(value) ? value : \"\" + value;\n },\n numeric (tickValue, index, ticks) {\n if (tickValue === 0) return \"0\";\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue;\n if (ticks.length > 1) {\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) notation = \"scientific\";\n delta = $02b6f511cc6c123c$var$calculateDelta(tickValue, ticks);\n }\n const logDelta = $02b6f511cc6c123c$export$9f4f30ee63539e24(Math.abs(delta));\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n const options = {\n notation: notation,\n minimumFractionDigits: numDecimal,\n maximumFractionDigits: numDecimal\n };\n Object.assign(options, this.options.ticks.format);\n return $02b6f511cc6c123c$export$ae1af26003f05816(tickValue, locale, options);\n },\n logarithmic (tickValue, index, ticks) {\n if (tickValue === 0) return \"0\";\n const remain = ticks[index].significand || tickValue / Math.pow(10, Math.floor($02b6f511cc6c123c$export$9f4f30ee63539e24(tickValue)));\n if ([\n 1,\n 2,\n 3,\n 5,\n 10,\n 15\n ].includes(remain) || index > 0.8 * ticks.length) return $02b6f511cc6c123c$var$formatters.numeric.call(this, tickValue, index, ticks);\n return \"\";\n }\n};\nfunction $02b6f511cc6c123c$var$calculateDelta(tickValue, ticks) {\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) delta = tickValue - Math.floor(tickValue);\n return delta;\n}\nvar $02b6f511cc6c123c$export$91477dc880baac21 = {\n formatters: $02b6f511cc6c123c$var$formatters\n};\nfunction $02b6f511cc6c123c$var$applyScaleDefaults(defaults) {\n defaults.set(\"scale\", {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n bounds: \"ticks\",\n clip: true,\n grace: 0,\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options)=>options.lineWidth,\n tickColor: (_ctx, options)=>options.color,\n offset: false\n },\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n title: {\n display: false,\n text: \"\",\n padding: {\n top: 4,\n bottom: 4\n }\n },\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: \"\",\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n callback: $02b6f511cc6c123c$export$91477dc880baac21.formatters.values,\n minor: {},\n major: {},\n align: \"center\",\n crossAlign: \"near\",\n showLabelBackdrop: false,\n backdropColor: \"rgba(255, 255, 255, 0.75)\",\n backdropPadding: 2\n }\n });\n defaults.route(\"scale.ticks\", \"color\", \"\", \"color\");\n defaults.route(\"scale.grid\", \"color\", \"\", \"borderColor\");\n defaults.route(\"scale.border\", \"color\", \"\", \"borderColor\");\n defaults.route(\"scale.title\", \"color\", \"\", \"color\");\n defaults.describe(\"scale\", {\n _fallback: false,\n _scriptable: (name)=>!name.startsWith(\"before\") && !name.startsWith(\"after\") && name !== \"callback\" && name !== \"parser\",\n _indexable: (name)=>name !== \"borderDash\" && name !== \"tickBorderDash\" && name !== \"dash\"\n });\n defaults.describe(\"scales\", {\n _fallback: \"scale\"\n });\n defaults.describe(\"scale.ticks\", {\n _scriptable: (name)=>name !== \"backdropPadding\" && name !== \"callback\",\n _indexable: (name)=>name !== \"backdropPadding\"\n });\n}\nconst $02b6f511cc6c123c$export$6559d589eb85fbb6 = Object.create(null);\nconst $02b6f511cc6c123c$export$2e2af4578d910ddf = Object.create(null);\nfunction $02b6f511cc6c123c$var$getScope$1(node, key) {\n if (!key) return node;\n const keys = key.split(\".\");\n for(let i = 0, n = keys.length; i < n; ++i){\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\nfunction $02b6f511cc6c123c$var$set(root, scope, values) {\n if (typeof scope === \"string\") return $02b6f511cc6c123c$export$efca4cbe5dd06740($02b6f511cc6c123c$var$getScope$1(root, scope), values);\n return $02b6f511cc6c123c$export$efca4cbe5dd06740($02b6f511cc6c123c$var$getScope$1(root, \"\"), scope);\n}\nclass $02b6f511cc6c123c$var$Defaults {\n set(scope, values) {\n return $02b6f511cc6c123c$var$set(this, scope, values);\n }\n get(scope) {\n return $02b6f511cc6c123c$var$getScope$1(this, scope);\n }\n describe(scope, values) {\n return $02b6f511cc6c123c$var$set($02b6f511cc6c123c$export$2e2af4578d910ddf, scope, values);\n }\n override(scope, values) {\n return $02b6f511cc6c123c$var$set($02b6f511cc6c123c$export$6559d589eb85fbb6, scope, values);\n }\n route(scope, name, targetScope, targetName) {\n const scopeObject = $02b6f511cc6c123c$var$getScope$1(this, scope);\n const targetScopeObject = $02b6f511cc6c123c$var$getScope$1(this, targetScope);\n const privateName = \"_\" + name;\n Object.defineProperties(scopeObject, {\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n [name]: {\n enumerable: true,\n get () {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if ($02b6f511cc6c123c$export$23f2a1d2818174ef(local)) return Object.assign({}, target, local);\n return $02b6f511cc6c123c$export$90a7f3efeed30595(local, target);\n },\n set (value) {\n this[privateName] = value;\n }\n }\n });\n }\n apply(appliers) {\n appliers.forEach((apply)=>apply(this));\n }\n constructor(_descriptors, _appliers){\n this.animation = undefined;\n this.backgroundColor = \"rgba(0,0,0,0.1)\";\n this.borderColor = \"rgba(0,0,0,0.1)\";\n this.color = \"#666\";\n this.datasets = {};\n this.devicePixelRatio = (context)=>context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n \"mousemove\",\n \"mouseout\",\n \"click\",\n \"touchstart\",\n \"touchmove\"\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: \"normal\",\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options)=>$02b6f511cc6c123c$export$738ab4df8bf92ae9(options.backgroundColor);\n this.hoverBorderColor = (ctx, options)=>$02b6f511cc6c123c$export$738ab4df8bf92ae9(options.borderColor);\n this.hoverColor = (ctx, options)=>$02b6f511cc6c123c$export$738ab4df8bf92ae9(options.color);\n this.indexAxis = \"x\";\n this.interaction = {\n mode: \"nearest\",\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n}\nvar $02b6f511cc6c123c$export$4368d992c4eafac0 = /* #__PURE__ */ new $02b6f511cc6c123c$var$Defaults({\n _scriptable: (name)=>!name.startsWith(\"on\"),\n _indexable: (name)=>name !== \"events\",\n hover: {\n _fallback: \"interaction\"\n },\n interaction: {\n _scriptable: false,\n _indexable: false\n }\n}, [\n $02b6f511cc6c123c$var$applyAnimationsDefaults,\n $02b6f511cc6c123c$var$applyLayoutsDefaults,\n $02b6f511cc6c123c$var$applyScaleDefaults\n]);\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */ function $02b6f511cc6c123c$export$1a8f5705751d8277(font) {\n if (!font || $02b6f511cc6c123c$export$342063e11d6c3cad(font.size) || $02b6f511cc6c123c$export$342063e11d6c3cad(font.family)) return null;\n return (font.style ? font.style + \" \" : \"\") + (font.weight ? font.weight + \" \" : \"\") + font.size + \"px \" + font.family;\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$e7c866399fa523f5(ctx, data, gc, longest, string) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) longest = textWidth;\n return longest;\n}\n/**\n * @private\n */ // eslint-disable-next-line complexity\nfunction $02b6f511cc6c123c$export$faec65b429be379(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n ctx.save();\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i, j, jlen, thing, nestedThing;\n for(i = 0; i < ilen; i++){\n thing = arrayOfThings[i];\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !$02b6f511cc6c123c$export$8b22cf2602fb60ce(thing)) longest = $02b6f511cc6c123c$export$e7c866399fa523f5(ctx, data, gc, longest, thing);\n else if ($02b6f511cc6c123c$export$8b22cf2602fb60ce(thing)) // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for(j = 0, jlen = thing.length; j < jlen; j++){\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !$02b6f511cc6c123c$export$8b22cf2602fb60ce(nestedThing)) longest = $02b6f511cc6c123c$export$e7c866399fa523f5(ctx, data, gc, longest, nestedThing);\n }\n }\n ctx.restore();\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for(i = 0; i < gcLen; i++)delete data[gc[i]];\n gc.splice(0, gcLen);\n }\n return longest;\n}\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */ function $02b6f511cc6c123c$export$78acf4525d8a74c4(chart, pixel, width) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n/**\n * Clears the entire canvas.\n */ function $02b6f511cc6c123c$export$c9170ad7d4cd7e57(canvas, ctx) {\n ctx = ctx || canvas.getContext(\"2d\");\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\nfunction $02b6f511cc6c123c$export$493d36ec626b6698(ctx, options, x, y) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n $02b6f511cc6c123c$export$24baa2b76016ce0e(ctx, options, x, y, null);\n}\n// eslint-disable-next-line complexity\nfunction $02b6f511cc6c123c$export$24baa2b76016ce0e(ctx, options, x, y, w) {\n let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * $02b6f511cc6c123c$export$53c86fa97d611818;\n if (style && typeof style === \"object\") {\n type = style.toString();\n if (type === \"[object HTMLImageElement]\" || type === \"[object HTMLCanvasElement]\") {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n if (isNaN(radius) || radius <= 0) return;\n ctx.beginPath();\n switch(style){\n // Default includes circle\n default:\n if (w) ctx.ellipse(x, y, w / 2, radius, 0, 0, $02b6f511cc6c123c$export$971d5caa766a69d7);\n else ctx.arc(x, y, radius, 0, $02b6f511cc6c123c$export$971d5caa766a69d7);\n ctx.closePath();\n break;\n case \"triangle\":\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += $02b6f511cc6c123c$export$7a0bdf7d4a91ea88;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += $02b6f511cc6c123c$export$7a0bdf7d4a91ea88;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case \"rectRounded\":\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + $02b6f511cc6c123c$export$39c1cc7c062529d4) * size;\n xOffsetW = Math.cos(rad + $02b6f511cc6c123c$export$39c1cc7c062529d4) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + $02b6f511cc6c123c$export$39c1cc7c062529d4) * size;\n yOffsetW = Math.sin(rad + $02b6f511cc6c123c$export$39c1cc7c062529d4) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - $02b6f511cc6c123c$export$56c0d5a1e737357d, rad - $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd, rad + $02b6f511cc6c123c$export$56c0d5a1e737357d);\n ctx.closePath();\n break;\n case \"rect\":\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += $02b6f511cc6c123c$export$39c1cc7c062529d4;\n /* falls through */ case \"rectRot\":\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case \"crossRot\":\n rad += $02b6f511cc6c123c$export$39c1cc7c062529d4;\n /* falls through */ case \"cross\":\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case \"star\":\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += $02b6f511cc6c123c$export$39c1cc7c062529d4;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case \"line\":\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case \"dash\":\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n ctx.fill();\n if (options.borderWidth > 0) ctx.stroke();\n}\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */ function $02b6f511cc6c123c$export$e7094788287c5e9b(point, area, margin) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;\n}\nfunction $02b6f511cc6c123c$export$8743009a87fcb00f(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\nfunction $02b6f511cc6c123c$export$3d8c2f653ac9d0b9(ctx) {\n ctx.restore();\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$d24c54395ce0c509(ctx, previous, target, flip, mode) {\n if (!previous) return ctx.lineTo(target.x, target.y);\n if (mode === \"middle\") {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === \"after\" !== !!flip) ctx.lineTo(previous.x, target.y);\n else ctx.lineTo(target.x, previous.y);\n ctx.lineTo(target.x, target.y);\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$6554612db691658e(ctx, previous, target, flip) {\n if (!previous) return ctx.lineTo(target.x, target.y);\n ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y);\n}\nfunction $02b6f511cc6c123c$var$setRenderOpts(ctx, opts) {\n if (opts.translation) ctx.translate(opts.translation[0], opts.translation[1]);\n if (!$02b6f511cc6c123c$export$342063e11d6c3cad(opts.rotation)) ctx.rotate(opts.rotation);\n if (opts.color) ctx.fillStyle = opts.color;\n if (opts.textAlign) ctx.textAlign = opts.textAlign;\n if (opts.textBaseline) ctx.textBaseline = opts.textBaseline;\n}\nfunction $02b6f511cc6c123c$var$decorateText(ctx, x, y, line, opts) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */ const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\nfunction $02b6f511cc6c123c$var$drawBackdrop(ctx, opts) {\n const oldColor = ctx.fillStyle;\n ctx.fillStyle = opts.color;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n/**\n * Render text onto the canvas\n */ function $02b6f511cc6c123c$export$dc98b0b04f4c7758(ctx, text, x, y, font, opts = {}) {\n const lines = $02b6f511cc6c123c$export$8b22cf2602fb60ce(text) ? text : [\n text\n ];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== \"\";\n let i, line;\n ctx.save();\n ctx.font = font.string;\n $02b6f511cc6c123c$var$setRenderOpts(ctx, opts);\n for(i = 0; i < lines.length; ++i){\n line = lines[i];\n if (opts.backdrop) $02b6f511cc6c123c$var$drawBackdrop(ctx, opts.backdrop);\n if (stroke) {\n if (opts.strokeColor) ctx.strokeStyle = opts.strokeColor;\n if (!$02b6f511cc6c123c$export$342063e11d6c3cad(opts.strokeWidth)) ctx.lineWidth = opts.strokeWidth;\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n ctx.fillText(line, x, y, opts.maxWidth);\n $02b6f511cc6c123c$var$decorateText(ctx, x, y, line, opts);\n y += Number(font.lineHeight);\n }\n ctx.restore();\n}\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */ function $02b6f511cc6c123c$export$1fbe638ecf81657e(ctx, rect) {\n const { x: x, y: y, w: w, h: h, radius: radius } = rect;\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * $02b6f511cc6c123c$export$56c0d5a1e737357d, $02b6f511cc6c123c$export$56c0d5a1e737357d, true);\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, $02b6f511cc6c123c$export$56c0d5a1e737357d, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd, true);\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd, 0, true);\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -$02b6f511cc6c123c$export$7f8ddf7c7c20b3cd, true);\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\nconst $02b6f511cc6c123c$var$LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst $02b6f511cc6c123c$var$FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n/**\n * @alias Chart.helpers.options\n * @namespace\n */ /**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */ function $02b6f511cc6c123c$export$8c78c7c36408ea29(value, size) {\n const matches = (\"\" + value).match($02b6f511cc6c123c$var$LINE_HEIGHT);\n if (!matches || matches[1] === \"normal\") return size * 1.2;\n value = +matches[2];\n switch(matches[3]){\n case \"px\":\n return value;\n case \"%\":\n value /= 100;\n break;\n }\n return size * value;\n}\nconst $02b6f511cc6c123c$var$numberOrZero = (v)=>+v || 0;\nfunction $02b6f511cc6c123c$export$21579262ef46735b(value, props) {\n const ret = {};\n const objProps = $02b6f511cc6c123c$export$23f2a1d2818174ef(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = $02b6f511cc6c123c$export$23f2a1d2818174ef(value) ? objProps ? (prop)=>$02b6f511cc6c123c$export$90a7f3efeed30595(value[prop], value[props[prop]]) : (prop)=>value[prop] : ()=>value;\n for (const prop of keys)ret[prop] = $02b6f511cc6c123c$var$numberOrZero(read(prop));\n return ret;\n}\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */ function $02b6f511cc6c123c$export$d66dc83d8cfc8dd(value) {\n return $02b6f511cc6c123c$export$21579262ef46735b(value, {\n top: \"y\",\n right: \"x\",\n bottom: \"y\",\n left: \"x\"\n });\n}\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */ function $02b6f511cc6c123c$export$92108d983e8ee699(value) {\n return $02b6f511cc6c123c$export$21579262ef46735b(value, [\n \"topLeft\",\n \"topRight\",\n \"bottomLeft\",\n \"bottomRight\"\n ]);\n}\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */ function $02b6f511cc6c123c$export$a9c23c6ac3fc3eca(value) {\n const obj = $02b6f511cc6c123c$export$d66dc83d8cfc8dd(value);\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n return obj;\n}\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */ function $02b6f511cc6c123c$export$34aec0b863436764(options, fallback) {\n options = options || {};\n fallback = fallback || $02b6f511cc6c123c$export$4368d992c4eafac0.font;\n let size = $02b6f511cc6c123c$export$90a7f3efeed30595(options.size, fallback.size);\n if (typeof size === \"string\") size = parseInt(size, 10);\n let style = $02b6f511cc6c123c$export$90a7f3efeed30595(options.style, fallback.style);\n if (style && !(\"\" + style).match($02b6f511cc6c123c$var$FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n const font = {\n family: $02b6f511cc6c123c$export$90a7f3efeed30595(options.family, fallback.family),\n lineHeight: $02b6f511cc6c123c$export$8c78c7c36408ea29($02b6f511cc6c123c$export$90a7f3efeed30595(options.lineHeight, fallback.lineHeight), size),\n size: size,\n style: style,\n weight: $02b6f511cc6c123c$export$90a7f3efeed30595(options.weight, fallback.weight),\n string: \"\"\n };\n font.string = $02b6f511cc6c123c$export$1a8f5705751d8277(font);\n return font;\n}\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */ function $02b6f511cc6c123c$export$407448d2b89b1813(inputs, context, index, info) {\n let cacheable = true;\n let i, ilen, value;\n for(i = 0, ilen = inputs.length; i < ilen; ++i){\n value = inputs[i];\n if (value === undefined) continue;\n if (context !== undefined && typeof value === \"function\") {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && $02b6f511cc6c123c$export$8b22cf2602fb60ce(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) info.cacheable = false;\n return value;\n }\n }\n}\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */ function $02b6f511cc6c123c$export$db202ddc8be9136(minmax, grace, beginAtZero) {\n const { min: min, max: max } = minmax;\n const change = $02b6f511cc6c123c$export$7ccc53e8f1e7dfc5(grace, (max - min) / 2);\n const keepZero = (value, add)=>beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\nfunction $02b6f511cc6c123c$export$35e795649ee09318(parentContext, context) {\n return Object.assign(Object.create(parentContext), context);\n}\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */ function $02b6f511cc6c123c$export$a9c996f45e5784d0(scopes, prefixes = [\n \"\"\n], rootScopes, fallback, getTarget = ()=>scopes[0]) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === \"undefined\") fallback = $02b6f511cc6c123c$var$_resolve(\"_fallback\", scopes);\n const cache = {\n [Symbol.toStringTag]: \"Object\",\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope)=>$02b6f511cc6c123c$export$a9c996f45e5784d0([\n scope,\n ...scopes\n ], prefixes, finalRootScopes, fallback)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop) {\n return $02b6f511cc6c123c$var$_cached(target, prop, ()=>$02b6f511cc6c123c$var$_resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return $02b6f511cc6c123c$var$getKeysFromAllScopes(target).includes(prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys (target) {\n return $02b6f511cc6c123c$var$getKeysFromAllScopes(target);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n });\n}\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */ function $02b6f511cc6c123c$export$c3950d9923825c02(proxy, context, subProxy, descriptorDefaults) {\n const cache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: $02b6f511cc6c123c$export$7910e0436ed8d1de(proxy, descriptorDefaults),\n setContext: (ctx)=>$02b6f511cc6c123c$export$c3950d9923825c02(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope)=>$02b6f511cc6c123c$export$c3950d9923825c02(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop, receiver) {\n return $02b6f511cc6c123c$var$_cached(target, prop, ()=>$02b6f511cc6c123c$var$_resolveWithContext(target, prop, receiver));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? {\n enumerable: true,\n configurable: true\n } : undefined : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(proxy);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return Reflect.has(proxy, prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys () {\n return Reflect.ownKeys(proxy);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n });\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$7910e0436ed8d1de(proxy, defaults = {\n scriptable: true,\n indexable: true\n}) {\n const { _scriptable: _scriptable = defaults.scriptable, _indexable: _indexable = defaults.indexable, _allKeys: _allKeys = defaults.allKeys } = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: $02b6f511cc6c123c$export$a93c5207d687da10(_scriptable) ? _scriptable : ()=>_scriptable,\n isIndexable: $02b6f511cc6c123c$export$a93c5207d687da10(_indexable) ? _indexable : ()=>_indexable\n };\n}\nconst $02b6f511cc6c123c$var$readKey = (prefix, name)=>prefix ? prefix + $02b6f511cc6c123c$export$a8550f7dbe79f93a(name) : name;\nconst $02b6f511cc6c123c$var$needsSubResolver = (prop, value)=>$02b6f511cc6c123c$export$23f2a1d2818174ef(value) && prop !== \"adapters\" && (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction $02b6f511cc6c123c$var$_cached(target, prop, resolve) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) return target[prop];\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\nfunction $02b6f511cc6c123c$var$_resolveWithContext(target, prop, receiver) {\n const { _proxy: _proxy, _context: _context, _subProxy: _subProxy, _descriptors: descriptors } = target;\n let value = _proxy[prop]; // resolve from proxy\n // resolve with context\n if ($02b6f511cc6c123c$export$a93c5207d687da10(value) && descriptors.isScriptable(prop)) value = $02b6f511cc6c123c$var$_resolveScriptable(prop, value, target, receiver);\n if ($02b6f511cc6c123c$export$8b22cf2602fb60ce(value) && value.length) value = $02b6f511cc6c123c$var$_resolveArray(prop, value, target, descriptors.isIndexable);\n if ($02b6f511cc6c123c$var$needsSubResolver(prop, value)) // if the resolved value is an object, create a sub resolver for it\n value = $02b6f511cc6c123c$export$c3950d9923825c02(value, _context, _subProxy && _subProxy[prop], descriptors);\n return value;\n}\nfunction $02b6f511cc6c123c$var$_resolveScriptable(prop, getValue, target, receiver) {\n const { _proxy: _proxy, _context: _context, _subProxy: _subProxy, _stack: _stack } = target;\n if (_stack.has(prop)) throw new Error(\"Recursion detected: \" + Array.from(_stack).join(\"->\") + \"->\" + prop);\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if ($02b6f511cc6c123c$var$needsSubResolver(prop, value)) // When scriptable option returns an object, create a resolver on that.\n value = $02b6f511cc6c123c$var$createSubResolver(_proxy._scopes, _proxy, prop, value);\n return value;\n}\nfunction $02b6f511cc6c123c$var$_resolveArray(prop, value, target, isIndexable) {\n const { _proxy: _proxy, _context: _context, _subProxy: _subProxy, _descriptors: descriptors } = target;\n if (typeof _context.index !== \"undefined\" && isIndexable(prop)) return value[_context.index % value.length];\n else if ($02b6f511cc6c123c$export$23f2a1d2818174ef(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter((s)=>s !== arr);\n value = [];\n for (const item of arr){\n const resolver = $02b6f511cc6c123c$var$createSubResolver(scopes, _proxy, prop, item);\n value.push($02b6f511cc6c123c$export$c3950d9923825c02(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\nfunction $02b6f511cc6c123c$var$resolveFallback(fallback, prop, value) {\n return $02b6f511cc6c123c$export$a93c5207d687da10(fallback) ? fallback(prop, value) : fallback;\n}\nconst $02b6f511cc6c123c$var$getScope = (key, parent)=>key === true ? parent : typeof key === \"string\" ? $02b6f511cc6c123c$export$2d1720544b23b823(parent, key) : undefined;\nfunction $02b6f511cc6c123c$var$addScopes(set, parentScopes, key, parentFallback, value) {\n for (const parent of parentScopes){\n const scope = $02b6f511cc6c123c$var$getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = $02b6f511cc6c123c$var$resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== \"undefined\" && fallback !== key && fallback !== parentFallback) // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n } else if (scope === false && typeof parentFallback !== \"undefined\" && key !== parentFallback) // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n return false;\n}\nfunction $02b6f511cc6c123c$var$createSubResolver(parentScopes, resolver, prop, value) {\n const rootScopes = resolver._rootScopes;\n const fallback = $02b6f511cc6c123c$var$resolveFallback(resolver._fallback, prop, value);\n const allScopes = [\n ...parentScopes,\n ...rootScopes\n ];\n const set = new Set();\n set.add(value);\n let key = $02b6f511cc6c123c$var$addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) return false;\n if (typeof fallback !== \"undefined\" && fallback !== prop) {\n key = $02b6f511cc6c123c$var$addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) return false;\n }\n return $02b6f511cc6c123c$export$a9c996f45e5784d0(Array.from(set), [\n \"\"\n ], rootScopes, fallback, ()=>$02b6f511cc6c123c$var$subGetTarget(resolver, prop, value));\n}\nfunction $02b6f511cc6c123c$var$addScopesFromKey(set, allScopes, key, fallback, item) {\n while(key)key = $02b6f511cc6c123c$var$addScopes(set, allScopes, key, fallback, item);\n return key;\n}\nfunction $02b6f511cc6c123c$var$subGetTarget(resolver, prop, value) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) parent[prop] = {};\n const target = parent[prop];\n if ($02b6f511cc6c123c$export$8b22cf2602fb60ce(target) && $02b6f511cc6c123c$export$23f2a1d2818174ef(value)) // For array of objects, the object is used to store updated values\n return value;\n return target || {};\n}\nfunction $02b6f511cc6c123c$var$_resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n let value;\n for (const prefix of prefixes){\n value = $02b6f511cc6c123c$var$_resolve($02b6f511cc6c123c$var$readKey(prefix, prop), scopes);\n if (typeof value !== \"undefined\") return $02b6f511cc6c123c$var$needsSubResolver(prop, value) ? $02b6f511cc6c123c$var$createSubResolver(scopes, proxy, prop, value) : value;\n }\n}\nfunction $02b6f511cc6c123c$var$_resolve(key, scopes) {\n for (const scope of scopes){\n if (!scope) continue;\n const value = scope[key];\n if (typeof value !== \"undefined\") return value;\n }\n}\nfunction $02b6f511cc6c123c$var$getKeysFromAllScopes(target) {\n let keys = target._keys;\n if (!keys) keys = target._keys = $02b6f511cc6c123c$var$resolveKeysFromAllScopes(target._scopes);\n return keys;\n}\nfunction $02b6f511cc6c123c$var$resolveKeysFromAllScopes(scopes) {\n const set = new Set();\n for (const scope of scopes)for (const key of Object.keys(scope).filter((k)=>!k.startsWith(\"_\")))set.add(key);\n return Array.from(set);\n}\nfunction $02b6f511cc6c123c$export$4a5767248b18ef41(meta, data, start, count) {\n const { iScale: iScale } = meta;\n const { key: key = \"r\" } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse($02b6f511cc6c123c$export$2d1720544b23b823(item, key), index)\n };\n }\n return parsed;\n}\nconst $02b6f511cc6c123c$var$EPSILON = Number.EPSILON || 1e-14;\nconst $02b6f511cc6c123c$var$getPoint = (points, i)=>i < points.length && !points[i].skip && points[i];\nconst $02b6f511cc6c123c$var$getValueAxis = (indexAxis)=>indexAxis === \"x\" ? \"y\" : \"x\";\nfunction $02b6f511cc6c123c$export$e171bab687b50e0(firstPoint, middlePoint, afterPoint, t) {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n // This function must also respect \"skipped\" points\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = $02b6f511cc6c123c$export$158acd800e1ef08b(current, previous);\n const d12 = $02b6f511cc6c123c$export$158acd800e1ef08b(next, current);\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n/**\n * Adjust tangents to ensure monotonic properties\n */ function $02b6f511cc6c123c$var$monotoneAdjust(points, deltaK, mK) {\n const pointsLen = points.length;\n let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n let pointAfter = $02b6f511cc6c123c$var$getPoint(points, 0);\n for(let i = 0; i < pointsLen - 1; ++i){\n pointCurrent = pointAfter;\n pointAfter = $02b6f511cc6c123c$var$getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) continue;\n if ($02b6f511cc6c123c$export$a05254e7c3aeba6e(deltaK[i], 0, $02b6f511cc6c123c$var$EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) continue;\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\nfunction $02b6f511cc6c123c$var$monotoneCompute(points, mK, indexAxis = \"x\") {\n const valueAxis = $02b6f511cc6c123c$var$getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta, pointBefore, pointCurrent;\n let pointAfter = $02b6f511cc6c123c$var$getPoint(points, 0);\n for(let i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = $02b6f511cc6c123c$var$getPoint(points, i + 1);\n if (!pointCurrent) continue;\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */ function $02b6f511cc6c123c$export$527e9aa3390079e9(points, indexAxis = \"x\") {\n const valueAxis = $02b6f511cc6c123c$var$getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK = Array(pointsLen).fill(0);\n const mK = Array(pointsLen);\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore, pointCurrent;\n let pointAfter = $02b6f511cc6c123c$var$getPoint(points, 0);\n for(i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = $02b6f511cc6c123c$var$getPoint(points, i + 1);\n if (!pointCurrent) continue;\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : $02b6f511cc6c123c$export$2408f22a0fab9ae5(deltaK[i - 1]) !== $02b6f511cc6c123c$export$2408f22a0fab9ae5(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n $02b6f511cc6c123c$var$monotoneAdjust(points, deltaK, mK);\n $02b6f511cc6c123c$var$monotoneCompute(points, mK, indexAxis);\n}\nfunction $02b6f511cc6c123c$var$capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n}\nfunction $02b6f511cc6c123c$var$capBezierPoints(points, area) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = $02b6f511cc6c123c$export$e7094788287c5e9b(points[0], area);\n for(i = 0, ilen = points.length; i < ilen; ++i){\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && $02b6f511cc6c123c$export$e7094788287c5e9b(points[i + 1], area);\n if (!inArea) continue;\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = $02b6f511cc6c123c$var$capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = $02b6f511cc6c123c$var$capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = $02b6f511cc6c123c$var$capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = $02b6f511cc6c123c$var$capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$ab83b03e4111b1d0(points, options, area, loop, indexAxis) {\n let i, ilen, point, controlPoints;\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) points = points.filter((pt)=>!pt.skip);\n if (options.cubicInterpolationMode === \"monotone\") $02b6f511cc6c123c$export$527e9aa3390079e9(points, indexAxis);\n else {\n let prev = loop ? points[points.length - 1] : points[0];\n for(i = 0, ilen = points.length; i < ilen; ++i){\n point = points[i];\n controlPoints = $02b6f511cc6c123c$export$e171bab687b50e0(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension);\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n if (options.capBezierPoints) $02b6f511cc6c123c$var$capBezierPoints(points, area);\n}\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */ /**\n * @private\n */ function $02b6f511cc6c123c$export$3a1a48c8f6ef640e() {\n return typeof window !== \"undefined\" && typeof document !== \"undefined\";\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$9bb611d729802a56(domNode) {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === \"[object ShadowRoot]\") parent = parent.host;\n return parent;\n}\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */ function $02b6f511cc6c123c$var$parseMaxStyle(styleValue, node, parentProperty) {\n let valueInPixels;\n if (typeof styleValue === \"string\") {\n valueInPixels = parseInt(styleValue, 10);\n if (styleValue.indexOf(\"%\") !== -1) // percentage * size in dimension\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n } else valueInPixels = styleValue;\n return valueInPixels;\n}\nconst $02b6f511cc6c123c$var$getComputedStyle = (element)=>element.ownerDocument.defaultView.getComputedStyle(element, null);\nfunction $02b6f511cc6c123c$export$a17c37559e1db147(el, property) {\n return $02b6f511cc6c123c$var$getComputedStyle(el).getPropertyValue(property);\n}\nconst $02b6f511cc6c123c$var$positions = [\n \"top\",\n \"right\",\n \"bottom\",\n \"left\"\n];\nfunction $02b6f511cc6c123c$var$getPositionedStyle(styles, style, suffix) {\n const result = {};\n suffix = suffix ? \"-\" + suffix : \"\";\n for(let i = 0; i < 4; i++){\n const pos = $02b6f511cc6c123c$var$positions[i];\n result[pos] = parseFloat(styles[style + \"-\" + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\nconst $02b6f511cc6c123c$var$useOffsetPos = (x, y, target)=>(x > 0 || y > 0) && (!target || !target.shadowRoot);\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */ function $02b6f511cc6c123c$var$getCanvasPosition(e, canvas) {\n const touches = e.touches;\n const source = touches && touches.length ? touches[0] : e;\n const { offsetX: offsetX, offsetY: offsetY } = source;\n let box = false;\n let x, y;\n if ($02b6f511cc6c123c$var$useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {\n x: x,\n y: y,\n box: box\n };\n}\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */ function $02b6f511cc6c123c$export$df995fae86a55f06(event, chart) {\n if (\"native\" in event) return event;\n const { canvas: canvas, currentDevicePixelRatio: currentDevicePixelRatio } = chart;\n const style = $02b6f511cc6c123c$var$getComputedStyle(canvas);\n const borderBox = style.boxSizing === \"border-box\";\n const paddings = $02b6f511cc6c123c$var$getPositionedStyle(style, \"padding\");\n const borders = $02b6f511cc6c123c$var$getPositionedStyle(style, \"border\", \"width\");\n const { x: x, y: y, box: box } = $02b6f511cc6c123c$var$getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n let { width: width, height: height } = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\nfunction $02b6f511cc6c123c$var$getContainerSize(canvas, width, height) {\n let maxWidth, maxHeight;\n if (width === undefined || height === undefined) {\n const container = $02b6f511cc6c123c$export$9bb611d729802a56(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = $02b6f511cc6c123c$var$getComputedStyle(container);\n const containerBorder = $02b6f511cc6c123c$var$getPositionedStyle(containerStyle, \"border\", \"width\");\n const containerPadding = $02b6f511cc6c123c$var$getPositionedStyle(containerStyle, \"padding\");\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = $02b6f511cc6c123c$var$parseMaxStyle(containerStyle.maxWidth, container, \"clientWidth\");\n maxHeight = $02b6f511cc6c123c$var$parseMaxStyle(containerStyle.maxHeight, container, \"clientHeight\");\n }\n }\n return {\n width: width,\n height: height,\n maxWidth: maxWidth || $02b6f511cc6c123c$export$2ec5befb9e6c97d4,\n maxHeight: maxHeight || $02b6f511cc6c123c$export$2ec5befb9e6c97d4\n };\n}\nconst $02b6f511cc6c123c$var$round1 = (v)=>Math.round(v * 10) / 10;\n// eslint-disable-next-line complexity\nfunction $02b6f511cc6c123c$export$2329c99376c9d0a4(canvas, bbWidth, bbHeight, aspectRatio) {\n const style = $02b6f511cc6c123c$var$getComputedStyle(canvas);\n const margins = $02b6f511cc6c123c$var$getPositionedStyle(style, \"margin\");\n const maxWidth = $02b6f511cc6c123c$var$parseMaxStyle(style.maxWidth, canvas, \"clientWidth\") || $02b6f511cc6c123c$export$2ec5befb9e6c97d4;\n const maxHeight = $02b6f511cc6c123c$var$parseMaxStyle(style.maxHeight, canvas, \"clientHeight\") || $02b6f511cc6c123c$export$2ec5befb9e6c97d4;\n const containerSize = $02b6f511cc6c123c$var$getContainerSize(canvas, bbWidth, bbHeight);\n let { width: width, height: height } = containerSize;\n if (style.boxSizing === \"content-box\") {\n const borders = $02b6f511cc6c123c$var$getPositionedStyle(style, \"border\", \"width\");\n const paddings = $02b6f511cc6c123c$var$getPositionedStyle(style, \"padding\");\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = $02b6f511cc6c123c$var$round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = $02b6f511cc6c123c$var$round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = $02b6f511cc6c123c$var$round1(width / 2);\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = $02b6f511cc6c123c$var$round1(Math.floor(height * aspectRatio));\n }\n return {\n width: width,\n height: height\n };\n}\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */ function $02b6f511cc6c123c$export$f787f51d84a910ad(chart, forceRatio, forceStyle) {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n const canvas = chart.canvas;\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */ const $02b6f511cc6c123c$export$3466f893ebf79586 = function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive () {\n passiveSupported = true;\n return false;\n }\n };\n window.addEventListener(\"test\", null, options);\n window.removeEventListener(\"test\", null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}();\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */ function $02b6f511cc6c123c$export$b4171a6734a65d42(element, property) {\n const value = $02b6f511cc6c123c$export$a17c37559e1db147(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$8a5498727ef6be21(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$7a38258bbe170828(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === \"middle\" ? t < 0.5 ? p1.y : p2.y : mode === \"after\" ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y\n };\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$2f6ca3d3b1f80bf5(p1, p2, t, mode) {\n const cp1 = {\n x: p1.cp2x,\n y: p1.cp2y\n };\n const cp2 = {\n x: p2.cp1x,\n y: p2.cp1y\n };\n const a = $02b6f511cc6c123c$export$8a5498727ef6be21(p1, cp1, t);\n const b = $02b6f511cc6c123c$export$8a5498727ef6be21(cp1, cp2, t);\n const c = $02b6f511cc6c123c$export$8a5498727ef6be21(cp2, p2, t);\n const d = $02b6f511cc6c123c$export$8a5498727ef6be21(a, b, t);\n const e = $02b6f511cc6c123c$export$8a5498727ef6be21(b, c, t);\n return $02b6f511cc6c123c$export$8a5498727ef6be21(d, e, t);\n}\nconst $02b6f511cc6c123c$var$getRightToLeftAdapter = function(rectX, width) {\n return {\n x (x) {\n return rectX + rectX + width - x;\n },\n setWidth (w) {\n width = w;\n },\n textAlign (align) {\n if (align === \"center\") return align;\n return align === \"right\" ? \"left\" : \"right\";\n },\n xPlus (x, value) {\n return x - value;\n },\n leftForLtr (x, itemWidth) {\n return x - itemWidth;\n }\n };\n};\nconst $02b6f511cc6c123c$var$getLeftToRightAdapter = function() {\n return {\n x (x) {\n return x;\n },\n setWidth (w) {},\n textAlign (align) {\n return align;\n },\n xPlus (x, value) {\n return x + value;\n },\n leftForLtr (x, _itemWidth) {\n return x;\n }\n };\n};\nfunction $02b6f511cc6c123c$export$3d12bd131bb975d1(rtl, rectX, width) {\n return rtl ? $02b6f511cc6c123c$var$getRightToLeftAdapter(rectX, width) : $02b6f511cc6c123c$var$getLeftToRightAdapter();\n}\nfunction $02b6f511cc6c123c$export$91c6e00c14e7e6fd(ctx, direction) {\n let style, original;\n if (direction === \"ltr\" || direction === \"rtl\") {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue(\"direction\"),\n style.getPropertyPriority(\"direction\")\n ];\n style.setProperty(\"direction\", direction, \"important\");\n ctx.prevTextDirection = original;\n }\n}\nfunction $02b6f511cc6c123c$export$890c4ad488842ce7(ctx, original) {\n if (original !== undefined) {\n delete ctx.prevTextDirection;\n ctx.canvas.style.setProperty(\"direction\", original[0], original[1]);\n }\n}\nfunction $02b6f511cc6c123c$var$propertyFn(property) {\n if (property === \"angle\") return {\n between: $02b6f511cc6c123c$export$ffb5f4729a158638,\n compare: $02b6f511cc6c123c$export$c18d01048907ea92,\n normalize: $02b6f511cc6c123c$export$28f7fcd39efa255\n };\n return {\n between: $02b6f511cc6c123c$export$3b513254972cfc9c,\n compare: (a, b)=>a - b,\n normalize: (x)=>x\n };\n}\nfunction $02b6f511cc6c123c$var$normalizeSegment({ start: start, end: end, count: count, loop: loop, style: style }) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style: style\n };\n}\nfunction $02b6f511cc6c123c$var$getSegment(segment, points, bounds) {\n const { property: property, start: startBound, end: endBound } = bounds;\n const { between: between, normalize: normalize } = $02b6f511cc6c123c$var$propertyFn(property);\n const count = points.length;\n let { start: start, end: end, loop: loop } = segment;\n let i, ilen;\n if (loop) {\n start += count;\n end += count;\n for(i = 0, ilen = count; i < ilen; ++i){\n if (!between(normalize(points[start % count][property]), startBound, endBound)) break;\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n if (end < start) end += count;\n return {\n start: start,\n end: end,\n loop: loop,\n style: segment.style\n };\n}\nfunction $02b6f511cc6c123c$export$9fa96a7d116ea3ce(segment, points, bounds) {\n if (!bounds) return [\n segment\n ];\n const { property: property, start: startBound, end: endBound } = bounds;\n const count = points.length;\n const { compare: compare, between: between, normalize: normalize } = $02b6f511cc6c123c$var$propertyFn(property);\n const { start: start, end: end, loop: loop, style: style } = $02b6f511cc6c123c$var$getSegment(segment, points, bounds);\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n const startIsBefore = ()=>between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = ()=>compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = ()=>inside || startIsBefore();\n const shouldStop = ()=>!inside || endIsBefore();\n for(let i = start, prev = start; i <= end; ++i){\n point = points[i % count];\n if (point.skip) continue;\n value = normalize(point[property]);\n if (value === prevValue) continue;\n inside = between(value, startBound, endBound);\n if (subStart === null && shouldStart()) subStart = compare(value, startBound) === 0 ? i : prev;\n if (subStart !== null && shouldStop()) {\n result.push($02b6f511cc6c123c$var$normalizeSegment({\n start: subStart,\n end: i,\n loop: loop,\n count: count,\n style: style\n }));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n if (subStart !== null) result.push($02b6f511cc6c123c$var$normalizeSegment({\n start: subStart,\n end: end,\n loop: loop,\n count: count,\n style: style\n }));\n return result;\n}\nfunction $02b6f511cc6c123c$export$306ddfe3a8403e2(line, bounds) {\n const result = [];\n const segments = line.segments;\n for(let i = 0; i < segments.length; i++){\n const sub = $02b6f511cc6c123c$export$9fa96a7d116ea3ce(segments[i], line.points, bounds);\n if (sub.length) result.push(...sub);\n }\n return result;\n}\nfunction $02b6f511cc6c123c$var$findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n if (loop && !spanGaps) while(start < count && !points[start].skip)start++;\n while(start < count && points[start].skip)start++;\n start %= count;\n if (loop) end += start;\n while(end > start && points[end % count].skip)end--;\n end %= count;\n return {\n start: start,\n end: end\n };\n}\nfunction $02b6f511cc6c123c$var$solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n for(end = start + 1; end <= max; ++end){\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({\n start: start % count,\n end: (end - 1) % count,\n loop: loop\n });\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) start = end;\n }\n prev = cur;\n }\n if (last !== null) result.push({\n start: start % count,\n end: last % count,\n loop: loop\n });\n return result;\n}\nfunction $02b6f511cc6c123c$export$1a82df3d29112e01(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n if (!count) return [];\n const loop = !!line._loop;\n const { start: start, end: end } = $02b6f511cc6c123c$var$findStartAndEnd(points, count, loop, spanGaps);\n if (spanGaps === true) return $02b6f511cc6c123c$var$splitByStyles(line, [\n {\n start: start,\n end: end,\n loop: loop\n }\n ], points, segmentOptions);\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return $02b6f511cc6c123c$var$splitByStyles(line, $02b6f511cc6c123c$var$solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\nfunction $02b6f511cc6c123c$var$splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) return segments;\n return $02b6f511cc6c123c$var$doSplitByStyles(line, segments, points, segmentOptions);\n}\nfunction $02b6f511cc6c123c$var$doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = $02b6f511cc6c123c$var$readStyle(line.options);\n const { _datasetIndex: datasetIndex, options: { spanGaps: spanGaps } } = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) return;\n s += count;\n while(points[s % count].skip)s -= dir;\n while(points[e % count].skip)e += dir;\n if (s % count !== e % count) {\n result.push({\n start: s % count,\n end: e % count,\n loop: l,\n style: st\n });\n prevStyle = st;\n start = e % count;\n }\n }\n for (const segment of segments){\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for(i = start + 1; i <= segment.end; i++){\n const pt = points[i % count];\n style = $02b6f511cc6c123c$var$readStyle(segmentOptions.setContext($02b6f511cc6c123c$export$35e795649ee09318(chartContext, {\n type: \"segment\",\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex: datasetIndex\n })));\n if ($02b6f511cc6c123c$var$styleChanged(style, prevStyle)) addStyle(start, i - 1, segment.loop, prevStyle);\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) addStyle(start, i - 1, segment.loop, prevStyle);\n }\n return result;\n}\nfunction $02b6f511cc6c123c$var$readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\nfunction $02b6f511cc6c123c$var$styleChanged(style, prevStyle) {\n if (!prevStyle) return false;\n const cache = [];\n const replacer = function(key, value) {\n if (!$02b6f511cc6c123c$export$f96d196f7728bb5(value)) return value;\n if (!cache.includes(value)) cache.push(value);\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n\n\n\nclass $77dc20320068f1ee$var$Animator {\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n callbacks.forEach((fn)=>fn({\n chart: chart,\n initial: anims.initial,\n numSteps: numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n _refresh() {\n if (this._request) return;\n this._running = true;\n this._request = (0, $02b6f511cc6c123c$export$43caf9889c228507).call(window, ()=>{\n this._update();\n this._request = null;\n if (this._running) this._refresh();\n });\n }\n _update(date = Date.now()) {\n let remaining = 0;\n this._charts.forEach((anims, chart)=>{\n if (!anims.running || !anims.items.length) return;\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n for(; i >= 0; --i){\n item = items[i];\n if (item._active) {\n if (item._total > anims.duration) anims.duration = item._total;\n item.tick(date);\n draw = true;\n } else {\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, \"progress\");\n }\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, \"complete\");\n anims.initial = false;\n }\n remaining += items.length;\n });\n this._lastDate = date;\n if (remaining === 0) this._running = false;\n }\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n add(chart, items) {\n if (!items || !items.length) return;\n this._getAnims(chart).items.push(...items);\n }\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) return;\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur)=>Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n running(chart) {\n if (!this._running) return false;\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) return false;\n return true;\n }\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) return;\n const items = anims.items;\n let i = items.length - 1;\n for(; i >= 0; --i)items[i].cancel();\n anims.items = [];\n this._notify(chart, anims, Date.now(), \"complete\");\n }\n remove(chart) {\n return this._charts.delete(chart);\n }\n constructor(){\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n}\nvar $77dc20320068f1ee$export$a424a0aa8f687495 = /* #__PURE__ */ new $77dc20320068f1ee$var$Animator();\nconst $77dc20320068f1ee$var$transparent = \"transparent\";\nconst $77dc20320068f1ee$var$interpolators = {\n boolean (from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n color (from, to, factor) {\n const c0 = (0, $02b6f511cc6c123c$export$db3b6bfb95261072)(from || $77dc20320068f1ee$var$transparent);\n const c1 = c0.valid && (0, $02b6f511cc6c123c$export$db3b6bfb95261072)(to || $77dc20320068f1ee$var$transparent);\n return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to;\n },\n number (from, to, factor) {\n return from + (to - from) * factor;\n }\n};\nclass $77dc20320068f1ee$export$c35d437ae5945fcd {\n active() {\n return this._active;\n }\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = (0, $02b6f511cc6c123c$export$407448d2b89b1813)([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n this._from = (0, $02b6f511cc6c123c$export$407448d2b89b1813)([\n cfg.from,\n currentValue,\n to\n ]);\n }\n }\n cancel() {\n if (this._active) {\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n this._active = from !== to && (loop || elapsed < duration);\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n factor = elapsed / duration % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n this._target[prop] = this._fn(from, to, factor);\n }\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej)=>{\n promises.push({\n res: res,\n rej: rej\n });\n });\n }\n _notify(resolved) {\n const method = resolved ? \"res\" : \"rej\";\n const promises = this._promises || [];\n for(let i = 0; i < promises.length; i++)promises[i][method]();\n }\n constructor(cfg, target, prop, to){\n const currentValue = target[prop];\n to = (0, $02b6f511cc6c123c$export$407448d2b89b1813)([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n const from = (0, $02b6f511cc6c123c$export$407448d2b89b1813)([\n cfg.from,\n currentValue,\n to\n ]);\n this._active = true;\n this._fn = cfg.fn || $77dc20320068f1ee$var$interpolators[cfg.type || typeof from];\n this._easing = (0, $02b6f511cc6c123c$export$f1e1789686576879)[cfg.easing] || (0, $02b6f511cc6c123c$export$f1e1789686576879).linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n}\nclass $77dc20320068f1ee$export$8ab227dac26677d {\n configure(config) {\n if (!(0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(config)) return;\n const animationOptions = Object.keys((0, $02b6f511cc6c123c$export$4368d992c4eafac0).animation);\n const animatedProps = this._properties;\n Object.getOwnPropertyNames(config).forEach((key)=>{\n const cfg = config[key];\n if (!(0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(cfg)) return;\n const resolved = {};\n for (const option of animationOptions)resolved[option] = cfg[option];\n ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(cfg.properties) && cfg.properties || [\n key\n ]).forEach((prop)=>{\n if (prop === key || !animatedProps.has(prop)) animatedProps.set(prop, resolved);\n });\n });\n }\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = $77dc20320068f1ee$var$resolveTargetOptions(target, newOptions);\n if (!options) return [];\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) $77dc20320068f1ee$var$awaitAll(target.options.$animations, newOptions).then(()=>{\n target.options = newOptions;\n }, ()=>{});\n return animations;\n }\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n for(i = props.length - 1; i >= 0; --i){\n const prop = props[i];\n if (prop.charAt(0) === \"$\") continue;\n if (prop === \"options\") {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n if (animation) {\n if (cfg && animation.active()) {\n animation.update(cfg, value, date);\n continue;\n } else animation.cancel();\n }\n if (!cfg || !cfg.duration) {\n target[prop] = value;\n continue;\n }\n running[prop] = animation = new $77dc20320068f1ee$export$c35d437ae5945fcd(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n update(target, values) {\n if (this._properties.size === 0) {\n Object.assign(target, values);\n return;\n }\n const animations = this._createAnimations(target, values);\n if (animations.length) {\n $77dc20320068f1ee$export$a424a0aa8f687495.add(this._chart, animations);\n return true;\n }\n }\n constructor(chart, config){\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n}\nfunction $77dc20320068f1ee$var$awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for(let i = 0; i < keys.length; i++){\n const anim = animations[keys[i]];\n if (anim && anim.active()) running.push(anim.wait());\n }\n return Promise.all(running);\n}\nfunction $77dc20320068f1ee$var$resolveTargetOptions(target, newOptions) {\n if (!newOptions) return;\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) target.options = options = Object.assign({}, options, {\n $shared: false,\n $animations: {}\n });\n return options;\n}\nfunction $77dc20320068f1ee$var$scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\nfunction $77dc20320068f1ee$var$defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) return false;\n const x = $77dc20320068f1ee$var$scaleClip(xScale, allowedOverflow);\n const y = $77dc20320068f1ee$var$scaleClip(yScale, allowedOverflow);\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\nfunction $77dc20320068f1ee$var$toClip(value) {\n let t, r, b, l;\n if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else t = r = b = l = value;\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\nfunction $77dc20320068f1ee$var$getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i)keys.push(metasets[i].index);\n return keys;\n}\nfunction $77dc20320068f1ee$var$applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === \"single\";\n let i, ilen, datasetIndex, otherValue;\n if (value === null) return;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) continue;\n break;\n }\n otherValue = stack.values[datasetIndex];\n if ((0, $02b6f511cc6c123c$export$39b482c5e57630a8)(otherValue) && (singleMode || value === 0 || (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(value) === (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(otherValue))) value += otherValue;\n }\n return value;\n}\nfunction $77dc20320068f1ee$var$convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\nfunction $77dc20320068f1ee$var$isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || stacked === undefined && meta.stack !== undefined;\n}\nfunction $77dc20320068f1ee$var$getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction $77dc20320068f1ee$var$getUserBounds(scale) {\n const { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\nfunction $77dc20320068f1ee$var$getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction $77dc20320068f1ee$var$getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()){\n const value = stack[meta.index];\n if (positive && value > 0 || !positive && value < 0) return meta.index;\n }\n return null;\n}\nfunction $77dc20320068f1ee$var$updateStacks(controller, parsed) {\n const { chart: chart, _cachedMeta: meta } = controller;\n const stacks = chart._stacks || (chart._stacks = {});\n const { iScale: iScale, vScale: vScale, index: datasetIndex } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = $77dc20320068f1ee$var$getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n for(let i = 0; i < ilen; ++i){\n const item = parsed[i];\n const { [iAxis]: index, [vAxis]: value } = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = $77dc20320068f1ee$var$getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n stack._top = $77dc20320068f1ee$var$getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = $77dc20320068f1ee$var$getLastIndexInStack(stack, vScale, false, meta.type);\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\nfunction $77dc20320068f1ee$var$getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter((key)=>scales[key].axis === axis).shift();\n}\nfunction $77dc20320068f1ee$var$createDatasetContext(parent, index) {\n return (0, $02b6f511cc6c123c$export$35e795649ee09318)(parent, {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index: index,\n mode: \"default\",\n type: \"dataset\"\n });\n}\nfunction $77dc20320068f1ee$var$createDataContext(parent, index, element) {\n return (0, $02b6f511cc6c123c$export$35e795649ee09318)(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element: element,\n index: index,\n mode: \"default\",\n type: \"data\"\n });\n}\nfunction $77dc20320068f1ee$var$clearStacks(meta, items) {\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) return;\n items = items || meta._parsed;\n for (const parsed of items){\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) return;\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) delete stacks[axis]._visualValues[datasetIndex];\n }\n}\nconst $77dc20320068f1ee$var$isDirectUpdateMode = (mode)=>mode === \"reset\" || mode === \"none\";\nconst $77dc20320068f1ee$var$cloneIfNotShared = (cached, shared)=>shared ? cached : Object.assign({}, cached);\nconst $77dc20320068f1ee$var$createStack = (canStack, meta, chart)=>canStack && !meta.hidden && meta._stacked && {\n keys: $77dc20320068f1ee$var$getSortedDatasetIndices(chart, true),\n values: null\n };\nclass $77dc20320068f1ee$export$75572ec5c55b4048 {\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = $77dc20320068f1ee$var$isStacked(meta.vScale, meta);\n this.addElements();\n if (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\");\n }\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) $77dc20320068f1ee$var$clearStacks(this._cachedMeta);\n this.index = datasetIndex;\n }\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n const chooseId = (axis, x, y, r)=>axis === \"x\" ? x : axis === \"r\" ? r : y;\n const xid = meta.xAxisID = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(dataset.xAxisID, $77dc20320068f1ee$var$getFirstScaleId(chart, \"x\"));\n const yid = meta.yAxisID = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(dataset.yAxisID, $77dc20320068f1ee$var$getFirstScaleId(chart, \"y\"));\n const rid = meta.rAxisID = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(dataset.rAxisID, $77dc20320068f1ee$var$getFirstScaleId(chart, \"r\"));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale ? meta.vScale : meta.iScale;\n }\n reset() {\n this._update(\"reset\");\n }\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) (0, $02b6f511cc6c123c$export$3b14a55fb2447963)(this._data, this);\n if (meta._stacked) $77dc20320068f1ee$var$clearStacks(meta);\n }\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(data)) this._data = $77dc20320068f1ee$var$convertObjectDataToArray(data);\n else if (_data !== data) {\n if (_data) {\n (0, $02b6f511cc6c123c$export$3b14a55fb2447963)(_data, this);\n const meta = this._cachedMeta;\n $77dc20320068f1ee$var$clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) (0, $02b6f511cc6c123c$export$882b5998b3b9117c)(data, this);\n this._syncList = [];\n this._data = data;\n }\n }\n addElements() {\n const meta = this._cachedMeta;\n this._dataCheck();\n if (this.datasetElementType) meta.dataset = new this.datasetElementType();\n }\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n this._dataCheck();\n const oldStacked = meta._stacked;\n meta._stacked = $77dc20320068f1ee$var$isStacked(meta.vScale, meta);\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n $77dc20320068f1ee$var$clearStacks(meta);\n meta.stack = dataset.stack;\n }\n this._resyncElements(resetNewElements);\n if (stackChanged || oldStacked !== meta._stacked) $77dc20320068f1ee$var$updateStacks(this, meta._parsed);\n }\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n parse(start, count) {\n const { _cachedMeta: meta, _data: data } = this;\n const { iScale: iScale, _stacked: _stacked } = meta;\n const iAxis = iScale.axis;\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(data[start])) parsed = this.parseArrayData(meta, data, start, count);\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(data[start])) parsed = this.parseObjectData(meta, data, start, count);\n else parsed = this.parsePrimitiveData(meta, data, start, count);\n const isNotInOrderComparedToPrev = ()=>cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];\n for(i = 0; i < count; ++i){\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) sorted = false;\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n if (_stacked) $77dc20320068f1ee$var$updateStacks(this, parsed);\n }\n parsePrimitiveData(meta, data, start, count) {\n const { iScale: iScale, vScale: vScale } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const { xScale: xScale, yScale: yScale } = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const { xScale: xScale, yScale: yScale } = meta;\n const { xAxisKey: xAxisKey = \"x\", yAxisKey: yAxisKey = \"y\" } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse((0, $02b6f511cc6c123c$export$2d1720544b23b823)(item, xAxisKey), index),\n y: yScale.parse((0, $02b6f511cc6c123c$export$2d1720544b23b823)(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: $77dc20320068f1ee$var$getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return $77dc20320068f1ee$var$applyStack(stack, value, meta.index, {\n mode: mode\n });\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = $77dc20320068f1ee$var$applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = $77dc20320068f1ee$var$createStack(canStack, meta, this.chart);\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n const { min: otherMin, max: otherMax } = $77dc20320068f1ee$var$getUserBounds(otherScale);\n let i, parsed;\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !(0, $02b6f511cc6c123c$export$39b482c5e57630a8)(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n for(i = 0; i < ilen; ++i){\n if (_skip()) continue;\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) break;\n }\n if (sorted) for(i = ilen - 1; i >= 0; --i){\n if (_skip()) continue;\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n return range;\n }\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n for(i = 0, ilen = parsed.length; i < ilen; ++i){\n value = parsed[i][scale.axis];\n if ((0, $02b6f511cc6c123c$export$39b482c5e57630a8)(value)) values.push(value);\n }\n return values;\n }\n getMaxOverflow() {\n return false;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? \"\" + iScale.getLabelForValue(parsed[iScale.axis]) : \"\",\n value: vScale ? \"\" + vScale.getLabelForValue(parsed[vScale.axis]) : \"\"\n };\n }\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || \"default\");\n meta._clip = $77dc20320068f1ee$var$toClip((0, $02b6f511cc6c123c$export$90a7f3efeed30595)(this.options.clip, $77dc20320068f1ee$var$defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n update(mode) {}\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || elements.length - start;\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n if (meta.dataset) meta.dataset.draw(ctx, area, start, count);\n for(i = start; i < start + count; ++i){\n const element = elements[i];\n if (element.hidden) continue;\n if (element.active && drawActiveElementsOnTop) active.push(element);\n else element.draw(ctx, area);\n }\n for(i = 0; i < active.length; ++i)active[i].draw(ctx, area);\n }\n getStyle(index, active) {\n const mode = active ? \"active\" : \"default\";\n return index === undefined && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index || 0, mode);\n }\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context || (element.$context = $77dc20320068f1ee$var$createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context || (this.$context = $77dc20320068f1ee$var$createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n _resolveElementOptions(elementType, mode = \"default\", index) {\n const active = mode === \"active\";\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + \"-\" + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && (0, $02b6f511cc6c123c$export$dda1d9f60106f0e9)(index);\n if (cached) return $77dc20320068f1ee$var$cloneIfNotShared(cached, sharing);\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [\n `${elementType}Hover`,\n \"hover\",\n elementType,\n \"\"\n ] : [\n elementType,\n \"\"\n ];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys((0, $02b6f511cc6c123c$export$4368d992c4eafac0).elements[elementType]);\n const context = ()=>this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n if (values.$shared) {\n values.$shared = sharing;\n cache[cacheKey] = Object.freeze($77dc20320068f1ee$var$cloneIfNotShared(values, sharing));\n }\n return values;\n }\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) return cached;\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new $77dc20320068f1ee$export$8ab227dac26677d(chart, options && options.animations);\n if (options && options._cacheable) cache[cacheKey] = Object.freeze(animations);\n return animations;\n }\n getSharedOptions(options) {\n if (!options.$shared) return;\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || $77dc20320068f1ee$var$isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions;\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {\n sharedOptions: sharedOptions,\n includeOptions: includeOptions\n };\n }\n updateElement(element, index, properties, mode) {\n if ($77dc20320068f1ee$var$isDirectUpdateMode(mode)) Object.assign(element, properties);\n else this._resolveAnimations(index, mode).update(element, properties);\n }\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !$77dc20320068f1ee$var$isDirectUpdateMode(mode)) this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n options: !active && this.getSharedOptions(options) || options\n });\n }\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, \"active\", false);\n }\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, \"active\", true);\n }\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) this._setStyle(element, undefined, \"active\", false);\n }\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) this._setStyle(element, undefined, \"active\", true);\n }\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n for (const [method, arg1, arg2] of this._syncList)this[method](arg1, arg2);\n this._syncList = [];\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n if (count) this.parse(0, count);\n if (numData > numMeta) this._insertElements(numMeta, numData - numMeta, resetNewElements);\n else if (numData < numMeta) this._removeElements(numData, numMeta - numData);\n }\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n const move = (arr)=>{\n arr.length += count;\n for(i = arr.length - 1; i >= end; i--)arr[i] = arr[i - count];\n };\n move(data);\n for(i = start; i < end; ++i)data[i] = new this.dataElementType();\n if (this._parsing) move(meta._parsed);\n this.parse(start, count);\n if (resetNewElements) this.updateElements(data, start, count, \"reset\");\n }\n updateElements(element, start, count, mode) {}\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) $77dc20320068f1ee$var$clearStacks(meta, removed);\n }\n meta.data.splice(start, count);\n }\n _sync(args) {\n if (this._parsing) this._syncList.push(args);\n else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([\n this.index,\n ...args\n ]);\n }\n _onDataPush() {\n const count = arguments.length;\n this._sync([\n \"_insertElements\",\n this.getDataset().data.length - count,\n count\n ]);\n }\n _onDataPop() {\n this._sync([\n \"_removeElements\",\n this._cachedMeta.data.length - 1,\n 1\n ]);\n }\n _onDataShift() {\n this._sync([\n \"_removeElements\",\n 0,\n 1\n ]);\n }\n _onDataSplice(start, count) {\n if (count) this._sync([\n \"_removeElements\",\n start,\n count\n ]);\n const newCount = arguments.length - 2;\n if (newCount) this._sync([\n \"_insertElements\",\n start,\n newCount\n ]);\n }\n _onDataUnshift() {\n this._sync([\n \"_insertElements\",\n 0,\n arguments.length\n ]);\n }\n constructor(chart, datasetIndex){\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n this.initialize();\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$75572ec5c55b4048, \"defaults\", {});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$75572ec5c55b4048, \"datasetElementType\", null);\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$75572ec5c55b4048, \"dataElementType\", null);\nfunction $77dc20320068f1ee$var$getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n for(let i = 0, ilen = visibleMetas.length; i < ilen; i++)values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n scale._cache.$bar = (0, $02b6f511cc6c123c$export$71511d61b312f219)(values.sort((a, b)=>a - b));\n }\n return scale._cache.$bar;\n}\nfunction $77dc20320068f1ee$var$computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = $77dc20320068f1ee$var$getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = ()=>{\n if (curr === 32767 || curr === -32768) return;\n if ((0, $02b6f511cc6c123c$export$dda1d9f60106f0e9)(prev)) min = Math.min(min, Math.abs(curr - prev) || min);\n prev = curr;\n };\n for(i = 0, ilen = values.length; i < ilen; ++i){\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n prev = undefined;\n for(i = 0, ilen = scale.ticks.length; i < ilen; ++i){\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n return min;\n}\nfunction $77dc20320068f1ee$var$computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n size = thickness * stackCount;\n ratio = 1;\n }\n return {\n chunk: size / stackCount,\n ratio: ratio,\n start: ruler.pixels[index] - size / 2\n };\n}\nfunction $77dc20320068f1ee$var$computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n if (prev === null) prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n if (next === null) next = curr + curr - prev;\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start: start\n };\n}\nfunction $77dc20320068f1ee$var$parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n item[vScale.axis] = barEnd;\n item._custom = {\n barStart: barStart,\n barEnd: barEnd,\n start: startValue,\n end: endValue,\n min: min,\n max: max\n };\n}\nfunction $77dc20320068f1ee$var$parseValue(entry, item, vScale, i) {\n if ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(entry)) $77dc20320068f1ee$var$parseFloatBar(entry, item, vScale, i);\n else item[vScale.axis] = vScale.parse(entry, i);\n return item;\n}\nfunction $77dc20320068f1ee$var$parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n for(i = start, ilen = start + count; i < ilen; ++i){\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push($77dc20320068f1ee$var$parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\nfunction $77dc20320068f1ee$var$isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction $77dc20320068f1ee$var$barSign(size, vScale, actualBase) {\n if (size !== 0) return (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(size);\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction $77dc20320068f1ee$var$borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = \"left\";\n end = \"right\";\n } else {\n reverse = properties.base < properties.y;\n start = \"bottom\";\n end = \"top\";\n }\n if (reverse) {\n top = \"end\";\n bottom = \"start\";\n } else {\n top = \"start\";\n bottom = \"end\";\n }\n return {\n start: start,\n end: end,\n reverse: reverse,\n top: top,\n bottom: bottom\n };\n}\nfunction $77dc20320068f1ee$var$setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n if (edge === true) {\n properties.borderSkipped = {\n top: true,\n right: true,\n bottom: true,\n left: true\n };\n return;\n }\n const { start: start, end: end, reverse: reverse, top: top, bottom: bottom } = $77dc20320068f1ee$var$borderProps(properties);\n if (edge === \"middle\" && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) edge = top;\n else if ((stack._bottom || 0) === index) edge = bottom;\n else {\n res[$77dc20320068f1ee$var$parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n res[$77dc20320068f1ee$var$parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\nfunction $77dc20320068f1ee$var$parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = $77dc20320068f1ee$var$swap(edge, a, b);\n edge = $77dc20320068f1ee$var$startEnd(edge, b, a);\n } else edge = $77dc20320068f1ee$var$startEnd(edge, a, b);\n return edge;\n}\nfunction $77dc20320068f1ee$var$swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction $77dc20320068f1ee$var$startEnd(v, start, end) {\n return v === \"start\" ? start : v === \"end\" ? end : v;\n}\nfunction $77dc20320068f1ee$var$setInflateAmount(properties, { inflateAmount: inflateAmount }, ratio) {\n properties.inflateAmount = inflateAmount === \"auto\" ? ratio === 1 ? 0.33 : 0 : inflateAmount;\n}\nclass $77dc20320068f1ee$export$e97d5dc64e999004 extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n parsePrimitiveData(meta, data, start, count) {\n return $77dc20320068f1ee$var$parseArrayOrPrimitive(meta, data, start, count);\n }\n parseArrayData(meta, data, start, count) {\n return $77dc20320068f1ee$var$parseArrayOrPrimitive(meta, data, start, count);\n }\n parseObjectData(meta, data, start, count) {\n const { iScale: iScale, vScale: vScale } = meta;\n const { xAxisKey: xAxisKey = \"x\", yAxisKey: yAxisKey = \"y\" } = this._parsing;\n const iAxisKey = iScale.axis === \"x\" ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === \"x\" ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for(i = start, ilen = start + count; i < ilen; ++i){\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse((0, $02b6f511cc6c123c$export$2d1720544b23b823)(obj, iAxisKey), i);\n parsed.push($77dc20320068f1ee$var$parseValue((0, $02b6f511cc6c123c$export$2d1720544b23b823)(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n getMaxOverflow() {\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const { iScale: iScale, vScale: vScale } = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = $77dc20320068f1ee$var$isFloatBar(custom) ? \"[\" + custom.start + \", \" + custom.end + \"]\" : \"\" + vScale.getLabelForValue(parsed[vScale.axis]);\n return {\n label: \"\" + iScale.getLabelForValue(parsed[iScale.axis]),\n value: value\n };\n }\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n updateElements(bars, start, count, mode) {\n const reset = mode === \"reset\";\n const { index: index, _cachedMeta: { vScale: vScale } } = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n for(let i = start; i < start + count; i++){\n const parsed = this.getParsed(i);\n const vpixels = reset || (0, $02b6f511cc6c123c$export$342063e11d6c3cad)(parsed[vScale.axis]) ? {\n base: base,\n head: base\n } : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n const properties = {\n horizontal: horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || $77dc20320068f1ee$var$isFloatBar(parsed._custom) || index === stack._top || index === stack._bottom,\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? \"active\" : mode);\n const options = properties.options || bars[i].options;\n $77dc20320068f1ee$var$setBorderSkipped(properties, options, stack, index);\n $77dc20320068f1ee$var$setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n _getStacks(last, dataIndex) {\n const { iScale: iScale } = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const skipNull = (meta)=>{\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(val) || isNaN(val)) return true;\n };\n for (const meta of metasets){\n if (dataIndex !== undefined && skipNull(meta)) continue;\n if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === undefined && meta.stack === undefined) stacks.push(meta.stack);\n if (meta.index === last) break;\n }\n if (!stacks.length) stacks.push(undefined);\n return stacks;\n }\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = name !== undefined ? stacks.indexOf(name) : -1;\n return index === -1 ? stacks.length - 1 : index;\n }\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n for(i = 0, ilen = meta.data.length; i < ilen; ++i)pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n const barThickness = opts.barThickness;\n const min = barThickness || $77dc20320068f1ee$var$computeMinSampleSize(meta);\n return {\n min: min,\n pixels: pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n _calculateBarValuePixels(index) {\n const { _cachedMeta: { vScale: vScale, _stacked: _stacked, index: datasetIndex }, options: { base: baseValue, minBarLength: minBarLength } } = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = $77dc20320068f1ee$var$isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n if (length !== value) {\n start = length - value;\n length = value;\n }\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n if (value !== 0 && (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(value) !== (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(custom.barEnd)) start = 0;\n start += value;\n }\n const startValue = !(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n if (this.chart.getDataVisibility(index)) head = vScale.getPixelForValue(start + length);\n else head = base;\n size = head - base;\n if (Math.abs(size) < minBarLength) {\n size = $77dc20320068f1ee$var$barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) base -= size / 2;\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n if (_stacked && !floating) parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n return {\n size: size,\n base: base,\n head: head,\n center: head + size / 2\n };\n }\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === \"flex\" ? $77dc20320068f1ee$var$computeFlexCategoryTraits(index, ruler, options, stackCount) : $77dc20320068f1ee$var$computeFitCategoryTraits(index, ruler, options, stackCount);\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + range.chunk * stackIndex + range.chunk / 2;\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n return {\n base: center - size / 2,\n head: center + size / 2,\n center: center,\n size: size\n };\n }\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n for(; i < ilen; ++i)if (this.getParsed(i)[vScale.axis] !== null) rects[i].draw(this._ctx);\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e97d5dc64e999004, \"id\", \"bar\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e97d5dc64e999004, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"bar\",\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"base\",\n \"width\",\n \"height\"\n ]\n }\n }\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e97d5dc64e999004, \"overrides\", {\n scales: {\n _index_: {\n type: \"category\",\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: \"linear\",\n beginAtZero: true\n }\n }\n});\nclass $77dc20320068f1ee$export$19b5c4773f17abe extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++)parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i)max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n return max > 0 && max;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale: xScale, yScale: yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n return {\n label: labels[index] || \"\",\n value: \"(\" + x + \", \" + y + (r ? \", \" + r : \"\") + \")\"\n };\n }\n update(mode) {\n const points = this._cachedMeta.data;\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === \"reset\";\n const { iScale: iScale, vScale: vScale } = this._cachedMeta;\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n if (reset) properties.options.radius = 0;\n }\n this.updateElement(point, i, properties, mode);\n }\n }\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n if (values.$shared) values = Object.assign({}, values, {\n $shared: false\n });\n const radius = values.radius;\n if (mode !== \"active\") values.radius = 0;\n values.radius += (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(parsed && parsed._custom, radius);\n return values;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$19b5c4773f17abe, \"id\", \"bubble\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$19b5c4773f17abe, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"point\",\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"borderWidth\",\n \"radius\"\n ]\n }\n }\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$19b5c4773f17abe, \"overrides\", {\n scales: {\n x: {\n type: \"linear\"\n },\n y: {\n type: \"linear\"\n }\n }\n});\nfunction $77dc20320068f1ee$var$getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n if (circumference < (0, $02b6f511cc6c123c$export$971d5caa766a69d7)) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b)=>(0, $02b6f511cc6c123c$export$ffb5f4729a158638)(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b)=>(0, $02b6f511cc6c123c$export$ffb5f4729a158638)(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax((0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd), startY, endY);\n const minX = calcMin((0, $02b6f511cc6c123c$export$56c0d5a1e737357d), startX, endX);\n const minY = calcMin((0, $02b6f511cc6c123c$export$56c0d5a1e737357d) + (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd), startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {\n ratioX: ratioX,\n ratioY: ratioY,\n offsetX: offsetX,\n offsetY: offsetY\n };\n}\nclass $77dc20320068f1ee$export$e04603e7d8b77172 extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n linkScales() {}\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n if (this._parsing === false) meta._parsed = data;\n else {\n let getter = (i)=>+data[i];\n if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(data[start])) {\n const { key: key = \"value\" } = this._parsing;\n getter = (i)=>+(0, $02b6f511cc6c123c$export$2d1720544b23b823)(data[i], key);\n }\n let i, ilen;\n for(i = start, ilen = start + count; i < ilen; ++i)meta._parsed[i] = getter(i);\n }\n }\n _getRotation() {\n return (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.options.rotation - 90);\n }\n _getCircumference() {\n return (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.options.circumference);\n }\n _getRotationExtents() {\n let min = (0, $02b6f511cc6c123c$export$971d5caa766a69d7);\n let max = -(0, $02b6f511cc6c123c$export$971d5caa766a69d7);\n for(let i = 0; i < this.chart.data.datasets.length; ++i)if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n return {\n rotation: min,\n circumference: max - min\n };\n }\n update(mode) {\n const chart = this.chart;\n const { chartArea: chartArea } = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min((0, $02b6f511cc6c123c$export$953cecd6e717a553)(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n const { circumference: circumference, rotation: rotation } = this._getRotationExtents();\n const { ratioX: ratioX, ratioY: ratioY, offsetX: offsetX, offsetY: offsetY } = $77dc20320068f1ee$var$getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = (0, $02b6f511cc6c123c$export$7ccc53e8f1e7dfc5)(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n meta.total = this.calculateTotal();\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) return 0;\n return this.calculateCircumference(meta._parsed[i] * circumference / (0, $02b6f511cc6c123c$export$971d5caa766a69d7));\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === \"reset\";\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n for(i = 0; i < start; ++i)startAngle += this._circumference(i, reset);\n for(i = start; i < start + count; ++i){\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle: startAngle,\n endAngle: startAngle + circumference,\n circumference: circumference,\n outerRadius: outerRadius,\n innerRadius: innerRadius\n };\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? \"active\" : mode);\n startAngle += circumference;\n this.updateElement(arc, i, properties, mode);\n }\n }\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n for(i = 0; i < metaData.length; i++){\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) total += Math.abs(value);\n }\n return total;\n }\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) return (0, $02b6f511cc6c123c$export$971d5caa766a69d7) * (Math.abs(value) / total);\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = (0, $02b6f511cc6c123c$export$ae1af26003f05816)(meta._parsed[index], chart.options.locale);\n return {\n label: labels[index] || \"\",\n value: value\n };\n }\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n if (!arcs) {\n for(i = 0, ilen = chart.data.datasets.length; i < ilen; ++i)if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n if (!arcs) return 0;\n for(i = 0, ilen = arcs.length; i < ilen; ++i){\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== \"inner\") max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n return max;\n }\n getMaxOffset(arcs) {\n let max = 0;\n for(let i = 0, ilen = arcs.length; i < ilen; ++i){\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n for(let i = 0; i < datasetIndex; ++i)if (this.chart.isDatasetVisible(i)) ringWeightOffset += this._getRingWeight(i);\n return ringWeightOffset;\n }\n _getRingWeight(datasetIndex) {\n return Math.max((0, $02b6f511cc6c123c$export$90a7f3efeed30595)(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e04603e7d8b77172, \"id\", \"doughnut\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e04603e7d8b77172, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"arc\",\n animation: {\n animateRotate: true,\n animateScale: false\n },\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"circumference\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\",\n \"startAngle\",\n \"x\",\n \"y\",\n \"offset\",\n \"borderWidth\",\n \"spacing\"\n ]\n }\n },\n cutout: \"50%\",\n rotation: 0,\n circumference: 360,\n radius: \"100%\",\n spacing: 0,\n indexAxis: \"r\"\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e04603e7d8b77172, \"descriptors\", {\n _scriptable: (name)=>name !== \"spacing\",\n _indexable: (name)=>name !== \"spacing\" && !name.startsWith(\"borderDash\") && !name.startsWith(\"hoverBorderDash\")\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e04603e7d8b77172, \"overrides\", {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle: pointStyle, color: color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n});\nclass $77dc20320068f1ee$export$3c9b5d28c11cbfd0 extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { dataset: line, data: points = [], _dataset: _dataset } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start: start, count: count } = (0, $02b6f511cc6c123c$export$9e5f44173e64f162)(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if ((0, $02b6f511cc6c123c$export$efccba1c4a2ef57b)(meta)) {\n start = 0;\n count = points.length;\n }\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) options.borderWidth = 0;\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options: options\n }, mode);\n this.updateElements(points, start, count, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === \"reset\";\n const { iScale: iScale, vScale: vScale, _stacked: _stacked, _dataset: _dataset } = this._cachedMeta;\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps: spanGaps, segment: segment } = this.options;\n const maxGapLength = (0, $02b6f511cc6c123c$export$d141bba7fdc215a3)(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === \"none\";\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = 0; i < pointsCount; ++i){\n const point = points[i];\n const properties = directUpdate ? point : {};\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n const parsed = this.getParsed(i);\n const nullData = (0, $02b6f511cc6c123c$export$342063e11d6c3cad)(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n if (!directUpdate) this.updateElement(point, i, properties, mode);\n prevParsed = parsed;\n }\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) return border;\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$3c9b5d28c11cbfd0, \"id\", \"line\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$3c9b5d28c11cbfd0, \"defaults\", {\n datasetElementType: \"line\",\n dataElementType: \"point\",\n showLine: true,\n spanGaps: false\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$3c9b5d28c11cbfd0, \"overrides\", {\n scales: {\n _index_: {\n type: \"category\"\n },\n _value_: {\n type: \"linear\"\n }\n }\n});\nclass $77dc20320068f1ee$export$2a270b3a0d973c85 extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = (0, $02b6f511cc6c123c$export$ae1af26003f05816)(meta._parsed[index].r, chart.options.locale);\n return {\n label: labels[index] || \"\",\n value: value\n };\n }\n parseObjectData(meta, data, start, count) {\n return (0, $02b6f511cc6c123c$export$4a5767248b18ef41).bind(this)(meta, data, start, count);\n }\n update(mode) {\n const arcs = this._cachedMeta.data;\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n meta.data.forEach((element, index)=>{\n const parsed = this.getParsed(index).r;\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) range.min = parsed;\n if (parsed > range.max) range.max = parsed;\n }\n });\n return range;\n }\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n this.outerRadius = outerRadius - radiusLength * this.index;\n this.innerRadius = this.outerRadius - radiusLength;\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === \"reset\";\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * (0, $02b6f511cc6c123c$export$56c0d5a1e737357d);\n let angle = datasetStartAngle;\n let i;\n const defaultAngle = 360 / this.countVisibleElements();\n for(i = 0; i < start; ++i)angle += this._computeAngle(i, mode, defaultAngle);\n for(i = start; i < start + count; i++){\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n if (reset) {\n if (animationOpts.animateScale) outerRadius = 0;\n if (animationOpts.animateRotate) startAngle = endAngle = datasetStartAngle;\n }\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius: outerRadius,\n startAngle: startAngle,\n endAngle: endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? \"active\" : mode)\n };\n this.updateElement(arc, i, properties, mode);\n }\n }\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n meta.data.forEach((element, index)=>{\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) count++;\n });\n return count;\n }\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index) ? (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.resolveDataElementOptions(index, mode).angle || defaultAngle) : 0;\n }\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$2a270b3a0d973c85, \"id\", \"polarArea\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$2a270b3a0d973c85, \"defaults\", {\n dataElementType: \"arc\",\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\"\n ]\n }\n },\n indexAxis: \"r\",\n startAngle: 0\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$2a270b3a0d973c85, \"overrides\", {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle: pointStyle, color: color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n scales: {\n r: {\n type: \"radialLinear\",\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n});\nclass $77dc20320068f1ee$export$b21a3f1286706191 extends $77dc20320068f1ee$export$e04603e7d8b77172 {\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$b21a3f1286706191, \"id\", \"pie\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$b21a3f1286706191, \"defaults\", {\n cutout: 0,\n rotation: 0,\n circumference: 360,\n radius: \"100%\"\n});\nclass $77dc20320068f1ee$export$48dbc6ac651bf8be extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: vScale.getLabels()[index],\n value: \"\" + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n parseObjectData(meta, data, start, count) {\n return (0, $02b6f511cc6c123c$export$4a5767248b18ef41).bind(this)(meta, data, start, count);\n }\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n line.points = points;\n if (mode !== \"resize\") {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) options.borderWidth = 0;\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options: options\n };\n this.updateElement(line, undefined, properties, mode);\n }\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === \"reset\";\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n const properties = {\n x: x,\n y: y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options: options\n };\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$48dbc6ac651bf8be, \"id\", \"radar\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$48dbc6ac651bf8be, \"defaults\", {\n datasetElementType: \"line\",\n dataElementType: \"point\",\n indexAxis: \"r\",\n showLine: true,\n elements: {\n line: {\n fill: \"start\"\n }\n }\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$48dbc6ac651bf8be, \"overrides\", {\n aspectRatio: 1,\n scales: {\n r: {\n type: \"radialLinear\"\n }\n }\n});\nclass $77dc20320068f1ee$export$b2f2bae6713db87 extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale: xScale, yScale: yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n return {\n label: labels[index] || \"\",\n value: \"(\" + x + \", \" + y + \")\"\n };\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { data: points = [] } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start: start, count: count } = (0, $02b6f511cc6c123c$export$9e5f44173e64f162)(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if ((0, $02b6f511cc6c123c$export$efccba1c4a2ef57b)(meta)) {\n start = 0;\n count = points.length;\n }\n if (this.options.showLine) {\n if (!this.datasetElementType) this.addElements();\n const { dataset: line, _dataset: _dataset } = meta;\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options: options\n }, mode);\n } else if (this.datasetElementType) {\n delete meta.dataset;\n this.datasetElementType = false;\n }\n this.updateElements(points, start, count, mode);\n }\n addElements() {\n const { showLine: showLine } = this.options;\n if (!this.datasetElementType && showLine) this.datasetElementType = this.chart.registry.getElement(\"line\");\n super.addElements();\n }\n updateElements(points, start, count, mode) {\n const reset = mode === \"reset\";\n const { iScale: iScale, vScale: vScale, _stacked: _stacked, _dataset: _dataset } = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps: spanGaps, segment: segment } = this.options;\n const maxGapLength = (0, $02b6f511cc6c123c$export$d141bba7fdc215a3)(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === \"none\";\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = start; i < start + count; ++i){\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = (0, $02b6f511cc6c123c$export$342063e11d6c3cad)(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n if (!directUpdate) this.updateElement(point, i, properties, mode);\n prevParsed = parsed;\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n if (!this.options.showLine) {\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i)max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n return max > 0 && max;\n }\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n if (!data.length) return border;\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$b2f2bae6713db87, \"id\", \"scatter\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$b2f2bae6713db87, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"point\",\n showLine: false,\n fill: false\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$b2f2bae6713db87, \"overrides\", {\n interaction: {\n mode: \"point\"\n },\n scales: {\n x: {\n type: \"linear\"\n },\n y: {\n type: \"linear\"\n }\n }\n});\nvar $77dc20320068f1ee$export$a6506504f799c5d5 = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n BarController: $77dc20320068f1ee$export$e97d5dc64e999004,\n BubbleController: $77dc20320068f1ee$export$19b5c4773f17abe,\n DoughnutController: $77dc20320068f1ee$export$e04603e7d8b77172,\n LineController: $77dc20320068f1ee$export$3c9b5d28c11cbfd0,\n PieController: $77dc20320068f1ee$export$b21a3f1286706191,\n PolarAreaController: $77dc20320068f1ee$export$2a270b3a0d973c85,\n RadarController: $77dc20320068f1ee$export$48dbc6ac651bf8be,\n ScatterController: $77dc20320068f1ee$export$b2f2bae6713db87\n});\n/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */ function $77dc20320068f1ee$var$abstract() {\n throw new Error(\"This method is not implemented: Check that a complete date adapter is provided.\");\n}\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */ class $77dc20320068f1ee$var$DateAdapterBase {\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */ static override(members) {\n Object.assign($77dc20320068f1ee$var$DateAdapterBase.prototype, members);\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n formats() {\n return $77dc20320068f1ee$var$abstract();\n }\n parse() {\n return $77dc20320068f1ee$var$abstract();\n }\n format() {\n return $77dc20320068f1ee$var$abstract();\n }\n add() {\n return $77dc20320068f1ee$var$abstract();\n }\n diff() {\n return $77dc20320068f1ee$var$abstract();\n }\n startOf() {\n return $77dc20320068f1ee$var$abstract();\n }\n endOf() {\n return $77dc20320068f1ee$var$abstract();\n }\n constructor(options){\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"options\", void 0);\n this.options = options || {};\n }\n}\nvar $77dc20320068f1ee$export$f32766ea09ec8bc4 = {\n _date: $77dc20320068f1ee$var$DateAdapterBase\n};\nfunction $77dc20320068f1ee$var$binarySearch(metaset, axis, value, intersect) {\n const { controller: controller, data: data, _sorted: _sorted } = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== \"r\" && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? (0, $02b6f511cc6c123c$export$ebd11618f299a286) : (0, $02b6f511cc6c123c$export$ef35774e6d314e91);\n if (!intersect) return lookupMethod(data, axis, value);\n else if (controller._sharedOptions) {\n const el = data[0];\n const range = typeof el.getRange === \"function\" && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {\n lo: start.lo,\n hi: end.hi\n };\n }\n }\n }\n return {\n lo: 0,\n hi: data.length - 1\n };\n}\nfunction $77dc20320068f1ee$var$evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for(let i = 0, ilen = metasets.length; i < ilen; ++i){\n const { index: index, data: data } = metasets[i];\n const { lo: lo, hi: hi } = $77dc20320068f1ee$var$binarySearch(metasets[i], axis, value, intersect);\n for(let j = lo; j <= hi; ++j){\n const element = data[j];\n if (!element.skip) handler(element, index, j);\n }\n }\n}\nfunction $77dc20320068f1ee$var$getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf(\"x\") !== -1;\n const useY = axis.indexOf(\"y\") !== -1;\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\nfunction $77dc20320068f1ee$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n if (!includeInvisible && !chart.isPointInArea(position)) return items;\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !(0, $02b6f511cc6c123c$export$e7094788287c5e9b)(element, chart.chartArea, 0)) return;\n if (element.inRange(position.x, position.y, useFinalPosition)) items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n };\n $77dc20320068f1ee$var$evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\nfunction $77dc20320068f1ee$var$getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n function evaluationFunc(element, datasetIndex, index) {\n const { startAngle: startAngle, endAngle: endAngle } = element.getProps([\n \"startAngle\",\n \"endAngle\"\n ], useFinalPosition);\n const { angle: angle } = (0, $02b6f511cc6c123c$export$96f57966bedc81b4)(element, {\n x: position.x,\n y: position.y\n });\n if ((0, $02b6f511cc6c123c$export$ffb5f4729a158638)(angle, startAngle, endAngle)) items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n }\n $77dc20320068f1ee$var$evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\nfunction $77dc20320068f1ee$var$getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = $77dc20320068f1ee$var$getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) return;\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) return;\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [\n {\n element: element,\n datasetIndex: datasetIndex,\n index: index\n }\n ];\n minDistance = distance;\n } else if (distance === minDistance) items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n }\n $77dc20320068f1ee$var$evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\nfunction $77dc20320068f1ee$var$getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) return [];\n return axis === \"r\" && !intersect ? $77dc20320068f1ee$var$getNearestRadialItems(chart, position, axis, useFinalPosition) : $77dc20320068f1ee$var$getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\nfunction $77dc20320068f1ee$var$getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === \"x\" ? \"inXRange\" : \"inYRange\";\n let intersectsItem = false;\n $77dc20320068f1ee$var$evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index)=>{\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n if (intersect && !intersectsItem) return [];\n return items;\n}\nvar $77dc20320068f1ee$export$a13296960cae0384 = {\n evaluateInteractionItems: $77dc20320068f1ee$var$evaluateInteractionItems,\n modes: {\n index (chart, e, options, useFinalPosition) {\n const position = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"x\";\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect ? $77dc20320068f1ee$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : $77dc20320068f1ee$var$getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n if (!items.length) return [];\n chart.getSortedVisibleDatasetMetas().forEach((meta)=>{\n const index = items[0].index;\n const element = meta.data[index];\n if (element && !element.skip) elements.push({\n element: element,\n datasetIndex: meta.index,\n index: index\n });\n });\n return elements;\n },\n dataset (chart, e, options, useFinalPosition) {\n const position = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"xy\";\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect ? $77dc20320068f1ee$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : $77dc20320068f1ee$var$getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for(let i = 0; i < data.length; ++i)items.push({\n element: data[i],\n datasetIndex: datasetIndex,\n index: i\n });\n }\n return items;\n },\n point (chart, e, options, useFinalPosition) {\n const position = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"xy\";\n const includeInvisible = options.includeInvisible || false;\n return $77dc20320068f1ee$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n nearest (chart, e, options, useFinalPosition) {\n const position = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"xy\";\n const includeInvisible = options.includeInvisible || false;\n return $77dc20320068f1ee$var$getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n x (chart, e, options, useFinalPosition) {\n const position = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(e, chart);\n return $77dc20320068f1ee$var$getAxisItems(chart, position, \"x\", options.intersect, useFinalPosition);\n },\n y (chart, e, options, useFinalPosition) {\n const position = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(e, chart);\n return $77dc20320068f1ee$var$getAxisItems(chart, position, \"y\", options.intersect, useFinalPosition);\n }\n }\n};\nconst $77dc20320068f1ee$var$STATIC_POSITIONS = [\n \"left\",\n \"top\",\n \"right\",\n \"bottom\"\n];\nfunction $77dc20320068f1ee$var$filterByPosition(array, position) {\n return array.filter((v)=>v.pos === position);\n}\nfunction $77dc20320068f1ee$var$filterDynamicPositionByAxis(array, axis) {\n return array.filter((v)=>$77dc20320068f1ee$var$STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction $77dc20320068f1ee$var$sortByWeight(array, reverse) {\n return array.sort((a, b)=>{\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;\n });\n}\nfunction $77dc20320068f1ee$var$wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n for(i = 0, ilen = (boxes || []).length; i < ilen; ++i){\n box = boxes[i];\n ({ position: pos, options: { stack: stack, stackWeight: stackWeight = 1 } } = box);\n layoutBoxes.push({\n index: i,\n box: box,\n pos: pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && pos + stack,\n stackWeight: stackWeight\n });\n }\n return layoutBoxes;\n}\nfunction $77dc20320068f1ee$var$buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts){\n const { stack: stack, pos: pos, stackWeight: stackWeight } = wrap;\n if (!stack || !$77dc20320068f1ee$var$STATIC_POSITIONS.includes(pos)) continue;\n const _stack = stacks[stack] || (stacks[stack] = {\n count: 0,\n placed: 0,\n weight: 0,\n size: 0\n });\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\nfunction $77dc20320068f1ee$var$setLayoutDims(layouts, params) {\n const stacks = $77dc20320068f1ee$var$buildStacks(layouts);\n const { vBoxMaxWidth: vBoxMaxWidth, hBoxMaxHeight: hBoxMaxHeight } = params;\n let i, ilen, layout;\n for(i = 0, ilen = layouts.length; i < ilen; ++i){\n layout = layouts[i];\n const { fullSize: fullSize } = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\nfunction $77dc20320068f1ee$var$buildLayoutBoxes(boxes) {\n const layoutBoxes = $77dc20320068f1ee$var$wrapBoxes(boxes);\n const fullSize = $77dc20320068f1ee$var$sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize), true);\n const left = $77dc20320068f1ee$var$sortByWeight($77dc20320068f1ee$var$filterByPosition(layoutBoxes, \"left\"), true);\n const right = $77dc20320068f1ee$var$sortByWeight($77dc20320068f1ee$var$filterByPosition(layoutBoxes, \"right\"));\n const top = $77dc20320068f1ee$var$sortByWeight($77dc20320068f1ee$var$filterByPosition(layoutBoxes, \"top\"), true);\n const bottom = $77dc20320068f1ee$var$sortByWeight($77dc20320068f1ee$var$filterByPosition(layoutBoxes, \"bottom\"));\n const centerHorizontal = $77dc20320068f1ee$var$filterDynamicPositionByAxis(layoutBoxes, \"x\");\n const centerVertical = $77dc20320068f1ee$var$filterDynamicPositionByAxis(layoutBoxes, \"y\");\n return {\n fullSize: fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: $77dc20320068f1ee$var$filterByPosition(layoutBoxes, \"chartArea\"),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\nfunction $77dc20320068f1ee$var$getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction $77dc20320068f1ee$var$updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction $77dc20320068f1ee$var$updateDims(chartArea, params, layout, stacks) {\n const { pos: pos, box: box } = layout;\n const maxPadding = chartArea.maxPadding;\n if (!(0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(pos)) {\n if (layout.size) chartArea[pos] -= layout.size;\n const stack = stacks[layout.stack] || {\n size: 0,\n count: 1\n };\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n if (box.getPadding) $77dc20320068f1ee$var$updateMaxPadding(maxPadding, box.getPadding());\n const newWidth = Math.max(0, params.outerWidth - $77dc20320068f1ee$var$getCombinedMax(maxPadding, chartArea, \"left\", \"right\"));\n const newHeight = Math.max(0, params.outerHeight - $77dc20320068f1ee$var$getCombinedMax(maxPadding, chartArea, \"top\", \"bottom\"));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n return layout.horizontal ? {\n same: widthChanged,\n other: heightChanged\n } : {\n same: heightChanged,\n other: widthChanged\n };\n}\nfunction $77dc20320068f1ee$var$handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos(\"top\");\n chartArea.x += updatePos(\"left\");\n updatePos(\"right\");\n updatePos(\"bottom\");\n}\nfunction $77dc20320068f1ee$var$getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n function marginForPositions(positions) {\n const margin = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n positions.forEach((pos)=>{\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n return horizontal ? marginForPositions([\n \"left\",\n \"right\"\n ]) : marginForPositions([\n \"top\",\n \"bottom\"\n ]);\n}\nfunction $77dc20320068f1ee$var$fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n for(i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i){\n layout = boxes[i];\n box = layout.box;\n box.update(layout.width || chartArea.w, layout.height || chartArea.h, $77dc20320068f1ee$var$getMargins(layout.horizontal, chartArea));\n const { same: same, other: other } = $77dc20320068f1ee$var$updateDims(chartArea, params, layout, stacks);\n refit |= same && refitBoxes.length;\n changed = changed || other;\n if (!box.fullSize) refitBoxes.push(layout);\n }\n return refit && $77dc20320068f1ee$var$fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction $77dc20320068f1ee$var$setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\nfunction $77dc20320068f1ee$var$placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let { x: x, y: y } = chartArea;\n for (const layout of boxes){\n const box = layout.box;\n const stack = stacks[layout.stack] || {\n count: 1,\n placed: 0,\n weight: 1\n };\n const weight = layout.stackWeight / stack.weight || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if ((0, $02b6f511cc6c123c$export$dda1d9f60106f0e9)(stack.start)) y = stack.start;\n if (box.fullSize) $77dc20320068f1ee$var$setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n else $77dc20320068f1ee$var$setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if ((0, $02b6f511cc6c123c$export$dda1d9f60106f0e9)(stack.start)) x = stack.start;\n if (box.fullSize) $77dc20320068f1ee$var$setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n else $77dc20320068f1ee$var$setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n chartArea.x = x;\n chartArea.y = y;\n}\nvar $77dc20320068f1ee$export$1ecca0613f5e56d2 = {\n addBox (chart, item) {\n if (!chart.boxes) chart.boxes = [];\n item.fullSize = item.fullSize || false;\n item.position = item.position || \"top\";\n item.weight = item.weight || 0;\n item._layers = item._layers || function() {\n return [\n {\n z: 0,\n draw (chartArea) {\n item.draw(chartArea);\n }\n }\n ];\n };\n chart.boxes.push(item);\n },\n removeBox (chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) chart.boxes.splice(index, 1);\n },\n configure (chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n update (chart, width, height, minPadding) {\n if (!chart) return;\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = $77dc20320068f1ee$var$buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(chart.boxes, (box)=>{\n if (typeof box.beforeLayout === \"function\") box.beforeLayout();\n });\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap)=>wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding: padding,\n availableWidth: availableWidth,\n availableHeight: availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n $77dc20320068f1ee$var$updateMaxPadding(maxPadding, (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(minPadding));\n const chartArea = Object.assign({\n maxPadding: maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n const stacks = $77dc20320068f1ee$var$setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n $77dc20320068f1ee$var$fitBoxes(boxes.fullSize, chartArea, params, stacks);\n $77dc20320068f1ee$var$fitBoxes(verticalBoxes, chartArea, params, stacks);\n if ($77dc20320068f1ee$var$fitBoxes(horizontalBoxes, chartArea, params, stacks)) $77dc20320068f1ee$var$fitBoxes(verticalBoxes, chartArea, params, stacks);\n $77dc20320068f1ee$var$handleMaxPadding(chartArea);\n $77dc20320068f1ee$var$placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n $77dc20320068f1ee$var$placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w\n };\n (0, $02b6f511cc6c123c$export$d66501df72047452)(boxes.chartArea, (layout)=>{\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n });\n });\n }\n};\nclass $77dc20320068f1ee$export$7b1aeb87f31f7da8 {\n acquireContext(canvas, aspectRatio) {}\n releaseContext(context) {\n return false;\n }\n addEventListener(chart, type, listener) {}\n removeEventListener(chart, type, listener) {}\n getDevicePixelRatio() {\n return 1;\n }\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width: width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n isAttached(canvas) {\n return true;\n }\n updateConfig(config) {}\n}\nclass $77dc20320068f1ee$export$a40a96b24b46cf35 extends $77dc20320068f1ee$export$7b1aeb87f31f7da8 {\n acquireContext(item) {\n return item && item.getContext && item.getContext(\"2d\") || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\nconst $77dc20320068f1ee$var$EXPANDO_KEY = \"$chartjs\";\nconst $77dc20320068f1ee$var$EVENT_TYPES = {\n touchstart: \"mousedown\",\n touchmove: \"mousemove\",\n touchend: \"mouseup\",\n pointerenter: \"mouseenter\",\n pointerdown: \"mousedown\",\n pointermove: \"mousemove\",\n pointerup: \"mouseup\",\n pointerleave: \"mouseout\",\n pointerout: \"mouseout\"\n};\nconst $77dc20320068f1ee$var$isNullOrEmpty = (value)=>value === null || value === \"\";\nfunction $77dc20320068f1ee$var$initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n const renderHeight = canvas.getAttribute(\"height\");\n const renderWidth = canvas.getAttribute(\"width\");\n canvas[$77dc20320068f1ee$var$EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n style.display = style.display || \"block\";\n style.boxSizing = style.boxSizing || \"border-box\";\n if ($77dc20320068f1ee$var$isNullOrEmpty(renderWidth)) {\n const displayWidth = (0, $02b6f511cc6c123c$export$b4171a6734a65d42)(canvas, \"width\");\n if (displayWidth !== undefined) canvas.width = displayWidth;\n }\n if ($77dc20320068f1ee$var$isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === \"\") canvas.height = canvas.width / (aspectRatio || 2);\n else {\n const displayHeight = (0, $02b6f511cc6c123c$export$b4171a6734a65d42)(canvas, \"height\");\n if (displayHeight !== undefined) canvas.height = displayHeight;\n }\n }\n return canvas;\n}\nconst $77dc20320068f1ee$var$eventListenerOptions = (0, $02b6f511cc6c123c$export$3466f893ebf79586) ? {\n passive: true\n} : false;\nfunction $77dc20320068f1ee$var$addListener(node, type, listener) {\n node.addEventListener(type, listener, $77dc20320068f1ee$var$eventListenerOptions);\n}\nfunction $77dc20320068f1ee$var$removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, $77dc20320068f1ee$var$eventListenerOptions);\n}\nfunction $77dc20320068f1ee$var$fromNativeEvent(event, chart) {\n const type = $77dc20320068f1ee$var$EVENT_TYPES[event.type] || event.type;\n const { x: x, y: y } = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(event, chart);\n return {\n type: type,\n chart: chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null\n };\n}\nfunction $77dc20320068f1ee$var$nodeListContains(nodeList, canvas) {\n for (const node of nodeList){\n if (node === canvas || node.contains(canvas)) return true;\n }\n}\nfunction $77dc20320068f1ee$var$createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || $77dc20320068f1ee$var$nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !$77dc20320068f1ee$var$nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) listener();\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nfunction $77dc20320068f1ee$var$createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || $77dc20320068f1ee$var$nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !$77dc20320068f1ee$var$nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) listener();\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nconst $77dc20320068f1ee$var$drpListeningCharts = new Map();\nlet $77dc20320068f1ee$var$oldDevicePixelRatio = 0;\nfunction $77dc20320068f1ee$var$onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === $77dc20320068f1ee$var$oldDevicePixelRatio) return;\n $77dc20320068f1ee$var$oldDevicePixelRatio = dpr;\n $77dc20320068f1ee$var$drpListeningCharts.forEach((resize, chart)=>{\n if (chart.currentDevicePixelRatio !== dpr) resize();\n });\n}\nfunction $77dc20320068f1ee$var$listenDevicePixelRatioChanges(chart, resize) {\n if (!$77dc20320068f1ee$var$drpListeningCharts.size) window.addEventListener(\"resize\", $77dc20320068f1ee$var$onWindowResize);\n $77dc20320068f1ee$var$drpListeningCharts.set(chart, resize);\n}\nfunction $77dc20320068f1ee$var$unlistenDevicePixelRatioChanges(chart) {\n $77dc20320068f1ee$var$drpListeningCharts.delete(chart);\n if (!$77dc20320068f1ee$var$drpListeningCharts.size) window.removeEventListener(\"resize\", $77dc20320068f1ee$var$onWindowResize);\n}\nfunction $77dc20320068f1ee$var$createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && (0, $02b6f511cc6c123c$export$9bb611d729802a56)(canvas);\n if (!container) return;\n const resize = (0, $02b6f511cc6c123c$export$61196ced6d74a310)((width, height)=>{\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) listener();\n }, window);\n const observer = new ResizeObserver((entries)=>{\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n if (width === 0 && height === 0) return;\n resize(width, height);\n });\n observer.observe(container);\n $77dc20320068f1ee$var$listenDevicePixelRatioChanges(chart, resize);\n return observer;\n}\nfunction $77dc20320068f1ee$var$releaseObserver(chart, type, observer) {\n if (observer) observer.disconnect();\n if (type === \"resize\") $77dc20320068f1ee$var$unlistenDevicePixelRatioChanges(chart);\n}\nfunction $77dc20320068f1ee$var$createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = (0, $02b6f511cc6c123c$export$61196ced6d74a310)((event)=>{\n if (chart.ctx !== null) listener($77dc20320068f1ee$var$fromNativeEvent(event, chart));\n }, chart);\n $77dc20320068f1ee$var$addListener(canvas, type, proxy);\n return proxy;\n}\nclass $77dc20320068f1ee$export$f02da7f882cf6b2e extends $77dc20320068f1ee$export$7b1aeb87f31f7da8 {\n acquireContext(canvas, aspectRatio) {\n const context = canvas && canvas.getContext && canvas.getContext(\"2d\");\n if (context && context.canvas === canvas) {\n $77dc20320068f1ee$var$initCanvas(canvas, aspectRatio);\n return context;\n }\n return null;\n }\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[$77dc20320068f1ee$var$EXPANDO_KEY]) return false;\n const initial = canvas[$77dc20320068f1ee$var$EXPANDO_KEY].initial;\n [\n \"height\",\n \"width\"\n ].forEach((prop)=>{\n const value = initial[prop];\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(value)) canvas.removeAttribute(prop);\n else canvas.setAttribute(prop, value);\n });\n const style = initial.style || {};\n Object.keys(style).forEach((key)=>{\n canvas.style[key] = style[key];\n });\n canvas.width = canvas.width;\n delete canvas[$77dc20320068f1ee$var$EXPANDO_KEY];\n return true;\n }\n addEventListener(chart, type, listener) {\n this.removeEventListener(chart, type);\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: $77dc20320068f1ee$var$createAttachObserver,\n detach: $77dc20320068f1ee$var$createDetachObserver,\n resize: $77dc20320068f1ee$var$createResizeObserver\n };\n const handler = handlers[type] || $77dc20320068f1ee$var$createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n if (!proxy) return;\n const handlers = {\n attach: $77dc20320068f1ee$var$releaseObserver,\n detach: $77dc20320068f1ee$var$releaseObserver,\n resize: $77dc20320068f1ee$var$releaseObserver\n };\n const handler = handlers[type] || $77dc20320068f1ee$var$removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n getMaximumSize(canvas, width, height, aspectRatio) {\n return (0, $02b6f511cc6c123c$export$2329c99376c9d0a4)(canvas, width, height, aspectRatio);\n }\n isAttached(canvas) {\n const container = (0, $02b6f511cc6c123c$export$9bb611d729802a56)(canvas);\n return !!(container && container.isConnected);\n }\n}\nfunction $77dc20320068f1ee$export$72cd9e67b1b784f9(canvas) {\n if (!(0, $02b6f511cc6c123c$export$3a1a48c8f6ef640e)() || typeof OffscreenCanvas !== \"undefined\" && canvas instanceof OffscreenCanvas) return $77dc20320068f1ee$export$a40a96b24b46cf35;\n return $77dc20320068f1ee$export$f02da7f882cf6b2e;\n}\nclass $77dc20320068f1ee$export$db77ccec0bb4ccac {\n tooltipPosition(useFinalPosition) {\n const { x: x, y: y } = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n return {\n x: x,\n y: y\n };\n }\n hasValue() {\n return (0, $02b6f511cc6c123c$export$d141bba7fdc215a3)(this.x) && (0, $02b6f511cc6c123c$export$d141bba7fdc215a3)(this.y);\n }\n getProps(props, final) {\n const anims = this.$animations;\n if (!final || !anims) // let's not create an object, if not needed\n return this;\n const ret = {};\n props.forEach((prop)=>{\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n });\n return ret;\n }\n constructor(){\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"x\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"y\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"active\", false);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"options\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"$animations\", void 0);\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$db77ccec0bb4ccac, \"defaults\", {});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$db77ccec0bb4ccac, \"defaultRoutes\", undefined);\nfunction $77dc20320068f1ee$var$autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = $77dc20320068f1ee$var$determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? $77dc20320068f1ee$var$getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n if (numMajorIndices > ticksLimit) {\n $77dc20320068f1ee$var$skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n const spacing = $77dc20320068f1ee$var$calculateSpacing(majorIndices, ticks, ticksLimit);\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n $77dc20320068f1ee$var$skip(ticks, newTicks, spacing, (0, $02b6f511cc6c123c$export$342063e11d6c3cad)(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for(i = 0, ilen = numMajorIndices - 1; i < ilen; i++)$77dc20320068f1ee$var$skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n $77dc20320068f1ee$var$skip(ticks, newTicks, spacing, last, (0, $02b6f511cc6c123c$export$342063e11d6c3cad)(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n $77dc20320068f1ee$var$skip(ticks, newTicks, spacing);\n return newTicks;\n}\nfunction $77dc20320068f1ee$var$determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\nfunction $77dc20320068f1ee$var$calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = $77dc20320068f1ee$var$getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n if (!evenMajorSpacing) return Math.max(spacing, 1);\n const factors = (0, $02b6f511cc6c123c$export$a07804094c3ecf2d)(evenMajorSpacing);\n for(let i = 0, ilen = factors.length - 1; i < ilen; i++){\n const factor = factors[i];\n if (factor > spacing) return factor;\n }\n return Math.max(spacing, 1);\n}\nfunction $77dc20320068f1ee$var$getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++)if (ticks[i].major) result.push(i);\n return result;\n}\nfunction $77dc20320068f1ee$var$skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n spacing = Math.ceil(spacing);\n for(i = 0; i < ticks.length; i++)if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n}\nfunction $77dc20320068f1ee$var$skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(majorStart, 0);\n const end = Math.min((0, $02b6f511cc6c123c$export$90a7f3efeed30595)(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n next = start;\n while(next < 0){\n count++;\n next = Math.round(start + count * spacing);\n }\n for(i = Math.max(start, 0); i < end; i++)if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n}\nfunction $77dc20320068f1ee$var$getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n if (len < 2) return false;\n for(diff = arr[0], i = 1; i < len; ++i){\n if (arr[i] - arr[i - 1] !== diff) return false;\n }\n return diff;\n}\nconst $77dc20320068f1ee$var$reverseAlign = (align)=>align === \"left\" ? \"right\" : align === \"right\" ? \"left\" : align;\nconst $77dc20320068f1ee$var$offsetFromEdge = (scale, edge, offset)=>edge === \"top\" || edge === \"left\" ? scale[edge] + offset : scale[edge] - offset;\nconst $77dc20320068f1ee$var$getTicksLimit = (ticksLength, maxTicksLimit)=>Math.min(maxTicksLimit || ticksLength, ticksLength);\nfunction $77dc20320068f1ee$var$sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n for(; i < len; i += increment)result.push(arr[Math.floor(i)]);\n return result;\n}\nfunction $77dc20320068f1ee$var$getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6;\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n if (offsetGridLines) {\n if (length === 1) offset = Math.max(lineValue - start, end - lineValue);\n else if (index === 0) offset = (scale.getPixelForTick(1) - lineValue) / 2;\n else offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n lineValue += validIndex < index ? offset : -offset;\n if (lineValue < start - epsilon || lineValue > end + epsilon) return;\n }\n return lineValue;\n}\nfunction $77dc20320068f1ee$var$garbageCollect(caches, length) {\n (0, $02b6f511cc6c123c$export$d66501df72047452)(caches, (cache)=>{\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for(i = 0; i < gcLen; ++i)delete cache.data[gc[i]];\n gc.splice(0, gcLen);\n }\n });\n}\nfunction $77dc20320068f1ee$var$getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\nfunction $77dc20320068f1ee$var$getTitleHeight(options, fallback) {\n if (!options.display) return 0;\n const font = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.font, fallback);\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(options.padding);\n const lines = (0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(options.text) ? options.text.length : 1;\n return lines * font.lineHeight + padding.height;\n}\nfunction $77dc20320068f1ee$var$createScaleContext(parent, scale) {\n return (0, $02b6f511cc6c123c$export$35e795649ee09318)(parent, {\n scale: scale,\n type: \"scale\"\n });\n}\nfunction $77dc20320068f1ee$var$createTickContext(parent, index, tick) {\n return (0, $02b6f511cc6c123c$export$35e795649ee09318)(parent, {\n tick: tick,\n index: index,\n type: \"tick\"\n });\n}\nfunction $77dc20320068f1ee$var$titleAlign(align, position, reverse) {\n let ret = (0, $02b6f511cc6c123c$export$3c2fa207a37baaea)(align);\n if (reverse && position !== \"right\" || !reverse && position === \"right\") ret = $77dc20320068f1ee$var$reverseAlign(ret);\n return ret;\n}\nfunction $77dc20320068f1ee$var$titleArgs(scale, offset, position, align) {\n const { top: top, left: left, bottom: bottom, right: right, chart: chart } = scale;\n const { chartArea: chartArea, scales: scales } = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n if (scale.isHorizontal()) {\n titleX = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, left, right);\n if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === \"center\") titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n else titleY = $77dc20320068f1ee$var$offsetFromEdge(scale, position, offset);\n maxWidth = right - left;\n } else {\n if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === \"center\") titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n else titleX = $77dc20320068f1ee$var$offsetFromEdge(scale, position, offset);\n titleY = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, bottom, top);\n rotation = position === \"left\" ? -(0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd) : (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd);\n }\n return {\n titleX: titleX,\n titleY: titleY,\n maxWidth: maxWidth,\n rotation: rotation\n };\n}\nclass $77dc20320068f1ee$export$d60cfc58d3c358b6 extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n init(options) {\n this.options = options.setContext(this.getContext());\n this.axis = options.axis;\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n parse(raw, index) {\n return raw;\n }\n getUserBounds() {\n let { _userMin: _userMin, _userMax: _userMax, _suggestedMin: _suggestedMin, _suggestedMax: _suggestedMax } = this;\n _userMin = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(_userMin, Number.POSITIVE_INFINITY);\n _userMax = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(_userMin, _suggestedMin),\n max: (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(_userMax, _suggestedMax),\n minDefined: (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(_userMin),\n maxDefined: (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(_userMax)\n };\n }\n getMinMax(canStack) {\n let { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let range;\n if (minDefined && maxDefined) return {\n min: min,\n max: max\n };\n const metas = this.getMatchingVisibleMetas();\n for(let i = 0, ilen = metas.length; i < ilen; ++i){\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) min = Math.min(min, range.min);\n if (!maxDefined) max = Math.max(max, range.max);\n }\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n return {\n min: (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(min, (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(max, min)),\n max: (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(max, (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(min, max))\n };\n }\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n getTicks() {\n return this.ticks;\n }\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n beforeUpdate() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.beforeUpdate, [\n this\n ]);\n }\n update(maxWidth, maxHeight, margins) {\n const { beginAtZero: beginAtZero, grace: grace, ticks: tickOpts } = this.options;\n const sampleSize = tickOpts.sampleSize;\n this.beforeUpdate();\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = (0, $02b6f511cc6c123c$export$db202ddc8be9136)(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n this.beforeBuildTicks();\n this.ticks = this.buildTicks() || [];\n this.afterBuildTicks();\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? $77dc20320068f1ee$var$sample(this.ticks, sampleSize) : this.ticks);\n this.configure();\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation();\n this.afterCalculateLabelRotation();\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === \"auto\")) {\n this.ticks = $77dc20320068f1ee$var$autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n if (samplingEnabled) this._convertTicksToLabels(this.ticks);\n this.beforeFit();\n this.fit();\n this.afterFit();\n this.afterUpdate();\n }\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n afterUpdate() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.afterUpdate, [\n this\n ]);\n }\n beforeSetDimensions() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.beforeSetDimensions, [\n this\n ]);\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = 0;\n this.bottom = this.height;\n }\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.afterSetDimensions, [\n this\n ]);\n }\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options[name], [\n this\n ]);\n }\n beforeDataLimits() {\n this._callHooks(\"beforeDataLimits\");\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks(\"afterDataLimits\");\n }\n beforeBuildTicks() {\n this._callHooks(\"beforeBuildTicks\");\n }\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks(\"afterBuildTicks\");\n }\n beforeTickToLabelConversion() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.beforeTickToLabelConversion, [\n this\n ]);\n }\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n tick = ticks[i];\n tick.label = (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(tickOpts.callback, [\n tick.value,\n i,\n ticks\n ], this);\n }\n }\n afterTickToLabelConversion() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.afterTickToLabelConversion, [\n this\n ]);\n }\n beforeCalculateLabelRotation() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.beforeCalculateLabelRotation, [\n this\n ]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = $77dc20320068f1ee$var$getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n const maxWidth = (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - $77dc20320068f1ee$var$getTickMarkLength(options.grid) - tickOpts.padding - $77dc20320068f1ee$var$getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = (0, $02b6f511cc6c123c$export$3a6d5c9ae78a2c08)(Math.min(Math.asin((0, $02b6f511cc6c123c$export$25ce5a424b770e84)((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin((0, $02b6f511cc6c123c$export$25ce5a424b770e84)(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin((0, $02b6f511cc6c123c$export$25ce5a424b770e84)(maxLabelHeight / maxLabelDiagonal, -1, 1))));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.afterCalculateLabelRotation, [\n this\n ]);\n }\n afterAutoSkip() {}\n beforeFit() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.beforeFit, [\n this\n ]);\n }\n fit() {\n const minSize = {\n width: 0,\n height: 0\n };\n const { chart: chart, options: { ticks: tickOpts, title: titleOpts, grid: gridOpts } } = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n if (display) {\n const titleHeight = $77dc20320068f1ee$var$getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = $77dc20320068f1ee$var$getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight;\n minSize.width = $77dc20320068f1ee$var$getTickMarkLength(gridOpts) + titleHeight;\n }\n if (tickOpts.display && this.ticks.length) {\n const { first: first, last: last, widest: widest, highest: highest } = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n if (isHorizontal) {\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n this._handleMargins();\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n _calculatePadding(first, last, sin, cos) {\n const { ticks: { align: align, padding: padding }, position: position } = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== \"top\" && this.axis === \"x\";\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === \"start\") paddingRight = last.width;\n else if (align === \"end\") paddingLeft = first.width;\n else if (align !== \"inner\") {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n if (align === \"start\") {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === \"end\") {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n afterFit() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.afterFit, [\n this\n ]);\n }\n isHorizontal() {\n const { axis: axis, position: position } = this.options;\n return position === \"top\" || position === \"bottom\" || axis === \"x\";\n }\n isFullSize() {\n return this.options.fullSize;\n }\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n this.generateTickLabels(ticks);\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++)if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n this.afterTickToLabelConversion();\n }\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) ticks = $77dc20320068f1ee$var$sample(ticks, sampleSize);\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n return labelSizes;\n }\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const { ctx: ctx, _longestTextCache: caches } = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / $77dc20320068f1ee$var$getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n for(i = 0; i < length; i += increment){\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {\n data: {},\n gc: []\n };\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(label) && !(0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(label)) {\n width = (0, $02b6f511cc6c123c$export$e7c866399fa523f5)(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(label)) for(j = 0, jlen = label.length; j < jlen; ++j){\n nestedLabel = label[j];\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(nestedLabel) && !(0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(nestedLabel)) {\n width = (0, $02b6f511cc6c123c$export$e7c866399fa523f5)(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n $77dc20320068f1ee$var$garbageCollect(caches, length);\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n const valueAt = (idx)=>({\n width: widths[idx] || 0,\n height: heights[idx] || 0\n });\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths: widths,\n heights: heights\n };\n }\n getLabelForValue(value) {\n return value;\n }\n getPixelForValue(value, index) {\n return NaN;\n }\n getValueForPixel(pixel) {}\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) return null;\n return this.getPixelForValue(ticks[index].value);\n }\n getPixelForDecimal(decimal) {\n if (this._reversePixels) decimal = 1 - decimal;\n const pixel = this._startPixel + decimal * this._length;\n return (0, $02b6f511cc6c123c$export$71cec2538cb2c617)(this._alignToPixels ? (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(this.chart, pixel, 0) : pixel);\n }\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n getBaseValue() {\n const { min: min, max: max } = this;\n return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0;\n }\n getContext(index) {\n const ticks = this.ticks || [];\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context || (tick.$context = $77dc20320068f1ee$var$createTickContext(this.getContext(), index, tick));\n }\n return this.$context || (this.$context = $77dc20320068f1ee$var$createScaleContext(this.chart.getContext(), this));\n }\n _tickSize() {\n const optionTicks = this.options.ticks;\n const rot = (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin;\n }\n _isVisible() {\n const display = this.options.display;\n if (display !== \"auto\") return !!display;\n return this.getMatchingVisibleMetas().length > 0;\n }\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const { grid: grid, position: position, border: border } = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = $77dc20320068f1ee$var$getTickMarkLength(grid);\n const items = [];\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n if (position === \"top\") {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === \"bottom\") {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === \"left\") {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === \"right\") {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === \"x\") {\n if (position === \"center\") borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === \"y\") {\n if (position === \"center\") borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n const limit = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for(i = 0; i < ticksLength; i += step){\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n lineValue = $77dc20320068f1ee$var$getPixelForGridLine(this, i, offset);\n if (lineValue === undefined) continue;\n alignedLineValue = (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(chart, lineValue, lineWidth);\n if (isHorizontal) tx1 = tx2 = x1 = x2 = alignedLineValue;\n else ty1 = ty2 = y1 = y2 = alignedLineValue;\n items.push({\n tx1: tx1,\n ty1: ty1,\n tx2: tx2,\n ty2: ty2,\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n width: lineWidth,\n color: lineColor,\n borderDash: borderDash,\n borderDashOffset: borderDashOffset,\n tickWidth: tickWidth,\n tickColor: tickColor,\n tickBorderDash: tickBorderDash,\n tickBorderDashOffset: tickBorderDashOffset\n });\n }\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n return items;\n }\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const { position: position, ticks: optionTicks } = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const { align: align, crossAlign: crossAlign, padding: padding, mirror: mirror } = optionTicks;\n const tl = $77dc20320068f1ee$var$getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -(0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = \"middle\";\n if (position === \"top\") {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === \"bottom\") {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === \"left\") {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === \"right\") {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === \"x\") {\n if (position === \"center\") y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === \"y\") {\n if (position === \"center\") x = (chartArea.left + chartArea.right) / 2 - tickAndPadding;\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n if (axis === \"y\") {\n if (align === \"start\") textBaseline = \"top\";\n else if (align === \"end\") textBaseline = \"bottom\";\n }\n const labelSizes = this._getLabelSizes();\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n label = tick.label;\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = (0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n if (isHorizontal) {\n x = pixel;\n if (textAlign === \"inner\") {\n if (i === ilen - 1) tickTextAlign = !this.options.reverse ? \"right\" : \"left\";\n else if (i === 0) tickTextAlign = !this.options.reverse ? \"left\" : \"right\";\n else tickTextAlign = \"center\";\n }\n if (position === \"top\") {\n if (crossAlign === \"near\" || rotation !== 0) textOffset = -lineCount * lineHeight + lineHeight / 2;\n else if (crossAlign === \"center\") textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n else textOffset = -labelSizes.highest.height + lineHeight / 2;\n } else {\n if (crossAlign === \"near\" || rotation !== 0) textOffset = lineHeight / 2;\n else if (crossAlign === \"center\") textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n else textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n if (mirror) textOffset *= -1;\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) x += lineHeight / 2 * Math.sin(rotation);\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n let backdrop;\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n switch(textBaseline){\n case \"middle\":\n top -= height / 2;\n break;\n case \"bottom\":\n top -= height;\n break;\n }\n switch(textAlign){\n case \"center\":\n left -= width / 2;\n break;\n case \"right\":\n left -= width;\n break;\n }\n backdrop = {\n left: left,\n top: top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n color: optsAtIndex.backdropColor\n };\n }\n items.push({\n label: label,\n font: font,\n textOffset: textOffset,\n options: {\n rotation: rotation,\n color: color,\n strokeColor: strokeColor,\n strokeWidth: strokeWidth,\n textAlign: tickTextAlign,\n textBaseline: textBaseline,\n translation: [\n x,\n y\n ],\n backdrop: backdrop\n }\n });\n }\n return items;\n }\n _getXAxisLabelAlignment() {\n const { position: position, ticks: ticks } = this.options;\n const rotation = -(0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.labelRotation);\n if (rotation) return position === \"top\" ? \"left\" : \"right\";\n let align = \"center\";\n if (ticks.align === \"start\") align = \"left\";\n else if (ticks.align === \"end\") align = \"right\";\n else if (ticks.align === \"inner\") align = \"inner\";\n return align;\n }\n _getYAxisLabelAlignment(tl) {\n const { position: position, ticks: { crossAlign: crossAlign, mirror: mirror, padding: padding } } = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n let textAlign;\n let x;\n if (position === \"left\") {\n if (mirror) {\n x = this.right + padding;\n if (crossAlign === \"near\") textAlign = \"left\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x += widest / 2;\n } else {\n textAlign = \"right\";\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n if (crossAlign === \"near\") textAlign = \"right\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x -= widest / 2;\n } else {\n textAlign = \"left\";\n x = this.left;\n }\n }\n } else if (position === \"right\") {\n if (mirror) {\n x = this.left + padding;\n if (crossAlign === \"near\") textAlign = \"right\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x -= widest / 2;\n } else {\n textAlign = \"left\";\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n if (crossAlign === \"near\") textAlign = \"left\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x += widest / 2;\n } else {\n textAlign = \"right\";\n x = this.right;\n }\n }\n } else textAlign = \"right\";\n return {\n textAlign: textAlign,\n x: x\n };\n }\n _computeLabelArea() {\n if (this.options.ticks.mirror) return;\n const chart = this.chart;\n const position = this.options.position;\n if (position === \"left\" || position === \"right\") return {\n top: 0,\n left: this.left,\n bottom: chart.height,\n right: this.right\n };\n if (position === \"top\" || position === \"bottom\") return {\n top: this.top,\n left: 0,\n bottom: this.bottom,\n right: chart.width\n };\n }\n drawBackground() {\n const { ctx: ctx, options: { backgroundColor: backgroundColor }, left: left, top: top, width: width, height: height } = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) return 0;\n const ticks = this.ticks;\n const index = ticks.findIndex((t)=>t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n const drawLine = (p1, p2, style)=>{\n if (!style.width || !style.color) return;\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n if (grid.display) for(i = 0, ilen = items.length; i < ilen; ++i){\n const item = items[i];\n if (grid.drawOnChartArea) drawLine({\n x: item.x1,\n y: item.y1\n }, {\n x: item.x2,\n y: item.y2\n }, item);\n if (grid.drawTicks) drawLine({\n x: item.tx1,\n y: item.ty1\n }, {\n x: item.tx2,\n y: item.ty2\n }, {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n });\n }\n }\n drawBorder() {\n const { chart: chart, ctx: ctx, options: { border: border, grid: grid } } = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) return;\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n if (this.isHorizontal()) {\n x1 = (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.restore();\n }\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n if (!optionTicks.display) return;\n const ctx = this.ctx;\n const area = this._computeLabelArea();\n if (area) (0, $02b6f511cc6c123c$export$8743009a87fcb00f)(ctx, area);\n const items = this.getLabelItems(chartArea);\n for (const item of items){\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n if (area) (0, $02b6f511cc6c123c$export$3d8c2f653ac9d0b9)(ctx);\n }\n drawTitle() {\n const { ctx: ctx, options: { position: position, title: title, reverse: reverse } } = this;\n if (!title.display) return;\n const font = (0, $02b6f511cc6c123c$export$34aec0b863436764)(title.font);\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n if (position === \"bottom\" || position === \"center\" || (0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n offset += padding.bottom;\n if ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(title.text)) offset += font.lineHeight * (title.text.length - 1);\n } else offset += padding.top;\n const { titleX: titleX, titleY: titleY, maxWidth: maxWidth, rotation: rotation } = $77dc20320068f1ee$var$titleArgs(this, offset, position, align);\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth: maxWidth,\n rotation: rotation,\n textAlign: $77dc20320068f1ee$var$titleAlign(align, position, reverse),\n textBaseline: \"middle\",\n translation: [\n titleX,\n titleY\n ]\n });\n }\n draw(chartArea) {\n if (!this._isVisible()) return;\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(opts.grid && opts.grid.z, -1);\n const bz = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(opts.border && opts.border.z, 0);\n if (!this._isVisible() || this.draw !== $77dc20320068f1ee$export$d60cfc58d3c358b6.prototype.draw) return [\n {\n z: tz,\n draw: (chartArea)=>{\n this.draw(chartArea);\n }\n }\n ];\n return [\n {\n z: gz,\n draw: (chartArea)=>{\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n },\n {\n z: bz,\n draw: ()=>{\n this.drawBorder();\n }\n },\n {\n z: tz,\n draw: (chartArea)=>{\n this.drawLabels(chartArea);\n }\n }\n ];\n }\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + \"AxisID\";\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) result.push(meta);\n }\n return result;\n }\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return (0, $02b6f511cc6c123c$export$34aec0b863436764)(opts.font);\n }\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n constructor(cfg){\n super();\n this.id = cfg.id;\n this.type = cfg.type;\n this.options = undefined;\n this.ctx = cfg.ctx;\n this.chart = cfg.chart;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.paddingTop = undefined;\n this.paddingBottom = undefined;\n this.paddingLeft = undefined;\n this.paddingRight = undefined;\n this.axis = undefined;\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n this.ticks = [];\n this._gridLineItems = null;\n this._labelItems = null;\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n this._startPixel = undefined;\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n}\nclass $77dc20320068f1ee$var$TypedRegistry {\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n if ($77dc20320068f1ee$var$isIChartComponent(proto)) parentScope = this.register(proto);\n const items = this.items;\n const id = item.id;\n const scope = this.scope + \".\" + id;\n if (!id) throw new Error(\"class does not have id: \" + item);\n if (id in items) return scope;\n items[id] = item;\n $77dc20320068f1ee$var$registerDefaults(item, scope, parentScope);\n if (this.override) (0, $02b6f511cc6c123c$export$4368d992c4eafac0).override(item.id, item.overrides);\n return scope;\n }\n get(id) {\n return this.items[id];\n }\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n if (id in items) delete items[id];\n if (scope && id in (0, $02b6f511cc6c123c$export$4368d992c4eafac0)[scope]) {\n delete (0, $02b6f511cc6c123c$export$4368d992c4eafac0)[scope][id];\n if (this.override) delete (0, $02b6f511cc6c123c$export$6559d589eb85fbb6)[id];\n }\n }\n constructor(type, scope, override){\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n}\nfunction $77dc20320068f1ee$var$registerDefaults(item, scope, parentScope) {\n const itemDefaults = (0, $02b6f511cc6c123c$export$efca4cbe5dd06740)(Object.create(null), [\n parentScope ? (0, $02b6f511cc6c123c$export$4368d992c4eafac0).get(parentScope) : {},\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0).get(scope),\n item.defaults\n ]);\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0).set(scope, itemDefaults);\n if (item.defaultRoutes) $77dc20320068f1ee$var$routeDefaults(scope, item.defaultRoutes);\n if (item.descriptors) (0, $02b6f511cc6c123c$export$4368d992c4eafac0).describe(scope, item.descriptors);\n}\nfunction $77dc20320068f1ee$var$routeDefaults(scope, routes) {\n Object.keys(routes).forEach((property)=>{\n const propertyParts = property.split(\".\");\n const sourceName = propertyParts.pop();\n const sourceScope = [\n scope\n ].concat(propertyParts).join(\".\");\n const parts = routes[property].split(\".\");\n const targetName = parts.pop();\n const targetScope = parts.join(\".\");\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0).route(sourceScope, sourceName, targetScope, targetName);\n });\n}\nfunction $77dc20320068f1ee$var$isIChartComponent(proto) {\n return \"id\" in proto && \"defaults\" in proto;\n}\nclass $77dc20320068f1ee$var$Registry {\n add(...args) {\n this._each(\"register\", args);\n }\n remove(...args) {\n this._each(\"unregister\", args);\n }\n addControllers(...args) {\n this._each(\"register\", args, this.controllers);\n }\n addElements(...args) {\n this._each(\"register\", args, this.elements);\n }\n addPlugins(...args) {\n this._each(\"register\", args, this.plugins);\n }\n addScales(...args) {\n this._each(\"register\", args, this.scales);\n }\n getController(id) {\n return this._get(id, this.controllers, \"controller\");\n }\n getElement(id) {\n return this._get(id, this.elements, \"element\");\n }\n getPlugin(id) {\n return this._get(id, this.plugins, \"plugin\");\n }\n getScale(id) {\n return this._get(id, this.scales, \"scale\");\n }\n removeControllers(...args) {\n this._each(\"unregister\", args, this.controllers);\n }\n removeElements(...args) {\n this._each(\"unregister\", args, this.elements);\n }\n removePlugins(...args) {\n this._each(\"unregister\", args, this.plugins);\n }\n removeScales(...args) {\n this._each(\"unregister\", args, this.scales);\n }\n _each(method, args, typedRegistry) {\n [\n ...args\n ].forEach((arg)=>{\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) this._exec(method, reg, arg);\n else (0, $02b6f511cc6c123c$export$d66501df72047452)(arg, (item)=>{\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n });\n }\n _exec(method, registry, component) {\n const camelMethod = (0, $02b6f511cc6c123c$export$a8550f7dbe79f93a)(method);\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(component[\"before\" + camelMethod], [], component);\n registry[method](component);\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(component[\"after\" + camelMethod], [], component);\n }\n _getRegistryForType(type) {\n for(let i = 0; i < this._typedRegistries.length; i++){\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) return reg;\n }\n return this.plugins;\n }\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) throw new Error('\"' + id + '\" is not a registered ' + type + \".\");\n return item;\n }\n constructor(){\n this.controllers = new $77dc20320068f1ee$var$TypedRegistry($77dc20320068f1ee$export$75572ec5c55b4048, \"datasets\", true);\n this.elements = new $77dc20320068f1ee$var$TypedRegistry($77dc20320068f1ee$export$db77ccec0bb4ccac, \"elements\");\n this.plugins = new $77dc20320068f1ee$var$TypedRegistry(Object, \"plugins\");\n this.scales = new $77dc20320068f1ee$var$TypedRegistry($77dc20320068f1ee$export$d60cfc58d3c358b6, \"scales\");\n this._typedRegistries = [\n this.controllers,\n this.scales,\n this.elements\n ];\n }\n}\nvar $77dc20320068f1ee$export$4bb7493d241fd8a5 = /* #__PURE__ */ new $77dc20320068f1ee$var$Registry();\nclass $77dc20320068f1ee$var$PluginService {\n notify(chart, hook, args, filter) {\n if (hook === \"beforeInit\") {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, \"install\");\n }\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n if (hook === \"afterDestroy\") {\n this._notify(descriptors, chart, \"stop\");\n this._notify(this._init, chart, \"uninstall\");\n }\n return result;\n }\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors){\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [\n chart,\n args,\n descriptor.options\n ];\n if ((0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(method, params, plugin) === false && args.cancelable) return false;\n }\n return true;\n }\n invalidate() {\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n _descriptors(chart) {\n if (this._cache) return this._cache;\n const descriptors = this._cache = this._createDescriptors(chart);\n this._notifyStateChanges(chart);\n return descriptors;\n }\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(config.options && config.options.plugins, {});\n const plugins = $77dc20320068f1ee$var$allPlugins(config);\n return options === false && !all ? [] : $77dc20320068f1ee$var$createDescriptors(chart, plugins, options, all);\n }\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, \"stop\");\n this._notify(diff(descriptors, previousDescriptors), chart, \"start\");\n }\n constructor(){\n this._init = [];\n }\n}\nfunction $77dc20320068f1ee$var$allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys($77dc20320068f1ee$export$4bb7493d241fd8a5.plugins.items);\n for(let i = 0; i < keys.length; i++)plugins.push($77dc20320068f1ee$export$4bb7493d241fd8a5.getPlugin(keys[i]));\n const local = config.plugins || [];\n for(let i = 0; i < local.length; i++){\n const plugin = local[i];\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n return {\n plugins: plugins,\n localIds: localIds\n };\n}\nfunction $77dc20320068f1ee$var$getOpts(options, all) {\n if (!all && options === false) return null;\n if (options === true) return {};\n return options;\n}\nfunction $77dc20320068f1ee$var$createDescriptors(chart, { plugins: plugins, localIds: localIds }, options, all) {\n const result = [];\n const context = chart.getContext();\n for (const plugin of plugins){\n const id = plugin.id;\n const opts = $77dc20320068f1ee$var$getOpts(options[id], all);\n if (opts === null) continue;\n result.push({\n plugin: plugin,\n options: $77dc20320068f1ee$var$pluginOpts(chart.config, {\n plugin: plugin,\n local: localIds[id]\n }, opts, context)\n });\n }\n return result;\n}\nfunction $77dc20320068f1ee$var$pluginOpts(config, { plugin: plugin, local: local }, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) scopes.push(plugin.defaults);\n return config.createResolver(scopes, context, [\n \"\"\n ], {\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\nfunction $77dc20320068f1ee$var$getIndexAxis(type, options) {\n const datasetDefaults = (0, $02b6f511cc6c123c$export$4368d992c4eafac0).datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || \"x\";\n}\nfunction $77dc20320068f1ee$var$getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === \"_index_\") axis = indexAxis;\n else if (id === \"_value_\") axis = indexAxis === \"x\" ? \"y\" : \"x\";\n return axis;\n}\nfunction $77dc20320068f1ee$var$getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? \"_index_\" : \"_value_\";\n}\nfunction $77dc20320068f1ee$var$idMatchesAxis(id) {\n if (id === \"x\" || id === \"y\" || id === \"r\") return id;\n}\nfunction $77dc20320068f1ee$var$axisFromPosition(position) {\n if (position === \"top\" || position === \"bottom\") return \"x\";\n if (position === \"left\" || position === \"right\") return \"y\";\n}\nfunction $77dc20320068f1ee$var$determineAxis(id, ...scaleOptions) {\n if ($77dc20320068f1ee$var$idMatchesAxis(id)) return id;\n for (const opts of scaleOptions){\n const axis = opts.axis || $77dc20320068f1ee$var$axisFromPosition(opts.position) || id.length > 1 && $77dc20320068f1ee$var$idMatchesAxis(id[0].toLowerCase());\n if (axis) return axis;\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\nfunction $77dc20320068f1ee$var$getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + \"AxisID\"] === id) return {\n axis: axis\n };\n}\nfunction $77dc20320068f1ee$var$retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d)=>d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) return $77dc20320068f1ee$var$getAxisFromDataset(id, \"x\", boundDs[0]) || $77dc20320068f1ee$var$getAxisFromDataset(id, \"y\", boundDs[0]);\n }\n return {};\n}\nfunction $77dc20320068f1ee$var$mergeScaleConfig(config, options) {\n const chartDefaults = (0, $02b6f511cc6c123c$export$6559d589eb85fbb6)[config.type] || {\n scales: {}\n };\n const configScales = options.scales || {};\n const chartIndexAxis = $77dc20320068f1ee$var$getIndexAxis(config.type, options);\n const scales = Object.create(null);\n Object.keys(configScales).forEach((id)=>{\n const scaleConf = configScales[id];\n if (!(0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(scaleConf)) return console.error(`Invalid scale configuration for scale: ${id}`);\n if (scaleConf._proxy) return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n const axis = $77dc20320068f1ee$var$determineAxis(id, scaleConf, $77dc20320068f1ee$var$retrieveAxisFromDatasets(id, config), (0, $02b6f511cc6c123c$export$4368d992c4eafac0).scales[scaleConf.type]);\n const defaultId = $77dc20320068f1ee$var$getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = (0, $02b6f511cc6c123c$export$555508cbc6add439)(Object.create(null), [\n {\n axis: axis\n },\n scaleConf,\n defaultScaleOptions[axis],\n defaultScaleOptions[defaultId]\n ]);\n });\n config.data.datasets.forEach((dataset)=>{\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || $77dc20320068f1ee$var$getIndexAxis(type, options);\n const datasetDefaults = (0, $02b6f511cc6c123c$export$6559d589eb85fbb6)[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach((defaultID)=>{\n const axis = $77dc20320068f1ee$var$getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + \"AxisID\"] || axis;\n scales[id] = scales[id] || Object.create(null);\n (0, $02b6f511cc6c123c$export$555508cbc6add439)(scales[id], [\n {\n axis: axis\n },\n configScales[id],\n defaultScaleOptions[defaultID]\n ]);\n });\n });\n Object.keys(scales).forEach((key)=>{\n const scale = scales[key];\n (0, $02b6f511cc6c123c$export$555508cbc6add439)(scale, [\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0).scales[scale.type],\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0).scale\n ]);\n });\n return scales;\n}\nfunction $77dc20320068f1ee$var$initOptions(config) {\n const options = config.options || (config.options = {});\n options.plugins = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(options.plugins, {});\n options.scales = $77dc20320068f1ee$var$mergeScaleConfig(config, options);\n}\nfunction $77dc20320068f1ee$var$initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\nfunction $77dc20320068f1ee$var$initConfig(config) {\n config = config || {};\n config.data = $77dc20320068f1ee$var$initData(config.data);\n $77dc20320068f1ee$var$initOptions(config);\n return config;\n}\nconst $77dc20320068f1ee$var$keyCache = new Map();\nconst $77dc20320068f1ee$var$keysCached = new Set();\nfunction $77dc20320068f1ee$var$cachedKeys(cacheKey, generate) {\n let keys = $77dc20320068f1ee$var$keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n $77dc20320068f1ee$var$keyCache.set(cacheKey, keys);\n $77dc20320068f1ee$var$keysCached.add(keys);\n }\n return keys;\n}\nconst $77dc20320068f1ee$var$addIfFound = (set, obj, key)=>{\n const opts = (0, $02b6f511cc6c123c$export$2d1720544b23b823)(obj, key);\n if (opts !== undefined) set.add(opts);\n};\nclass $77dc20320068f1ee$var$Config {\n get platform() {\n return this._config.platform;\n }\n get type() {\n return this._config.type;\n }\n set type(type) {\n this._config.type = type;\n }\n get data() {\n return this._config.data;\n }\n set data(data) {\n this._config.data = $77dc20320068f1ee$var$initData(data);\n }\n get options() {\n return this._config.options;\n }\n set options(options) {\n this._config.options = options;\n }\n get plugins() {\n return this._config.plugins;\n }\n update() {\n const config = this._config;\n this.clearCache();\n $77dc20320068f1ee$var$initOptions(config);\n }\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n datasetScopeKeys(datasetType) {\n return $77dc20320068f1ee$var$cachedKeys(datasetType, ()=>[\n [\n `datasets.${datasetType}`,\n \"\"\n ]\n ]);\n }\n datasetAnimationScopeKeys(datasetType, transition) {\n return $77dc20320068f1ee$var$cachedKeys(`${datasetType}.transition.${transition}`, ()=>[\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`\n ],\n [\n `datasets.${datasetType}`,\n \"\"\n ]\n ]);\n }\n datasetElementScopeKeys(datasetType, elementType) {\n return $77dc20320068f1ee$var$cachedKeys(`${datasetType}-${elementType}`, ()=>[\n [\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n \"\"\n ]\n ]);\n }\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return $77dc20320068f1ee$var$cachedKeys(`${type}-plugin-${id}`, ()=>[\n [\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || []\n ]\n ]);\n }\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n getOptionScopes(mainScope, keyLists, resetCache) {\n const { options: options, type: type } = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) return cached;\n const scopes = new Set();\n keyLists.forEach((keys)=>{\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach((key)=>$77dc20320068f1ee$var$addIfFound(scopes, mainScope, key));\n }\n keys.forEach((key)=>$77dc20320068f1ee$var$addIfFound(scopes, options, key));\n keys.forEach((key)=>$77dc20320068f1ee$var$addIfFound(scopes, (0, $02b6f511cc6c123c$export$6559d589eb85fbb6)[type] || {}, key));\n keys.forEach((key)=>$77dc20320068f1ee$var$addIfFound(scopes, (0, $02b6f511cc6c123c$export$4368d992c4eafac0), key));\n keys.forEach((key)=>$77dc20320068f1ee$var$addIfFound(scopes, (0, $02b6f511cc6c123c$export$2e2af4578d910ddf), key));\n });\n const array = Array.from(scopes);\n if (array.length === 0) array.push(Object.create(null));\n if ($77dc20320068f1ee$var$keysCached.has(keyLists)) cache.set(keyLists, array);\n return array;\n }\n chartOptionScopes() {\n const { options: options, type: type } = this;\n return [\n options,\n (0, $02b6f511cc6c123c$export$6559d589eb85fbb6)[type] || {},\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0).datasets[type] || {},\n {\n type: type\n },\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0),\n (0, $02b6f511cc6c123c$export$2e2af4578d910ddf)\n ];\n }\n resolveNamedOptions(scopes, names, context, prefixes = [\n \"\"\n ]) {\n const result = {\n $shared: true\n };\n const { resolver: resolver, subPrefixes: subPrefixes } = $77dc20320068f1ee$var$getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if ($77dc20320068f1ee$var$needContext(resolver, names)) {\n result.$shared = false;\n context = (0, $02b6f511cc6c123c$export$a93c5207d687da10)(context) ? context() : context;\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = (0, $02b6f511cc6c123c$export$c3950d9923825c02)(resolver, context, subResolver);\n }\n for (const prop of names)result[prop] = options[prop];\n return result;\n }\n createResolver(scopes, context, prefixes = [\n \"\"\n ], descriptorDefaults) {\n const { resolver: resolver } = $77dc20320068f1ee$var$getResolver(this._resolverCache, scopes, prefixes);\n return (0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(context) ? (0, $02b6f511cc6c123c$export$c3950d9923825c02)(resolver, context, undefined, descriptorDefaults) : resolver;\n }\n constructor(config){\n this._config = $77dc20320068f1ee$var$initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n}\nfunction $77dc20320068f1ee$var$getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = (0, $02b6f511cc6c123c$export$a9c996f45e5784d0)(scopes, prefixes);\n cached = {\n resolver: resolver,\n subPrefixes: prefixes.filter((p)=>!p.toLowerCase().includes(\"hover\"))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\nconst $77dc20320068f1ee$var$hasFunction = (value)=>(0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(value) && Object.getOwnPropertyNames(value).reduce((acc, key)=>acc || (0, $02b6f511cc6c123c$export$a93c5207d687da10)(value[key]), false);\nfunction $77dc20320068f1ee$var$needContext(proxy, names) {\n const { isScriptable: isScriptable, isIndexable: isIndexable } = (0, $02b6f511cc6c123c$export$7910e0436ed8d1de)(proxy);\n for (const prop of names){\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if (scriptable && ((0, $02b6f511cc6c123c$export$a93c5207d687da10)(value) || $77dc20320068f1ee$var$hasFunction(value)) || indexable && (0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(value)) return true;\n }\n return false;\n}\nvar $77dc20320068f1ee$var$version = \"4.4.0\";\nconst $77dc20320068f1ee$var$KNOWN_POSITIONS = [\n \"top\",\n \"bottom\",\n \"left\",\n \"right\",\n \"chartArea\"\n];\nfunction $77dc20320068f1ee$var$positionIsHorizontal(position, axis) {\n return position === \"top\" || position === \"bottom\" || $77dc20320068f1ee$var$KNOWN_POSITIONS.indexOf(position) === -1 && axis === \"x\";\n}\nfunction $77dc20320068f1ee$var$compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1];\n };\n}\nfunction $77dc20320068f1ee$var$onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n chart.notifyPlugins(\"afterRender\");\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(animationOptions && animationOptions.onComplete, [\n context\n ], chart);\n}\nfunction $77dc20320068f1ee$var$onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(animationOptions && animationOptions.onProgress, [\n context\n ], chart);\n}\nfunction $77dc20320068f1ee$var$getCanvas(item) {\n if ((0, $02b6f511cc6c123c$export$3a1a48c8f6ef640e)() && typeof item === \"string\") item = document.getElementById(item);\n else if (item && item.length) item = item[0];\n if (item && item.canvas) item = item.canvas;\n return item;\n}\nconst $77dc20320068f1ee$var$instances = {};\nconst $77dc20320068f1ee$var$getChart = (key)=>{\n const canvas = $77dc20320068f1ee$var$getCanvas(key);\n return Object.values($77dc20320068f1ee$var$instances).filter((c)=>c.canvas === canvas).pop();\n};\nfunction $77dc20320068f1ee$var$moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys){\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) obj[intKey + move] = value;\n }\n }\n}\nfunction $77dc20320068f1ee$var$determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === \"mouseout\") return null;\n if (isClick) return lastEvent;\n return e;\n}\nfunction $77dc20320068f1ee$var$getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\nfunction $77dc20320068f1ee$var$getDatasetArea(meta, chartArea) {\n const { xScale: xScale, yScale: yScale } = meta;\n if (xScale && yScale) return {\n left: $77dc20320068f1ee$var$getSizeForArea(xScale, chartArea, \"left\"),\n right: $77dc20320068f1ee$var$getSizeForArea(xScale, chartArea, \"right\"),\n top: $77dc20320068f1ee$var$getSizeForArea(yScale, chartArea, \"top\"),\n bottom: $77dc20320068f1ee$var$getSizeForArea(yScale, chartArea, \"bottom\")\n };\n return chartArea;\n}\nclass $77dc20320068f1ee$export$acaa6426d77a227e {\n static register(...items) {\n $77dc20320068f1ee$export$4bb7493d241fd8a5.add(...items);\n $77dc20320068f1ee$var$invalidatePlugins();\n }\n static unregister(...items) {\n $77dc20320068f1ee$export$4bb7493d241fd8a5.remove(...items);\n $77dc20320068f1ee$var$invalidatePlugins();\n }\n get aspectRatio() {\n const { options: { aspectRatio: aspectRatio, maintainAspectRatio: maintainAspectRatio }, width: width, height: height, _aspectRatio: _aspectRatio } = this;\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(aspectRatio)) return aspectRatio;\n if (maintainAspectRatio && _aspectRatio) return _aspectRatio;\n return height ? width / height : null;\n }\n get data() {\n return this.config.data;\n }\n set data(data) {\n this.config.data = data;\n }\n get options() {\n return this._options;\n }\n set options(options) {\n this.config.options = options;\n }\n get registry() {\n return $77dc20320068f1ee$export$4bb7493d241fd8a5;\n }\n _initialize() {\n this.notifyPlugins(\"beforeInit\");\n if (this.options.responsive) this.resize();\n else (0, $02b6f511cc6c123c$export$f787f51d84a910ad)(this, this.options.devicePixelRatio);\n this.bindEvents();\n this.notifyPlugins(\"afterInit\");\n return this;\n }\n clear() {\n (0, $02b6f511cc6c123c$export$c9170ad7d4cd7e57)(this.canvas, this.ctx);\n return this;\n }\n stop() {\n $77dc20320068f1ee$export$a424a0aa8f687495.stop(this);\n return this;\n }\n resize(width, height) {\n if (!$77dc20320068f1ee$export$a424a0aa8f687495.running(this)) this._resize(width, height);\n else this._resizeBeforeDraw = {\n width: width,\n height: height\n };\n }\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? \"resize\" : \"attach\";\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!(0, $02b6f511cc6c123c$export$f787f51d84a910ad)(this, newRatio, true)) return;\n this.notifyPlugins(\"resize\", {\n size: newSize\n });\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(options.onResize, [\n this,\n newSize\n ], this);\n if (this.attached) {\n if (this._doResize(mode)) this.render();\n }\n }\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n (0, $02b6f511cc6c123c$export$d66501df72047452)(scalesOptions, (axisOptions, axisID)=>{\n axisOptions.id = axisID;\n });\n }\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id)=>{\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n if (scaleOpts) items = items.concat(Object.keys(scaleOpts).map((id)=>{\n const scaleOptions = scaleOpts[id];\n const axis = $77dc20320068f1ee$var$determineAxis(id, scaleOptions);\n const isRadial = axis === \"r\";\n const isHorizontal = axis === \"x\";\n return {\n options: scaleOptions,\n dposition: isRadial ? \"chartArea\" : isHorizontal ? \"bottom\" : \"left\",\n dtype: isRadial ? \"radialLinear\" : isHorizontal ? \"category\" : \"linear\"\n };\n }));\n (0, $02b6f511cc6c123c$export$d66501df72047452)(items, (item)=>{\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = $77dc20320068f1ee$var$determineAxis(id, scaleOptions);\n const scaleType = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(scaleOptions.type, item.dtype);\n if (scaleOptions.position === undefined || $77dc20320068f1ee$var$positionIsHorizontal(scaleOptions.position, axis) !== $77dc20320068f1ee$var$positionIsHorizontal(item.dposition)) scaleOptions.position = item.dposition;\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) scale = scales[id];\n else {\n const scaleClass = $77dc20320068f1ee$export$4bb7493d241fd8a5.getScale(scaleType);\n scale = new scaleClass({\n id: id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n scale.init(scaleOptions, options);\n });\n (0, $02b6f511cc6c123c$export$d66501df72047452)(updated, (hasUpdated, id)=>{\n if (!hasUpdated) delete scales[id];\n });\n (0, $02b6f511cc6c123c$export$d66501df72047452)(scales, (scale)=>{\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(this, scale, scale.options);\n $77dc20320068f1ee$export$1ecca0613f5e56d2.addBox(this, scale);\n });\n }\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n metasets.sort((a, b)=>a.index - b.index);\n if (numMeta > numData) {\n for(let i = numData; i < numMeta; ++i)this._destroyDatasetMeta(i);\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort($77dc20320068f1ee$var$compare2Level(\"order\", \"index\"));\n }\n _removeUnreferencedMetasets() {\n const { _metasets: metasets, data: { datasets: datasets } } = this;\n if (metasets.length > datasets.length) delete this._stacks;\n metasets.forEach((meta, index)=>{\n if (datasets.filter((x)=>x === meta._dataset).length === 0) this._destroyDatasetMeta(index);\n });\n }\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n this._removeUnreferencedMetasets();\n for(i = 0, ilen = datasets.length; i < ilen; i++){\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || $77dc20320068f1ee$var$getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = \"\" + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = $77dc20320068f1ee$export$4bb7493d241fd8a5.getController(type);\n const { datasetElementType: datasetElementType, dataElementType: dataElementType } = (0, $02b6f511cc6c123c$export$4368d992c4eafac0).datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: $77dc20320068f1ee$export$4bb7493d241fd8a5.getElement(dataElementType),\n datasetElementType: datasetElementType && $77dc20320068f1ee$export$4bb7493d241fd8a5.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n this._updateMetasets();\n return newControllers;\n }\n _resetElements() {\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this.data.datasets, (dataset, datasetIndex)=>{\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n reset() {\n this._resetElements();\n this.notifyPlugins(\"reset\");\n }\n update(mode) {\n const config = this.config;\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n this._plugins.invalidate();\n if (this.notifyPlugins(\"beforeUpdate\", {\n mode: mode,\n cancelable: true\n }) === false) return;\n const newControllers = this.buildOrUpdateControllers();\n this.notifyPlugins(\"beforeElementsUpdate\");\n let minPadding = 0;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; i++){\n const { controller: controller } = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n if (!animsDisabled) (0, $02b6f511cc6c123c$export$d66501df72047452)(newControllers, (controller)=>{\n controller.reset();\n });\n this._updateDatasets(mode);\n this.notifyPlugins(\"afterUpdate\", {\n mode: mode\n });\n this._layers.sort($77dc20320068f1ee$var$compare2Level(\"z\", \"_idx\"));\n const { _active: _active, _lastEvent: _lastEvent } = this;\n if (_lastEvent) this._eventHandler(_lastEvent, true);\n else if (_active.length) this._updateHoverStyles(_active, _active, true);\n this.render();\n }\n _updateScales() {\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this.scales, (scale)=>{\n $77dc20320068f1ee$export$1ecca0613f5e56d2.removeBox(this, scale);\n });\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n if (!(0, $02b6f511cc6c123c$export$ee7c8ad385a60b7b)(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n this.unbindEvents();\n this.bindEvents();\n }\n }\n _updateHiddenIndices() {\n const { _hiddenIndices: _hiddenIndices } = this;\n const changes = this._getUniformDataChanges() || [];\n for (const { method: method, start: start, count: count } of changes){\n const move = method === \"_removeElements\" ? -count : count;\n $77dc20320068f1ee$var$moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) return;\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx)=>new Set(_dataChanges.filter((c)=>c[0] === idx).map((c, i)=>i + \",\" + c.splice(1).join(\",\")));\n const changeSet = makeSet(0);\n for(let i = 1; i < datasetCount; i++){\n if (!(0, $02b6f511cc6c123c$export$ee7c8ad385a60b7b)(changeSet, makeSet(i))) return;\n }\n return Array.from(changeSet).map((c)=>c.split(\",\")).map((a)=>({\n method: a[1],\n start: +a[2],\n count: +a[3]\n }));\n }\n _updateLayout(minPadding) {\n if (this.notifyPlugins(\"beforeLayout\", {\n cancelable: true\n }) === false) return;\n $77dc20320068f1ee$export$1ecca0613f5e56d2.update(this, this.width, this.height, minPadding);\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n this._layers = [];\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this.boxes, (box)=>{\n if (noArea && box.position === \"chartArea\") return;\n if (box.configure) box.configure();\n this._layers.push(...box._layers());\n }, this);\n this._layers.forEach((item, index)=>{\n item._idx = index;\n });\n this.notifyPlugins(\"afterLayout\");\n }\n _updateDatasets(mode) {\n if (this.notifyPlugins(\"beforeDatasetsUpdate\", {\n mode: mode,\n cancelable: true\n }) === false) return;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i)this.getDatasetMeta(i).controller.configure();\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i)this._updateDataset(i, (0, $02b6f511cc6c123c$export$a93c5207d687da10)(mode) ? mode({\n datasetIndex: i\n }) : mode);\n this.notifyPlugins(\"afterDatasetsUpdate\", {\n mode: mode\n });\n }\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {\n meta: meta,\n index: index,\n mode: mode,\n cancelable: true\n };\n if (this.notifyPlugins(\"beforeDatasetUpdate\", args) === false) return;\n meta.controller._update(mode);\n args.cancelable = false;\n this.notifyPlugins(\"afterDatasetUpdate\", args);\n }\n render() {\n if (this.notifyPlugins(\"beforeRender\", {\n cancelable: true\n }) === false) return;\n if ($77dc20320068f1ee$export$a424a0aa8f687495.has(this)) {\n if (this.attached && !$77dc20320068f1ee$export$a424a0aa8f687495.running(this)) $77dc20320068f1ee$export$a424a0aa8f687495.start(this);\n } else {\n this.draw();\n $77dc20320068f1ee$var$onAnimationsComplete({\n chart: this\n });\n }\n }\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const { width: width, height: height } = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n if (this.width <= 0 || this.height <= 0) return;\n if (this.notifyPlugins(\"beforeDraw\", {\n cancelable: true\n }) === false) return;\n const layers = this._layers;\n for(i = 0; i < layers.length && layers[i].z <= 0; ++i)layers[i].draw(this.chartArea);\n this._drawDatasets();\n for(; i < layers.length; ++i)layers[i].draw(this.chartArea);\n this.notifyPlugins(\"afterDraw\");\n }\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n const meta = metasets[i];\n if (!filterVisible || meta.visible) result.push(meta);\n }\n return result;\n }\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n _drawDatasets() {\n if (this.notifyPlugins(\"beforeDatasetsDraw\", {\n cancelable: true\n }) === false) return;\n const metasets = this.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i)this._drawDataset(metasets[i]);\n this.notifyPlugins(\"afterDatasetsDraw\");\n }\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = $77dc20320068f1ee$var$getDatasetArea(meta, this.chartArea);\n const args = {\n meta: meta,\n index: meta.index,\n cancelable: true\n };\n if (this.notifyPlugins(\"beforeDatasetDraw\", args) === false) return;\n if (useClip) (0, $02b6f511cc6c123c$export$8743009a87fcb00f)(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n meta.controller.draw();\n if (useClip) (0, $02b6f511cc6c123c$export$3d8c2f653ac9d0b9)(ctx);\n args.cancelable = false;\n this.notifyPlugins(\"afterDatasetDraw\", args);\n }\n isPointInArea(point) {\n return (0, $02b6f511cc6c123c$export$e7094788287c5e9b)(point, this.chartArea, this._minPadding);\n }\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = $77dc20320068f1ee$export$a13296960cae0384.modes[mode];\n if (typeof method === \"function\") return method(this, e, options, useFinalPosition);\n return [];\n }\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter((x)=>x && x._dataset === dataset).pop();\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n return meta;\n }\n getContext() {\n return this.$context || (this.$context = (0, $02b6f511cc6c123c$export$35e795649ee09318)(null, {\n chart: this,\n type: \"chart\"\n }));\n }\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) return false;\n const meta = this.getDatasetMeta(datasetIndex);\n return typeof meta.hidden === \"boolean\" ? !meta.hidden : !dataset.hidden;\n }\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? \"show\" : \"hide\";\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n if ((0, $02b6f511cc6c123c$export$dda1d9f60106f0e9)(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n anims.update(meta, {\n visible: visible\n });\n this.update((ctx)=>ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) meta.controller._destroy();\n delete this._metasets[datasetIndex];\n }\n _stop() {\n let i, ilen;\n this.stop();\n $77dc20320068f1ee$export$a424a0aa8f687495.remove(this);\n for(i = 0, ilen = this.data.datasets.length; i < ilen; ++i)this._destroyDatasetMeta(i);\n }\n destroy() {\n this.notifyPlugins(\"beforeDestroy\");\n const { canvas: canvas, ctx: ctx } = this;\n this._stop();\n this.config.clearCache();\n if (canvas) {\n this.unbindEvents();\n (0, $02b6f511cc6c123c$export$c9170ad7d4cd7e57)(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n delete $77dc20320068f1ee$var$instances[this.id];\n this.notifyPlugins(\"afterDestroy\");\n }\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) this.bindResponsiveEvents();\n else this.attached = true;\n }\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const listener = (e, x, y)=>{\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this.options.events, (type)=>_add(type, listener));\n }\n bindResponsiveEvents() {\n if (!this._responsiveListeners) this._responsiveListeners = {};\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener)=>{\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n const listener = (width, height)=>{\n if (this.canvas) this.resize(width, height);\n };\n let detached;\n const attached = ()=>{\n _remove(\"attach\", attached);\n this.attached = true;\n this.resize();\n _add(\"resize\", listener);\n _add(\"detach\", detached);\n };\n detached = ()=>{\n this.attached = false;\n _remove(\"resize\", listener);\n this._stop();\n this._resize(0, 0);\n _add(\"attach\", attached);\n };\n if (platform.isAttached(this.canvas)) attached();\n else detached();\n }\n unbindEvents() {\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this._listeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this._responsiveListeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? \"set\" : \"remove\";\n let meta, item, i, ilen;\n if (mode === \"dataset\") {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller[\"_\" + prefix + \"DatasetHoverStyle\"]();\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) controller[prefix + \"HoverStyle\"](item.element, item.datasetIndex, item.index);\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({ datasetIndex: datasetIndex, index: index })=>{\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) throw new Error(\"No dataset found at index \" + datasetIndex);\n return {\n datasetIndex: datasetIndex,\n element: meta.data[index],\n index: index\n };\n });\n const changed = !(0, $02b6f511cc6c123c$export$995eb9fca571757)(active, lastActive);\n if (changed) {\n this._active = active;\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter((p)=>p.plugin.id === pluginId).length === 1;\n }\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n if (deactivated.length) this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n if (activated.length && hoverOptions.mode) this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay: replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin)=>(plugin.options.events || this.options.events).includes(e.native.type);\n if (this.notifyPlugins(\"beforeEvent\", args, eventFilter) === false) return;\n const changed = this._handleEvent(e, replay, args.inChartArea);\n args.cancelable = false;\n this.notifyPlugins(\"afterEvent\", args, eventFilter);\n if (changed || args.changed) this.render();\n return this;\n }\n _handleEvent(e, replay, inChartArea) {\n const { _active: lastActive = [], options: options } = this;\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = (0, $02b6f511cc6c123c$export$f38c853ae54ed474)(e);\n const lastEvent = $77dc20320068f1ee$var$determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n if (inChartArea) {\n this._lastEvent = null;\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(options.onHover, [\n e,\n active,\n this\n ], this);\n if (isClick) (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(options.onClick, [\n e,\n active,\n this\n ], this);\n }\n const changed = !(0, $02b6f511cc6c123c$export$995eb9fca571757)(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n this._lastEvent = lastEvent;\n return changed;\n }\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === \"mouseout\") return [];\n if (!inChartArea) return lastActive;\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n constructor(item, userConfig){\n const config = this.config = new $77dc20320068f1ee$var$Config(userConfig);\n const initialCanvas = $77dc20320068f1ee$var$getCanvas(item);\n const existingChart = $77dc20320068f1ee$var$getChart(initialCanvas);\n if (existingChart) throw new Error(\"Canvas is already in use. Chart with ID '\" + existingChart.id + \"'\" + \" must be destroyed before the canvas with ID '\" + existingChart.canvas.id + \"' can be reused.\");\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n this.platform = new (config.platform || $77dc20320068f1ee$export$72cd9e67b1b784f9(initialCanvas))();\n this.platform.updateConfig(config);\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n this.id = (0, $02b6f511cc6c123c$export$2219238a014317b0)();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new $77dc20320068f1ee$var$PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = (0, $02b6f511cc6c123c$export$4c3d22f3d993c33f)((mode)=>this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n $77dc20320068f1ee$var$instances[this.id] = this;\n if (!context || !canvas) {\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n $77dc20320068f1ee$export$a424a0aa8f687495.listen(this, \"complete\", $77dc20320068f1ee$var$onAnimationsComplete);\n $77dc20320068f1ee$export$a424a0aa8f687495.listen(this, \"progress\", $77dc20320068f1ee$var$onAnimationProgress);\n this._initialize();\n if (this.attached) this.update();\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$acaa6426d77a227e, \"defaults\", (0, $02b6f511cc6c123c$export$4368d992c4eafac0));\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$acaa6426d77a227e, \"instances\", $77dc20320068f1ee$var$instances);\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$acaa6426d77a227e, \"overrides\", (0, $02b6f511cc6c123c$export$6559d589eb85fbb6));\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$acaa6426d77a227e, \"registry\", $77dc20320068f1ee$export$4bb7493d241fd8a5);\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$acaa6426d77a227e, \"version\", $77dc20320068f1ee$var$version);\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$acaa6426d77a227e, \"getChart\", $77dc20320068f1ee$var$getChart);\nfunction $77dc20320068f1ee$var$invalidatePlugins() {\n return (0, $02b6f511cc6c123c$export$d66501df72047452)($77dc20320068f1ee$export$acaa6426d77a227e.instances, (chart)=>chart._plugins.invalidate());\n}\nfunction $77dc20320068f1ee$var$clipArc(ctx, element, endAngle) {\n const { startAngle: startAngle, pixelMargin: pixelMargin, x: x, y: y, outerRadius: outerRadius, innerRadius: innerRadius } = element;\n let angleMargin = pixelMargin / outerRadius;\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else ctx.arc(x, y, pixelMargin, endAngle + (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd), startAngle - (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd));\n ctx.closePath();\n ctx.clip();\n}\nfunction $77dc20320068f1ee$var$toRadiusCorners(value) {\n return (0, $02b6f511cc6c123c$export$21579262ef46735b)(value, [\n \"outerStart\",\n \"outerEnd\",\n \"innerStart\",\n \"innerEnd\"\n ]);\n}\n/**\n * Parse border radius from the provided options\n */ function $77dc20320068f1ee$var$parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n const o = $77dc20320068f1ee$var$toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val)=>{\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(o.innerStart, 0, innerLimit),\n innerEnd: (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(o.innerEnd, 0, innerLimit)\n };\n}\n/**\n * Convert (r, 𝜃) to (x, y)\n */ function $77dc20320068f1ee$var$rThetaToXY(r, theta, x, y) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta)\n };\n}\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */ function $77dc20320068f1ee$var$pathArc(ctx, element, offset, spacing, end, circular) {\n const { x: x, y: y, startAngle: start, pixelMargin: pixelMargin, innerRadius: innerR } = element;\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n let spacingOffset = 0;\n const alpha = end - start;\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n const beta = Math.max(0.001, alpha * outerRadius - offset / (0, $02b6f511cc6c123c$export$56c0d5a1e737357d)) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const { outerStart: outerStart, outerEnd: outerEnd, innerStart: innerStart, innerEnd: innerEnd } = $77dc20320068f1ee$var$parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n ctx.beginPath();\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = $77dc20320068f1ee$var$rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd));\n }\n // The line from point 3 to point 4\n const p4 = $77dc20320068f1ee$var$rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = $77dc20320068f1ee$var$rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd), innerEndAdjustedAngle + Math.PI);\n }\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2;\n ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true);\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = $77dc20320068f1ee$var$rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd));\n }\n // The line from point 7 to point 8\n const p8 = $77dc20320068f1ee$var$rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = $77dc20320068f1ee$var$rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd), outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n ctx.closePath();\n}\nfunction $77dc20320068f1ee$var$drawArc(ctx, element, offset, spacing, circular) {\n const { fullCircles: fullCircles, startAngle: startAngle, circumference: circumference } = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n $77dc20320068f1ee$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i)ctx.fill();\n if (!isNaN(circumference)) endAngle = startAngle + (circumference % (0, $02b6f511cc6c123c$export$971d5caa766a69d7) || (0, $02b6f511cc6c123c$export$971d5caa766a69d7));\n }\n $77dc20320068f1ee$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\nfunction $77dc20320068f1ee$var$drawBorder(ctx, element, offset, spacing, circular) {\n const { fullCircles: fullCircles, startAngle: startAngle, circumference: circumference, options: options } = element;\n const { borderWidth: borderWidth, borderJoinStyle: borderJoinStyle, borderDash: borderDash, borderDashOffset: borderDashOffset } = options;\n const inner = options.borderAlign === \"inner\";\n if (!borderWidth) return;\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || \"round\";\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || \"bevel\";\n }\n let endAngle = element.endAngle;\n if (fullCircles) {\n $77dc20320068f1ee$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i)ctx.stroke();\n if (!isNaN(circumference)) endAngle = startAngle + (circumference % (0, $02b6f511cc6c123c$export$971d5caa766a69d7) || (0, $02b6f511cc6c123c$export$971d5caa766a69d7));\n }\n if (inner) $77dc20320068f1ee$var$clipArc(ctx, element, endAngle);\n if (!fullCircles) {\n $77dc20320068f1ee$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\nclass $77dc20320068f1ee$export$d48203c759d6a1fc extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n inRange(chartX, chartY, useFinalPosition) {\n const point = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n const { angle: angle, distance: distance } = (0, $02b6f511cc6c123c$export$96f57966bedc81b4)(point, {\n x: chartX,\n y: chartY\n });\n const { startAngle: startAngle, endAngle: endAngle, innerRadius: innerRadius, outerRadius: outerRadius, circumference: circumference } = this.getProps([\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\",\n \"circumference\"\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= (0, $02b6f511cc6c123c$export$971d5caa766a69d7) || (0, $02b6f511cc6c123c$export$ffb5f4729a158638)(angle, startAngle, endAngle);\n const withinRadius = (0, $02b6f511cc6c123c$export$3b513254972cfc9c)(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n return betweenAngles && withinRadius;\n }\n getCenterPoint(useFinalPosition) {\n const { x: x, y: y, startAngle: startAngle, endAngle: endAngle, innerRadius: innerRadius, outerRadius: outerRadius } = this.getProps([\n \"x\",\n \"y\",\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\"\n ], useFinalPosition);\n const { offset: offset, spacing: spacing } = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n tooltipPosition(useFinalPosition) {\n return this.getCenterPoint(useFinalPosition);\n }\n draw(ctx) {\n const { options: options, circumference: circumference } = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = options.borderAlign === \"inner\" ? 0.33 : 0;\n this.fullCircles = circumference > (0, $02b6f511cc6c123c$export$971d5caa766a69d7) ? Math.floor(circumference / (0, $02b6f511cc6c123c$export$971d5caa766a69d7)) : 0;\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) return;\n ctx.save();\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min((0, $02b6f511cc6c123c$export$56c0d5a1e737357d), circumference || 0));\n const radiusOffset = offset * fix;\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n $77dc20320068f1ee$var$drawArc(ctx, this, radiusOffset, spacing, circular);\n $77dc20320068f1ee$var$drawBorder(ctx, this, radiusOffset, spacing, circular);\n ctx.restore();\n }\n constructor(cfg){\n super();\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"circumference\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"endAngle\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"fullCircles\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"innerRadius\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"outerRadius\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"pixelMargin\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"startAngle\", void 0);\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$d48203c759d6a1fc, \"id\", \"arc\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$d48203c759d6a1fc, \"defaults\", {\n borderAlign: \"center\",\n borderColor: \"#fff\",\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$d48203c759d6a1fc, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\"\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$d48203c759d6a1fc, \"descriptors\", {\n _scriptable: true,\n _indexable: (name)=>name !== \"borderDash\"\n});\nfunction $77dc20320068f1ee$var$setStyle(ctx, options, style = options) {\n ctx.lineCap = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash((0, $02b6f511cc6c123c$export$90a7f3efeed30595)(style.borderDash, options.borderDash));\n ctx.lineDashOffset = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(style.borderColor, options.borderColor);\n}\nfunction $77dc20320068f1ee$var$lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\nfunction $77dc20320068f1ee$var$getLineMethod(options) {\n if (options.stepped) return 0, $02b6f511cc6c123c$export$d24c54395ce0c509;\n if (options.tension || options.cubicInterpolationMode === \"monotone\") return 0, $02b6f511cc6c123c$export$6554612db691658e;\n return $77dc20320068f1ee$var$lineTo;\n}\nfunction $77dc20320068f1ee$var$pathVars(points, segment, params = {}) {\n const count = points.length;\n const { start: paramsStart = 0, end: paramsEnd = count - 1 } = params;\n const { start: segmentStart, end: segmentEnd } = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n return {\n count: count,\n start: start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\nfunction $77dc20320068f1ee$var$pathSegment(ctx, line, segment, params) {\n const { points: points, options: options } = line;\n const { count: count, start: start, loop: loop, ilen: ilen } = $77dc20320068f1ee$var$pathVars(points, segment, params);\n const lineMethod = $77dc20320068f1ee$var$getLineMethod(options);\n let { move: move = true, reverse: reverse } = params || {};\n let i, point, prev;\n for(i = 0; i <= ilen; ++i){\n point = points[(start + (reverse ? ilen - i : i)) % count];\n if (point.skip) continue;\n else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else lineMethod(ctx, prev, point, reverse, options.stepped);\n prev = point;\n }\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n return !!loop;\n}\nfunction $77dc20320068f1ee$var$fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const { count: count, start: start, ilen: ilen } = $77dc20320068f1ee$var$pathVars(points, segment, params);\n const { move: move = true, reverse: reverse } = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n const pointIndex = (index)=>(start + (reverse ? ilen - index : index)) % count;\n const drawX = ()=>{\n if (minY !== maxY) {\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n ctx.lineTo(avgX, lastY);\n }\n };\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n for(i = 0; i <= ilen; ++i){\n point = points[pointIndex(i)];\n if (point.skip) continue;\n const x = point.x;\n const y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) minY = y;\n else if (y > maxY) maxY = y;\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n ctx.lineTo(x, y);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n lastY = y;\n }\n drawX();\n}\nfunction $77dc20320068f1ee$var$_getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== \"monotone\" && !opts.stepped && !borderDash;\n return useFastPath ? $77dc20320068f1ee$var$fastPathSegment : $77dc20320068f1ee$var$pathSegment;\n}\nfunction $77dc20320068f1ee$var$_getInterpolationMethod(options) {\n if (options.stepped) return 0, $02b6f511cc6c123c$export$7a38258bbe170828;\n if (options.tension || options.cubicInterpolationMode === \"monotone\") return 0, $02b6f511cc6c123c$export$2f6ca3d3b1f80bf5;\n return 0, $02b6f511cc6c123c$export$8a5498727ef6be21;\n}\nfunction $77dc20320068f1ee$var$strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) path.closePath();\n }\n $77dc20320068f1ee$var$setStyle(ctx, line.options);\n ctx.stroke(path);\n}\nfunction $77dc20320068f1ee$var$strokePathDirect(ctx, line, start, count) {\n const { segments: segments, options: options } = line;\n const segmentMethod = $77dc20320068f1ee$var$_getSegmentMethod(line);\n for (const segment of segments){\n $77dc20320068f1ee$var$setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {\n start: start,\n end: start + count - 1\n })) ctx.closePath();\n ctx.stroke();\n }\n}\nconst $77dc20320068f1ee$var$usePath2D = typeof Path2D === \"function\";\nfunction $77dc20320068f1ee$var$draw(ctx, line, start, count) {\n if ($77dc20320068f1ee$var$usePath2D && !line.options.segment) $77dc20320068f1ee$var$strokePathWithCache(ctx, line, start, count);\n else $77dc20320068f1ee$var$strokePathDirect(ctx, line, start, count);\n}\nclass $77dc20320068f1ee$export$55e463fa7bcd3469 extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === \"monotone\") && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n (0, $02b6f511cc6c123c$export$ab83b03e4111b1d0)(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n get points() {\n return this._points;\n }\n get segments() {\n return this._segments || (this._segments = (0, $02b6f511cc6c123c$export$1a82df3d29112e01)(this, this.options.segment));\n }\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = (0, $02b6f511cc6c123c$export$306ddfe3a8403e2)(this, {\n property: property,\n start: value,\n end: value\n });\n if (!segments.length) return;\n const result = [];\n const _interpolate = $77dc20320068f1ee$var$_getInterpolationMethod(options);\n let i, ilen;\n for(i = 0, ilen = segments.length; i < ilen; ++i){\n const { start: start, end: end } = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n pathSegment(ctx, segment, params) {\n const segmentMethod = $77dc20320068f1ee$var$_getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = $77dc20320068f1ee$var$_getSegmentMethod(this);\n let loop = this._loop;\n start = start || 0;\n count = count || this.points.length - start;\n for (const segment of segments)loop &= segmentMethod(ctx, this, segment, {\n start: start,\n end: start + count - 1\n });\n return !!loop;\n }\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n if (points.length && options.borderWidth) {\n ctx.save();\n $77dc20320068f1ee$var$draw(ctx, this, start, count);\n ctx.restore();\n }\n if (this.animated) {\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n constructor(cfg){\n super();\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$55e463fa7bcd3469, \"id\", \"line\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$55e463fa7bcd3469, \"defaults\", {\n borderCapStyle: \"butt\",\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: \"miter\",\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: \"default\",\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$55e463fa7bcd3469, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\",\n borderColor: \"borderColor\"\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$55e463fa7bcd3469, \"descriptors\", {\n _scriptable: true,\n _indexable: (name)=>name !== \"borderDash\" && name !== \"fill\"\n});\nfunction $77dc20320068f1ee$var$inRange$1(el, pos, axis, useFinalPosition) {\n const options = el.options;\n const { [axis]: value } = el.getProps([\n axis\n ], useFinalPosition);\n return Math.abs(pos - value) < options.radius + options.hitRadius;\n}\nclass $77dc20320068f1ee$export$bd159b522b230b7a extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n inRange(mouseX, mouseY, useFinalPosition) {\n const options = this.options;\n const { x: x, y: y } = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2);\n }\n inXRange(mouseX, useFinalPosition) {\n return $77dc20320068f1ee$var$inRange$1(this, mouseX, \"x\", useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return $77dc20320068f1ee$var$inRange$1(this, mouseY, \"y\", useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x: x, y: y } = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n return {\n x: x,\n y: y\n };\n }\n size(options) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n draw(ctx, area) {\n const options = this.options;\n if (this.skip || options.radius < 0.1 || !(0, $02b6f511cc6c123c$export$e7094788287c5e9b)(this, area, this.size(options) / 2)) return;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n (0, $02b6f511cc6c123c$export$493d36ec626b6698)(ctx, options, this.x, this.y);\n }\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n constructor(cfg){\n super();\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"parsed\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"skip\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"stop\", void 0);\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$bd159b522b230b7a, \"id\", \"point\");\n/**\n * @type {any}\n */ (0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$bd159b522b230b7a, \"defaults\", {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: \"circle\",\n radius: 3,\n rotation: 0\n});\n/**\n * @type {any}\n */ (0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$bd159b522b230b7a, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\",\n borderColor: \"borderColor\"\n});\nfunction $77dc20320068f1ee$var$getBarBounds(bar, useFinalPosition) {\n const { x: x, y: y, base: base, width: width, height: height } = bar.getProps([\n \"x\",\n \"y\",\n \"base\",\n \"width\",\n \"height\"\n ], useFinalPosition);\n let left, right, top, bottom, half;\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n return {\n left: left,\n top: top,\n right: right,\n bottom: bottom\n };\n}\nfunction $77dc20320068f1ee$var$skipOrLimit(skip, value, min, max) {\n return skip ? 0 : (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(value, min, max);\n}\nfunction $77dc20320068f1ee$var$parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = (0, $02b6f511cc6c123c$export$d66dc83d8cfc8dd)(value);\n return {\n t: $77dc20320068f1ee$var$skipOrLimit(skip.top, o.top, 0, maxH),\n r: $77dc20320068f1ee$var$skipOrLimit(skip.right, o.right, 0, maxW),\n b: $77dc20320068f1ee$var$skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: $77dc20320068f1ee$var$skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\nfunction $77dc20320068f1ee$var$parseBorderRadius(bar, maxW, maxH) {\n const { enableBorderRadius: enableBorderRadius } = bar.getProps([\n \"enableBorderRadius\"\n ]);\n const value = bar.options.borderRadius;\n const o = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n const enableBorder = enableBorderRadius || (0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(value);\n return {\n topLeft: $77dc20320068f1ee$var$skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: $77dc20320068f1ee$var$skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: $77dc20320068f1ee$var$skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: $77dc20320068f1ee$var$skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\nfunction $77dc20320068f1ee$var$boundingRects(bar) {\n const bounds = $77dc20320068f1ee$var$getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = $77dc20320068f1ee$var$parseBorderWidth(bar, width / 2, height / 2);\n const radius = $77dc20320068f1ee$var$parseBorderRadius(bar, width / 2, height / 2);\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius: radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))\n }\n }\n };\n}\nfunction $77dc20320068f1ee$var$inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && $77dc20320068f1ee$var$getBarBounds(bar, useFinalPosition);\n return bounds && (skipX || (0, $02b6f511cc6c123c$export$3b513254972cfc9c)(x, bounds.left, bounds.right)) && (skipY || (0, $02b6f511cc6c123c$export$3b513254972cfc9c)(y, bounds.top, bounds.bottom));\n}\nfunction $77dc20320068f1ee$var$hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\nfunction $77dc20320068f1ee$var$addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction $77dc20320068f1ee$var$inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\nclass $77dc20320068f1ee$export$a16ed71bf4b07672 extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n draw(ctx) {\n const { inflateAmount: inflateAmount, options: { borderColor: borderColor, backgroundColor: backgroundColor } } = this;\n const { inner: inner, outer: outer } = $77dc20320068f1ee$var$boundingRects(this);\n const addRectPath = $77dc20320068f1ee$var$hasRadius(outer.radius) ? (0, $02b6f511cc6c123c$export$1fbe638ecf81657e) : $77dc20320068f1ee$var$addNormalRectPath;\n ctx.save();\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, $77dc20320068f1ee$var$inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, $77dc20320068f1ee$var$inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill(\"evenodd\");\n }\n ctx.beginPath();\n addRectPath(ctx, $77dc20320068f1ee$var$inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n return $77dc20320068f1ee$var$inRange(this, mouseX, mouseY, useFinalPosition);\n }\n inXRange(mouseX, useFinalPosition) {\n return $77dc20320068f1ee$var$inRange(this, mouseX, null, useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return $77dc20320068f1ee$var$inRange(this, null, mouseY, useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x: x, y: y, base: base, horizontal: horizontal } = this.getProps([\n \"x\",\n \"y\",\n \"base\",\n \"horizontal\"\n ], useFinalPosition);\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n getRange(axis) {\n return axis === \"x\" ? this.width / 2 : this.height / 2;\n }\n constructor(cfg){\n super();\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$a16ed71bf4b07672, \"id\", \"bar\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$a16ed71bf4b07672, \"defaults\", {\n borderSkipped: \"start\",\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: \"auto\",\n pointStyle: undefined\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$a16ed71bf4b07672, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\",\n borderColor: \"borderColor\"\n});\nvar $77dc20320068f1ee$export$7a5d735b2ab6389d = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n ArcElement: $77dc20320068f1ee$export$d48203c759d6a1fc,\n BarElement: $77dc20320068f1ee$export$a16ed71bf4b07672,\n LineElement: $77dc20320068f1ee$export$55e463fa7bcd3469,\n PointElement: $77dc20320068f1ee$export$bd159b522b230b7a\n});\nconst $77dc20320068f1ee$var$BORDER_COLORS = [\n \"rgb(54, 162, 235)\",\n \"rgb(255, 99, 132)\",\n \"rgb(255, 159, 64)\",\n \"rgb(255, 205, 86)\",\n \"rgb(75, 192, 192)\",\n \"rgb(153, 102, 255)\",\n \"rgb(201, 203, 207)\" // grey\n];\n// Border colors with 50% transparency\nconst $77dc20320068f1ee$var$BACKGROUND_COLORS = /* #__PURE__ */ $77dc20320068f1ee$var$BORDER_COLORS.map((color)=>color.replace(\"rgb(\", \"rgba(\").replace(\")\", \", 0.5)\"));\nfunction $77dc20320068f1ee$var$getBorderColor(i) {\n return $77dc20320068f1ee$var$BORDER_COLORS[i % $77dc20320068f1ee$var$BORDER_COLORS.length];\n}\nfunction $77dc20320068f1ee$var$getBackgroundColor(i) {\n return $77dc20320068f1ee$var$BACKGROUND_COLORS[i % $77dc20320068f1ee$var$BACKGROUND_COLORS.length];\n}\nfunction $77dc20320068f1ee$var$colorizeDefaultDataset(dataset, i) {\n dataset.borderColor = $77dc20320068f1ee$var$getBorderColor(i);\n dataset.backgroundColor = $77dc20320068f1ee$var$getBackgroundColor(i);\n return ++i;\n}\nfunction $77dc20320068f1ee$var$colorizeDoughnutDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>$77dc20320068f1ee$var$getBorderColor(i++));\n return i;\n}\nfunction $77dc20320068f1ee$var$colorizePolarAreaDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>$77dc20320068f1ee$var$getBackgroundColor(i++));\n return i;\n}\nfunction $77dc20320068f1ee$var$getColorizer(chart) {\n let i = 0;\n return (dataset, datasetIndex)=>{\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n if (controller instanceof $77dc20320068f1ee$export$e04603e7d8b77172) i = $77dc20320068f1ee$var$colorizeDoughnutDataset(dataset, i);\n else if (controller instanceof $77dc20320068f1ee$export$2a270b3a0d973c85) i = $77dc20320068f1ee$var$colorizePolarAreaDataset(dataset, i);\n else if (controller) i = $77dc20320068f1ee$var$colorizeDefaultDataset(dataset, i);\n };\n}\nfunction $77dc20320068f1ee$var$containsColorsDefinitions(descriptors) {\n let k;\n for(k in descriptors){\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) return true;\n }\n return false;\n}\nfunction $77dc20320068f1ee$var$containsColorsDefinition(descriptor) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\nvar $77dc20320068f1ee$export$c537fa0d021d010b = {\n id: \"colors\",\n defaults: {\n enabled: true,\n forceOverride: false\n },\n beforeLayout (chart, _args, options) {\n if (!options.enabled) return;\n const { data: { datasets: datasets }, options: chartOptions } = chart.config;\n const { elements: elements } = chartOptions;\n if (!options.forceOverride && ($77dc20320068f1ee$var$containsColorsDefinitions(datasets) || $77dc20320068f1ee$var$containsColorsDefinition(chartOptions) || elements && $77dc20320068f1ee$var$containsColorsDefinitions(elements))) return;\n const colorizer = $77dc20320068f1ee$var$getColorizer(chart);\n datasets.forEach(colorizer);\n }\n};\nfunction $77dc20320068f1ee$var$lttbDecimation(data, start, count, availableWidth, options) {\n const samples = options.samples || availableWidth;\n if (samples >= count) return data.slice(start, start + count);\n const decimated = [];\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n decimated[sampledIndex++] = data[a];\n for(i = 0; i < samples - 2; i++){\n let avgX = 0;\n let avgY = 0;\n let j;\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n for(j = avgRangeStart; j < avgRangeEnd; j++){\n avgX += data[j].x;\n avgY += data[j].y;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const { x: pointAx, y: pointAy } = data[a];\n maxArea = area = -1;\n for(j = rangeOffs; j < rangeTo; j++){\n area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy));\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n decimated[sampledIndex++] = data[endIndex];\n return decimated;\n}\nfunction $77dc20320068f1ee$var$minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n for(i = start; i < start + count; ++i){\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n const lastIndex = i - 1;\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(minIndex) && !(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(maxIndex)) {\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) decimated.push({\n ...data[intermediateIndex1],\n x: avgX\n });\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n if (i > 0 && lastIndex !== startIndex) decimated.push(data[lastIndex]);\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n return decimated;\n}\nfunction $77dc20320068f1ee$var$cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, \"data\", {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data\n });\n }\n}\nfunction $77dc20320068f1ee$var$cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset)=>{\n $77dc20320068f1ee$var$cleanDecimatedDataset(dataset);\n });\n}\nfunction $77dc20320068f1ee$var$getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n let start = 0;\n let count;\n const { iScale: iScale } = meta;\n const { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = iScale.getUserBounds();\n if (minDefined) start = (0, $02b6f511cc6c123c$export$25ce5a424b770e84)((0, $02b6f511cc6c123c$export$ef35774e6d314e91)(points, iScale.axis, min).lo, 0, pointCount - 1);\n if (maxDefined) count = (0, $02b6f511cc6c123c$export$25ce5a424b770e84)((0, $02b6f511cc6c123c$export$ef35774e6d314e91)(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n else count = pointCount - start;\n return {\n start: start,\n count: count\n };\n}\nvar $77dc20320068f1ee$export$be17f937e9aa7533 = {\n id: \"decimation\",\n defaults: {\n algorithm: \"min-max\",\n enabled: false\n },\n beforeElementsUpdate: (chart, args, options)=>{\n if (!options.enabled) {\n $77dc20320068f1ee$var$cleanDecimatedData(chart);\n return;\n }\n const availableWidth = chart.width;\n chart.data.datasets.forEach((dataset, datasetIndex)=>{\n const { _data: _data, indexAxis: indexAxis } = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n if ((0, $02b6f511cc6c123c$export$407448d2b89b1813)([\n indexAxis,\n chart.options.indexAxis\n ]) === \"y\") return;\n if (!meta.controller.supportsDecimation) return;\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== \"linear\" && xAxis.type !== \"time\") return;\n if (chart.options.parsing) return;\n let { start: start, count: count } = $77dc20320068f1ee$var$getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n $77dc20320068f1ee$var$cleanDecimatedDataset(dataset);\n return;\n }\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(_data)) {\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, \"data\", {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n let decimated;\n switch(options.algorithm){\n case \"lttb\":\n decimated = $77dc20320068f1ee$var$lttbDecimation(data, start, count, availableWidth, options);\n break;\n case \"min-max\":\n decimated = $77dc20320068f1ee$var$minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n dataset._decimated = decimated;\n });\n },\n destroy (chart) {\n $77dc20320068f1ee$var$cleanDecimatedData(chart);\n }\n};\nfunction $77dc20320068f1ee$var$_segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n for (const segment of segments){\n let { start: start, end: end } = segment;\n end = $77dc20320068f1ee$var$_findSegmentEnd(start, end, points);\n const bounds = $77dc20320068f1ee$var$_getBounds(property, points[start], points[end], segment.loop);\n if (!target.segments) {\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n const targetSegments = (0, $02b6f511cc6c123c$export$306ddfe3a8403e2)(target, bounds);\n for (const tgt of targetSegments){\n const subBounds = $77dc20320068f1ee$var$_getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = (0, $02b6f511cc6c123c$export$9fa96a7d116ea3ce)(segment, points, subBounds);\n for (const fillSource of fillSources)parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: $77dc20320068f1ee$var$_getEdge(bounds, subBounds, \"start\", Math.max)\n },\n end: {\n [property]: $77dc20320068f1ee$var$_getEdge(bounds, subBounds, \"end\", Math.min)\n }\n });\n }\n }\n return parts;\n}\nfunction $77dc20320068f1ee$var$_getBounds(property, first, last, loop) {\n if (loop) return;\n let start = first[property];\n let end = last[property];\n if (property === \"angle\") {\n start = (0, $02b6f511cc6c123c$export$28f7fcd39efa255)(start);\n end = (0, $02b6f511cc6c123c$export$28f7fcd39efa255)(end);\n }\n return {\n property: property,\n start: start,\n end: end\n };\n}\nfunction $77dc20320068f1ee$var$_pointsFromSegments(boundary, line) {\n const { x: x = null, y: y = null } = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({ start: start, end: end })=>{\n end = $77dc20320068f1ee$var$_findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({\n x: first.x,\n y: y\n });\n points.push({\n x: last.x,\n y: y\n });\n } else if (x !== null) {\n points.push({\n x: x,\n y: first.y\n });\n points.push({\n x: x,\n y: last.y\n });\n }\n });\n return points;\n}\nfunction $77dc20320068f1ee$var$_findSegmentEnd(start, end, points) {\n for(; end > start; end--){\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) break;\n }\n return end;\n}\nfunction $77dc20320068f1ee$var$_getEdge(a, b, prop, fn) {\n if (a && b) return fn(a[prop], b[prop]);\n return a ? a[prop] : b ? b[prop] : 0;\n}\nfunction $77dc20320068f1ee$var$_createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n if ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(boundary)) {\n _loop = true;\n points = boundary;\n } else points = $77dc20320068f1ee$var$_pointsFromSegments(boundary, line);\n return points.length ? new $77dc20320068f1ee$export$55e463fa7bcd3469({\n points: points,\n options: {\n tension: 0\n },\n _loop: _loop,\n _fullLoop: _loop\n }) : null;\n}\nfunction $77dc20320068f1ee$var$_shouldApplyFill(source) {\n return source && source.fill !== false;\n}\nfunction $77dc20320068f1ee$var$_resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [\n index\n ];\n let target;\n if (!propagate) return fill;\n while(fill !== false && visited.indexOf(fill) === -1){\n if (!(0, $02b6f511cc6c123c$export$39b482c5e57630a8)(fill)) return fill;\n target = sources[fill];\n if (!target) return false;\n if (target.visible) return fill;\n visited.push(fill);\n fill = target.fill;\n }\n return false;\n}\nfunction $77dc20320068f1ee$var$_decodeFill(line, index, count) {\n const fill = $77dc20320068f1ee$var$parseFillOption(line);\n if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(fill)) return isNaN(fill.value) ? false : fill;\n let target = parseFloat(fill);\n if ((0, $02b6f511cc6c123c$export$39b482c5e57630a8)(target) && Math.floor(target) === target) return $77dc20320068f1ee$var$decodeTargetIndex(fill[0], index, target, count);\n return [\n \"origin\",\n \"start\",\n \"end\",\n \"stack\",\n \"shape\"\n ].indexOf(fill) >= 0 && fill;\n}\nfunction $77dc20320068f1ee$var$decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === \"-\" || firstCh === \"+\") target = index + target;\n if (target === index || target < 0 || target >= count) return false;\n return target;\n}\nfunction $77dc20320068f1ee$var$_getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === \"start\") pixel = scale.bottom;\n else if (fill === \"end\") pixel = scale.top;\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(fill)) pixel = scale.getPixelForValue(fill.value);\n else if (scale.getBasePixel) pixel = scale.getBasePixel();\n return pixel;\n}\nfunction $77dc20320068f1ee$var$_getTargetValue(fill, scale, startValue) {\n let value;\n if (fill === \"start\") value = startValue;\n else if (fill === \"end\") value = scale.options.reverse ? scale.min : scale.max;\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(fill)) value = fill.value;\n else value = scale.getBaseValue();\n return value;\n}\nfunction $77dc20320068f1ee$var$parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(fillOption && fillOption.target, fillOption);\n if (fill === undefined) fill = !!options.backgroundColor;\n if (fill === false || fill === null) return false;\n if (fill === true) return \"origin\";\n return fill;\n}\nfunction $77dc20320068f1ee$var$_buildStackLine(source) {\n const { scale: scale, index: index, line: line } = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = $77dc20320068f1ee$var$getLinesBelow(scale, index);\n linesBelow.push($77dc20320068f1ee$var$_createBoundaryLine({\n x: null,\n y: scale.bottom\n }, line));\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n for(let j = segment.start; j <= segment.end; j++)$77dc20320068f1ee$var$addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n return new $77dc20320068f1ee$export$55e463fa7bcd3469({\n points: points,\n options: {}\n });\n}\nfunction $77dc20320068f1ee$var$getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas(\"line\");\n for(let i = 0; i < metas.length; i++){\n const meta = metas[i];\n if (meta.index === index) break;\n if (!meta.hidden) below.unshift(meta.dataset);\n }\n return below;\n}\nfunction $77dc20320068f1ee$var$addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for(let j = 0; j < linesBelow.length; j++){\n const line = linesBelow[j];\n const { first: first, last: last, point: point } = $77dc20320068f1ee$var$findPoint(line, sourcePoint, \"x\");\n if (!point || first && last) continue;\n if (first) postponed.unshift(point);\n else {\n points.push(point);\n if (!last) break;\n }\n }\n points.push(...postponed);\n}\nfunction $77dc20320068f1ee$var$findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) return {};\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if ((0, $02b6f511cc6c123c$export$3b513254972cfc9c)(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {\n first: first,\n last: last,\n point: point\n };\n}\nclass $77dc20320068f1ee$var$simpleArc {\n pathSegment(ctx, bounds, opts) {\n const { x: x, y: y, radius: radius } = this;\n bounds = bounds || {\n start: 0,\n end: (0, $02b6f511cc6c123c$export$971d5caa766a69d7)\n };\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n interpolate(point) {\n const { x: x, y: y, radius: radius } = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle: angle\n };\n }\n constructor(opts){\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n}\nfunction $77dc20320068f1ee$var$_getTarget(source) {\n const { chart: chart, fill: fill, line: line } = source;\n if ((0, $02b6f511cc6c123c$export$39b482c5e57630a8)(fill)) return $77dc20320068f1ee$var$getLineByIndex(chart, fill);\n if (fill === \"stack\") return $77dc20320068f1ee$var$_buildStackLine(source);\n if (fill === \"shape\") return true;\n const boundary = $77dc20320068f1ee$var$computeBoundary(source);\n if (boundary instanceof $77dc20320068f1ee$var$simpleArc) return boundary;\n return $77dc20320068f1ee$var$_createBoundaryLine(boundary, line);\n}\nfunction $77dc20320068f1ee$var$getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\nfunction $77dc20320068f1ee$var$computeBoundary(source) {\n const scale = source.scale || {};\n if (scale.getPointPositionForValue) return $77dc20320068f1ee$var$computeCircularBoundary(source);\n return $77dc20320068f1ee$var$computeLinearBoundary(source);\n}\nfunction $77dc20320068f1ee$var$computeLinearBoundary(source) {\n const { scale: scale = {}, fill: fill } = source;\n const pixel = $77dc20320068f1ee$var$_getTargetPixel(fill, scale);\n if ((0, $02b6f511cc6c123c$export$39b482c5e57630a8)(pixel)) {\n const horizontal = scale.isHorizontal();\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n return null;\n}\nfunction $77dc20320068f1ee$var$computeCircularBoundary(source) {\n const { scale: scale, fill: fill } = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = $77dc20320068f1ee$var$_getTargetValue(fill, scale, start);\n const target = [];\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new $77dc20320068f1ee$var$simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n for(let i = 0; i < length; ++i)target.push(scale.getPointPositionForValue(i, value));\n return target;\n}\nfunction $77dc20320068f1ee$var$_drawfill(ctx, source, area) {\n const target = $77dc20320068f1ee$var$_getTarget(source);\n const { line: line, scale: scale, axis: axis } = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const { above: above = color, below: below = color } = fillOption || {};\n if (target && line.points.length) {\n (0, $02b6f511cc6c123c$export$8743009a87fcb00f)(ctx, area);\n $77dc20320068f1ee$var$doFill(ctx, {\n line: line,\n target: target,\n above: above,\n below: below,\n area: area,\n scale: scale,\n axis: axis\n });\n (0, $02b6f511cc6c123c$export$3d8c2f653ac9d0b9)(ctx);\n }\n}\nfunction $77dc20320068f1ee$var$doFill(ctx, cfg) {\n const { line: line, target: target, above: above, below: below, area: area, scale: scale } = cfg;\n const property = line._loop ? \"angle\" : cfg.axis;\n ctx.save();\n if (property === \"x\" && below !== above) {\n $77dc20320068f1ee$var$clipVertical(ctx, target, area.top);\n $77dc20320068f1ee$var$fill(ctx, {\n line: line,\n target: target,\n color: above,\n scale: scale,\n property: property\n });\n ctx.restore();\n ctx.save();\n $77dc20320068f1ee$var$clipVertical(ctx, target, area.bottom);\n }\n $77dc20320068f1ee$var$fill(ctx, {\n line: line,\n target: target,\n color: below,\n scale: scale,\n property: property\n });\n ctx.restore();\n}\nfunction $77dc20320068f1ee$var$clipVertical(ctx, target, clipY) {\n const { segments: segments, points: points } = target;\n let first = true;\n let lineLoop = false;\n ctx.beginPath();\n for (const segment of segments){\n const { start: start, end: end } = segment;\n const firstPoint = points[start];\n const lastPoint = points[$77dc20320068f1ee$var$_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {\n move: lineLoop\n });\n if (lineLoop) ctx.closePath();\n else ctx.lineTo(lastPoint.x, clipY);\n }\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\nfunction $77dc20320068f1ee$var$fill(ctx, cfg) {\n const { line: line, target: target, property: property, color: color, scale: scale } = cfg;\n const segments = $77dc20320068f1ee$var$_segments(line, target, property);\n for (const { source: src, target: tgt, start: start, end: end } of segments){\n const { style: { backgroundColor: backgroundColor = color } = {} } = src;\n const notShape = target !== true;\n ctx.save();\n ctx.fillStyle = backgroundColor;\n $77dc20320068f1ee$var$clipBounds(ctx, scale, notShape && $77dc20320068f1ee$var$_getBounds(property, start, end));\n ctx.beginPath();\n const lineLoop = !!line.pathSegment(ctx, src);\n let loop;\n if (notShape) {\n if (lineLoop) ctx.closePath();\n else $77dc20320068f1ee$var$interpolatedLineTo(ctx, target, end, property);\n const targetLoop = !!target.pathSegment(ctx, tgt, {\n move: lineLoop,\n reverse: true\n });\n loop = lineLoop && targetLoop;\n if (!loop) $77dc20320068f1ee$var$interpolatedLineTo(ctx, target, start, property);\n }\n ctx.closePath();\n ctx.fill(loop ? \"evenodd\" : \"nonzero\");\n ctx.restore();\n }\n}\nfunction $77dc20320068f1ee$var$clipBounds(ctx, scale, bounds) {\n const { top: top, bottom: bottom } = scale.chart.chartArea;\n const { property: property, start: start, end: end } = bounds || {};\n if (property === \"x\") {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\nfunction $77dc20320068f1ee$var$interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n}\nvar $77dc20320068f1ee$export$d19ba4d812bed757 = {\n id: \"filler\",\n afterDatasetsUpdate (chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n for(i = 0; i < count; ++i){\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n if (line && line.options && line instanceof $77dc20320068f1ee$export$55e463fa7bcd3469) source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: $77dc20320068f1ee$var$_decodeFill(line, i, count),\n chart: chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line: line\n };\n meta.$filler = source;\n sources.push(source);\n }\n for(i = 0; i < count; ++i){\n source = sources[i];\n if (!source || source.fill === false) continue;\n source.fill = $77dc20320068f1ee$var$_resolveTarget(sources, i, options.propagate);\n }\n },\n beforeDraw (chart, _args, options) {\n const draw = options.drawTime === \"beforeDraw\";\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (!source) continue;\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) $77dc20320068f1ee$var$_drawfill(chart.ctx, source, area);\n }\n },\n beforeDatasetsDraw (chart, _args, options) {\n if (options.drawTime !== \"beforeDatasetsDraw\") return;\n const metasets = chart.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if ($77dc20320068f1ee$var$_shouldApplyFill(source)) $77dc20320068f1ee$var$_drawfill(chart.ctx, source, chart.chartArea);\n }\n },\n beforeDatasetDraw (chart, args, options) {\n const source = args.meta.$filler;\n if (!$77dc20320068f1ee$var$_shouldApplyFill(source) || options.drawTime !== \"beforeDatasetDraw\") return;\n $77dc20320068f1ee$var$_drawfill(chart.ctx, source, chart.chartArea);\n },\n defaults: {\n propagate: true,\n drawTime: \"beforeDatasetDraw\"\n }\n};\nconst $77dc20320068f1ee$var$getBoxSize = (labelOpts, fontSize)=>{\n let { boxHeight: boxHeight = fontSize, boxWidth: boxWidth = fontSize } = labelOpts;\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n return {\n boxWidth: boxWidth,\n boxHeight: boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\nconst $77dc20320068f1ee$var$itemsEqual = (a, b)=>a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass $77dc20320068f1ee$var$Legend extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(labelOpts.generateLabels, [\n this.chart\n ], this) || [];\n if (labelOpts.filter) legendItems = legendItems.filter((item)=>labelOpts.filter(item, this.chart.data));\n if (labelOpts.sort) legendItems = legendItems.sort((a, b)=>labelOpts.sort(a, b, this.chart.data));\n if (this.options.reverse) legendItems.reverse();\n this.legendItems = legendItems;\n }\n fit() {\n const { options: options, ctx: ctx } = this;\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n const labelOpts = options.labels;\n const labelFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const { boxWidth: boxWidth, itemHeight: itemHeight } = $77dc20320068f1ee$var$getBoxSize(labelOpts, fontSize);\n let width, height;\n ctx.font = labelFont.string;\n if (this.isHorizontal()) {\n width = this.maxWidth;\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight;\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const { ctx: ctx, maxWidth: maxWidth, options: { labels: { padding: padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const lineWidths = this.lineWidths = [\n 0\n ];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i)=>{\n const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n hitboxes[i] = {\n left: 0,\n top: top,\n row: row,\n width: itemWidth,\n height: itemHeight\n };\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n return totalHeight;\n }\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const { ctx: ctx, maxHeight: maxHeight, options: { labels: { padding: padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n let left = 0;\n let col = 0;\n this.legendItems.forEach((legendItem, i)=>{\n const { itemWidth: itemWidth, itemHeight: itemHeight } = $77dc20320068f1ee$var$calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n hitboxes[i] = {\n left: left,\n top: currentColHeight,\n col: col,\n width: itemWidth,\n height: itemHeight\n };\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n totalWidth += currentColWidth;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n return totalWidth;\n }\n adjustHitBoxes() {\n if (!this.options.display) return;\n const titleHeight = this._computeTitleHeight();\n const { legendHitBoxes: hitboxes, options: { align: align, labels: { padding: padding }, rtl: rtl } } = this;\n const rtlHelper = (0, $02b6f511cc6c123c$export$3d12bd131bb975d1)(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes){\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes){\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n isHorizontal() {\n return this.options.position === \"top\" || this.options.position === \"bottom\";\n }\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n (0, $02b6f511cc6c123c$export$8743009a87fcb00f)(ctx, this);\n this._draw();\n (0, $02b6f511cc6c123c$export$3d8c2f653ac9d0b9)(ctx);\n }\n }\n _draw() {\n const { options: opts, columnSizes: columnSizes, lineWidths: lineWidths, ctx: ctx } = this;\n const { align: align, labels: labelOpts } = opts;\n const defaultColor = (0, $02b6f511cc6c123c$export$4368d992c4eafac0).color;\n const rtlHelper = (0, $02b6f511cc6c123c$export$3d12bd131bb975d1)(opts.rtl, this.left, this.width);\n const labelFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(labelOpts.font);\n const { padding: padding } = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n this.drawTitle();\n ctx.textAlign = rtlHelper.textAlign(\"left\");\n ctx.textBaseline = \"middle\";\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n const { boxWidth: boxWidth, boxHeight: boxHeight, itemHeight: itemHeight } = $77dc20320068f1ee$var$getBoxSize(labelOpts, fontSize);\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) return;\n ctx.save();\n const lineWidth = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.lineWidth, 1);\n ctx.fillStyle = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.fillStyle, defaultColor);\n ctx.lineCap = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.lineCap, \"butt\");\n ctx.lineDashOffset = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.lineDashOffset, 0);\n ctx.lineJoin = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.lineJoin, \"miter\");\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.strokeStyle, defaultColor);\n ctx.setLineDash((0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.lineDash, []));\n if (labelOpts.usePointStyle) {\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n (0, $02b6f511cc6c123c$export$24baa2b76016ce0e)(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(legendItem.borderRadius);\n ctx.beginPath();\n if (Object.values(borderRadius).some((v)=>v !== 0)) (0, $02b6f511cc6c123c$export$1fbe638ecf81657e)(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n else ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n ctx.fill();\n if (lineWidth !== 0) ctx.stroke();\n }\n ctx.restore();\n };\n const fillText = function(x, y, legendItem) {\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) cursor = {\n x: (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n else cursor = {\n x: this.left + padding,\n y: (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n (0, $02b6f511cc6c123c$export$91c6e00c14e7e6fd)(this.ctx, opts.textDirection);\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i)=>{\n ctx.strokeStyle = legendItem.fontColor;\n ctx.fillStyle = legendItem.fontColor;\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n rtlHelper.setWidth(this.width);\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n const realX = rtlHelper.x(x);\n drawLegendBox(realX, y, legendItem);\n x = (0, $02b6f511cc6c123c$export$9d398bebfec1c039)(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n fillText(rtlHelper.x(x), y, legendItem);\n if (isHorizontal) cursor.x += width + padding;\n else if (typeof legendItem.text !== \"string\") {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += $77dc20320068f1ee$var$calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else cursor.y += lineHeight;\n });\n (0, $02b6f511cc6c123c$export$890c4ad488842ce7)(this.ctx, opts.textDirection);\n }\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(titleOpts.font);\n const titlePadding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(titleOpts.padding);\n if (!titleOpts.display) return;\n const rtlHelper = (0, $02b6f511cc6c123c$export$3d12bd131bb975d1)(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n let left = this.left;\n let maxWidth = this.width;\n if (this.isHorizontal()) {\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(opts.align, left, this.right - maxWidth);\n } else {\n const maxHeight = this.columnSizes.reduce((acc, size)=>Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n const x = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(position, left, left + maxWidth);\n ctx.textAlign = rtlHelper.textAlign((0, $02b6f511cc6c123c$export$3c2fa207a37baaea)(position));\n ctx.textBaseline = \"middle\";\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, titleOpts.text, x, y, titleFont);\n }\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(titleOpts.font);\n const titlePadding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n if ((0, $02b6f511cc6c123c$export$3b513254972cfc9c)(x, this.left, this.right) && (0, $02b6f511cc6c123c$export$3b513254972cfc9c)(y, this.top, this.bottom)) {\n lh = this.legendHitBoxes;\n for(i = 0; i < lh.length; ++i){\n hitBox = lh[i];\n if ((0, $02b6f511cc6c123c$export$3b513254972cfc9c)(x, hitBox.left, hitBox.left + hitBox.width) && (0, $02b6f511cc6c123c$export$3b513254972cfc9c)(y, hitBox.top, hitBox.top + hitBox.height)) return this.legendItems[i];\n }\n }\n return null;\n }\n handleEvent(e) {\n const opts = this.options;\n if (!$77dc20320068f1ee$var$isListened(e.type, opts)) return;\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n if (e.type === \"mousemove\" || e.type === \"mouseout\") {\n const previous = this._hoveredItem;\n const sameItem = $77dc20320068f1ee$var$itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(opts.onLeave, [\n e,\n previous,\n this\n ], this);\n this._hoveredItem = hoveredItem;\n if (hoveredItem && !sameItem) (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(opts.onHover, [\n e,\n hoveredItem,\n this\n ], this);\n } else if (hoveredItem) (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(opts.onClick, [\n e,\n hoveredItem,\n this\n ], this);\n }\n constructor(config){\n super();\n this._added = false;\n this.legendHitBoxes = [];\n this._hoveredItem = null;\n this.doughnutMode = false;\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n}\nfunction $77dc20320068f1ee$var$calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = $77dc20320068f1ee$var$calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = $77dc20320068f1ee$var$calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {\n itemWidth: itemWidth,\n itemHeight: itemHeight\n };\n}\nfunction $77dc20320068f1ee$var$calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== \"string\") legendItemText = legendItemText.reduce((a, b)=>a.length > b.length ? a : b);\n return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width;\n}\nfunction $77dc20320068f1ee$var$calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== \"string\") itemHeight = $77dc20320068f1ee$var$calculateLegendItemHeight(legendItem, fontLineHeight);\n return itemHeight;\n}\nfunction $77dc20320068f1ee$var$calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\nfunction $77dc20320068f1ee$var$isListened(type, opts) {\n if ((type === \"mousemove\" || type === \"mouseout\") && (opts.onHover || opts.onLeave)) return true;\n if (opts.onClick && (type === \"click\" || type === \"mouseup\")) return true;\n return false;\n}\nvar $77dc20320068f1ee$export$ed247974535929c7 = {\n id: \"legend\",\n _element: $77dc20320068f1ee$var$Legend,\n start (chart, _args, options) {\n const legend = chart.legend = new $77dc20320068f1ee$var$Legend({\n ctx: chart.ctx,\n options: options,\n chart: chart\n });\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(chart, legend, options);\n $77dc20320068f1ee$export$1ecca0613f5e56d2.addBox(chart, legend);\n },\n stop (chart) {\n $77dc20320068f1ee$export$1ecca0613f5e56d2.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n beforeUpdate (chart, _args, options) {\n const legend = chart.legend;\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(chart, legend, options);\n legend.options = options;\n },\n afterUpdate (chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n afterEvent (chart, args) {\n if (!args.replay) chart.legend.handleEvent(args.event);\n },\n defaults: {\n display: true,\n position: \"top\",\n align: \"center\",\n fullSize: true,\n reverse: false,\n weight: 1000,\n onClick (e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n onHover: null,\n onLeave: null,\n labels: {\n color: (ctx)=>ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n generateLabels (chart) {\n const datasets = chart.data.datasets;\n const { labels: { usePointStyle: usePointStyle, pointStyle: pointStyle, textAlign: textAlign, color: color, useBorderRadius: useBorderRadius, borderRadius: borderRadius } } = chart.legend.options;\n return chart._getSortedDatasetMetas().map((meta)=>{\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(style.borderWidth);\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n title: {\n color: (ctx)=>ctx.chart.options.color,\n display: false,\n position: \"center\",\n text: \"\"\n }\n },\n descriptors: {\n _scriptable: (name)=>!name.startsWith(\"on\"),\n labels: {\n _scriptable: (name)=>![\n \"generateLabels\",\n \"filter\",\n \"sort\"\n ].includes(name)\n }\n }\n};\nclass $77dc20320068f1ee$var$Title extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n update(maxWidth, maxHeight) {\n const opts = this.options;\n this.left = 0;\n this.top = 0;\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n const lineCount = (0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(opts.text) ? opts.text.length : 1;\n this._padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(opts.padding);\n const textSize = lineCount * (0, $02b6f511cc6c123c$export$34aec0b863436764)(opts.font).lineHeight + this._padding.height;\n if (this.isHorizontal()) this.height = textSize;\n else this.width = textSize;\n }\n isHorizontal() {\n const pos = this.options.position;\n return pos === \"top\" || pos === \"bottom\";\n }\n _drawArgs(offset) {\n const { top: top, left: left, bottom: bottom, right: right, options: options } = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n if (this.isHorizontal()) {\n titleX = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === \"left\") {\n titleX = left + offset;\n titleY = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, bottom, top);\n rotation = (0, $02b6f511cc6c123c$export$56c0d5a1e737357d) * -0.5;\n } else {\n titleX = right - offset;\n titleY = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, top, bottom);\n rotation = (0, $02b6f511cc6c123c$export$56c0d5a1e737357d) * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {\n titleX: titleX,\n titleY: titleY,\n maxWidth: maxWidth,\n rotation: rotation\n };\n }\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n if (!opts.display) return;\n const fontOpts = (0, $02b6f511cc6c123c$export$34aec0b863436764)(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const { titleX: titleX, titleY: titleY, maxWidth: maxWidth, rotation: rotation } = this._drawArgs(offset);\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth: maxWidth,\n rotation: rotation,\n textAlign: (0, $02b6f511cc6c123c$export$3c2fa207a37baaea)(opts.align),\n textBaseline: \"middle\",\n translation: [\n titleX,\n titleY\n ]\n });\n }\n constructor(config){\n super();\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n}\nfunction $77dc20320068f1ee$var$createTitle(chart, titleOpts) {\n const title = new $77dc20320068f1ee$var$Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart: chart\n });\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(chart, title, titleOpts);\n $77dc20320068f1ee$export$1ecca0613f5e56d2.addBox(chart, title);\n chart.titleBlock = title;\n}\nvar $77dc20320068f1ee$export$f99233281efd08a0 = {\n id: \"title\",\n _element: $77dc20320068f1ee$var$Title,\n start (chart, _args, options) {\n $77dc20320068f1ee$var$createTitle(chart, options);\n },\n stop (chart) {\n const titleBlock = chart.titleBlock;\n $77dc20320068f1ee$export$1ecca0613f5e56d2.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n beforeUpdate (chart, _args, options) {\n const title = chart.titleBlock;\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: \"center\",\n display: false,\n font: {\n weight: \"bold\"\n },\n fullSize: true,\n padding: 10,\n position: \"top\",\n text: \"\",\n weight: 2000\n },\n defaultRoutes: {\n color: \"color\"\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\nconst $77dc20320068f1ee$var$map = new WeakMap();\nvar $77dc20320068f1ee$export$d5c56664638992a4 = {\n id: \"subtitle\",\n start (chart, _args, options) {\n const title = new $77dc20320068f1ee$var$Title({\n ctx: chart.ctx,\n options: options,\n chart: chart\n });\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(chart, title, options);\n $77dc20320068f1ee$export$1ecca0613f5e56d2.addBox(chart, title);\n $77dc20320068f1ee$var$map.set(chart, title);\n },\n stop (chart) {\n $77dc20320068f1ee$export$1ecca0613f5e56d2.removeBox(chart, $77dc20320068f1ee$var$map.get(chart));\n $77dc20320068f1ee$var$map.delete(chart);\n },\n beforeUpdate (chart, _args, options) {\n const title = $77dc20320068f1ee$var$map.get(chart);\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: \"center\",\n display: false,\n font: {\n weight: \"normal\"\n },\n fullSize: true,\n padding: 0,\n position: \"top\",\n text: \"\",\n weight: 1500\n },\n defaultRoutes: {\n color: \"color\"\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\nconst $77dc20320068f1ee$var$positioners = {\n average (items) {\n if (!items.length) return false;\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n return {\n x: x / count,\n y: y / count\n };\n },\n nearest (items, eventPosition) {\n if (!items.length) return false;\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = (0, $02b6f511cc6c123c$export$158acd800e1ef08b)(eventPosition, center);\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n return {\n x: x,\n y: y\n };\n }\n};\nfunction $77dc20320068f1ee$var$pushOrConcat(base, toPush) {\n if (toPush) {\n if ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(toPush)) Array.prototype.push.apply(base, toPush);\n else base.push(toPush);\n }\n return base;\n}\nfunction $77dc20320068f1ee$var$splitNewlines(str) {\n if ((typeof str === \"string\" || str instanceof String) && str.indexOf(\"\\n\") > -1) return str.split(\"\\n\");\n return str;\n}\nfunction $77dc20320068f1ee$var$createTooltipItem(chart, item) {\n const { element: element, datasetIndex: datasetIndex, index: index } = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const { label: label, value: value } = controller.getLabelAndValue(index);\n return {\n chart: chart,\n label: label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex: datasetIndex,\n element: element\n };\n}\nfunction $77dc20320068f1ee$var$getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const { body: body, footer: footer, title: title } = tooltip;\n const { boxWidth: boxWidth, boxHeight: boxHeight } = options;\n const bodyFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.bodyFont);\n const titleFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.titleFont);\n const footerFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(options.padding);\n let height = padding.height;\n let width = 0;\n let combinedBodyLength = body.reduce((count, bodyItem)=>count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n if (titleLineCount) height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;\n if (combinedBodyLength) {\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n ctx.save();\n ctx.font = titleFont.string;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(tooltip.title, maxLineWidth);\n ctx.font = bodyFont.string;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(body, (bodyItem)=>{\n (0, $02b6f511cc6c123c$export$d66501df72047452)(bodyItem.before, maxLineWidth);\n (0, $02b6f511cc6c123c$export$d66501df72047452)(bodyItem.lines, maxLineWidth);\n (0, $02b6f511cc6c123c$export$d66501df72047452)(bodyItem.after, maxLineWidth);\n });\n widthPadding = 0;\n ctx.font = footerFont.string;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(tooltip.footer, maxLineWidth);\n ctx.restore();\n width += padding.width;\n return {\n width: width,\n height: height\n };\n}\nfunction $77dc20320068f1ee$var$determineYAlign(chart, size) {\n const { y: y, height: height } = size;\n if (y < height / 2) return \"top\";\n else if (y > chart.height - height / 2) return \"bottom\";\n return \"center\";\n}\nfunction $77dc20320068f1ee$var$doesNotFitWithAlign(xAlign, chart, options, size) {\n const { x: x, width: width } = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === \"left\" && x + width + caret > chart.width) return true;\n if (xAlign === \"right\" && x - width - caret < 0) return true;\n}\nfunction $77dc20320068f1ee$var$determineXAlign(chart, options, size, yAlign) {\n const { x: x, width: width } = size;\n const { width: chartWidth, chartArea: { left: left, right: right } } = chart;\n let xAlign = \"center\";\n if (yAlign === \"center\") xAlign = x <= (left + right) / 2 ? \"left\" : \"right\";\n else if (x <= width / 2) xAlign = \"left\";\n else if (x >= chartWidth - width / 2) xAlign = \"right\";\n if ($77dc20320068f1ee$var$doesNotFitWithAlign(xAlign, chart, options, size)) xAlign = \"center\";\n return xAlign;\n}\nfunction $77dc20320068f1ee$var$determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || $77dc20320068f1ee$var$determineYAlign(chart, size);\n return {\n xAlign: size.xAlign || options.xAlign || $77dc20320068f1ee$var$determineXAlign(chart, options, size, yAlign),\n yAlign: yAlign\n };\n}\nfunction $77dc20320068f1ee$var$alignX(size, xAlign) {\n let { x: x, width: width } = size;\n if (xAlign === \"right\") x -= width;\n else if (xAlign === \"center\") x -= width / 2;\n return x;\n}\nfunction $77dc20320068f1ee$var$alignY(size, yAlign, paddingAndSize) {\n let { y: y, height: height } = size;\n if (yAlign === \"top\") y += paddingAndSize;\n else if (yAlign === \"bottom\") y -= height + paddingAndSize;\n else y -= height / 2;\n return y;\n}\nfunction $77dc20320068f1ee$var$getBackgroundPoint(options, size, alignment, chart) {\n const { caretSize: caretSize, caretPadding: caretPadding, cornerRadius: cornerRadius } = options;\n const { xAlign: xAlign, yAlign: yAlign } = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const { topLeft: topLeft, topRight: topRight, bottomLeft: bottomLeft, bottomRight: bottomRight } = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(cornerRadius);\n let x = $77dc20320068f1ee$var$alignX(size, xAlign);\n const y = $77dc20320068f1ee$var$alignY(size, yAlign, paddingAndSize);\n if (yAlign === \"center\") {\n if (xAlign === \"left\") x += paddingAndSize;\n else if (xAlign === \"right\") x -= paddingAndSize;\n } else if (xAlign === \"left\") x -= Math.max(topLeft, bottomLeft) + caretSize;\n else if (xAlign === \"right\") x += Math.max(topRight, bottomRight) + caretSize;\n return {\n x: (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(x, 0, chart.width - size.width),\n y: (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(y, 0, chart.height - size.height)\n };\n}\nfunction $77dc20320068f1ee$var$getAlignedX(tooltip, align, options) {\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(options.padding);\n return align === \"center\" ? tooltip.x + tooltip.width / 2 : align === \"right\" ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;\n}\nfunction $77dc20320068f1ee$var$getBeforeAfterBodyLines(callback) {\n return $77dc20320068f1ee$var$pushOrConcat([], $77dc20320068f1ee$var$splitNewlines(callback));\n}\nfunction $77dc20320068f1ee$var$createTooltipContext(parent, tooltip, tooltipItems) {\n return (0, $02b6f511cc6c123c$export$35e795649ee09318)(parent, {\n tooltip: tooltip,\n tooltipItems: tooltipItems,\n type: \"tooltip\"\n });\n}\nfunction $77dc20320068f1ee$var$overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\nconst $77dc20320068f1ee$var$defaultCallbacks = {\n beforeTitle: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n title (tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n if (this && this.options && this.options.mode === \"dataset\") return item.dataset.label || \"\";\n else if (item.label) return item.label;\n else if (labelCount > 0 && item.dataIndex < labelCount) return labels[item.dataIndex];\n }\n return \"\";\n },\n afterTitle: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n beforeBody: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n beforeLabel: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n label (tooltipItem) {\n if (this && this.options && this.options.mode === \"dataset\") return tooltipItem.label + \": \" + tooltipItem.formattedValue || tooltipItem.formattedValue;\n let label = tooltipItem.dataset.label || \"\";\n if (label) label += \": \";\n const value = tooltipItem.formattedValue;\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(value)) label += value;\n return label;\n },\n labelColor (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0\n };\n },\n labelTextColor () {\n return this.options.bodyColor;\n },\n labelPointStyle (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation\n };\n },\n afterLabel: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n afterBody: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n beforeFooter: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n footer: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n afterFooter: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46)\n};\nfunction $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n if (typeof result === \"undefined\") return $77dc20320068f1ee$var$defaultCallbacks[name].call(ctx, arg);\n return result;\n}\nclass $77dc20320068f1ee$var$Tooltip extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n if (cached) return cached;\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new $77dc20320068f1ee$export$8ab227dac26677d(this.chart, opts);\n if (opts._cacheable) this._cachedAnimations = Object.freeze(animations);\n return animations;\n }\n getContext() {\n return this.$context || (this.$context = $77dc20320068f1ee$var$createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n getTitle(context, options) {\n const { callbacks: callbacks } = options;\n const beforeTitle = $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, \"beforeTitle\", this, context);\n const title = $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, \"title\", this, context);\n const afterTitle = $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, \"afterTitle\", this, context);\n let lines = [];\n lines = $77dc20320068f1ee$var$pushOrConcat(lines, $77dc20320068f1ee$var$splitNewlines(beforeTitle));\n lines = $77dc20320068f1ee$var$pushOrConcat(lines, $77dc20320068f1ee$var$splitNewlines(title));\n lines = $77dc20320068f1ee$var$pushOrConcat(lines, $77dc20320068f1ee$var$splitNewlines(afterTitle));\n return lines;\n }\n getBeforeBody(tooltipItems, options) {\n return $77dc20320068f1ee$var$getBeforeAfterBodyLines($77dc20320068f1ee$var$invokeCallbackWithFallback(options.callbacks, \"beforeBody\", this, tooltipItems));\n }\n getBody(tooltipItems, options) {\n const { callbacks: callbacks } = options;\n const bodyItems = [];\n (0, $02b6f511cc6c123c$export$d66501df72047452)(tooltipItems, (context)=>{\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = $77dc20320068f1ee$var$overrideCallbacks(callbacks, context);\n $77dc20320068f1ee$var$pushOrConcat(bodyItem.before, $77dc20320068f1ee$var$splitNewlines($77dc20320068f1ee$var$invokeCallbackWithFallback(scoped, \"beforeLabel\", this, context)));\n $77dc20320068f1ee$var$pushOrConcat(bodyItem.lines, $77dc20320068f1ee$var$invokeCallbackWithFallback(scoped, \"label\", this, context));\n $77dc20320068f1ee$var$pushOrConcat(bodyItem.after, $77dc20320068f1ee$var$splitNewlines($77dc20320068f1ee$var$invokeCallbackWithFallback(scoped, \"afterLabel\", this, context)));\n bodyItems.push(bodyItem);\n });\n return bodyItems;\n }\n getAfterBody(tooltipItems, options) {\n return $77dc20320068f1ee$var$getBeforeAfterBodyLines($77dc20320068f1ee$var$invokeCallbackWithFallback(options.callbacks, \"afterBody\", this, tooltipItems));\n }\n getFooter(tooltipItems, options) {\n const { callbacks: callbacks } = options;\n const beforeFooter = $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, \"beforeFooter\", this, tooltipItems);\n const footer = $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, \"footer\", this, tooltipItems);\n const afterFooter = $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, \"afterFooter\", this, tooltipItems);\n let lines = [];\n lines = $77dc20320068f1ee$var$pushOrConcat(lines, $77dc20320068f1ee$var$splitNewlines(beforeFooter));\n lines = $77dc20320068f1ee$var$pushOrConcat(lines, $77dc20320068f1ee$var$splitNewlines(footer));\n lines = $77dc20320068f1ee$var$pushOrConcat(lines, $77dc20320068f1ee$var$splitNewlines(afterFooter));\n return lines;\n }\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n for(i = 0, len = active.length; i < len; ++i)tooltipItems.push($77dc20320068f1ee$var$createTooltipItem(this.chart, active[i]));\n if (options.filter) tooltipItems = tooltipItems.filter((element, index, array)=>options.filter(element, index, array, data));\n if (options.itemSort) tooltipItems = tooltipItems.sort((a, b)=>options.itemSort(a, b, data));\n (0, $02b6f511cc6c123c$export$d66501df72047452)(tooltipItems, (context)=>{\n const scoped = $77dc20320068f1ee$var$overrideCallbacks(options.callbacks, context);\n labelColors.push($77dc20320068f1ee$var$invokeCallbackWithFallback(scoped, \"labelColor\", this, context));\n labelPointStyles.push($77dc20320068f1ee$var$invokeCallbackWithFallback(scoped, \"labelPointStyle\", this, context));\n labelTextColors.push($77dc20320068f1ee$var$invokeCallbackWithFallback(scoped, \"labelTextColor\", this, context));\n });\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n if (!active.length) {\n if (this.opacity !== 0) properties = {\n opacity: 0\n };\n } else {\n const position = $77dc20320068f1ee$var$positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n const size = this._size = $77dc20320068f1ee$var$getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = $77dc20320068f1ee$var$determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = $77dc20320068f1ee$var$getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n if (properties) this._resolveAnimations().update(this, properties);\n if (changed && options.external) options.external.call(this, {\n chart: this.chart,\n tooltip: this,\n replay: replay\n });\n }\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n getCaretPosition(tooltipPoint, size, options) {\n const { xAlign: xAlign, yAlign: yAlign } = this;\n const { caretSize: caretSize, cornerRadius: cornerRadius } = options;\n const { topLeft: topLeft, topRight: topRight, bottomLeft: bottomLeft, bottomRight: bottomRight } = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(cornerRadius);\n const { x: ptX, y: ptY } = tooltipPoint;\n const { width: width, height: height } = size;\n let x1, x2, x3, y1, y2, y3;\n if (yAlign === \"center\") {\n y2 = ptY + height / 2;\n if (xAlign === \"left\") {\n x1 = ptX;\n x2 = x1 - caretSize;\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n x3 = x1;\n } else {\n if (xAlign === \"left\") x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize;\n else if (xAlign === \"right\") x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n else x2 = this.caretX;\n if (yAlign === \"top\") {\n y1 = ptY;\n y2 = y1 - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {\n x1: x1,\n x2: x2,\n x3: x3,\n y1: y1,\n y2: y2,\n y3: y3\n };\n }\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n if (length) {\n const rtlHelper = (0, $02b6f511cc6c123c$export$3d12bd131bb975d1)(options.rtl, this.x, this.width);\n pt.x = $77dc20320068f1ee$var$getAlignedX(this, options.titleAlign, options);\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = \"middle\";\n titleFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.titleFont);\n titleSpacing = options.titleSpacing;\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing;\n if (i + 1 === length) pt.y += options.titleMarginBottom - titleSpacing;\n }\n }\n }\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const { boxHeight: boxHeight, boxWidth: boxWidth } = options;\n const bodyFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.bodyFont);\n const colorX = $77dc20320068f1ee$var$getAlignedX(this, \"left\", options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2,\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n (0, $02b6f511cc6c123c$export$493d36ec626b6698)(ctx, drawOptions, centerX, centerY);\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n (0, $02b6f511cc6c123c$export$493d36ec626b6698)(ctx, drawOptions, centerX, centerY);\n } else {\n ctx.lineWidth = (0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1;\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(labelColor.borderRadius);\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n (0, $02b6f511cc6c123c$export$1fbe638ecf81657e)(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n (0, $02b6f511cc6c123c$export$1fbe638ecf81657e)(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n ctx.fillStyle = this.labelTextColors[i];\n }\n drawBody(pt, ctx, options) {\n const { body: body } = this;\n const { bodySpacing: bodySpacing, bodyAlign: bodyAlign, displayColors: displayColors, boxHeight: boxHeight, boxWidth: boxWidth, boxPadding: boxPadding } = options;\n const bodyFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n const rtlHelper = (0, $02b6f511cc6c123c$export$3d12bd131bb975d1)(options.rtl, this.x, this.width);\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = \"middle\";\n ctx.font = bodyFont.string;\n pt.x = $77dc20320068f1ee$var$getAlignedX(this, bodyAlignForCalculation, options);\n ctx.fillStyle = options.bodyColor;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this.beforeBody, fillLineOfText);\n xLinePadding = displayColors && bodyAlignForCalculation !== \"right\" ? bodyAlign === \"center\" ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;\n for(i = 0, ilen = body.length; i < ilen; ++i){\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n ctx.fillStyle = textColor;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(bodyItem.before, fillLineOfText);\n lines = bodyItem.lines;\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n for(j = 0, jlen = lines.length; j < jlen; ++j){\n fillLineOfText(lines[j]);\n bodyLineHeight = bodyFont.lineHeight;\n }\n (0, $02b6f511cc6c123c$export$d66501df72047452)(bodyItem.after, fillLineOfText);\n }\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing;\n }\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n if (length) {\n const rtlHelper = (0, $02b6f511cc6c123c$export$3d12bd131bb975d1)(options.rtl, this.x, this.width);\n pt.x = $77dc20320068f1ee$var$getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = \"middle\";\n footerFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.footerFont);\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n drawBackground(pt, ctx, tooltipSize, options) {\n const { xAlign: xAlign, yAlign: yAlign } = this;\n const { x: x, y: y } = pt;\n const { width: width, height: height } = tooltipSize;\n const { topLeft: topLeft, topRight: topRight, bottomLeft: bottomLeft, bottomRight: bottomRight } = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(options.cornerRadius);\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === \"top\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === \"center\" && xAlign === \"right\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === \"bottom\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === \"center\" && xAlign === \"left\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n ctx.fill();\n if (options.borderWidth > 0) ctx.stroke();\n }\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = $77dc20320068f1ee$var$positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) return;\n const size = this._size = $77dc20320068f1ee$var$getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = $77dc20320068f1ee$var$determineAlignment(chart, options, positionAndSize);\n const point = $77dc20320068f1ee$var$getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n _willRender() {\n return !!this.opacity;\n }\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n if (!opacity) return;\n this._updateAnimationTarget(options);\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(options.padding);\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n this.drawBackground(pt, ctx, tooltipSize, options);\n (0, $02b6f511cc6c123c$export$91c6e00c14e7e6fd)(ctx, options.textDirection);\n pt.y += padding.top;\n this.drawTitle(pt, ctx, options);\n this.drawBody(pt, ctx, options);\n this.drawFooter(pt, ctx, options);\n (0, $02b6f511cc6c123c$export$890c4ad488842ce7)(ctx, options.textDirection);\n ctx.restore();\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({ datasetIndex: datasetIndex, index: index })=>{\n const meta = this.chart.getDatasetMeta(datasetIndex);\n if (!meta) throw new Error(\"Cannot find a dataset at index \" + datasetIndex);\n return {\n datasetIndex: datasetIndex,\n element: meta.data[index],\n index: index\n };\n });\n const changed = !(0, $02b6f511cc6c123c$export$995eb9fca571757)(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) return false;\n this._ignoreReplayEvents = false;\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n const positionChanged = this._positionChanged(active, e);\n const changed = replay || !(0, $02b6f511cc6c123c$export$995eb9fca571757)(active, lastActive) || positionChanged;\n if (changed) {\n this._active = active;\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n this.update(true, replay);\n }\n }\n return changed;\n }\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n if (e.type === \"mouseout\") return [];\n if (!inChartArea) return lastActive;\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n if (options.reverse) active.reverse();\n return active;\n }\n _positionChanged(active, e) {\n const { caretX: caretX, caretY: caretY, options: options } = this;\n const position = $77dc20320068f1ee$var$positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n constructor(config){\n super();\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$var$Tooltip, \"positioners\", $77dc20320068f1ee$var$positioners);\nvar $77dc20320068f1ee$export$28c660c63b792dea = {\n id: \"tooltip\",\n _element: $77dc20320068f1ee$var$Tooltip,\n positioners: $77dc20320068f1ee$var$positioners,\n afterInit (chart, _args, options) {\n if (options) chart.tooltip = new $77dc20320068f1ee$var$Tooltip({\n chart: chart,\n options: options\n });\n },\n beforeUpdate (chart, _args, options) {\n if (chart.tooltip) chart.tooltip.initialize(options);\n },\n reset (chart, _args, options) {\n if (chart.tooltip) chart.tooltip.initialize(options);\n },\n afterDraw (chart) {\n const tooltip = chart.tooltip;\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip: tooltip\n };\n if (chart.notifyPlugins(\"beforeTooltipDraw\", {\n ...args,\n cancelable: true\n }) === false) return;\n tooltip.draw(chart.ctx);\n chart.notifyPlugins(\"afterTooltipDraw\", args);\n }\n },\n afterEvent (chart, args) {\n if (chart.tooltip) {\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) args.changed = true;\n }\n },\n defaults: {\n enabled: true,\n external: null,\n position: \"average\",\n backgroundColor: \"rgba(0,0,0,0.8)\",\n titleColor: \"#fff\",\n titleFont: {\n weight: \"bold\"\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: \"left\",\n bodyColor: \"#fff\",\n bodySpacing: 2,\n bodyFont: {},\n bodyAlign: \"left\",\n footerColor: \"#fff\",\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: \"bold\"\n },\n footerAlign: \"left\",\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts)=>opts.bodyFont.size,\n boxWidth: (ctx, opts)=>opts.bodyFont.size,\n multiKeyBackground: \"#fff\",\n displayColors: true,\n boxPadding: 0,\n borderColor: \"rgba(0,0,0,0)\",\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: \"easeOutQuart\"\n },\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"width\",\n \"height\",\n \"caretX\",\n \"caretY\"\n ]\n },\n opacity: {\n easing: \"linear\",\n duration: 200\n }\n },\n callbacks: $77dc20320068f1ee$var$defaultCallbacks\n },\n defaultRoutes: {\n bodyFont: \"font\",\n footerFont: \"font\",\n titleFont: \"font\"\n },\n descriptors: {\n _scriptable: (name)=>name !== \"filter\" && name !== \"itemSort\" && name !== \"external\",\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: \"animation\"\n }\n },\n additionalOptionScopes: [\n \"interaction\"\n ]\n};\nvar $77dc20320068f1ee$export$8b3ca321c77fdea6 = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n Colors: $77dc20320068f1ee$export$c537fa0d021d010b,\n Decimation: $77dc20320068f1ee$export$be17f937e9aa7533,\n Filler: $77dc20320068f1ee$export$d19ba4d812bed757,\n Legend: $77dc20320068f1ee$export$ed247974535929c7,\n SubTitle: $77dc20320068f1ee$export$d5c56664638992a4,\n Title: $77dc20320068f1ee$export$f99233281efd08a0,\n Tooltip: $77dc20320068f1ee$export$28c660c63b792dea\n});\nconst $77dc20320068f1ee$var$addIfString = (labels, raw, index, addedLabels)=>{\n if (typeof raw === \"string\") {\n index = labels.push(raw) - 1;\n addedLabels.unshift({\n index: index,\n label: raw\n });\n } else if (isNaN(raw)) index = null;\n return index;\n};\nfunction $77dc20320068f1ee$var$findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) return $77dc20320068f1ee$var$addIfString(labels, raw, index, addedLabels);\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\nconst $77dc20320068f1ee$var$validIndex = (index, max)=>index === null ? null : (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(Math.round(index), 0, max);\nfunction $77dc20320068f1ee$var$_getLabelForValue(value) {\n const labels = this.getLabels();\n if (value >= 0 && value < labels.length) return labels[value];\n return value;\n}\nclass $77dc20320068f1ee$export$29e663ba4d09fe7 extends $77dc20320068f1ee$export$d60cfc58d3c358b6 {\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const { index: index, label: label } of added)if (labels[index] === label) labels.splice(index, 1);\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n parse(raw, index) {\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(raw)) return null;\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index : $77dc20320068f1ee$var$findOrAddLabel(labels, raw, (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(index, raw), this._addedLabels);\n return $77dc20320068f1ee$var$validIndex(index, labels.length - 1);\n }\n determineDataLimits() {\n const { minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let { min: min, max: max } = this.getMinMax(true);\n if (this.options.bounds === \"ticks\") {\n if (!minDefined) min = 0;\n if (!maxDefined) max = this.getLabels().length - 1;\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1);\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n for(let value = min; value <= max; value++)ticks.push({\n value: value\n });\n return ticks;\n }\n getLabelForValue(value) {\n return $77dc20320068f1ee$var$_getLabelForValue.call(this, value);\n }\n configure() {\n super.configure();\n if (!this.isHorizontal()) this._reversePixels = !this._reversePixels;\n }\n getPixelForValue(value) {\n if (typeof value !== \"number\") value = this.parse(value);\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) return null;\n return this.getPixelForValue(ticks[index].value);\n }\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n getBasePixel() {\n return this.bottom;\n }\n constructor(cfg){\n super(cfg);\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$29e663ba4d09fe7, \"id\", \"category\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$29e663ba4d09fe7, \"defaults\", {\n ticks: {\n callback: $77dc20320068f1ee$var$_getLabelForValue\n }\n});\nfunction $77dc20320068f1ee$var$generateTicks$1(generationOptions, dataRange) {\n const ticks = [];\n const MIN_SPACING = 1e-14;\n const { bounds: bounds, step: step, min: min, max: max, precision: precision, count: count, maxTicks: maxTicks, maxDigits: maxDigits, includeBounds: includeBounds } = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const { min: rmin, max: rmax } = dataRange;\n const minDefined = !(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(min);\n const maxDefined = !(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(max);\n const countDefined = !(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = (0, $02b6f511cc6c123c$export$a33b77bbdbb8366c)((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) return [\n {\n value: rmin\n },\n {\n value: rmax\n }\n ];\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) spacing = (0, $02b6f511cc6c123c$export$a33b77bbdbb8366c)(numSpaces * spacing / maxSpaces / unit) * unit;\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(precision)) {\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n if (bounds === \"ticks\") {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n if (minDefined && maxDefined && step && (0, $02b6f511cc6c123c$export$b9a6b53f9be3734)((max - min) / step, spacing / 1000)) {\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n numSpaces = (niceMax - niceMin) / spacing;\n if ((0, $02b6f511cc6c123c$export$a05254e7c3aeba6e)(numSpaces, Math.round(numSpaces), spacing / 1000)) numSpaces = Math.round(numSpaces);\n else numSpaces = Math.ceil(numSpaces);\n }\n const decimalPlaces = Math.max((0, $02b6f511cc6c123c$export$23ebac1979863676)(spacing), (0, $02b6f511cc6c123c$export$23ebac1979863676)(niceMin));\n factor = Math.pow(10, (0, $02b6f511cc6c123c$export$342063e11d6c3cad)(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({\n value: min\n });\n if (niceMin < min) j++;\n if ((0, $02b6f511cc6c123c$export$a05254e7c3aeba6e)(Math.round((niceMin + j * spacing) * factor) / factor, min, $77dc20320068f1ee$var$relativeLabelSize(min, minSpacing, generationOptions))) j++;\n } else if (niceMin < min) j++;\n }\n for(; j < numSpaces; ++j){\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) break;\n ticks.push({\n value: tickValue\n });\n }\n if (maxDefined && includeBounds && niceMax !== max) {\n if (ticks.length && (0, $02b6f511cc6c123c$export$a05254e7c3aeba6e)(ticks[ticks.length - 1].value, max, $77dc20320068f1ee$var$relativeLabelSize(max, minSpacing, generationOptions))) ticks[ticks.length - 1].value = max;\n else ticks.push({\n value: max\n });\n } else if (!maxDefined || niceMax === max) ticks.push({\n value: niceMax\n });\n return ticks;\n}\nfunction $77dc20320068f1ee$var$relativeLabelSize(value, minSpacing, { horizontal: horizontal, minRotation: minRotation }) {\n const rad = (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * (\"\" + value).length;\n return Math.min(minSpacing / ratio, length);\n}\nclass $77dc20320068f1ee$var$LinearScaleBase extends $77dc20320068f1ee$export$d60cfc58d3c358b6 {\n parse(raw, index) {\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(raw)) return null;\n if ((typeof raw === \"number\" || raw instanceof Number) && !isFinite(+raw)) return null;\n return +raw;\n }\n handleTickRangeOptions() {\n const { beginAtZero: beginAtZero } = this.options;\n const { minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let { min: min, max: max } = this;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (beginAtZero) {\n const minSign = (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(min);\n const maxSign = (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(max);\n if (minSign < 0 && maxSign < 0) setMax(0);\n else if (minSign > 0 && maxSign > 0) setMin(0);\n }\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n setMax(max + offset);\n if (!beginAtZero) setMin(min - offset);\n }\n this.min = min;\n this.max = max;\n }\n getTickLimit() {\n const tickOpts = this.options.ticks;\n let { maxTicksLimit: maxTicksLimit, stepSize: stepSize } = tickOpts;\n let maxTicks;\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n if (maxTicksLimit) maxTicks = Math.min(maxTicksLimit, maxTicks);\n return maxTicks;\n }\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n const numericGeneratorOptions = {\n maxTicks: maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = $77dc20320068f1ee$var$generateTicks$1(numericGeneratorOptions, dataRange);\n if (opts.bounds === \"ticks\") (0, $02b6f511cc6c123c$export$53a70dd1ebbae346)(ticks, this, \"value\");\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n super.configure();\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n getLabelForValue(value) {\n return (0, $02b6f511cc6c123c$export$ae1af26003f05816)(value, this.chart.options.locale, this.options.ticks.format);\n }\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._endValue = undefined;\n this._valueRange = 0;\n }\n}\nclass $77dc20320068f1ee$export$e7f4e5e8656f0b93 extends $77dc20320068f1ee$var$LinearScaleBase {\n determineDataLimits() {\n const { min: min, max: max } = this.getMinMax(true);\n this.min = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(min) ? min : 0;\n this.max = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(max) ? max : 1;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e7f4e5e8656f0b93, \"id\", \"linear\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e7f4e5e8656f0b93, \"defaults\", {\n ticks: {\n callback: (0, $02b6f511cc6c123c$export$91477dc880baac21).formatters.numeric\n }\n});\nconst $77dc20320068f1ee$var$log10Floor = (v)=>Math.floor((0, $02b6f511cc6c123c$export$9f4f30ee63539e24)(v));\nconst $77dc20320068f1ee$var$changeExponent = (v, m)=>Math.pow(10, $77dc20320068f1ee$var$log10Floor(v) + m);\nfunction $77dc20320068f1ee$var$isMajor(tickVal) {\n const remain = tickVal / Math.pow(10, $77dc20320068f1ee$var$log10Floor(tickVal));\n return remain === 1;\n}\nfunction $77dc20320068f1ee$var$steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\nfunction $77dc20320068f1ee$var$startExp(min, max) {\n const range = max - min;\n let rangeExp = $77dc20320068f1ee$var$log10Floor(range);\n while($77dc20320068f1ee$var$steps(min, max, rangeExp) > 10)rangeExp++;\n while($77dc20320068f1ee$var$steps(min, max, rangeExp) < 10)rangeExp--;\n return Math.min(rangeExp, $77dc20320068f1ee$var$log10Floor(min));\n}\nfunction $77dc20320068f1ee$var$generateTicks(generationOptions, { min: min, max: max }) {\n min = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(generationOptions.min, min);\n const ticks = [];\n const minExp = $77dc20320068f1ee$var$log10Floor(min);\n let exp = $77dc20320068f1ee$var$startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while(value < max){\n ticks.push({\n value: value,\n major: $77dc20320068f1ee$var$isMajor(value),\n significand: significand\n });\n if (significand >= 10) significand = significand < 15 ? 15 : 20;\n else significand++;\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(generationOptions.max, value);\n ticks.push({\n value: lastTick,\n major: $77dc20320068f1ee$var$isMajor(lastTick),\n significand: significand\n });\n return ticks;\n}\nclass $77dc20320068f1ee$export$85295eaf7cb3ac3e extends $77dc20320068f1ee$export$d60cfc58d3c358b6 {\n parse(raw, index) {\n const value = $77dc20320068f1ee$var$LinearScaleBase.prototype.parse.apply(this, [\n raw,\n index\n ]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(value) && value > 0 ? value : null;\n }\n determineDataLimits() {\n const { min: min, max: max } = this.getMinMax(true);\n this.min = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(min) ? Math.max(0, min) : null;\n this.max = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(max) ? Math.max(0, max) : null;\n if (this.options.beginAtZero) this._zero = true;\n if (this._zero && this.min !== this._suggestedMin && !(0, $02b6f511cc6c123c$export$39b482c5e57630a8)(this._userMin)) this.min = min === $77dc20320068f1ee$var$changeExponent(this.min, 0) ? $77dc20320068f1ee$var$changeExponent(this.min, -1) : $77dc20320068f1ee$var$changeExponent(this.min, 0);\n this.handleTickRangeOptions();\n }\n handleTickRangeOptions() {\n const { minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (min === max) {\n if (min <= 0) {\n setMin(1);\n setMax(10);\n } else {\n setMin($77dc20320068f1ee$var$changeExponent(min, -1));\n setMax($77dc20320068f1ee$var$changeExponent(max, 1));\n }\n }\n if (min <= 0) setMin($77dc20320068f1ee$var$changeExponent(max, -1));\n if (max <= 0) setMax($77dc20320068f1ee$var$changeExponent(min, 1));\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const opts = this.options;\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = $77dc20320068f1ee$var$generateTicks(generationOptions, this);\n if (opts.bounds === \"ticks\") (0, $02b6f511cc6c123c$export$53a70dd1ebbae346)(ticks, this, \"value\");\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n getLabelForValue(value) {\n return value === undefined ? \"0\" : (0, $02b6f511cc6c123c$export$ae1af26003f05816)(value, this.chart.options.locale, this.options.ticks.format);\n }\n configure() {\n const start = this.min;\n super.configure();\n this._startValue = (0, $02b6f511cc6c123c$export$9f4f30ee63539e24)(start);\n this._valueRange = (0, $02b6f511cc6c123c$export$9f4f30ee63539e24)(this.max) - (0, $02b6f511cc6c123c$export$9f4f30ee63539e24)(start);\n }\n getPixelForValue(value) {\n if (value === undefined || value === 0) value = this.min;\n if (value === null || isNaN(value)) return NaN;\n return this.getPixelForDecimal(value === this.min ? 0 : ((0, $02b6f511cc6c123c$export$9f4f30ee63539e24)(value) - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._valueRange = 0;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$85295eaf7cb3ac3e, \"id\", \"logarithmic\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$85295eaf7cb3ac3e, \"defaults\", {\n ticks: {\n callback: (0, $02b6f511cc6c123c$export$91477dc880baac21).formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n});\nfunction $77dc20320068f1ee$var$getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n if (tickOpts.display && opts.display) {\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(tickOpts.backdropPadding);\n return (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(tickOpts.font && tickOpts.font.size, (0, $02b6f511cc6c123c$export$4368d992c4eafac0).font.size) + padding.height;\n }\n return 0;\n}\nfunction $77dc20320068f1ee$var$measureLabelSize(ctx, font, label) {\n label = (0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(label) ? label : [\n label\n ];\n return {\n w: (0, $02b6f511cc6c123c$export$faec65b429be379)(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\nfunction $77dc20320068f1ee$var$determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) return {\n start: pos - size / 2,\n end: pos + size / 2\n };\n else if (angle < min || angle > max) return {\n start: pos - size,\n end: pos\n };\n return {\n start: pos,\n end: pos + size\n };\n}\nfunction $77dc20320068f1ee$var$fitWithPointLabels(scale) {\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? (0, $02b6f511cc6c123c$export$56c0d5a1e737357d) / valueCount : 0;\n for(let i = 0; i < valueCount; i++){\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(opts.font);\n const textSize = $77dc20320068f1ee$var$measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n const angleRadians = (0, $02b6f511cc6c123c$export$28f7fcd39efa255)(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round((0, $02b6f511cc6c123c$export$3a6d5c9ae78a2c08)(angleRadians));\n const hLimits = $77dc20320068f1ee$var$determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = $77dc20320068f1ee$var$determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n $77dc20320068f1ee$var$updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b);\n scale._pointLabelItems = $77dc20320068f1ee$var$buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction $77dc20320068f1ee$var$updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\nfunction $77dc20320068f1ee$var$createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const { extra: extra, additionalAngle: additionalAngle, padding: padding, size: size } = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round((0, $02b6f511cc6c123c$export$3a6d5c9ae78a2c08)((0, $02b6f511cc6c123c$export$28f7fcd39efa255)(pointLabelPosition.angle + (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd))));\n const y = $77dc20320068f1ee$var$yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = $77dc20320068f1ee$var$getTextAlignForAngle(angle);\n const left = $77dc20320068f1ee$var$leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n visible: true,\n x: pointLabelPosition.x,\n y: y,\n textAlign: textAlign,\n left: left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\nfunction $77dc20320068f1ee$var$isNotOverlapped(item, area) {\n if (!area) return true;\n const { left: left, top: top, right: right, bottom: bottom } = item;\n const apexesInArea = (0, $02b6f511cc6c123c$export$e7094788287c5e9b)({\n x: left,\n y: top\n }, area) || (0, $02b6f511cc6c123c$export$e7094788287c5e9b)({\n x: left,\n y: bottom\n }, area) || (0, $02b6f511cc6c123c$export$e7094788287c5e9b)({\n x: right,\n y: top\n }, area) || (0, $02b6f511cc6c123c$export$e7094788287c5e9b)({\n x: right,\n y: bottom\n }, area);\n return !apexesInArea;\n}\nfunction $77dc20320068f1ee$var$buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const { centerPointLabels: centerPointLabels, display: display } = opts.pointLabels;\n const itemOpts = {\n extra: $77dc20320068f1ee$var$getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? (0, $02b6f511cc6c123c$export$56c0d5a1e737357d) / valueCount : 0\n };\n let area;\n for(let i = 0; i < valueCount; i++){\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n const item = $77dc20320068f1ee$var$createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === \"auto\") {\n item.visible = $77dc20320068f1ee$var$isNotOverlapped(item, area);\n if (item.visible) area = item;\n }\n }\n return items;\n}\nfunction $77dc20320068f1ee$var$getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) return \"center\";\n else if (angle < 180) return \"left\";\n return \"right\";\n}\nfunction $77dc20320068f1ee$var$leftForTextAlign(x, w, align) {\n if (align === \"right\") x -= w;\n else if (align === \"center\") x -= w / 2;\n return x;\n}\nfunction $77dc20320068f1ee$var$yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) y -= h / 2;\n else if (angle > 270 || angle < 90) y -= h;\n return y;\n}\nfunction $77dc20320068f1ee$var$drawPointLabelBox(ctx, opts, item) {\n const { left: left, top: top, right: right, bottom: bottom } = item;\n const { backdropColor: backdropColor } = opts;\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(backdropColor)) {\n const borderRadius = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(opts.borderRadius);\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n (0, $02b6f511cc6c123c$export$1fbe638ecf81657e)(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius\n });\n ctx.fill();\n } else ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n}\nfunction $77dc20320068f1ee$var$drawPointLabels(scale, labelCount) {\n const { ctx: ctx, options: { pointLabels: pointLabels } } = scale;\n for(let i = labelCount - 1; i >= 0; i--){\n const item = scale._pointLabelItems[i];\n if (!item.visible) continue;\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n $77dc20320068f1ee$var$drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(optsAtIndex.font);\n const { x: x, y: y, textAlign: textAlign } = item;\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: \"middle\"\n });\n }\n}\nfunction $77dc20320068f1ee$var$pathRadiusLine(scale, radius, circular, labelCount) {\n const { ctx: ctx } = scale;\n if (circular) ctx.arc(scale.xCenter, scale.yCenter, radius, 0, (0, $02b6f511cc6c123c$export$971d5caa766a69d7));\n else {\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n for(let i = 1; i < labelCount; i++){\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\nfunction $77dc20320068f1ee$var$drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n const { color: color, lineWidth: lineWidth } = gridLineOpts;\n if (!circular && !labelCount || !color || !lineWidth || radius < 0) return;\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n ctx.beginPath();\n $77dc20320068f1ee$var$pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\nfunction $77dc20320068f1ee$var$createPointLabelContext(parent, index, label) {\n return (0, $02b6f511cc6c123c$export$35e795649ee09318)(parent, {\n label: label,\n index: index,\n type: \"pointLabel\"\n });\n}\nclass $77dc20320068f1ee$export$cfafc36d95386d38 extends $77dc20320068f1ee$var$LinearScaleBase {\n setDimensions() {\n const padding = this._padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)($77dc20320068f1ee$var$getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n determineDataLimits() {\n const { min: min, max: max } = this.getMinMax(false);\n this.min = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(min) && !isNaN(min) ? min : 0;\n this.max = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(max) && !isNaN(max) ? max : 0;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n return Math.ceil(this.drawingArea / $77dc20320068f1ee$var$getTickBackdropHeight(this.options));\n }\n generateTickLabels(ticks) {\n $77dc20320068f1ee$var$LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n this._pointLabels = this.getLabels().map((value, index)=>{\n const label = (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.pointLabels.callback, [\n value,\n index\n ], this);\n return label || label === 0 ? label : \"\";\n }).filter((v, i)=>this.chart.getDataVisibility(i));\n }\n fit() {\n const opts = this.options;\n if (opts.display && opts.pointLabels.display) $77dc20320068f1ee$var$fitWithPointLabels(this);\n else this.setCenterPoint(0, 0, 0, 0);\n }\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n getIndexAngle(index) {\n const angleMultiplier = (0, $02b6f511cc6c123c$export$971d5caa766a69d7) / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n return (0, $02b6f511cc6c123c$export$28f7fcd39efa255)(index * angleMultiplier + (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(startAngle));\n }\n getDistanceFromCenterForValue(value) {\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(value)) return NaN;\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) return (this.max - value) * scalingFactor;\n return (value - this.min) * scalingFactor;\n }\n getValueForDistanceFromCenter(distance) {\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(distance)) return NaN;\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return $77dc20320068f1ee$var$createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd) + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle: angle\n };\n }\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n getPointLabelPosition(index) {\n const { left: left, top: top, right: right, bottom: bottom } = this._pointLabelItems[index];\n return {\n left: left,\n top: top,\n right: right,\n bottom: bottom\n };\n }\n drawBackground() {\n const { backgroundColor: backgroundColor, grid: { circular: circular } } = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n $77dc20320068f1ee$var$pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const { angleLines: angleLines, grid: grid, border: border } = opts;\n const labelCount = this._pointLabels.length;\n let i, offset, position;\n if (opts.pointLabels.display) $77dc20320068f1ee$var$drawPointLabels(this, labelCount);\n if (grid.display) this.ticks.forEach((tick, index)=>{\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n $77dc20320068f1ee$var$drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n if (angleLines.display) {\n ctx.save();\n for(i = labelCount - 1; i >= 0; i--){\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const { color: color, lineWidth: lineWidth } = optsAtIndex;\n if (!lineWidth || !color) continue;\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n ctx.restore();\n }\n }\n drawBorder() {}\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n if (!tickOpts.display) return;\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n this.ticks.forEach((tick, index)=>{\n if (index === 0 && !opts.reverse) return;\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(optsAtIndex.backdropPadding);\n ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height);\n }\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth\n });\n });\n ctx.restore();\n }\n drawTitle() {}\n constructor(cfg){\n super(cfg);\n this.xCenter = undefined;\n this.yCenter = undefined;\n this.drawingArea = undefined;\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$cfafc36d95386d38, \"id\", \"radialLinear\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$cfafc36d95386d38, \"defaults\", {\n display: true,\n animate: true,\n position: \"chartArea\",\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n grid: {\n circular: false\n },\n startAngle: 0,\n ticks: {\n showLabelBackdrop: true,\n callback: (0, $02b6f511cc6c123c$export$91477dc880baac21).formatters.numeric\n },\n pointLabels: {\n backdropColor: undefined,\n backdropPadding: 2,\n display: true,\n font: {\n size: 10\n },\n callback (label) {\n return label;\n },\n padding: 5,\n centerPointLabels: false\n }\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$cfafc36d95386d38, \"defaultRoutes\", {\n \"angleLines.color\": \"borderColor\",\n \"pointLabels.color\": \"color\",\n \"ticks.color\": \"color\"\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$cfafc36d95386d38, \"descriptors\", {\n angleLines: {\n _fallback: \"grid\"\n }\n});\nconst $77dc20320068f1ee$var$INTERVALS = {\n millisecond: {\n common: true,\n size: 1,\n steps: 1000\n },\n second: {\n common: true,\n size: 1000,\n steps: 60\n },\n minute: {\n common: true,\n size: 60000,\n steps: 60\n },\n hour: {\n common: true,\n size: 3600000,\n steps: 24\n },\n day: {\n common: true,\n size: 86400000,\n steps: 30\n },\n week: {\n common: false,\n size: 604800000,\n steps: 4\n },\n month: {\n common: true,\n size: 2.628e9,\n steps: 12\n },\n quarter: {\n common: false,\n size: 7.884e9,\n steps: 4\n },\n year: {\n common: true,\n size: 3.154e10\n }\n};\nconst $77dc20320068f1ee$var$UNITS = /* #__PURE__ */ Object.keys($77dc20320068f1ee$var$INTERVALS);\nfunction $77dc20320068f1ee$var$sorter(a, b) {\n return a - b;\n}\nfunction $77dc20320068f1ee$var$parse(scale, input) {\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(input)) return null;\n const adapter = scale._adapter;\n const { parser: parser, round: round, isoWeekday: isoWeekday } = scale._parseOpts;\n let value = input;\n if (typeof parser === \"function\") value = parser(value);\n if (!(0, $02b6f511cc6c123c$export$39b482c5e57630a8)(value)) value = typeof parser === \"string\" ? adapter.parse(value, parser) : adapter.parse(value);\n if (value === null) return null;\n if (round) value = round === \"week\" && ((0, $02b6f511cc6c123c$export$d141bba7fdc215a3)(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, \"isoWeek\", isoWeekday) : adapter.startOf(value, round);\n return +value;\n}\nfunction $77dc20320068f1ee$var$determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = $77dc20320068f1ee$var$UNITS.length;\n for(let i = $77dc20320068f1ee$var$UNITS.indexOf(minUnit); i < ilen - 1; ++i){\n const interval = $77dc20320068f1ee$var$INTERVALS[$77dc20320068f1ee$var$UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) return $77dc20320068f1ee$var$UNITS[i];\n }\n return $77dc20320068f1ee$var$UNITS[ilen - 1];\n}\nfunction $77dc20320068f1ee$var$determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for(let i = $77dc20320068f1ee$var$UNITS.length - 1; i >= $77dc20320068f1ee$var$UNITS.indexOf(minUnit); i--){\n const unit = $77dc20320068f1ee$var$UNITS[i];\n if ($77dc20320068f1ee$var$INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) return unit;\n }\n return $77dc20320068f1ee$var$UNITS[minUnit ? $77dc20320068f1ee$var$UNITS.indexOf(minUnit) : 0];\n}\nfunction $77dc20320068f1ee$var$determineMajorUnit(unit) {\n for(let i = $77dc20320068f1ee$var$UNITS.indexOf(unit) + 1, ilen = $77dc20320068f1ee$var$UNITS.length; i < ilen; ++i){\n if ($77dc20320068f1ee$var$INTERVALS[$77dc20320068f1ee$var$UNITS[i]].common) return $77dc20320068f1ee$var$UNITS[i];\n }\n}\nfunction $77dc20320068f1ee$var$addTick(ticks, time, timestamps) {\n if (!timestamps) ticks[time] = true;\n else if (timestamps.length) {\n const { lo: lo, hi: hi } = (0, $02b6f511cc6c123c$export$2ed0fc6709e59212)(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\nfunction $77dc20320068f1ee$var$setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n for(major = first; major <= last; major = +adapter.add(major, 1, majorUnit)){\n index = map[major];\n if (index >= 0) ticks[index].major = true;\n }\n return ticks;\n}\nfunction $77dc20320068f1ee$var$ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n const map = {};\n const ilen = values.length;\n let i, value;\n for(i = 0; i < ilen; ++i){\n value = values[i];\n map[value] = i;\n ticks.push({\n value: value,\n major: false\n });\n }\n return ilen === 0 || !majorUnit ? ticks : $77dc20320068f1ee$var$setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass $77dc20320068f1ee$export$a894c72689ff3ec extends $77dc20320068f1ee$export$d60cfc58d3c358b6 {\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n const adapter = this._adapter = new $77dc20320068f1ee$export$f32766ea09ec8bc4._date(scaleOpts.adapters.date);\n adapter.init(opts);\n (0, $02b6f511cc6c123c$export$555508cbc6add439)(time.displayFormats, adapter.formats());\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n super.init(scaleOpts);\n this._normalized = opts.normalized;\n }\n parse(raw, index) {\n if (raw === undefined) return null;\n return $77dc20320068f1ee$var$parse(this, raw);\n }\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || \"day\";\n let { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) min = Math.min(min, bounds.min);\n if (!maxDefined && !isNaN(bounds.max)) max = Math.max(max, bounds.max);\n }\n if (!minDefined || !maxDefined) {\n _applyBounds(this._getLabelBounds());\n if (options.bounds !== \"ticks\" || options.ticks.source !== \"labels\") _applyBounds(this.getMinMax(false));\n }\n min = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {\n min: min,\n max: max\n };\n }\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === \"labels\" ? this.getLabelTimestamps() : this._generate();\n if (options.bounds === \"ticks\" && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n const min = this.min;\n const max = this.max;\n const ticks = (0, $02b6f511cc6c123c$export$c03999cb2f36933f)(timestamps, min, max);\n this._unit = timeOpts.unit || (tickOpts.autoSkip ? $77dc20320068f1ee$var$determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : $77dc20320068f1ee$var$determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === \"year\" ? undefined : $77dc20320068f1ee$var$determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n if (options.reverse) ticks.reverse();\n return $77dc20320068f1ee$var$ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n afterAutoSkip() {\n if (this.options.offsetAfterAutoskip) this.initOffsets(this.ticks.map((tick)=>+tick.value));\n }\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) start = 1 - first;\n else start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) end = last;\n else end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(start, 0, limit);\n end = (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(end, 0, limit);\n this._offsets = {\n start: start,\n end: end,\n factor: 1 / (start + 1 + end)\n };\n }\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n const minor = timeOpts.unit || $77dc20320068f1ee$var$determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(options.ticks.stepSize, 1);\n const weekday = minor === \"week\" ? timeOpts.isoWeekday : false;\n const hasWeekday = (0, $02b6f511cc6c123c$export$d141bba7fdc215a3)(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n if (hasWeekday) first = +adapter.startOf(first, \"isoWeek\", weekday);\n first = +adapter.startOf(first, hasWeekday ? \"day\" : minor);\n if (adapter.diff(max, min, minor) > 100000 * stepSize) throw new Error(min + \" and \" + max + \" are too far apart with stepSize of \" + stepSize + \" \" + minor);\n const timestamps = options.ticks.source === \"data\" && this.getDataTimestamps();\n for(time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++)$77dc20320068f1ee$var$addTick(ticks, time, timestamps);\n if (time === max || options.bounds === \"ticks\" || count === 1) $77dc20320068f1ee$var$addTick(ticks, time, timestamps);\n return Object.keys(ticks).sort($77dc20320068f1ee$var$sorter).map((x)=>+x);\n }\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n if (timeOpts.tooltipFormat) return adapter.format(value, timeOpts.tooltipFormat);\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n if (formatter) return (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(formatter, [\n time,\n index,\n ticks\n ], this);\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n generateTickLabels(ticks) {\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n return {\n w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,\n h: tickLabelWidth * sinRotation + tickFontSize * cosRotation\n };\n }\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, $77dc20320068f1ee$var$ticksFromTimestamps(this, [\n exampleTime\n ], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n if (timestamps.length) return timestamps;\n const metas = this.getMatchingVisibleMetas();\n if (this._normalized && metas.length) return this._cache.data = metas[0].controller.getAllParsedValues(this);\n for(i = 0, ilen = metas.length; i < ilen; ++i)timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n return this._cache.data = this.normalize(timestamps);\n }\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n if (timestamps.length) return timestamps;\n const labels = this.getLabels();\n for(i = 0, ilen = labels.length; i < ilen; ++i)timestamps.push($77dc20320068f1ee$var$parse(this, labels[i]));\n return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);\n }\n normalize(values) {\n return (0, $02b6f511cc6c123c$export$71511d61b312f219)(values.sort($77dc20320068f1ee$var$sorter));\n }\n constructor(props){\n super(props);\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n this._unit = \"day\";\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$a894c72689ff3ec, \"id\", \"time\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$a894c72689ff3ec, \"defaults\", {\n bounds: \"data\",\n adapters: {},\n time: {\n parser: false,\n unit: false,\n round: false,\n isoWeekday: false,\n minUnit: \"millisecond\",\n displayFormats: {}\n },\n ticks: {\n source: \"auto\",\n callback: false,\n major: {\n enabled: false\n }\n }\n});\nfunction $77dc20320068f1ee$var$interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) ({ lo: lo, hi: hi } = (0, $02b6f511cc6c123c$export$ef35774e6d314e91)(table, \"pos\", val));\n ({ pos: prevSource, time: prevTarget } = table[lo]);\n ({ pos: nextSource, time: nextTarget } = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) ({ lo: lo, hi: hi } = (0, $02b6f511cc6c123c$export$ef35774e6d314e91)(table, \"time\", val));\n ({ time: prevSource, pos: prevTarget } = table[lo]);\n ({ time: nextSource, pos: nextTarget } = table[hi]);\n }\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass $77dc20320068f1ee$export$85df64a8eb6dc986 extends $77dc20320068f1ee$export$a894c72689ff3ec {\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = $77dc20320068f1ee$var$interpolate(table, this.min);\n this._tableRange = $77dc20320068f1ee$var$interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n buildLookupTable(timestamps) {\n const { min: min, max: max } = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n for(i = 0, ilen = timestamps.length; i < ilen; ++i){\n curr = timestamps[i];\n if (curr >= min && curr <= max) items.push(curr);\n }\n if (items.length < 2) return [\n {\n time: min,\n pos: 0\n },\n {\n time: max,\n pos: 1\n }\n ];\n for(i = 0, ilen = items.length; i < ilen; ++i){\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n if (Math.round((next + prev) / 2) !== curr) table.push({\n time: curr,\n pos: i / (ilen - 1)\n });\n }\n return table;\n }\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) timestamps.splice(0, 0, min);\n if (!timestamps.includes(max) || timestamps.length === 1) timestamps.push(max);\n return timestamps.sort((a, b)=>a - b);\n }\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n if (timestamps.length) return timestamps;\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) timestamps = this.normalize(data.concat(label));\n else timestamps = data.length ? data : label;\n timestamps = this._cache.all = timestamps;\n return timestamps;\n }\n getDecimalForValue(value) {\n return ($77dc20320068f1ee$var$interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return $77dc20320068f1ee$var$interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n constructor(props){\n super(props);\n this._table = [];\n this._minPos = undefined;\n this._tableRange = undefined;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$85df64a8eb6dc986, \"id\", \"timeseries\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$85df64a8eb6dc986, \"defaults\", $77dc20320068f1ee$export$a894c72689ff3ec.defaults);\nvar $77dc20320068f1ee$export$bcac1c16f1530ec2 = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n CategoryScale: $77dc20320068f1ee$export$29e663ba4d09fe7,\n LinearScale: $77dc20320068f1ee$export$e7f4e5e8656f0b93,\n LogarithmicScale: $77dc20320068f1ee$export$85295eaf7cb3ac3e,\n RadialLinearScale: $77dc20320068f1ee$export$cfafc36d95386d38,\n TimeScale: $77dc20320068f1ee$export$a894c72689ff3ec,\n TimeSeriesScale: $77dc20320068f1ee$export$85df64a8eb6dc986\n});\nconst $77dc20320068f1ee$export$e8959e79e3af550f = [\n $77dc20320068f1ee$export$a6506504f799c5d5,\n $77dc20320068f1ee$export$7a5d735b2ab6389d,\n $77dc20320068f1ee$export$8b3ca321c77fdea6,\n $77dc20320068f1ee$export$bcac1c16f1530ec2\n];\n\n\n(0, $77dc20320068f1ee$export$acaa6426d77a227e).register(...(0, $77dc20320068f1ee$export$e8959e79e3af550f));\nvar $8b0f4f5753bf297d$export$2e2bcd8739ae039 = (0, $77dc20320068f1ee$export$acaa6426d77a227e);\n\n\n/**!\n * Sortable 1.15.1\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */ function $3bc6321cdb0e9401$var$ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function(sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction $3bc6321cdb0e9401$var$_objectSpread2(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) $3bc6321cdb0e9401$var$ownKeys(Object(source), true).forEach(function(key) {\n $3bc6321cdb0e9401$var$_defineProperty(target, key, source[key]);\n });\n else if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n else $3bc6321cdb0e9401$var$ownKeys(Object(source)).forEach(function(key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\n}\nfunction $3bc6321cdb0e9401$var$_typeof(obj) {\n \"@babel/helpers - typeof\";\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") $3bc6321cdb0e9401$var$_typeof = function(obj) {\n return typeof obj;\n };\n else $3bc6321cdb0e9401$var$_typeof = function(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n return $3bc6321cdb0e9401$var$_typeof(obj);\n}\nfunction $3bc6321cdb0e9401$var$_defineProperty(obj, key, value) {\n if (key in obj) Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n else obj[key] = value;\n return obj;\n}\nfunction $3bc6321cdb0e9401$var$_extends() {\n $3bc6321cdb0e9401$var$_extends = Object.assign || function(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i];\n for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];\n }\n return target;\n };\n return $3bc6321cdb0e9401$var$_extends.apply(this, arguments);\n}\nfunction $3bc6321cdb0e9401$var$_objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for(i = 0; i < sourceKeys.length; i++){\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction $3bc6321cdb0e9401$var$_objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = $3bc6321cdb0e9401$var$_objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for(i = 0; i < sourceSymbolKeys.length; i++){\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction $3bc6321cdb0e9401$var$_toConsumableArray(arr) {\n return $3bc6321cdb0e9401$var$_arrayWithoutHoles(arr) || $3bc6321cdb0e9401$var$_iterableToArray(arr) || $3bc6321cdb0e9401$var$_unsupportedIterableToArray(arr) || $3bc6321cdb0e9401$var$_nonIterableSpread();\n}\nfunction $3bc6321cdb0e9401$var$_arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return $3bc6321cdb0e9401$var$_arrayLikeToArray(arr);\n}\nfunction $3bc6321cdb0e9401$var$_iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction $3bc6321cdb0e9401$var$_unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return $3bc6321cdb0e9401$var$_arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $3bc6321cdb0e9401$var$_arrayLikeToArray(o, minLen);\n}\nfunction $3bc6321cdb0e9401$var$_arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction $3bc6321cdb0e9401$var$_nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nvar $3bc6321cdb0e9401$var$version = \"1.15.1\";\nfunction $3bc6321cdb0e9401$var$userAgent(pattern) {\n if (typeof window !== \"undefined\" && window.navigator) return !!/*@__PURE__*/ navigator.userAgent.match(pattern);\n}\nvar $3bc6321cdb0e9401$var$IE11OrLess = $3bc6321cdb0e9401$var$userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar $3bc6321cdb0e9401$var$Edge = $3bc6321cdb0e9401$var$userAgent(/Edge/i);\nvar $3bc6321cdb0e9401$var$FireFox = $3bc6321cdb0e9401$var$userAgent(/firefox/i);\nvar $3bc6321cdb0e9401$var$Safari = $3bc6321cdb0e9401$var$userAgent(/safari/i) && !$3bc6321cdb0e9401$var$userAgent(/chrome/i) && !$3bc6321cdb0e9401$var$userAgent(/android/i);\nvar $3bc6321cdb0e9401$var$IOS = $3bc6321cdb0e9401$var$userAgent(/iP(ad|od|hone)/i);\nvar $3bc6321cdb0e9401$var$ChromeForAndroid = $3bc6321cdb0e9401$var$userAgent(/chrome/i) && $3bc6321cdb0e9401$var$userAgent(/android/i);\nvar $3bc6321cdb0e9401$var$captureMode = {\n capture: false,\n passive: false\n};\nfunction $3bc6321cdb0e9401$var$on(el, event, fn) {\n el.addEventListener(event, fn, !$3bc6321cdb0e9401$var$IE11OrLess && $3bc6321cdb0e9401$var$captureMode);\n}\nfunction $3bc6321cdb0e9401$var$off(el, event, fn) {\n el.removeEventListener(event, fn, !$3bc6321cdb0e9401$var$IE11OrLess && $3bc6321cdb0e9401$var$captureMode);\n}\nfunction $3bc6321cdb0e9401$var$matches(/**HTMLElement*/ el, /**String*/ selector) {\n if (!selector) return;\n selector[0] === \">\" && (selector = selector.substring(1));\n if (el) try {\n if (el.matches) return el.matches(selector);\n else if (el.msMatchesSelector) return el.msMatchesSelector(selector);\n else if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);\n } catch (_) {\n return false;\n }\n return false;\n}\nfunction $3bc6321cdb0e9401$var$getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction $3bc6321cdb0e9401$var$closest(/**HTMLElement*/ el, /**String*/ selector, /**HTMLElement*/ ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === \">\" ? el.parentNode === ctx && $3bc6321cdb0e9401$var$matches(el, selector) : $3bc6321cdb0e9401$var$matches(el, selector)) || includeCTX && el === ctx) return el;\n if (el === ctx) break;\n /* jshint boss:true */ }while (el = $3bc6321cdb0e9401$var$getParentOrHost(el));\n }\n return null;\n}\nvar $3bc6321cdb0e9401$var$R_SPACE = /\\s+/g;\nfunction $3bc6321cdb0e9401$var$toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) el.classList[state ? \"add\" : \"remove\"](name);\n else {\n var className = (\" \" + el.className + \" \").replace($3bc6321cdb0e9401$var$R_SPACE, \" \").replace(\" \" + name + \" \", \" \");\n el.className = (className + (state ? \" \" + name : \"\")).replace($3bc6321cdb0e9401$var$R_SPACE, \" \");\n }\n }\n}\nfunction $3bc6321cdb0e9401$var$css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) val = document.defaultView.getComputedStyle(el, \"\");\n else if (el.currentStyle) val = el.currentStyle;\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf(\"webkit\") === -1) prop = \"-webkit-\" + prop;\n style[prop] = val + (typeof val === \"string\" ? \"\" : \"px\");\n }\n }\n}\nfunction $3bc6321cdb0e9401$var$matrix(el, selfOnly) {\n var appliedTransforms = \"\";\n if (typeof el === \"string\") appliedTransforms = el;\n else do {\n var transform = $3bc6321cdb0e9401$var$css(el, \"transform\");\n if (transform && transform !== \"none\") appliedTransforms = transform + \" \" + appliedTransforms;\n /* jshint boss:true */ }while (!selfOnly && (el = el.parentNode));\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */ return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction $3bc6321cdb0e9401$var$find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length;\n if (iterator) for(; i < n; i++)iterator(list[i], i);\n return list;\n }\n return [];\n}\nfunction $3bc6321cdb0e9401$var$getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) return scrollingElement;\n else return document.documentElement;\n}\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */ function $3bc6321cdb0e9401$var$getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== $3bc6321cdb0e9401$var$getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!$3bc6321cdb0e9401$var$IE11OrLess) {\n do if (container && container.getBoundingClientRect && ($3bc6321cdb0e9401$var$css(container, \"transform\") !== \"none\" || relativeToNonStaticParent && $3bc6321cdb0e9401$var$css(container, \"position\") !== \"static\")) {\n var containerRect = container.getBoundingClientRect();\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt($3bc6321cdb0e9401$var$css(container, \"border-top-width\"));\n left -= containerRect.left + parseInt($3bc6321cdb0e9401$var$css(container, \"border-left-width\"));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = $3bc6321cdb0e9401$var$matrix(container || el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\r\n * Returns the content rect of the element (bounding rect minus border and padding)\r\n * @param {HTMLElement} el \r\n */ function $3bc6321cdb0e9401$var$getContentRect(el) {\n var rect = $3bc6321cdb0e9401$var$getRect(el);\n var paddingLeft = parseInt($3bc6321cdb0e9401$var$css(el, \"padding-left\")), paddingTop = parseInt($3bc6321cdb0e9401$var$css(el, \"padding-top\")), paddingRight = parseInt($3bc6321cdb0e9401$var$css(el, \"padding-right\")), paddingBottom = parseInt($3bc6321cdb0e9401$var$css(el, \"padding-bottom\"));\n rect.top += paddingTop + parseInt($3bc6321cdb0e9401$var$css(el, \"border-top-width\"));\n rect.left += paddingLeft + parseInt($3bc6321cdb0e9401$var$css(el, \"border-left-width\"));\n // Client Width/Height includes padding only\n rect.width = el.clientWidth - paddingLeft - paddingRight;\n rect.height = el.clientHeight - paddingTop - paddingBottom;\n rect.bottom = rect.top + rect.height;\n rect.right = rect.left + rect.width;\n return rect;\n}\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */ function $3bc6321cdb0e9401$var$isScrolledPast(el, elSide, parentSide) {\n var parent = $3bc6321cdb0e9401$var$getParentAutoScrollElement(el, true), elSideVal = $3bc6321cdb0e9401$var$getRect(el)[elSide];\n /* jshint boss:true */ while(parent){\n var parentSideVal = $3bc6321cdb0e9401$var$getRect(parent)[parentSide], visible = void 0;\n if (parentSide === \"top\" || parentSide === \"left\") visible = elSideVal >= parentSideVal;\n else visible = elSideVal <= parentSideVal;\n if (!visible) return parent;\n if (parent === $3bc6321cdb0e9401$var$getWindowScrollingElement()) break;\n parent = $3bc6321cdb0e9401$var$getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */ function $3bc6321cdb0e9401$var$getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0, i = 0, children = el.children;\n while(i < children.length){\n if (children[i].style.display !== \"none\" && children[i] !== $3bc6321cdb0e9401$export$31b3ca70d8f57423.ghost && (includeDragEl || children[i] !== $3bc6321cdb0e9401$export$31b3ca70d8f57423.dragged) && $3bc6321cdb0e9401$var$closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) return children[i];\n currentChild++;\n }\n i++;\n }\n return null;\n}\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */ function $3bc6321cdb0e9401$var$lastChild(el, selector) {\n var last = el.lastElementChild;\n while(last && (last === $3bc6321cdb0e9401$export$31b3ca70d8f57423.ghost || $3bc6321cdb0e9401$var$css(last, \"display\") === \"none\" || selector && !$3bc6321cdb0e9401$var$matches(last, selector)))last = last.previousElementSibling;\n return last || null;\n}\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */ function $3bc6321cdb0e9401$var$index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) return -1;\n /* jshint boss:true */ while(el = el.previousElementSibling)if (el.nodeName.toUpperCase() !== \"TEMPLATE\" && el !== $3bc6321cdb0e9401$export$31b3ca70d8f57423.clone && (!selector || $3bc6321cdb0e9401$var$matches(el, selector))) index++;\n return index;\n}\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */ function $3bc6321cdb0e9401$var$getRelativeScrollOffset(el) {\n var offsetLeft = 0, offsetTop = 0, winScroller = $3bc6321cdb0e9401$var$getWindowScrollingElement();\n if (el) do {\n var elMatrix = $3bc6321cdb0e9401$var$matrix(el), scaleX = elMatrix.a, scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n }while (el !== winScroller && (el = el.parentNode));\n return [\n offsetLeft,\n offsetTop\n ];\n}\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */ function $3bc6321cdb0e9401$var$indexOfObject(arr, obj) {\n for(var i in arr){\n if (!arr.hasOwnProperty(i)) continue;\n for(var key in obj){\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction $3bc6321cdb0e9401$var$getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return $3bc6321cdb0e9401$var$getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = $3bc6321cdb0e9401$var$css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == \"auto\" || elemCSS.overflowX == \"scroll\") || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == \"auto\" || elemCSS.overflowY == \"scroll\")) {\n if (!elem.getBoundingClientRect || elem === document.body) return $3bc6321cdb0e9401$var$getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n while (elem = elem.parentNode);\n return $3bc6321cdb0e9401$var$getWindowScrollingElement();\n}\nfunction $3bc6321cdb0e9401$var$extend(dst, src) {\n if (dst && src) {\n for(var key in src)if (src.hasOwnProperty(key)) dst[key] = src[key];\n }\n return dst;\n}\nfunction $3bc6321cdb0e9401$var$isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar $3bc6321cdb0e9401$var$_throttleTimeout;\nfunction $3bc6321cdb0e9401$var$throttle(callback, ms) {\n return function() {\n if (!$3bc6321cdb0e9401$var$_throttleTimeout) {\n var args = arguments, _this = this;\n if (args.length === 1) callback.call(_this, args[0]);\n else callback.apply(_this, args);\n $3bc6321cdb0e9401$var$_throttleTimeout = setTimeout(function() {\n $3bc6321cdb0e9401$var$_throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction $3bc6321cdb0e9401$var$cancelThrottle() {\n clearTimeout($3bc6321cdb0e9401$var$_throttleTimeout);\n $3bc6321cdb0e9401$var$_throttleTimeout = void 0;\n}\nfunction $3bc6321cdb0e9401$var$scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction $3bc6321cdb0e9401$var$clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) return Polymer.dom(el).cloneNode(true);\n else if ($) return $(el).clone(true)[0];\n else return el.cloneNode(true);\n}\nfunction $3bc6321cdb0e9401$var$setRect(el, rect) {\n $3bc6321cdb0e9401$var$css(el, \"position\", \"absolute\");\n $3bc6321cdb0e9401$var$css(el, \"top\", rect.top);\n $3bc6321cdb0e9401$var$css(el, \"left\", rect.left);\n $3bc6321cdb0e9401$var$css(el, \"width\", rect.width);\n $3bc6321cdb0e9401$var$css(el, \"height\", rect.height);\n}\nfunction $3bc6321cdb0e9401$var$unsetRect(el) {\n $3bc6321cdb0e9401$var$css(el, \"position\", \"\");\n $3bc6321cdb0e9401$var$css(el, \"top\", \"\");\n $3bc6321cdb0e9401$var$css(el, \"left\", \"\");\n $3bc6321cdb0e9401$var$css(el, \"width\", \"\");\n $3bc6321cdb0e9401$var$css(el, \"height\", \"\");\n}\nvar $3bc6321cdb0e9401$var$expando = \"Sortable\" + new Date().getTime();\nfunction $3bc6321cdb0e9401$var$AnimationStateManager() {\n var animationStates = [], animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function(child) {\n if ($3bc6321cdb0e9401$var$css(child, \"display\") === \"none\" || child === $3bc6321cdb0e9401$export$31b3ca70d8f57423.ghost) return;\n animationStates.push({\n target: child,\n rect: $3bc6321cdb0e9401$var$getRect(child)\n });\n var fromRect = $3bc6321cdb0e9401$var$_objectSpread2({}, animationStates[animationStates.length - 1].rect);\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = $3bc6321cdb0e9401$var$matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice($3bc6321cdb0e9401$var$indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === \"function\") callback();\n return;\n }\n var animating = false, animationTime = 0;\n animationStates.forEach(function(state) {\n var time = 0, target = state.target, fromRect = target.fromRect, toRect = $3bc6321cdb0e9401$var$getRect(target), prevFromRect = target.prevFromRect, prevToRect = target.prevToRect, animatingRect = state.rect, targetMatrix = $3bc6321cdb0e9401$var$matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) // Could also check if animatingRect is between fromRect and toRect\n {\n if ($3bc6321cdb0e9401$var$isRectEqual(prevFromRect, toRect) && !$3bc6321cdb0e9401$var$isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) // If returning to same place as started from animation and on same axis\n time = $3bc6321cdb0e9401$var$calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n // if fromRect != toRect: animate\n if (!$3bc6321cdb0e9401$var$isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) time = _this.options.animation;\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function() {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === \"function\") callback();\n } else animationCallbackId = setTimeout(function() {\n if (typeof callback === \"function\") callback();\n }, animationTime);\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n $3bc6321cdb0e9401$var$css(target, \"transition\", \"\");\n $3bc6321cdb0e9401$var$css(target, \"transform\", \"\");\n var elMatrix = $3bc6321cdb0e9401$var$matrix(this.el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d, translateX = (currentRect.left - toRect.left) / (scaleX || 1), translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n $3bc6321cdb0e9401$var$css(target, \"transform\", \"translate3d(\" + translateX + \"px,\" + translateY + \"px,0)\");\n this.forRepaintDummy = $3bc6321cdb0e9401$var$repaint(target); // repaint\n $3bc6321cdb0e9401$var$css(target, \"transition\", \"transform \" + duration + \"ms\" + (this.options.easing ? \" \" + this.options.easing : \"\"));\n $3bc6321cdb0e9401$var$css(target, \"transform\", \"translate3d(0,0,0)\");\n typeof target.animated === \"number\" && clearTimeout(target.animated);\n target.animated = setTimeout(function() {\n $3bc6321cdb0e9401$var$css(target, \"transition\", \"\");\n $3bc6321cdb0e9401$var$css(target, \"transform\", \"\");\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction $3bc6321cdb0e9401$var$repaint(target) {\n return target.offsetWidth;\n}\nfunction $3bc6321cdb0e9401$var$calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\nvar $3bc6321cdb0e9401$var$plugins = [];\nvar $3bc6321cdb0e9401$var$defaults = {\n initializeByDefault: true\n};\nvar $3bc6321cdb0e9401$var$PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for(var option in $3bc6321cdb0e9401$var$defaults)if ($3bc6321cdb0e9401$var$defaults.hasOwnProperty(option) && !(option in plugin)) plugin[option] = $3bc6321cdb0e9401$var$defaults[option];\n $3bc6321cdb0e9401$var$plugins.forEach(function(p) {\n if (p.pluginName === plugin.pluginName) throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n });\n $3bc6321cdb0e9401$var$plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function() {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + \"Global\";\n $3bc6321cdb0e9401$var$plugins.forEach(function(plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) sortable[plugin.pluginName][eventNameGlobal]($3bc6321cdb0e9401$var$_objectSpread2({\n sortable: sortable\n }, evt));\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) sortable[plugin.pluginName][eventName]($3bc6321cdb0e9401$var$_objectSpread2({\n sortable: sortable\n }, evt));\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n $3bc6321cdb0e9401$var$plugins.forEach(function(plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n // Add default options from plugin\n $3bc6321cdb0e9401$var$_extends(defaults, initialized.defaults);\n });\n for(var option in sortable.options){\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== \"undefined\") sortable.options[option] = modified;\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n $3bc6321cdb0e9401$var$plugins.forEach(function(plugin) {\n if (typeof plugin.eventProperties !== \"function\") return;\n $3bc6321cdb0e9401$var$_extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n $3bc6321cdb0e9401$var$plugins.forEach(function(plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === \"function\") modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n });\n return modifiedValue;\n }\n};\nfunction $3bc6321cdb0e9401$var$dispatchEvent(_ref) {\n var sortable = _ref.sortable, rootEl = _ref.rootEl, name = _ref.name, targetEl = _ref.targetEl, cloneEl = _ref.cloneEl, toEl = _ref.toEl, fromEl = _ref.fromEl, oldIndex = _ref.oldIndex, newIndex = _ref.newIndex, oldDraggableIndex = _ref.oldDraggableIndex, newDraggableIndex = _ref.newDraggableIndex, originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[$3bc6321cdb0e9401$var$expando];\n if (!sortable) return;\n var evt, options = sortable.options, onName = \"on\" + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !$3bc6321cdb0e9401$var$IE11OrLess && !$3bc6321cdb0e9401$var$Edge) evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n else {\n evt = document.createEvent(\"Event\");\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = $3bc6321cdb0e9401$var$_objectSpread2($3bc6321cdb0e9401$var$_objectSpread2({}, extraEventProperties), $3bc6321cdb0e9401$var$PluginManager.getEventProperties(name, sortable));\n for(var option in allEventProperties)evt[option] = allEventProperties[option];\n if (rootEl) rootEl.dispatchEvent(evt);\n if (options[onName]) options[onName].call(sortable, evt);\n}\nvar $3bc6321cdb0e9401$var$_excluded = [\n \"evt\"\n];\nvar $3bc6321cdb0e9401$var$pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, originalEvent = _ref.evt, data = $3bc6321cdb0e9401$var$_objectWithoutProperties(_ref, $3bc6321cdb0e9401$var$_excluded);\n $3bc6321cdb0e9401$var$PluginManager.pluginEvent.bind($3bc6321cdb0e9401$export$31b3ca70d8f57423)(eventName, sortable, $3bc6321cdb0e9401$var$_objectSpread2({\n dragEl: $3bc6321cdb0e9401$var$dragEl,\n parentEl: $3bc6321cdb0e9401$var$parentEl,\n ghostEl: $3bc6321cdb0e9401$var$ghostEl,\n rootEl: $3bc6321cdb0e9401$var$rootEl,\n nextEl: $3bc6321cdb0e9401$var$nextEl,\n lastDownEl: $3bc6321cdb0e9401$var$lastDownEl,\n cloneEl: $3bc6321cdb0e9401$var$cloneEl,\n cloneHidden: $3bc6321cdb0e9401$var$cloneHidden,\n dragStarted: $3bc6321cdb0e9401$var$moved,\n putSortable: $3bc6321cdb0e9401$var$putSortable,\n activeSortable: $3bc6321cdb0e9401$export$31b3ca70d8f57423.active,\n originalEvent: originalEvent,\n oldIndex: $3bc6321cdb0e9401$var$oldIndex,\n oldDraggableIndex: $3bc6321cdb0e9401$var$oldDraggableIndex,\n newIndex: $3bc6321cdb0e9401$var$newIndex,\n newDraggableIndex: $3bc6321cdb0e9401$var$newDraggableIndex,\n hideGhostForTarget: $3bc6321cdb0e9401$var$_hideGhostForTarget,\n unhideGhostForTarget: $3bc6321cdb0e9401$var$_unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n $3bc6321cdb0e9401$var$cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n $3bc6321cdb0e9401$var$cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction $3bc6321cdb0e9401$var$_dispatchEvent(info) {\n $3bc6321cdb0e9401$var$dispatchEvent($3bc6321cdb0e9401$var$_objectSpread2({\n putSortable: $3bc6321cdb0e9401$var$putSortable,\n cloneEl: $3bc6321cdb0e9401$var$cloneEl,\n targetEl: $3bc6321cdb0e9401$var$dragEl,\n rootEl: $3bc6321cdb0e9401$var$rootEl,\n oldIndex: $3bc6321cdb0e9401$var$oldIndex,\n oldDraggableIndex: $3bc6321cdb0e9401$var$oldDraggableIndex,\n newIndex: $3bc6321cdb0e9401$var$newIndex,\n newDraggableIndex: $3bc6321cdb0e9401$var$newDraggableIndex\n }, info));\n}\nvar $3bc6321cdb0e9401$var$dragEl, $3bc6321cdb0e9401$var$parentEl, $3bc6321cdb0e9401$var$ghostEl, $3bc6321cdb0e9401$var$rootEl, $3bc6321cdb0e9401$var$nextEl, $3bc6321cdb0e9401$var$lastDownEl, $3bc6321cdb0e9401$var$cloneEl, $3bc6321cdb0e9401$var$cloneHidden, $3bc6321cdb0e9401$var$oldIndex, $3bc6321cdb0e9401$var$newIndex, $3bc6321cdb0e9401$var$oldDraggableIndex, $3bc6321cdb0e9401$var$newDraggableIndex, $3bc6321cdb0e9401$var$activeGroup, $3bc6321cdb0e9401$var$putSortable, $3bc6321cdb0e9401$var$awaitingDragStarted = false, $3bc6321cdb0e9401$var$ignoreNextClick = false, $3bc6321cdb0e9401$var$sortables = [], $3bc6321cdb0e9401$var$tapEvt, $3bc6321cdb0e9401$var$touchEvt, $3bc6321cdb0e9401$var$lastDx, $3bc6321cdb0e9401$var$lastDy, $3bc6321cdb0e9401$var$tapDistanceLeft, $3bc6321cdb0e9401$var$tapDistanceTop, $3bc6321cdb0e9401$var$moved, $3bc6321cdb0e9401$var$lastTarget, $3bc6321cdb0e9401$var$lastDirection, $3bc6321cdb0e9401$var$pastFirstInvertThresh = false, $3bc6321cdb0e9401$var$isCircumstantialInvert = false, $3bc6321cdb0e9401$var$targetMoveDistance, // For positioning ghost absolutely\n$3bc6321cdb0e9401$var$ghostRelativeParent, $3bc6321cdb0e9401$var$ghostRelativeParentInitialScroll = [], // (left, top)\n$3bc6321cdb0e9401$var$_silent = false, $3bc6321cdb0e9401$var$savedInputChecked = [];\n/** @const */ var $3bc6321cdb0e9401$var$documentExists = typeof document !== \"undefined\", $3bc6321cdb0e9401$var$PositionGhostAbsolutely = $3bc6321cdb0e9401$var$IOS, $3bc6321cdb0e9401$var$CSSFloatProperty = $3bc6321cdb0e9401$var$Edge || $3bc6321cdb0e9401$var$IE11OrLess ? \"cssFloat\" : \"float\", // This will not pass for IE9, because IE9 DnD only works on anchors\n$3bc6321cdb0e9401$var$supportDraggable = $3bc6321cdb0e9401$var$documentExists && !$3bc6321cdb0e9401$var$ChromeForAndroid && !$3bc6321cdb0e9401$var$IOS && \"draggable\" in document.createElement(\"div\"), $3bc6321cdb0e9401$var$supportCssPointerEvents = function() {\n if (!$3bc6321cdb0e9401$var$documentExists) return;\n // false when <= IE11\n if ($3bc6321cdb0e9401$var$IE11OrLess) return false;\n var el = document.createElement(\"x\");\n el.style.cssText = \"pointer-events:auto\";\n return el.style.pointerEvents === \"auto\";\n}(), $3bc6321cdb0e9401$var$_detectDirection = function _detectDirection(el, options) {\n var elCSS = $3bc6321cdb0e9401$var$css(el), elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth), child1 = $3bc6321cdb0e9401$var$getChild(el, 0, options), child2 = $3bc6321cdb0e9401$var$getChild(el, 1, options), firstChildCSS = child1 && $3bc6321cdb0e9401$var$css(child1), secondChildCSS = child2 && $3bc6321cdb0e9401$var$css(child2), firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + $3bc6321cdb0e9401$var$getRect(child1).width, secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + $3bc6321cdb0e9401$var$getRect(child2).width;\n if (elCSS.display === \"flex\") return elCSS.flexDirection === \"column\" || elCSS.flexDirection === \"column-reverse\" ? \"vertical\" : \"horizontal\";\n if (elCSS.display === \"grid\") return elCSS.gridTemplateColumns.split(\" \").length <= 1 ? \"vertical\" : \"horizontal\";\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== \"none\") {\n var touchingSideChild2 = firstChildCSS[\"float\"] === \"left\" ? \"left\" : \"right\";\n return child2 && (secondChildCSS.clear === \"both\" || secondChildCSS.clear === touchingSideChild2) ? \"vertical\" : \"horizontal\";\n }\n return child1 && (firstChildCSS.display === \"block\" || firstChildCSS.display === \"flex\" || firstChildCSS.display === \"table\" || firstChildCSS.display === \"grid\" || firstChildWidth >= elWidth && elCSS[$3bc6321cdb0e9401$var$CSSFloatProperty] === \"none\" || child2 && elCSS[$3bc6321cdb0e9401$var$CSSFloatProperty] === \"none\" && firstChildWidth + secondChildWidth > elWidth) ? \"vertical\" : \"horizontal\";\n}, $3bc6321cdb0e9401$var$_dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top, dragElS2Opp = vertical ? dragRect.right : dragRect.bottom, dragElOppLength = vertical ? dragRect.width : dragRect.height, targetS1Opp = vertical ? targetRect.left : targetRect.top, targetS2Opp = vertical ? targetRect.right : targetRect.bottom, targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n}, /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */ $3bc6321cdb0e9401$var$_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n $3bc6321cdb0e9401$var$sortables.some(function(sortable) {\n var threshold = sortable[$3bc6321cdb0e9401$var$expando].options.emptyInsertThreshold;\n if (!threshold || $3bc6321cdb0e9401$var$lastChild(sortable)) return;\n var rect = $3bc6321cdb0e9401$var$getRect(sortable), insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) return ret = sortable;\n });\n return ret;\n}, $3bc6321cdb0e9401$var$_prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function(to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) // Default pull value\n // Default pull and put value if same group\n return true;\n else if (value == null || value === false) return false;\n else if (pull && value === \"clone\") return value;\n else if (typeof value === \"function\") return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === \"string\" && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || $3bc6321cdb0e9401$var$_typeof(originalGroup) != \"object\") originalGroup = {\n name: originalGroup\n };\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n}, $3bc6321cdb0e9401$var$_hideGhostForTarget = function _hideGhostForTarget() {\n if (!$3bc6321cdb0e9401$var$supportCssPointerEvents && $3bc6321cdb0e9401$var$ghostEl) $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"display\", \"none\");\n}, $3bc6321cdb0e9401$var$_unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!$3bc6321cdb0e9401$var$supportCssPointerEvents && $3bc6321cdb0e9401$var$ghostEl) $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"display\", \"\");\n};\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif ($3bc6321cdb0e9401$var$documentExists && !$3bc6321cdb0e9401$var$ChromeForAndroid) document.addEventListener(\"click\", function(evt) {\n if ($3bc6321cdb0e9401$var$ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n $3bc6321cdb0e9401$var$ignoreNextClick = false;\n return false;\n }\n}, true);\nvar $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if ($3bc6321cdb0e9401$var$dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = $3bc6321cdb0e9401$var$_detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for(var i in evt)if (evt.hasOwnProperty(i)) event[i] = evt[i];\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[$3bc6321cdb0e9401$var$expando]._onDragOver(event);\n }\n }\n};\nvar $3bc6321cdb0e9401$var$_checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if ($3bc6321cdb0e9401$var$dragEl) $3bc6321cdb0e9401$var$dragEl.parentNode[$3bc6321cdb0e9401$var$expando]._isOutsideThisEl(evt.target);\n};\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */ function $3bc6321cdb0e9401$export$31b3ca70d8f57423(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) throw \"Sortable: `el` must be an HTMLElement, not \".concat(({}).toString.call(el));\n this.el = el; // root element\n this.options = options = $3bc6321cdb0e9401$var$_extends({}, options);\n // Export instance\n el[$3bc6321cdb0e9401$var$expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? \">li\" : \">*\",\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return $3bc6321cdb0e9401$var$_detectDirection(el, this.options);\n },\n ghostClass: \"sortable-ghost\",\n chosenClass: \"sortable-chosen\",\n dragClass: \"sortable-drag\",\n ignore: \"a, img\",\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData(\"Text\", dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: \"data-id\",\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: \"sortable-fallback\",\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: $3bc6321cdb0e9401$export$31b3ca70d8f57423.supportPointer !== false && \"PointerEvent\" in window && !$3bc6321cdb0e9401$var$Safari,\n emptyInsertThreshold: 5\n };\n $3bc6321cdb0e9401$var$PluginManager.initializePlugins(this, el, defaults);\n // Set default options\n for(var name in defaults)!(name in options) && (options[name] = defaults[name]);\n $3bc6321cdb0e9401$var$_prepareGroup(options);\n // Bind all private methods\n for(var fn in this)if (fn.charAt(0) === \"_\" && typeof this[fn] === \"function\") this[fn] = this[fn].bind(this);\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : $3bc6321cdb0e9401$var$supportDraggable;\n if (this.nativeDraggable) // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n // Bind events\n if (options.supportPointer) $3bc6321cdb0e9401$var$on(el, \"pointerdown\", this._onTapStart);\n else {\n $3bc6321cdb0e9401$var$on(el, \"mousedown\", this._onTapStart);\n $3bc6321cdb0e9401$var$on(el, \"touchstart\", this._onTapStart);\n }\n if (this.nativeDraggable) {\n $3bc6321cdb0e9401$var$on(el, \"dragover\", this);\n $3bc6321cdb0e9401$var$on(el, \"dragenter\", this);\n }\n $3bc6321cdb0e9401$var$sortables.push(this.el);\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n // Add animation state manager\n $3bc6321cdb0e9401$var$_extends(this, $3bc6321cdb0e9401$var$AnimationStateManager());\n}\n$3bc6321cdb0e9401$export$31b3ca70d8f57423.prototype = /** @lends Sortable.prototype */ {\n constructor: $3bc6321cdb0e9401$export$31b3ca70d8f57423,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) $3bc6321cdb0e9401$var$lastTarget = null;\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === \"function\" ? this.options.direction.call(this, evt, target, $3bc6321cdb0e9401$var$dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(/** Event|TouchEvent */ evt) {\n if (!evt.cancelable) return;\n var _this = this, el = this.el, options = this.options, preventOnFilter = options.preventOnFilter, type = evt.type, touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === \"touch\" && evt, target = (touch || evt).target, originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, filter = options.filter;\n $3bc6321cdb0e9401$var$_saveInputCheckedState(el);\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if ($3bc6321cdb0e9401$var$dragEl) return;\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) return; // only left button and enabled\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) return;\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && $3bc6321cdb0e9401$var$Safari && target && target.tagName.toUpperCase() === \"SELECT\") return;\n target = $3bc6321cdb0e9401$var$closest(target, options.draggable, el, false);\n if (target && target.animated) return;\n if ($3bc6321cdb0e9401$var$lastDownEl === target) // Ignoring duplicate `down`\n return;\n // Get the index of the dragged element within its parent\n $3bc6321cdb0e9401$var$oldIndex = $3bc6321cdb0e9401$var$index(target);\n $3bc6321cdb0e9401$var$oldDraggableIndex = $3bc6321cdb0e9401$var$index(target, options.draggable);\n // Check filter\n if (typeof filter === \"function\") {\n if (filter.call(this, evt, target, this)) {\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: \"filter\",\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n $3bc6321cdb0e9401$var$pluginEvent(\"filter\", _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(\",\").some(function(criteria) {\n criteria = $3bc6321cdb0e9401$var$closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: \"filter\",\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n $3bc6321cdb0e9401$var$pluginEvent(\"filter\", _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !$3bc6321cdb0e9401$var$closest(originalTarget, options.handle, el, false)) return;\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(/** Event */ evt, /** Touch */ touch, /** HTMLElement */ target) {\n var _this = this, el = _this.el, options = _this.options, ownerDocument = el.ownerDocument, dragStartFn;\n if (target && !$3bc6321cdb0e9401$var$dragEl && target.parentNode === el) {\n var dragRect = $3bc6321cdb0e9401$var$getRect(target);\n $3bc6321cdb0e9401$var$rootEl = el;\n $3bc6321cdb0e9401$var$dragEl = target;\n $3bc6321cdb0e9401$var$parentEl = $3bc6321cdb0e9401$var$dragEl.parentNode;\n $3bc6321cdb0e9401$var$nextEl = $3bc6321cdb0e9401$var$dragEl.nextSibling;\n $3bc6321cdb0e9401$var$lastDownEl = target;\n $3bc6321cdb0e9401$var$activeGroup = options.group;\n $3bc6321cdb0e9401$export$31b3ca70d8f57423.dragged = $3bc6321cdb0e9401$var$dragEl;\n $3bc6321cdb0e9401$var$tapEvt = {\n target: $3bc6321cdb0e9401$var$dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n $3bc6321cdb0e9401$var$tapDistanceLeft = $3bc6321cdb0e9401$var$tapEvt.clientX - dragRect.left;\n $3bc6321cdb0e9401$var$tapDistanceTop = $3bc6321cdb0e9401$var$tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n $3bc6321cdb0e9401$var$dragEl.style[\"will-change\"] = \"all\";\n dragStartFn = function dragStartFn() {\n $3bc6321cdb0e9401$var$pluginEvent(\"delayEnded\", _this, {\n evt: evt\n });\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!$3bc6321cdb0e9401$var$FireFox && _this.nativeDraggable) $3bc6321cdb0e9401$var$dragEl.draggable = true;\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n // Drag start event\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: _this,\n name: \"choose\",\n originalEvent: evt\n });\n // Chosen item\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, options.chosenClass, true);\n };\n // Disable \"draggable\"\n options.ignore.split(\",\").forEach(function(criteria) {\n $3bc6321cdb0e9401$var$find($3bc6321cdb0e9401$var$dragEl, criteria.trim(), $3bc6321cdb0e9401$var$_disableDraggable);\n });\n $3bc6321cdb0e9401$var$on(ownerDocument, \"dragover\", $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"mousemove\", $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"touchmove\", $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"mouseup\", _this._onDrop);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"touchend\", _this._onDrop);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"touchcancel\", _this._onDrop);\n // Make dragEl draggable (must be before delay for FireFox)\n if ($3bc6321cdb0e9401$var$FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n $3bc6321cdb0e9401$var$dragEl.draggable = true;\n }\n $3bc6321cdb0e9401$var$pluginEvent(\"delayStart\", this, {\n evt: evt\n });\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !($3bc6321cdb0e9401$var$Edge || $3bc6321cdb0e9401$var$IE11OrLess))) {\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n $3bc6321cdb0e9401$var$on(ownerDocument, \"mouseup\", _this._disableDelayedDrag);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"touchend\", _this._disableDelayedDrag);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"touchcancel\", _this._disableDelayedDrag);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"mousemove\", _this._delayedDragTouchMoveHandler);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"touchmove\", _this._delayedDragTouchMoveHandler);\n options.supportPointer && $3bc6321cdb0e9401$var$on(ownerDocument, \"pointermove\", _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else dragStartFn();\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(/** TouchEvent|PointerEvent **/ e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) this._disableDelayedDrag();\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n $3bc6321cdb0e9401$var$dragEl && $3bc6321cdb0e9401$var$_disableDraggable($3bc6321cdb0e9401$var$dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n $3bc6321cdb0e9401$var$off(ownerDocument, \"mouseup\", this._disableDelayedDrag);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"touchend\", this._disableDelayedDrag);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"touchcancel\", this._disableDelayedDrag);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"mousemove\", this._delayedDragTouchMoveHandler);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"touchmove\", this._delayedDragTouchMoveHandler);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"pointermove\", this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(/** Event */ evt, /** Touch */ touch) {\n touch = touch || evt.pointerType == \"touch\" && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) $3bc6321cdb0e9401$var$on(document, \"pointermove\", this._onTouchMove);\n else if (touch) $3bc6321cdb0e9401$var$on(document, \"touchmove\", this._onTouchMove);\n else $3bc6321cdb0e9401$var$on(document, \"mousemove\", this._onTouchMove);\n } else {\n $3bc6321cdb0e9401$var$on($3bc6321cdb0e9401$var$dragEl, \"dragend\", this);\n $3bc6321cdb0e9401$var$on($3bc6321cdb0e9401$var$rootEl, \"dragstart\", this._onDragStart);\n }\n try {\n if (document.selection) // Timeout neccessary for IE9\n $3bc6321cdb0e9401$var$_nextTick(function() {\n document.selection.empty();\n });\n else window.getSelection().removeAllRanges();\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n $3bc6321cdb0e9401$var$awaitingDragStarted = false;\n if ($3bc6321cdb0e9401$var$rootEl && $3bc6321cdb0e9401$var$dragEl) {\n $3bc6321cdb0e9401$var$pluginEvent(\"dragStarted\", this, {\n evt: evt\n });\n if (this.nativeDraggable) $3bc6321cdb0e9401$var$on(document, \"dragover\", $3bc6321cdb0e9401$var$_checkOutsideTargetEl);\n var options = this.options;\n // Apply effect\n !fallback && $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, options.dragClass, false);\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, options.ghostClass, true);\n $3bc6321cdb0e9401$export$31b3ca70d8f57423.active = this;\n fallback && this._appendGhost();\n // Drag start event\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"start\",\n originalEvent: evt\n });\n } else this._nulling();\n },\n _emulateDragOver: function _emulateDragOver() {\n if ($3bc6321cdb0e9401$var$touchEvt) {\n this._lastX = $3bc6321cdb0e9401$var$touchEvt.clientX;\n this._lastY = $3bc6321cdb0e9401$var$touchEvt.clientY;\n $3bc6321cdb0e9401$var$_hideGhostForTarget();\n var target = document.elementFromPoint($3bc6321cdb0e9401$var$touchEvt.clientX, $3bc6321cdb0e9401$var$touchEvt.clientY);\n var parent = target;\n while(target && target.shadowRoot){\n target = target.shadowRoot.elementFromPoint($3bc6321cdb0e9401$var$touchEvt.clientX, $3bc6321cdb0e9401$var$touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n $3bc6321cdb0e9401$var$dragEl.parentNode[$3bc6321cdb0e9401$var$expando]._isOutsideThisEl(target);\n if (parent) do {\n if (parent[$3bc6321cdb0e9401$var$expando]) {\n var inserted = void 0;\n inserted = parent[$3bc6321cdb0e9401$var$expando]._onDragOver({\n clientX: $3bc6321cdb0e9401$var$touchEvt.clientX,\n clientY: $3bc6321cdb0e9401$var$touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) break;\n }\n target = parent; // store last element\n }while (parent = parent.parentNode);\n $3bc6321cdb0e9401$var$_unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(/**TouchEvent*/ evt) {\n if ($3bc6321cdb0e9401$var$tapEvt) {\n var options = this.options, fallbackTolerance = options.fallbackTolerance, fallbackOffset = options.fallbackOffset, touch = evt.touches ? evt.touches[0] : evt, ghostMatrix = $3bc6321cdb0e9401$var$ghostEl && $3bc6321cdb0e9401$var$matrix($3bc6321cdb0e9401$var$ghostEl, true), scaleX = $3bc6321cdb0e9401$var$ghostEl && ghostMatrix && ghostMatrix.a, scaleY = $3bc6321cdb0e9401$var$ghostEl && ghostMatrix && ghostMatrix.d, relativeScrollOffset = $3bc6321cdb0e9401$var$PositionGhostAbsolutely && $3bc6321cdb0e9401$var$ghostRelativeParent && $3bc6321cdb0e9401$var$getRelativeScrollOffset($3bc6321cdb0e9401$var$ghostRelativeParent), dx = (touch.clientX - $3bc6321cdb0e9401$var$tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - $3bc6321cdb0e9401$var$ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1), dy = (touch.clientY - $3bc6321cdb0e9401$var$tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - $3bc6321cdb0e9401$var$ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n // only set the status to dragging, when we are actually dragging\n if (!$3bc6321cdb0e9401$export$31b3ca70d8f57423.active && !$3bc6321cdb0e9401$var$awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) return;\n this._onDragStart(evt, true);\n }\n if ($3bc6321cdb0e9401$var$ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - ($3bc6321cdb0e9401$var$lastDx || 0);\n ghostMatrix.f += dy - ($3bc6321cdb0e9401$var$lastDy || 0);\n } else ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"webkitTransform\", cssMatrix);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"mozTransform\", cssMatrix);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"msTransform\", cssMatrix);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"transform\", cssMatrix);\n $3bc6321cdb0e9401$var$lastDx = dx;\n $3bc6321cdb0e9401$var$lastDy = dy;\n $3bc6321cdb0e9401$var$touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!$3bc6321cdb0e9401$var$ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : $3bc6321cdb0e9401$var$rootEl, rect = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$dragEl, true, $3bc6321cdb0e9401$var$PositionGhostAbsolutely, true, container), options = this.options;\n // Position absolutely\n if ($3bc6321cdb0e9401$var$PositionGhostAbsolutely) {\n // Get relatively positioned parent\n $3bc6321cdb0e9401$var$ghostRelativeParent = container;\n while($3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostRelativeParent, \"position\") === \"static\" && $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostRelativeParent, \"transform\") === \"none\" && $3bc6321cdb0e9401$var$ghostRelativeParent !== document)$3bc6321cdb0e9401$var$ghostRelativeParent = $3bc6321cdb0e9401$var$ghostRelativeParent.parentNode;\n if ($3bc6321cdb0e9401$var$ghostRelativeParent !== document.body && $3bc6321cdb0e9401$var$ghostRelativeParent !== document.documentElement) {\n if ($3bc6321cdb0e9401$var$ghostRelativeParent === document) $3bc6321cdb0e9401$var$ghostRelativeParent = $3bc6321cdb0e9401$var$getWindowScrollingElement();\n rect.top += $3bc6321cdb0e9401$var$ghostRelativeParent.scrollTop;\n rect.left += $3bc6321cdb0e9401$var$ghostRelativeParent.scrollLeft;\n } else $3bc6321cdb0e9401$var$ghostRelativeParent = $3bc6321cdb0e9401$var$getWindowScrollingElement();\n $3bc6321cdb0e9401$var$ghostRelativeParentInitialScroll = $3bc6321cdb0e9401$var$getRelativeScrollOffset($3bc6321cdb0e9401$var$ghostRelativeParent);\n }\n $3bc6321cdb0e9401$var$ghostEl = $3bc6321cdb0e9401$var$dragEl.cloneNode(true);\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$ghostEl, options.ghostClass, false);\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$ghostEl, options.fallbackClass, true);\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$ghostEl, options.dragClass, true);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"transition\", \"\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"transform\", \"\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"box-sizing\", \"border-box\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"margin\", 0);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"top\", rect.top);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"left\", rect.left);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"width\", rect.width);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"height\", rect.height);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"opacity\", \"0.8\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"position\", $3bc6321cdb0e9401$var$PositionGhostAbsolutely ? \"absolute\" : \"fixed\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"zIndex\", \"100000\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"pointerEvents\", \"none\");\n $3bc6321cdb0e9401$export$31b3ca70d8f57423.ghost = $3bc6321cdb0e9401$var$ghostEl;\n container.appendChild($3bc6321cdb0e9401$var$ghostEl);\n // Set transform-origin\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"transform-origin\", $3bc6321cdb0e9401$var$tapDistanceLeft / parseInt($3bc6321cdb0e9401$var$ghostEl.style.width) * 100 + \"% \" + $3bc6321cdb0e9401$var$tapDistanceTop / parseInt($3bc6321cdb0e9401$var$ghostEl.style.height) * 100 + \"%\");\n }\n },\n _onDragStart: function _onDragStart(/**Event*/ evt, /**boolean*/ fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n $3bc6321cdb0e9401$var$pluginEvent(\"dragStart\", this, {\n evt: evt\n });\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) {\n this._onDrop();\n return;\n }\n $3bc6321cdb0e9401$var$pluginEvent(\"setupClone\", this);\n if (!$3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) {\n $3bc6321cdb0e9401$var$cloneEl = $3bc6321cdb0e9401$var$clone($3bc6321cdb0e9401$var$dragEl);\n $3bc6321cdb0e9401$var$cloneEl.removeAttribute(\"id\");\n $3bc6321cdb0e9401$var$cloneEl.draggable = false;\n $3bc6321cdb0e9401$var$cloneEl.style[\"will-change\"] = \"\";\n this._hideClone();\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$cloneEl, this.options.chosenClass, false);\n $3bc6321cdb0e9401$export$31b3ca70d8f57423.clone = $3bc6321cdb0e9401$var$cloneEl;\n }\n // #1143: IFrame support workaround\n _this.cloneId = $3bc6321cdb0e9401$var$_nextTick(function() {\n $3bc6321cdb0e9401$var$pluginEvent(\"clone\", _this);\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) $3bc6321cdb0e9401$var$rootEl.insertBefore($3bc6321cdb0e9401$var$cloneEl, $3bc6321cdb0e9401$var$dragEl);\n _this._hideClone();\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: _this,\n name: \"clone\"\n });\n });\n !fallback && $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, options.dragClass, true);\n // Set proper drop events\n if (fallback) {\n $3bc6321cdb0e9401$var$ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n $3bc6321cdb0e9401$var$off(document, \"mouseup\", _this._onDrop);\n $3bc6321cdb0e9401$var$off(document, \"touchend\", _this._onDrop);\n $3bc6321cdb0e9401$var$off(document, \"touchcancel\", _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = \"move\";\n options.setData && options.setData.call(_this, dataTransfer, $3bc6321cdb0e9401$var$dragEl);\n }\n $3bc6321cdb0e9401$var$on(document, \"drop\", _this);\n // #1276 fix:\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$dragEl, \"transform\", \"translateZ(0)\");\n }\n $3bc6321cdb0e9401$var$awaitingDragStarted = true;\n _this._dragStartId = $3bc6321cdb0e9401$var$_nextTick(_this._dragStarted.bind(_this, fallback, evt));\n $3bc6321cdb0e9401$var$on(document, \"selectstart\", _this);\n $3bc6321cdb0e9401$var$moved = true;\n if ($3bc6321cdb0e9401$var$Safari) $3bc6321cdb0e9401$var$css(document.body, \"user-select\", \"none\");\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(/**Event*/ evt) {\n var el = this.el, target = evt.target, dragRect, targetRect, revert, options = this.options, group = options.group, activeSortable = $3bc6321cdb0e9401$export$31b3ca70d8f57423.active, isOwner = $3bc6321cdb0e9401$var$activeGroup === group, canSort = options.sort, fromSortable = $3bc6321cdb0e9401$var$putSortable || activeSortable, vertical, _this = this, completedFired = false;\n if ($3bc6321cdb0e9401$var$_silent) return;\n function dragOverEvent(name, extra) {\n $3bc6321cdb0e9401$var$pluginEvent(name, _this, $3bc6321cdb0e9401$var$_objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? \"vertical\" : \"horizontal\",\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return $3bc6321cdb0e9401$var$_onMove($3bc6321cdb0e9401$var$rootEl, el, $3bc6321cdb0e9401$var$dragEl, dragRect, target, $3bc6321cdb0e9401$var$getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n // Capture animation state\n function capture() {\n dragOverEvent(\"dragOverAnimationCapture\");\n _this.captureAnimationState();\n if (_this !== fromSortable) fromSortable.captureAnimationState();\n }\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent(\"dragOverCompleted\", {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) activeSortable._hideClone();\n else activeSortable._showClone(_this);\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, $3bc6321cdb0e9401$var$putSortable ? $3bc6321cdb0e9401$var$putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, options.ghostClass, true);\n }\n if ($3bc6321cdb0e9401$var$putSortable !== _this && _this !== $3bc6321cdb0e9401$export$31b3ca70d8f57423.active) $3bc6321cdb0e9401$var$putSortable = _this;\n else if (_this === $3bc6321cdb0e9401$export$31b3ca70d8f57423.active && $3bc6321cdb0e9401$var$putSortable) $3bc6321cdb0e9401$var$putSortable = null;\n // Animation\n if (fromSortable === _this) _this._ignoreWhileAnimating = target;\n _this.animateAll(function() {\n dragOverEvent(\"dragOverAnimationComplete\");\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n // Null lastTarget if it is not inside a previously swapped element\n if (target === $3bc6321cdb0e9401$var$dragEl && !$3bc6321cdb0e9401$var$dragEl.animated || target === el && !target.animated) $3bc6321cdb0e9401$var$lastTarget = null;\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n $3bc6321cdb0e9401$var$dragEl.parentNode[$3bc6321cdb0e9401$var$expando]._isOutsideThisEl(evt.target);\n // Do not detect for empty insert if already inserted\n !insertion && $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n // Call when dragEl has been inserted\n function changed() {\n $3bc6321cdb0e9401$var$newIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl);\n $3bc6321cdb0e9401$var$newDraggableIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl, options.draggable);\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: _this,\n name: \"change\",\n toEl: el,\n newIndex: $3bc6321cdb0e9401$var$newIndex,\n newDraggableIndex: $3bc6321cdb0e9401$var$newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) evt.cancelable && evt.preventDefault();\n target = $3bc6321cdb0e9401$var$closest(target, options.draggable, el, true);\n dragOverEvent(\"dragOver\");\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) return completedFired;\n if ($3bc6321cdb0e9401$var$dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) return completed(false);\n $3bc6321cdb0e9401$var$ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = $3bc6321cdb0e9401$var$parentEl !== $3bc6321cdb0e9401$var$rootEl // Reverting item into the original list\n ) : $3bc6321cdb0e9401$var$putSortable === this || (this.lastPutMode = $3bc6321cdb0e9401$var$activeGroup.checkPull(this, activeSortable, $3bc6321cdb0e9401$var$dragEl, evt)) && group.checkPut(this, activeSortable, $3bc6321cdb0e9401$var$dragEl, evt))) {\n vertical = this._getDirection(evt, target) === \"vertical\";\n dragRect = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$dragEl);\n dragOverEvent(\"dragOverValid\");\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) return completedFired;\n if (revert) {\n $3bc6321cdb0e9401$var$parentEl = $3bc6321cdb0e9401$var$rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent(\"revert\");\n if (!$3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) {\n if ($3bc6321cdb0e9401$var$nextEl) $3bc6321cdb0e9401$var$rootEl.insertBefore($3bc6321cdb0e9401$var$dragEl, $3bc6321cdb0e9401$var$nextEl);\n else $3bc6321cdb0e9401$var$rootEl.appendChild($3bc6321cdb0e9401$var$dragEl);\n }\n return completed(true);\n }\n var elLastChild = $3bc6321cdb0e9401$var$lastChild(el, options.draggable);\n if (!elLastChild || $3bc6321cdb0e9401$var$_ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n // If already at end of list: Do not insert\n if (elLastChild === $3bc6321cdb0e9401$var$dragEl) return completed(false);\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) target = elLastChild;\n if (target) targetRect = $3bc6321cdb0e9401$var$getRect(target);\n if ($3bc6321cdb0e9401$var$_onMove($3bc6321cdb0e9401$var$rootEl, el, $3bc6321cdb0e9401$var$dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) // the last draggable element is not the last node\n el.insertBefore($3bc6321cdb0e9401$var$dragEl, elLastChild.nextSibling);\n else el.appendChild($3bc6321cdb0e9401$var$dragEl);\n $3bc6321cdb0e9401$var$parentEl = el; // actualization\n changed();\n return completed(true);\n }\n } else if (elLastChild && $3bc6321cdb0e9401$var$_ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = $3bc6321cdb0e9401$var$getChild(el, 0, options, true);\n if (firstChild === $3bc6321cdb0e9401$var$dragEl) return completed(false);\n target = firstChild;\n targetRect = $3bc6321cdb0e9401$var$getRect(target);\n if ($3bc6321cdb0e9401$var$_onMove($3bc6321cdb0e9401$var$rootEl, el, $3bc6321cdb0e9401$var$dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore($3bc6321cdb0e9401$var$dragEl, firstChild);\n $3bc6321cdb0e9401$var$parentEl = el; // actualization\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = $3bc6321cdb0e9401$var$getRect(target);\n var direction = 0, targetBeforeFirstSwap, differentLevel = $3bc6321cdb0e9401$var$dragEl.parentNode !== el, differentRowCol = !$3bc6321cdb0e9401$var$_dragElInRowColumn($3bc6321cdb0e9401$var$dragEl.animated && $3bc6321cdb0e9401$var$dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical), side1 = vertical ? \"top\" : \"left\", scrolledPastTop = $3bc6321cdb0e9401$var$isScrolledPast(target, \"top\", \"top\") || $3bc6321cdb0e9401$var$isScrolledPast($3bc6321cdb0e9401$var$dragEl, \"top\", \"top\"), scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if ($3bc6321cdb0e9401$var$lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n $3bc6321cdb0e9401$var$pastFirstInvertThresh = false;\n $3bc6321cdb0e9401$var$isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = $3bc6321cdb0e9401$var$_getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, $3bc6321cdb0e9401$var$isCircumstantialInvert, $3bc6321cdb0e9401$var$lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl);\n do {\n dragIndex -= direction;\n sibling = $3bc6321cdb0e9401$var$parentEl.children[dragIndex];\n }while (sibling && ($3bc6321cdb0e9401$var$css(sibling, \"display\") === \"none\" || sibling === $3bc6321cdb0e9401$var$ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) return completed(false);\n $3bc6321cdb0e9401$var$lastTarget = target;\n $3bc6321cdb0e9401$var$lastDirection = direction;\n var nextSibling = target.nextElementSibling, after = false;\n after = direction === 1;\n var moveVector = $3bc6321cdb0e9401$var$_onMove($3bc6321cdb0e9401$var$rootEl, el, $3bc6321cdb0e9401$var$dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) after = moveVector === 1;\n $3bc6321cdb0e9401$var$_silent = true;\n setTimeout($3bc6321cdb0e9401$var$_unsilent, 30);\n capture();\n if (after && !nextSibling) el.appendChild($3bc6321cdb0e9401$var$dragEl);\n else target.parentNode.insertBefore($3bc6321cdb0e9401$var$dragEl, after ? nextSibling : target);\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) $3bc6321cdb0e9401$var$scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n $3bc6321cdb0e9401$var$parentEl = $3bc6321cdb0e9401$var$dragEl.parentNode; // actualization\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !$3bc6321cdb0e9401$var$isCircumstantialInvert) $3bc6321cdb0e9401$var$targetMoveDistance = Math.abs(targetBeforeFirstSwap - $3bc6321cdb0e9401$var$getRect(target)[side1]);\n changed();\n return completed(true);\n }\n }\n if (el.contains($3bc6321cdb0e9401$var$dragEl)) return completed(false);\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n $3bc6321cdb0e9401$var$off(document, \"mousemove\", this._onTouchMove);\n $3bc6321cdb0e9401$var$off(document, \"touchmove\", this._onTouchMove);\n $3bc6321cdb0e9401$var$off(document, \"pointermove\", this._onTouchMove);\n $3bc6321cdb0e9401$var$off(document, \"dragover\", $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent);\n $3bc6321cdb0e9401$var$off(document, \"mousemove\", $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent);\n $3bc6321cdb0e9401$var$off(document, \"touchmove\", $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n $3bc6321cdb0e9401$var$off(ownerDocument, \"mouseup\", this._onDrop);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"touchend\", this._onDrop);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"pointerup\", this._onDrop);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"touchcancel\", this._onDrop);\n $3bc6321cdb0e9401$var$off(document, \"selectstart\", this);\n },\n _onDrop: function _onDrop(/**Event*/ evt) {\n var el = this.el, options = this.options;\n // Get the index of the dragged element within its parent\n $3bc6321cdb0e9401$var$newIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl);\n $3bc6321cdb0e9401$var$newDraggableIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl, options.draggable);\n $3bc6321cdb0e9401$var$pluginEvent(\"drop\", this, {\n evt: evt\n });\n $3bc6321cdb0e9401$var$parentEl = $3bc6321cdb0e9401$var$dragEl && $3bc6321cdb0e9401$var$dragEl.parentNode;\n // Get again after plugin event\n $3bc6321cdb0e9401$var$newIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl);\n $3bc6321cdb0e9401$var$newDraggableIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl, options.draggable);\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) {\n this._nulling();\n return;\n }\n $3bc6321cdb0e9401$var$awaitingDragStarted = false;\n $3bc6321cdb0e9401$var$isCircumstantialInvert = false;\n $3bc6321cdb0e9401$var$pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n $3bc6321cdb0e9401$var$_cancelNextTick(this.cloneId);\n $3bc6321cdb0e9401$var$_cancelNextTick(this._dragStartId);\n // Unbind events\n if (this.nativeDraggable) {\n $3bc6321cdb0e9401$var$off(document, \"drop\", this);\n $3bc6321cdb0e9401$var$off(el, \"dragstart\", this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if ($3bc6321cdb0e9401$var$Safari) $3bc6321cdb0e9401$var$css(document.body, \"user-select\", \"\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$dragEl, \"transform\", \"\");\n if (evt) {\n if ($3bc6321cdb0e9401$var$moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n $3bc6321cdb0e9401$var$ghostEl && $3bc6321cdb0e9401$var$ghostEl.parentNode && $3bc6321cdb0e9401$var$ghostEl.parentNode.removeChild($3bc6321cdb0e9401$var$ghostEl);\n if ($3bc6321cdb0e9401$var$rootEl === $3bc6321cdb0e9401$var$parentEl || $3bc6321cdb0e9401$var$putSortable && $3bc6321cdb0e9401$var$putSortable.lastPutMode !== \"clone\") // Remove clone(s)\n $3bc6321cdb0e9401$var$cloneEl && $3bc6321cdb0e9401$var$cloneEl.parentNode && $3bc6321cdb0e9401$var$cloneEl.parentNode.removeChild($3bc6321cdb0e9401$var$cloneEl);\n if ($3bc6321cdb0e9401$var$dragEl) {\n if (this.nativeDraggable) $3bc6321cdb0e9401$var$off($3bc6321cdb0e9401$var$dragEl, \"dragend\", this);\n $3bc6321cdb0e9401$var$_disableDraggable($3bc6321cdb0e9401$var$dragEl);\n $3bc6321cdb0e9401$var$dragEl.style[\"will-change\"] = \"\";\n // Remove classes\n // ghostClass is added in dragStarted\n if ($3bc6321cdb0e9401$var$moved && !$3bc6321cdb0e9401$var$awaitingDragStarted) $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, $3bc6321cdb0e9401$var$putSortable ? $3bc6321cdb0e9401$var$putSortable.options.ghostClass : this.options.ghostClass, false);\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, this.options.chosenClass, false);\n // Drag stop event\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"unchoose\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if ($3bc6321cdb0e9401$var$rootEl !== $3bc6321cdb0e9401$var$parentEl) {\n if ($3bc6321cdb0e9401$var$newIndex >= 0) {\n // Add event\n $3bc6321cdb0e9401$var$_dispatchEvent({\n rootEl: $3bc6321cdb0e9401$var$parentEl,\n name: \"add\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n fromEl: $3bc6321cdb0e9401$var$rootEl,\n originalEvent: evt\n });\n // Remove event\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"remove\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n originalEvent: evt\n });\n // drag from one list and drop into another\n $3bc6321cdb0e9401$var$_dispatchEvent({\n rootEl: $3bc6321cdb0e9401$var$parentEl,\n name: \"sort\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n fromEl: $3bc6321cdb0e9401$var$rootEl,\n originalEvent: evt\n });\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"sort\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n originalEvent: evt\n });\n }\n $3bc6321cdb0e9401$var$putSortable && $3bc6321cdb0e9401$var$putSortable.save();\n } else {\n if ($3bc6321cdb0e9401$var$newIndex !== $3bc6321cdb0e9401$var$oldIndex) {\n if ($3bc6321cdb0e9401$var$newIndex >= 0) {\n // drag & drop within the same list\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"update\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n originalEvent: evt\n });\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"sort\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.active) {\n /* jshint eqnull:true */ if ($3bc6321cdb0e9401$var$newIndex == null || $3bc6321cdb0e9401$var$newIndex === -1) {\n $3bc6321cdb0e9401$var$newIndex = $3bc6321cdb0e9401$var$oldIndex;\n $3bc6321cdb0e9401$var$newDraggableIndex = $3bc6321cdb0e9401$var$oldDraggableIndex;\n }\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"end\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n originalEvent: evt\n });\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n $3bc6321cdb0e9401$var$pluginEvent(\"nulling\", this);\n $3bc6321cdb0e9401$var$rootEl = $3bc6321cdb0e9401$var$dragEl = $3bc6321cdb0e9401$var$parentEl = $3bc6321cdb0e9401$var$ghostEl = $3bc6321cdb0e9401$var$nextEl = $3bc6321cdb0e9401$var$cloneEl = $3bc6321cdb0e9401$var$lastDownEl = $3bc6321cdb0e9401$var$cloneHidden = $3bc6321cdb0e9401$var$tapEvt = $3bc6321cdb0e9401$var$touchEvt = $3bc6321cdb0e9401$var$moved = $3bc6321cdb0e9401$var$newIndex = $3bc6321cdb0e9401$var$newDraggableIndex = $3bc6321cdb0e9401$var$oldIndex = $3bc6321cdb0e9401$var$oldDraggableIndex = $3bc6321cdb0e9401$var$lastTarget = $3bc6321cdb0e9401$var$lastDirection = $3bc6321cdb0e9401$var$putSortable = $3bc6321cdb0e9401$var$activeGroup = $3bc6321cdb0e9401$export$31b3ca70d8f57423.dragged = $3bc6321cdb0e9401$export$31b3ca70d8f57423.ghost = $3bc6321cdb0e9401$export$31b3ca70d8f57423.clone = $3bc6321cdb0e9401$export$31b3ca70d8f57423.active = null;\n $3bc6321cdb0e9401$var$savedInputChecked.forEach(function(el) {\n el.checked = true;\n });\n $3bc6321cdb0e9401$var$savedInputChecked.length = $3bc6321cdb0e9401$var$lastDx = $3bc6321cdb0e9401$var$lastDy = 0;\n },\n handleEvent: function handleEvent(/**Event*/ evt) {\n switch(evt.type){\n case \"drop\":\n case \"dragend\":\n this._onDrop(evt);\n break;\n case \"dragenter\":\n case \"dragover\":\n if ($3bc6321cdb0e9401$var$dragEl) {\n this._onDragOver(evt);\n $3bc6321cdb0e9401$var$_globalDragOver(evt);\n }\n break;\n case \"selectstart\":\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */ toArray: function toArray() {\n var order = [], el, children = this.el.children, i = 0, n = children.length, options = this.options;\n for(; i < n; i++){\n el = children[i];\n if ($3bc6321cdb0e9401$var$closest(el, options.draggable, this.el, false)) order.push(el.getAttribute(options.dataIdAttr) || $3bc6321cdb0e9401$var$_generateId(el));\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */ sort: function sort(order, useAnimation) {\n var items = {}, rootEl = this.el;\n this.toArray().forEach(function(id, i) {\n var el = rootEl.children[i];\n if ($3bc6321cdb0e9401$var$closest(el, this.options.draggable, rootEl, false)) items[id] = el;\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function(id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */ save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */ closest: function closest$1(el, selector) {\n return $3bc6321cdb0e9401$var$closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */ option: function option(name, value) {\n var options = this.options;\n if (value === void 0) return options[name];\n else {\n var modifiedValue = $3bc6321cdb0e9401$var$PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== \"undefined\") options[name] = modifiedValue;\n else options[name] = value;\n if (name === \"group\") $3bc6321cdb0e9401$var$_prepareGroup(options);\n }\n },\n /**\r\n * Destroy\r\n */ destroy: function destroy() {\n $3bc6321cdb0e9401$var$pluginEvent(\"destroy\", this);\n var el = this.el;\n el[$3bc6321cdb0e9401$var$expando] = null;\n $3bc6321cdb0e9401$var$off(el, \"mousedown\", this._onTapStart);\n $3bc6321cdb0e9401$var$off(el, \"touchstart\", this._onTapStart);\n $3bc6321cdb0e9401$var$off(el, \"pointerdown\", this._onTapStart);\n if (this.nativeDraggable) {\n $3bc6321cdb0e9401$var$off(el, \"dragover\", this);\n $3bc6321cdb0e9401$var$off(el, \"dragenter\", this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll(\"[draggable]\"), function(el) {\n el.removeAttribute(\"draggable\");\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n $3bc6321cdb0e9401$var$sortables.splice($3bc6321cdb0e9401$var$sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!$3bc6321cdb0e9401$var$cloneHidden) {\n $3bc6321cdb0e9401$var$pluginEvent(\"hideClone\", this);\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) return;\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$cloneEl, \"display\", \"none\");\n if (this.options.removeCloneOnHide && $3bc6321cdb0e9401$var$cloneEl.parentNode) $3bc6321cdb0e9401$var$cloneEl.parentNode.removeChild($3bc6321cdb0e9401$var$cloneEl);\n $3bc6321cdb0e9401$var$cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== \"clone\") {\n this._hideClone();\n return;\n }\n if ($3bc6321cdb0e9401$var$cloneHidden) {\n $3bc6321cdb0e9401$var$pluginEvent(\"showClone\", this);\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) return;\n // show clone at dragEl or original position\n if ($3bc6321cdb0e9401$var$dragEl.parentNode == $3bc6321cdb0e9401$var$rootEl && !this.options.group.revertClone) $3bc6321cdb0e9401$var$rootEl.insertBefore($3bc6321cdb0e9401$var$cloneEl, $3bc6321cdb0e9401$var$dragEl);\n else if ($3bc6321cdb0e9401$var$nextEl) $3bc6321cdb0e9401$var$rootEl.insertBefore($3bc6321cdb0e9401$var$cloneEl, $3bc6321cdb0e9401$var$nextEl);\n else $3bc6321cdb0e9401$var$rootEl.appendChild($3bc6321cdb0e9401$var$cloneEl);\n if (this.options.group.revertClone) this.animate($3bc6321cdb0e9401$var$dragEl, $3bc6321cdb0e9401$var$cloneEl);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$cloneEl, \"display\", \"\");\n $3bc6321cdb0e9401$var$cloneHidden = false;\n }\n }\n};\nfunction $3bc6321cdb0e9401$var$_globalDragOver(/**Event*/ evt) {\n if (evt.dataTransfer) evt.dataTransfer.dropEffect = \"move\";\n evt.cancelable && evt.preventDefault();\n}\nfunction $3bc6321cdb0e9401$var$_onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt, sortable = fromEl[$3bc6321cdb0e9401$var$expando], onMoveFn = sortable.options.onMove, retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !$3bc6321cdb0e9401$var$IE11OrLess && !$3bc6321cdb0e9401$var$Edge) evt = new CustomEvent(\"move\", {\n bubbles: true,\n cancelable: true\n });\n else {\n evt = document.createEvent(\"Event\");\n evt.initEvent(\"move\", true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || $3bc6321cdb0e9401$var$getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) retVal = onMoveFn.call(sortable, evt, originalEvent);\n return retVal;\n}\nfunction $3bc6321cdb0e9401$var$_disableDraggable(el) {\n el.draggable = false;\n}\nfunction $3bc6321cdb0e9401$var$_unsilent() {\n $3bc6321cdb0e9401$var$_silent = false;\n}\nfunction $3bc6321cdb0e9401$var$_ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$getChild(sortable.el, 0, sortable.options, true));\n var sortableContentRect = $3bc6321cdb0e9401$var$getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX < sortableContentRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < sortableContentRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction $3bc6321cdb0e9401$var$_ghostIsLast(evt, vertical, sortable) {\n var lastElRect = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$lastChild(sortable.el, sortable.options.draggable));\n var sortableContentRect = $3bc6321cdb0e9401$var$getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX > sortableContentRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > sortableContentRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction $3bc6321cdb0e9401$var$_getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX, targetLength = vertical ? targetRect.height : targetRect.width, targetS1 = vertical ? targetRect.top : targetRect.left, targetS2 = vertical ? targetRect.bottom : targetRect.right, invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && $3bc6321cdb0e9401$var$targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!$3bc6321cdb0e9401$var$pastFirstInvertThresh && ($3bc6321cdb0e9401$var$lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n $3bc6321cdb0e9401$var$pastFirstInvertThresh = true;\n if (!$3bc6321cdb0e9401$var$pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if ($3bc6321cdb0e9401$var$lastDirection === 1 ? mouseOnAxis < targetS1 + $3bc6321cdb0e9401$var$targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - $3bc6321cdb0e9401$var$targetMoveDistance) return -$3bc6321cdb0e9401$var$lastDirection;\n } else invert = true;\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) return $3bc6321cdb0e9401$var$_getInsertDirection(target);\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n return 0;\n}\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */ function $3bc6321cdb0e9401$var$_getInsertDirection(target) {\n if ($3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl) < $3bc6321cdb0e9401$var$index(target)) return 1;\n else return -1;\n}\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */ function $3bc6321cdb0e9401$var$_generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent, i = str.length, sum = 0;\n while(i--)sum += str.charCodeAt(i);\n return sum.toString(36);\n}\nfunction $3bc6321cdb0e9401$var$_saveInputCheckedState(root) {\n $3bc6321cdb0e9401$var$savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName(\"input\");\n var idx = inputs.length;\n while(idx--){\n var el = inputs[idx];\n el.checked && $3bc6321cdb0e9401$var$savedInputChecked.push(el);\n }\n}\nfunction $3bc6321cdb0e9401$var$_nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction $3bc6321cdb0e9401$var$_cancelNextTick(id) {\n return clearTimeout(id);\n}\n// Fixed #973:\nif ($3bc6321cdb0e9401$var$documentExists) $3bc6321cdb0e9401$var$on(document, \"touchmove\", function(evt) {\n if (($3bc6321cdb0e9401$export$31b3ca70d8f57423.active || $3bc6321cdb0e9401$var$awaitingDragStarted) && evt.cancelable) evt.preventDefault();\n});\n// Export utils\n$3bc6321cdb0e9401$export$31b3ca70d8f57423.utils = {\n on: $3bc6321cdb0e9401$var$on,\n off: $3bc6321cdb0e9401$var$off,\n css: $3bc6321cdb0e9401$var$css,\n find: $3bc6321cdb0e9401$var$find,\n is: function is(el, selector) {\n return !!$3bc6321cdb0e9401$var$closest(el, selector, el, false);\n },\n extend: $3bc6321cdb0e9401$var$extend,\n throttle: $3bc6321cdb0e9401$var$throttle,\n closest: $3bc6321cdb0e9401$var$closest,\n toggleClass: $3bc6321cdb0e9401$var$toggleClass,\n clone: $3bc6321cdb0e9401$var$clone,\n index: $3bc6321cdb0e9401$var$index,\n nextTick: $3bc6321cdb0e9401$var$_nextTick,\n cancelNextTick: $3bc6321cdb0e9401$var$_cancelNextTick,\n detectDirection: $3bc6321cdb0e9401$var$_detectDirection,\n getChild: $3bc6321cdb0e9401$var$getChild\n};\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */ $3bc6321cdb0e9401$export$31b3ca70d8f57423.get = function(element) {\n return element[$3bc6321cdb0e9401$var$expando];\n};\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */ $3bc6321cdb0e9401$export$31b3ca70d8f57423.mount = function() {\n for(var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++)plugins[_key] = arguments[_key];\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function(plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) throw \"Sortable: Mounted plugin must be a constructor function, not \".concat(({}).toString.call(plugin));\n if (plugin.utils) $3bc6321cdb0e9401$export$31b3ca70d8f57423.utils = $3bc6321cdb0e9401$var$_objectSpread2($3bc6321cdb0e9401$var$_objectSpread2({}, $3bc6321cdb0e9401$export$31b3ca70d8f57423.utils), plugin.utils);\n $3bc6321cdb0e9401$var$PluginManager.mount(plugin);\n });\n};\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */ $3bc6321cdb0e9401$export$31b3ca70d8f57423.create = function(el, options) {\n return new $3bc6321cdb0e9401$export$31b3ca70d8f57423(el, options);\n};\n// Export\n$3bc6321cdb0e9401$export$31b3ca70d8f57423.version = $3bc6321cdb0e9401$var$version;\nvar $3bc6321cdb0e9401$var$autoScrolls = [], $3bc6321cdb0e9401$var$scrollEl, $3bc6321cdb0e9401$var$scrollRootEl, $3bc6321cdb0e9401$var$scrolling = false, $3bc6321cdb0e9401$var$lastAutoScrollX, $3bc6321cdb0e9401$var$lastAutoScrollY, $3bc6321cdb0e9401$var$touchEvt$1, $3bc6321cdb0e9401$var$pointerElemChangedInterval;\nfunction $3bc6321cdb0e9401$var$AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n // Bind all private methods\n for(var fn in this)if (fn.charAt(0) === \"_\" && typeof this[fn] === \"function\") this[fn] = this[fn].bind(this);\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) $3bc6321cdb0e9401$var$on(document, \"dragover\", this._handleAutoScroll);\n else {\n if (this.options.supportPointer) $3bc6321cdb0e9401$var$on(document, \"pointermove\", this._handleFallbackAutoScroll);\n else if (originalEvent.touches) $3bc6321cdb0e9401$var$on(document, \"touchmove\", this._handleFallbackAutoScroll);\n else $3bc6321cdb0e9401$var$on(document, \"mousemove\", this._handleFallbackAutoScroll);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) this._handleAutoScroll(originalEvent);\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) $3bc6321cdb0e9401$var$off(document, \"dragover\", this._handleAutoScroll);\n else {\n $3bc6321cdb0e9401$var$off(document, \"pointermove\", this._handleFallbackAutoScroll);\n $3bc6321cdb0e9401$var$off(document, \"touchmove\", this._handleFallbackAutoScroll);\n $3bc6321cdb0e9401$var$off(document, \"mousemove\", this._handleFallbackAutoScroll);\n }\n $3bc6321cdb0e9401$var$clearPointerElemChangedInterval();\n $3bc6321cdb0e9401$var$clearAutoScrolls();\n $3bc6321cdb0e9401$var$cancelThrottle();\n },\n nulling: function nulling() {\n $3bc6321cdb0e9401$var$touchEvt$1 = $3bc6321cdb0e9401$var$scrollRootEl = $3bc6321cdb0e9401$var$scrollEl = $3bc6321cdb0e9401$var$scrolling = $3bc6321cdb0e9401$var$pointerElemChangedInterval = $3bc6321cdb0e9401$var$lastAutoScrollX = $3bc6321cdb0e9401$var$lastAutoScrollY = null;\n $3bc6321cdb0e9401$var$autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, elem = document.elementFromPoint(x, y);\n $3bc6321cdb0e9401$var$touchEvt$1 = evt;\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || $3bc6321cdb0e9401$var$Edge || $3bc6321cdb0e9401$var$IE11OrLess || $3bc6321cdb0e9401$var$Safari) {\n $3bc6321cdb0e9401$var$autoScroll(evt, this.options, elem, fallback);\n // Listener for pointer element change\n var ogElemScroller = $3bc6321cdb0e9401$var$getParentAutoScrollElement(elem, true);\n if ($3bc6321cdb0e9401$var$scrolling && (!$3bc6321cdb0e9401$var$pointerElemChangedInterval || x !== $3bc6321cdb0e9401$var$lastAutoScrollX || y !== $3bc6321cdb0e9401$var$lastAutoScrollY)) {\n $3bc6321cdb0e9401$var$pointerElemChangedInterval && $3bc6321cdb0e9401$var$clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n $3bc6321cdb0e9401$var$pointerElemChangedInterval = setInterval(function() {\n var newElem = $3bc6321cdb0e9401$var$getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n $3bc6321cdb0e9401$var$clearAutoScrolls();\n }\n $3bc6321cdb0e9401$var$autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n $3bc6321cdb0e9401$var$lastAutoScrollX = x;\n $3bc6321cdb0e9401$var$lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || $3bc6321cdb0e9401$var$getParentAutoScrollElement(elem, true) === $3bc6321cdb0e9401$var$getWindowScrollingElement()) {\n $3bc6321cdb0e9401$var$clearAutoScrolls();\n return;\n }\n $3bc6321cdb0e9401$var$autoScroll(evt, this.options, $3bc6321cdb0e9401$var$getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return $3bc6321cdb0e9401$var$_extends(AutoScroll, {\n pluginName: \"scroll\",\n initializeByDefault: true\n });\n}\nfunction $3bc6321cdb0e9401$var$clearAutoScrolls() {\n $3bc6321cdb0e9401$var$autoScrolls.forEach(function(autoScroll) {\n clearInterval(autoScroll.pid);\n });\n $3bc6321cdb0e9401$var$autoScrolls = [];\n}\nfunction $3bc6321cdb0e9401$var$clearPointerElemChangedInterval() {\n clearInterval($3bc6321cdb0e9401$var$pointerElemChangedInterval);\n}\nvar $3bc6321cdb0e9401$var$autoScroll = $3bc6321cdb0e9401$var$throttle(function(evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, sens = options.scrollSensitivity, speed = options.scrollSpeed, winScroller = $3bc6321cdb0e9401$var$getWindowScrollingElement();\n var scrollThisInstance = false, scrollCustomFn;\n // New scroll root, set scrollEl\n if ($3bc6321cdb0e9401$var$scrollRootEl !== rootEl) {\n $3bc6321cdb0e9401$var$scrollRootEl = rootEl;\n $3bc6321cdb0e9401$var$clearAutoScrolls();\n $3bc6321cdb0e9401$var$scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if ($3bc6321cdb0e9401$var$scrollEl === true) $3bc6321cdb0e9401$var$scrollEl = $3bc6321cdb0e9401$var$getParentAutoScrollElement(rootEl, true);\n }\n var layersOut = 0;\n var currentParent = $3bc6321cdb0e9401$var$scrollEl;\n do {\n var el = currentParent, rect = $3bc6321cdb0e9401$var$getRect(el), top = rect.top, bottom = rect.bottom, left = rect.left, right = rect.right, width = rect.width, height = rect.height, canScrollX = void 0, canScrollY = void 0, scrollWidth = el.scrollWidth, scrollHeight = el.scrollHeight, elCSS = $3bc6321cdb0e9401$var$css(el), scrollPosX = el.scrollLeft, scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === \"auto\" || elCSS.overflowX === \"scroll\" || elCSS.overflowX === \"visible\");\n canScrollY = height < scrollHeight && (elCSS.overflowY === \"auto\" || elCSS.overflowY === \"scroll\" || elCSS.overflowY === \"visible\");\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === \"auto\" || elCSS.overflowX === \"scroll\");\n canScrollY = height < scrollHeight && (elCSS.overflowY === \"auto\" || elCSS.overflowY === \"scroll\");\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!$3bc6321cdb0e9401$var$autoScrolls[layersOut]) {\n for(var i = 0; i <= layersOut; i++)if (!$3bc6321cdb0e9401$var$autoScrolls[i]) $3bc6321cdb0e9401$var$autoScrolls[i] = {};\n }\n if ($3bc6321cdb0e9401$var$autoScrolls[layersOut].vx != vx || $3bc6321cdb0e9401$var$autoScrolls[layersOut].vy != vy || $3bc6321cdb0e9401$var$autoScrolls[layersOut].el !== el) {\n $3bc6321cdb0e9401$var$autoScrolls[layersOut].el = el;\n $3bc6321cdb0e9401$var$autoScrolls[layersOut].vx = vx;\n $3bc6321cdb0e9401$var$autoScrolls[layersOut].vy = vy;\n clearInterval($3bc6321cdb0e9401$var$autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */ $3bc6321cdb0e9401$var$autoScrolls[layersOut].pid = setInterval((function() {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) $3bc6321cdb0e9401$export$31b3ca70d8f57423.active._onTouchMove($3bc6321cdb0e9401$var$touchEvt$1); // To move ghost if it is positioned absolutely\n var scrollOffsetY = $3bc6321cdb0e9401$var$autoScrolls[this.layer].vy ? $3bc6321cdb0e9401$var$autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = $3bc6321cdb0e9401$var$autoScrolls[this.layer].vx ? $3bc6321cdb0e9401$var$autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === \"function\") {\n if (scrollCustomFn.call($3bc6321cdb0e9401$export$31b3ca70d8f57423.dragged.parentNode[$3bc6321cdb0e9401$var$expando], scrollOffsetX, scrollOffsetY, evt, $3bc6321cdb0e9401$var$touchEvt$1, $3bc6321cdb0e9401$var$autoScrolls[this.layer].el) !== \"continue\") return;\n }\n $3bc6321cdb0e9401$var$scrollBy($3bc6321cdb0e9401$var$autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }).bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n }while (options.bubbleScroll && currentParent !== winScroller && (currentParent = $3bc6321cdb0e9401$var$getParentAutoScrollElement(currentParent, false)));\n $3bc6321cdb0e9401$var$scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\nvar $3bc6321cdb0e9401$var$drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, dragEl = _ref.dragEl, activeSortable = _ref.activeSortable, dispatchSortableEvent = _ref.dispatchSortableEvent, hideGhostForTarget = _ref.hideGhostForTarget, unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent(\"spill\");\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction $3bc6321cdb0e9401$var$Revert() {}\n$3bc6321cdb0e9401$var$Revert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl, putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) putSortable.captureAnimationState();\n var nextSibling = $3bc6321cdb0e9401$var$getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) this.sortable.el.insertBefore(dragEl, nextSibling);\n else this.sortable.el.appendChild(dragEl);\n this.sortable.animateAll();\n if (putSortable) putSortable.animateAll();\n },\n drop: $3bc6321cdb0e9401$var$drop\n};\n$3bc6321cdb0e9401$var$_extends($3bc6321cdb0e9401$var$Revert, {\n pluginName: \"revertOnSpill\"\n});\nfunction $3bc6321cdb0e9401$var$Remove() {}\n$3bc6321cdb0e9401$var$Remove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl, putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: $3bc6321cdb0e9401$var$drop\n};\n$3bc6321cdb0e9401$var$_extends($3bc6321cdb0e9401$var$Remove, {\n pluginName: \"removeOnSpill\"\n});\nvar $3bc6321cdb0e9401$var$lastSwapEl;\nfunction $3bc6321cdb0e9401$export$bdb5f0a1b77546f4() {\n function Swap() {\n this.defaults = {\n swapClass: \"sortable-swap-highlight\"\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n $3bc6321cdb0e9401$var$lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed, target = _ref2.target, onMove = _ref2.onMove, activeSortable = _ref2.activeSortable, changed = _ref2.changed, cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el, options = this.options;\n if (target && target !== el) {\n var prevSwapEl = $3bc6321cdb0e9401$var$lastSwapEl;\n if (onMove(target) !== false) {\n $3bc6321cdb0e9401$var$toggleClass(target, options.swapClass, true);\n $3bc6321cdb0e9401$var$lastSwapEl = target;\n } else $3bc6321cdb0e9401$var$lastSwapEl = null;\n if (prevSwapEl && prevSwapEl !== $3bc6321cdb0e9401$var$lastSwapEl) $3bc6321cdb0e9401$var$toggleClass(prevSwapEl, options.swapClass, false);\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable, putSortable = _ref3.putSortable, dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n $3bc6321cdb0e9401$var$lastSwapEl && $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$lastSwapEl, options.swapClass, false);\n if ($3bc6321cdb0e9401$var$lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== $3bc6321cdb0e9401$var$lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n $3bc6321cdb0e9401$var$swapNodes(dragEl, $3bc6321cdb0e9401$var$lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n $3bc6321cdb0e9401$var$lastSwapEl = null;\n }\n };\n return $3bc6321cdb0e9401$var$_extends(Swap, {\n pluginName: \"swap\",\n eventProperties: function eventProperties() {\n return {\n swapItem: $3bc6321cdb0e9401$var$lastSwapEl\n };\n }\n });\n}\nfunction $3bc6321cdb0e9401$var$swapNodes(n1, n2) {\n var p1 = n1.parentNode, p2 = n2.parentNode, i1, i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = $3bc6321cdb0e9401$var$index(n1);\n i2 = $3bc6321cdb0e9401$var$index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) i2++;\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\nvar $3bc6321cdb0e9401$var$multiDragElements = [], $3bc6321cdb0e9401$var$multiDragClones = [], $3bc6321cdb0e9401$var$lastMultiDragSelect, // for selection with modifier key down (SHIFT)\n$3bc6321cdb0e9401$var$multiDragSortable, $3bc6321cdb0e9401$var$initialFolding = false, // Initial multi-drag fold when drag started\n$3bc6321cdb0e9401$var$folding = false, // Folding any other time\n$3bc6321cdb0e9401$var$dragStarted = false, $3bc6321cdb0e9401$var$dragEl$1, $3bc6321cdb0e9401$var$clonesFromRect, $3bc6321cdb0e9401$var$clonesHidden;\nfunction $3bc6321cdb0e9401$export$18e5d2a5d1df842d() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for(var fn in this)if (fn.charAt(0) === \"_\" && typeof this[fn] === \"function\") this[fn] = this[fn].bind(this);\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) $3bc6321cdb0e9401$var$on(document, \"pointerup\", this._deselectMultiDrag);\n else {\n $3bc6321cdb0e9401$var$on(document, \"mouseup\", this._deselectMultiDrag);\n $3bc6321cdb0e9401$var$on(document, \"touchend\", this._deselectMultiDrag);\n }\n }\n $3bc6321cdb0e9401$var$on(document, \"keydown\", this._checkKeyDown);\n $3bc6321cdb0e9401$var$on(document, \"keyup\", this._checkKeyUp);\n this.defaults = {\n selectedClass: \"sortable-selected\",\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = \"\";\n if ($3bc6321cdb0e9401$var$multiDragElements.length && $3bc6321cdb0e9401$var$multiDragSortable === sortable) $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement, i) {\n data += (!i ? \"\" : \", \") + multiDragElement.textContent;\n });\n else data = dragEl.textContent;\n dataTransfer.setData(\"Text\", data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n $3bc6321cdb0e9401$var$dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~$3bc6321cdb0e9401$var$multiDragElements.indexOf($3bc6321cdb0e9401$var$dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable, cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for(var i = 0; i < $3bc6321cdb0e9401$var$multiDragElements.length; i++){\n $3bc6321cdb0e9401$var$multiDragClones.push($3bc6321cdb0e9401$var$clone($3bc6321cdb0e9401$var$multiDragElements[i]));\n $3bc6321cdb0e9401$var$multiDragClones[i].sortableIndex = $3bc6321cdb0e9401$var$multiDragElements[i].sortableIndex;\n $3bc6321cdb0e9401$var$multiDragClones[i].draggable = false;\n $3bc6321cdb0e9401$var$multiDragClones[i].style[\"will-change\"] = \"\";\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$multiDragClones[i], this.options.selectedClass, false);\n $3bc6321cdb0e9401$var$multiDragElements[i] === $3bc6321cdb0e9401$var$dragEl$1 && $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable, rootEl = _ref3.rootEl, dispatchSortableEvent = _ref3.dispatchSortableEvent, cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if ($3bc6321cdb0e9401$var$multiDragElements.length && $3bc6321cdb0e9401$var$multiDragSortable === sortable) {\n $3bc6321cdb0e9401$var$insertMultiDragClones(true, rootEl);\n dispatchSortableEvent(\"clone\");\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown, rootEl = _ref4.rootEl, cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n $3bc6321cdb0e9401$var$insertMultiDragClones(false, rootEl);\n $3bc6321cdb0e9401$var$multiDragClones.forEach(function(clone) {\n $3bc6321cdb0e9401$var$css(clone, \"display\", \"\");\n });\n cloneNowShown();\n $3bc6321cdb0e9401$var$clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable, cloneNowHidden = _ref5.cloneNowHidden, cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n $3bc6321cdb0e9401$var$multiDragClones.forEach(function(clone) {\n $3bc6321cdb0e9401$var$css(clone, \"display\", \"none\");\n if (_this.options.removeCloneOnHide && clone.parentNode) clone.parentNode.removeChild(clone);\n });\n cloneNowHidden();\n $3bc6321cdb0e9401$var$clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && $3bc6321cdb0e9401$var$multiDragSortable) $3bc6321cdb0e9401$var$multiDragSortable.multiDrag._deselectMultiDrag();\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n multiDragElement.sortableIndex = $3bc6321cdb0e9401$var$index(multiDragElement);\n });\n // Sort multi-drag elements\n $3bc6321cdb0e9401$var$multiDragElements = $3bc6321cdb0e9401$var$multiDragElements.sort(function(a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n $3bc6321cdb0e9401$var$dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n sortable.captureAnimationState();\n if (this.options.animation) {\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $3bc6321cdb0e9401$var$dragEl$1) return;\n $3bc6321cdb0e9401$var$css(multiDragElement, \"position\", \"absolute\");\n });\n var dragRect = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$dragEl$1, false, true, true);\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $3bc6321cdb0e9401$var$dragEl$1) return;\n $3bc6321cdb0e9401$var$setRect(multiDragElement, dragRect);\n });\n $3bc6321cdb0e9401$var$folding = true;\n $3bc6321cdb0e9401$var$initialFolding = true;\n }\n }\n sortable.animateAll(function() {\n $3bc6321cdb0e9401$var$folding = false;\n $3bc6321cdb0e9401$var$initialFolding = false;\n if (_this2.options.animation) $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n $3bc6321cdb0e9401$var$unsetRect(multiDragElement);\n });\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) $3bc6321cdb0e9401$var$removeMultiDragElements();\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target, completed = _ref8.completed, cancel = _ref8.cancel;\n if ($3bc6321cdb0e9401$var$folding && ~$3bc6321cdb0e9401$var$multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable, rootEl = _ref9.rootEl, sortable = _ref9.sortable, dragRect = _ref9.dragRect;\n if ($3bc6321cdb0e9401$var$multiDragElements.length > 1) {\n // Setup unfold animation\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: $3bc6321cdb0e9401$var$folding ? $3bc6321cdb0e9401$var$getRect(multiDragElement) : dragRect\n });\n $3bc6321cdb0e9401$var$unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n $3bc6321cdb0e9401$var$folding = false;\n $3bc6321cdb0e9401$var$insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable, isOwner = _ref10.isOwner, insertion = _ref10.insertion, activeSortable = _ref10.activeSortable, parentEl = _ref10.parentEl, putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) activeSortable._hideClone();\n $3bc6321cdb0e9401$var$initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && $3bc6321cdb0e9401$var$multiDragElements.length > 1 && ($3bc6321cdb0e9401$var$folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$dragEl$1, false, true, true);\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $3bc6321cdb0e9401$var$dragEl$1) return;\n $3bc6321cdb0e9401$var$setRect(multiDragElement, dragRectAbsolute);\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n $3bc6321cdb0e9401$var$folding = true;\n }\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!$3bc6321cdb0e9401$var$folding) $3bc6321cdb0e9401$var$removeMultiDragElements();\n if ($3bc6321cdb0e9401$var$multiDragElements.length > 1) {\n var clonesHiddenBefore = $3bc6321cdb0e9401$var$clonesHidden;\n activeSortable._showClone(sortable);\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !$3bc6321cdb0e9401$var$clonesHidden && clonesHiddenBefore) $3bc6321cdb0e9401$var$multiDragClones.forEach(function(clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: $3bc6321cdb0e9401$var$clonesFromRect\n });\n clone.fromRect = $3bc6321cdb0e9401$var$clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n } else activeSortable._showClone(sortable);\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect, isOwner = _ref11.isOwner, activeSortable = _ref11.activeSortable;\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n $3bc6321cdb0e9401$var$clonesFromRect = $3bc6321cdb0e9401$var$_extends({}, dragRect);\n var dragMatrix = $3bc6321cdb0e9401$var$matrix($3bc6321cdb0e9401$var$dragEl$1, true);\n $3bc6321cdb0e9401$var$clonesFromRect.top -= dragMatrix.f;\n $3bc6321cdb0e9401$var$clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if ($3bc6321cdb0e9401$var$folding) {\n $3bc6321cdb0e9401$var$folding = false;\n $3bc6321cdb0e9401$var$removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent, rootEl = _ref12.rootEl, parentEl = _ref12.parentEl, sortable = _ref12.sortable, dispatchSortableEvent = _ref12.dispatchSortableEvent, oldIndex = _ref12.oldIndex, putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options, children = parentEl.children;\n // Multi-drag selection\n if (!$3bc6321cdb0e9401$var$dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) this._deselectMultiDrag();\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl$1, options.selectedClass, !~$3bc6321cdb0e9401$var$multiDragElements.indexOf($3bc6321cdb0e9401$var$dragEl$1));\n if (!~$3bc6321cdb0e9401$var$multiDragElements.indexOf($3bc6321cdb0e9401$var$dragEl$1)) {\n $3bc6321cdb0e9401$var$multiDragElements.push($3bc6321cdb0e9401$var$dragEl$1);\n $3bc6321cdb0e9401$var$dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: \"select\",\n targetEl: $3bc6321cdb0e9401$var$dragEl$1,\n originalEvent: evt\n });\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && $3bc6321cdb0e9401$var$lastMultiDragSelect && sortable.el.contains($3bc6321cdb0e9401$var$lastMultiDragSelect)) {\n var lastIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$lastMultiDragSelect), currentIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n for(; i < n; i++){\n if (~$3bc6321cdb0e9401$var$multiDragElements.indexOf(children[i])) continue;\n $3bc6321cdb0e9401$var$toggleClass(children[i], options.selectedClass, true);\n $3bc6321cdb0e9401$var$multiDragElements.push(children[i]);\n $3bc6321cdb0e9401$var$dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: \"select\",\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else $3bc6321cdb0e9401$var$lastMultiDragSelect = $3bc6321cdb0e9401$var$dragEl$1;\n $3bc6321cdb0e9401$var$multiDragSortable = toSortable;\n } else {\n $3bc6321cdb0e9401$var$multiDragElements.splice($3bc6321cdb0e9401$var$multiDragElements.indexOf($3bc6321cdb0e9401$var$dragEl$1), 1);\n $3bc6321cdb0e9401$var$lastMultiDragSelect = null;\n $3bc6321cdb0e9401$var$dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: \"deselect\",\n targetEl: $3bc6321cdb0e9401$var$dragEl$1,\n originalEvent: evt\n });\n }\n }\n // Multi-drag drop\n if ($3bc6321cdb0e9401$var$dragStarted && this.isMultiDrag) {\n $3bc6321cdb0e9401$var$folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[$3bc6321cdb0e9401$var$expando].options.sort || parentEl !== rootEl) && $3bc6321cdb0e9401$var$multiDragElements.length > 1) {\n var dragRect = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$dragEl$1), multiDragIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl$1, \":not(.\" + this.options.selectedClass + \")\");\n if (!$3bc6321cdb0e9401$var$initialFolding && options.animation) $3bc6321cdb0e9401$var$dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!$3bc6321cdb0e9401$var$initialFolding) {\n if (options.animation) {\n $3bc6321cdb0e9401$var$dragEl$1.fromRect = dragRect;\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== $3bc6321cdb0e9401$var$dragEl$1) {\n var rect = $3bc6321cdb0e9401$var$folding ? $3bc6321cdb0e9401$var$getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n $3bc6321cdb0e9401$var$removeMultiDragElements();\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n if (children[multiDragIndex]) parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n else parentEl.appendChild(multiDragElement);\n multiDragIndex++;\n });\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl$1)) {\n var update = false;\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement.sortableIndex !== $3bc6321cdb0e9401$var$index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent(\"update\");\n dispatchSortableEvent(\"sort\");\n }\n }\n }\n // Must be done after capturing individual rects (scroll bar)\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n $3bc6321cdb0e9401$var$unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n $3bc6321cdb0e9401$var$multiDragSortable = toSortable;\n }\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== \"clone\") $3bc6321cdb0e9401$var$multiDragClones.forEach(function(clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = $3bc6321cdb0e9401$var$dragStarted = false;\n $3bc6321cdb0e9401$var$multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n $3bc6321cdb0e9401$var$off(document, \"pointerup\", this._deselectMultiDrag);\n $3bc6321cdb0e9401$var$off(document, \"mouseup\", this._deselectMultiDrag);\n $3bc6321cdb0e9401$var$off(document, \"touchend\", this._deselectMultiDrag);\n $3bc6321cdb0e9401$var$off(document, \"keydown\", this._checkKeyDown);\n $3bc6321cdb0e9401$var$off(document, \"keyup\", this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof $3bc6321cdb0e9401$var$dragStarted !== \"undefined\" && $3bc6321cdb0e9401$var$dragStarted) return;\n // Only deselect if selection is in this sortable\n if ($3bc6321cdb0e9401$var$multiDragSortable !== this.sortable) return;\n // Only deselect if target is not item in this sortable\n if (evt && $3bc6321cdb0e9401$var$closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while($3bc6321cdb0e9401$var$multiDragElements.length){\n var el = $3bc6321cdb0e9401$var$multiDragElements[0];\n $3bc6321cdb0e9401$var$toggleClass(el, this.options.selectedClass, false);\n $3bc6321cdb0e9401$var$multiDragElements.shift();\n $3bc6321cdb0e9401$var$dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: \"deselect\",\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) this.multiDragKeyDown = true;\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) this.multiDragKeyDown = false;\n }\n };\n return $3bc6321cdb0e9401$var$_extends(MultiDrag, {\n // Static methods & properties\n pluginName: \"multiDrag\",\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */ select: function select(el) {\n var sortable = el.parentNode[$3bc6321cdb0e9401$var$expando];\n if (!sortable || !sortable.options.multiDrag || ~$3bc6321cdb0e9401$var$multiDragElements.indexOf(el)) return;\n if ($3bc6321cdb0e9401$var$multiDragSortable && $3bc6321cdb0e9401$var$multiDragSortable !== sortable) {\n $3bc6321cdb0e9401$var$multiDragSortable.multiDrag._deselectMultiDrag();\n $3bc6321cdb0e9401$var$multiDragSortable = sortable;\n }\n $3bc6321cdb0e9401$var$toggleClass(el, sortable.options.selectedClass, true);\n $3bc6321cdb0e9401$var$multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */ deselect: function deselect(el) {\n var sortable = el.parentNode[$3bc6321cdb0e9401$var$expando], index = $3bc6321cdb0e9401$var$multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n $3bc6321cdb0e9401$var$toggleClass(el, sortable.options.selectedClass, false);\n $3bc6321cdb0e9401$var$multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [], newIndicies = [];\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n // multiDragElements will already be sorted if folding\n var newIndex;\n if ($3bc6321cdb0e9401$var$folding && multiDragElement !== $3bc6321cdb0e9401$var$dragEl$1) newIndex = -1;\n else if ($3bc6321cdb0e9401$var$folding) newIndex = $3bc6321cdb0e9401$var$index(multiDragElement, \":not(.\" + _this3.options.selectedClass + \")\");\n else newIndex = $3bc6321cdb0e9401$var$index(multiDragElement);\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: $3bc6321cdb0e9401$var$_toConsumableArray($3bc6321cdb0e9401$var$multiDragElements),\n clones: [].concat($3bc6321cdb0e9401$var$multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === \"ctrl\") key = \"Control\";\n else if (key.length > 1) key = key.charAt(0).toUpperCase() + key.substr(1);\n return key;\n }\n }\n });\n}\nfunction $3bc6321cdb0e9401$var$insertMultiDragElements(clonesInserted, rootEl) {\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) rootEl.insertBefore(multiDragElement, target);\n else rootEl.appendChild(multiDragElement);\n });\n}\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */ function $3bc6321cdb0e9401$var$insertMultiDragClones(elementsInserted, rootEl) {\n $3bc6321cdb0e9401$var$multiDragClones.forEach(function(clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) rootEl.insertBefore(clone, target);\n else rootEl.appendChild(clone);\n });\n}\nfunction $3bc6321cdb0e9401$var$removeMultiDragElements() {\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $3bc6321cdb0e9401$var$dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n$3bc6321cdb0e9401$export$31b3ca70d8f57423.mount(new $3bc6321cdb0e9401$var$AutoScrollPlugin());\n$3bc6321cdb0e9401$export$31b3ca70d8f57423.mount($3bc6321cdb0e9401$var$Remove, $3bc6321cdb0e9401$var$Revert);\nvar $3bc6321cdb0e9401$export$2e2bcd8739ae039 = $3bc6321cdb0e9401$export$31b3ca70d8f57423;\n\n\nasync function $48e8ed6252738c92$export$1402cba6a733f33a() {\n return new Promise((resolve)=>{\n requestAnimationFrame(resolve);\n });\n}\n\n\nfunction $6a8d624098efe915$export$dc799133ea41435b(y, x, h, derivatives) {\n const n = y.length;\n const dydx = derivatives(y, x);\n const yTemp = dydx; // Reuse array for result to avoid allocation and GC\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h * dydx[i];\n return yTemp;\n}\nfunction $6a8d624098efe915$export$926181dbdeb3ce30(y, x, h, derivatives) {\n const n = y.length;\n const dydx = derivatives(y, x);\n const yTemp = new Array(n);\n const h2 = h / 2.0;\n const h6 = h / 6.0;\n const xhh = x + h2;\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h2 * dydx[i];\n let dydxTemp = derivatives(yTemp, xhh);\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h2 * dydxTemp[i];\n const dydxM = derivatives(yTemp, xhh);\n for(let i = 0; i < n; i += 1){\n yTemp[i] = y[i] + h * dydxM[i];\n dydxM[i] += dydxTemp[i];\n }\n dydxTemp = derivatives(yTemp, x + h);\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h6 * (dydx[i] + dydxTemp[i] + 2.0 * dydxM[i]);\n return yTemp;\n}\n\n\nfunction $867aa247f14d8746$export$35d34bc0ed591a92(stocksAtT, t, h, getFlows, integrator = (0, $6a8d624098efe915$export$926181dbdeb3ce30)) {\n return integrator(stocksAtT, t, h, getFlows);\n}\nfunction $867aa247f14d8746$export$342c33653c71264(stocksAtT, t, h, getFlows, criterion, integrator = (0, $6a8d624098efe915$export$926181dbdeb3ce30)) {\n let iterations = 0;\n let { userdata: userdata, done: done } = criterion(stocksAtT, t, undefined, iterations);\n if (!done) {\n let newT = t;\n let newStocks;\n do {\n newStocks = integrator(newStocks !== null && newStocks !== void 0 ? newStocks : stocksAtT, newT, h, getFlows);\n newT += h;\n iterations += 1;\n ({ userdata: userdata, done: done } = criterion(newStocks, newT, userdata, iterations));\n }while (!done);\n }\n return userdata;\n}\n\n\nfunction $c7f17e22947729fa$var$step5(stocksAtT, t, h, computeFlows, integrator) {\n return (0, $867aa247f14d8746$export$35d34bc0ed591a92)(stocksAtT, t, h, computeFlows, integrator);\n}\nfunction $c7f17e22947729fa$var$step6(stocksAtT, flowsAtT, t, h, computeFlows, integrator) {\n const mutableFlowsAtT = [\n ...flowsAtT\n ];\n const getFlows = (y, x)=>x === t ? mutableFlowsAtT : computeFlows(y, x);\n return (0, $867aa247f14d8746$export$35d34bc0ed591a92)(stocksAtT, t, h, getFlows, integrator);\n}\nfunction $c7f17e22947729fa$export$35d34bc0ed591a92(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrIntegrator, integrator) {\n if (typeof tOrFlowsAtT === \"number\") return $c7f17e22947729fa$var$step5(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrIntegrator);\n return $c7f17e22947729fa$var$step6(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrIntegrator, integrator);\n}\nfunction $c7f17e22947729fa$var$converge6(stocksAtT, t, h, computeFlows, criterion, integrator) {\n return (0, $867aa247f14d8746$export$342c33653c71264)(stocksAtT, t, h, computeFlows, criterion, integrator);\n}\nfunction $c7f17e22947729fa$var$converge7(stocksAtT, flowsAtT, t, h, computeFlows, criterion, integrator) {\n const mutableFlowsAtT = [\n ...flowsAtT\n ];\n const getFlows = (y, x)=>x === t ? mutableFlowsAtT : computeFlows(y, x);\n return (0, $867aa247f14d8746$export$342c33653c71264)(stocksAtT, t, h, getFlows, criterion, integrator);\n}\nfunction $c7f17e22947729fa$export$342c33653c71264(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrCriterion, criterionOrIntegrator, integrator) {\n if (typeof tOrFlowsAtT === \"number\") return $c7f17e22947729fa$var$converge6(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrCriterion, criterionOrIntegrator);\n return $c7f17e22947729fa$var$converge7(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrCriterion, criterionOrIntegrator, integrator);\n}\n\n\nclass $84b4e0427207f64e$export$a1edc412be3e1841 {\n static elementObjectToArray(ids, object) {\n return ids.map((id)=>object[id]);\n }\n static arrayToElementObject(ids, array) {\n const result = {};\n for(let i = 0; i < ids.length; i += 1){\n const id = ids[i];\n result[id] = array[i];\n }\n return result;\n }\n stocksToStockArray(stocks) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.elementObjectToArray(this.stockIds, stocks);\n }\n stockArrayToStocks(stockArray) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.arrayToElementObject(this.stockIds, stockArray);\n }\n flowsToFlowArray(flows) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.elementObjectToArray(this.flowIds, flows);\n }\n flowArrayToFlows(flowArray) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.arrayToElementObject(this.flowIds, flowArray);\n }\n variablesToVariableArray(variables) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.elementObjectToArray(this.variableIds, variables);\n }\n variableArrayToVariables(variableArray) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.arrayToElementObject(this.variableIds, variableArray);\n }\n parametersToParameterArray(parameters) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.elementObjectToArray(this.parameterIds, parameters);\n }\n parameterArrayToParameters(parameterArray) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.arrayToElementObject(this.parameterIds, parameterArray);\n }\n evaluateFlowPerStock(stocks, parameters, t) {\n const { flows: flows } = this.evaluate(stocks, parameters, t);\n return this.accumulateFlowsPerStock(flows);\n }\n createFlowEvaluator(parameters) {\n const result = (stocksArray, t)=>{\n const stocks = this.stockArrayToStocks(stocksArray);\n const flowsPerStock = this.evaluateFlowPerStock(stocks, parameters, t);\n const flowPerStockArray = this.stocksToStockArray(flowsPerStock);\n return flowPerStockArray;\n };\n return result;\n }\n step(stocks, t, h, flowEvaluator) {\n const stocksArray = this.stocksToStockArray(stocks);\n const newStocksArray = (0, $c7f17e22947729fa$export$35d34bc0ed591a92)(stocksArray, t, h, flowEvaluator);\n return this.stockArrayToStocks(newStocksArray);\n }\n constructor(stocksIds, flowIds, variableIds, parameterIds){\n this.stockIds = stocksIds;\n this.flowIds = flowIds;\n this.variableIds = variableIds;\n this.parameterIds = parameterIds;\n }\n}\n$84b4e0427207f64e$export$a1edc412be3e1841.elementIds = [\n \"stocks\",\n \"parameters\",\n \"variables\",\n \"flows\"\n];\n\n\nconst $921d098521bb0b85$var$stockIds = [\n \"capacityOfNewlyProducedPhones\",\n \"capacityOfRecycledMaterials\",\n \"capacityOfRefurbishedPhones\",\n \"capacityOfRepairedPhones\",\n \"phonesInUse\",\n \"supplyOfBrokenPhones\",\n \"supplyOfDisposedPhones\",\n \"supplyOfHibernatingPhones\",\n \"supplyOfNewlyProducedPhones\",\n \"supplyOfRecycledMaterials\",\n \"supplyOfRefurbishedPhones\",\n \"supplyOfRepairedPhones\"\n];\nconst $921d098521bb0b85$var$flowIds = [\n \"abandon\",\n \"acquireNewlyProduced\",\n \"acquireRefurbished\",\n \"acquireRepaired\",\n \"acquireUsed\",\n \"capacityOfNewlyProducedPhonesAdjustment\",\n \"capacityOfRecycledMaterialsAdjustment\",\n \"capacityOfRefurbishedPhonesAdjustment\",\n \"disposeBroken\",\n \"disposeHibernating\",\n \"goBroken\",\n \"landfill\",\n \"produceFromNaturalResources\",\n \"produceFromRecycledMaterials\",\n \"recycle\",\n \"refurbish\",\n \"repair\",\n \"repairShopCapcityAdjustment\"\n];\nconst $921d098521bb0b85$var$variableIds = [\n \"demandForNaturalResources\",\n \"demandForNewlyProducedPhones\",\n \"demandForPhones\",\n \"demandForRecycledMaterials\",\n \"demandForRecycling\",\n \"demandForRefurbishedPhones\",\n \"demandForRefurbishment\",\n \"demandForRepair\",\n \"demandForRepairedPhones\",\n \"demandForResources\",\n \"demandForReusedPhones\",\n \"inflowIncentiveSumForPhonesInUse\",\n \"phoneGoal\",\n \"phonesInUseExcess\",\n \"supplyOfBrokenPhonesForDisposal\",\n \"supplyOfBrokenPhonesForRepair\",\n \"supplyOfDisposedPhonesForLandfilling\",\n \"supplyOfDisposedPhonesForRecycling\",\n \"supplyOfHibernatingPhonesForDisposal\",\n \"supplyOfHibernatingPhonesForRefurbishment\",\n \"supplyOfHibernatingPhonesForReuse\"\n];\nconst $921d098521bb0b85$var$parameterIds = [\n \"abandonExcessRate\",\n \"abandonRate\",\n \"acquireRate\",\n \"breakRate\",\n \"capacityAdjustmentRate\",\n \"disposeIncentive\",\n \"disposeRate\",\n \"landfillIncentive\",\n \"landfillRate\",\n \"naturalResourcesIncentive\",\n \"newPhoneProductionRate\",\n \"newlyProducedPhoneIncentive\",\n \"numberOfUsers\",\n \"phonesPerUserGoal\",\n \"recycleRate\",\n \"recyclingIncentive\",\n \"refurbishmentIncentive\",\n \"refurbishmentRate\",\n \"repairIncentive\",\n \"repairRate\",\n \"reuseIncentive\"\n];\nclass $921d098521bb0b85$var$CircularEconomyModel extends (0, $84b4e0427207f64e$export$a1edc412be3e1841) {\n // eslint-disable-next-line class-methods-use-this\n evaluate(stocks, parameters, t) {\n const { capacityOfNewlyProducedPhones: capacityOfNewlyProducedPhones, capacityOfRecycledMaterials: capacityOfRecycledMaterials, capacityOfRefurbishedPhones: capacityOfRefurbishedPhones, capacityOfRepairedPhones: capacityOfRepairedPhones, phonesInUse: phonesInUse, supplyOfBrokenPhones: supplyOfBrokenPhones, supplyOfDisposedPhones: supplyOfDisposedPhones, supplyOfHibernatingPhones: supplyOfHibernatingPhones, supplyOfNewlyProducedPhones: supplyOfNewlyProducedPhones, supplyOfRecycledMaterials: supplyOfRecycledMaterials, supplyOfRefurbishedPhones: supplyOfRefurbishedPhones, supplyOfRepairedPhones: supplyOfRepairedPhones } = stocks;\n const { abandonExcessRate: abandonExcessRate, abandonRate: abandonRate, acquireRate: acquireRate, breakRate: breakRate, capacityAdjustmentRate: capacityAdjustmentRate, disposeIncentive: disposeIncentive, disposeRate: disposeRate, landfillIncentive: landfillIncentive, landfillRate: landfillRate, naturalResourcesIncentive: naturalResourcesIncentive, newPhoneProductionRate: newPhoneProductionRate, newlyProducedPhoneIncentive: newlyProducedPhoneIncentive, numberOfUsers: numberOfUsers, phonesPerUserGoal: phonesPerUserGoal, recycleRate: recycleRate, recyclingIncentive: recyclingIncentive, refurbishmentIncentive: refurbishmentIncentive, refurbishmentRate: refurbishmentRate, repairIncentive: repairIncentive, repairRate: repairRate, reuseIncentive: reuseIncentive } = parameters;\n const phoneGoal = numberOfUsers * phonesPerUserGoal;\n const phonesInUseExcess = Math.max(phonesInUse - phoneGoal, 0);\n const abandon = abandonRate * phonesInUse + abandonExcessRate * phonesInUseExcess;\n const inflowIncentiveSumForPhonesInUse = reuseIncentive + repairIncentive + refurbishmentIncentive + newlyProducedPhoneIncentive;\n const goBroken = breakRate * phonesInUse;\n const demandForPhones = Math.max(0, phoneGoal - phonesInUse + goBroken + abandon);\n const demandForNewlyProducedPhones = newlyProducedPhoneIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireNewlyProduced = acquireRate * Math.min(supplyOfNewlyProducedPhones, demandForNewlyProducedPhones);\n const demandForRefurbishedPhones = refurbishmentIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireRefurbished = acquireRate * Math.min(demandForRefurbishedPhones, supplyOfRefurbishedPhones);\n const demandForRepairedPhones = repairIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireRepaired = acquireRate * Math.min(demandForRepairedPhones, supplyOfRepairedPhones);\n const supplyOfHibernatingPhonesForReuse = reuseIncentive / (reuseIncentive + refurbishmentIncentive + disposeIncentive) * supplyOfHibernatingPhones;\n const demandForReusedPhones = reuseIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireUsed = acquireRate * Math.min(supplyOfHibernatingPhonesForReuse, demandForReusedPhones);\n const capacityOfNewlyProducedPhonesAdjustment = capacityAdjustmentRate * (demandForNewlyProducedPhones - capacityOfNewlyProducedPhones);\n const demandForResources = Math.max(capacityOfNewlyProducedPhones - supplyOfNewlyProducedPhones + acquireNewlyProduced, 0);\n const demandForRecycledMaterials = recyclingIncentive / (naturalResourcesIncentive + recyclingIncentive) * demandForResources;\n const capacityOfRecycledMaterialsAdjustment = capacityAdjustmentRate * (demandForRecycledMaterials - capacityOfRecycledMaterials);\n const capacityOfRefurbishedPhonesAdjustment = capacityAdjustmentRate * (demandForRefurbishedPhones - capacityOfRefurbishedPhones);\n const supplyOfBrokenPhonesForDisposal = disposeIncentive / (repairIncentive + disposeIncentive) * supplyOfBrokenPhones;\n const disposeBroken = disposeRate * supplyOfBrokenPhonesForDisposal;\n const supplyOfHibernatingPhonesForDisposal = disposeIncentive / (reuseIncentive + refurbishmentIncentive + disposeIncentive) * supplyOfHibernatingPhones;\n const disposeHibernating = disposeRate * supplyOfHibernatingPhonesForDisposal;\n const supplyOfDisposedPhonesForLandfilling = landfillIncentive / (recyclingIncentive + landfillIncentive) * supplyOfDisposedPhones;\n const landfill = landfillRate * supplyOfDisposedPhonesForLandfilling;\n const demandForNaturalResources = naturalResourcesIncentive / (naturalResourcesIncentive + recyclingIncentive) * demandForResources;\n const produceFromNaturalResources = newPhoneProductionRate * demandForNaturalResources;\n const produceFromRecycledMaterials = newPhoneProductionRate * Math.min(demandForRecycledMaterials, supplyOfRecycledMaterials);\n const supplyOfDisposedPhonesForRecycling = recyclingIncentive / (recyclingIncentive + landfillIncentive) * supplyOfDisposedPhones;\n const demandForRecycling = Math.max(capacityOfRecycledMaterials - supplyOfRecycledMaterials + produceFromRecycledMaterials, 0);\n const recycle = recycleRate * Math.min(supplyOfDisposedPhonesForRecycling, demandForRecycling);\n const supplyOfHibernatingPhonesForRefurbishment = refurbishmentIncentive / (reuseIncentive + refurbishmentIncentive + disposeIncentive) * supplyOfHibernatingPhones;\n const demandForRefurbishment = Math.max(capacityOfRefurbishedPhones - supplyOfRefurbishedPhones + acquireRefurbished, 0);\n const refurbish = refurbishmentRate * Math.min(supplyOfHibernatingPhonesForRefurbishment, demandForRefurbishment);\n const demandForRepair = Math.max(capacityOfRepairedPhones - supplyOfRepairedPhones + acquireRepaired, 0);\n const repair = repairRate * Math.min(supplyOfBrokenPhones, demandForRepair);\n const repairShopCapcityAdjustment = capacityAdjustmentRate * (demandForRepairedPhones - capacityOfRepairedPhones);\n const supplyOfBrokenPhonesForRepair = repairIncentive / (repairIncentive + disposeIncentive) * supplyOfBrokenPhones;\n const variables = {\n demandForNaturalResources: demandForNaturalResources,\n demandForNewlyProducedPhones: demandForNewlyProducedPhones,\n demandForPhones: demandForPhones,\n demandForRecycledMaterials: demandForRecycledMaterials,\n demandForRecycling: demandForRecycling,\n demandForRefurbishedPhones: demandForRefurbishedPhones,\n demandForRefurbishment: demandForRefurbishment,\n demandForRepair: demandForRepair,\n demandForRepairedPhones: demandForRepairedPhones,\n demandForResources: demandForResources,\n demandForReusedPhones: demandForReusedPhones,\n inflowIncentiveSumForPhonesInUse: inflowIncentiveSumForPhonesInUse,\n phoneGoal: phoneGoal,\n phonesInUseExcess: phonesInUseExcess,\n supplyOfBrokenPhonesForDisposal: supplyOfBrokenPhonesForDisposal,\n supplyOfBrokenPhonesForRepair: supplyOfBrokenPhonesForRepair,\n supplyOfDisposedPhonesForLandfilling: supplyOfDisposedPhonesForLandfilling,\n supplyOfDisposedPhonesForRecycling: supplyOfDisposedPhonesForRecycling,\n supplyOfHibernatingPhonesForDisposal: supplyOfHibernatingPhonesForDisposal,\n supplyOfHibernatingPhonesForRefurbishment: supplyOfHibernatingPhonesForRefurbishment,\n supplyOfHibernatingPhonesForReuse: supplyOfHibernatingPhonesForReuse\n };\n const flows = {\n abandon: abandon,\n acquireNewlyProduced: acquireNewlyProduced,\n acquireRefurbished: acquireRefurbished,\n acquireRepaired: acquireRepaired,\n acquireUsed: acquireUsed,\n capacityOfNewlyProducedPhonesAdjustment: capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterialsAdjustment: capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhonesAdjustment: capacityOfRefurbishedPhonesAdjustment,\n disposeBroken: disposeBroken,\n disposeHibernating: disposeHibernating,\n goBroken: goBroken,\n landfill: landfill,\n produceFromNaturalResources: produceFromNaturalResources,\n produceFromRecycledMaterials: produceFromRecycledMaterials,\n recycle: recycle,\n refurbish: refurbish,\n repair: repair,\n repairShopCapcityAdjustment: repairShopCapcityAdjustment\n };\n return {\n t: t,\n stocks: stocks,\n parameters: parameters,\n variables: variables,\n flows: flows\n };\n }\n // eslint-disable-next-line class-methods-use-this\n accumulateFlowsPerStock(flows) {\n const { abandon: abandon, acquireNewlyProduced: acquireNewlyProduced, acquireRefurbished: acquireRefurbished, acquireRepaired: acquireRepaired, acquireUsed: acquireUsed, capacityOfNewlyProducedPhonesAdjustment: capacityOfNewlyProducedPhonesAdjustment, capacityOfRecycledMaterialsAdjustment: capacityOfRecycledMaterialsAdjustment, capacityOfRefurbishedPhonesAdjustment: capacityOfRefurbishedPhonesAdjustment, disposeBroken: disposeBroken, disposeHibernating: disposeHibernating, goBroken: goBroken, landfill: landfill, produceFromNaturalResources: produceFromNaturalResources, produceFromRecycledMaterials: produceFromRecycledMaterials, recycle: recycle, refurbish: refurbish, repair: repair, repairShopCapcityAdjustment: repairShopCapcityAdjustment } = flows;\n const flowPerStock = {\n capacityOfNewlyProducedPhones: capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterials: capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhones: capacityOfRefurbishedPhonesAdjustment,\n capacityOfRepairedPhones: repairShopCapcityAdjustment,\n phonesInUse: acquireNewlyProduced + acquireRefurbished + acquireRepaired + acquireUsed - (abandon + goBroken),\n supplyOfBrokenPhones: goBroken - (disposeBroken + repair),\n supplyOfDisposedPhones: disposeBroken + disposeHibernating - (landfill + recycle),\n supplyOfHibernatingPhones: abandon - (acquireUsed + disposeHibernating + refurbish),\n supplyOfNewlyProducedPhones: produceFromNaturalResources + produceFromRecycledMaterials - acquireNewlyProduced,\n supplyOfRecycledMaterials: recycle - produceFromRecycledMaterials,\n supplyOfRefurbishedPhones: refurbish - acquireRefurbished,\n supplyOfRepairedPhones: repair - acquireRepaired\n };\n return flowPerStock;\n }\n constructor(){\n super($921d098521bb0b85$var$stockIds, $921d098521bb0b85$var$flowIds, $921d098521bb0b85$var$variableIds, $921d098521bb0b85$var$parameterIds);\n }\n}\n$921d098521bb0b85$var$CircularEconomyModel.initialStocks = {\n capacityOfNewlyProducedPhones: 0,\n capacityOfRecycledMaterials: 0,\n capacityOfRefurbishedPhones: 0,\n capacityOfRepairedPhones: 0,\n phonesInUse: 0,\n supplyOfBrokenPhones: 0,\n supplyOfDisposedPhones: 0,\n supplyOfHibernatingPhones: 0,\n supplyOfNewlyProducedPhones: 0,\n supplyOfRecycledMaterials: 0,\n supplyOfRefurbishedPhones: 0,\n supplyOfRepairedPhones: 0\n};\n$921d098521bb0b85$var$CircularEconomyModel.defaultParameters = {\n abandonExcessRate: 0.5,\n abandonRate: 0.1,\n acquireRate: 1,\n breakRate: 0.1,\n capacityAdjustmentRate: 0.1,\n disposeIncentive: 0.5,\n disposeRate: 0.5,\n landfillIncentive: 0.5,\n landfillRate: 1,\n naturalResourcesIncentive: 0.5,\n newPhoneProductionRate: 0.5,\n newlyProducedPhoneIncentive: 0.82,\n numberOfUsers: 1000000,\n phonesPerUserGoal: 1,\n recycleRate: 1,\n recyclingIncentive: 0.89,\n refurbishmentIncentive: 0.5,\n refurbishmentRate: 1,\n repairIncentive: 0.5,\n repairRate: 1,\n reuseIncentive: 0.86\n};\nvar $921d098521bb0b85$export$2e2bcd8739ae039 = $921d098521bb0b85$var$CircularEconomyModel;\n\n\nclass $106ba4e13cc3399a$var$ModelSimulator {\n evaluateFlowPerStockWithCache(stockArray, t) {\n if (this.flowPerStockCache !== null && this.flowPerStockCache.t === t) return [\n ...this.flowPerStockCache.value\n ];\n return this.flowEvaluator(stockArray, t);\n }\n step() {\n const { stocks: stocks, parameters: parameters, t: t } = this.record;\n const newStocks = this.model.step(stocks, t, this.h, this.flowEvaluatorWithCache);\n const newRecord = this.model.evaluate(newStocks, parameters, t + this.h);\n this.flowPerStockCache = {\n t: newRecord.t,\n value: this.model.stocksToStockArray(this.model.accumulateFlowsPerStock(newRecord.flows))\n };\n this.record = newRecord;\n return newRecord;\n }\n constructor(model, stocks, parameters, t, h){\n this.model = model;\n this.parameters = parameters;\n this.flowPerStockCache = null;\n this.record = this.model.evaluate(stocks, parameters, t);\n this.h = h;\n this.flowEvaluator = this.model.createFlowEvaluator(parameters);\n this.flowEvaluatorWithCache = this.evaluateFlowPerStockWithCache.bind(this);\n }\n}\nvar $106ba4e13cc3399a$export$2e2bcd8739ae039 = $106ba4e13cc3399a$var$ModelSimulator;\n\n\nvar $1e97a6829bac4722$exports = {};\nvar $3213226c6f6709d1$exports = {};\nvar $4f1a1606e7098a1b$exports = {};\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */ function $4f1a1606e7098a1b$var$arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1, length = array == null ? 0 : array.length;\n if (initAccum && length) accumulator = array[++index];\n while(++index < length)accumulator = iteratee(accumulator, array[index], index, array);\n return accumulator;\n}\n$4f1a1606e7098a1b$exports = $4f1a1606e7098a1b$var$arrayReduce;\n\n\nvar $36afe5eae89b9d7e$exports = {};\nvar $b1b879fc8198071f$exports = {};\nvar $f2e9e481daee7666$exports = {};\n/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */ function $f2e9e481daee7666$var$basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n$f2e9e481daee7666$exports = $f2e9e481daee7666$var$basePropertyOf;\n\n\n/** Used to map Latin Unicode letters to basic Latin letters. */ var $b1b879fc8198071f$var$deburredLetters = {\n // Latin-1 Supplement block.\n \"\\xc0\": \"A\",\n \"\\xc1\": \"A\",\n \"\\xc2\": \"A\",\n \"\\xc3\": \"A\",\n \"\\xc4\": \"A\",\n \"\\xc5\": \"A\",\n \"\\xe0\": \"a\",\n \"\\xe1\": \"a\",\n \"\\xe2\": \"a\",\n \"\\xe3\": \"a\",\n \"\\xe4\": \"a\",\n \"\\xe5\": \"a\",\n \"\\xc7\": \"C\",\n \"\\xe7\": \"c\",\n \"\\xd0\": \"D\",\n \"\\xf0\": \"d\",\n \"\\xc8\": \"E\",\n \"\\xc9\": \"E\",\n \"\\xca\": \"E\",\n \"\\xcb\": \"E\",\n \"\\xe8\": \"e\",\n \"\\xe9\": \"e\",\n \"\\xea\": \"e\",\n \"\\xeb\": \"e\",\n \"\\xcc\": \"I\",\n \"\\xcd\": \"I\",\n \"\\xce\": \"I\",\n \"\\xcf\": \"I\",\n \"\\xec\": \"i\",\n \"\\xed\": \"i\",\n \"\\xee\": \"i\",\n \"\\xef\": \"i\",\n \"\\xd1\": \"N\",\n \"\\xf1\": \"n\",\n \"\\xd2\": \"O\",\n \"\\xd3\": \"O\",\n \"\\xd4\": \"O\",\n \"\\xd5\": \"O\",\n \"\\xd6\": \"O\",\n \"\\xd8\": \"O\",\n \"\\xf2\": \"o\",\n \"\\xf3\": \"o\",\n \"\\xf4\": \"o\",\n \"\\xf5\": \"o\",\n \"\\xf6\": \"o\",\n \"\\xf8\": \"o\",\n \"\\xd9\": \"U\",\n \"\\xda\": \"U\",\n \"\\xdb\": \"U\",\n \"\\xdc\": \"U\",\n \"\\xf9\": \"u\",\n \"\\xfa\": \"u\",\n \"\\xfb\": \"u\",\n \"\\xfc\": \"u\",\n \"\\xdd\": \"Y\",\n \"\\xfd\": \"y\",\n \"\\xff\": \"y\",\n \"\\xc6\": \"Ae\",\n \"\\xe6\": \"ae\",\n \"\\xde\": \"Th\",\n \"\\xfe\": \"th\",\n \"\\xdf\": \"ss\",\n // Latin Extended-A block.\n \"\\u0100\": \"A\",\n \"\\u0102\": \"A\",\n \"\\u0104\": \"A\",\n \"\\u0101\": \"a\",\n \"\\u0103\": \"a\",\n \"\\u0105\": \"a\",\n \"\\u0106\": \"C\",\n \"\\u0108\": \"C\",\n \"\\u010A\": \"C\",\n \"\\u010C\": \"C\",\n \"\\u0107\": \"c\",\n \"\\u0109\": \"c\",\n \"\\u010B\": \"c\",\n \"\\u010D\": \"c\",\n \"\\u010E\": \"D\",\n \"\\u0110\": \"D\",\n \"\\u010F\": \"d\",\n \"\\u0111\": \"d\",\n \"\\u0112\": \"E\",\n \"\\u0114\": \"E\",\n \"\\u0116\": \"E\",\n \"\\u0118\": \"E\",\n \"\\u011A\": \"E\",\n \"\\u0113\": \"e\",\n \"\\u0115\": \"e\",\n \"\\u0117\": \"e\",\n \"\\u0119\": \"e\",\n \"\\u011B\": \"e\",\n \"\\u011C\": \"G\",\n \"\\u011E\": \"G\",\n \"\\u0120\": \"G\",\n \"\\u0122\": \"G\",\n \"\\u011D\": \"g\",\n \"\\u011F\": \"g\",\n \"\\u0121\": \"g\",\n \"\\u0123\": \"g\",\n \"\\u0124\": \"H\",\n \"\\u0126\": \"H\",\n \"\\u0125\": \"h\",\n \"\\u0127\": \"h\",\n \"\\u0128\": \"I\",\n \"\\u012A\": \"I\",\n \"\\u012C\": \"I\",\n \"\\u012E\": \"I\",\n \"\\u0130\": \"I\",\n \"\\u0129\": \"i\",\n \"\\u012B\": \"i\",\n \"\\u012D\": \"i\",\n \"\\u012F\": \"i\",\n \"\\u0131\": \"i\",\n \"\\u0134\": \"J\",\n \"\\u0135\": \"j\",\n \"\\u0136\": \"K\",\n \"\\u0137\": \"k\",\n \"\\u0138\": \"k\",\n \"\\u0139\": \"L\",\n \"\\u013B\": \"L\",\n \"\\u013D\": \"L\",\n \"\\u013F\": \"L\",\n \"\\u0141\": \"L\",\n \"\\u013A\": \"l\",\n \"\\u013C\": \"l\",\n \"\\u013E\": \"l\",\n \"\\u0140\": \"l\",\n \"\\u0142\": \"l\",\n \"\\u0143\": \"N\",\n \"\\u0145\": \"N\",\n \"\\u0147\": \"N\",\n \"\\u014A\": \"N\",\n \"\\u0144\": \"n\",\n \"\\u0146\": \"n\",\n \"\\u0148\": \"n\",\n \"\\u014B\": \"n\",\n \"\\u014C\": \"O\",\n \"\\u014E\": \"O\",\n \"\\u0150\": \"O\",\n \"\\u014D\": \"o\",\n \"\\u014F\": \"o\",\n \"\\u0151\": \"o\",\n \"\\u0154\": \"R\",\n \"\\u0156\": \"R\",\n \"\\u0158\": \"R\",\n \"\\u0155\": \"r\",\n \"\\u0157\": \"r\",\n \"\\u0159\": \"r\",\n \"\\u015A\": \"S\",\n \"\\u015C\": \"S\",\n \"\\u015E\": \"S\",\n \"\\u0160\": \"S\",\n \"\\u015B\": \"s\",\n \"\\u015D\": \"s\",\n \"\\u015F\": \"s\",\n \"\\u0161\": \"s\",\n \"\\u0162\": \"T\",\n \"\\u0164\": \"T\",\n \"\\u0166\": \"T\",\n \"\\u0163\": \"t\",\n \"\\u0165\": \"t\",\n \"\\u0167\": \"t\",\n \"\\u0168\": \"U\",\n \"\\u016A\": \"U\",\n \"\\u016C\": \"U\",\n \"\\u016E\": \"U\",\n \"\\u0170\": \"U\",\n \"\\u0172\": \"U\",\n \"\\u0169\": \"u\",\n \"\\u016B\": \"u\",\n \"\\u016D\": \"u\",\n \"\\u016F\": \"u\",\n \"\\u0171\": \"u\",\n \"\\u0173\": \"u\",\n \"\\u0174\": \"W\",\n \"\\u0175\": \"w\",\n \"\\u0176\": \"Y\",\n \"\\u0177\": \"y\",\n \"\\u0178\": \"Y\",\n \"\\u0179\": \"Z\",\n \"\\u017B\": \"Z\",\n \"\\u017D\": \"Z\",\n \"\\u017A\": \"z\",\n \"\\u017C\": \"z\",\n \"\\u017E\": \"z\",\n \"\\u0132\": \"IJ\",\n \"\\u0133\": \"ij\",\n \"\\u0152\": \"Oe\",\n \"\\u0153\": \"oe\",\n \"\\u0149\": \"'n\",\n \"\\u017F\": \"s\"\n};\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */ var $b1b879fc8198071f$var$deburrLetter = $f2e9e481daee7666$exports($b1b879fc8198071f$var$deburredLetters);\n$b1b879fc8198071f$exports = $b1b879fc8198071f$var$deburrLetter;\n\n\nvar $76c6dc58ca6da032$exports = {};\nvar $1879420c2201e4f5$exports = {};\nvar $16a1c88c6274b89e$exports = {};\nvar $967238627eb0c90e$exports = {};\nvar $99453366d0047353$exports = {};\n/** Detect free variable `global` from Node.js. */ var $99453366d0047353$var$freeGlobal = typeof $parcel$global == \"object\" && $parcel$global && $parcel$global.Object === Object && $parcel$global;\n$99453366d0047353$exports = $99453366d0047353$var$freeGlobal;\n\n\n/** Detect free variable `self`. */ var $967238627eb0c90e$var$freeSelf = typeof self == \"object\" && self && self.Object === Object && self;\n/** Used as a reference to the global object. */ var $967238627eb0c90e$var$root = $99453366d0047353$exports || $967238627eb0c90e$var$freeSelf || Function(\"return this\")();\n$967238627eb0c90e$exports = $967238627eb0c90e$var$root;\n\n\n/** Built-in value references. */ var $16a1c88c6274b89e$var$Symbol = $967238627eb0c90e$exports.Symbol;\n$16a1c88c6274b89e$exports = $16a1c88c6274b89e$var$Symbol;\n\n\nvar $eee618309e39ba8f$exports = {};\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */ function $eee618309e39ba8f$var$arrayMap(array, iteratee) {\n var index = -1, length = array == null ? 0 : array.length, result = Array(length);\n while(++index < length)result[index] = iteratee(array[index], index, array);\n return result;\n}\n$eee618309e39ba8f$exports = $eee618309e39ba8f$var$arrayMap;\n\n\nvar $ac048cd2ac6bb018$exports = {};\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */ var $ac048cd2ac6bb018$var$isArray = Array.isArray;\n$ac048cd2ac6bb018$exports = $ac048cd2ac6bb018$var$isArray;\n\n\nvar $558e04b299841d71$exports = {};\nvar $49a2e995e5c6b149$exports = {};\n\nvar $4a7cc576fba0dac1$exports = {};\n\n/** Used for built-in method references. */ var $4a7cc576fba0dac1$var$objectProto = Object.prototype;\n/** Used to check objects for own properties. */ var $4a7cc576fba0dac1$var$hasOwnProperty = $4a7cc576fba0dac1$var$objectProto.hasOwnProperty;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */ var $4a7cc576fba0dac1$var$nativeObjectToString = $4a7cc576fba0dac1$var$objectProto.toString;\n/** Built-in value references. */ var $4a7cc576fba0dac1$var$symToStringTag = $16a1c88c6274b89e$exports ? $16a1c88c6274b89e$exports.toStringTag : undefined;\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */ function $4a7cc576fba0dac1$var$getRawTag(value) {\n var isOwn = $4a7cc576fba0dac1$var$hasOwnProperty.call(value, $4a7cc576fba0dac1$var$symToStringTag), tag = value[$4a7cc576fba0dac1$var$symToStringTag];\n try {\n value[$4a7cc576fba0dac1$var$symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n var result = $4a7cc576fba0dac1$var$nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) value[$4a7cc576fba0dac1$var$symToStringTag] = tag;\n else delete value[$4a7cc576fba0dac1$var$symToStringTag];\n }\n return result;\n}\n$4a7cc576fba0dac1$exports = $4a7cc576fba0dac1$var$getRawTag;\n\n\nvar $04062fd85b2020b2$exports = {};\n/** Used for built-in method references. */ var $04062fd85b2020b2$var$objectProto = Object.prototype;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */ var $04062fd85b2020b2$var$nativeObjectToString = $04062fd85b2020b2$var$objectProto.toString;\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */ function $04062fd85b2020b2$var$objectToString(value) {\n return $04062fd85b2020b2$var$nativeObjectToString.call(value);\n}\n$04062fd85b2020b2$exports = $04062fd85b2020b2$var$objectToString;\n\n\n/** `Object#toString` result references. */ var $49a2e995e5c6b149$var$nullTag = \"[object Null]\", $49a2e995e5c6b149$var$undefinedTag = \"[object Undefined]\";\n/** Built-in value references. */ var $49a2e995e5c6b149$var$symToStringTag = $16a1c88c6274b89e$exports ? $16a1c88c6274b89e$exports.toStringTag : undefined;\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */ function $49a2e995e5c6b149$var$baseGetTag(value) {\n if (value == null) return value === undefined ? $49a2e995e5c6b149$var$undefinedTag : $49a2e995e5c6b149$var$nullTag;\n return $49a2e995e5c6b149$var$symToStringTag && $49a2e995e5c6b149$var$symToStringTag in Object(value) ? $4a7cc576fba0dac1$exports(value) : $04062fd85b2020b2$exports(value);\n}\n$49a2e995e5c6b149$exports = $49a2e995e5c6b149$var$baseGetTag;\n\n\nvar $ba1663caad3bd751$exports = {};\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */ function $ba1663caad3bd751$var$isObjectLike(value) {\n return value != null && typeof value == \"object\";\n}\n$ba1663caad3bd751$exports = $ba1663caad3bd751$var$isObjectLike;\n\n\n/** `Object#toString` result references. */ var $558e04b299841d71$var$symbolTag = \"[object Symbol]\";\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */ function $558e04b299841d71$var$isSymbol(value) {\n return typeof value == \"symbol\" || $ba1663caad3bd751$exports(value) && $49a2e995e5c6b149$exports(value) == $558e04b299841d71$var$symbolTag;\n}\n$558e04b299841d71$exports = $558e04b299841d71$var$isSymbol;\n\n\n/** Used as references for various `Number` constants. */ var $1879420c2201e4f5$var$INFINITY = 1 / 0;\n/** Used to convert symbols to primitives and strings. */ var $1879420c2201e4f5$var$symbolProto = $16a1c88c6274b89e$exports ? $16a1c88c6274b89e$exports.prototype : undefined, $1879420c2201e4f5$var$symbolToString = $1879420c2201e4f5$var$symbolProto ? $1879420c2201e4f5$var$symbolProto.toString : undefined;\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */ function $1879420c2201e4f5$var$baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == \"string\") return value;\n if ($ac048cd2ac6bb018$exports(value)) // Recursively convert values (susceptible to call stack limits).\n return $eee618309e39ba8f$exports(value, $1879420c2201e4f5$var$baseToString) + \"\";\n if ($558e04b299841d71$exports(value)) return $1879420c2201e4f5$var$symbolToString ? $1879420c2201e4f5$var$symbolToString.call(value) : \"\";\n var result = value + \"\";\n return result == \"0\" && 1 / value == -$1879420c2201e4f5$var$INFINITY ? \"-0\" : result;\n}\n$1879420c2201e4f5$exports = $1879420c2201e4f5$var$baseToString;\n\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */ function $76c6dc58ca6da032$var$toString(value) {\n return value == null ? \"\" : $1879420c2201e4f5$exports(value);\n}\n$76c6dc58ca6da032$exports = $76c6dc58ca6da032$var$toString;\n\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */ var $36afe5eae89b9d7e$var$reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n/** Used to compose unicode character classes. */ var $36afe5eae89b9d7e$var$rsComboMarksRange = \"\\\\u0300-\\\\u036f\", $36afe5eae89b9d7e$var$reComboHalfMarksRange = \"\\\\ufe20-\\\\ufe2f\", $36afe5eae89b9d7e$var$rsComboSymbolsRange = \"\\\\u20d0-\\\\u20ff\", $36afe5eae89b9d7e$var$rsComboRange = $36afe5eae89b9d7e$var$rsComboMarksRange + $36afe5eae89b9d7e$var$reComboHalfMarksRange + $36afe5eae89b9d7e$var$rsComboSymbolsRange;\n/** Used to compose unicode capture groups. */ var $36afe5eae89b9d7e$var$rsCombo = \"[\" + $36afe5eae89b9d7e$var$rsComboRange + \"]\";\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */ var $36afe5eae89b9d7e$var$reComboMark = RegExp($36afe5eae89b9d7e$var$rsCombo, \"g\");\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */ function $36afe5eae89b9d7e$var$deburr(string) {\n string = $76c6dc58ca6da032$exports(string);\n return string && string.replace($36afe5eae89b9d7e$var$reLatin, $b1b879fc8198071f$exports).replace($36afe5eae89b9d7e$var$reComboMark, \"\");\n}\n$36afe5eae89b9d7e$exports = $36afe5eae89b9d7e$var$deburr;\n\n\nvar $ab91531510e64339$exports = {};\nvar $3b3532336f4ee99d$exports = {};\n/** Used to match words composed of alphanumeric characters. */ var $3b3532336f4ee99d$var$reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */ function $3b3532336f4ee99d$var$asciiWords(string) {\n return string.match($3b3532336f4ee99d$var$reAsciiWord) || [];\n}\n$3b3532336f4ee99d$exports = $3b3532336f4ee99d$var$asciiWords;\n\n\nvar $a612d359136754bd$exports = {};\n/** Used to detect strings that need a more robust regexp to match words. */ var $a612d359136754bd$var$reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */ function $a612d359136754bd$var$hasUnicodeWord(string) {\n return $a612d359136754bd$var$reHasUnicodeWord.test(string);\n}\n$a612d359136754bd$exports = $a612d359136754bd$var$hasUnicodeWord;\n\n\n\nvar $cdffef05f24fe61a$exports = {};\n/** Used to compose unicode character classes. */ var $cdffef05f24fe61a$var$rsAstralRange = \"\\ud800-\\udfff\", $cdffef05f24fe61a$var$rsComboMarksRange = \"\\\\u0300-\\\\u036f\", $cdffef05f24fe61a$var$reComboHalfMarksRange = \"\\\\ufe20-\\\\ufe2f\", $cdffef05f24fe61a$var$rsComboSymbolsRange = \"\\\\u20d0-\\\\u20ff\", $cdffef05f24fe61a$var$rsComboRange = $cdffef05f24fe61a$var$rsComboMarksRange + $cdffef05f24fe61a$var$reComboHalfMarksRange + $cdffef05f24fe61a$var$rsComboSymbolsRange, $cdffef05f24fe61a$var$rsDingbatRange = \"\\\\u2700-\\\\u27bf\", $cdffef05f24fe61a$var$rsLowerRange = \"a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff\", $cdffef05f24fe61a$var$rsMathOpRange = \"\\\\xac\\\\xb1\\\\xd7\\\\xf7\", $cdffef05f24fe61a$var$rsNonCharRange = \"\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\", $cdffef05f24fe61a$var$rsPunctuationRange = \"\\\\u2000-\\\\u206f\", $cdffef05f24fe61a$var$rsSpaceRange = \" \\\\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\", $cdffef05f24fe61a$var$rsUpperRange = \"A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde\", $cdffef05f24fe61a$var$rsVarRange = \"\\\\ufe0e\\\\ufe0f\", $cdffef05f24fe61a$var$rsBreakRange = $cdffef05f24fe61a$var$rsMathOpRange + $cdffef05f24fe61a$var$rsNonCharRange + $cdffef05f24fe61a$var$rsPunctuationRange + $cdffef05f24fe61a$var$rsSpaceRange;\n/** Used to compose unicode capture groups. */ var $cdffef05f24fe61a$var$rsApos = \"['\\u2019]\", $cdffef05f24fe61a$var$rsBreak = \"[\" + $cdffef05f24fe61a$var$rsBreakRange + \"]\", $cdffef05f24fe61a$var$rsCombo = \"[\" + $cdffef05f24fe61a$var$rsComboRange + \"]\", $cdffef05f24fe61a$var$rsDigits = \"\\\\d+\", $cdffef05f24fe61a$var$rsDingbat = \"[\" + $cdffef05f24fe61a$var$rsDingbatRange + \"]\", $cdffef05f24fe61a$var$rsLower = \"[\" + $cdffef05f24fe61a$var$rsLowerRange + \"]\", $cdffef05f24fe61a$var$rsMisc = \"[^\" + $cdffef05f24fe61a$var$rsAstralRange + $cdffef05f24fe61a$var$rsBreakRange + $cdffef05f24fe61a$var$rsDigits + $cdffef05f24fe61a$var$rsDingbatRange + $cdffef05f24fe61a$var$rsLowerRange + $cdffef05f24fe61a$var$rsUpperRange + \"]\", $cdffef05f24fe61a$var$rsFitz = \"\\ud83c[\\udffb-\\udfff]\", $cdffef05f24fe61a$var$rsModifier = \"(?:\" + $cdffef05f24fe61a$var$rsCombo + \"|\" + $cdffef05f24fe61a$var$rsFitz + \")\", $cdffef05f24fe61a$var$rsNonAstral = \"[^\" + $cdffef05f24fe61a$var$rsAstralRange + \"]\", $cdffef05f24fe61a$var$rsRegional = \"(?:\\ud83c[\\udde6-\\uddff]){2}\", $cdffef05f24fe61a$var$rsSurrPair = \"[\\ud800-\\udbff][\\udc00-\\udfff]\", $cdffef05f24fe61a$var$rsUpper = \"[\" + $cdffef05f24fe61a$var$rsUpperRange + \"]\", $cdffef05f24fe61a$var$rsZWJ = \"\\\\u200d\";\n/** Used to compose unicode regexes. */ var $cdffef05f24fe61a$var$rsMiscLower = \"(?:\" + $cdffef05f24fe61a$var$rsLower + \"|\" + $cdffef05f24fe61a$var$rsMisc + \")\", $cdffef05f24fe61a$var$rsMiscUpper = \"(?:\" + $cdffef05f24fe61a$var$rsUpper + \"|\" + $cdffef05f24fe61a$var$rsMisc + \")\", $cdffef05f24fe61a$var$rsOptContrLower = \"(?:\" + $cdffef05f24fe61a$var$rsApos + \"(?:d|ll|m|re|s|t|ve))?\", $cdffef05f24fe61a$var$rsOptContrUpper = \"(?:\" + $cdffef05f24fe61a$var$rsApos + \"(?:D|LL|M|RE|S|T|VE))?\", $cdffef05f24fe61a$var$reOptMod = $cdffef05f24fe61a$var$rsModifier + \"?\", $cdffef05f24fe61a$var$rsOptVar = \"[\" + $cdffef05f24fe61a$var$rsVarRange + \"]?\", $cdffef05f24fe61a$var$rsOptJoin = \"(?:\" + $cdffef05f24fe61a$var$rsZWJ + \"(?:\" + [\n $cdffef05f24fe61a$var$rsNonAstral,\n $cdffef05f24fe61a$var$rsRegional,\n $cdffef05f24fe61a$var$rsSurrPair\n].join(\"|\") + \")\" + $cdffef05f24fe61a$var$rsOptVar + $cdffef05f24fe61a$var$reOptMod + \")*\", $cdffef05f24fe61a$var$rsOrdLower = \"\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])\", $cdffef05f24fe61a$var$rsOrdUpper = \"\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])\", $cdffef05f24fe61a$var$rsSeq = $cdffef05f24fe61a$var$rsOptVar + $cdffef05f24fe61a$var$reOptMod + $cdffef05f24fe61a$var$rsOptJoin, $cdffef05f24fe61a$var$rsEmoji = \"(?:\" + [\n $cdffef05f24fe61a$var$rsDingbat,\n $cdffef05f24fe61a$var$rsRegional,\n $cdffef05f24fe61a$var$rsSurrPair\n].join(\"|\") + \")\" + $cdffef05f24fe61a$var$rsSeq;\n/** Used to match complex or compound words. */ var $cdffef05f24fe61a$var$reUnicodeWord = RegExp([\n $cdffef05f24fe61a$var$rsUpper + \"?\" + $cdffef05f24fe61a$var$rsLower + \"+\" + $cdffef05f24fe61a$var$rsOptContrLower + \"(?=\" + [\n $cdffef05f24fe61a$var$rsBreak,\n $cdffef05f24fe61a$var$rsUpper,\n \"$\"\n ].join(\"|\") + \")\",\n $cdffef05f24fe61a$var$rsMiscUpper + \"+\" + $cdffef05f24fe61a$var$rsOptContrUpper + \"(?=\" + [\n $cdffef05f24fe61a$var$rsBreak,\n $cdffef05f24fe61a$var$rsUpper + $cdffef05f24fe61a$var$rsMiscLower,\n \"$\"\n ].join(\"|\") + \")\",\n $cdffef05f24fe61a$var$rsUpper + \"?\" + $cdffef05f24fe61a$var$rsMiscLower + \"+\" + $cdffef05f24fe61a$var$rsOptContrLower,\n $cdffef05f24fe61a$var$rsUpper + \"+\" + $cdffef05f24fe61a$var$rsOptContrUpper,\n $cdffef05f24fe61a$var$rsOrdUpper,\n $cdffef05f24fe61a$var$rsOrdLower,\n $cdffef05f24fe61a$var$rsDigits,\n $cdffef05f24fe61a$var$rsEmoji\n].join(\"|\"), \"g\");\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */ function $cdffef05f24fe61a$var$unicodeWords(string) {\n return string.match($cdffef05f24fe61a$var$reUnicodeWord) || [];\n}\n$cdffef05f24fe61a$exports = $cdffef05f24fe61a$var$unicodeWords;\n\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */ function $ab91531510e64339$var$words(string, pattern, guard) {\n string = $76c6dc58ca6da032$exports(string);\n pattern = guard ? undefined : pattern;\n if (pattern === undefined) return $a612d359136754bd$exports(string) ? $cdffef05f24fe61a$exports(string) : $3b3532336f4ee99d$exports(string);\n return string.match(pattern) || [];\n}\n$ab91531510e64339$exports = $ab91531510e64339$var$words;\n\n\n/** Used to compose unicode capture groups. */ var $3213226c6f6709d1$var$rsApos = \"['\\u2019]\";\n/** Used to match apostrophes. */ var $3213226c6f6709d1$var$reApos = RegExp($3213226c6f6709d1$var$rsApos, \"g\");\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */ function $3213226c6f6709d1$var$createCompounder(callback) {\n return function(string) {\n return $4f1a1606e7098a1b$exports($ab91531510e64339$exports($36afe5eae89b9d7e$exports(string).replace($3213226c6f6709d1$var$reApos, \"\")), callback, \"\");\n };\n}\n$3213226c6f6709d1$exports = $3213226c6f6709d1$var$createCompounder;\n\n\n/**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */ var $1e97a6829bac4722$var$kebabCase = $3213226c6f6709d1$exports(function(result, word, index) {\n return result + (index ? \"-\" : \"\") + word.toLowerCase();\n});\n$1e97a6829bac4722$exports = $1e97a6829bac4722$var$kebabCase;\n\n\n/**\n * Loads an external SVG file and returns the DOM tree of its first element.\n *\n * @param {string|URL} uri\n * @param {boolean} clearStyles\n * If true removes the style elements from the file\n * @return {Promise}\n */ async function $9209478113a893f2$export$b6a2e78b63791dfa(uri, clearStyles = true) {\n var _svgDoc_querySelectorAll;\n const response = await fetch(uri);\n if (response.status < 200 || response.status >= 300) throw new Error(`Server returned status ${response.status} (${response.statusText}) loading ${new URL(uri).href}.`);\n const svgText = await response.text();\n const div = document.createElement(\"div\");\n div.innerHTML = svgText;\n const svgDoc = div.querySelector(\"svg\");\n if (svgDoc === null) throw new Error(`No SVG element found in ${new URL(uri).href}.`);\n if (clearStyles) (_svgDoc_querySelectorAll = svgDoc.querySelectorAll(\"style\")) === null || _svgDoc_querySelectorAll === void 0 ? void 0 : _svgDoc_querySelectorAll.forEach((s)=>s.remove());\n return svgDoc;\n}\n\n\nfunction $7b1f0afa5e19a5a4$export$99496351b147462(elem, selector, type) {\n const result = elem.querySelector(selector);\n if (result === null) throw new Error(`No element found matching selector ${selector}.`);\n if (!(result instanceof type)) throw new Error(`Element matching selector ${selector} has the wrong type.`);\n return result;\n}\nfunction $7b1f0afa5e19a5a4$export$65a5d093667c64b6(elem, selector, type) {\n const results = elem.querySelectorAll(selector);\n results.forEach((result)=>{\n if (!(result instanceof type)) throw new Error(`An element matching selector ${selector} has the wrong type.`);\n });\n return results;\n}\n\n\nvar $dac2d623b8646eea$exports = {};\n\n$dac2d623b8646eea$exports = (parcelRequire(\"c93e5\")).getBundleURL(\"c39XQ\") + \"model.f8e270f6.svg\";\n\n\nconst $f48791a249d3586b$var$svgUrl = new URL($dac2d623b8646eea$exports);\nconst $f48791a249d3586b$var$mainFlowIds = [\n \"abandon\",\n \"acquireNewlyProduced\",\n \"acquireRefurbished\",\n \"acquireRepaired\",\n \"acquireUsed\",\n \"disposeBroken\",\n \"disposeHibernating\",\n \"goBroken\",\n \"landfill\",\n \"produceFromNaturalResources\",\n \"produceFromRecycledMaterials\",\n \"recycle\",\n \"refurbish\",\n \"repair\"\n];\nconst $f48791a249d3586b$var$flowVizSigns = {\n abandon: 1,\n acquireNewlyProduced: -1,\n acquireRefurbished: -1,\n acquireRepaired: -1,\n acquireUsed: -1,\n disposeBroken: -1,\n disposeHibernating: -1,\n goBroken: -1,\n landfill: -1,\n produceFromNaturalResources: -1,\n produceFromRecycledMaterials: -1,\n recycle: -1,\n refurbish: -1,\n repair: -1\n};\nconst $f48791a249d3586b$var$dashGap = 30; // FIXME: Calculate from CSS\nconst $f48791a249d3586b$var$lineWidth = 10; // FIXME: Calculate from CSS\nconst $f48791a249d3586b$var$dotRadius = 20; // FIXME: Calculate from CSS\nconst $f48791a249d3586b$var$lineSegmentArea = $f48791a249d3586b$var$lineWidth * $f48791a249d3586b$var$dashGap;\nconst $f48791a249d3586b$var$dotWithoutLineSegmentArea = Math.sqrt($f48791a249d3586b$var$dotRadius ** 2 - $f48791a249d3586b$var$lineWidth ** 2) * $f48791a249d3586b$var$lineWidth;\nconst $f48791a249d3586b$var$averageFlowVizWidth = $f48791a249d3586b$var$lineSegmentArea + $f48791a249d3586b$var$dotWithoutLineSegmentArea;\nconsole.log($f48791a249d3586b$var$lineSegmentArea, $f48791a249d3586b$var$dotWithoutLineSegmentArea, $f48791a249d3586b$var$averageFlowVizWidth);\nconst $f48791a249d3586b$var$quantityScaleFactor = 30000.0;\nclass $f48791a249d3586b$export$2e2bcd8739ae039 {\n updateSvgFlows(deltaMs, stepSize, record) {\n const { flows: flows } = record;\n const flowVizScale = stepSize * ($f48791a249d3586b$var$quantityScaleFactor / record.parameters.numberOfUsers) / $f48791a249d3586b$var$averageFlowVizWidth;\n $f48791a249d3586b$var$mainFlowIds.forEach((id)=>{\n const flow = flows[id];\n const flowVizSign = $f48791a249d3586b$var$flowVizSigns[id];\n const elementId = `${(0, (/*@__PURE__*/$parcel$interopDefault($1e97a6829bac4722$exports)))(id)}-flow`;\n const element = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(this.svg, `#${elementId}`, SVGPathElement);\n var _element_getAttribute;\n const lastDashOffset = parseFloat((_element_getAttribute = element.getAttribute(\"stroke-dashoffset\")) !== null && _element_getAttribute !== void 0 ? _element_getAttribute : \"0\");\n // The dash offset step must not be small compared to the dash gap.\n // Otherwise, the flow animation may appear to move backwards.\n const dashOffsetStep = Math.max(-0.3 * $f48791a249d3586b$var$dashGap, Math.min(flowVizSign * (deltaMs * flow) * flowVizScale, 0.1 * $f48791a249d3586b$var$dashGap));\n const dashOffset = (Number.isNaN(lastDashOffset) ? 0 : lastDashOffset) + dashOffsetStep;\n element.setAttribute(\"stroke-dashoffset\", `${dashOffset}`);\n element.setAttribute(\"stroke-dasharray\", `0 ${$f48791a249d3586b$var$dashGap}`);\n });\n }\n updateSvgStocks(deltaMs, stepSize, record) {\n const { stocks: stocks } = record;\n const stockVizScale = $f48791a249d3586b$var$quantityScaleFactor / record.parameters.numberOfUsers;\n this.model.stockIds.forEach((id)=>{\n const elementId = (0, (/*@__PURE__*/$parcel$interopDefault($1e97a6829bac4722$exports)))(id);\n const element = this.svg.getElementById(elementId);\n if (element === null) throw new Error(`SVG element with id ${elementId} for stock ${id} not found.`);\n if (!(element instanceof SVGCircleElement)) throw new Error(`Stock element for stock ${id} with id ${elementId} is not an SVG circle element.`);\n const stock = stocks[id];\n const radius = Math.sqrt(stock * stockVizScale / Math.PI);\n element.setAttribute(\"r\", `${radius}`);\n });\n }\n updateSvg(deltaMs, stepSize, record) {\n this.updateSvgFlows(deltaMs, stepSize, record);\n this.updateSvgStocks(deltaMs, stepSize, record);\n }\n update(deltaMs, stepSize, record) {\n this.updateSvg(deltaMs, stepSize, record);\n }\n static prepareSvg(model, svg) {\n const createSVGElement = (tagName)=>svg.ownerDocument.createElementNS(\"http://www.w3.org/2000/svg\", tagName);\n svg.classList.add(\"model-visualization\");\n svg.querySelectorAll(\"circle, rect, path, text\").forEach((element)=>{\n element.removeAttribute(\"style\");\n });\n const elementsToRemove = [\n ...svg.children\n ];\n const labelLayer = createSVGElement(\"g\");\n labelLayer.classList.add(\"labels\");\n const supplyLayer = createSVGElement(\"g\");\n supplyLayer.classList.add(\"supplies\");\n const capacityLayer = createSVGElement(\"g\");\n capacityLayer.classList.add(\"capacities\");\n const flowLayer = createSVGElement(\"g\");\n flowLayer.classList.add(\"flows\");\n svg.append(capacityLayer, flowLayer, supplyLayer, labelLayer);\n svg.querySelectorAll(\"text\").forEach((baseElement)=>{\n const clone = baseElement.cloneNode(true);\n clone.classList.add(\"label\");\n labelLayer.append(clone);\n });\n svg.querySelectorAll(\"rect\").forEach((baseElement)=>{\n const clone = baseElement.cloneNode(false);\n clone.classList.add(\"capacity\");\n capacityLayer.append(clone);\n });\n model.stockIds.filter((id)=>id.startsWith(\"supplyOf\")).forEach((id)=>{\n const baseElementId = (0, (/*@__PURE__*/$parcel$interopDefault($1e97a6829bac4722$exports)))(id.replace(/^supplyOf/, \"\"));\n const baseElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(svg, `#${baseElementId}`, SVGGeometryElement);\n const clone = baseElement.cloneNode(false);\n clone.id = `supply-of-${baseElement.id}`;\n clone.classList.add(\"stock\", \"supply\");\n supplyLayer.append(clone);\n });\n const phonesInUse = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(svg, \"#phones-in-use\", SVGGeometryElement);\n const phonesInUseClone = phonesInUse.cloneNode(false);\n supplyLayer.append(phonesInUseClone);\n model.stockIds.filter((id)=>id.startsWith(\"capacityOf\")).forEach((id)=>{\n const baseElementId = (0, (/*@__PURE__*/$parcel$interopDefault($1e97a6829bac4722$exports)))(id.replace(/^capacityOf/, \"\"));\n const baseElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(svg, `#${baseElementId}`, SVGGeometryElement);\n const clone = baseElement.cloneNode(false);\n clone.id = `capacity-of-${baseElementId}`;\n clone.classList.add(\"stock\", \"capacity\");\n capacityLayer.append(clone);\n });\n $f48791a249d3586b$var$mainFlowIds.forEach((id)=>{\n const baseElementId = (0, (/*@__PURE__*/$parcel$interopDefault($1e97a6829bac4722$exports)))(id);\n const baseElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(svg, `#${baseElementId}`, SVGGeometryElement);\n const edge = baseElement.cloneNode(false);\n edge.id = `${baseElementId}-edge`;\n edge.removeAttribute(\"style\");\n edge.classList.add(\"flow\", \"edge\");\n flowLayer.append(edge);\n const flow = baseElement.cloneNode(false);\n flow.id = `${baseElementId}-flow`;\n flow.removeAttribute(\"style\");\n flow.classList.add(\"flow\", \"anim-edge\");\n flowLayer.append(flow);\n });\n elementsToRemove.forEach((element)=>element.remove());\n }\n static async create(model) {\n const svg = await (0, $9209478113a893f2$export$b6a2e78b63791dfa)($f48791a249d3586b$var$svgUrl);\n this.prepareSvg(model, svg);\n return new $f48791a249d3586b$export$2e2bcd8739ae039(model, svg);\n }\n constructor(model, svg){\n this.model = model;\n this.svg = svg;\n this.element = document.createElement(\"div\");\n this.element.append(this.svg);\n }\n}\n\n\nasync function $e412526fc10a648a$export$3e2b244719956741() {\n return new Promise((resolve)=>{\n const state = document.readyState;\n if (state === \"complete\" || state === \"interactive\") setTimeout(resolve, 0);\n document.addEventListener(\"DOMContentLoaded\", ()=>resolve());\n });\n}\n\n\n\nfunction $486e7c314fe88235$export$2e2bcd8739ae039(str) {\n if (typeof str !== \"string\") return false;\n if (str.trim() !== str) return false;\n if (str.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/) === null) return false;\n return true;\n}\n\n\nclass $30abf6595c867a38$export$2e2bcd8739ae039 {\n constructor(i18nKey){\n this.i18nKey = i18nKey;\n }\n}\n\n\nclass $4af93babe4ef46c3$export$2e2bcd8739ae039 extends (0, $30abf6595c867a38$export$2e2bcd8739ae039) {\n applyTo(parameters) {\n this.callable(parameters);\n return parameters;\n }\n constructor(i18nKey, callable){\n super(i18nKey);\n this.callable = callable;\n }\n}\n\n\nclass $5023ecf4320e7a5e$export$2e2bcd8739ae039 extends (0, $4af93babe4ef46c3$export$2e2bcd8739ae039) {\n static createFunction(parameterIds, script) {\n parameterIds.forEach((parameterId)=>{\n if (!(0, $486e7c314fe88235$export$2e2bcd8739ae039)(parameterId)) throw new Error(`Parameter name '${parameterId}' can not be used as a variable`);\n });\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const wrappedScript = new Function(script).toString();\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const func = new Function(`{ ${parameterIds.join(\", \")} }`, `(${wrappedScript})(); return { ${parameterIds.join(\", \")} }`);\n return (parameters)=>{\n const transformedParameters = func(parameters);\n Object.assign(parameters, transformedParameters);\n return parameters;\n };\n }\n constructor(i18nKey, parameterIds, script){\n super(i18nKey, $5023ecf4320e7a5e$export$2e2bcd8739ae039.createFunction(parameterIds, script));\n this.script = script;\n }\n}\n\n\nconst $0bf1d6c4c7fae0ba$var$initialParameters = {\n abandonExcessRate: 0.5,\n abandonRate: 0.02,\n acquireRate: 1.0,\n breakRate: 0.01,\n capacityAdjustmentRate: 0.05,\n disposeIncentive: 1.5,\n disposeRate: 0.5,\n landfillIncentive: 1.0,\n landfillRate: 1.0,\n naturalResourcesIncentive: 1.5,\n newPhoneProductionRate: 1.0,\n newlyProducedPhoneIncentive: 2,\n numberOfUsers: 1000000,\n phonesPerUserGoal: 1.2,\n recycleRate: 1.0,\n recyclingIncentive: 0.25,\n refurbishmentIncentive: 0.25,\n refurbishmentRate: 1.0,\n repairIncentive: 0.5,\n repairRate: 1.0,\n reuseIncentive: 0.25\n};\nasync function $0bf1d6c4c7fae0ba$var$init() {\n const model = new (0, $921d098521bb0b85$export$2e2bcd8739ae039)();\n const modelSimulator = new (0, $106ba4e13cc3399a$export$2e2bcd8739ae039)(model, // FIXME: It should be possible to pass CircularEconomyModel.initialStocks directly, but TypeScript does not complain.\n {\n ...(0, $921d098521bb0b85$export$2e2bcd8739ae039).initialStocks\n }, {\n ...$0bf1d6c4c7fae0ba$var$initialParameters\n }, 0.0, 0.1);\n const availableParameterTransformsContainer = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#parameter-transforms .available\", HTMLElement);\n const activeParameterTransformsContainer = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#parameter-transforms .active\", HTMLElement);\n const availableParameterTransforms = new Map();\n function getDistinctParameters(p1, p2) {\n const result = {};\n model.parameterIds.forEach((id)=>{\n if (p1[id] !== p2[id]) result[id] = p2[id];\n });\n return result;\n }\n function updateParameters() {\n const parameters = {\n ...$0bf1d6c4c7fae0ba$var$initialParameters\n };\n [\n ...activeParameterTransformsContainer.children\n ].forEach((e)=>{\n (0, $cgw1K.strict)(e instanceof HTMLElement);\n const id = e.getAttribute(\"data-id\");\n (0, $cgw1K.strict)(id !== null);\n const parameterTransform = availableParameterTransforms.get(id);\n (0, $cgw1K.strict)(parameterTransform !== undefined);\n const backupParameters = {\n ...parameters\n };\n parameterTransform.applyTo(parameters);\n const distinctParameters = getDistinctParameters(backupParameters, parameters);\n e.title = `${parameterTransform.script}\\n\\n${JSON.stringify(distinctParameters, null, 2)}\\n\\n${JSON.stringify(parameters, null, 2)}`;\n });\n Object.assign(modelSimulator.parameters, parameters);\n }\n (0, $3bc6321cdb0e9401$export$2e2bcd8739ae039).create(availableParameterTransformsContainer, {\n group: {\n name: \"sharedParameterTransforms\",\n pull: \"clone\",\n put: false\n }\n });\n (0, $3bc6321cdb0e9401$export$2e2bcd8739ae039).create(activeParameterTransformsContainer, {\n group: {\n name: \"sharedParameterTransforms\"\n },\n removeOnSpill: true,\n onSort: ()=>updateParameters(),\n onSpill: (event)=>{\n event.item.remove();\n updateParameters();\n }\n });\n const parameterTransforms = {\n create: (id, script)=>{\n if (availableParameterTransforms.has(id)) throw new Error(`Parameter transform with id '${id}' already exists`);\n availableParameterTransforms.set(id, new (0, $5023ecf4320e7a5e$export$2e2bcd8739ae039)(\"none\", model.parameterIds, script));\n const dummyElement = document.createElement(\"div\");\n dummyElement.innerHTML = `

${id}
`;\n const parameterTransformElement = dummyElement.firstChild;\n (0, $cgw1K.strict)(parameterTransformElement !== null);\n availableParameterTransformsContainer.append(parameterTransformElement);\n },\n destroy: (id)=>{\n availableParameterTransforms.delete(id);\n }\n };\n (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#add-parameter-transform\", HTMLElement).addEventListener(\"click\", ()=>{\n const idElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#parameter-transform-id\", HTMLInputElement);\n const id = idElement.value;\n const scriptElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#parameter-transform-script\", HTMLTextAreaElement);\n const script = scriptElement.value;\n parameterTransforms.create(id, script);\n });\n const sliderContainer = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#sliders\", HTMLElement);\n model.parameterIds.filter((id)=>id !== \"numberOfUsers\").forEach((id)=>{\n const sliderElementLabel = document.createElement(\"div\");\n const sliderElement = document.createElement(\"input\");\n sliderElement.type = \"range\";\n sliderElement.min = \"0\";\n sliderElement.max = \"4\";\n sliderElement.step = \"0.001\";\n sliderElement.value = `${$0bf1d6c4c7fae0ba$var$initialParameters[id]}`;\n function updateSliderValue() {\n $0bf1d6c4c7fae0ba$var$initialParameters[id] = Number.parseFloat(sliderElement.value);\n sliderElementLabel.innerText = `${id} = ${$0bf1d6c4c7fae0ba$var$initialParameters[id]}`;\n updateParameters();\n }\n updateSliderValue();\n sliderElement.addEventListener(\"input\", updateSliderValue);\n const sliderWrapperElement = document.createElement(\"div\");\n sliderWrapperElement.append(sliderElementLabel, sliderElement);\n sliderContainer.append(sliderWrapperElement);\n });\n let circularityIndex = 0;\n const circularityIndexElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#circularity-index\", HTMLElement);\n let userSatisfaction = 0;\n const userSatisfactionElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#user-satisfaction\", HTMLElement);\n const visualization = await (0, $f48791a249d3586b$export$2e2bcd8739ae039).create(model);\n document.body.prepend(visualization.element);\n function toChartRecord(record) {\n return (0, $921d098521bb0b85$export$2e2bcd8739ae039).elementIds.map((key)=>Object.entries(record[key]).map(([id, value])=>({\n id: id,\n value: value\n }))).reduce((cur, acc)=>[\n ...cur,\n ...acc\n ], []);\n }\n const initialChartRecord = toChartRecord(modelSimulator.record);\n const chartCanvas = document.getElementById(\"chart\");\n (0, $cgw1K.strict)(chartCanvas !== null, \"chart element not found\");\n const chart = new (0, $8b0f4f5753bf297d$export$2e2bcd8739ae039)(chartCanvas, {\n type: \"bar\",\n data: {\n labels: initialChartRecord.map((row)=>row.id),\n datasets: [\n {\n label: \"Values\",\n data: initialChartRecord.map((row)=>row.value)\n }\n ]\n },\n options: {\n animation: false\n }\n });\n function updateIndices(record) {\n const smoothingFactor = 0.5;\n const { phonesInUse: phonesInUse } = record.stocks;\n const { produceFromNaturalResources: produceFromNaturalResources, acquireNewlyProduced: acquireNewlyProduced, acquireUsed: acquireUsed, acquireRepaired: acquireRepaired, acquireRefurbished: acquireRefurbished, disposeHibernating: disposeHibernating, disposeBroken: disposeBroken, landfill: landfill } = record.flows;\n const { phoneGoal: phoneGoal } = record.variables;\n const naturalResourcesShare = Math.min(1.0, produceFromNaturalResources / (acquireNewlyProduced + acquireUsed + acquireRepaired + acquireRefurbished));\n const landfillShare = Math.min(1.0, landfill / (disposeHibernating + disposeBroken));\n const circularityIndexTarget = Math.min(1.0 - naturalResourcesShare, 1.0 - landfillShare);\n circularityIndex += (circularityIndexTarget - circularityIndex) * smoothingFactor;\n circularityIndexElement.innerText = `${(circularityIndex * 100).toFixed(1)}%`;\n const userSatisfactionTarget = phonesInUse < phoneGoal ? phonesInUse / phoneGoal : phoneGoal / phonesInUse;\n userSatisfaction += (userSatisfactionTarget - userSatisfaction) * smoothingFactor;\n userSatisfactionElement.innerText = `${(userSatisfaction * 100).toFixed(1)}%`;\n }\n function stepSimulation(deltaMs) {\n // TODO: pass deltaMs to modelSimulator.step()\n const record = modelSimulator.step();\n updateIndices(record);\n const chartRecord = toChartRecord(record);\n // console.log(chartRecord);\n chart.data.datasets[0].data = chartRecord.map((row)=>row.value);\n chart.update();\n visualization.update(deltaMs, modelSimulator.h, record);\n }\n let running = false;\n const runCheckBox = document.getElementById(\"run\");\n (0, $cgw1K.strict)(runCheckBox !== null, \"run checkbox not found\");\n async function loopSimulation() {\n running = true;\n let lastTimeMs = null;\n while(runCheckBox.checked){\n // eslint-disable-next-line no-await-in-loop\n const currentTimeMs = await (0, $48e8ed6252738c92$export$1402cba6a733f33a)();\n const deltaMs = lastTimeMs === null ? 0 : currentTimeMs - lastTimeMs;\n stepSimulation(deltaMs);\n lastTimeMs = currentTimeMs;\n }\n running = false;\n }\n runCheckBox.addEventListener(\"input\", ()=>{\n if (!running) loopSimulation().catch((err)=>{\n throw err;\n });\n });\n stepSimulation(0);\n const circularEconomyApi = {\n model: model,\n modelSimulator: modelSimulator,\n parameterTransforms: parameterTransforms\n };\n return circularEconomyApi;\n}\nwindow.circularEconomy = (0, $e412526fc10a648a$export$3e2b244719956741)().then($0bf1d6c4c7fae0ba$var$init);\n\n})();\n//# sourceMappingURL=index.20493566.js.map\n","// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b\n\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nvar _require = require('./internal/errors'),\n _require$codes = _require.codes,\n ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE,\n ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;\nvar AssertionError = require('./internal/assert/assertion_error');\nvar _require2 = require('util/'),\n inspect = _require2.inspect;\nvar _require$types = require('util/').types,\n isPromise = _require$types.isPromise,\n isRegExp = _require$types.isRegExp;\nvar objectAssign = require('object.assign/polyfill')();\nvar objectIs = require('object-is/polyfill')();\nvar RegExpPrototypeTest = require('call-bind/callBound')('RegExp.prototype.test');\nvar errorCache = new Map();\nvar isDeepEqual;\nvar isDeepStrictEqual;\nvar parseExpressionAt;\nvar findNodeAround;\nvar decoder;\nfunction lazyLoadComparison() {\n var comparison = require('./internal/util/comparisons');\n isDeepEqual = comparison.isDeepEqual;\n isDeepStrictEqual = comparison.isDeepStrictEqual;\n}\n\n// Escape control characters but not \\n and \\t to keep the line breaks and\n// indentation intact.\n// eslint-disable-next-line no-control-regex\nvar escapeSequencesRegExp = /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/g;\nvar meta = [\"\\\\u0000\", \"\\\\u0001\", \"\\\\u0002\", \"\\\\u0003\", \"\\\\u0004\", \"\\\\u0005\", \"\\\\u0006\", \"\\\\u0007\", '\\\\b', '', '', \"\\\\u000b\", '\\\\f', '', \"\\\\u000e\", \"\\\\u000f\", \"\\\\u0010\", \"\\\\u0011\", \"\\\\u0012\", \"\\\\u0013\", \"\\\\u0014\", \"\\\\u0015\", \"\\\\u0016\", \"\\\\u0017\", \"\\\\u0018\", \"\\\\u0019\", \"\\\\u001a\", \"\\\\u001b\", \"\\\\u001c\", \"\\\\u001d\", \"\\\\u001e\", \"\\\\u001f\"];\nvar escapeFn = function escapeFn(str) {\n return meta[str.charCodeAt(0)];\n};\nvar warned = false;\n\n// The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\nvar NO_EXCEPTION_SENTINEL = {};\n\n// All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction innerFail(obj) {\n if (obj.message instanceof Error) throw obj.message;\n throw new AssertionError(obj);\n}\nfunction fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length;\n var internalMessage;\n if (argsLen === 0) {\n internalMessage = 'Failed';\n } else if (argsLen === 1) {\n message = actual;\n actual = undefined;\n } else {\n if (warned === false) {\n warned = true;\n var warn = process.emitWarning ? process.emitWarning : console.warn.bind(console);\n warn('assert.fail() with more than one argument is deprecated. ' + 'Please use assert.strictEqual() instead or only pass a message.', 'DeprecationWarning', 'DEP0094');\n }\n if (argsLen === 2) operator = '!=';\n }\n if (message instanceof Error) throw message;\n var errArgs = {\n actual: actual,\n expected: expected,\n operator: operator === undefined ? 'fail' : operator,\n stackStartFn: stackStartFn || fail\n };\n if (message !== undefined) {\n errArgs.message = message;\n }\n var err = new AssertionError(errArgs);\n if (internalMessage) {\n err.message = internalMessage;\n err.generatedMessage = true;\n }\n throw err;\n}\nassert.fail = fail;\n\n// The AssertionError is defined in internal/error.\nassert.AssertionError = AssertionError;\nfunction innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = false;\n if (argLen === 0) {\n generatedMessage = true;\n message = 'No value argument passed to `assert.ok()`';\n } else if (message instanceof Error) {\n throw message;\n }\n var err = new AssertionError({\n actual: value,\n expected: true,\n message: message,\n operator: '==',\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\n\n// Pure assertion tests whether a value is truthy, as determined\n// by !!value.\nfunction ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n innerOk.apply(void 0, [ok, args.length].concat(args));\n}\nassert.ok = ok;\n\n// The equality assertion tests shallow, coercive equality with ==.\n/* eslint-disable no-restricted-properties */\nassert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n // eslint-disable-next-line eqeqeq\n if (actual != expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '==',\n stackStartFn: equal\n });\n }\n};\n\n// The non-equality assertion tests for whether two objects are not\n// equal with !=.\nassert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n // eslint-disable-next-line eqeqeq\n if (actual == expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '!=',\n stackStartFn: notEqual\n });\n }\n};\n\n// The equivalence assertion tests a deep equality relation.\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (!isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepEqual',\n stackStartFn: deepEqual\n });\n }\n};\n\n// The non-equivalence assertion tests for any deep inequality.\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepEqual',\n stackStartFn: notDeepEqual\n });\n }\n};\n/* eslint-enable */\n\nassert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (!isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepStrictEqual',\n stackStartFn: deepStrictEqual\n });\n }\n};\nassert.notDeepStrictEqual = notDeepStrictEqual;\nfunction notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepStrictEqual',\n stackStartFn: notDeepStrictEqual\n });\n }\n}\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (!objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'strictEqual',\n stackStartFn: strictEqual\n });\n }\n};\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notStrictEqual',\n stackStartFn: notStrictEqual\n });\n }\n};\nvar Comparison = /*#__PURE__*/_createClass(function Comparison(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison);\n keys.forEach(function (key) {\n if (key in obj) {\n if (actual !== undefined && typeof actual[key] === 'string' && isRegExp(obj[key]) && RegExpPrototypeTest(obj[key], actual[key])) {\n _this[key] = actual[key];\n } else {\n _this[key] = obj[key];\n }\n }\n });\n});\nfunction compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) {\n if (!message) {\n // Create placeholder objects to create a nice output.\n var a = new Comparison(actual, keys);\n var b = new Comparison(expected, keys, actual);\n var err = new AssertionError({\n actual: a,\n expected: b,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.actual = actual;\n err.expected = expected;\n err.operator = fn.name;\n throw err;\n }\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n}\nfunction expectedException(actual, expected, msg, fn) {\n if (typeof expected !== 'function') {\n if (isRegExp(expected)) return RegExpPrototypeTest(expected, actual);\n // assert.doesNotThrow does not accept objects.\n if (arguments.length === 2) {\n throw new ERR_INVALID_ARG_TYPE('expected', ['Function', 'RegExp'], expected);\n }\n\n // Handle primitives properly.\n if (_typeof(actual) !== 'object' || actual === null) {\n var err = new AssertionError({\n actual: actual,\n expected: expected,\n message: msg,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.operator = fn.name;\n throw err;\n }\n var keys = Object.keys(expected);\n // Special handle errors to make sure the name and the message are compared\n // as well.\n if (expected instanceof Error) {\n keys.push('name', 'message');\n } else if (keys.length === 0) {\n throw new ERR_INVALID_ARG_VALUE('error', expected, 'may not be an empty object');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n keys.forEach(function (key) {\n if (typeof actual[key] === 'string' && isRegExp(expected[key]) && RegExpPrototypeTest(expected[key], actual[key])) {\n return;\n }\n compareExceptionKey(actual, expected, key, msg, keys, fn);\n });\n return true;\n }\n // Guard instanceof against arrow functions as they don't have a prototype.\n if (expected.prototype !== undefined && actual instanceof expected) {\n return true;\n }\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n return expected.call({}, actual) === true;\n}\nfunction getActual(fn) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', 'Function', fn);\n }\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n}\nfunction checkIsPromise(obj) {\n // Accept native ES6 promises and promises that are implemented in a similar\n // way. Do not accept thenables that use a function as `obj` and that have no\n // `catch` handler.\n\n // TODO: thenables are checked up until they have the correct methods,\n // but according to documentation, the `then` method should receive\n // the `fulfill` and `reject` arguments as well or it may be never resolved.\n\n return isPromise(obj) || obj !== null && _typeof(obj) === 'object' && typeof obj.then === 'function' && typeof obj.catch === 'function';\n}\nfunction waitForActual(promiseFn) {\n return Promise.resolve().then(function () {\n var resultPromise;\n if (typeof promiseFn === 'function') {\n // Return a rejected promise if `promiseFn` throws synchronously.\n resultPromise = promiseFn();\n // Fail in case no promise is returned.\n if (!checkIsPromise(resultPromise)) {\n throw new ERR_INVALID_RETURN_VALUE('instance of Promise', 'promiseFn', resultPromise);\n }\n } else if (checkIsPromise(promiseFn)) {\n resultPromise = promiseFn;\n } else {\n throw new ERR_INVALID_ARG_TYPE('promiseFn', ['Function', 'Promise'], promiseFn);\n }\n return Promise.resolve().then(function () {\n return resultPromise;\n }).then(function () {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function (e) {\n return e;\n });\n });\n}\nfunction expectsError(stackStartFn, actual, error, message) {\n if (typeof error === 'string') {\n if (arguments.length === 4) {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n if (_typeof(actual) === 'object' && actual !== null) {\n if (actual.message === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error message \\\"\".concat(actual.message, \"\\\" is identical to the message.\"));\n }\n } else if (actual === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error \\\"\".concat(actual, \"\\\" is identical to the message.\"));\n }\n message = error;\n error = undefined;\n } else if (error != null && _typeof(error) !== 'object' && typeof error !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = '';\n if (error && error.name) {\n details += \" (\".concat(error.name, \")\");\n }\n details += message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'rejects' ? 'rejection' : 'exception';\n innerFail({\n actual: undefined,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn: stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn)) {\n throw actual;\n }\n}\nfunction expectsNoError(stackStartFn, actual, error, message) {\n if (actual === NO_EXCEPTION_SENTINEL) return;\n if (typeof error === 'string') {\n message = error;\n error = undefined;\n }\n if (!error || expectedException(actual, error)) {\n var details = message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'doesNotReject' ? 'rejection' : 'exception';\n innerFail({\n actual: actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, \"\\n\") + \"Actual message: \\\"\".concat(actual && actual.message, \"\\\"\"),\n stackStartFn: stackStartFn\n });\n }\n throw actual;\n}\nassert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n};\nassert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n return waitForActual(promiseFn).then(function (result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n};\nassert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n};\nassert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {\n args[_key5 - 1] = arguments[_key5];\n }\n return waitForActual(fn).then(function (result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n};\nassert.ifError = function ifError(err) {\n if (err !== null && err !== undefined) {\n var message = 'ifError got unwanted exception: ';\n if (_typeof(err) === 'object' && typeof err.message === 'string') {\n if (err.message.length === 0 && err.constructor) {\n message += err.constructor.name;\n } else {\n message += err.message;\n }\n } else {\n message += inspect(err);\n }\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: 'ifError',\n message: message,\n stackStartFn: ifError\n });\n\n // Make sure we actually have a stack trace!\n var origStack = err.stack;\n if (typeof origStack === 'string') {\n // This will remove any duplicated frames from the error frames taken\n // from within `ifError` and add the original error frames to the newly\n // created ones.\n var tmp2 = origStack.split('\\n');\n tmp2.shift();\n // Filter all frames existing in err.stack.\n var tmp1 = newErr.stack.split('\\n');\n for (var i = 0; i < tmp2.length; i++) {\n // Find the first occurrence of the frame.\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n // Only keep new frames.\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join('\\n'), \"\\n\").concat(tmp2.join('\\n'));\n }\n throw newErr;\n }\n};\n\n// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a871df3dfb8ea663ef5e1f8f62701ec51384ecb\nfunction internalMatch(string, regexp, message, fn, fnName) {\n if (!isRegExp(regexp)) {\n throw new ERR_INVALID_ARG_TYPE('regexp', 'RegExp', regexp);\n }\n var match = fnName === 'match';\n if (typeof string !== 'string' || RegExpPrototypeTest(regexp, string) !== match) {\n if (message instanceof Error) {\n throw message;\n }\n var generatedMessage = !message;\n\n // 'The input was expected to not match the regular expression ' +\n message = message || (typeof string !== 'string' ? 'The \"string\" argument must be of type string. Received type ' + \"\".concat(_typeof(string), \" (\").concat(inspect(string), \")\") : (match ? 'The input did not match the regular expression ' : 'The input was expected to not match the regular expression ') + \"\".concat(inspect(regexp), \". Input:\\n\\n\").concat(inspect(string), \"\\n\"));\n var err = new AssertionError({\n actual: string,\n expected: regexp,\n message: message,\n operator: fnName,\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\nassert.match = function match(string, regexp, message) {\n internalMatch(string, regexp, message, match, 'match');\n};\nassert.doesNotMatch = function doesNotMatch(string, regexp, message) {\n internalMatch(string, regexp, message, doesNotMatch, 'doesNotMatch');\n};\n\n// Expose a strict only variant of assert\nfunction strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n innerOk.apply(void 0, [strict, args.length].concat(args));\n}\nassert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n});\nassert.strict.strict = assert.strict;","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","// Currently in sync with Node.js lib/internal/errors.js\n// https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f\n\n/* eslint node-core/documented-errors: \"error\" */\n/* eslint node-core/alphabetize-errors: \"error\" */\n/* eslint node-core/prefer-util-format-errors: \"error\" */\n\n'use strict';\n\n// The whole point behind this internal module is to allow Node.js to no\n// longer be forced to treat every error message change as a semver-major\n// change. The NodeError classes here all expose a `code` property whose\n// value statically and permanently identifies the error. While the error\n// message may change, the code should not.\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar codes = {};\n\n// Lazy loaded\nvar assert;\nvar util;\nfunction createErrorType(code, message, Base) {\n if (!Base) {\n Base = Error;\n }\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === 'string') {\n return message;\n } else {\n return message(arg1, arg2, arg3);\n }\n }\n var NodeError = /*#__PURE__*/function (_Base) {\n _inherits(NodeError, _Base);\n var _super = _createSuper(NodeError);\n function NodeError(arg1, arg2, arg3) {\n var _this;\n _classCallCheck(this, NodeError);\n _this = _super.call(this, getMessage(arg1, arg2, arg3));\n _this.code = code;\n return _this;\n }\n return _createClass(NodeError);\n }(Base);\n codes[code] = NodeError;\n}\n\n// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\nfunction oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function (i) {\n return String(i);\n });\n if (len > 2) {\n return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(', '), \", or \") + expected[len - 1];\n } else if (len === 2) {\n return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n } else {\n return \"of \".concat(thing, \" \").concat(expected[0]);\n }\n } else {\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\nfunction startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n return str.substring(this_len - search.length, this_len) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\nfunction includes(str, search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n if (start + search.length > str.length) {\n return false;\n } else {\n return str.indexOf(search, start) !== -1;\n }\n}\ncreateErrorType('ERR_AMBIGUOUS_ARGUMENT', 'The \"%s\" argument is ambiguous. %s', TypeError);\ncreateErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {\n if (assert === undefined) assert = require('../assert');\n assert(typeof name === 'string', \"'name' must be a string\");\n\n // determiner: 'must be' or 'must not be'\n var determiner;\n if (typeof expected === 'string' && startsWith(expected, 'not ')) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n } else {\n determiner = 'must be';\n }\n var msg;\n if (endsWith(name, ' argument')) {\n // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } else {\n var type = includes(name, '.') ? 'property' : 'argument';\n msg = \"The \\\"\".concat(name, \"\\\" \").concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n }\n\n // TODO(BridgeAR): Improve the output by showing `null` and similar.\n msg += \". Received type \".concat(_typeof(actual));\n return msg;\n}, TypeError);\ncreateErrorType('ERR_INVALID_ARG_VALUE', function (name, value) {\n var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'is invalid';\n if (util === undefined) util = require('util/');\n var inspected = util.inspect(value);\n if (inspected.length > 128) {\n inspected = \"\".concat(inspected.slice(0, 128), \"...\");\n }\n return \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n}, TypeError, RangeError);\ncreateErrorType('ERR_INVALID_RETURN_VALUE', function (input, name, value) {\n var type;\n if (value && value.constructor && value.constructor.name) {\n type = \"instance of \".concat(value.constructor.name);\n } else {\n type = \"type \".concat(_typeof(value));\n }\n return \"Expected \".concat(input, \" to be returned from the \\\"\").concat(name, \"\\\"\") + \" function but got \".concat(type, \".\");\n}, TypeError);\ncreateErrorType('ERR_MISSING_ARGS', function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (assert === undefined) assert = require('../assert');\n assert(args.length > 0, 'At least one arg needs to be specified');\n var msg = 'The ';\n var len = args.length;\n args = args.map(function (a) {\n return \"\\\"\".concat(a, \"\\\"\");\n });\n switch (len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(', ');\n msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n}, TypeError);\nmodule.exports.codes = codes;","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||\n function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for (var i = 0; i < keys.length; i++) {\n descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n }\n return descriptors;\n };\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n if (typeof process !== 'undefined' && process.noDeprecation === true) {\n return fn;\n }\n\n // Allow for deprecating things in the process of starting up.\n if (typeof process === 'undefined') {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnvRegex = /^$/;\n\nif (process.env.NODE_DEBUG) {\n var debugEnv = process.env.NODE_DEBUG;\n debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+?.]/g, '\\\\$&')\n .replace(/\\*/g, '.*')\n .replace(/,/g, '$|^')\n .toUpperCase();\n debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i');\n}\nexports.debuglog = function(set) {\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').slice(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.slice(1, -1);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexports.types = require('./support/types');\n\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\nexports.types.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\nexports.types.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\nexports.types.isNativeError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nvar kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;\n\nexports.promisify = function promisify(original) {\n if (typeof original !== 'function')\n throw new TypeError('The \"original\" argument must be of type Function');\n\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== 'function') {\n throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n }\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return fn;\n }\n\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function (resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n args.push(function (err, value) {\n if (err) {\n promiseReject(err);\n } else {\n promiseResolve(value);\n }\n });\n\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n\n return promise;\n }\n\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n\n if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return Object.defineProperties(\n fn,\n getOwnPropertyDescriptors(original)\n );\n}\n\nexports.promisify.custom = kCustomPromisifiedSymbol\n\nfunction callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error('Promise was rejected with a falsy value');\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\n\nfunction callbackify(original) {\n if (typeof original !== 'function') {\n throw new TypeError('The \"original\" argument must be of type Function');\n }\n\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args)\n .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) },\n function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) });\n }\n\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified,\n getOwnPropertyDescriptors(original));\n return callbackified;\n}\nexports.callbackify = callbackify;\n","// Currently in sync with Node.js lib/internal/util/types.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\n'use strict';\n\nvar isArgumentsObject = require('is-arguments');\nvar isGeneratorFunction = require('is-generator-function');\nvar whichTypedArray = require('which-typed-array');\nvar isTypedArray = require('is-typed-array');\n\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\n\nvar BigIntSupported = typeof BigInt !== 'undefined';\nvar SymbolSupported = typeof Symbol !== 'undefined';\n\nvar ObjectToString = uncurryThis(Object.prototype.toString);\n\nvar numberValue = uncurryThis(Number.prototype.valueOf);\nvar stringValue = uncurryThis(String.prototype.valueOf);\nvar booleanValue = uncurryThis(Boolean.prototype.valueOf);\n\nif (BigIntSupported) {\n var bigIntValue = uncurryThis(BigInt.prototype.valueOf);\n}\n\nif (SymbolSupported) {\n var symbolValue = uncurryThis(Symbol.prototype.valueOf);\n}\n\nfunction checkBoxedPrimitive(value, prototypeValueOf) {\n if (typeof value !== 'object') {\n return false;\n }\n try {\n prototypeValueOf(value);\n return true;\n } catch(e) {\n return false;\n }\n}\n\nexports.isArgumentsObject = isArgumentsObject;\nexports.isGeneratorFunction = isGeneratorFunction;\nexports.isTypedArray = isTypedArray;\n\n// Taken from here and modified for better browser support\n// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js\nfunction isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}\nexports.isPromise = isPromise;\n\nfunction isArrayBufferView(value) {\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n return ArrayBuffer.isView(value);\n }\n\n return (\n isTypedArray(value) ||\n isDataView(value)\n );\n}\nexports.isArrayBufferView = isArrayBufferView;\n\n\nfunction isUint8Array(value) {\n return whichTypedArray(value) === 'Uint8Array';\n}\nexports.isUint8Array = isUint8Array;\n\nfunction isUint8ClampedArray(value) {\n return whichTypedArray(value) === 'Uint8ClampedArray';\n}\nexports.isUint8ClampedArray = isUint8ClampedArray;\n\nfunction isUint16Array(value) {\n return whichTypedArray(value) === 'Uint16Array';\n}\nexports.isUint16Array = isUint16Array;\n\nfunction isUint32Array(value) {\n return whichTypedArray(value) === 'Uint32Array';\n}\nexports.isUint32Array = isUint32Array;\n\nfunction isInt8Array(value) {\n return whichTypedArray(value) === 'Int8Array';\n}\nexports.isInt8Array = isInt8Array;\n\nfunction isInt16Array(value) {\n return whichTypedArray(value) === 'Int16Array';\n}\nexports.isInt16Array = isInt16Array;\n\nfunction isInt32Array(value) {\n return whichTypedArray(value) === 'Int32Array';\n}\nexports.isInt32Array = isInt32Array;\n\nfunction isFloat32Array(value) {\n return whichTypedArray(value) === 'Float32Array';\n}\nexports.isFloat32Array = isFloat32Array;\n\nfunction isFloat64Array(value) {\n return whichTypedArray(value) === 'Float64Array';\n}\nexports.isFloat64Array = isFloat64Array;\n\nfunction isBigInt64Array(value) {\n return whichTypedArray(value) === 'BigInt64Array';\n}\nexports.isBigInt64Array = isBigInt64Array;\n\nfunction isBigUint64Array(value) {\n return whichTypedArray(value) === 'BigUint64Array';\n}\nexports.isBigUint64Array = isBigUint64Array;\n\nfunction isMapToString(value) {\n return ObjectToString(value) === '[object Map]';\n}\nisMapToString.working = (\n typeof Map !== 'undefined' &&\n isMapToString(new Map())\n);\n\nfunction isMap(value) {\n if (typeof Map === 'undefined') {\n return false;\n }\n\n return isMapToString.working\n ? isMapToString(value)\n : value instanceof Map;\n}\nexports.isMap = isMap;\n\nfunction isSetToString(value) {\n return ObjectToString(value) === '[object Set]';\n}\nisSetToString.working = (\n typeof Set !== 'undefined' &&\n isSetToString(new Set())\n);\nfunction isSet(value) {\n if (typeof Set === 'undefined') {\n return false;\n }\n\n return isSetToString.working\n ? isSetToString(value)\n : value instanceof Set;\n}\nexports.isSet = isSet;\n\nfunction isWeakMapToString(value) {\n return ObjectToString(value) === '[object WeakMap]';\n}\nisWeakMapToString.working = (\n typeof WeakMap !== 'undefined' &&\n isWeakMapToString(new WeakMap())\n);\nfunction isWeakMap(value) {\n if (typeof WeakMap === 'undefined') {\n return false;\n }\n\n return isWeakMapToString.working\n ? isWeakMapToString(value)\n : value instanceof WeakMap;\n}\nexports.isWeakMap = isWeakMap;\n\nfunction isWeakSetToString(value) {\n return ObjectToString(value) === '[object WeakSet]';\n}\nisWeakSetToString.working = (\n typeof WeakSet !== 'undefined' &&\n isWeakSetToString(new WeakSet())\n);\nfunction isWeakSet(value) {\n return isWeakSetToString(value);\n}\nexports.isWeakSet = isWeakSet;\n\nfunction isArrayBufferToString(value) {\n return ObjectToString(value) === '[object ArrayBuffer]';\n}\nisArrayBufferToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n isArrayBufferToString(new ArrayBuffer())\n);\nfunction isArrayBuffer(value) {\n if (typeof ArrayBuffer === 'undefined') {\n return false;\n }\n\n return isArrayBufferToString.working\n ? isArrayBufferToString(value)\n : value instanceof ArrayBuffer;\n}\nexports.isArrayBuffer = isArrayBuffer;\n\nfunction isDataViewToString(value) {\n return ObjectToString(value) === '[object DataView]';\n}\nisDataViewToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n typeof DataView !== 'undefined' &&\n isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1))\n);\nfunction isDataView(value) {\n if (typeof DataView === 'undefined') {\n return false;\n }\n\n return isDataViewToString.working\n ? isDataViewToString(value)\n : value instanceof DataView;\n}\nexports.isDataView = isDataView;\n\n// Store a copy of SharedArrayBuffer in case it's deleted elsewhere\nvar SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined;\nfunction isSharedArrayBufferToString(value) {\n return ObjectToString(value) === '[object SharedArrayBuffer]';\n}\nfunction isSharedArrayBuffer(value) {\n if (typeof SharedArrayBufferCopy === 'undefined') {\n return false;\n }\n\n if (typeof isSharedArrayBufferToString.working === 'undefined') {\n isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());\n }\n\n return isSharedArrayBufferToString.working\n ? isSharedArrayBufferToString(value)\n : value instanceof SharedArrayBufferCopy;\n}\nexports.isSharedArrayBuffer = isSharedArrayBuffer;\n\nfunction isAsyncFunction(value) {\n return ObjectToString(value) === '[object AsyncFunction]';\n}\nexports.isAsyncFunction = isAsyncFunction;\n\nfunction isMapIterator(value) {\n return ObjectToString(value) === '[object Map Iterator]';\n}\nexports.isMapIterator = isMapIterator;\n\nfunction isSetIterator(value) {\n return ObjectToString(value) === '[object Set Iterator]';\n}\nexports.isSetIterator = isSetIterator;\n\nfunction isGeneratorObject(value) {\n return ObjectToString(value) === '[object Generator]';\n}\nexports.isGeneratorObject = isGeneratorObject;\n\nfunction isWebAssemblyCompiledModule(value) {\n return ObjectToString(value) === '[object WebAssembly.Module]';\n}\nexports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;\n\nfunction isNumberObject(value) {\n return checkBoxedPrimitive(value, numberValue);\n}\nexports.isNumberObject = isNumberObject;\n\nfunction isStringObject(value) {\n return checkBoxedPrimitive(value, stringValue);\n}\nexports.isStringObject = isStringObject;\n\nfunction isBooleanObject(value) {\n return checkBoxedPrimitive(value, booleanValue);\n}\nexports.isBooleanObject = isBooleanObject;\n\nfunction isBigIntObject(value) {\n return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);\n}\nexports.isBigIntObject = isBigIntObject;\n\nfunction isSymbolObject(value) {\n return SymbolSupported && checkBoxedPrimitive(value, symbolValue);\n}\nexports.isSymbolObject = isSymbolObject;\n\nfunction isBoxedPrimitive(value) {\n return (\n isNumberObject(value) ||\n isStringObject(value) ||\n isBooleanObject(value) ||\n isBigIntObject(value) ||\n isSymbolObject(value)\n );\n}\nexports.isBoxedPrimitive = isBoxedPrimitive;\n\nfunction isAnyArrayBuffer(value) {\n return typeof Uint8Array !== 'undefined' && (\n isArrayBuffer(value) ||\n isSharedArrayBuffer(value)\n );\n}\nexports.isAnyArrayBuffer = isAnyArrayBuffer;\n\n['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) {\n Object.defineProperty(exports, method, {\n enumerable: false,\n value: function() {\n throw new Error(method + ' is not supported in userland');\n }\n });\n});\n","'use strict';\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\n\nvar isStandardArguments = function isArguments(value) {\n\tif (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {\n\t\treturn false;\n\t}\n\treturn $toString(value) === '[object Arguments]';\n};\n\nvar isLegacyArguments = function isArguments(value) {\n\tif (isStandardArguments(value)) {\n\t\treturn true;\n\t}\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.length === 'number' &&\n\t\tvalue.length >= 0 &&\n\t\t$toString(value) !== '[object Array]' &&\n\t\t$toString(value.callee) === '[object Function]';\n};\n\nvar supportsStandardArguments = (function () {\n\treturn isStandardArguments(arguments);\n}());\n\nisStandardArguments.isLegacyArguments = isLegacyArguments; // for tests\n\nmodule.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('hasown');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = require('function-bind');\n\n/** @type {(o: {}, p: PropertyKey) => p is keyof o} */\nmodule.exports = bind.call(call, $hasOwn);\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\nvar setFunctionLength = require('set-function-length');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tif (typeof originalFunction !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\tvar func = $reflectApply(bind, $call, arguments);\n\treturn setFunctionLength(\n\t\tfunc,\n\t\t1 + $max(0, originalFunction.length - (arguments.length - 1)),\n\t\ttrue\n\t);\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar gOPD = require('gopd');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $floor = GetIntrinsic('%Math.floor%');\n\nmodule.exports = function setFunctionLength(fn, length) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tif (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {\n\t\tthrow new $TypeError('`length` must be a positive 32-bit integer');\n\t}\n\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\n\tvar functionLengthIsConfigurable = true;\n\tvar functionLengthIsWritable = true;\n\tif ('length' in fn && gOPD) {\n\t\tvar desc = gOPD(fn, 'length');\n\t\tif (desc && !desc.configurable) {\n\t\t\tfunctionLengthIsConfigurable = false;\n\t\t}\n\t\tif (desc && !desc.writable) {\n\t\t\tfunctionLengthIsWritable = false;\n\t\t}\n\t}\n\n\tif (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(fn, 'length', length, true, true);\n\t\t} else {\n\t\t\tdefine(fn, 'length', length);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors')();\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar gopd = require('gopd');\n\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\tif ($defineProperty) {\n\t\ttry {\n\t\t\t$defineProperty({}, 'a', { value: 1 });\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\t// IE 8 has a broken defineProperty\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!hasPropertyDescriptors()) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar fnToStr = Function.prototype.toString;\nvar isFnRegex = /^\\s*(?:function)?\\*/;\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar getProto = Object.getPrototypeOf;\nvar getGeneratorFunc = function () { // eslint-disable-line consistent-return\n\tif (!hasToStringTag) {\n\t\treturn false;\n\t}\n\ttry {\n\t\treturn Function('return function*() {}')();\n\t} catch (e) {\n\t}\n};\nvar GeneratorFunction;\n\nmodule.exports = function isGeneratorFunction(fn) {\n\tif (typeof fn !== 'function') {\n\t\treturn false;\n\t}\n\tif (isFnRegex.test(fnToStr.call(fn))) {\n\t\treturn true;\n\t}\n\tif (!hasToStringTag) {\n\t\tvar str = toStr.call(fn);\n\t\treturn str === '[object GeneratorFunction]';\n\t}\n\tif (!getProto) {\n\t\treturn false;\n\t}\n\tif (typeof GeneratorFunction === 'undefined') {\n\t\tvar generatorFunc = getGeneratorFunc();\n\t\tGeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;\n\t}\n\treturn getProto(fn) === GeneratorFunction;\n};\n","'use strict';\n\nvar forEach = require('for-each');\nvar availableTypedArrays = require('available-typed-arrays');\nvar callBind = require('call-bind');\nvar callBound = require('call-bind/callBound');\nvar gOPD = require('gopd');\n\nvar $toString = callBound('Object.prototype.toString');\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\nvar typedArrays = availableTypedArrays();\n\nvar $slice = callBound('String.prototype.slice');\nvar getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\n\nvar $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tif (array[i] === value) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n};\nvar cache = { __proto__: null };\nif (hasToStringTag && gOPD && getPrototypeOf) {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new g[typedArray]();\n\t\tif (Symbol.toStringTag in arr) {\n\t\t\tvar proto = getPrototypeOf(arr);\n\t\t\tvar descriptor = gOPD(proto, Symbol.toStringTag);\n\t\t\tif (!descriptor) {\n\t\t\t\tvar superProto = getPrototypeOf(proto);\n\t\t\t\tdescriptor = gOPD(superProto, Symbol.toStringTag);\n\t\t\t}\n\t\t\tcache['$' + typedArray] = callBind(descriptor.get);\n\t\t}\n\t});\n} else {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new g[typedArray]();\n\t\tvar fn = arr.slice || arr.set;\n\t\tif (fn) {\n\t\t\tcache['$' + typedArray] = callBind(fn);\n\t\t}\n\t});\n}\n\nvar tryTypedArrays = function tryAllTypedArrays(value) {\n\tvar found = false;\n\tforEach(cache, function (getter, typedArray) {\n\t\tif (!found) {\n\t\t\ttry {\n\t\t\t\tif ('$' + getter(value) === typedArray) {\n\t\t\t\t\tfound = $slice(typedArray, 1);\n\t\t\t\t}\n\t\t\t} catch (e) { /**/ }\n\t\t}\n\t});\n\treturn found;\n};\n\nvar trySlices = function tryAllSlices(value) {\n\tvar found = false;\n\tforEach(cache, function (getter, name) {\n\t\tif (!found) {\n\t\t\ttry {\n\t\t\t\tgetter(value);\n\t\t\t\tfound = $slice(name, 1);\n\t\t\t} catch (e) { /**/ }\n\t\t}\n\t});\n\treturn found;\n};\n\nmodule.exports = function whichTypedArray(value) {\n\tif (!value || typeof value !== 'object') { return false; }\n\tif (!hasToStringTag) {\n\t\tvar tag = $slice($toString(value), 8, -1);\n\t\tif ($indexOf(typedArrays, tag) > -1) {\n\t\t\treturn tag;\n\t\t}\n\t\tif (tag !== 'Object') {\n\t\t\treturn false;\n\t\t}\n\t\t// node < 0.6 hits here on real Typed Arrays\n\t\treturn trySlices(value);\n\t}\n\tif (!gOPD) { return null; } // unknown engine\n\treturn tryTypedArrays(value);\n};\n","'use strict';\n\nvar isCallable = require('is-callable');\n\nvar toStr = Object.prototype.toString;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar forEachArray = function forEachArray(array, iterator, receiver) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (hasOwnProperty.call(array, i)) {\n if (receiver == null) {\n iterator(array[i], i, array);\n } else {\n iterator.call(receiver, array[i], i, array);\n }\n }\n }\n};\n\nvar forEachString = function forEachString(string, iterator, receiver) {\n for (var i = 0, len = string.length; i < len; i++) {\n // no such thing as a sparse string.\n if (receiver == null) {\n iterator(string.charAt(i), i, string);\n } else {\n iterator.call(receiver, string.charAt(i), i, string);\n }\n }\n};\n\nvar forEachObject = function forEachObject(object, iterator, receiver) {\n for (var k in object) {\n if (hasOwnProperty.call(object, k)) {\n if (receiver == null) {\n iterator(object[k], k, object);\n } else {\n iterator.call(receiver, object[k], k, object);\n }\n }\n }\n};\n\nvar forEach = function forEach(list, iterator, thisArg) {\n if (!isCallable(iterator)) {\n throw new TypeError('iterator must be a function');\n }\n\n var receiver;\n if (arguments.length >= 3) {\n receiver = thisArg;\n }\n\n if (toStr.call(list) === '[object Array]') {\n forEachArray(list, iterator, receiver);\n } else if (typeof list === 'string') {\n forEachString(list, iterator, receiver);\n } else {\n forEachObject(list, iterator, receiver);\n }\n};\n\nmodule.exports = forEach;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar possibleNames = [\n\t'BigInt64Array',\n\t'BigUint64Array',\n\t'Float32Array',\n\t'Float64Array',\n\t'Int16Array',\n\t'Int32Array',\n\t'Int8Array',\n\t'Uint16Array',\n\t'Uint32Array',\n\t'Uint8Array',\n\t'Uint8ClampedArray'\n];\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\n\nmodule.exports = function availableTypedArrays() {\n\tvar out = [];\n\tfor (var i = 0; i < possibleNames.length; i++) {\n\t\tif (typeof g[possibleNames[i]] === 'function') {\n\t\t\tout[out.length] = possibleNames[i];\n\t\t}\n\t}\n\treturn out;\n};\n","'use strict';\n\nvar whichTypedArray = require('which-typed-array');\n\nmodule.exports = function isTypedArray(value) {\n\treturn !!whichTypedArray(value);\n};\n","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","// Currently in sync with Node.js lib/internal/assert/assertion_error.js\n// https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c\n\n'use strict';\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _require = require('util/'),\n inspect = _require.inspect;\nvar _require2 = require('../errors'),\n ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n return str.substring(this_len - search.length, this_len) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\nfunction repeat(str, count) {\n count = Math.floor(count);\n if (str.length == 0 || count == 0) return '';\n var maxCount = str.length * count;\n count = Math.floor(Math.log(count) / Math.log(2));\n while (count) {\n str += str;\n count--;\n }\n str += str.substring(0, maxCount - str.length);\n return str;\n}\nvar blue = '';\nvar green = '';\nvar red = '';\nvar white = '';\nvar kReadableOperator = {\n deepStrictEqual: 'Expected values to be strictly deep-equal:',\n strictEqual: 'Expected values to be strictly equal:',\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: 'Expected values to be loosely deep-equal:',\n equal: 'Expected values to be loosely equal:',\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: 'Values identical but not reference-equal:'\n};\n\n// Comparing short primitives should just show === / !== instead of using the\n// diff.\nvar kMaxShortLength = 10;\nfunction copyError(source) {\n var keys = Object.keys(source);\n var target = Object.create(Object.getPrototypeOf(source));\n keys.forEach(function (key) {\n target[key] = source[key];\n });\n Object.defineProperty(target, 'message', {\n value: source.message\n });\n return target;\n}\nfunction inspectValue(val) {\n // The util.inspect default values could be changed. This makes sure the\n // error messages contain the necessary information nevertheless.\n return inspect(val, {\n compact: false,\n customInspect: false,\n depth: 1000,\n maxArrayLength: Infinity,\n // Assert compares only enumerable properties (with a few exceptions).\n showHidden: false,\n // Having a long line as error is better than wrapping the line for\n // comparison for now.\n // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we\n // have meta information about the inspected properties (i.e., know where\n // in what line the property starts and ends).\n breakLength: Infinity,\n // Assert does not detect proxies currently.\n showProxy: false,\n sorted: true,\n // Inspect getters as we also check them when comparing entries.\n getters: true\n });\n}\nfunction createErrDiff(actual, expected, operator) {\n var other = '';\n var res = '';\n var lastPos = 0;\n var end = '';\n var skipped = false;\n var actualInspected = inspectValue(actual);\n var actualLines = actualInspected.split('\\n');\n var expectedLines = inspectValue(expected).split('\\n');\n var i = 0;\n var indicator = '';\n\n // In case both values are objects explicitly mark them as not reference equal\n // for the `strictEqual` operator.\n if (operator === 'strictEqual' && _typeof(actual) === 'object' && _typeof(expected) === 'object' && actual !== null && expected !== null) {\n operator = 'strictEqualObject';\n }\n\n // If \"actual\" and \"expected\" fit on a single line and they are not strictly\n // equal, check further special handling.\n if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n // If the character length of \"actual\" and \"expected\" together is less than\n // kMaxShortLength and if neither is an object and at least one of them is\n // not `zero`, use the strict equal comparison to visualize the output.\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== 'object' || actual === null) && (_typeof(expected) !== 'object' || expected === null) && (actual !== 0 || expected !== 0)) {\n // -0 === +0\n return \"\".concat(kReadableOperator[operator], \"\\n\\n\") + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], \"\\n\");\n }\n } else if (operator !== 'strictEqualObject') {\n // If the stderr is a tty and the input length is lower than the current\n // columns per line, add a mismatch indicator below the output. If it is\n // not a tty, use a default value of 80 characters.\n var maxLength = process.stderr && process.stderr.isTTY ? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n while (actualLines[0][i] === expectedLines[0][i]) {\n i++;\n }\n // Ignore the first characters.\n if (i > 2) {\n // Add position indicator for the first mismatch in case it is a\n // single line and the input length is less than the column length.\n indicator = \"\\n \".concat(repeat(' ', i), \"^\");\n i = 0;\n }\n }\n }\n }\n\n // Remove all ending lines that match (this optimizes the output for\n // readability by reducing the number of total changed lines).\n var a = actualLines[actualLines.length - 1];\n var b = expectedLines[expectedLines.length - 1];\n while (a === b) {\n if (i++ < 2) {\n end = \"\\n \".concat(a).concat(end);\n } else {\n other = a;\n }\n actualLines.pop();\n expectedLines.pop();\n if (actualLines.length === 0 || expectedLines.length === 0) break;\n a = actualLines[actualLines.length - 1];\n b = expectedLines[expectedLines.length - 1];\n }\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n // Strict equal with identical objects that are not identical by reference.\n // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() })\n if (maxLines === 0) {\n // We have to get the result again. The lines were all removed before.\n var _actualLines = actualInspected.split('\\n');\n\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (_actualLines.length > 30) {\n _actualLines[26] = \"\".concat(blue, \"...\").concat(white);\n while (_actualLines.length > 27) {\n _actualLines.pop();\n }\n }\n return \"\".concat(kReadableOperator.notIdentical, \"\\n\\n\").concat(_actualLines.join('\\n'), \"\\n\");\n }\n if (i > 3) {\n end = \"\\n\".concat(blue, \"...\").concat(white).concat(end);\n skipped = true;\n }\n if (other !== '') {\n end = \"\\n \".concat(other).concat(end);\n other = '';\n }\n var printedLines = 0;\n var msg = kReadableOperator[operator] + \"\\n\".concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white);\n var skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0; i < maxLines; i++) {\n // Only extra expected lines exist\n var cur = i - lastPos;\n if (actualLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(expectedLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(expectedLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the expected line to the cache.\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]);\n printedLines++;\n // Only extra actual lines exist\n } else if (expectedLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result.\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLines[i]);\n printedLines++;\n // Lines diverge\n } else {\n var expectedLine = expectedLines[i];\n var actualLine = actualLines[i];\n // If the lines diverge, specifically check for lines that only diverge by\n // a trailing comma. In that case it is actually identical and we should\n // mark it as such.\n var divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, ',') || actualLine.slice(0, -1) !== expectedLine);\n // If the expected line has a trailing comma but is otherwise identical,\n // add a comma at the end of the actual line. Otherwise the output could\n // look weird as in:\n //\n // [\n // 1 // No comma at the end!\n // + 2\n // ]\n //\n if (divergingLines && endsWith(expectedLine, ',') && expectedLine.slice(0, -1) === actualLine) {\n divergingLines = false;\n actualLine += ',';\n }\n if (divergingLines) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result and cache the expected diverging\n // line so consecutive diverging lines show up as +++--- and not +-+-+-.\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLine);\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLine);\n printedLines += 2;\n // Lines are identical\n } else {\n // Add all cached information to the result before adding other things\n // and reset the cache.\n res += other;\n other = '';\n // If the last diverging line is exactly one line above or if it is the\n // very first line, add the line to the result.\n if (cur === 1 || i === 0) {\n res += \"\\n \".concat(actualLine);\n printedLines++;\n }\n }\n }\n // Inspected object to big (Show ~20 rows max)\n if (printedLines > 20 && i < maxLines - 2) {\n return \"\".concat(msg).concat(skippedMsg, \"\\n\").concat(res, \"\\n\").concat(blue, \"...\").concat(white).concat(other, \"\\n\") + \"\".concat(blue, \"...\").concat(white);\n }\n }\n return \"\".concat(msg).concat(skipped ? skippedMsg : '', \"\\n\").concat(res).concat(other).concat(end).concat(indicator);\n}\nvar AssertionError = /*#__PURE__*/function (_Error, _inspect$custom) {\n _inherits(AssertionError, _Error);\n var _super = _createSuper(AssertionError);\n function AssertionError(options) {\n var _this;\n _classCallCheck(this, AssertionError);\n if (_typeof(options) !== 'object' || options === null) {\n throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);\n }\n var message = options.message,\n operator = options.operator,\n stackStartFn = options.stackStartFn;\n var actual = options.actual,\n expected = options.expected;\n var limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n if (message != null) {\n _this = _super.call(this, String(message));\n } else {\n if (process.stderr && process.stderr.isTTY) {\n // Reset on each call to make sure we handle dynamically set environment\n // variables correct.\n if (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1) {\n blue = \"\\x1B[34m\";\n green = \"\\x1B[32m\";\n white = \"\\x1B[39m\";\n red = \"\\x1B[31m\";\n } else {\n blue = '';\n green = '';\n white = '';\n red = '';\n }\n }\n // Prevent the error stack from being visible by duplicating the error\n // in a very close way to the original in case both sides are actually\n // instances of Error.\n if (_typeof(actual) === 'object' && actual !== null && _typeof(expected) === 'object' && expected !== null && 'stack' in actual && actual instanceof Error && 'stack' in expected && expected instanceof Error) {\n actual = copyError(actual);\n expected = copyError(expected);\n }\n if (operator === 'deepStrictEqual' || operator === 'strictEqual') {\n _this = _super.call(this, createErrDiff(actual, expected, operator));\n } else if (operator === 'notDeepStrictEqual' || operator === 'notStrictEqual') {\n // In case the objects are equal but the operator requires unequal, show\n // the first object and say A equals B\n var base = kReadableOperator[operator];\n var res = inspectValue(actual).split('\\n');\n\n // In case \"actual\" is an object, it should not be reference equal.\n if (operator === 'notStrictEqual' && _typeof(actual) === 'object' && actual !== null) {\n base = kReadableOperator.notStrictEqualObject;\n }\n\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (res.length > 30) {\n res[26] = \"\".concat(blue, \"...\").concat(white);\n while (res.length > 27) {\n res.pop();\n }\n }\n\n // Only print a single input.\n if (res.length === 1) {\n _this = _super.call(this, \"\".concat(base, \" \").concat(res[0]));\n } else {\n _this = _super.call(this, \"\".concat(base, \"\\n\\n\").concat(res.join('\\n'), \"\\n\"));\n }\n } else {\n var _res = inspectValue(actual);\n var other = '';\n var knownOperators = kReadableOperator[operator];\n if (operator === 'notDeepEqual' || operator === 'notEqual') {\n _res = \"\".concat(kReadableOperator[operator], \"\\n\\n\").concat(_res);\n if (_res.length > 1024) {\n _res = \"\".concat(_res.slice(0, 1021), \"...\");\n }\n } else {\n other = \"\".concat(inspectValue(expected));\n if (_res.length > 512) {\n _res = \"\".concat(_res.slice(0, 509), \"...\");\n }\n if (other.length > 512) {\n other = \"\".concat(other.slice(0, 509), \"...\");\n }\n if (operator === 'deepEqual' || operator === 'equal') {\n _res = \"\".concat(knownOperators, \"\\n\\n\").concat(_res, \"\\n\\nshould equal\\n\\n\");\n } else {\n other = \" \".concat(operator, \" \").concat(other);\n }\n }\n _this = _super.call(this, \"\".concat(_res).concat(other));\n }\n }\n Error.stackTraceLimit = limit;\n _this.generatedMessage = !message;\n Object.defineProperty(_assertThisInitialized(_this), 'name', {\n value: 'AssertionError [ERR_ASSERTION]',\n enumerable: false,\n writable: true,\n configurable: true\n });\n _this.code = 'ERR_ASSERTION';\n _this.actual = actual;\n _this.expected = expected;\n _this.operator = operator;\n if (Error.captureStackTrace) {\n // eslint-disable-next-line no-restricted-syntax\n Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn);\n }\n // Create error message including the error code in the name.\n _this.stack;\n // Reset the name.\n _this.name = 'AssertionError';\n return _possibleConstructorReturn(_this);\n }\n _createClass(AssertionError, [{\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n }, {\n key: _inspect$custom,\n value: function value(recurseTimes, ctx) {\n // This limits the `actual` and `expected` property default inspection to\n // the minimum depth. Otherwise those values would be too verbose compared\n // to the actual error message which contains a combined view of these two\n // input values.\n return inspect(this, _objectSpread(_objectSpread({}, ctx), {}, {\n customInspect: false,\n depth: 0\n }));\n }\n }]);\n return AssertionError;\n}( /*#__PURE__*/_wrapNativeSuper(Error), inspect.custom);\nmodule.exports = AssertionError;","'use strict';\n\nvar implementation = require('./implementation');\n\nvar lacksProperEnumerationOrder = function () {\n\tif (!Object.assign) {\n\t\treturn false;\n\t}\n\t/*\n\t * v8, specifically in node 4.x, has a bug with incorrect property enumeration order\n\t * note: this does not detect the bug unless there's 20 characters\n\t */\n\tvar str = 'abcdefghijklmnopqrst';\n\tvar letters = str.split('');\n\tvar map = {};\n\tfor (var i = 0; i < letters.length; ++i) {\n\t\tmap[letters[i]] = letters[i];\n\t}\n\tvar obj = Object.assign({}, map);\n\tvar actual = '';\n\tfor (var k in obj) {\n\t\tactual += k;\n\t}\n\treturn str !== actual;\n};\n\nvar assignHasPendingExceptions = function () {\n\tif (!Object.assign || !Object.preventExtensions) {\n\t\treturn false;\n\t}\n\t/*\n\t * Firefox 37 still has \"pending exception\" logic in its Object.assign implementation,\n\t * which is 72% slower than our shim, and Firefox 40's native implementation.\n\t */\n\tvar thrower = Object.preventExtensions({ 1: 2 });\n\ttry {\n\t\tObject.assign(thrower, 'xy');\n\t} catch (e) {\n\t\treturn thrower[1] === 'y';\n\t}\n\treturn false;\n};\n\nmodule.exports = function getPolyfill() {\n\tif (!Object.assign) {\n\t\treturn implementation;\n\t}\n\tif (lacksProperEnumerationOrder()) {\n\t\treturn implementation;\n\t}\n\tif (assignHasPendingExceptions()) {\n\t\treturn implementation;\n\t}\n\treturn Object.assign;\n};\n","'use strict';\n\n// modified from https://github.com/es-shims/es6-shim\nvar objectKeys = require('object-keys');\nvar hasSymbols = require('has-symbols/shams')();\nvar callBound = require('call-bind/callBound');\nvar toObject = Object;\nvar $push = callBound('Array.prototype.push');\nvar $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');\nvar originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;\n\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function assign(target, source1) {\n\tif (target == null) { throw new TypeError('target must be an object'); }\n\tvar to = toObject(target); // step 1\n\tif (arguments.length === 1) {\n\t\treturn to; // step 2\n\t}\n\tfor (var s = 1; s < arguments.length; ++s) {\n\t\tvar from = toObject(arguments[s]); // step 3.a.i\n\n\t\t// step 3.a.ii:\n\t\tvar keys = objectKeys(from);\n\t\tvar getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);\n\t\tif (getSymbols) {\n\t\t\tvar syms = getSymbols(from);\n\t\t\tfor (var j = 0; j < syms.length; ++j) {\n\t\t\t\tvar key = syms[j];\n\t\t\t\tif ($propIsEnumerable(from, key)) {\n\t\t\t\t\t$push(keys, key);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// step 3.a.iii:\n\t\tfor (var i = 0; i < keys.length; ++i) {\n\t\t\tvar nextKey = keys[i];\n\t\t\tif ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2\n\t\t\t\tvar propValue = from[nextKey]; // step 3.a.iii.2.a\n\t\t\t\tto[nextKey] = propValue; // step 3.a.iii.2.b\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to; // step 4\n};\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\treturn typeof Object.is === 'function' ? Object.is : implementation;\n};\n","'use strict';\n\nvar numberIsNaN = function (value) {\n\treturn value !== value;\n};\n\nmodule.exports = function is(a, b) {\n\tif (a === 0 && b === 0) {\n\t\treturn 1 / a === 1 / b;\n\t}\n\tif (a === b) {\n\t\treturn true;\n\t}\n\tif (numberIsNaN(a) && numberIsNaN(b)) {\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n","// Currently in sync with Node.js lib/internal/util/comparisons.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\n'use strict';\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar regexFlagsSupported = /a/g.flags !== undefined;\nvar arrayFromSet = function arrayFromSet(set) {\n var array = [];\n set.forEach(function (value) {\n return array.push(value);\n });\n return array;\n};\nvar arrayFromMap = function arrayFromMap(map) {\n var array = [];\n map.forEach(function (value, key) {\n return array.push([key, value]);\n });\n return array;\n};\nvar objectIs = Object.is ? Object.is : require('object-is');\nvar objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function () {\n return [];\n};\nvar numberIsNaN = Number.isNaN ? Number.isNaN : require('is-nan');\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\nvar hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);\nvar propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable);\nvar objectToString = uncurryThis(Object.prototype.toString);\nvar _require$types = require('util/').types,\n isAnyArrayBuffer = _require$types.isAnyArrayBuffer,\n isArrayBufferView = _require$types.isArrayBufferView,\n isDate = _require$types.isDate,\n isMap = _require$types.isMap,\n isRegExp = _require$types.isRegExp,\n isSet = _require$types.isSet,\n isNativeError = _require$types.isNativeError,\n isBoxedPrimitive = _require$types.isBoxedPrimitive,\n isNumberObject = _require$types.isNumberObject,\n isStringObject = _require$types.isStringObject,\n isBooleanObject = _require$types.isBooleanObject,\n isBigIntObject = _require$types.isBigIntObject,\n isSymbolObject = _require$types.isSymbolObject,\n isFloat32Array = _require$types.isFloat32Array,\n isFloat64Array = _require$types.isFloat64Array;\nfunction isNonIndex(key) {\n if (key.length === 0 || key.length > 10) return true;\n for (var i = 0; i < key.length; i++) {\n var code = key.charCodeAt(i);\n if (code < 48 || code > 57) return true;\n }\n // The maximum size for an array is 2 ** 32 -1.\n return key.length === 10 && key >= Math.pow(2, 32);\n}\nfunction getOwnNonIndexProperties(value) {\n return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));\n}\n\n// Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n var x = a.length;\n var y = b.length;\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}\nvar ONLY_ENUMERABLE = undefined;\nvar kStrict = true;\nvar kLoose = false;\nvar kNoIterator = 0;\nvar kIsArray = 1;\nvar kIsSet = 2;\nvar kIsMap = 3;\n\n// Check if they have the same source and flags\nfunction areSimilarRegExps(a, b) {\n return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);\n}\nfunction areSimilarFloatArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n for (var offset = 0; offset < a.byteLength; offset++) {\n if (a[offset] !== b[offset]) {\n return false;\n }\n }\n return true;\n}\nfunction areSimilarTypedArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n return compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;\n}\nfunction areEqualArrayBuffers(buf1, buf2) {\n return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;\n}\nfunction isEqualBoxedPrimitive(val1, val2) {\n if (isNumberObject(val1)) {\n return isNumberObject(val2) && objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));\n }\n if (isStringObject(val1)) {\n return isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);\n }\n if (isBooleanObject(val1)) {\n return isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);\n }\n if (isBigIntObject(val1)) {\n return isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);\n }\n return isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);\n}\n\n// Notes: Type tags are historical [[Class]] properties that can be set by\n// FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS\n// and retrieved using Object.prototype.toString.call(obj) in JS\n// See https://tc39.github.io/ecma262/#sec-object.prototype.tostring\n// for a list of tags pre-defined in the spec.\n// There are some unspecified tags in the wild too (e.g. typed array tags).\n// Since tags can be altered, they only serve fast failures\n//\n// Typed arrays and buffers are checked by comparing the content in their\n// underlying ArrayBuffer. This optimization requires that it's\n// reasonable to interpret their underlying memory in the same way,\n// which is checked by comparing their type tags.\n// (e.g. a Uint8Array and a Uint16Array with the same memory content\n// could still be different because they will be interpreted differently).\n//\n// For strict comparison, objects should have\n// a) The same built-in type tags\n// b) The same prototypes.\n\nfunction innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? objectIs(val1, val2) : true;\n }\n\n // Check more closely if val1 and val2 are equal.\n if (strict) {\n if (_typeof(val1) !== 'object') {\n return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2);\n }\n if (_typeof(val2) !== 'object' || val1 === null || val2 === null) {\n return false;\n }\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) {\n return false;\n }\n } else {\n if (val1 === null || _typeof(val1) !== 'object') {\n if (val2 === null || _typeof(val2) !== 'object') {\n // eslint-disable-next-line eqeqeq\n return val1 == val2;\n }\n return false;\n }\n if (val2 === null || _typeof(val2) !== 'object') {\n return false;\n }\n }\n var val1Tag = objectToString(val1);\n var val2Tag = objectToString(val2);\n if (val1Tag !== val2Tag) {\n return false;\n }\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) {\n return false;\n }\n var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n if (keys1.length !== keys2.length) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kIsArray, keys1);\n }\n // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n if (val1Tag === '[object Object]') {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) {\n return false;\n }\n }\n if (isDate(val1)) {\n if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) {\n return false;\n }\n } else if (isRegExp(val1)) {\n if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) {\n return false;\n }\n } else if (isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) {\n return false;\n }\n } else if (isArrayBufferView(val1)) {\n if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {\n if (!areSimilarFloatArrays(val1, val2)) {\n return false;\n }\n } else if (!areSimilarTypedArrays(val1, val2)) {\n return false;\n }\n // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n if (_keys.length !== _keys2.length) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);\n } else if (isSet(val1)) {\n if (!isSet(val2) || val1.size !== val2.size) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kIsSet);\n } else if (isMap(val1)) {\n if (!isMap(val2) || val1.size !== val2.size) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kIsMap);\n } else if (isAnyArrayBuffer(val1)) {\n if (!areEqualArrayBuffers(val1, val2)) {\n return false;\n }\n } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kNoIterator);\n}\nfunction getEnumerables(val, keys) {\n return keys.filter(function (k) {\n return propertyIsEnumerable(val, k);\n });\n}\nfunction keyCheck(val1, val2, strict, memos, iterationType, aKeys) {\n // For all remaining Object pairs, including Array, objects and Maps,\n // equivalence is determined by having:\n // a) The same number of owned enumerable properties\n // b) The same set of keys/indexes (although not necessarily the same order)\n // c) Equivalent values for every corresponding key/index\n // d) For Sets and Maps, equal contents\n // Note: this accounts for both named and indexed properties on Arrays.\n if (arguments.length === 5) {\n aKeys = Object.keys(val1);\n var bKeys = Object.keys(val2);\n\n // The pair must have the same number of owned properties.\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n }\n\n // Cheap key test\n var i = 0;\n for (; i < aKeys.length; i++) {\n if (!hasOwnProperty(val2, aKeys[i])) {\n return false;\n }\n }\n if (strict && arguments.length === 5) {\n var symbolKeysA = objectGetOwnPropertySymbols(val1);\n if (symbolKeysA.length !== 0) {\n var count = 0;\n for (i = 0; i < symbolKeysA.length; i++) {\n var key = symbolKeysA[i];\n if (propertyIsEnumerable(val1, key)) {\n if (!propertyIsEnumerable(val2, key)) {\n return false;\n }\n aKeys.push(key);\n count++;\n } else if (propertyIsEnumerable(val2, key)) {\n return false;\n }\n }\n var symbolKeysB = objectGetOwnPropertySymbols(val2);\n if (symbolKeysA.length !== symbolKeysB.length && getEnumerables(val2, symbolKeysB).length !== count) {\n return false;\n }\n } else {\n var _symbolKeysB = objectGetOwnPropertySymbols(val2);\n if (_symbolKeysB.length !== 0 && getEnumerables(val2, _symbolKeysB).length !== 0) {\n return false;\n }\n }\n }\n if (aKeys.length === 0 && (iterationType === kNoIterator || iterationType === kIsArray && val1.length === 0 || val1.size === 0)) {\n return true;\n }\n\n // Use memos to handle cycles.\n if (memos === undefined) {\n memos = {\n val1: new Map(),\n val2: new Map(),\n position: 0\n };\n } else {\n // We prevent up to two map.has(x) calls by directly retrieving the value\n // and checking for undefined. The map can only contain numbers, so it is\n // safe to check for undefined only.\n var val2MemoA = memos.val1.get(val1);\n if (val2MemoA !== undefined) {\n var val2MemoB = memos.val2.get(val2);\n if (val2MemoB !== undefined) {\n return val2MemoA === val2MemoB;\n }\n }\n memos.position++;\n }\n memos.val1.set(val1, memos.position);\n memos.val2.set(val2, memos.position);\n var areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType);\n memos.val1.delete(val1);\n memos.val2.delete(val2);\n return areEq;\n}\nfunction setHasEqualElement(set, val1, strict, memo) {\n // Go looking.\n var setValues = arrayFromSet(set);\n for (var i = 0; i < setValues.length; i++) {\n var val2 = setValues[i];\n if (innerDeepEqual(val1, val2, strict, memo)) {\n // Remove the matching element to make sure we do not check that again.\n set.delete(val2);\n return true;\n }\n }\n return false;\n}\n\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using\n// Sadly it is not possible to detect corresponding values properly in case the\n// type is a string, number, bigint or boolean. The reason is that those values\n// can match lots of different string values (e.g., 1n == '+00001').\nfunction findLooseMatchingPrimitives(prim) {\n switch (_typeof(prim)) {\n case 'undefined':\n return null;\n case 'object':\n // Only pass in null as object!\n return undefined;\n case 'symbol':\n return false;\n case 'string':\n prim = +prim;\n // Loose equal entries exist only if the string is possible to convert to\n // a regular number and not NaN.\n // Fall through\n case 'number':\n if (numberIsNaN(prim)) {\n return false;\n }\n }\n return true;\n}\nfunction setMightHaveLoosePrim(a, b, prim) {\n var altValue = findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n return b.has(altValue) && !a.has(altValue);\n}\nfunction mapMightHaveLoosePrim(a, b, prim, item, memo) {\n var altValue = findLooseMatchingPrimitives(prim);\n if (altValue != null) {\n return altValue;\n }\n var curB = b.get(altValue);\n if (curB === undefined && !b.has(altValue) || !innerDeepEqual(item, curB, false, memo)) {\n return false;\n }\n return !a.has(altValue) && innerDeepEqual(item, curB, false, memo);\n}\nfunction setEquiv(a, b, strict, memo) {\n // This is a lazily initiated Set of entries which have to be compared\n // pairwise.\n var set = null;\n var aValues = arrayFromSet(a);\n for (var i = 0; i < aValues.length; i++) {\n var val = aValues[i];\n // Note: Checking for the objects first improves the performance for object\n // heavy sets but it is a minor slow down for primitives. As they are fast\n // to check this improves the worst case scenario instead.\n if (_typeof(val) === 'object' && val !== null) {\n if (set === null) {\n set = new Set();\n }\n // If the specified value doesn't exist in the second set its an not null\n // object (or non strict only: a not matching primitive) we'll need to go\n // hunting for something thats deep-(strict-)equal to it. To make this\n // O(n log n) complexity we have to copy these values in a new set first.\n set.add(val);\n } else if (!b.has(val)) {\n if (strict) return false;\n\n // Fast path to detect missing string, symbol, undefined and null values.\n if (!setMightHaveLoosePrim(a, b, val)) {\n return false;\n }\n if (set === null) {\n set = new Set();\n }\n set.add(val);\n }\n }\n if (set !== null) {\n var bValues = arrayFromSet(b);\n for (var _i = 0; _i < bValues.length; _i++) {\n var _val = bValues[_i];\n // We have to check if a primitive value is already\n // matching and only if it's not, go hunting for it.\n if (_typeof(_val) === 'object' && _val !== null) {\n if (!setHasEqualElement(set, _val, strict, memo)) return false;\n } else if (!strict && !a.has(_val) && !setHasEqualElement(set, _val, strict, memo)) {\n return false;\n }\n }\n return set.size === 0;\n }\n return true;\n}\nfunction mapHasEqualEntry(set, map, key1, item1, strict, memo) {\n // To be able to handle cases like:\n // Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']])\n // ... we need to consider *all* matching keys, not just the first we find.\n var setValues = arrayFromSet(set);\n for (var i = 0; i < setValues.length; i++) {\n var key2 = setValues[i];\n if (innerDeepEqual(key1, key2, strict, memo) && innerDeepEqual(item1, map.get(key2), strict, memo)) {\n set.delete(key2);\n return true;\n }\n }\n return false;\n}\nfunction mapEquiv(a, b, strict, memo) {\n var set = null;\n var aEntries = arrayFromMap(a);\n for (var i = 0; i < aEntries.length; i++) {\n var _aEntries$i = _slicedToArray(aEntries[i], 2),\n key = _aEntries$i[0],\n item1 = _aEntries$i[1];\n if (_typeof(key) === 'object' && key !== null) {\n if (set === null) {\n set = new Set();\n }\n set.add(key);\n } else {\n // By directly retrieving the value we prevent another b.has(key) check in\n // almost all possible cases.\n var item2 = b.get(key);\n if (item2 === undefined && !b.has(key) || !innerDeepEqual(item1, item2, strict, memo)) {\n if (strict) return false;\n // Fast path to detect missing string, symbol, undefined and null\n // keys.\n if (!mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;\n if (set === null) {\n set = new Set();\n }\n set.add(key);\n }\n }\n }\n if (set !== null) {\n var bEntries = arrayFromMap(b);\n for (var _i2 = 0; _i2 < bEntries.length; _i2++) {\n var _bEntries$_i = _slicedToArray(bEntries[_i2], 2),\n _key = _bEntries$_i[0],\n item = _bEntries$_i[1];\n if (_typeof(_key) === 'object' && _key !== null) {\n if (!mapHasEqualEntry(set, a, _key, item, strict, memo)) return false;\n } else if (!strict && (!a.has(_key) || !innerDeepEqual(a.get(_key), item, false, memo)) && !mapHasEqualEntry(set, a, _key, item, false, memo)) {\n return false;\n }\n }\n return set.size === 0;\n }\n return true;\n}\nfunction objEquiv(a, b, strict, keys, memos, iterationType) {\n // Sets and maps don't have their entries accessible via normal object\n // properties.\n var i = 0;\n if (iterationType === kIsSet) {\n if (!setEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsMap) {\n if (!mapEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsArray) {\n for (; i < a.length; i++) {\n if (hasOwnProperty(a, i)) {\n if (!hasOwnProperty(b, i) || !innerDeepEqual(a[i], b[i], strict, memos)) {\n return false;\n }\n } else if (hasOwnProperty(b, i)) {\n return false;\n } else {\n // Array is sparse.\n var keysA = Object.keys(a);\n for (; i < keysA.length; i++) {\n var key = keysA[i];\n if (!hasOwnProperty(b, key) || !innerDeepEqual(a[key], b[key], strict, memos)) {\n return false;\n }\n }\n if (keysA.length !== Object.keys(b).length) {\n return false;\n }\n return true;\n }\n }\n }\n\n // The pair must have equivalent values for every corresponding key.\n // Possibly expensive deep test:\n for (i = 0; i < keys.length; i++) {\n var _key2 = keys[i];\n if (!innerDeepEqual(a[_key2], b[_key2], strict, memos)) {\n return false;\n }\n }\n return true;\n}\nfunction isDeepEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kLoose);\n}\nfunction isDeepStrictEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kStrict);\n}\nmodule.exports = {\n isDeepEqual: isDeepEqual,\n isDeepStrictEqual: isDeepStrictEqual\n};","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Object);\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar defineDataProperty = require('define-data-property');\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar supportsDescriptors = require('has-property-descriptors')();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object) {\n\t\tif (predicate === true) {\n\t\t\tif (object[name] === value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (!isFunction(predicate) || !predicate()) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (supportsDescriptors) {\n\t\tdefineDataProperty(object, name, value, true);\n\t} else {\n\t\tdefineDataProperty(object, name, value);\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","'use strict';\n\nvar getPolyfill = require('./polyfill');\nvar define = require('define-properties');\n\nmodule.exports = function shimObjectIs() {\n\tvar polyfill = getPolyfill();\n\tdefine(Object, { is: polyfill }, {\n\t\tis: function testObjectIs() {\n\t\t\treturn Object.is !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Number);\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\nmodule.exports = function isNaN(value) {\n\treturn value !== value;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) {\n\t\treturn Number.isNaN;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\nmodule.exports = function shimNumberIsNaN() {\n\tvar polyfill = getPolyfill();\n\tdefine(Number, { isNaN: polyfill }, {\n\t\tisNaN: function testIsNaN() {\n\t\t\treturn Number.isNaN !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","import { strict as assert } from 'assert';\nimport Chart from 'chart.js/auto';\nimport Sortable from 'sortablejs';\n\nimport { animationFrame } from './util/animation-frame';\nimport type {\n StockIds,\n FlowIds,\n VariableIds,\n ParameterIds,\n} from './circular-economy-model';\nimport CircularEconomyModel, {\n Parameters,\n Record,\n} from './circular-economy-model';\nimport ModelSimulator from './model-simulator';\nimport Visualization from './visualization';\nimport { documentReady } from './util/document-ready';\nimport { guardedQuerySelector } from './util/guarded-query-selectors';\nimport ScriptedParameterTransform from './parameter-transform/scripted-parameter-transform';\n\ntype CircularEconomyModelSimulator = ModelSimulator<\n StockIds,\n FlowIds,\n VariableIds,\n ParameterIds\n>;\n\ntype ScriptCircularEconomyParameterTransform =\n ScriptedParameterTransform;\n\ntype CircularEconomyApi = {\n model: CircularEconomyModel;\n modelSimulator: CircularEconomyModelSimulator;\n parameterTransforms: {\n create: (id: string, script: string) => void;\n destroy: (id: string) => void;\n };\n};\n\nconst initialParameters = {\n abandonExcessRate: 0.5,\n abandonRate: 0.02,\n acquireRate: 1.0,\n breakRate: 0.01,\n capacityAdjustmentRate: 0.05,\n disposeIncentive: 1.5,\n disposeRate: 0.5,\n landfillIncentive: 1.0,\n landfillRate: 1.0,\n naturalResourcesIncentive: 1.5,\n newPhoneProductionRate: 1.0,\n newlyProducedPhoneIncentive: 2,\n numberOfUsers: 1000000,\n phonesPerUserGoal: 1.2,\n recycleRate: 1.0,\n recyclingIncentive: 0.25,\n refurbishmentIncentive: 0.25,\n refurbishmentRate: 1.0,\n repairIncentive: 0.5,\n repairRate: 1.0,\n reuseIncentive: 0.25,\n};\n\nasync function init(): Promise {\n const model = new CircularEconomyModel();\n const modelSimulator = new ModelSimulator(\n model,\n // FIXME: It should be possible to pass CircularEconomyModel.initialStocks directly, but TypeScript does not complain.\n { ...CircularEconomyModel.initialStocks },\n { ...initialParameters },\n 0.0,\n 0.1,\n );\n\n const availableParameterTransformsContainer = guardedQuerySelector(\n document,\n '#parameter-transforms .available',\n HTMLElement,\n );\n const activeParameterTransformsContainer = guardedQuerySelector(\n document,\n '#parameter-transforms .active',\n HTMLElement,\n );\n\n const availableParameterTransforms = new Map<\n string,\n ScriptCircularEconomyParameterTransform\n >();\n\n function getDistinctParameters(\n p1: Parameters,\n p2: Parameters,\n ): Partial {\n const result: Partial = {};\n model.parameterIds.forEach((id) => {\n if (p1[id] !== p2[id]) {\n result[id] = p2[id];\n }\n });\n return result;\n }\n\n function updateParameters() {\n const parameters = { ...initialParameters };\n [...activeParameterTransformsContainer.children].forEach((e) => {\n assert(e instanceof HTMLElement);\n const id = e.getAttribute('data-id');\n assert(id !== null);\n const parameterTransform = availableParameterTransforms.get(id);\n assert(parameterTransform !== undefined);\n const backupParameters = { ...parameters };\n parameterTransform.applyTo(parameters);\n const distinctParameters = getDistinctParameters(\n backupParameters,\n parameters,\n );\n e.title = `${parameterTransform.script}\\n\\n${JSON.stringify(\n distinctParameters,\n null,\n 2,\n )}\\n\\n${JSON.stringify(parameters, null, 2)}`;\n });\n Object.assign(modelSimulator.parameters, parameters);\n }\n\n Sortable.create(availableParameterTransformsContainer, {\n group: {\n name: 'sharedParameterTransforms',\n pull: 'clone',\n put: false, // Do not allow items to be put into this list\n },\n });\n Sortable.create(activeParameterTransformsContainer, {\n group: { name: 'sharedParameterTransforms' },\n removeOnSpill: true,\n onSort: () => updateParameters(),\n onSpill: (event) => {\n event.item.remove();\n updateParameters();\n },\n });\n const parameterTransforms = {\n create: (id: string, script: string) => {\n if (availableParameterTransforms.has(id))\n throw new Error(`Parameter transform with id '${id}' already exists`);\n availableParameterTransforms.set(\n id,\n new ScriptedParameterTransform(\n 'none',\n model.parameterIds,\n script,\n ),\n );\n const dummyElement = document.createElement('div');\n dummyElement.innerHTML = `
${id}
`;\n const parameterTransformElement = dummyElement.firstChild;\n assert(parameterTransformElement !== null);\n availableParameterTransformsContainer.append(parameterTransformElement);\n },\n destroy: (id: string) => {\n availableParameterTransforms.delete(id);\n },\n };\n\n guardedQuerySelector(\n document,\n '#add-parameter-transform',\n HTMLElement,\n ).addEventListener('click', () => {\n const idElement = guardedQuerySelector(\n document,\n '#parameter-transform-id',\n HTMLInputElement,\n );\n const id = idElement.value;\n const scriptElement = guardedQuerySelector(\n document,\n '#parameter-transform-script',\n HTMLTextAreaElement,\n );\n const script = scriptElement.value;\n parameterTransforms.create(id, script);\n });\n\n const sliderContainer = guardedQuerySelector(\n document,\n '#sliders',\n HTMLElement,\n );\n\n model.parameterIds\n .filter((id) => id !== 'numberOfUsers')\n .forEach((id) => {\n const sliderElementLabel = document.createElement('div');\n const sliderElement = document.createElement('input');\n sliderElement.type = 'range';\n sliderElement.min = '0';\n sliderElement.max = '4';\n sliderElement.step = '0.001';\n sliderElement.value = `${initialParameters[id]}`;\n\n function updateSliderValue() {\n initialParameters[id] = Number.parseFloat(sliderElement.value);\n sliderElementLabel.innerText = `${id} = ${initialParameters[id]}`;\n updateParameters();\n }\n updateSliderValue();\n\n sliderElement.addEventListener('input', updateSliderValue);\n\n const sliderWrapperElement = document.createElement('div');\n sliderWrapperElement.append(sliderElementLabel, sliderElement);\n\n sliderContainer.append(sliderWrapperElement);\n });\n\n let circularityIndex = 0;\n const circularityIndexElement = guardedQuerySelector(\n document,\n '#circularity-index',\n HTMLElement,\n );\n\n let userSatisfaction = 0;\n const userSatisfactionElement = guardedQuerySelector(\n document,\n '#user-satisfaction',\n HTMLElement,\n );\n\n const visualization = await Visualization.create(model);\n document.body.prepend(visualization.element);\n\n function toChartRecord(record: Record) {\n return CircularEconomyModel.elementIds\n .map((key) =>\n Object.entries(record[key]).map(([id, value]) => ({ id, value })),\n )\n .reduce((cur, acc) => [...cur, ...acc], []);\n }\n\n const initialChartRecord = toChartRecord(modelSimulator.record);\n\n const chartCanvas = document.getElementById('chart') as HTMLCanvasElement;\n assert(chartCanvas !== null, 'chart element not found');\n const chart = new Chart(chartCanvas, {\n type: 'bar',\n data: {\n labels: initialChartRecord.map((row) => row.id),\n datasets: [\n {\n label: 'Values',\n data: initialChartRecord.map((row) => row.value),\n },\n ],\n },\n options: { animation: false },\n });\n\n function updateIndices(record: Record) {\n const smoothingFactor = 0.5;\n\n const { phonesInUse } = record.stocks;\n const {\n produceFromNaturalResources,\n acquireNewlyProduced,\n acquireUsed,\n acquireRepaired,\n acquireRefurbished,\n disposeHibernating,\n disposeBroken,\n landfill,\n } = record.flows;\n const { phoneGoal } = record.variables;\n\n const naturalResourcesShare = Math.min(\n 1.0,\n produceFromNaturalResources /\n (acquireNewlyProduced +\n acquireUsed +\n acquireRepaired +\n acquireRefurbished),\n );\n const landfillShare = Math.min(\n 1.0,\n landfill / (disposeHibernating + disposeBroken),\n );\n const circularityIndexTarget = Math.min(\n 1.0 - naturalResourcesShare,\n 1.0 - landfillShare,\n );\n\n circularityIndex +=\n (circularityIndexTarget - circularityIndex) * smoothingFactor;\n circularityIndexElement.innerText = `${(circularityIndex * 100).toFixed(\n 1,\n )}%`;\n\n const userSatisfactionTarget =\n phonesInUse < phoneGoal\n ? phonesInUse / phoneGoal\n : phoneGoal / phonesInUse;\n userSatisfaction +=\n (userSatisfactionTarget - userSatisfaction) * smoothingFactor;\n userSatisfactionElement.innerText = `${(userSatisfaction * 100).toFixed(\n 1,\n )}%`;\n }\n\n function stepSimulation(deltaMs: number) {\n // TODO: pass deltaMs to modelSimulator.step()\n const record = modelSimulator.step();\n\n updateIndices(record);\n\n const chartRecord = toChartRecord(record);\n // console.log(chartRecord);\n chart.data.datasets[0].data = chartRecord.map((row) => row.value);\n\n chart.update();\n\n visualization.update(deltaMs, modelSimulator.h, record);\n }\n\n let running = false;\n const runCheckBox = document.getElementById('run') as HTMLInputElement;\n assert(runCheckBox !== null, 'run checkbox not found');\n\n async function loopSimulation() {\n running = true;\n let lastTimeMs: DOMHighResTimeStamp | null = null;\n\n while (runCheckBox.checked) {\n // eslint-disable-next-line no-await-in-loop\n const currentTimeMs = await animationFrame();\n const deltaMs = lastTimeMs === null ? 0 : currentTimeMs - lastTimeMs;\n stepSimulation(deltaMs);\n lastTimeMs = currentTimeMs;\n }\n running = false;\n }\n\n runCheckBox.addEventListener('input', () => {\n if (!running)\n loopSimulation().catch((err) => {\n throw err;\n });\n });\n\n stepSimulation(0);\n\n const circularEconomyApi: CircularEconomyApi = {\n model,\n modelSimulator,\n parameterTransforms,\n };\n\n return circularEconomyApi;\n}\n\ndeclare global {\n interface Window {\n circularEconomy: Promise;\n }\n}\n\nwindow.circularEconomy = documentReady().then(init);\n","import {Chart, registerables} from '../dist/chart.js';\n\nChart.register(...registerables);\n\nexport * from '../dist/chart.js';\nexport default Chart;\n","/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */\nimport { r as requestAnimFrame, a as resolve, e as effects, c as color, i as isObject, d as defaults, b as isArray, v as valueOrDefault, u as unlistenArrayEvents, l as listenArrayEvents, f as resolveObjectKey, g as isNumberFinite, h as defined, s as sign, j as createContext, k as isNullOrUndef, _ as _arrayUnique, t as toRadians, m as toPercentage, n as toDimension, T as TAU, o as formatNumber, p as _angleBetween, H as HALF_PI, P as PI, q as _getStartAndCountOfVisiblePoints, w as _scaleRangesChanged, x as isNumber, y as _parseObjectDataRadialScale, z as getRelativePosition, A as _rlookupByKey, B as _lookupByKey, C as _isPointInArea, D as getAngleFromPoint, E as toPadding, F as each, G as getMaximumSize, I as _getParentNode, J as readUsedSize, K as supportsEventListenerOptions, L as throttled, M as _isDomSupported, N as _factorize, O as finiteOrDefault, Q as callback, R as _addGrace, S as _limitValue, U as toDegrees, V as _measureText, W as _int16Range, X as _alignPixel, Y as clipArea, Z as renderText, $ as unclipArea, a0 as toFont, a1 as _toLeftRightCenter, a2 as _alignStartEnd, a3 as overrides, a4 as merge, a5 as _capitalize, a6 as descriptors, a7 as isFunction, a8 as _attachContext, a9 as _createResolver, aa as _descriptors, ab as mergeIf, ac as uid, ad as debounce, ae as retinaScale, af as clearCanvas, ag as setsEqual, ah as _elementsEqual, ai as _isClickEvent, aj as _isBetween, ak as _readValueToProps, al as _updateBezierControlPoints, am as _computeSegments, an as _boundSegments, ao as _steppedInterpolation, ap as _bezierInterpolation, aq as _pointInLine, ar as _steppedLineTo, as as _bezierCurveTo, at as drawPoint, au as addRoundedRectPath, av as toTRBL, aw as toTRBLCorners, ax as _boundSegment, ay as _normalizeAngle, az as getRtlAdapter, aA as overrideTextDirection, aB as _textX, aC as restoreTextDirection, aD as drawPointLegend, aE as distanceBetweenPoints, aF as noop, aG as _setMinAndMaxByKey, aH as niceNum, aI as almostWhole, aJ as almostEquals, aK as _decimalPlaces, aL as Ticks, aM as log10, aN as _longestText, aO as _filterBetween, aP as _lookup } from './chunks/helpers.segment.js';\nimport '@kurkle/color';\n\nclass Animator {\n constructor(){\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n callbacks.forEach((fn)=>fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n this._request = requestAnimFrame.call(window, ()=>{\n this._update();\n this._request = null;\n if (this._running) {\n this._refresh();\n }\n });\n }\n _update(date = Date.now()) {\n let remaining = 0;\n this._charts.forEach((anims, chart)=>{\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n for(; i >= 0; --i){\n item = items[i];\n if (item._active) {\n if (item._total > anims.duration) {\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n remaining += items.length;\n });\n this._lastDate = date;\n if (remaining === 0) {\n this._running = false;\n }\n }\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur)=>Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n for(; i >= 0; --i){\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\nvar animator = /* #__PURE__ */ new Animator();\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean (from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n color (from, to, factor) {\n const c0 = color(from || transparent);\n const c1 = c0.valid && color(to || transparent);\n return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to;\n },\n number (from, to, factor) {\n return from + (to - from) * factor;\n }\n};\nclass Animation {\n constructor(cfg, target, prop, to){\n const currentValue = target[prop];\n to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n const from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n active() {\n return this._active;\n }\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n this._from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n }\n }\n cancel() {\n if (this._active) {\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n this._active = from !== to && (loop || elapsed < duration);\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n factor = elapsed / duration % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n this._target[prop] = this._fn(from, to, factor);\n }\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej)=>{\n promises.push({\n res,\n rej\n });\n });\n }\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for(let i = 0; i < promises.length; i++){\n promises[i][method]();\n }\n }\n}\n\nclass Animations {\n constructor(chart, config){\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n Object.getOwnPropertyNames(config).forEach((key)=>{\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions){\n resolved[option] = cfg[option];\n }\n (isArray(cfg.properties) && cfg.properties || [\n key\n ]).forEach((prop)=>{\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n awaitAll(target.options.$animations, newOptions).then(()=>{\n target.options = newOptions;\n }, ()=>{\n });\n }\n return animations;\n }\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n for(i = props.length - 1; i >= 0; --i){\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n if (animation) {\n if (cfg && animation.active()) {\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n target[prop] = value;\n continue;\n }\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n update(target, values) {\n if (this._properties.size === 0) {\n Object.assign(target, values);\n return;\n }\n const animations = this._createAnimations(target, values);\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for(let i = 0; i < keys.length; i++){\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n return Promise.all(running);\n}\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n target.options = options = Object.assign({}, options, {\n $shared: false,\n $animations: {}\n });\n }\n return options;\n}\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\nfunction toClip(value) {\n let t, r, b, l;\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n keys.push(metasets[i].index);\n }\n return keys;\n}\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n if (value === null) {\n return;\n }\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isNumberFinite(otherValue) && (singleMode || value === 0 || sign(value) === sign(otherValue))) {\n value += otherValue;\n }\n }\n return value;\n}\nfunction convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || stacked === undefined && meta.stack !== undefined;\n}\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction getUserBounds(scale) {\n const { min , max , minDefined , maxDefined } = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()){\n const value = stack[meta.index];\n if (positive && value > 0 || !positive && value < 0) {\n return meta.index;\n }\n }\n return null;\n}\nfunction updateStacks(controller, parsed) {\n const { chart , _cachedMeta: meta } = controller;\n const stacks = chart._stacks || (chart._stacks = {});\n const { iScale , vScale , index: datasetIndex } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n for(let i = 0; i < ilen; ++i){\n const item = parsed[i];\n const { [iAxis]: index , [vAxis]: value } = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter((key)=>scales[key].axis === axis).shift();\n}\nfunction createDatasetContext(parent, index) {\n return createContext(parent, {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n });\n}\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\nfunction clearStacks(meta, items) {\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n items = items || meta._parsed;\n for (const parsed of items){\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n delete stacks[axis]._visualValues[datasetIndex];\n }\n }\n}\nconst isDirectUpdateMode = (mode)=>mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared)=>shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart)=>canStack && !meta.hidden && meta._stacked && {\n keys: getSortedDatasetIndices(chart, true),\n values: null\n };\nclass DatasetController {\n static defaults = {};\n static datasetElementType = null;\n static dataElementType = null;\n constructor(chart, datasetIndex){\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n this.initialize();\n }\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n 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\");\n }\n }\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n const chooseId = (axis, x, y, r)=>axis === 'x' ? x : axis === 'r' ? r : y;\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale ? meta.vScale : meta.iScale;\n }\n reset() {\n this._update('reset');\n }\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n if (isObject(data)) {\n this._data = convertObjectDataToArray(data);\n } else if (_data !== data) {\n if (_data) {\n unlistenArrayEvents(_data, this);\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n addElements() {\n const meta = this._cachedMeta;\n this._dataCheck();\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n this._dataCheck();\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n this._resyncElements(resetNewElements);\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n }\n }\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n parse(start, count) {\n const { _cachedMeta: meta , _data: data } = this;\n const { iScale , _stacked } = meta;\n const iAxis = iScale.axis;\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n const isNotInOrderComparedToPrev = ()=>cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];\n for(i = 0; i < count; ++i){\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n parsePrimitiveData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return applyStack(stack, value, meta.index, {\n mode\n });\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n const { min: otherMin , max: otherMax } = getUserBounds(otherScale);\n let i, parsed;\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n for(i = 0; i < ilen; ++i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n break;\n }\n }\n if (sorted) {\n for(i = ilen - 1; i >= 0; --i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n for(i = 0, ilen = parsed.length; i < ilen; ++i){\n value = parsed[i][scale.axis];\n if (isNumberFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n getMaxOverflow() {\n return false;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n update(mode) {}\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || elements.length - start;\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n for(i = start; i < start + count; ++i){\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n for(i = 0; i < active.length; ++i){\n active[i].draw(ctx, area);\n }\n }\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index || 0, mode);\n }\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context || (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [\n `${elementType}Hover`,\n 'hover',\n elementType,\n ''\n ] : [\n elementType,\n ''\n ];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n const context = ()=>this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n if (values.$shared) {\n values.$shared = sharing;\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n return values;\n }\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions;\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {\n sharedOptions,\n includeOptions\n };\n }\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n options: !active && this.getSharedOptions(options) || options\n });\n }\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n for (const [method, arg1, arg2] of this._syncList){\n this[method](arg1, arg2);\n }\n this._syncList = [];\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n if (count) {\n this.parse(0, count);\n }\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n const move = (arr)=>{\n arr.length += count;\n for(i = arr.length - 1; i >= end; i--){\n arr[i] = arr[i - count];\n }\n };\n move(data);\n for(i = start; i < end; ++i){\n data[i] = new this.dataElementType();\n }\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n updateElements(element, start, count, mode) {}\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([\n this.index,\n ...args\n ]);\n }\n _onDataPush() {\n const count = arguments.length;\n this._sync([\n '_insertElements',\n this.getDataset().data.length - count,\n count\n ]);\n }\n _onDataPop() {\n this._sync([\n '_removeElements',\n this._cachedMeta.data.length - 1,\n 1\n ]);\n }\n _onDataShift() {\n this._sync([\n '_removeElements',\n 0,\n 1\n ]);\n }\n _onDataSplice(start, count) {\n if (count) {\n this._sync([\n '_removeElements',\n start,\n count\n ]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync([\n '_insertElements',\n start,\n newCount\n ]);\n }\n }\n _onDataUnshift() {\n this._sync([\n '_insertElements',\n 0,\n arguments.length\n ]);\n }\n}\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n for(let i = 0, ilen = visibleMetas.length; i < ilen; i++){\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b)=>a - b));\n }\n return scale._cache.$bar;\n}\n function computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = ()=>{\n if (curr === 32767 || curr === -32768) {\n return;\n }\n if (defined(prev)) {\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n for(i = 0, ilen = values.length; i < ilen; ++i){\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n prev = undefined;\n for(i = 0, ilen = scale.ticks.length; i < ilen; ++i){\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n return min;\n}\n function computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n size = thickness * stackCount;\n ratio = 1;\n }\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - size / 2\n };\n}\n function computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n if (prev === null) {\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n if (next === null) {\n next = curr + curr - prev;\n }\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n item[vScale.axis] = barEnd;\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n for(i = start, ilen = start + count; i < ilen; ++i){\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {\n start,\n end,\n reverse,\n top,\n bottom\n };\n}\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n if (edge === true) {\n properties.borderSkipped = {\n top: true,\n right: true,\n bottom: true,\n left: true\n };\n return;\n }\n const { start , end , reverse , top , bottom } = borderProps(properties);\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\nfunction setInflateAmount(properties, { inflateAmount }, ratio) {\n properties.inflateAmount = inflateAmount === 'auto' ? ratio === 1 ? 0.33 : 0 : inflateAmount;\n}\nclass BarController extends DatasetController {\n static id = 'bar';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true\n }\n }\n };\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseObjectData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for(i = start, ilen = start + count; i < ilen; ++i){\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n getMaxOverflow() {\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const { iScale , vScale } = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom) ? '[' + custom.start + ', ' + custom.end + ']' : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const { index , _cachedMeta: { vScale } } = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n for(let i = start; i < start + count; i++){\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {\n base,\n head: base\n } : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || index === stack._top || index === stack._bottom,\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n _getStacks(last, dataIndex) {\n const { iScale } = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const skipNull = (meta)=>{\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n for (const meta of metasets){\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === undefined && meta.stack === undefined) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n if (!stacks.length) {\n stacks.push(undefined);\n }\n return stacks;\n }\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = name !== undefined ? stacks.indexOf(name) : -1;\n return index === -1 ? stacks.length - 1 : index;\n }\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n for(i = 0, ilen = meta.data.length; i < ilen; ++i){\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n _calculateBarValuePixels(index) {\n const { _cachedMeta: { vScale , _stacked , index: datasetIndex } , options: { base: baseValue , minBarLength } } = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n if (length !== value) {\n start = length - value;\n length = value;\n }\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n head = base;\n }\n size = head - base;\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n if (_stacked && !floating) {\n parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n }\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex' ? computeFlexCategoryTraits(index, ruler, options, stackCount) : computeFitCategoryTraits(index, ruler, options, stackCount);\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + range.chunk * stackIndex + range.chunk / 2;\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n for(; i < ilen; ++i){\n if (this.getParsed(i)[vScale.axis] !== null) {\n rects[i].draw(this._ctx);\n }\n }\n }\n}\n\nclass BubbleController extends DatasetController {\n static id = 'bubble';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'borderWidth',\n 'radius'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n update(mode) {\n const points = this._cachedMeta.data;\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n if (reset) {\n properties.options.radius = 0;\n }\n }\n this.updateElement(point, i, properties, mode);\n }\n }\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n if (values.$shared) {\n values = Object.assign({}, values, {\n $shared: false\n });\n }\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n return values;\n }\n}\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {\n ratioX,\n ratioY,\n offsetX,\n offsetY\n };\n}\nclass DoughnutController extends DatasetController {\n static id = 'doughnut';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'circumference',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'startAngle',\n 'x',\n 'y',\n 'offset',\n 'borderWidth',\n 'spacing'\n ]\n }\n },\n cutout: '50%',\n rotation: 0,\n circumference: 360,\n radius: '100%',\n spacing: 0,\n indexAxis: 'r'\n };\n static descriptors = {\n _scriptable: (name)=>name !== 'spacing',\n _indexable: (name)=>name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash')\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n linkScales() {}\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i)=>+data[i];\n if (isObject(data[start])) {\n const { key ='value' } = this._parsing;\n getter = (i)=>+resolveObjectKey(data[i], key);\n }\n let i, ilen;\n for(i = start, ilen = start + count; i < ilen; ++i){\n meta._parsed[i] = getter(i);\n }\n }\n }\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n for(let i = 0; i < this.chart.data.datasets.length; ++i){\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n return {\n rotation: min,\n circumference: max - min\n };\n }\n update(mode) {\n const chart = this.chart;\n const { chartArea } = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n const { circumference , rotation } = this._getRotationExtents();\n const { ratioX , ratioY , offsetX , offsetY } = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n meta.total = this.calculateTotal();\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n for(i = 0; i < start; ++i){\n startAngle += this._circumference(i, reset);\n }\n for(i = start; i < start + count; ++i){\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n this.updateElement(arc, i, properties, mode);\n }\n }\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n for(i = 0; i < metaData.length; i++){\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n return total;\n }\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n if (!arcs) {\n for(i = 0, ilen = chart.data.datasets.length; i < ilen; ++i){\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n if (!arcs) {\n return 0;\n }\n for(i = 0, ilen = arcs.length; i < ilen; ++i){\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n getMaxOffset(arcs) {\n let max = 0;\n for(let i = 0, ilen = arcs.length; i < ilen; ++i){\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n for(let i = 0; i < datasetIndex; ++i){\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n return ringWeightOffset;\n }\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n\nclass LineController extends DatasetController {\n static id = 'line';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n showLine: true,\n spanGaps: false\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category'\n },\n _value_: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { dataset: line , data: points = [] , _dataset } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n this.updateElements(points, start, count, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = 0; i < pointsCount; ++i){\n const point = points[i];\n const properties = directUpdate ? point : {};\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n\nclass PolarAreaController extends DatasetController {\n static id = 'polarArea';\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ]\n }\n },\n indexAxis: 'r',\n startAngle: 0\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const arcs = this._cachedMeta.data;\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n meta.data.forEach((element, index)=>{\n const parsed = this.getParsed(index).r;\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n return range;\n }\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n this.outerRadius = outerRadius - radiusLength * this.index;\n this.innerRadius = this.outerRadius - radiusLength;\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n const defaultAngle = 360 / this.countVisibleElements();\n for(i = 0; i < start; ++i){\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for(i = start; i < start + count; i++){\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n this.updateElement(arc, i, properties, mode);\n }\n }\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n meta.data.forEach((element, index)=>{\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n return count;\n }\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index) ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle) : 0;\n }\n}\n\nclass PieController extends DoughnutController {\n static id = 'pie';\n static defaults = {\n cutout: 0,\n rotation: 0,\n circumference: 360,\n radius: '100%'\n };\n}\n\nclass RadarController extends DatasetController {\n static id = 'radar';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n }\n };\n static overrides = {\n aspectRatio: 1,\n scales: {\n r: {\n type: 'radialLinear'\n }\n }\n };\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n line.points = points;\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n this.updateElement(line, undefined, properties, mode);\n }\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n\nclass ScatterController extends DatasetController {\n static id = 'scatter';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n static overrides = {\n interaction: {\n mode: 'point'\n },\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { data: points = [] } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n if (this.options.showLine) {\n if (!this.datasetElementType) {\n this.addElements();\n }\n const { dataset: line , _dataset } = meta;\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n } else if (this.datasetElementType) {\n delete meta.dataset;\n this.datasetElementType = false;\n }\n this.updateElements(points, start, count, mode);\n }\n addElements() {\n const { showLine } = this.options;\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n super.addElements();\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = start; i < start + count; ++i){\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n if (!this.options.showLine) {\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n\nvar controllers = /*#__PURE__*/Object.freeze({\n__proto__: null,\nBarController: BarController,\nBubbleController: BubbleController,\nDoughnutController: DoughnutController,\nLineController: LineController,\nPieController: PieController,\nPolarAreaController: PolarAreaController,\nRadarController: RadarController,\nScatterController: ScatterController\n});\n\n/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */ function abstract() {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */ class DateAdapterBase {\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */ static override(members) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n options;\n constructor(options){\n this.options = options || {};\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n formats() {\n return abstract();\n }\n parse() {\n return abstract();\n }\n format() {\n return abstract();\n }\n add() {\n return abstract();\n }\n diff() {\n return abstract();\n }\n startOf() {\n return abstract();\n }\n endOf() {\n return abstract();\n }\n}\nvar adapters = {\n _date: DateAdapterBase\n};\n\nfunction binarySearch(metaset, axis, value, intersect) {\n const { controller , data , _sorted } = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {\n lo: start.lo,\n hi: end.hi\n };\n }\n }\n }\n return {\n lo: 0,\n hi: data.length - 1\n };\n}\n function evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for(let i = 0, ilen = metasets.length; i < ilen; ++i){\n const { index , data } = metasets[i];\n const { lo , hi } = binarySearch(metasets[i], axis, value, intersect);\n for(let j = lo; j <= hi; ++j){\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n function getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n function getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n };\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n function getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n function evaluationFunc(element, datasetIndex, index) {\n const { startAngle , endAngle } = element.getProps([\n 'startAngle',\n 'endAngle'\n ], useFinalPosition);\n const { angle } = getAngleFromPoint(element, {\n x: position.x,\n y: position.y\n });\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [\n {\n element,\n datasetIndex,\n index\n }\n ];\n minDistance = distance;\n } else if (distance === minDistance) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n return axis === 'r' && !intersect ? getNearestRadialItems(chart, position, axis, useFinalPosition) : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n function getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index)=>{\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n var Interaction = {\n evaluateInteractionItems,\n modes: {\n index (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n if (!items.length) {\n return [];\n }\n chart.getSortedVisibleDatasetMetas().forEach((meta)=>{\n const index = items[0].index;\n const element = meta.data[index];\n if (element && !element.skip) {\n elements.push({\n element,\n datasetIndex: meta.index,\n index\n });\n }\n });\n return elements;\n },\n dataset (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for(let i = 0; i < data.length; ++i){\n items.push({\n element: data[i],\n datasetIndex,\n index: i\n });\n }\n }\n return items;\n },\n point (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n nearest (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n x (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n y (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n\nconst STATIC_POSITIONS = [\n 'left',\n 'top',\n 'right',\n 'bottom'\n];\nfunction filterByPosition(array, position) {\n return array.filter((v)=>v.pos === position);\n}\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter((v)=>STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b)=>{\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;\n });\n}\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n for(i = 0, ilen = (boxes || []).length; i < ilen; ++i){\n box = boxes[i];\n ({ position: pos , options: { stack , stackWeight =1 } } = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && pos + stack,\n stackWeight\n });\n }\n return layoutBoxes;\n}\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts){\n const { stack , pos , stackWeight } = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {\n count: 0,\n placed: 0,\n weight: 0,\n size: 0\n });\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n function setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const { vBoxMaxWidth , hBoxMaxHeight } = params;\n let i, ilen, layout;\n for(i = 0, ilen = layouts.length; i < ilen; ++i){\n layout = layouts[i];\n const { fullSize } = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction updateDims(chartArea, params, layout, stacks) {\n const { pos , box } = layout;\n const maxPadding = chartArea.maxPadding;\n if (!isObject(pos)) {\n if (layout.size) {\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {\n size: 0,\n count: 1\n };\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n return layout.horizontal ? {\n same: widthChanged,\n other: heightChanged\n } : {\n same: heightChanged,\n other: widthChanged\n };\n}\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n function marginForPositions(positions) {\n const margin = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n positions.forEach((pos)=>{\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n return horizontal ? marginForPositions([\n 'left',\n 'right'\n ]) : marginForPositions([\n 'top',\n 'bottom'\n ]);\n}\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n for(i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i){\n layout = boxes[i];\n box = layout.box;\n box.update(layout.width || chartArea.w, layout.height || chartArea.h, getMargins(layout.horizontal, chartArea));\n const { same , other } = updateDims(chartArea, params, layout, stacks);\n refit |= same && refitBoxes.length;\n changed = changed || other;\n if (!box.fullSize) {\n refitBoxes.push(layout);\n }\n }\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let { x , y } = chartArea;\n for (const layout of boxes){\n const box = layout.box;\n const stack = stacks[layout.stack] || {\n count: 1,\n placed: 0,\n weight: 1\n };\n const weight = layout.stackWeight / stack.weight || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n chartArea.x = x;\n chartArea.y = y;\n}\nvar layouts = {\n addBox (chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n item._layers = item._layers || function() {\n return [\n {\n z: 0,\n draw (chartArea) {\n item.draw(chartArea);\n }\n }\n ];\n };\n chart.boxes.push(item);\n },\n removeBox (chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n configure (chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n update (chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n each(chart.boxes, (box)=>{\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap)=>wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n handleMaxPadding(chartArea);\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w\n };\n each(boxes.chartArea, (layout)=>{\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n });\n });\n }\n};\n\nclass BasePlatform {\n acquireContext(canvas, aspectRatio) {}\n releaseContext(context) {\n return false;\n }\n addEventListener(chart, type, listener) {}\n removeEventListener(chart, type, listener) {}\n getDevicePixelRatio() {\n return 1;\n }\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n isAttached(canvas) {\n return true;\n }\n updateConfig(config) {\n }\n}\n\nclass BasicPlatform extends BasePlatform {\n acquireContext(item) {\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n\nconst EXPANDO_KEY = '$chartjs';\n const EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\nconst isNullOrEmpty = (value)=>value === null || value === '';\n function initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n style.display = style.display || 'block';\n style.boxSizing = style.boxSizing || 'border-box';\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n return canvas;\n}\nconst eventListenerOptions = supportsEventListenerOptions ? {\n passive: true\n} : false;\nfunction addListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n}\nfunction removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const { x , y } = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null\n };\n}\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList){\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart)=>{\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height)=>{\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n listener();\n }\n }, window);\n const observer = new ResizeObserver((entries)=>{\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n return observer;\n}\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event)=>{\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n addListener(canvas, type, proxy);\n return proxy;\n}\n class DomPlatform extends BasePlatform {\n acquireContext(canvas, aspectRatio) {\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n if (context && context.canvas === canvas) {\n initCanvas(canvas, aspectRatio);\n return context;\n }\n return null;\n }\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n const initial = canvas[EXPANDO_KEY].initial;\n [\n 'height',\n 'width'\n ].forEach((prop)=>{\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n const style = initial.style || {};\n Object.keys(style).forEach((key)=>{\n canvas.style[key] = style[key];\n });\n canvas.width = canvas.width;\n delete canvas[EXPANDO_KEY];\n return true;\n }\n addEventListener(chart, type, listener) {\n this.removeEventListener(chart, type);\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n if (!proxy) {\n return;\n }\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n isAttached(canvas) {\n const container = _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n\nfunction _detectPlatform(canvas) {\n if (!_isDomSupported() || typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nclass Element {\n static defaults = {};\n static defaultRoutes = undefined;\n x;\n y;\n active = false;\n options;\n $animations;\n tooltipPosition(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n getProps(props, final) {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this;\n }\n const ret = {};\n props.forEach((prop)=>{\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n });\n return ret;\n }\n}\n\nfunction autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for(i = 0, ilen = numMajorIndices - 1; i < ilen; i++){\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n function calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n const factors = _factorize(evenMajorSpacing);\n for(let i = 0, ilen = factors.length - 1; i < ilen; i++){\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n function getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n function skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n spacing = Math.ceil(spacing);\n for(i = 0; i < ticks.length; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n function skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n next = start;\n while(next < 0){\n count++;\n next = Math.round(start + count * spacing);\n }\n for(i = Math.max(start, 0); i < end; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n function getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n if (len < 2) {\n return false;\n }\n for(diff = arr[0], i = 1; i < len; ++i){\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n\nconst reverseAlign = (align)=>align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset)=>edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit)=>Math.min(maxTicksLimit || ticksLength, ticksLength);\n function sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n for(; i < len; i += increment){\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n function getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6;\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n function garbageCollect(caches, length) {\n each(caches, (cache)=>{\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for(i = 0; i < gcLen; ++i){\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n function getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n function getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n return lines * font.lineHeight + padding.height;\n}\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\nfunction titleAlign(align, position, reverse) {\n let ret = _toLeftRightCenter(align);\n if (reverse && position !== 'right' || !reverse && position === 'right') {\n ret = reverseAlign(ret);\n }\n return ret;\n}\nfunction titleArgs(scale, offset, position, align) {\n const { top , left , bottom , right , chart } = scale;\n const { chartArea , scales } = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n}\nclass Scale extends Element {\n constructor(cfg){\n super();\n this.id = cfg.id;\n this.type = cfg.type;\n this.options = undefined;\n this.ctx = cfg.ctx;\n this.chart = cfg.chart;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.paddingTop = undefined;\n this.paddingBottom = undefined;\n this.paddingLeft = undefined;\n this.paddingRight = undefined;\n this.axis = undefined;\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n this.ticks = [];\n this._gridLineItems = null;\n this._labelItems = null;\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n this._startPixel = undefined;\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n init(options) {\n this.options = options.setContext(this.getContext());\n this.axis = options.axis;\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n parse(raw, index) {\n return raw;\n }\n getUserBounds() {\n let { _userMin , _userMax , _suggestedMin , _suggestedMax } = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isNumberFinite(_userMin),\n maxDefined: isNumberFinite(_userMax)\n };\n }\n getMinMax(canStack) {\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n let range;\n if (minDefined && maxDefined) {\n return {\n min,\n max\n };\n }\n const metas = this.getMatchingVisibleMetas();\n for(let i = 0, ilen = metas.length; i < ilen; ++i){\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n getTicks() {\n return this.ticks;\n }\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n beforeUpdate() {\n callback(this.options.beforeUpdate, [\n this\n ]);\n }\n update(maxWidth, maxHeight, margins) {\n const { beginAtZero , grace , ticks: tickOpts } = this.options;\n const sampleSize = tickOpts.sampleSize;\n this.beforeUpdate();\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n this.beforeBuildTicks();\n this.ticks = this.buildTicks() || [];\n this.afterBuildTicks();\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n this.configure();\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation();\n this.afterCalculateLabelRotation();\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n if (samplingEnabled) {\n this._convertTicksToLabels(this.ticks);\n }\n this.beforeFit();\n this.fit();\n this.afterFit();\n this.afterUpdate();\n }\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n afterUpdate() {\n callback(this.options.afterUpdate, [\n this\n ]);\n }\n beforeSetDimensions() {\n callback(this.options.beforeSetDimensions, [\n this\n ]);\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = 0;\n this.bottom = this.height;\n }\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n callback(this.options.afterSetDimensions, [\n this\n ]);\n }\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n callback(this.options[name], [\n this\n ]);\n }\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n beforeTickToLabelConversion() {\n callback(this.options.beforeTickToLabelConversion, [\n this\n ]);\n }\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n tick = ticks[i];\n tick.label = callback(tickOpts.callback, [\n tick.value,\n i,\n ticks\n ], this);\n }\n }\n afterTickToLabelConversion() {\n callback(this.options.afterTickToLabelConversion, [\n this\n ]);\n }\n beforeCalculateLabelRotation() {\n callback(this.options.beforeCalculateLabelRotation, [\n this\n ]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n callback(this.options.afterCalculateLabelRotation, [\n this\n ]);\n }\n afterAutoSkip() {}\n beforeFit() {\n callback(this.options.beforeFit, [\n this\n ]);\n }\n fit() {\n const minSize = {\n width: 0,\n height: 0\n };\n const { chart , options: { ticks: tickOpts , title: titleOpts , grid: gridOpts } } = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight;\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n if (tickOpts.display && this.ticks.length) {\n const { first , last , widest , highest } = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n if (isHorizontal) {\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n this._handleMargins();\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n _calculatePadding(first, last, sin, cos) {\n const { ticks: { align , padding } , position } = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n afterFit() {\n callback(this.options.afterFit, [\n this\n ]);\n }\n isHorizontal() {\n const { axis , position } = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n isFullSize() {\n return this.options.fullSize;\n }\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n this.generateTickLabels(ticks);\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n this.afterTickToLabelConversion();\n }\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n return labelSizes;\n }\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const { ctx , _longestTextCache: caches } = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n for(i = 0; i < length; i += increment){\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {\n data: {},\n gc: []\n };\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n for(j = 0, jlen = label.length; j < jlen; ++j){\n nestedLabel = label[j];\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n const valueAt = (idx)=>({\n width: widths[idx] || 0,\n height: heights[idx] || 0\n });\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights\n };\n }\n getLabelForValue(value) {\n return value;\n }\n getPixelForValue(value, index) {\n return NaN;\n }\n getValueForPixel(pixel) {}\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n getBaseValue() {\n const { min , max } = this;\n return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0;\n }\n getContext(index) {\n const ticks = this.ticks || [];\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context || (tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this));\n }\n _tickSize() {\n const optionTicks = this.options.ticks;\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin;\n }\n _isVisible() {\n const display = this.options.display;\n if (display !== 'auto') {\n return !!display;\n }\n return this.getMatchingVisibleMetas().length > 0;\n }\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const { grid , position , border } = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for(i = 0; i < ticksLength; i += step){\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n lineValue = getPixelForGridLine(this, i, offset);\n if (lineValue === undefined) {\n continue;\n }\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset\n });\n }\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n return items;\n }\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const { position , ticks: optionTicks } = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const { align , crossAlign , padding , mirror } = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = (chartArea.left + chartArea.right) / 2 - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n const labelSizes = this._getLabelSizes();\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n label = tick.label;\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n if (isHorizontal) {\n x = pixel;\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += lineHeight / 2 * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n let backdrop;\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n switch(textBaseline){\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n }\n switch(textAlign){\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n }\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n color: optsAtIndex.backdropColor\n };\n }\n items.push({\n label,\n font,\n textOffset,\n options: {\n rotation,\n color,\n strokeColor,\n strokeWidth,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [\n x,\n y\n ],\n backdrop\n }\n });\n }\n return items;\n }\n _getXAxisLabelAlignment() {\n const { position , ticks } = this.options;\n const rotation = -toRadians(this.labelRotation);\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n let align = 'center';\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n return align;\n }\n _getYAxisLabelAlignment(tl) {\n const { position , ticks: { crossAlign , mirror , padding } } = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n let textAlign;\n let x;\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n return {\n textAlign,\n x\n };\n }\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n const chart = this.chart;\n const position = this.options.position;\n if (position === 'left' || position === 'right') {\n return {\n top: 0,\n left: this.left,\n bottom: chart.height,\n right: this.right\n };\n }\n if (position === 'top' || position === 'bottom') {\n return {\n top: this.top,\n left: 0,\n bottom: this.bottom,\n right: chart.width\n };\n }\n }\n drawBackground() {\n const { ctx , options: { backgroundColor } , left , top , width , height } = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex((t)=>t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n const drawLine = (p1, p2, style)=>{\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n if (grid.display) {\n for(i = 0, ilen = items.length; i < ilen; ++i){\n const item = items[i];\n if (grid.drawOnChartArea) {\n drawLine({\n x: item.x1,\n y: item.y1\n }, {\n x: item.x2,\n y: item.y2\n }, item);\n }\n if (grid.drawTicks) {\n drawLine({\n x: item.tx1,\n y: item.ty1\n }, {\n x: item.tx2,\n y: item.ty2\n }, {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n });\n }\n }\n }\n }\n drawBorder() {\n const { chart , ctx , options: { border , grid } } = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.restore();\n }\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n if (!optionTicks.display) {\n return;\n }\n const ctx = this.ctx;\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n const items = this.getLabelItems(chartArea);\n for (const item of items){\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n if (area) {\n unclipArea(ctx);\n }\n }\n drawTitle() {\n const { ctx , options: { position , title , reverse } } = this;\n if (!title.display) {\n return;\n }\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n const { titleX , titleY , maxWidth , rotation } = titleArgs(this, offset, position, align);\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n return [\n {\n z: tz,\n draw: (chartArea)=>{\n this.draw(chartArea);\n }\n }\n ];\n }\n return [\n {\n z: gz,\n draw: (chartArea)=>{\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n },\n {\n z: bz,\n draw: ()=>{\n this.drawBorder();\n }\n },\n {\n z: tz,\n draw: (chartArea)=>{\n this.drawLabels(chartArea);\n }\n }\n ];\n }\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n\nclass TypedRegistry {\n constructor(type, scope, override){\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n if (isIChartComponent(proto)) {\n parentScope = this.register(proto);\n }\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n if (id in items) {\n return scope;\n }\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n return scope;\n }\n get(id) {\n return this.items[id];\n }\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n if (id in items) {\n delete items[id];\n }\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\nfunction registerDefaults(item, scope, parentScope) {\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n defaults.set(scope, itemDefaults);\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach((property)=>{\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [\n scope\n ].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n\nclass Registry {\n constructor(){\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n this._typedRegistries = [\n this.controllers,\n this.scales,\n this.elements\n ];\n }\n add(...args) {\n this._each('register', args);\n }\n remove(...args) {\n this._each('unregister', args);\n }\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n _each(method, args, typedRegistry) {\n [\n ...args\n ].forEach((arg)=>{\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) {\n this._exec(method, reg, arg);\n } else {\n each(arg, (item)=>{\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n callback(component['before' + camelMethod], [], component);\n registry[method](component);\n callback(component['after' + camelMethod], [], component);\n }\n _getRegistryForType(type) {\n for(let i = 0; i < this._typedRegistries.length; i++){\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n return this.plugins;\n }\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n}\nvar registry = /* #__PURE__ */ new Registry();\n\nclass PluginService {\n constructor(){\n this._init = [];\n }\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors){\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [\n chart,\n args,\n descriptor.options\n ];\n if (callback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n return true;\n }\n invalidate() {\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n const descriptors = this._cache = this._createDescriptors(chart);\n this._notifyStateChanges(chart);\n return descriptors;\n }\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\n function allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for(let i = 0; i < keys.length; i++){\n plugins.push(registry.getPlugin(keys[i]));\n }\n const local = config.plugins || [];\n for(let i = 0; i < local.length; i++){\n const plugin = local[i];\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n return {\n plugins,\n localIds\n };\n}\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\nfunction createDescriptors(chart, { plugins , localIds }, options, all) {\n const result = [];\n const context = chart.getContext();\n for (const plugin of plugins){\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {\n plugin,\n local: localIds[id]\n }, opts, context)\n });\n }\n return result;\n}\nfunction pluginOpts(config, { plugin , local }, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [\n ''\n ], {\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n\nfunction getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\nfunction idMatchesAxis(id) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n}\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\nfunction determineAxis(id, ...scaleOptions) {\n if (idMatchesAxis(id)) {\n return id;\n }\n for (const opts of scaleOptions){\n const axis = opts.axis || axisFromPosition(opts.position) || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n if (axis) {\n return axis;\n }\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\nfunction getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + 'AxisID'] === id) {\n return {\n axis\n };\n }\n}\nfunction retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d)=>d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) {\n return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n }\n }\n return {};\n}\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {\n scales: {}\n };\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n Object.keys(configScales).forEach((id)=>{\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [\n {\n axis\n },\n scaleConf,\n defaultScaleOptions[axis],\n defaultScaleOptions[defaultId]\n ]);\n });\n config.data.datasets.forEach((dataset)=>{\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach((defaultID)=>{\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [\n {\n axis\n },\n configScales[id],\n defaultScaleOptions[defaultID]\n ]);\n });\n });\n Object.keys(scales).forEach((key)=>{\n const scale = scales[key];\n mergeIf(scale, [\n defaults.scales[scale.type],\n defaults.scale\n ]);\n });\n return scales;\n}\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n initOptions(config);\n return config;\n}\nconst keyCache = new Map();\nconst keysCached = new Set();\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\nconst addIfFound = (set, obj, key)=>{\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\nclass Config {\n constructor(config){\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n get platform() {\n return this._config.platform;\n }\n get type() {\n return this._config.type;\n }\n set type(type) {\n this._config.type = type;\n }\n get data() {\n return this._config.data;\n }\n set data(data) {\n this._config.data = initData(data);\n }\n get options() {\n return this._config.options;\n }\n set options(options) {\n this._config.options = options;\n }\n get plugins() {\n return this._config.plugins;\n }\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType, ()=>[\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`, ()=>[\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`\n ],\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`, ()=>[\n [\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]\n ]);\n }\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`, ()=>[\n [\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || []\n ]\n ]);\n }\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n getOptionScopes(mainScope, keyLists, resetCache) {\n const { options , type } = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n const scopes = new Set();\n keyLists.forEach((keys)=>{\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach((key)=>addIfFound(scopes, mainScope, key));\n }\n keys.forEach((key)=>addIfFound(scopes, options, key));\n keys.forEach((key)=>addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach((key)=>addIfFound(scopes, defaults, key));\n keys.forEach((key)=>addIfFound(scopes, descriptors, key));\n });\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n chartOptionScopes() {\n const { options , type } = this;\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {},\n {\n type\n },\n defaults,\n descriptors\n ];\n }\n resolveNamedOptions(scopes, names, context, prefixes = [\n ''\n ]) {\n const result = {\n $shared: true\n };\n const { resolver , subPrefixes } = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n for (const prop of names){\n result[prop] = options[prop];\n }\n return result;\n }\n createResolver(scopes, context, prefixes = [\n ''\n ], descriptorDefaults) {\n const { resolver } = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context) ? _attachContext(resolver, context, undefined, descriptorDefaults) : resolver;\n }\n}\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter((p)=>!p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\nconst hasFunction = (value)=>isObject(value) && Object.getOwnPropertyNames(value).reduce((acc, key)=>acc || isFunction(value[key]), false);\nfunction needContext(proxy, names) {\n const { isScriptable , isIndexable } = _descriptors(proxy);\n for (const prop of names){\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if (scriptable && (isFunction(value) || hasFunction(value)) || indexable && isArray(value)) {\n return true;\n }\n }\n return false;\n}\n\nvar version = \"4.4.0\";\n\nconst KNOWN_POSITIONS = [\n 'top',\n 'bottom',\n 'left',\n 'right',\n 'chartArea'\n];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';\n}\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1];\n };\n}\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n chart.notifyPlugins('afterRender');\n callback(animationOptions && animationOptions.onComplete, [\n context\n ], chart);\n}\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callback(animationOptions && animationOptions.onProgress, [\n context\n ], chart);\n}\n function getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n item = item[0];\n }\n if (item && item.canvas) {\n item = item.canvas;\n }\n return item;\n}\nconst instances = {};\nconst getChart = (key)=>{\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c)=>c.canvas === canvas).pop();\n};\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys){\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n function determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\nfunction getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\nfunction getDatasetArea(meta, chartArea) {\n const { xScale , yScale } = meta;\n if (xScale && yScale) {\n return {\n left: getSizeForArea(xScale, chartArea, 'left'),\n right: getSizeForArea(xScale, chartArea, 'right'),\n top: getSizeForArea(yScale, chartArea, 'top'),\n bottom: getSizeForArea(yScale, chartArea, 'bottom')\n };\n }\n return chartArea;\n}\nclass Chart {\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n constructor(item, userConfig){\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error('Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' + ' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.');\n }\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce((mode)=>this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n instances[this.id] = this;\n if (!context || !canvas) {\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n get aspectRatio() {\n const { options: { aspectRatio , maintainAspectRatio } , width , height , _aspectRatio } = this;\n if (!isNullOrUndef(aspectRatio)) {\n return aspectRatio;\n }\n if (maintainAspectRatio && _aspectRatio) {\n return _aspectRatio;\n }\n return height ? width / height : null;\n }\n get data() {\n return this.config.data;\n }\n set data(data) {\n this.config.data = data;\n }\n get options() {\n return this._options;\n }\n set options(options) {\n this.config.options = options;\n }\n get registry() {\n return registry;\n }\n _initialize() {\n this.notifyPlugins('beforeInit');\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n this.bindEvents();\n this.notifyPlugins('afterInit');\n return this;\n }\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n stop() {\n animator.stop(this);\n return this;\n }\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {\n width,\n height\n };\n }\n }\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n this.notifyPlugins('resize', {\n size: newSize\n });\n callback(options.onResize, [\n this,\n newSize\n ], this);\n if (this.attached) {\n if (this._doResize(mode)) {\n this.render();\n }\n }\n }\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n each(scalesOptions, (axisOptions, axisID)=>{\n axisOptions.id = axisID;\n });\n }\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id)=>{\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n if (scaleOpts) {\n items = items.concat(Object.keys(scaleOpts).map((id)=>{\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n }));\n }\n each(items, (item)=>{\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n scale.init(scaleOptions, options);\n });\n each(updated, (hasUpdated, id)=>{\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n each(scales, (scale)=>{\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n metasets.sort((a, b)=>a.index - b.index);\n if (numMeta > numData) {\n for(let i = numData; i < numMeta; ++i){\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n _removeUnreferencedMetasets() {\n const { _metasets: metasets , data: { datasets } } = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index)=>{\n if (datasets.filter((x)=>x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n this._removeUnreferencedMetasets();\n for(i = 0, ilen = datasets.length; i < ilen; i++){\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const { datasetElementType , dataElementType } = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n this._updateMetasets();\n return newControllers;\n }\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex)=>{\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n update(mode) {\n const config = this.config;\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n this._plugins.invalidate();\n if (this.notifyPlugins('beforeUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n const newControllers = this.buildOrUpdateControllers();\n this.notifyPlugins('beforeElementsUpdate');\n let minPadding = 0;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; i++){\n const { controller } = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n if (!animsDisabled) {\n each(newControllers, (controller)=>{\n controller.reset();\n });\n }\n this._updateDatasets(mode);\n this.notifyPlugins('afterUpdate', {\n mode\n });\n this._layers.sort(compare2Level('z', '_idx'));\n const { _active , _lastEvent } = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n this.render();\n }\n _updateScales() {\n each(this.scales, (scale)=>{\n layouts.removeBox(this, scale);\n });\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n this.unbindEvents();\n this.bindEvents();\n }\n }\n _updateHiddenIndices() {\n const { _hiddenIndices } = this;\n const changes = this._getUniformDataChanges() || [];\n for (const { method , start , count } of changes){\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx)=>new Set(_dataChanges.filter((c)=>c[0] === idx).map((c, i)=>i + ',' + c.splice(1).join(',')));\n const changeSet = makeSet(0);\n for(let i = 1; i < datasetCount; i++){\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet).map((c)=>c.split(',')).map((a)=>({\n method: a[1],\n start: +a[2],\n count: +a[3]\n }));\n }\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {\n cancelable: true\n }) === false) {\n return;\n }\n layouts.update(this, this.width, this.height, minPadding);\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n this._layers = [];\n each(this.boxes, (box)=>{\n if (noArea && box.position === 'chartArea') {\n return;\n }\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n this._layers.forEach((item, index)=>{\n item._idx = index;\n });\n this.notifyPlugins('afterLayout');\n }\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this.getDatasetMeta(i).controller.configure();\n }\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this._updateDataset(i, isFunction(mode) ? mode({\n datasetIndex: i\n }) : mode);\n }\n this.notifyPlugins('afterDatasetsUpdate', {\n mode\n });\n }\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {\n meta,\n index,\n mode,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n meta.controller._update(mode);\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n render() {\n if (this.notifyPlugins('beforeRender', {\n cancelable: true\n }) === false) {\n return;\n }\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({\n chart: this\n });\n }\n }\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const { width , height } = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n if (this.notifyPlugins('beforeDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const layers = this._layers;\n for(i = 0; i < layers.length && layers[i].z <= 0; ++i){\n layers[i].draw(this.chartArea);\n }\n this._drawDatasets();\n for(; i < layers.length; ++i){\n layers[i].draw(this.chartArea);\n }\n this.notifyPlugins('afterDraw');\n }\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n return result;\n }\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const metasets = this.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n this._drawDataset(metasets[i]);\n }\n this.notifyPlugins('afterDatasetsDraw');\n }\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta, this.chartArea);\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n meta.controller.draw();\n if (useClip) {\n unclipArea(ctx);\n }\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n return [];\n }\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter((x)=>x && x._dataset === dataset).pop();\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n return meta;\n }\n getContext() {\n return this.$context || (this.$context = createContext(null, {\n chart: this,\n type: 'chart'\n }));\n }\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n const meta = this.getDatasetMeta(datasetIndex);\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n anims.update(meta, {\n visible\n });\n this.update((ctx)=>ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n for(i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this._destroyDatasetMeta(i);\n }\n }\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const { canvas , ctx } = this;\n this._stop();\n this.config.clearCache();\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n delete instances[this.id];\n this.notifyPlugins('afterDestroy');\n }\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const listener = (e, x, y)=>{\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n each(this.options.events, (type)=>_add(type, listener));\n }\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener)=>{\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n const listener = (width, height)=>{\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n let detached;\n const attached = ()=>{\n _remove('attach', attached);\n this.attached = true;\n this.resize();\n _add('resize', listener);\n _add('detach', detached);\n };\n detached = ()=>{\n this.attached = false;\n _remove('resize', listener);\n this._stop();\n this._resize(0, 0);\n _add('attach', attached);\n };\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n unbindEvents() {\n each(this._listeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n each(this._responsiveListeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n if (changed) {\n this._active = active;\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter((p)=>p.plugin.id === pluginId).length === 1;\n }\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin)=>(plugin.options.events || this.options.events).includes(e.native.type);\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n const changed = this._handleEvent(e, replay, args.inChartArea);\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n if (changed || args.changed) {\n this.render();\n }\n return this;\n }\n _handleEvent(e, replay, inChartArea) {\n const { _active: lastActive = [] , options } = this;\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n if (inChartArea) {\n this._lastEvent = null;\n callback(options.onHover, [\n e,\n active,\n this\n ], this);\n if (isClick) {\n callback(options.onClick, [\n e,\n active,\n this\n ], this);\n }\n }\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n this._lastEvent = lastEvent;\n return changed;\n }\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart)=>chart._plugins.invalidate());\n}\n\nfunction clipArc(ctx, element, endAngle) {\n const { startAngle , pixelMargin , x , y , outerRadius , innerRadius } = element;\n let angleMargin = pixelMargin / outerRadius;\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, [\n 'outerStart',\n 'outerEnd',\n 'innerStart',\n 'innerEnd'\n ]);\n}\n/**\n * Parse border radius from the provided options\n */ function parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val)=>{\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit)\n };\n}\n/**\n * Convert (r, 𝜃) to (x, y)\n */ function rThetaToXY(r, theta, x, y) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta)\n };\n}\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */ function pathArc(ctx, element, offset, spacing, end, circular) {\n const { x , y , startAngle: start , pixelMargin , innerRadius: innerR } = element;\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n let spacingOffset = 0;\n const alpha = end - start;\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const { outerStart , outerEnd , innerStart , innerEnd } = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n ctx.beginPath();\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2;\n ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true);\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n ctx.closePath();\n}\nfunction drawArc(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference } = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\nfunction drawBorder(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference , options } = element;\n const { borderWidth , borderJoinStyle , borderDash , borderDashOffset } = options;\n const inner = options.borderAlign === 'inner';\n if (!borderWidth) {\n return;\n }\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\nclass ArcElement extends Element {\n static id = 'arc';\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n static descriptors = {\n _scriptable: true,\n _indexable: (name)=>name !== 'borderDash'\n };\n circumference;\n endAngle;\n fullCircles;\n innerRadius;\n outerRadius;\n pixelMargin;\n startAngle;\n constructor(cfg){\n super();\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(chartX, chartY, useFinalPosition) {\n const point = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n const { angle , distance } = getAngleFromPoint(point, {\n x: chartX,\n y: chartY\n });\n const { startAngle , endAngle , innerRadius , outerRadius , circumference } = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n return betweenAngles && withinRadius;\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , startAngle , endAngle , innerRadius , outerRadius } = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ], useFinalPosition);\n const { offset , spacing } = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n tooltipPosition(useFinalPosition) {\n return this.getCenterPoint(useFinalPosition);\n }\n draw(ctx) {\n const { options , circumference } = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = options.borderAlign === 'inner' ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n ctx.save();\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n ctx.restore();\n }\n}\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\n function getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n return lineTo;\n}\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const { start: paramsStart = 0 , end: paramsEnd = count - 1 } = params;\n const { start: segmentStart , end: segmentEnd } = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n function pathSegment(ctx, line, segment, params) {\n const { points , options } = line;\n const { count , start , loop , ilen } = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n let { move =true , reverse } = params || {};\n let i, point, prev;\n for(i = 0; i <= ilen; ++i){\n point = points[(start + (reverse ? ilen - i : i)) % count];\n if (point.skip) {\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n prev = point;\n }\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n return !!loop;\n}\n function fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const { count , start , ilen } = pathVars(points, segment, params);\n const { move =true , reverse } = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n const pointIndex = (index)=>(start + (reverse ? ilen - index : index)) % count;\n const drawX = ()=>{\n if (minY !== maxY) {\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n ctx.lineTo(avgX, lastY);\n }\n };\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n for(i = 0; i <= ilen; ++i){\n point = points[pointIndex(i)];\n if (point.skip) {\n continue;\n }\n const x = point.x;\n const y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n ctx.lineTo(x, y);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n lastY = y;\n }\n drawX();\n}\n function _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n function _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n return _pointInLine;\n}\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\nfunction strokePathDirect(ctx, line, start, count) {\n const { segments , options } = line;\n const segmentMethod = _getSegmentMethod(line);\n for (const segment of segments){\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {\n start,\n end: start + count - 1\n })) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\nconst usePath2D = typeof Path2D === 'function';\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\nclass LineElement extends Element {\n static id = 'line';\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n static descriptors = {\n _scriptable: true,\n _indexable: (name)=>name !== 'borderDash' && name !== 'fill'\n };\n constructor(cfg){\n super();\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n get points() {\n return this._points;\n }\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {\n property,\n start: value,\n end: value\n });\n if (!segments.length) {\n return;\n }\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for(i = 0, ilen = segments.length; i < ilen; ++i){\n const { start , end } = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n start = start || 0;\n count = count || this.points.length - start;\n for (const segment of segments){\n loop &= segmentMethod(ctx, this, segment, {\n start,\n end: start + count - 1\n });\n }\n return !!loop;\n }\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n if (points.length && options.borderWidth) {\n ctx.save();\n draw(ctx, this, start, count);\n ctx.restore();\n }\n if (this.animated) {\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n\nfunction inRange$1(el, pos, axis, useFinalPosition) {\n const options = el.options;\n const { [axis]: value } = el.getProps([\n axis\n ], useFinalPosition);\n return Math.abs(pos - value) < options.radius + options.hitRadius;\n}\nclass PointElement extends Element {\n static id = 'point';\n parsed;\n skip;\n stop;\n /**\n * @type {any}\n */ static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n /**\n * @type {any}\n */ static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n const options = this.options;\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange$1(this, mouseX, 'x', useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange$1(this, mouseY, 'y', useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n size(options) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n draw(ctx, area) {\n const options = this.options;\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n\nfunction getBarBounds(bar, useFinalPosition) {\n const { x , y , base , width , height } = bar.getProps([\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ], useFinalPosition);\n let left, right, top, bottom, half;\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n return {\n left,\n top,\n right,\n bottom\n };\n}\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\nfunction parseBorderRadius(bar, maxW, maxH) {\n const { enableBorderRadius } = bar.getProps([\n 'enableBorderRadius'\n ]);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n const enableBorder = enableBorderRadius || isObject(value);\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))\n }\n }\n };\n}\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n return bounds && (skipX || _isBetween(x, bounds.left, bounds.right)) && (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n function addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\nclass BarElement extends Element {\n static id = 'bar';\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n draw(ctx) {\n const { inflateAmount , options: { borderColor , backgroundColor } } = this;\n const { inner , outer } = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n ctx.save();\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , base , horizontal } = this.getProps([\n 'x',\n 'y',\n 'base',\n 'horizontal'\n ], useFinalPosition);\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n\nvar elements = /*#__PURE__*/Object.freeze({\n__proto__: null,\nArcElement: ArcElement,\nBarElement: BarElement,\nLineElement: LineElement,\nPointElement: PointElement\n});\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)',\n 'rgb(255, 99, 132)',\n 'rgb(255, 159, 64)',\n 'rgb(255, 205, 86)',\n 'rgb(75, 192, 192)',\n 'rgb(153, 102, 255)',\n 'rgb(201, 203, 207)' // grey\n];\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map((color)=>color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\nfunction getBorderColor(i) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\nfunction getBackgroundColor(i) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\nfunction colorizeDefaultDataset(dataset, i) {\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n return ++i;\n}\nfunction colorizeDoughnutDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>getBorderColor(i++));\n return i;\n}\nfunction colorizePolarAreaDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>getBackgroundColor(i++));\n return i;\n}\nfunction getColorizer(chart) {\n let i = 0;\n return (dataset, datasetIndex)=>{\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n if (controller instanceof DoughnutController) {\n i = colorizeDoughnutDataset(dataset, i);\n } else if (controller instanceof PolarAreaController) {\n i = colorizePolarAreaDataset(dataset, i);\n } else if (controller) {\n i = colorizeDefaultDataset(dataset, i);\n }\n };\n}\nfunction containsColorsDefinitions(descriptors) {\n let k;\n for(k in descriptors){\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n return false;\n}\nfunction containsColorsDefinition(descriptor) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\nvar plugin_colors = {\n id: 'colors',\n defaults: {\n enabled: true,\n forceOverride: false\n },\n beforeLayout (chart, _args, options) {\n if (!options.enabled) {\n return;\n }\n const { data: { datasets } , options: chartOptions } = chart.config;\n const { elements } = chartOptions;\n if (!options.forceOverride && (containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || elements && containsColorsDefinitions(elements))) {\n return;\n }\n const colorizer = getColorizer(chart);\n datasets.forEach(colorizer);\n }\n};\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n const samples = options.samples || availableWidth;\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n const decimated = [];\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n decimated[sampledIndex++] = data[a];\n for(i = 0; i < samples - 2; i++){\n let avgX = 0;\n let avgY = 0;\n let j;\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n for(j = avgRangeStart; j < avgRangeEnd; j++){\n avgX += data[j].x;\n avgY += data[j].y;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const { x: pointAx , y: pointAy } = data[a];\n maxArea = area = -1;\n for(j = rangeOffs; j < rangeTo; j++){\n area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy));\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n decimated[sampledIndex++] = data[endIndex];\n return decimated;\n}\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n for(i = start; i < start + count; ++i){\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n const lastIndex = i - 1;\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n if (i > 0 && lastIndex !== startIndex) {\n decimated.push(data[lastIndex]);\n }\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n return decimated;\n}\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data\n });\n }\n}\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset)=>{\n cleanDecimatedDataset(dataset);\n });\n}\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n let start = 0;\n let count;\n const { iScale } = meta;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n return {\n start,\n count\n };\n}\nvar plugin_decimation = {\n id: 'decimation',\n defaults: {\n algorithm: 'min-max',\n enabled: false\n },\n beforeElementsUpdate: (chart, args, options)=>{\n if (!options.enabled) {\n cleanDecimatedData(chart);\n return;\n }\n const availableWidth = chart.width;\n chart.data.datasets.forEach((dataset, datasetIndex)=>{\n const { _data , indexAxis } = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n if (resolve([\n indexAxis,\n chart.options.indexAxis\n ]) === 'y') {\n return;\n }\n if (!meta.controller.supportsDecimation) {\n return;\n }\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n return;\n }\n if (chart.options.parsing) {\n return;\n }\n let { start , count } = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n cleanDecimatedDataset(dataset);\n return;\n }\n if (isNullOrUndef(_data)) {\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n let decimated;\n switch(options.algorithm){\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n dataset._decimated = decimated;\n });\n },\n destroy (chart) {\n cleanDecimatedData(chart);\n }\n};\n\nfunction _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n for (const segment of segments){\n let { start , end } = segment;\n end = _findSegmentEnd(start, end, points);\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n if (!target.segments) {\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n const targetSegments = _boundSegments(target, bounds);\n for (const tgt of targetSegments){\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n for (const fillSource of fillSources){\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\nfunction _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {\n property,\n start,\n end\n };\n}\nfunction _pointsFromSegments(boundary, line) {\n const { x =null , y =null } = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({ start , end })=>{\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({\n x: first.x,\n y\n });\n points.push({\n x: last.x,\n y\n });\n } else if (x !== null) {\n points.push({\n x,\n y: first.y\n });\n points.push({\n x,\n y: last.y\n });\n }\n });\n return points;\n}\nfunction _findSegmentEnd(start, end, points) {\n for(; end > start; end--){\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n\nfunction _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n if (isArray(boundary)) {\n _loop = true;\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n return points.length ? new LineElement({\n points,\n options: {\n tension: 0\n },\n _loop,\n _fullLoop: _loop\n }) : null;\n}\nfunction _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n\nfunction _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [\n index\n ];\n let target;\n if (!propagate) {\n return fill;\n }\n while(fill !== false && visited.indexOf(fill) === -1){\n if (!isNumberFinite(fill)) {\n return fill;\n }\n target = sources[fill];\n if (!target) {\n return false;\n }\n if (target.visible) {\n return fill;\n }\n visited.push(fill);\n fill = target.fill;\n }\n return false;\n}\n function _decodeFill(line, index, count) {\n const fill = parseFillOption(line);\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n let target = parseFloat(fill);\n if (isNumberFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n return [\n 'origin',\n 'start',\n 'end',\n 'stack',\n 'shape'\n ].indexOf(fill) >= 0 && fill;\n}\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n return target;\n}\n function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n function _getTargetValue(fill, scale, startValue) {\n let value;\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n function parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n if (fill === false || fill === null) {\n return false;\n }\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n\nfunction _buildStackLine(source) {\n const { scale , index , line } = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({\n x: null,\n y: scale.bottom\n }, line));\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n for(let j = segment.start; j <= segment.end; j++){\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({\n points,\n options: {}\n });\n}\n function getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n for(let i = 0; i < metas.length; i++){\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n function addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for(let j = 0; j < linesBelow.length; j++){\n const line = linesBelow[j];\n const { first , last , point } = findPoint(line, sourcePoint, 'x');\n if (!point || first && last) {\n continue;\n }\n if (first) {\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n break;\n }\n }\n }\n points.push(...postponed);\n}\n function findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {\n first,\n last,\n point\n };\n}\n\nclass simpleArc {\n constructor(opts){\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n pathSegment(ctx, bounds, opts) {\n const { x , y , radius } = this;\n bounds = bounds || {\n start: 0,\n end: TAU\n };\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n interpolate(point) {\n const { x , y , radius } = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n\nfunction _getTarget(source) {\n const { chart , fill , line } = source;\n if (isNumberFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n if (fill === 'shape') {\n return true;\n }\n const boundary = computeBoundary(source);\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n return _createBoundaryLine(boundary, line);\n}\n function getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\nfunction computeLinearBoundary(source) {\n const { scale ={} , fill } = source;\n const pixel = _getTargetPixel(fill, scale);\n if (isNumberFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n return null;\n}\nfunction computeCircularBoundary(source) {\n const { scale , fill } = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n for(let i = 0; i < length; ++i){\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\nfunction _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const { line , scale , axis } = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const { above =color , below =color } = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {\n line,\n target,\n above,\n below,\n area,\n scale,\n axis\n });\n unclipArea(ctx);\n }\n}\nfunction doFill(ctx, cfg) {\n const { line , target , above , below , area , scale } = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n ctx.save();\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {\n line,\n target,\n color: above,\n scale,\n property\n });\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {\n line,\n target,\n color: below,\n scale,\n property\n });\n ctx.restore();\n}\nfunction clipVertical(ctx, target, clipY) {\n const { segments , points } = target;\n let first = true;\n let lineLoop = false;\n ctx.beginPath();\n for (const segment of segments){\n const { start , end } = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {\n move: lineLoop\n });\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\nfunction fill(ctx, cfg) {\n const { line , target , property , color , scale } = cfg;\n const segments = _segments(line, target, property);\n for (const { source: src , target: tgt , start , end } of segments){\n const { style: { backgroundColor =color } = {} } = src;\n const notShape = target !== true;\n ctx.save();\n ctx.fillStyle = backgroundColor;\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n ctx.beginPath();\n const lineLoop = !!line.pathSegment(ctx, src);\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n const targetLoop = !!target.pathSegment(ctx, tgt, {\n move: lineLoop,\n reverse: true\n });\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n ctx.restore();\n }\n}\nfunction clipBounds(ctx, scale, bounds) {\n const { top , bottom } = scale.chart.chartArea;\n const { property , start , end } = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\nvar index = {\n id: 'filler',\n afterDatasetsUpdate (chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n for(i = 0; i < count; ++i){\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line\n };\n }\n meta.$filler = source;\n sources.push(source);\n }\n for(i = 0; i < count; ++i){\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n beforeDraw (chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n beforeDatasetsDraw (chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n const metasets = chart.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n beforeDatasetDraw (chart, args, options) {\n const source = args.meta.$filler;\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n\nconst getBoxSize = (labelOpts, fontSize)=>{\n let { boxHeight =fontSize , boxWidth =fontSize } = labelOpts;\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\nconst itemsEqual = (a, b)=>a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass Legend extends Element {\n constructor(config){\n super();\n this._added = false;\n this.legendHitBoxes = [];\n this._hoveredItem = null;\n this.doughnutMode = false;\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = callback(labelOpts.generateLabels, [\n this.chart\n ], this) || [];\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item)=>labelOpts.filter(item, this.chart.data));\n }\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b)=>labelOpts.sort(a, b, this.chart.data));\n }\n if (this.options.reverse) {\n legendItems.reverse();\n }\n this.legendItems = legendItems;\n }\n fit() {\n const { options , ctx } = this;\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const { boxWidth , itemHeight } = getBoxSize(labelOpts, fontSize);\n let width, height;\n ctx.font = labelFont.string;\n if (this.isHorizontal()) {\n width = this.maxWidth;\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight;\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const { ctx , maxWidth , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const lineWidths = this.lineWidths = [\n 0\n ];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i)=>{\n const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n hitboxes[i] = {\n left: 0,\n top,\n row,\n width: itemWidth,\n height: itemHeight\n };\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n return totalHeight;\n }\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const { ctx , maxHeight , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n let left = 0;\n let col = 0;\n this.legendItems.forEach((legendItem, i)=>{\n const { itemWidth , itemHeight } = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n hitboxes[i] = {\n left,\n top: currentColHeight,\n col,\n width: itemWidth,\n height: itemHeight\n };\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n totalWidth += currentColWidth;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n return totalWidth;\n }\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const { legendHitBoxes: hitboxes , options: { align , labels: { padding } , rtl } } = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes){\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes){\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n this._draw();\n unclipArea(ctx);\n }\n }\n _draw() {\n const { options: opts , columnSizes , lineWidths , ctx } = this;\n const { align , labels: labelOpts } = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const { padding } = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n this.drawTitle();\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n const { boxWidth , boxHeight , itemHeight } = getBoxSize(labelOpts, fontSize);\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n ctx.save();\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n if (labelOpts.usePointStyle) {\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n ctx.beginPath();\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n ctx.restore();\n };\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n overrideTextDirection(this.ctx, opts.textDirection);\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i)=>{\n ctx.strokeStyle = legendItem.fontColor;\n ctx.fillStyle = legendItem.fontColor;\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n rtlHelper.setWidth(this.width);\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n const realX = rtlHelper.x(x);\n drawLegendBox(realX, y, legendItem);\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n fillText(rtlHelper.x(x), y, legendItem);\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n if (!titleOpts.display) {\n return;\n }\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n let left = this.left;\n let maxWidth = this.width;\n if (this.isHorizontal()) {\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n const maxHeight = this.columnSizes.reduce((acc, size)=>Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n const x = _alignStartEnd(position, left, left + maxWidth);\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n if (_isBetween(x, this.left, this.right) && _isBetween(y, this.top, this.bottom)) {\n lh = this.legendHitBoxes;\n for(i = 0; i < lh.length; ++i){\n hitBox = lh[i];\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width) && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n return this.legendItems[i];\n }\n }\n }\n return null;\n }\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n callback(opts.onLeave, [\n e,\n previous,\n this\n ], this);\n }\n this._hoveredItem = hoveredItem;\n if (hoveredItem && !sameItem) {\n callback(opts.onHover, [\n e,\n hoveredItem,\n this\n ], this);\n }\n } else if (hoveredItem) {\n callback(opts.onClick, [\n e,\n hoveredItem,\n this\n ], this);\n }\n }\n}\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {\n itemWidth,\n itemHeight\n };\n}\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b)=>a.length > b.length ? a : b);\n }\n return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width;\n}\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\nvar plugin_legend = {\n id: 'legend',\n _element: Legend,\n start (chart, _args, options) {\n const legend = chart.legend = new Legend({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n stop (chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n beforeUpdate (chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n afterUpdate (chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n afterEvent (chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n onClick (e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n onHover: null,\n onLeave: null,\n labels: {\n color: (ctx)=>ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n generateLabels (chart) {\n const datasets = chart.data.datasets;\n const { labels: { usePointStyle , pointStyle , textAlign , color , useBorderRadius , borderRadius } } = chart.legend.options;\n return chart._getSortedDatasetMetas().map((meta)=>{\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n title: {\n color: (ctx)=>ctx.chart.options.color,\n display: false,\n position: 'center',\n text: ''\n }\n },\n descriptors: {\n _scriptable: (name)=>!name.startsWith('on'),\n labels: {\n _scriptable: (name)=>![\n 'generateLabels',\n 'filter',\n 'sort'\n ].includes(name)\n }\n }\n};\n\nclass Title extends Element {\n constructor(config){\n super();\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight) {\n const opts = this.options;\n this.left = 0;\n this.top = 0;\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n _drawArgs(offset) {\n const { top , left , bottom , right , options } = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n }\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n if (!opts.display) {\n return;\n }\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const { titleX , titleY , maxWidth , rotation } = this._drawArgs(offset);\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n}\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\nvar plugin_title = {\n id: 'title',\n _element: Title,\n start (chart, _args, options) {\n createTitle(chart, options);\n },\n stop (chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n beforeUpdate (chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold'\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst map = new WeakMap();\nvar plugin_subtitle = {\n id: 'subtitle',\n start (chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n stop (chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n beforeUpdate (chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal'\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst positioners = {\n average (items) {\n if (!items.length) {\n return false;\n }\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n return {\n x: x / count,\n y: y / count\n };\n },\n nearest (items, eventPosition) {\n if (!items.length) {\n return false;\n }\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n return {\n x,\n y\n };\n }\n};\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n return base;\n}\n function splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n function createTooltipItem(chart, item) {\n const { element , datasetIndex , index } = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const { label , value } = controller.getLabelAndValue(index);\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n function getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const { body , footer , title } = tooltip;\n const { boxWidth , boxHeight } = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n let combinedBodyLength = body.reduce((count, bodyItem)=>count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;\n }\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n ctx.save();\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;\n each(body, (bodyItem)=>{\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n widthPadding = 0;\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n ctx.restore();\n width += padding.width;\n return {\n width,\n height\n };\n}\nfunction determineYAlign(chart, size) {\n const { y , height } = size;\n if (y < height / 2) {\n return 'top';\n } else if (y > chart.height - height / 2) {\n return 'bottom';\n }\n return 'center';\n}\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const { x , width } = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\nfunction determineXAlign(chart, options, size, yAlign) {\n const { x , width } = size;\n const { width: chartWidth , chartArea: { left , right } } = chart;\n let xAlign = 'center';\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n return xAlign;\n}\n function determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\nfunction alignX(size, xAlign) {\n let { x , width } = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= width / 2;\n }\n return x;\n}\nfunction alignY(size, yAlign, paddingAndSize) {\n let { y , height } = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= height / 2;\n }\n return y;\n}\n function getBackgroundPoint(options, size, alignment, chart) {\n const { caretSize , caretPadding , cornerRadius } = options;\n const { xAlign , yAlign } = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n return align === 'center' ? tooltip.x + tooltip.width / 2 : align === 'right' ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;\n}\n function getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\nconst defaultCallbacks = {\n beforeTitle: noop,\n title (tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n return '';\n },\n afterTitle: noop,\n beforeBody: noop,\n beforeLabel: noop,\n label (tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n let label = tooltipItem.dataset.label || '';\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0\n };\n },\n labelTextColor () {\n return this.options.bodyColor;\n },\n labelPointStyle (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation\n };\n },\n afterLabel: noop,\n afterBody: noop,\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n function invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n return result;\n}\nclass Tooltip extends Element {\n static positioners = positioners;\n constructor(config){\n super();\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n if (cached) {\n return cached;\n }\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n return animations;\n }\n getContext() {\n return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n getTitle(context, options) {\n const { callbacks } = options;\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n return lines;\n }\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems));\n }\n getBody(tooltipItems, options) {\n const { callbacks } = options;\n const bodyItems = [];\n each(tooltipItems, (context)=>{\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n bodyItems.push(bodyItem);\n });\n return bodyItems;\n }\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems));\n }\n getFooter(tooltipItems, options) {\n const { callbacks } = options;\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n return lines;\n }\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n for(i = 0, len = active.length; i < len; ++i){\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array)=>options.filter(element, index, array, data));\n }\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b)=>options.itemSort(a, b, data));\n }\n each(tooltipItems, (context)=>{\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n if (changed && options.external) {\n options.external.call(this, {\n chart: this.chart,\n tooltip: this,\n replay\n });\n }\n }\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n getCaretPosition(tooltipPoint, size, options) {\n const { xAlign , yAlign } = this;\n const { caretSize , cornerRadius } = options;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n const { x: ptX , y: ptY } = tooltipPoint;\n const { width , height } = size;\n let x1, x2, x3, y1, y2, y3;\n if (yAlign === 'center') {\n y2 = ptY + height / 2;\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {\n x1,\n x2,\n x3,\n y1,\n y2,\n y3\n };\n }\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.titleAlign, options);\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing;\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing;\n }\n }\n }\n }\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const { boxHeight , boxWidth } = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2,\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1;\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = toTRBLCorners(labelColor.borderRadius);\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n ctx.fillStyle = this.labelTextColors[i];\n }\n drawBody(pt, ctx, options) {\n const { body } = this;\n const { bodySpacing , bodyAlign , displayColors , boxHeight , boxWidth , boxPadding } = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right' ? bodyAlign === 'center' ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;\n for(i = 0, ilen = body.length; i < ilen; ++i){\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n lines = bodyItem.lines;\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n for(j = 0, jlen = lines.length; j < jlen; ++j){\n fillLineOfText(lines[j]);\n bodyLineHeight = bodyFont.lineHeight;\n }\n each(bodyItem.after, fillLineOfText);\n }\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing;\n }\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n footerFont = toFont(options.footerFont);\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n drawBackground(pt, ctx, tooltipSize, options) {\n const { xAlign , yAlign } = this;\n const { x , y } = pt;\n const { width , height } = tooltipSize;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(options.cornerRadius);\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n _willRender() {\n return !!this.opacity;\n }\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n if (!opacity) {\n return;\n }\n this._updateAnimationTarget(options);\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n const padding = toPadding(options.padding);\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n this.drawBackground(pt, ctx, tooltipSize, options);\n overrideTextDirection(ctx, options.textDirection);\n pt.y += padding.top;\n this.drawTitle(pt, ctx, options);\n this.drawBody(pt, ctx, options);\n this.drawFooter(pt, ctx, options);\n restoreTextDirection(ctx, options.textDirection);\n ctx.restore();\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.chart.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n const positionChanged = this._positionChanged(active, e);\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n if (changed) {\n this._active = active;\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n this.update(true, replay);\n }\n }\n return changed;\n }\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n if (options.reverse) {\n active.reverse();\n }\n return active;\n }\n _positionChanged(active, e) {\n const { caretX , caretY , options } = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\nvar plugin_tooltip = {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n afterInit (chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({\n chart,\n options\n });\n }\n },\n beforeUpdate (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n reset (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n afterDraw (chart) {\n const tooltip = chart.tooltip;\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n if (chart.notifyPlugins('beforeTooltipDraw', {\n ...args,\n cancelable: true\n }) === false) {\n return;\n }\n tooltip.draw(chart.ctx);\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n afterEvent (chart, args) {\n if (chart.tooltip) {\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n args.changed = true;\n }\n }\n },\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold'\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {},\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold'\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts)=>opts.bodyFont.size,\n boxWidth: (ctx, opts)=>opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart'\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'width',\n 'height',\n 'caretX',\n 'caretY'\n ]\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n descriptors: {\n _scriptable: (name)=>name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n additionalOptionScopes: [\n 'interaction'\n ]\n};\n\nvar plugins = /*#__PURE__*/Object.freeze({\n__proto__: null,\nColors: plugin_colors,\nDecimation: plugin_decimation,\nFiller: index,\nLegend: plugin_legend,\nSubTitle: plugin_subtitle,\nTitle: plugin_title,\nTooltip: plugin_tooltip\n});\n\nconst addIfString = (labels, raw, index, addedLabels)=>{\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({\n index,\n label: raw\n });\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\nconst validIndex = (index, max)=>index === null ? null : _limitValue(Math.round(index), 0, max);\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\nclass CategoryScale extends Scale {\n static id = 'category';\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n constructor(cfg){\n super(cfg);\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const { index , label } of added){\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n determineDataLimits() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this.getMinMax(true);\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1);\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n for(let value = min; value <= max; value++){\n ticks.push({\n value\n });\n }\n return ticks;\n }\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n configure() {\n super.configure();\n if (!this.isHorizontal()) {\n this._reversePixels = !this._reversePixels;\n }\n }\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n getBasePixel() {\n return this.bottom;\n }\n}\n\nfunction generateTicks$1(generationOptions, dataRange) {\n const ticks = [];\n const MIN_SPACING = 1e-14;\n const { bounds , step , min , max , precision , count , maxTicks , maxDigits , includeBounds } = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const { min: rmin , max: rmax } = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [\n {\n value: rmin\n },\n {\n value: rmax\n }\n ];\n }\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n if (!isNullOrUndef(precision)) {\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n numSpaces = (niceMax - niceMin) / spacing;\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n const decimalPlaces = Math.max(_decimalPlaces(spacing), _decimalPlaces(niceMin));\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({\n value: min\n });\n if (niceMin < min) {\n j++;\n }\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n for(; j < numSpaces; ++j){\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) {\n break;\n }\n ticks.push({\n value: tickValue\n });\n }\n if (maxDefined && includeBounds && niceMax !== max) {\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({\n value: max\n });\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({\n value: niceMax\n });\n }\n return ticks;\n}\nfunction relativeLabelSize(value, minSpacing, { horizontal , minRotation }) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\nclass LinearScaleBase extends Scale {\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._endValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n return +raw;\n }\n handleTickRangeOptions() {\n const { beginAtZero } = this.options;\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n setMax(max + offset);\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n getTickLimit() {\n const tickOpts = this.options.ticks;\n let { maxTicksLimit , stepSize } = tickOpts;\n let maxTicks;\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n return maxTicks;\n }\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks$1(numericGeneratorOptions, dataRange);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n super.configure();\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n\nclass LinearScale extends LinearScaleBase {\n static id = 'linear';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? min : 0;\n this.max = isNumberFinite(max) ? max : 1;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n\nconst log10Floor = (v)=>Math.floor(log10(v));\nconst changeExponent = (v, m)=>Math.pow(10, log10Floor(v) + m);\nfunction isMajor(tickVal) {\n const remain = tickVal / Math.pow(10, log10Floor(tickVal));\n return remain === 1;\n}\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while(steps(min, max, rangeExp) > 10){\n rangeExp++;\n }\n while(steps(min, max, rangeExp) < 10){\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n function generateTicks(generationOptions, { min , max }) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while(value < max){\n ticks.push({\n value,\n major: isMajor(value),\n significand\n });\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({\n value: lastTick,\n major: isMajor(lastTick),\n significand\n });\n return ticks;\n}\nclass LogarithmicScale extends Scale {\n static id = 'logarithmic';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [\n raw,\n index\n ]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isNumberFinite(value) && value > 0 ? value : null;\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? Math.max(0, min) : null;\n this.max = isNumberFinite(max) ? Math.max(0, max) : null;\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n if (this._zero && this.min !== this._suggestedMin && !isNumberFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n this.handleTickRangeOptions();\n }\n handleTickRangeOptions() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (min === max) {\n if (min <= 0) {\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n setMax(changeExponent(min, +1));\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const opts = this.options;\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n getLabelForValue(value) {\n return value === undefined ? '0' : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n configure() {\n const start = this.min;\n super.configure();\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min ? 0 : (log10(value) - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [\n label\n ];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - size / 2,\n end: pos + size / 2\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n return {\n start: pos,\n end: pos + size\n };\n}\n function fitWithPointLabels(scale) {\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n for(let i = 0; i < valueCount; i++){\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b);\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\nfunction createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const { extra , additionalAngle , padding , size } = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n visible: true,\n x: pointLabelPosition.x,\n y,\n textAlign,\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\nfunction isNotOverlapped(item, area) {\n if (!area) {\n return true;\n }\n const { left , top , right , bottom } = item;\n const apexesInArea = _isPointInArea({\n x: left,\n y: top\n }, area) || _isPointInArea({\n x: left,\n y: bottom\n }, area) || _isPointInArea({\n x: right,\n y: top\n }, area) || _isPointInArea({\n x: right,\n y: bottom\n }, area);\n return !apexesInArea;\n}\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const { centerPointLabels , display } = opts.pointLabels;\n const itemOpts = {\n extra: getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? PI / valueCount : 0\n };\n let area;\n for(let i = 0; i < valueCount; i++){\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n const item = createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === 'auto') {\n item.visible = isNotOverlapped(item, area);\n if (item.visible) {\n area = item;\n }\n }\n }\n return items;\n}\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n return 'right';\n}\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= w / 2;\n }\n return x;\n}\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= h / 2;\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\nfunction drawPointLabelBox(ctx, opts, item) {\n const { left , top , right , bottom } = item;\n const { backdropColor } = opts;\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(opts.borderRadius);\n const padding = toPadding(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n}\nfunction drawPointLabels(scale, labelCount) {\n const { ctx , options: { pointLabels } } = scale;\n for(let i = labelCount - 1; i >= 0; i--){\n const item = scale._pointLabelItems[i];\n if (!item.visible) {\n continue;\n }\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = toFont(optsAtIndex.font);\n const { x , y , textAlign } = item;\n renderText(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n });\n }\n}\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const { ctx } = scale;\n if (circular) {\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n for(let i = 1; i < labelCount; i++){\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n const { color , lineWidth } = gridLineOpts;\n if (!circular && !labelCount || !color || !lineWidth || radius < 0) {\n return;\n }\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\nclass RadialLinearScale extends LinearScaleBase {\n static id = 'radialLinear';\n static defaults = {\n display: true,\n animate: true,\n position: 'chartArea',\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n grid: {\n circular: false\n },\n startAngle: 0,\n ticks: {\n showLabelBackdrop: true,\n callback: Ticks.formatters.numeric\n },\n pointLabels: {\n backdropColor: undefined,\n backdropPadding: 2,\n display: true,\n font: {\n size: 10\n },\n callback (label) {\n return label;\n },\n padding: 5,\n centerPointLabels: false\n }\n };\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n constructor(cfg){\n super(cfg);\n this.xCenter = undefined;\n this.yCenter = undefined;\n this.drawingArea = undefined;\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n setDimensions() {\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(false);\n this.min = isNumberFinite(min) && !isNaN(min) ? min : 0;\n this.max = isNumberFinite(max) && !isNaN(max) ? max : 0;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n this._pointLabels = this.getLabels().map((value, index)=>{\n const label = callback(this.options.pointLabels.callback, [\n value,\n index\n ], this);\n return label || label === 0 ? label : '';\n }).filter((v, i)=>this.chart.getDataVisibility(i));\n }\n fit() {\n const opts = this.options;\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n getPointLabelPosition(index) {\n const { left , top , right , bottom } = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom\n };\n }\n drawBackground() {\n const { backgroundColor , grid: { circular } } = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const { angleLines , grid , border } = opts;\n const labelCount = this._pointLabels.length;\n let i, offset, position;\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n if (grid.display) {\n this.ticks.forEach((tick, index)=>{\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n if (angleLines.display) {\n ctx.save();\n for(i = labelCount - 1; i >= 0; i--){\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const { color , lineWidth } = optsAtIndex;\n if (!lineWidth || !color) {\n continue;\n }\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n ctx.restore();\n }\n }\n drawBorder() {}\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n if (!tickOpts.display) {\n return;\n }\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n this.ticks.forEach((tick, index)=>{\n if (index === 0 && !opts.reverse) {\n return;\n }\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height);\n }\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth\n });\n });\n ctx.restore();\n }\n drawTitle() {}\n}\n\nconst INTERVALS = {\n millisecond: {\n common: true,\n size: 1,\n steps: 1000\n },\n second: {\n common: true,\n size: 1000,\n steps: 60\n },\n minute: {\n common: true,\n size: 60000,\n steps: 60\n },\n hour: {\n common: true,\n size: 3600000,\n steps: 24\n },\n day: {\n common: true,\n size: 86400000,\n steps: 30\n },\n week: {\n common: false,\n size: 604800000,\n steps: 4\n },\n month: {\n common: true,\n size: 2.628e9,\n steps: 12\n },\n quarter: {\n common: false,\n size: 7.884e9,\n steps: 4\n },\n year: {\n common: true,\n size: 3.154e10\n }\n};\n const UNITS = /* #__PURE__ */ Object.keys(INTERVALS);\n function sorter(a, b) {\n return a - b;\n}\n function parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n const adapter = scale._adapter;\n const { parser , round , isoWeekday } = scale._parseOpts;\n let value = input;\n if (typeof parser === 'function') {\n value = parser(value);\n }\n if (!isNumberFinite(value)) {\n value = typeof parser === 'string' ? adapter.parse(value, parser) : adapter.parse(value);\n }\n if (value === null) {\n return null;\n }\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, 'isoWeek', isoWeekday) : adapter.startOf(value, round);\n }\n return +value;\n}\n function determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n for(let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i){\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n return UNITS[ilen - 1];\n}\n function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for(let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--){\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n function determineMajorUnit(unit) {\n for(let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i){\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n function addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const { lo , hi } = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n function setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n for(major = first; major <= last; major = +adapter.add(major, 1, majorUnit)){\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n function ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n const map = {};\n const ilen = values.length;\n let i, value;\n for(i = 0; i < ilen; ++i){\n value = values[i];\n map[value] = i;\n ticks.push({\n value,\n major: false\n });\n }\n return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass TimeScale extends Scale {\n static id = 'time';\n static defaults = {\n bounds: 'data',\n adapters: {},\n time: {\n parser: false,\n unit: false,\n round: false,\n isoWeekday: false,\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n source: 'auto',\n callback: false,\n major: {\n enabled: false\n }\n }\n };\n constructor(props){\n super(props);\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n this._unit = 'day';\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n adapter.init(opts);\n mergeIf(time.displayFormats, adapter.formats());\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n super.init(scaleOpts);\n this._normalized = opts.normalized;\n }\n parse(raw, index) {\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n if (!minDefined || !maxDefined) {\n _applyBounds(this._getLabelBounds());\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {\n min,\n max\n };\n }\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n const min = this.min;\n const max = this.max;\n const ticks = _filterBetween(timestamps, min, max);\n this._unit = timeOpts.unit || (tickOpts.autoSkip ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n if (options.reverse) {\n ticks.reverse();\n }\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n afterAutoSkip() {\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map((tick)=>+tick.value));\n }\n }\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n this._offsets = {\n start,\n end,\n factor: 1 / (start + 1 + end)\n };\n }\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for(time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++){\n addTick(ticks, time, timestamps);\n }\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n return Object.keys(ticks).sort(sorter).map((x)=>+x);\n }\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n if (formatter) {\n return callback(formatter, [\n time,\n index,\n ticks\n ], this);\n }\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n generateTickLabels(ticks) {\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n return {\n w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,\n h: tickLabelWidth * sinRotation + tickFontSize * cosRotation\n };\n }\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [\n exampleTime\n ], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const metas = this.getMatchingVisibleMetas();\n if (this._normalized && metas.length) {\n return this._cache.data = metas[0].controller.getAllParsedValues(this);\n }\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n return this._cache.data = this.normalize(timestamps);\n }\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const labels = this.getLabels();\n for(i = 0, ilen = labels.length; i < ilen; ++i){\n timestamps.push(parse(this, labels[i]));\n }\n return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);\n }\n normalize(values) {\n return _arrayUnique(values.sort(sorter));\n }\n}\n\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({ lo , hi } = _lookupByKey(table, 'pos', val));\n }\n ({ pos: prevSource , time: prevTarget } = table[lo]);\n ({ pos: nextSource , time: nextTarget } = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({ lo , hi } = _lookupByKey(table, 'time', val));\n }\n ({ time: prevSource , pos: prevTarget } = table[lo]);\n ({ time: nextSource , pos: nextTarget } = table[hi]);\n }\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass TimeSeriesScale extends TimeScale {\n static id = 'timeseries';\n static defaults = TimeScale.defaults;\n constructor(props){\n super(props);\n this._table = [];\n this._minPos = undefined;\n this._tableRange = undefined;\n }\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n buildLookupTable(timestamps) {\n const { min , max } = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n for(i = 0, ilen = timestamps.length; i < ilen; ++i){\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n if (items.length < 2) {\n return [\n {\n time: min,\n pos: 0\n },\n {\n time: max,\n pos: 1\n }\n ];\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({\n time: curr,\n pos: i / (ilen - 1)\n });\n }\n }\n return table;\n }\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) {\n timestamps.splice(0, 0, min);\n }\n if (!timestamps.includes(max) || timestamps.length === 1) {\n timestamps.push(max);\n }\n return timestamps.sort((a, b)=>a - b);\n }\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n if (timestamps.length) {\n return timestamps;\n }\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n return timestamps;\n }\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\n\nvar scales = /*#__PURE__*/Object.freeze({\n__proto__: null,\nCategoryScale: CategoryScale,\nLinearScale: LinearScale,\nLogarithmicScale: LogarithmicScale,\nRadialLinearScale: RadialLinearScale,\nTimeScale: TimeScale,\nTimeSeriesScale: TimeSeriesScale\n});\n\nconst registerables = [\n controllers,\n elements,\n plugins,\n scales\n];\n\nexport { Animation, Animations, ArcElement, BarController, BarElement, BasePlatform, BasicPlatform, BubbleController, CategoryScale, Chart, plugin_colors as Colors, DatasetController, plugin_decimation as Decimation, DomPlatform, DoughnutController, Element, index as Filler, Interaction, plugin_legend as Legend, LineController, LineElement, LinearScale, LogarithmicScale, PieController, PointElement, PolarAreaController, RadarController, RadialLinearScale, Scale, ScatterController, plugin_subtitle as SubTitle, Ticks, TimeScale, TimeSeriesScale, plugin_title as Title, plugin_tooltip as Tooltip, adapters as _adapters, _detectPlatform, animator, controllers, defaults, elements, layouts, plugins, registerables, registry, scales };\n//# sourceMappingURL=chart.js.map\n","import {requestAnimFrame} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('./core.animation.js').default } Animation\n * @typedef { import('./core.controller.js').default } Chart\n */\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is export for typedoc\n */\nexport class Animator {\n constructor() {\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n\n /**\n\t * @private\n\t */\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n\n callbacks.forEach(fn => fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n\n /**\n\t * @private\n\t */\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n\n this._request = requestAnimFrame.call(window, () => {\n this._update();\n this._request = null;\n\n if (this._running) {\n this._refresh();\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _update(date = Date.now()) {\n let remaining = 0;\n\n this._charts.forEach((anims, chart) => {\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n\n for (; i >= 0; --i) {\n item = items[i];\n\n if (item._active) {\n if (item._total > anims.duration) {\n // if the animation has been updated and its duration prolonged,\n // update to total duration of current animations run (for progress event)\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n // Remove the item by replacing it with last item and removing the last\n // A lot faster than splice.\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n\n remaining += items.length;\n });\n\n this._lastDate = date;\n\n if (remaining === 0) {\n this._running = false;\n }\n }\n\n /**\n\t * @private\n\t */\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} event - event name\n\t * @param {Function} cb - callback\n\t */\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n\n /**\n\t * Add animations\n\t * @param {Chart} chart\n\t * @param {Animation[]} items - animations\n\t */\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n\n /**\n\t * Counts number of active animations for the chart\n\t * @param {Chart} chart\n\t */\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n\n /**\n\t * Start animating (all charts)\n\t * @param {Chart} chart\n\t */\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n\n /**\n\t * Stop all animations for the chart\n\t * @param {Chart} chart\n\t */\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n\n for (; i >= 0; --i) {\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n\n /**\n\t * Remove chart from Animator\n\t * @param {Chart} chart\n\t */\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Animator();\n","import effects from '../helpers/helpers.easing.js';\nimport {resolve} from '../helpers/helpers.options.js';\nimport {color as helpersColor} from '../helpers/helpers.color.js';\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean(from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n /**\n * @param {string} from\n * @param {string} to\n * @param {number} factor\n */\n color(from, to, factor) {\n const c0 = helpersColor(from || transparent);\n const c1 = c0.valid && helpersColor(to || transparent);\n return c1 && c1.valid\n ? c1.mix(c0, factor).hexString()\n : to;\n },\n number(from, to, factor) {\n return from + (to - from) * factor;\n }\n};\n\nexport default class Animation {\n constructor(cfg, target, prop, to) {\n const currentValue = target[prop];\n\n to = resolve([cfg.to, to, currentValue, cfg.from]);\n const from = resolve([cfg.from, currentValue, to]);\n\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n\n active() {\n return this._active;\n }\n\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([cfg.to, to, currentValue, cfg.from]);\n this._from = resolve([cfg.from, currentValue, to]);\n }\n }\n\n cancel() {\n if (this._active) {\n // update current evaluated value, for smoother animations\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n\n this._active = from !== to && (loop || (elapsed < duration));\n\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n\n factor = (elapsed / duration) % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n\n this._target[prop] = this._fn(from, to, factor);\n }\n\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej) => {\n promises.push({res, rej});\n });\n }\n\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for (let i = 0; i < promises.length; i++) {\n promises[i][method]();\n }\n }\n}\n","import animator from './core.animator.js';\nimport Animation from './core.animation.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isObject} from '../helpers/helpers.core.js';\n\nexport default class Animations {\n constructor(chart, config) {\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n\n Object.getOwnPropertyNames(config).forEach(key => {\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions) {\n resolved[option] = cfg[option];\n }\n\n (isArray(cfg.properties) && cfg.properties || [key]).forEach((prop) => {\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n\n /**\n\t * Utility to handle animation of `options`.\n\t * @private\n\t */\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n // Going to shared options:\n // After all animations are done, assign the shared options object to the element\n // So any new updates to the shared options are observed\n awaitAll(target.options.$animations, newOptions).then(() => {\n target.options = newOptions;\n }, () => {\n // rejected, noop\n });\n }\n\n return animations;\n }\n\n /**\n\t * @private\n\t */\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n\n for (i = props.length - 1; i >= 0; --i) {\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n\n if (animation) {\n if (cfg && animation.active()) {\n // There is an existing active animation, let's update that\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n // not animated, set directly to new value\n target[prop] = value;\n continue;\n }\n\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n\n\n /**\n\t * Update `target` properties to new values, using configured animations\n\t * @param {object} target - object to update\n\t * @param {object} values - new target properties\n\t * @returns {boolean|undefined} - `true` if animations were started\n\t **/\n update(target, values) {\n if (this._properties.size === 0) {\n // Nothing is animated, just apply the new values.\n Object.assign(target, values);\n return;\n }\n\n const animations = this._createAnimations(target, values);\n\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\n\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for (let i = 0; i < keys.length; i++) {\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n // @ts-ignore\n return Promise.all(running);\n}\n\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n // Going from shared options to distinct one:\n // Create new options object containing the old shared values and start updating that.\n target.options = options = Object.assign({}, options, {$shared: false, $animations: {}});\n }\n return options;\n}\n","import Animations from './core.animations.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isFinite, isObject, valueOrDefault, resolveObjectKey, defined} from '../helpers/helpers.core.js';\nimport {listenArrayEvents, unlistenArrayEvents} from '../helpers/helpers.collection.js';\nimport {createContext, sign} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('./core.scale.js').default } Scale\n */\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\n\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\n\nfunction toClip(value) {\n let t, r, b, l;\n\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\n\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n keys.push(metasets[i].index);\n }\n return keys;\n}\n\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n\n if (value === null) {\n return;\n }\n\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) {\n value += otherValue;\n }\n }\n return value;\n}\n\nfunction convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\n\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || (stacked === undefined && meta.stack !== undefined);\n}\n\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\n\nfunction getUserBounds(scale) {\n const {min, max, minDefined, maxDefined} = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\n\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\n\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {\n const value = stack[meta.index];\n if ((positive && value > 0) || (!positive && value < 0)) {\n return meta.index;\n }\n }\n\n return null;\n}\n\nfunction updateStacks(controller, parsed) {\n const {chart, _cachedMeta: meta} = controller;\n const stacks = chart._stacks || (chart._stacks = {}); // map structure is {stackKey: {datasetIndex: value}}\n const {iScale, vScale, index: datasetIndex} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n\n for (let i = 0; i < ilen; ++i) {\n const item = parsed[i];\n const {[iAxis]: index, [vAxis]: value} = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\n\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter(key => scales[key].axis === axis).shift();\n}\n\nfunction createDatasetContext(parent, index) {\n return createContext(parent,\n {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n }\n );\n}\n\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\n\nfunction clearStacks(meta, items) {\n // Not using meta.index here, because it might be already updated if the dataset changed location\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n\n items = items || meta._parsed;\n for (const parsed of items) {\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n delete stacks[axis]._visualValues[datasetIndex];\n }\n }\n}\n\nconst isDirectUpdateMode = (mode) => mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked\n && {keys: getSortedDatasetIndices(chart, true), values: null};\n\nexport default class DatasetController {\n\n /**\n * @type {any}\n */\n static defaults = {};\n\n /**\n * Element type used to generate a meta dataset (e.g. Chart.element.LineElement).\n */\n static datasetElementType = null;\n\n /**\n * Element type used to generate a meta data (e.g. Chart.element.PointElement).\n */\n static dataElementType = null;\n\n /**\n\t * @param {Chart} chart\n\t * @param {number} datasetIndex\n\t */\n constructor(chart, datasetIndex) {\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n /** @type {boolean | object} */\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n\n this.initialize();\n }\n\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n 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\");\n }\n }\n\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n\n const chooseId = (axis, x, y, r) => axis === 'x' ? x : axis === 'r' ? r : y;\n\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n\n /**\n\t * @param {string} scaleID\n\t * @return {Scale}\n\t */\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n\n /**\n\t * @private\n\t */\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale\n ? meta.vScale\n : meta.iScale;\n }\n\n reset() {\n this._update('reset');\n }\n\n /**\n\t * @private\n\t */\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n\n /**\n\t * @private\n\t */\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n\n // In order to correctly handle data addition/deletion animation (and thus simulate\n // real-time charts), we need to monitor these data modifications and synchronize\n // the internal metadata accordingly.\n\n if (isObject(data)) {\n this._data = convertObjectDataToArray(data);\n } else if (_data !== data) {\n if (_data) {\n // This case happens when the user replaced the data array instance.\n unlistenArrayEvents(_data, this);\n // Discard old parsed data and stacks\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n\n addElements() {\n const meta = this._cachedMeta;\n\n this._dataCheck();\n\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n\n this._dataCheck();\n\n // make sure cached _stacked status is current\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n\n // detect change in stack option\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n // remove values from old stack\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n\n // Re-sync meta data in case the user replaced the data array or if we missed\n // any updates and so make sure that we handle number of datapoints changing.\n this._resyncElements(resetNewElements);\n\n // if stack changed, update stack values for the whole dataset\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n }\n }\n\n /**\n\t * Merges user-supplied and default dataset-level options\n\t * @private\n\t */\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n\n /**\n\t * @param {number} start\n\t * @param {number} count\n\t */\n parse(start, count) {\n const {_cachedMeta: meta, _data: data} = this;\n const {iScale, _stacked} = meta;\n const iAxis = iScale.axis;\n\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n\n const isNotInOrderComparedToPrev = () => cur[iAxis] === null || (prev && cur[iAxis] < prev[iAxis]);\n for (i = 0; i < count; ++i) {\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n\n /**\n\t * Parse array of primitive values\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [1,3,4]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {xScale0: 0, yScale0: 1}\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [[1,2],[3,4]]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {x: 0, y: 1}\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [{x:1, y:5}, {x:2, y:10}]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id. _custom is optional\n\t * Example: {xScale0: 0, yScale0: 1, _custom: {r: 10, foo: 'bar'}}\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n\n /**\n\t * @protected\n\t */\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n\n /**\n\t * @protected\n\t */\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return applyStack(stack, value, meta.index, {mode});\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n\n /**\n\t * @protected\n\t */\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n const {min: otherMin, max: otherMax} = getUserBounds(otherScale);\n let i, parsed;\n\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n\n for (i = 0; i < ilen; ++i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n // if the data is sorted, we don't need to check further from this end of array\n break;\n }\n }\n if (sorted) {\n // in the sorted case, find first non-skipped value from other end of array\n for (i = ilen - 1; i >= 0; --i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n\n for (i = 0, ilen = parsed.length; i < ilen; ++i) {\n value = parsed[i][scale.axis];\n if (isFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return false;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n\n /**\n\t * @private\n\t */\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {} // eslint-disable-line no-unused-vars\n\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || (elements.length - start);\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n\n for (i = start; i < start + count; ++i) {\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n\n for (i = 0; i < active.length; ++i) {\n active[i].draw(ctx, area);\n }\n }\n\n /**\n\t * Returns a set of predefined style properties that should be used to represent the dataset\n\t * or the data if the index is specified\n\t * @param {number} index - data index\n\t * @param {boolean} [active] - true if hover\n\t * @return {object} style object\n\t */\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset\n ? this.resolveDatasetElementOptions(mode)\n : this.resolveDataElementOptions(index || 0, mode);\n }\n\n /**\n\t * @protected\n\t */\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context ||\n (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context ||\n (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n\n /**\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n\n /**\n\t * @private\n\t */\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [`${elementType}Hover`, 'hover', elementType, ''] : [elementType, ''];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n // context is provided as a function, and is called only if needed,\n // so we don't create a context for each element if not needed.\n const context = () => this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n\n if (values.$shared) {\n // `$shared` indicates this set of options can be shared between multiple elements.\n // Sharing is used to reduce number of properties to change during animation.\n values.$shared = sharing;\n\n // We cache options by `mode`, which can be 'active' for example. This enables us\n // to have the 'active' element options and 'default' options to switch between\n // when interacting.\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n\n return values;\n }\n\n\n /**\n\t * @private\n\t */\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n\n /**\n\t * Utility for getting the options object shared between elements\n\t * @protected\n\t */\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n\n /**\n\t * Utility for determining if `options` should be included in the updated properties\n\t * @protected\n\t */\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n\n /**\n * @todo v4, rename to getSharedOptions and remove excess functions\n */\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || (sharedOptions !== previouslySharedOptions);\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {sharedOptions, includeOptions};\n }\n\n /**\n\t * Utility for updating an element with new properties, using animations when appropriate.\n\t * @protected\n\t */\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n\n /**\n\t * Utility to animate the shared options, that are potentially affecting multiple elements.\n\t * @protected\n\t */\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n\n /**\n\t * @private\n\t */\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n // When going from active to inactive, we need to update to the shared options.\n // This way the once hovered element will end up with the same original shared options instance, after animation.\n options: (!active && this.getSharedOptions(options)) || options\n });\n }\n\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n\n /**\n\t * @private\n\t */\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n\n /**\n\t * @private\n\t */\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n\n /**\n\t * @private\n\t */\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n\n // Apply changes detected through array listeners\n for (const [method, arg1, arg2] of this._syncList) {\n this[method](arg1, arg2);\n }\n this._syncList = [];\n\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n\n if (count) {\n // TODO: It is not optimal to always parse the old data\n // This is done because we are not detecting direct assignments:\n // chart.data.datasets[0].data[5] = 10;\n // chart.data.datasets[0].data[5].y = 10;\n this.parse(0, count);\n }\n\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n\n /**\n\t * @private\n\t */\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n\n const move = (arr) => {\n arr.length += count;\n for (i = arr.length - 1; i >= end; i--) {\n arr[i] = arr[i - count];\n }\n };\n move(data);\n\n for (i = start; i < end; ++i) {\n data[i] = new this.dataElementType();\n }\n\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n\n updateElements(element, start, count, mode) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @private\n\t */\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n\n /**\n\t * @private\n */\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([this.index, ...args]);\n }\n\n _onDataPush() {\n const count = arguments.length;\n this._sync(['_insertElements', this.getDataset().data.length - count, count]);\n }\n\n _onDataPop() {\n this._sync(['_removeElements', this._cachedMeta.data.length - 1, 1]);\n }\n\n _onDataShift() {\n this._sync(['_removeElements', 0, 1]);\n }\n\n _onDataSplice(start, count) {\n if (count) {\n this._sync(['_removeElements', start, count]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync(['_insertElements', start, newCount]);\n }\n }\n\n _onDataUnshift() {\n this._sync(['_insertElements', 0, arguments.length]);\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {\n _arrayUnique, isArray, isNullOrUndef,\n valueOrDefault, resolveObjectKey, sign, defined\n} from '../helpers/index.js';\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n\n for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));\n }\n return scale._cache.$bar;\n}\n\n/**\n * Computes the \"optimal\" sample size to maintain bars equally sized while preventing overlap.\n * @private\n */\nfunction computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = () => {\n if (curr === 32767 || curr === -32768) {\n // Ignore truncated pixels\n return;\n }\n if (defined(prev)) {\n // curr - prev === 0 is ignored\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n\n for (i = 0, ilen = values.length; i < ilen; ++i) {\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n\n prev = undefined;\n for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) {\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n\n return min;\n}\n\n/**\n * Computes an \"ideal\" category based on the absolute bar thickness or, if undefined or null,\n * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This\n * mode currently always generates bars equally sized (until we introduce scriptable options?).\n * @private\n */\nfunction computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n // When bar thickness is enforced, category and bar percentages are ignored.\n // Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n // and deprecate barPercentage since this value is ignored when thickness is absolute.\n size = thickness * stackCount;\n ratio = 1;\n }\n\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - (size / 2)\n };\n}\n\n/**\n * Computes an \"optimal\" category that globally arranges bars side by side (no gap when\n * percentage options are 1), based on the previous and following categories. This mode\n * generates bars with different widths when data are not evenly spaced.\n * @private\n */\nfunction computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n\n if (prev === null) {\n // first data: its size is double based on the next point or,\n // if it's also the last data, we use the scale size.\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n\n if (next === null) {\n // last data: its size is also double based on the previous point.\n next = curr + curr - prev;\n }\n\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\n\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n\n // Store `barEnd` (furthest away from origin) as parsed value,\n // to make stacking straight forward\n item[vScale.axis] = barEnd;\n\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\n\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\n\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n\n for (i = start, ilen = start + count; i < ilen; ++i) {\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\n\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\n\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\n\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {start, end, reverse, top, bottom};\n}\n\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n\n if (edge === true) {\n properties.borderSkipped = {top: true, right: true, bottom: true, left: true};\n return;\n }\n\n const {start, end, reverse, top, bottom} = borderProps(properties);\n\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\n\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\n\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\n\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\n\nfunction setInflateAmount(properties, {inflateAmount}, ratio) {\n properties.inflateAmount = inflateAmount === 'auto'\n ? ratio === 1 ? 0.33 : 0\n : inflateAmount;\n}\n\nexport default class BarController extends DatasetController {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'base', 'width', 'height']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true,\n }\n }\n };\n\n\n /**\n\t * Overriding primitive data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding array data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding object data parsing since we support mixed primitive/array\n\t * value-scale data for float bars\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n // float bar: only one end of the bar is considered by `super`\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const {iScale, vScale} = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom)\n ? '[' + custom.start + ', ' + custom.end + ']'\n : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n\n initialize() {\n this.enableOptionSharing = true;\n\n super.initialize();\n\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const {index, _cachedMeta: {vScale}} = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n\n for (let i = start; i < start + count; i++) {\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {base, head: base} : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index === stack._top || index === stack._bottom),\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n\n /**\n\t * Returns the stacks based on groups and bar visibility.\n\t * @param {number} [last] - The dataset index\n\t * @param {number} [dataIndex] - The data index of the ruler\n\t * @returns {string[]} The list of stack IDs\n\t * @private\n\t */\n _getStacks(last, dataIndex) {\n const {iScale} = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type)\n .filter(meta => meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n\n const skipNull = (meta) => {\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n\n for (const meta of metasets) {\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n\n // stacked | meta.stack\n // | found | not found | undefined\n // false | x | x | x\n // true | | x |\n // undefined | | x | x\n if (stacked === false || stacks.indexOf(meta.stack) === -1 ||\n\t\t\t\t(stacked === undefined && meta.stack === undefined)) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n\n // No stacks? that means there is no visible data. Let's still initialize an `undefined`\n // stack where possible invisible bars will be located.\n // https://github.com/chartjs/Chart.js/issues/6368\n if (!stacks.length) {\n stacks.push(undefined);\n }\n\n return stacks;\n }\n\n /**\n\t * Returns the effective number of stacks based on groups and bar visibility.\n\t * @private\n\t */\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n\n /**\n\t * Returns the stack index for the given dataset based on groups and bar visibility.\n\t * @param {number} [datasetIndex] - The dataset index\n\t * @param {string} [name] - The stack name to find\n * @param {number} [dataIndex]\n\t * @returns {number} The stack index\n\t * @private\n\t */\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = (name !== undefined)\n ? stacks.indexOf(name)\n : -1; // indexOf returns -1 if element is not present\n\n return (index === -1)\n ? stacks.length - 1\n : index;\n }\n\n /**\n\t * @private\n\t */\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n\n for (i = 0, ilen = meta.data.length; i < ilen; ++i) {\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n // bar thickness ratio used for non-grouped bars\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n\n /**\n\t * Note: pixel values are not clamped to the scale area.\n\t * @private\n\t */\n _calculateBarValuePixels(index) {\n const {_cachedMeta: {vScale, _stacked, index: datasetIndex}, options: {base: baseValue, minBarLength}} = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n\n if (length !== value) {\n start = length - value;\n length = value;\n }\n\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n // bars crossing origin are not stacked\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n // When not visible, no height\n head = base;\n }\n\n size = head - base;\n\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n\n if (_stacked && !floating) {\n // visual data coordinates after applying minBarLength\n parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n }\n\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n\n /**\n\t * @private\n\t */\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex'\n ? computeFlexCategoryTraits(index, ruler, options, stackCount)\n : computeFitCategoryTraits(index, ruler, options, stackCount);\n\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n // For non-grouped bar charts, exact pixel values are used\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n\n for (; i < ilen; ++i) {\n if (this.getParsed(i)[vScale.axis] !== null) {\n rects[i].draw(this._ctx);\n }\n }\n }\n\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {valueOrDefault} from '../helpers/helpers.core.js';\n\nexport default class BubbleController extends DatasetController {\n\n static id = 'bubble';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'borderWidth', 'radius']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n\n /**\n\t * Parse array of primitive values\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n\n update(mode) {\n const points = this._cachedMeta.data;\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n\n if (reset) {\n properties.options.radius = 0;\n }\n }\n\n this.updateElement(point, i, properties, mode);\n }\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n\n // In case values were cached (and thus frozen), we need to clone the values\n if (values.$shared) {\n values = Object.assign({}, values, {$shared: false});\n }\n\n // Custom radius resolution\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n\n return values;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isObject, resolveObjectKey, toPercentage, toDimension, valueOrDefault} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {toRadians, PI, TAU, HALF_PI, _angleBetween} from '../helpers/helpers.math.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n // If the chart's circumference isn't a full circle, calculate size as a ratio of the width/height of the arc\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {ratioX, ratioY, offsetX, offsetY};\n}\n\nexport default class DoughnutController extends DatasetController {\n\n static id = 'doughnut';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n // Boolean - Whether we animate the rotation of the Doughnut\n animateRotate: true,\n // Boolean - Whether we animate scaling the Doughnut from the centre\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['circumference', 'endAngle', 'innerRadius', 'outerRadius', 'startAngle', 'x', 'y', 'offset', 'borderWidth', 'spacing']\n },\n },\n // The percentage of the chart that we cut out of the middle.\n cutout: '50%',\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%',\n\n // Spacing between arcs\n spacing: 0,\n\n indexAxis: 'r',\n };\n\n static descriptors = {\n _scriptable: (name) => name !== 'spacing',\n _indexable: (name) => name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash'),\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n // Need to override these to give a nice default\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n\n linkScales() {}\n\n /**\n\t * Override data parsing, since we are not using scales\n\t */\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i) => +data[i];\n\n if (isObject(data[start])) {\n const {key = 'value'} = this._parsing;\n getter = (i) => +resolveObjectKey(data[i], key);\n }\n\n let i, ilen;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n meta._parsed[i] = getter(i);\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n\n /**\n\t * @private\n\t */\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n\n /**\n\t * Get the maximal rotation & circumference extents\n\t * across all visible datasets.\n\t */\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n\n for (let i = 0; i < this.chart.data.datasets.length; ++i) {\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n\n return {\n rotation: min,\n circumference: max - min,\n };\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {\n const chart = this.chart;\n const {chartArea} = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n\n // Compute the maximal rotation & circumference limits.\n // If we only consider our dataset, this can cause problems when two datasets\n // are both less than a circle with different rotations (starting angles)\n const {circumference, rotation} = this._getRotationExtents();\n const {ratioX, ratioY, offsetX, offsetY} = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n\n meta.total = this.calculateTotal();\n\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @private\n */\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if ((reset && opts.animation.animateRotate) || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n\n for (i = 0; i < start; ++i) {\n startAngle += this._circumference(i, reset);\n }\n\n for (i = start; i < start + count; ++i) {\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n\n for (i = 0; i < metaData.length; i++) {\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n\n return total;\n }\n\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n\n if (!arcs) {\n // Find the outmost visible dataset\n for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n\n if (!arcs) {\n return 0;\n }\n\n for (i = 0, ilen = arcs.length; i < ilen; ++i) {\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n\n getMaxOffset(arcs) {\n let max = 0;\n\n for (let i = 0, ilen = arcs.length; i < ilen; ++i) {\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n\n /**\n\t * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly\n\t * @private\n\t */\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n\n for (let i = 0; i < datasetIndex; ++i) {\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n\n return ringWeightOffset;\n }\n\n /**\n\t * @private\n\t */\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n\n /**\n\t * Returns the sum of all visible data set weights.\n\t * @private\n\t */\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class LineController extends DatasetController {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n\n showLine: true,\n spanGaps: false,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n },\n _value_: {\n type: 'linear',\n },\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {dataset: line, data: points = [], _dataset} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = 0; i < pointsCount; ++i) {\n const point = points[i];\n const properties = directUpdate ? point : {};\n\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {toRadians, PI, formatNumber, _parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class PolarAreaController extends DatasetController {\n\n static id = 'polarArea';\n\n /**\n * @type {any}\n */\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'startAngle', 'endAngle', 'innerRadius', 'outerRadius']\n },\n },\n indexAxis: 'r',\n startAngle: 0,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const arcs = this._cachedMeta.data;\n\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @protected\n */\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n\n meta.data.forEach((element, index) => {\n const parsed = this.getParsed(index).r;\n\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n\n return range;\n }\n\n /**\n\t * @private\n\t */\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? (outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n\n this.outerRadius = outerRadius - (radiusLength * this.index);\n this.innerRadius = this.outerRadius - radiusLength;\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n\n const defaultAngle = 360 / this.countVisibleElements();\n\n for (i = 0; i < start; ++i) {\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for (i = start; i < start + count; i++) {\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n\n meta.data.forEach((element, index) => {\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n\n return count;\n }\n\n /**\n\t * @private\n\t */\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index)\n ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle)\n : 0;\n }\n}\n","import DoughnutController from './controller.doughnut.js';\n\n// Pie charts are Doughnut chart with different defaults\nexport default class PieController extends DoughnutController {\n\n static id = 'pie';\n\n /**\n * @type {any}\n */\n static defaults = {\n // The percentage of the chart that we cut out of the middle.\n cutout: 0,\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%'\n };\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {_parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class RadarController extends DatasetController {\n\n static id = 'radar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n },\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n scales: {\n r: {\n type: 'radialLinear',\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n\n // Update Line\n line.points = points;\n // In resize mode only point locations change, so no need to set the points or options.\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n\n this.updateElement(line, undefined, properties, mode);\n }\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class ScatterController extends DatasetController {\n\n static id = 'scatter';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n\n interaction: {\n mode: 'point'\n },\n\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {data: points = []} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n if (this.options.showLine) {\n\n // https://github.com/chartjs/Chart.js/issues/11333\n if (!this.datasetElementType) {\n this.addElements();\n }\n const {dataset: line, _dataset} = meta;\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n } else if (this.datasetElementType) {\n // https://github.com/chartjs/Chart.js/issues/11333\n delete meta.dataset;\n this.datasetElementType = false;\n }\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n addElements() {\n const {showLine} = this.options;\n\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n\n super.addElements();\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = start; i < start + count; ++i) {\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n\n if (!this.options.showLine) {\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n\n if (!data.length) {\n return border;\n }\n\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n","/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartOptions} from '../types/index.js';\n\nexport type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';\n\nexport interface DateAdapter {\n readonly options: T;\n /**\n * Will called with chart options after adapter creation.\n */\n init(this: DateAdapter, chartOptions: ChartOptions): void;\n /**\n * Returns a map of time formats for the supported formatting units defined\n * in Unit as well as 'datetime' representing a detailed date/time string.\n */\n formats(this: DateAdapter): Record;\n /**\n * Parses the given `value` and return the associated timestamp.\n * @param value - the value to parse (usually comes from the data)\n * @param [format] - the expected data format\n */\n parse(this: DateAdapter, value: unknown, format?: TimeUnit): number | null;\n /**\n * Returns the formatted date in the specified `format` for a given `timestamp`.\n * @param timestamp - the timestamp to format\n * @param format - the date/time token\n */\n format(this: DateAdapter, timestamp: number, format: TimeUnit): string;\n /**\n * Adds the specified `amount` of `unit` to the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param amount - the amount to add\n * @param unit - the unit as string\n */\n add(this: DateAdapter, timestamp: number, amount: number, unit: TimeUnit): number;\n /**\n * Returns the number of `unit` between the given timestamps.\n * @param a - the input timestamp (reference)\n * @param b - the timestamp to subtract\n * @param unit - the unit as string\n */\n diff(this: DateAdapter, a: number, b: number, unit: TimeUnit): number;\n /**\n * Returns start of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n * @param [weekday] - the ISO day of the week with 1 being Monday\n * and 7 being Sunday (only needed if param *unit* is `isoWeek`).\n */\n startOf(this: DateAdapter, timestamp: number, unit: TimeUnit | 'isoWeek', weekday?: number): number;\n /**\n * Returns end of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n */\n endOf(this: DateAdapter, timestamp: number, unit: TimeUnit | 'isoWeek'): number;\n}\n\nfunction abstract(): T {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */\nclass DateAdapterBase implements DateAdapter {\n\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */\n static override(\n members: Partial, 'options'>>\n ) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n\n readonly options: AnyObject;\n\n constructor(options: AnyObject) {\n this.options = options || {};\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n\n formats(): Record {\n return abstract();\n }\n\n parse(): number | null {\n return abstract();\n }\n\n format(): string {\n return abstract();\n }\n\n add(): number {\n return abstract();\n }\n\n diff(): number {\n return abstract();\n }\n\n startOf(): number {\n return abstract();\n }\n\n endOf(): number {\n return abstract();\n }\n}\n\nexport default {\n _date: DateAdapterBase\n};\n","import {_lookupByKey, _rlookupByKey} from '../helpers/helpers.collection.js';\nimport {getRelativePosition} from '../helpers/helpers.dom.js';\nimport {_angleBetween, getAngleFromPoint} from '../helpers/helpers.math.js';\nimport {_isPointInArea} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef {{axis?: string, intersect?: boolean, includeInvisible?: boolean}} InteractionOptions\n * @typedef {{datasetIndex: number, index: number, element: import('./core.element.js').default}} InteractionItem\n * @typedef { import('../types/index.js').Point } Point\n */\n\n/**\n * Helper function to do binary search when possible\n * @param {object} metaset - the dataset meta\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {number} value - the value to find\n * @param {boolean} [intersect] - should the element intersect\n * @returns {{lo:number, hi:number}} indices to search data array between\n */\nfunction binarySearch(metaset, axis, value, intersect) {\n const {controller, data, _sorted} = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n // _sharedOptions indicates that each element has equal options -> equal proportions\n // So we can do a ranged binary search based on the range of first element and\n // be confident to get the full range of indices that can intersect with the value.\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {lo: start.lo, hi: end.hi};\n }\n }\n }\n // Default to all elements, when binary search can not be used.\n return {lo: 0, hi: data.length - 1};\n}\n\n/**\n * Helper function to select candidate elements for interaction\n * @param {Chart} chart - the chart\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {function} handler - the callback to execute for each visible item\n * @param {boolean} [intersect] - consider intersecting items\n */\nfunction evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for (let i = 0, ilen = metasets.length; i < ilen; ++i) {\n const {index, data} = metasets[i];\n const {lo, hi} = binarySearch(metasets[i], axis, value, intersect);\n for (let j = lo; j <= hi; ++j) {\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n\n/**\n * Get a distance metric function for two points based on the\n * axis mode setting\n * @param {string} axis - the axis mode. x|y|xy|r\n */\nfunction getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n\n/**\n * Helper function to get the items that intersect the event position\n * @param {Chart} chart - the chart\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({element, datasetIndex, index});\n }\n };\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a radial chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n\n function evaluationFunc(element, datasetIndex, index) {\n const {startAngle, endAngle} = element.getProps(['startAngle', 'endAngle'], useFinalPosition);\n const {angle} = getAngleFromPoint(element, {x: position.x, y: position.y});\n\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a cartesian chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [{element, datasetIndex, index}];\n minDistance = distance;\n } else if (distance === minDistance) {\n // Can have multiple items at the same distance in which case we sort by size\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position considering all visible items in the chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n\n return axis === 'r' && !intersect\n ? getNearestRadialItems(chart, position, axis, useFinalPosition)\n : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n\n/**\n * Helper function to get the items matching along the given X or Y axis\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis to match\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index) => {\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({element, datasetIndex, index});\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n\n // If we want to trigger on an intersect and we don't have any items\n // that intersect the position, return nothing\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n\n/**\n * Contains interaction related functions\n * @namespace Chart.Interaction\n */\nexport default {\n // Part of the public API to facilitate developers creating their own modes\n evaluateInteractionItems,\n\n // Helper function for different modes\n modes: {\n /**\n\t\t * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\n\t\t * @function Chart.Interaction.modes.index\n\t\t * @since v2.4.0\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n index(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n // Default axis for index mode is 'x' to match old behaviour\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible)\n : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n\n if (!items.length) {\n return [];\n }\n\n chart.getSortedVisibleDatasetMetas().forEach((meta) => {\n const index = items[0].index;\n const element = meta.data[index];\n\n // don't count items that are skipped (null data)\n if (element && !element.skip) {\n elements.push({element, datasetIndex: meta.index, index});\n }\n });\n\n return elements;\n },\n\n /**\n\t\t * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect is false, we find the nearest item and return the items in that dataset\n\t\t * @function Chart.Interaction.modes.dataset\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n dataset(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) :\n getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for (let i = 0; i < data.length; ++i) {\n items.push({element: data[i], datasetIndex, index: i});\n }\n }\n\n return items;\n },\n\n /**\n\t\t * Point mode returns all elements that hit test based on the event position\n\t\t * of the event\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n point(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * nearest mode returns the element closest to the point\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n nearest(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * x mode returns the elements that hit-test at the current x coordinate\n\t\t * @function Chart.Interaction.modes.x\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n x(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n\n /**\n\t\t * y mode returns the elements that hit-test at the current y coordinate\n\t\t * @function Chart.Interaction.modes.y\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n y(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n","import {defined, each, isObject} from '../helpers/helpers.core.js';\nimport {toPadding} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n */\n\nconst STATIC_POSITIONS = ['left', 'top', 'right', 'bottom'];\n\nfunction filterByPosition(array, position) {\n return array.filter(v => v.pos === position);\n}\n\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter(v => STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\n\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b) => {\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ?\n v0.index - v1.index :\n v0.weight - v1.weight;\n });\n}\n\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n\n for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\n box = boxes[i];\n ({position: pos, options: {stack, stackWeight = 1}} = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && (pos + stack),\n stackWeight\n });\n }\n return layoutBoxes;\n}\n\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts) {\n const {stack, pos, stackWeight} = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {count: 0, placed: 0, weight: 0, size: 0});\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n\n/**\n * store dimensions used instead of available chartArea in fitBoxes\n **/\nfunction setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const {vBoxMaxWidth, hBoxMaxHeight} = params;\n let i, ilen, layout;\n for (i = 0, ilen = layouts.length; i < ilen; ++i) {\n layout = layouts[i];\n const {fullSize} = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\n\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter(wrap => wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\n\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\n\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\n\nfunction updateDims(chartArea, params, layout, stacks) {\n const {pos, box} = layout;\n const maxPadding = chartArea.maxPadding;\n\n // dynamically placed boxes size is not considered\n if (!isObject(pos)) {\n if (layout.size) {\n // this layout was already counted for, lets first reduce old size\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {size: 0, count: 1};\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n\n // return booleans on the changes per direction\n return layout.horizontal\n ? {same: widthChanged, other: heightChanged}\n : {same: heightChanged, other: widthChanged};\n}\n\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\n\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function marginForPositions(positions) {\n const margin = {left: 0, top: 0, right: 0, bottom: 0};\n positions.forEach((pos) => {\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n\n return horizontal\n ? marginForPositions(['left', 'right'])\n : marginForPositions(['top', 'bottom']);\n}\n\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n\n for (i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i) {\n layout = boxes[i];\n box = layout.box;\n\n box.update(\n layout.width || chartArea.w,\n layout.height || chartArea.h,\n getMargins(layout.horizontal, chartArea)\n );\n const {same, other} = updateDims(chartArea, params, layout, stacks);\n\n // Dimensions changed and there were non full width boxes before this\n // -> we have to refit those\n refit |= same && refitBoxes.length;\n\n // Chart area changed in the opposite direction\n changed = changed || other;\n\n if (!box.fullSize) { // fullSize boxes don't need to be re-fitted in any case\n refitBoxes.push(layout);\n }\n }\n\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\n\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\n\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let {x, y} = chartArea;\n\n for (const layout of boxes) {\n const box = layout.box;\n const stack = stacks[layout.stack] || {count: 1, placed: 0, weight: 1};\n const weight = (layout.stackWeight / stack.weight) || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n\n chartArea.x = x;\n chartArea.y = y;\n}\n\n/**\n * @interface LayoutItem\n * @typedef {object} LayoutItem\n * @prop {string} position - The position of the item in the chart layout. Possible values are\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\n * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area\n * @prop {boolean} fullSize - if true, and the item is horizontal, then push vertical boxes down\n * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\n * @prop {function} update - Takes two parameters: width and height. Returns size of item\n * @prop {function} draw - Draws the element\n * @prop {function} [getPadding] - Returns an object with padding on the edges\n * @prop {number} width - Width of item. Must be valid after update()\n * @prop {number} height - Height of item. Must be valid after update()\n * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update\n * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update\n * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update\n * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\n */\n\n// The layout service is very self explanatory. It's responsible for the layout within a chart.\n// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\n// It is this service's responsibility of carrying out that layout.\nexport default {\n\n /**\n\t * Register a box to a chart.\n\t * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\n\t * @param {Chart} chart - the chart to use\n\t * @param {LayoutItem} item - the item to add to be laid out\n\t */\n addBox(chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n\n // initialize item with default values\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n // @ts-ignore\n item._layers = item._layers || function() {\n return [{\n z: 0,\n draw(chartArea) {\n item.draw(chartArea);\n }\n }];\n };\n\n chart.boxes.push(item);\n },\n\n /**\n\t * Remove a layoutItem from a chart\n\t * @param {Chart} chart - the chart to remove the box from\n\t * @param {LayoutItem} layoutItem - the item to remove from the layout\n\t */\n removeBox(chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n\n /**\n\t * Sets (or updates) options on the given `item`.\n\t * @param {Chart} chart - the chart in which the item lives (or will be added to)\n\t * @param {LayoutItem} item - the item to configure with the given options\n\t * @param {object} options - the new item options.\n\t */\n configure(chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n\n /**\n\t * Fits boxes of the given chart into the given size by having each box measure itself\n\t * then running a fitting algorithm\n\t * @param {Chart} chart - the chart\n\t * @param {number} width - the width to fit into\n\t * @param {number} height - the height to fit into\n * @param {number} minPadding - minimum padding required for each side of chart area\n\t */\n update(chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n\n // Before any changes are made, notify boxes that an update is about to being\n // This is used to clear any cached data (e.g. scale limits)\n each(chart.boxes, box => {\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n\n // Essentially we now have any number of boxes on each of the 4 sides.\n // Our canvas looks like the following.\n // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\n // B1 is the bottom axis\n // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\n // These locations are single-box locations only, when trying to register a chartArea location that is already taken,\n // an error will be thrown.\n //\n // |----------------------------------------------------|\n // | T1 (Full Width) |\n // |----------------------------------------------------|\n // | | | T2 | |\n // | |----|-------------------------------------|----|\n // | | | C1 | | C2 | |\n // | | |----| |----| |\n // | | | | |\n // | L1 | L2 | ChartArea (C0) | R1 |\n // | | | | |\n // | | |----| |----| |\n // | | | C3 | | C4 | |\n // | |----|-------------------------------------|----|\n // | | | B1 | |\n // |----------------------------------------------------|\n // | B2 (Full Width) |\n // |----------------------------------------------------|\n //\n\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>\n wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n\n // First fit the fullSize boxes, to reduce probability of re-fitting.\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n\n // Then fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n\n // Then fit horizontal boxes\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n // if the area changed, re-fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n\n handleMaxPadding(chartArea);\n\n // Finally place the boxes to correct coordinates\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n\n // Move to opposite side of chart\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w,\n };\n\n // Finally update boxes in chartArea (radial scale for example)\n each(boxes.chartArea, (layout) => {\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {left: 0, top: 0, right: 0, bottom: 0});\n });\n }\n};\n","\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\n/**\n * Abstract class that allows abstracting platform dependencies away from the chart.\n */\nexport default class BasePlatform {\n /**\n\t * Called at chart construction time, returns a context2d instance implementing\n\t * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.\n\t * @param {HTMLCanvasElement} canvas - The canvas from which to acquire context (platform specific)\n\t * @param {number} [aspectRatio] - The chart options\n\t */\n acquireContext(canvas, aspectRatio) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Called at chart destruction time, releases any resources associated to the context\n\t * previously returned by the acquireContext() method.\n\t * @param {CanvasRenderingContext2D} context - The context2d instance\n\t * @returns {boolean} true if the method succeeded, else false\n\t */\n releaseContext(context) { // eslint-disable-line no-unused-vars\n return false;\n }\n\n /**\n\t * Registers the specified listener on the given chart.\n\t * @param {Chart} chart - Chart from which to listen for event\n\t * @param {string} type - The ({@link ChartEvent}) type to listen for\n\t * @param {function} listener - Receives a notification (an object that implements\n\t * the {@link ChartEvent} interface) when an event of the specified type occurs.\n\t */\n addEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Removes the specified listener previously registered with addEventListener.\n\t * @param {Chart} chart - Chart from which to remove the listener\n\t * @param {string} type - The ({@link ChartEvent}) type to remove\n\t * @param {function} listener - The listener function to remove from the event target.\n\t */\n removeEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @returns {number} the current devicePixelRatio of the device this platform is connected to.\n\t */\n getDevicePixelRatio() {\n return 1;\n }\n\n /**\n\t * Returns the maximum size in pixels of given canvas element.\n\t * @param {HTMLCanvasElement} element\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @returns {boolean} true if the canvas is attached to the platform, false if not.\n\t */\n isAttached(canvas) { // eslint-disable-line no-unused-vars\n return true;\n }\n\n /**\n * Updates config with platform specific requirements\n * @param {import('../core/core.config.js').default} config\n */\n updateConfig(config) { // eslint-disable-line no-unused-vars\n // no-op\n }\n}\n","/**\n * Platform fallback implementation (minimal).\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\n */\n\nimport BasePlatform from './platform.base.js';\n\n/**\n * Platform class for charts without access to the DOM or to many element properties\n * This platform is used by default for any chart passed an OffscreenCanvas.\n * @extends BasePlatform\n */\nexport default class BasicPlatform extends BasePlatform {\n acquireContext(item) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n","/**\n * Chart.Platform implementation for targeting a web browser\n */\n\nimport BasePlatform from './platform.base.js';\nimport {_getParentNode, getRelativePosition, supportsEventListenerOptions, readUsedSize, getMaximumSize} from '../helpers/helpers.dom.js';\nimport {throttled} from '../helpers/helpers.extras.js';\nimport {isNullOrUndef} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nconst EXPANDO_KEY = '$chartjs';\n\n/**\n * DOM event types -> Chart.js event types.\n * Note: only events with different types are mapped.\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\n */\nconst EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\n\nconst isNullOrEmpty = value => value === null || value === '';\n/**\n * Initializes the canvas style and render size without modifying the canvas display size,\n * since responsiveness is handled by the controller.resize() method. The config is used\n * to determine the aspect ratio to apply in case no explicit height has been specified.\n * @param {HTMLCanvasElement} canvas\n * @param {number} [aspectRatio]\n */\nfunction initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n\n // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\n // returns null or '' if no explicit value has been set to the canvas attribute.\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n\n // Chart.js modifies some canvas values that we want to restore on destroy\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n\n // Force canvas to display as block to avoid extra space caused by inline\n // elements, which would interfere with the responsive resize process.\n // https://github.com/chartjs/Chart.js/issues/2538\n style.display = style.display || 'block';\n // Include possible borders in the size\n style.boxSizing = style.boxSizing || 'border-box';\n\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n // If no explicit render height and style height, let's apply the aspect ratio,\n // which one can be specified by the user but also by charts as default option\n // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n\n return canvas;\n}\n\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\n// https://github.com/chartjs/Chart.js/issues/4287\nconst eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\n\nfunction addListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n}\n\nfunction removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\n\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const {x, y} = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null,\n };\n}\n\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList) {\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\n\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\n\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart) => {\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\n\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\n\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\n\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height) => {\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n // If the container size shrank during chart resize, let's assume\n // scrollbar appeared. So we resize again with the scrollbar visible -\n // effectively making chart smaller and the scrollbar hidden again.\n // Because we are inside `throttled`, and currently `ticking`, scroll\n // events are ignored during this whole 2 resize process.\n // If we assumed wrong and something else happened, we are resizing\n // twice in a frame (potential performance issue)\n listener();\n }\n }, window);\n\n // @ts-ignore until https://github.com/microsoft/TypeScript/issues/37861 implemented\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n // When its container's display is set to 'none' the callback will be called with a\n // size of (0, 0), which will cause the chart to lose its original height, so skip\n // resizing in such case.\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n\n return observer;\n}\n\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\n\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event) => {\n // This case can occur if the chart is destroyed while waiting\n // for the throttled function to occur. We prevent crashes by checking\n // for a destroyed chart\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n\n addListener(canvas, type, proxy);\n\n return proxy;\n}\n\n/**\n * Platform class for charts that can access the DOM and global window/document properties\n * @extends BasePlatform\n */\nexport default class DomPlatform extends BasePlatform {\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [aspectRatio]\n\t * @return {CanvasRenderingContext2D|null}\n\t */\n acquireContext(canvas, aspectRatio) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n\n // `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the canvas is\n // inside an iframe or when running in a protected environment. We could guess the\n // types from their toString() value but let's keep things flexible and assume it's\n // a sufficient condition if the canvas has a context2D which has canvas as `canvas`.\n // https://github.com/chartjs/Chart.js/issues/3887\n // https://github.com/chartjs/Chart.js/issues/4102\n // https://github.com/chartjs/Chart.js/issues/4152\n if (context && context.canvas === canvas) {\n // Load platform resources on first chart creation, to make it possible to\n // import the library before setting platform options.\n initCanvas(canvas, aspectRatio);\n return context;\n }\n\n return null;\n }\n\n /**\n\t * @param {CanvasRenderingContext2D} context\n\t */\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n\n const initial = canvas[EXPANDO_KEY].initial;\n ['height', 'width'].forEach((prop) => {\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n\n const style = initial.style || {};\n Object.keys(style).forEach((key) => {\n canvas.style[key] = style[key];\n });\n\n // The canvas render size might have been changed (and thus the state stack discarded),\n // we can't use save() and restore() to restore the initial state. So make sure that at\n // least the canvas context is reset to the default state by setting the canvas width.\n // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html\n // eslint-disable-next-line no-self-assign\n canvas.width = canvas.width;\n\n delete canvas[EXPANDO_KEY];\n return true;\n }\n\n /**\n\t *\n\t * @param {Chart} chart\n\t * @param {string} type\n\t * @param {function} listener\n\t */\n addEventListener(chart, type, listener) {\n // Can have only one listener per type, so make sure previous is removed\n this.removeEventListener(chart, type);\n\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} type\n\t */\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n\n if (!proxy) {\n return;\n }\n\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t */\n isAttached(canvas) {\n const container = _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n","import {_isDomSupported} from '../helpers/index.js';\nimport BasePlatform from './platform.base.js';\nimport BasicPlatform from './platform.basic.js';\nimport DomPlatform from './platform.dom.js';\n\nexport function _detectPlatform(canvas) {\n if (!_isDomSupported() || (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas)) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nexport {BasePlatform, BasicPlatform, DomPlatform};\n","import type {AnyObject} from '../types/basic.js';\nimport type {Point} from '../types/geometric.js';\nimport type {Animation} from '../types/animation.js';\nimport {isNumber} from '../helpers/helpers.math.js';\n\nexport default class Element {\n\n static defaults = {};\n static defaultRoutes = undefined;\n\n x: number;\n y: number;\n active = false;\n options: O;\n $animations: Record;\n\n tooltipPosition(useFinalPosition: boolean): Point {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y} as Point;\n }\n\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n\n /**\n * Gets the current or final value of each prop. Can return extra properties (whole object).\n * @param props - properties to get\n * @param [final] - get the final value (animation target)\n */\n getProps

(props: P, final?: boolean): Pick;\n getProps

(props: P[], final?: boolean): Partial>;\n getProps(props: string[], final?: boolean): Partial> {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this as Record;\n }\n const ret: Record = {};\n props.forEach((prop) => {\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop as string];\n });\n return ret;\n }\n}\n","import {isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\nimport {_factorize} from '../helpers/helpers.math.js';\n\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a subset of ticks to be plotted to avoid overlapping labels.\n * @param {import('./core.scale.js').default} scale\n * @param {Tick[]} ticks\n * @return {Tick[]}\n * @private\n */\nexport function autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n\n // If there are too many major ticks to display them all\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\n\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n\n/**\n * @param {number[]} majorIndices\n * @param {Tick[]} ticks\n * @param {number} ticksLimit\n */\nfunction calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n\n // If the major ticks are evenly spaced apart, place the minor ticks\n // so that they divide the major ticks into even chunks\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n\n const factors = _factorize(evenMajorSpacing);\n for (let i = 0, ilen = factors.length - 1; i < ilen; i++) {\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n\n/**\n * @param {Tick[]} ticks\n */\nfunction getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number[]} majorIndices\n * @param {number} spacing\n */\nfunction skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n\n spacing = Math.ceil(spacing);\n for (i = 0; i < ticks.length; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number} spacing\n * @param {number} [majorStart]\n * @param {number} [majorEnd]\n */\nfunction skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n\n next = start;\n\n while (next < 0) {\n count++;\n next = Math.round(start + count * spacing);\n }\n\n for (i = Math.max(start, 0); i < end; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n\n\n/**\n * @param {number[]} arr\n */\nfunction getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n\n if (len < 2) {\n return false;\n }\n\n for (diff = arr[0], i = 1; i < len; ++i) {\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n","import Element from './core.element.js';\nimport {_alignPixel, _measureText, renderText, clipArea, unclipArea} from '../helpers/helpers.canvas.js';\nimport {callback as call, each, finiteOrDefault, isArray, isFinite, isNullOrUndef, isObject, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toDegrees, toRadians, _int16Range, _limitValue, HALF_PI} from '../helpers/helpers.math.js';\nimport {_alignStartEnd, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {createContext, toFont, toPadding, _addGrace} from '../helpers/helpers.options.js';\nimport {autoSkip} from './core.scale.autoskip.js';\n\nconst reverseAlign = (align) => align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset) => edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit) => Math.min(maxTicksLimit || ticksLength, ticksLength);\n\n/**\n * @typedef { import('../types/index.js').Chart } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a new array containing numItems from arr\n * @param {any[]} arr\n * @param {number} numItems\n */\nfunction sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n\n for (; i < len; i += increment) {\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @param {boolean} offsetGridLines\n */\nfunction getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n\n // Return undefined if the pixel is out of the range\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n\n/**\n * @param {object} caches\n * @param {number} length\n */\nfunction garbageCollect(caches, length) {\n each(caches, (cache) => {\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for (i = 0; i < gcLen; ++i) {\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n\n/**\n * @param {object} options\n */\nfunction getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n\n/**\n * @param {object} options\n */\nfunction getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n\n return (lines * font.lineHeight) + padding.height;\n}\n\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\n\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\n\nfunction titleAlign(align, position, reverse) {\n /** @type {CanvasTextAlign} */\n let ret = _toLeftRightCenter(align);\n if ((reverse && position !== 'right') || (!reverse && position === 'right')) {\n ret = reverseAlign(ret);\n }\n return ret;\n}\n\nfunction titleArgs(scale, offset, position, align) {\n const {top, left, bottom, right, chart} = scale;\n const {chartArea, scales} = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {titleX, titleY, maxWidth, rotation};\n}\n\nexport default class Scale extends Element {\n\n // eslint-disable-next-line max-statements\n constructor(cfg) {\n super();\n\n /** @type {string} */\n this.id = cfg.id;\n /** @type {string} */\n this.type = cfg.type;\n /** @type {any} */\n this.options = undefined;\n /** @type {CanvasRenderingContext2D} */\n this.ctx = cfg.ctx;\n /** @type {Chart} */\n this.chart = cfg.chart;\n\n // implements box\n /** @type {number} */\n this.top = undefined;\n /** @type {number} */\n this.bottom = undefined;\n /** @type {number} */\n this.left = undefined;\n /** @type {number} */\n this.right = undefined;\n /** @type {number} */\n this.width = undefined;\n /** @type {number} */\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n /** @type {number} */\n this.maxWidth = undefined;\n /** @type {number} */\n this.maxHeight = undefined;\n /** @type {number} */\n this.paddingTop = undefined;\n /** @type {number} */\n this.paddingBottom = undefined;\n /** @type {number} */\n this.paddingLeft = undefined;\n /** @type {number} */\n this.paddingRight = undefined;\n\n // scale-specific properties\n /** @type {string=} */\n this.axis = undefined;\n /** @type {number=} */\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n /** @type {Tick[]} */\n this.ticks = [];\n /** @type {object[]|null} */\n this._gridLineItems = null;\n /** @type {object[]|null} */\n this._labelItems = null;\n /** @type {object|null} */\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n /** @type {number} */\n this._startPixel = undefined;\n /** @type {number} */\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n\n /**\n\t * @param {any} options\n\t * @since 3.0\n\t */\n init(options) {\n this.options = options.setContext(this.getContext());\n\n this.axis = options.axis;\n\n // parse min/max value, so we can properly determine min/max for other scales\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n\n /**\n\t * Parse a supported input value to internal representation.\n\t * @param {*} raw\n\t * @param {number} [index]\n\t * @since 3.0\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n return raw;\n }\n\n /**\n\t * @return {{min: number, max: number, minDefined: boolean, maxDefined: boolean}}\n\t * @protected\n\t * @since 3.0\n\t */\n getUserBounds() {\n let {_userMin, _userMax, _suggestedMin, _suggestedMax} = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isFinite(_userMin),\n maxDefined: isFinite(_userMax)\n };\n }\n\n /**\n\t * @param {boolean} canStack\n\t * @return {{min: number, max: number}}\n\t * @protected\n\t * @since 3.0\n\t */\n getMinMax(canStack) {\n // eslint-disable-next-line prefer-const\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n let range;\n\n if (minDefined && maxDefined) {\n return {min, max};\n }\n\n const metas = this.getMatchingVisibleMetas();\n for (let i = 0, ilen = metas.length; i < ilen; ++i) {\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n\n // Make sure min <= max when only min or max is defined by user and the data is outside that range\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n\n /**\n\t * Get the padding needed for the scale\n\t * @return {{top: number, left: number, bottom: number, right: number}} the necessary padding\n\t * @private\n\t */\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n\n /**\n\t * Returns the scale tick objects\n\t * @return {Tick[]}\n\t * @since 2.7\n\t */\n getTicks() {\n return this.ticks;\n }\n\n /**\n\t * @return {string[]}\n\t */\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n\n /**\n * @return {import('../types.js').LabelItem[]}\n */\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n\n // When a new layout is created, reset the data limits cache\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n\n // These methods are ordered by lifecycle. Utilities then follow.\n // Any function defined here is inherited by all scale types.\n // Any function can be extended by the scale type\n\n beforeUpdate() {\n call(this.options.beforeUpdate, [this]);\n }\n\n /**\n\t * @param {number} maxWidth - the max width in pixels\n\t * @param {number} maxHeight - the max height in pixels\n\t * @param {{top: number, left: number, bottom: number, right: number}} margins - the space between the edge of the other scales and edge of the chart\n\t * This space comes from two sources:\n\t * - padding - space that's required to show the labels at the edges of the scale\n\t * - thickness of scales or legends in another orientation\n\t */\n update(maxWidth, maxHeight, margins) {\n const {beginAtZero, grace, ticks: tickOpts} = this.options;\n const sampleSize = tickOpts.sampleSize;\n\n // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n this.beforeUpdate();\n\n // Absorb the master measurements\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n\n // Dimensions\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n\n this._maxLength = this.isHorizontal()\n ? this.width + margins.left + margins.right\n : this.height + margins.top + margins.bottom;\n\n // Data min/max\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n\n this.beforeBuildTicks();\n\n this.ticks = this.buildTicks() || [];\n\n // Allow modification of ticks in callback.\n this.afterBuildTicks();\n\n // Compute tick rotation and fit using a sampled subset of labels\n // We generally don't need to compute the size of every single label for determining scale size\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n\n // configure is called twice, once here, once from core.controller.updateLayout.\n // Here we haven't been positioned yet, but dimensions are correct.\n // Variables set in configure are needed for calculateLabelRotation, and\n // it's ok that coordinates are not correct there, only dimensions matter.\n this.configure();\n\n // Tick Rotation\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation(); // Preconditions: number of ticks and sizes of largest labels must be calculated beforehand\n this.afterCalculateLabelRotation();\n\n // Auto-skip\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n\n if (samplingEnabled) {\n // Generate labels using all non-skipped ticks\n this._convertTicksToLabels(this.ticks);\n }\n\n this.beforeFit();\n this.fit(); // Preconditions: label rotation and label sizes must be calculated beforehand\n this.afterFit();\n\n // IMPORTANT: after this point, we consider that `this.ticks` will NEVER change!\n\n this.afterUpdate();\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n // by default vertical scales are from bottom to top, so pixels are reversed\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n\n afterUpdate() {\n call(this.options.afterUpdate, [this]);\n }\n\n //\n\n beforeSetDimensions() {\n call(this.options.beforeSetDimensions, [this]);\n }\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n if (this.isHorizontal()) {\n // Reset position before calculating rotation\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n\n // Reset position before calculating rotation\n this.top = 0;\n this.bottom = this.height;\n }\n\n // Reset padding\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n call(this.options.afterSetDimensions, [this]);\n }\n\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n call(this.options[name], [this]);\n }\n\n // Data limits\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n\n //\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n /**\n\t * @return {object[]} the ticks\n\t */\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n\n beforeTickToLabelConversion() {\n call(this.options.beforeTickToLabelConversion, [this]);\n }\n /**\n\t * Convert ticks to label strings\n\t * @param {Tick[]} ticks\n\t */\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n tick = ticks[i];\n tick.label = call(tickOpts.callback, [tick.value, i, ticks], this);\n }\n }\n afterTickToLabelConversion() {\n call(this.options.afterTickToLabelConversion, [this]);\n }\n\n //\n\n beforeCalculateLabelRotation() {\n call(this.options.beforeCalculateLabelRotation, [this]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n\n // Estimate the width of each grid based on the canvas width, the maximum\n // label width and the number of tick intervals\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n\n // Allow 3 pixels x2 padding either side for label readability\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid)\n\t\t\t\t- tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(\n Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),\n Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))\n ));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n call(this.options.afterCalculateLabelRotation, [this]);\n }\n afterAutoSkip() {}\n\n //\n\n beforeFit() {\n call(this.options.beforeFit, [this]);\n }\n fit() {\n // Reset\n const minSize = {\n width: 0,\n height: 0\n };\n\n const {chart, options: {ticks: tickOpts, title: titleOpts, grid: gridOpts}} = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight; // fill all the height\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n\n // Don't bother fitting the ticks if we are not showing the labels\n if (tickOpts.display && this.ticks.length) {\n const {first, last, widest, highest} = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n\n if (isHorizontal) {\n // A horizontal axis is more constrained by the height.\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n // A vertical axis is more constrained by the width. Labels are the\n // dominant factor here, so get that length first and account for padding\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n\n this._handleMargins();\n\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n\n _calculatePadding(first, last, sin, cos) {\n const {ticks: {align, padding}, position} = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n\n // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned\n // which means that the right padding is dominated by the font height\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n\n // Adjust padding taking into account changes in offsets\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n\n /**\n\t * Handle margins and padding interactions\n\t * @private\n\t */\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n\n afterFit() {\n call(this.options.afterFit, [this]);\n }\n\n // Shared Methods\n /**\n\t * @return {boolean}\n\t */\n isHorizontal() {\n const {axis, position} = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n /**\n\t * @return {boolean}\n\t */\n isFullSize() {\n return this.options.fullSize;\n }\n\n /**\n\t * @param {Tick[]} ticks\n\t * @private\n\t */\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n\n this.generateTickLabels(ticks);\n\n // Ticks should be skipped when callback returns null or undef, so lets remove those.\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n\n this.afterTickToLabelConversion();\n }\n\n /**\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n\n return labelSizes;\n }\n\n /**\n\t * Returns {width, height, offset} objects for the first, last, widest, highest tick\n\t * labels where offset indicates the anchor point offset from the top in pixels.\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const {ctx, _longestTextCache: caches} = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n\n for (i = 0; i < length; i += increment) {\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n // if it is an array let's measure each element\n for (j = 0, jlen = label.length; j < jlen; ++j) {\n nestedLabel = /** @type {string} */ (label[j]);\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n\n const valueAt = (idx) => ({width: widths[idx] || 0, height: heights[idx] || 0});\n\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights,\n };\n }\n\n /**\n\t * Used to get the label to display in the tooltip for the given value\n\t * @param {*} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value;\n }\n\n /**\n\t * Returns the location of the given data point. Value can either be an index or a numerical value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {*} value\n\t * @param {number} [index]\n\t * @return {number}\n\t */\n getPixelForValue(value, index) { // eslint-disable-line no-unused-vars\n return NaN;\n }\n\n /**\n\t * Used to get the data value from a given pixel. This is the inverse of getPixelForValue\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} pixel\n\t * @return {*}\n\t */\n getValueForPixel(pixel) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Returns the location of the tick at the given index\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} index\n\t * @return {number}\n\t */\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n /**\n\t * Utility for getting the pixel location of a percentage of scale\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} decimal\n\t * @return {number}\n\t */\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n\n /**\n\t * Returns the pixel for the minimum chart value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @return {number}\n\t */\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n\n /**\n\t * @return {number}\n\t */\n getBaseValue() {\n const {min, max} = this;\n\n return min < 0 && max < 0 ? max :\n min > 0 && max > 0 ? min :\n 0;\n }\n\n /**\n\t * @protected\n\t */\n getContext(index) {\n const ticks = this.ticks || [];\n\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context ||\n\t\t\t\t(tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context ||\n\t\t\t(this.$context = createScaleContext(this.chart.getContext(), this));\n }\n\n /**\n\t * @return {number}\n\t * @private\n\t */\n _tickSize() {\n const optionTicks = this.options.ticks;\n\n // Calculate space needed by label in axis direction.\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n\n // Calculate space needed for 1 tick in axis direction.\n return this.isHorizontal()\n ? h * cos > w * sin ? w / cos : h / sin\n : h * sin < w * cos ? h / cos : w / sin;\n }\n\n /**\n\t * @return {boolean}\n\t * @private\n\t */\n _isVisible() {\n const display = this.options.display;\n\n if (display !== 'auto') {\n return !!display;\n }\n\n return this.getMatchingVisibleMetas().length > 0;\n }\n\n /**\n\t * @private\n\t */\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const {grid, position, border} = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for (i = 0; i < ticksLength; i += step) {\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n\n lineValue = getPixelForGridLine(this, i, offset);\n\n // Skip if the pixel is out of the range\n if (lineValue === undefined) {\n continue;\n }\n\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset,\n });\n }\n\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n\n return items;\n }\n\n /**\n\t * @private\n\t */\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const {position, ticks: optionTicks} = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const {align, crossAlign, padding, mirror} = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = ((chartArea.top + chartArea.bottom) / 2) + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = ((chartArea.left + chartArea.right) / 2) - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n\n const labelSizes = this._getLabelSizes();\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n label = tick.label;\n\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n\n if (isHorizontal) {\n x = pixel;\n\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += (lineHeight / 2) * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n\n let backdrop;\n\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n\n switch (textBaseline) {\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n default:\n break;\n }\n\n switch (textAlign) {\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n default:\n break;\n }\n\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n\n color: optsAtIndex.backdropColor,\n };\n }\n\n items.push({\n label,\n font,\n textOffset,\n options: {\n rotation,\n color,\n strokeColor,\n strokeWidth,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [x, y],\n backdrop,\n }\n });\n }\n\n return items;\n }\n\n _getXAxisLabelAlignment() {\n const {position, ticks} = this.options;\n const rotation = -toRadians(this.labelRotation);\n\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n\n let align = 'center';\n\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n\n return align;\n }\n\n _getYAxisLabelAlignment(tl) {\n const {position, ticks: {crossAlign, mirror, padding}} = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n\n let textAlign;\n let x;\n\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += (widest / 2);\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n\n return {textAlign, x};\n }\n\n /**\n\t * @private\n\t */\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n\n const chart = this.chart;\n const position = this.options.position;\n\n if (position === 'left' || position === 'right') {\n return {top: 0, left: this.left, bottom: chart.height, right: this.right};\n } if (position === 'top' || position === 'bottom') {\n return {top: this.top, left: 0, bottom: this.bottom, right: chart.width};\n }\n }\n\n /**\n * @protected\n */\n drawBackground() {\n const {ctx, options: {backgroundColor}, left, top, width, height} = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex(t => t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n\n const drawLine = (p1, p2, style) => {\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n\n if (grid.display) {\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n const item = items[i];\n\n if (grid.drawOnChartArea) {\n drawLine(\n {x: item.x1, y: item.y1},\n {x: item.x2, y: item.y2},\n item\n );\n }\n\n if (grid.drawTicks) {\n drawLine(\n {x: item.tx1, y: item.ty1},\n {x: item.tx2, y: item.ty2},\n {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n }\n );\n }\n }\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {\n const {chart, ctx, options: {border, grid}} = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n\n if (!optionTicks.display) {\n return;\n }\n\n const ctx = this.ctx;\n\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n\n const items = this.getLabelItems(chartArea);\n for (const item of items) {\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n\n if (area) {\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const {ctx, options: {position, title, reverse}} = this;\n\n if (!title.display) {\n return;\n }\n\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n\n const {titleX, titleY, maxWidth, rotation} = titleArgs(this, offset, position, align);\n\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n\n /**\n\t * @return {object[]}\n\t * @private\n\t */\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n // backward compatibility: draw has been overridden by custom scale\n return [{\n z: tz,\n draw: (chartArea) => {\n this.draw(chartArea);\n }\n }];\n }\n\n return [{\n z: gz,\n draw: (chartArea) => {\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n }, {\n z: bz,\n draw: () => {\n this.drawBorder();\n }\n }, {\n z: tz,\n draw: (chartArea) => {\n this.drawLabels(chartArea);\n }\n }];\n }\n\n /**\n\t * Returns visible dataset metas that are attached to this scale\n\t * @param {string} [type] - if specified, also filter by dataset type\n\t * @return {object[]}\n\t */\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n\n /**\n\t * @param {number} index\n\t * @return {object}\n\t * @protected\n \t */\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n\n /**\n * @protected\n */\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n","import {merge} from '../helpers/index.js';\nimport defaults, {overrides} from './core.defaults.js';\n\n/**\n * @typedef {{id: string, defaults: any, overrides?: any, defaultRoutes: any}} IChartComponent\n */\n\nexport default class TypedRegistry {\n constructor(type, scope, override) {\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n\n /**\n\t * @param {IChartComponent} item\n\t * @returns {string} The scope where items defaults were registered to.\n\t */\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n\n if (isIChartComponent(proto)) {\n // Make sure the parent is registered and note the scope where its defaults are.\n parentScope = this.register(proto);\n }\n\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n\n if (id in items) {\n // already registered\n return scope;\n }\n\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n\n return scope;\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object?}\n\t */\n get(id) {\n return this.items[id];\n }\n\n /**\n\t * @param {IChartComponent} item\n\t */\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n\n if (id in items) {\n delete items[id];\n }\n\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\n\nfunction registerDefaults(item, scope, parentScope) {\n // Inherit the parent's defaults and keep existing defaults\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n\n defaults.set(scope, itemDefaults);\n\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\n\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach(property => {\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [scope].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\n\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n","import DatasetController from './core.datasetController.js';\nimport Element from './core.element.js';\nimport Scale from './core.scale.js';\nimport TypedRegistry from './core.typedRegistry.js';\nimport {each, callback as call, _capitalize} from '../helpers/helpers.core.js';\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Registry {\n constructor() {\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n // Order is important, Scale has Element in prototype chain,\n // so Scales must be before Elements. Plugins are a fallback, so not listed here.\n this._typedRegistries = [this.controllers, this.scales, this.elements];\n }\n\n /**\n\t * @param {...any} args\n\t */\n add(...args) {\n this._each('register', args);\n }\n\n remove(...args) {\n this._each('unregister', args);\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof DatasetController}\n\t */\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Element}\n\t */\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object}\n\t */\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Scale}\n\t */\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n\n /**\n\t * @private\n\t */\n _each(method, args, typedRegistry) {\n [...args].forEach(arg => {\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || (reg === this.plugins && arg.id)) {\n this._exec(method, reg, arg);\n } else {\n // Handle loopable args\n // Use case:\n // import * as plugins from './plugins.js';\n // Chart.register(plugins);\n each(arg, item => {\n // If there are mixed types in the loopable, make sure those are\n // registered in correct registry\n // Use case: (treemap exporting controller, elements etc)\n // import * as treemap from 'chartjs-chart-treemap.js';\n // Chart.register(treemap);\n\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n call(component['before' + camelMethod], [], component); // beforeRegister / beforeUnregister\n registry[method](component);\n call(component['after' + camelMethod], [], component); // afterRegister / afterUnregister\n }\n\n /**\n\t * @private\n\t */\n _getRegistryForType(type) {\n for (let i = 0; i < this._typedRegistries.length; i++) {\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n // plugins is the fallback registry\n return this.plugins;\n }\n\n /**\n\t * @private\n\t */\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Registry();\n","import registry from './core.registry.js';\nimport {callback as callCallback, isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../plugins/plugin.tooltip.js').default } Tooltip\n */\n\n/**\n * @callback filterCallback\n * @param {{plugin: object, options: object}} value\n * @param {number} [index]\n * @param {array} [array]\n * @param {object} [thisArg]\n * @return {boolean}\n */\n\n\nexport default class PluginService {\n constructor() {\n this._init = [];\n }\n\n /**\n\t * Calls enabled plugins for `chart` on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {Chart} chart - The chart instance for which plugins should be called.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {object} [args] - Extra arguments to apply to the hook call.\n * @param {filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n\n /**\n\t * @private\n\t */\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors) {\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [chart, args, descriptor.options];\n if (callCallback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n\n return true;\n }\n\n invalidate() {\n // When plugins are registered, there is the possibility of a double\n // invalidate situation. In this case, we only want to invalidate once.\n // If we invalidate multiple times, the `_oldCache` is lost and all of the\n // plugins are restarted without being correctly stopped.\n // See https://github.com/chartjs/Chart.js/issues/8147\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n\n const descriptors = this._cache = this._createDescriptors(chart);\n\n this._notifyStateChanges(chart);\n\n return descriptors;\n }\n\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n // options === false => all plugins are disabled\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b) => a.filter(x => !b.some(y => x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\n\n/**\n * @param {import('./core.config.js').default} config\n */\nfunction allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for (let i = 0; i < keys.length; i++) {\n plugins.push(registry.getPlugin(keys[i]));\n }\n\n const local = config.plugins || [];\n for (let i = 0; i < local.length; i++) {\n const plugin = local[i];\n\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n\n return {plugins, localIds};\n}\n\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\n\nfunction createDescriptors(chart, {plugins, localIds}, options, all) {\n const result = [];\n const context = chart.getContext();\n\n for (const plugin of plugins) {\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {plugin, local: localIds[id]}, opts, context)\n });\n }\n\n return result;\n}\n\nfunction pluginOpts(config, {plugin, local}, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n // make sure plugin defaults are in scopes for local (not registered) plugins\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [''], {\n // These are just defaults that plugins can override\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n","import defaults, {overrides, descriptors} from './core.defaults.js';\nimport {mergeIf, resolveObjectKey, isArray, isFunction, valueOrDefault, isObject} from '../helpers/helpers.core.js';\nimport {_attachContext, _createResolver, _descriptors} from '../helpers/helpers.config.js';\n\nexport function getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\n\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\n\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\n\nfunction idMatchesAxis(id) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n}\n\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\n\nexport function determineAxis(id, ...scaleOptions) {\n if (idMatchesAxis(id)) {\n return id;\n }\n for (const opts of scaleOptions) {\n const axis = opts.axis\n || axisFromPosition(opts.position)\n || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n if (axis) {\n return axis;\n }\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\n\nfunction getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + 'AxisID'] === id) {\n return {axis};\n }\n}\n\nfunction retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d) => d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) {\n return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n }\n }\n return {};\n}\n\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {scales: {}};\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n\n // First figure out first scale id's per axis.\n Object.keys(configScales).forEach(id => {\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [{axis}, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]);\n });\n\n // Then merge dataset defaults to scale configs\n config.data.datasets.forEach(dataset => {\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach(defaultID => {\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [{axis}, configScales[id], defaultScaleOptions[defaultID]]);\n });\n });\n\n // apply scale defaults, if not overridden by dataset defaults\n Object.keys(scales).forEach(key => {\n const scale = scales[key];\n mergeIf(scale, [defaults.scales[scale.type], defaults.scale]);\n });\n\n return scales;\n}\n\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\n\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\n\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n\n initOptions(config);\n\n return config;\n}\n\nconst keyCache = new Map();\nconst keysCached = new Set();\n\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\n\nconst addIfFound = (set, obj, key) => {\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\n\nexport default class Config {\n constructor(config) {\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n\n get platform() {\n return this._config.platform;\n }\n\n get type() {\n return this._config.type;\n }\n\n set type(type) {\n this._config.type = type;\n }\n\n get data() {\n return this._config.data;\n }\n\n set data(data) {\n this._config.data = initData(data);\n }\n\n get options() {\n return this._config.options;\n }\n\n set options(options) {\n this._config.options = options;\n }\n\n get plugins() {\n return this._config.plugins;\n }\n\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n\n /**\n * Returns the option scope keys for resolving dataset options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @return {string[][]}\n */\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType,\n () => [[\n `datasets.${datasetType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the option scope keys for resolving dataset animation options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @param {string} transition\n * @return {string[][]}\n */\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`,\n () => [\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`,\n ],\n // The following are used for looking up the `animations` and `animation` keys\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n\n /**\n * Returns the options scope keys for resolving element options that belong\n * to an dataset. These keys do not include the dataset itself, because it\n * is not under options.\n * @param {string} datasetType\n * @param {string} elementType\n * @return {string[][]}\n */\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`,\n () => [[\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the options scope keys for resolving plugin options.\n * @param {{id: string, additionalOptionScopes?: string[]}} plugin\n * @return {string[][]}\n */\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`,\n () => [[\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || [],\n ]]);\n }\n\n /**\n * @private\n */\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n\n /**\n * Resolves the objects from options and defaults for option value resolution.\n * @param {object} mainScope - The main scope object for options\n * @param {string[][]} keyLists - The arrays of keys in resolution order\n * @param {boolean} [resetCache] - reset the cache for this mainScope\n */\n getOptionScopes(mainScope, keyLists, resetCache) {\n const {options, type} = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n\n const scopes = new Set();\n\n keyLists.forEach(keys => {\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach(key => addIfFound(scopes, mainScope, key));\n }\n keys.forEach(key => addIfFound(scopes, options, key));\n keys.forEach(key => addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach(key => addIfFound(scopes, defaults, key));\n keys.forEach(key => addIfFound(scopes, descriptors, key));\n });\n\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n\n /**\n * Returns the option scopes for resolving chart options\n * @return {object[]}\n */\n chartOptionScopes() {\n const {options, type} = this;\n\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {}, // https://github.com/chartjs/Chart.js/issues/8531\n {type},\n defaults,\n descriptors\n ];\n }\n\n /**\n * @param {object[]} scopes\n * @param {string[]} names\n * @param {function|object} context\n * @param {string[]} [prefixes]\n * @return {object}\n */\n resolveNamedOptions(scopes, names, context, prefixes = ['']) {\n const result = {$shared: true};\n const {resolver, subPrefixes} = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n // subResolver is passed to scriptable options. It should not resolve to hover options.\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n\n for (const prop of names) {\n result[prop] = options[prop];\n }\n return result;\n }\n\n /**\n * @param {object[]} scopes\n * @param {object} [context]\n * @param {string[]} [prefixes]\n * @param {{scriptable: boolean, indexable: boolean, allKeys?: boolean}} [descriptorDefaults]\n */\n createResolver(scopes, context, prefixes = [''], descriptorDefaults) {\n const {resolver} = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context)\n ? _attachContext(resolver, context, undefined, descriptorDefaults)\n : resolver;\n }\n}\n\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter(p => !p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\n\nconst hasFunction = value => isObject(value)\n && Object.getOwnPropertyNames(value).reduce((acc, key) => acc || isFunction(value[key]), false);\n\nfunction needContext(proxy, names) {\n const {isScriptable, isIndexable} = _descriptors(proxy);\n\n for (const prop of names) {\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if ((scriptable && (isFunction(value) || hasFunction(value)))\n || (indexable && isArray(value))) {\n return true;\n }\n }\n return false;\n}\n","import animator from './core.animator.js';\nimport defaults, {overrides} from './core.defaults.js';\nimport Interaction from './core.interaction.js';\nimport layouts from './core.layouts.js';\nimport {_detectPlatform} from '../platform/index.js';\nimport PluginService from './core.plugins.js';\nimport registry from './core.registry.js';\nimport Config, {determineAxis, getIndexAxis} from './core.config.js';\nimport {retinaScale, _isDomSupported} from '../helpers/helpers.dom.js';\nimport {each, callback as callCallback, uid, valueOrDefault, _elementsEqual, isNullOrUndef, setsEqual, defined, isFunction, _isClickEvent} from '../helpers/helpers.core.js';\nimport {clearCanvas, clipArea, createContext, unclipArea, _isPointInArea} from '../helpers/index.js';\n// @ts-ignore\nimport {version} from '../../package.json';\nimport {debounce} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').Point } Point\n */\n\nconst KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || (KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x');\n}\n\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1]\n ? a[l2] - b[l2]\n : a[l1] - b[l1];\n };\n}\n\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n\n chart.notifyPlugins('afterRender');\n callCallback(animationOptions && animationOptions.onComplete, [context], chart);\n}\n\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callCallback(animationOptions && animationOptions.onProgress, [context], chart);\n}\n\n/**\n * Chart.js can take a string id of a canvas element, a 2d context, or a canvas element itself.\n * Attempt to unwrap the item passed into the chart constructor so that it is a canvas element (if possible).\n */\nfunction getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n // Support for array based queries (such as jQuery)\n item = item[0];\n }\n\n if (item && item.canvas) {\n // Support for any object associated to a canvas (including a context2d)\n item = item.canvas;\n }\n return item;\n}\n\nconst instances = {};\nconst getChart = (key) => {\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c) => c.canvas === canvas).pop();\n};\n\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys) {\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n\n/**\n * @param {ChartEvent} e\n * @param {ChartEvent|null} lastEvent\n * @param {boolean} inChartArea\n * @param {boolean} isClick\n * @returns {ChartEvent|null}\n */\nfunction determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\n\nfunction getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\n\nfunction getDatasetArea(meta, chartArea) {\n const {xScale, yScale} = meta;\n if (xScale && yScale) {\n return {\n left: getSizeForArea(xScale, chartArea, 'left'),\n right: getSizeForArea(xScale, chartArea, 'right'),\n top: getSizeForArea(yScale, chartArea, 'top'),\n bottom: getSizeForArea(yScale, chartArea, 'bottom')\n };\n }\n return chartArea;\n}\n\nclass Chart {\n\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n\n // eslint-disable-next-line max-statements\n constructor(item, userConfig) {\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error(\n 'Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' +\n\t\t\t\t' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.'\n );\n }\n\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n // Store the previously used aspect ratio to determine if a resize\n // is needed during updates. Do this after _options is set since\n // aspectRatio uses a getter\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n /** @type {?{attach?: function, detach?: function, resize?: function}} */\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce(mode => this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n\n // Add the chart instance to the global namespace\n instances[this.id] = this;\n\n if (!context || !canvas) {\n // The given item is not a compatible context2d element, let's return before finalizing\n // the chart initialization but after setting basic chart / controller properties that\n // can help to figure out that the chart is not valid (e.g chart.canvas !== null);\n // https://github.com/chartjs/Chart.js/issues/2807\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n\n get aspectRatio() {\n const {options: {aspectRatio, maintainAspectRatio}, width, height, _aspectRatio} = this;\n if (!isNullOrUndef(aspectRatio)) {\n // If aspectRatio is defined in options, use that.\n return aspectRatio;\n }\n\n if (maintainAspectRatio && _aspectRatio) {\n // If maintainAspectRatio is truthly and we had previously determined _aspectRatio, use that\n return _aspectRatio;\n }\n\n // Calculate\n return height ? width / height : null;\n }\n\n get data() {\n return this.config.data;\n }\n\n set data(data) {\n this.config.data = data;\n }\n\n get options() {\n return this._options;\n }\n\n set options(options) {\n this.config.options = options;\n }\n\n get registry() {\n return registry;\n }\n\n /**\n\t * @private\n\t */\n _initialize() {\n // Before init plugin notification\n this.notifyPlugins('beforeInit');\n\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n\n this.bindEvents();\n\n // After init plugin notification\n this.notifyPlugins('afterInit');\n\n return this;\n }\n\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n\n stop() {\n animator.stop(this);\n return this;\n }\n\n /**\n\t * Resize the chart to its container or to explicit dimensions.\n\t * @param {number} [width]\n\t * @param {number} [height]\n\t */\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {width, height};\n }\n }\n\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n\n this.notifyPlugins('resize', {size: newSize});\n\n callCallback(options.onResize, [this, newSize], this);\n\n if (this.attached) {\n if (this._doResize(mode)) {\n // The resize update is delayed, only draw without updating.\n this.render();\n }\n }\n }\n\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n\n each(scalesOptions, (axisOptions, axisID) => {\n axisOptions.id = axisID;\n });\n }\n\n /**\n\t * Builds a map of scale ID to scale object for future lookup.\n\t */\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id) => {\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n\n if (scaleOpts) {\n items = items.concat(\n Object.keys(scaleOpts).map((id) => {\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n })\n );\n }\n\n each(items, (item) => {\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n\n scale.init(scaleOptions, options);\n });\n // clear up discarded scales\n each(updated, (hasUpdated, id) => {\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n\n each(scales, (scale) => {\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n\n /**\n\t * @private\n\t */\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n\n metasets.sort((a, b) => a.index - b.index);\n if (numMeta > numData) {\n for (let i = numData; i < numMeta; ++i) {\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n\n /**\n\t * @private\n\t */\n _removeUnreferencedMetasets() {\n const {_metasets: metasets, data: {datasets}} = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index) => {\n if (datasets.filter(x => x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n\n this._removeUnreferencedMetasets();\n\n for (i = 0, ilen = datasets.length; i < ilen; i++) {\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const {datasetElementType, dataElementType} = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n\n this._updateMetasets();\n return newControllers;\n }\n\n /**\n\t * Reset the elements of all datasets\n\t * @private\n\t */\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex) => {\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n\n /**\n\t* Resets the chart back to its state before the initial animation\n\t*/\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n\n update(mode) {\n const config = this.config;\n\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n\n // plugins options references might have change, let's invalidate the cache\n // https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\n this._plugins.invalidate();\n\n if (this.notifyPlugins('beforeUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n // Make sure dataset controllers are updated and new controllers are reset\n const newControllers = this.buildOrUpdateControllers();\n\n this.notifyPlugins('beforeElementsUpdate');\n\n // Make sure all dataset controllers have correct meta data counts\n let minPadding = 0;\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; i++) {\n const {controller} = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n // New controllers will be reset after the layout pass, so we only want to modify\n // elements added to new datasets\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n\n // Only reset the controllers if we have animations\n if (!animsDisabled) {\n // Can only reset the new controllers after the scales have been updated\n // Reset is done to get the starting point for the initial animation\n each(newControllers, (controller) => {\n controller.reset();\n });\n }\n\n this._updateDatasets(mode);\n\n // Do this before render so that any plugins that need final scale updates can use it\n this.notifyPlugins('afterUpdate', {mode});\n\n this._layers.sort(compare2Level('z', '_idx'));\n\n // Replay last event from before update, or set hover styles on active elements\n const {_active, _lastEvent} = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n\n this.render();\n }\n\n /**\n * @private\n */\n _updateScales() {\n each(this.scales, (scale) => {\n layouts.removeBox(this, scale);\n });\n\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n\n /**\n * @private\n */\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n // The configured events have changed. Rebind.\n this.unbindEvents();\n this.bindEvents();\n }\n }\n\n /**\n * @private\n */\n _updateHiddenIndices() {\n const {_hiddenIndices} = this;\n const changes = this._getUniformDataChanges() || [];\n for (const {method, start, count} of changes) {\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n\n /**\n * @private\n */\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx) => new Set(\n _dataChanges\n .filter(c => c[0] === idx)\n .map((c, i) => i + ',' + c.splice(1).join(','))\n );\n\n const changeSet = makeSet(0);\n for (let i = 1; i < datasetCount; i++) {\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet)\n .map(c => c.split(','))\n .map(a => ({method: a[1], start: +a[2], count: +a[3]}));\n }\n\n /**\n\t * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`\n\t * hook, in which case, plugins will not be called on `afterLayout`.\n\t * @private\n\t */\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {cancelable: true}) === false) {\n return;\n }\n\n layouts.update(this, this.width, this.height, minPadding);\n\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n\n this._layers = [];\n each(this.boxes, (box) => {\n if (noArea && box.position === 'chartArea') {\n // Skip drawing and configuring chartArea boxes when chartArea is zero or negative\n return;\n }\n\n // configure is called twice, once in core.scale.update and once here.\n // Here the boxes are fully updated and at their final positions.\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n\n this._layers.forEach((item, index) => {\n item._idx = index;\n });\n\n this.notifyPlugins('afterLayout');\n }\n\n /**\n\t * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.\n\t * @private\n\t */\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this.getDatasetMeta(i).controller.configure();\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);\n }\n\n this.notifyPlugins('afterDatasetsUpdate', {mode});\n }\n\n /**\n\t * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetUpdate`.\n\t * @private\n\t */\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {meta, index, mode, cancelable: true};\n\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n\n meta.controller._update(mode);\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n\n render() {\n if (this.notifyPlugins('beforeRender', {cancelable: true}) === false) {\n return;\n }\n\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({chart: this});\n }\n }\n\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const {width, height} = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n\n if (this.notifyPlugins('beforeDraw', {cancelable: true}) === false) {\n return;\n }\n\n // Because of plugin hooks (before/afterDatasetsDraw), datasets can't\n // currently be part of layers. Instead, we draw\n // layers <= 0 before(default, backward compat), and the rest after\n const layers = this._layers;\n for (i = 0; i < layers.length && layers[i].z <= 0; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this._drawDatasets();\n\n // Rest of layers\n for (; i < layers.length; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this.notifyPlugins('afterDraw');\n }\n\n /**\n\t * @private\n\t */\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n\n return result;\n }\n\n /**\n\t * Gets the visible dataset metas in drawing order\n\t * @return {object[]}\n\t */\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n\n /**\n\t * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetsDraw`.\n\t * @private\n\t */\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {cancelable: true}) === false) {\n return;\n }\n\n const metasets = this.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n this._drawDataset(metasets[i]);\n }\n\n this.notifyPlugins('afterDatasetsDraw');\n }\n\n /**\n\t * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetDraw`.\n\t * @private\n\t */\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta, this.chartArea);\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n\n meta.controller.draw();\n\n if (useClip) {\n unclipArea(ctx);\n }\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n\n /**\n * Checks whether the given point is in the chart area.\n * @param {Point} point - in relative coordinates (see, e.g., getRelativePosition)\n * @returns {boolean}\n */\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n\n return [];\n }\n\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter(x => x && x._dataset === dataset).pop();\n\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\t\t\t// See isDatasetVisible() comment\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n\n return meta;\n }\n\n getContext() {\n return this.$context || (this.$context = createContext(null, {chart: this, type: 'chart'}));\n }\n\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n\n const meta = this.getDatasetMeta(datasetIndex);\n\n // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,\n // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n\n /**\n\t * @private\n\t */\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n // Animate visible state, so hide animation can be seen. This could be handled better if update / updateDataset returned a Promise.\n anims.update(meta, {visible});\n this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n\n /**\n\t * @private\n\t */\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n\n for (i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._destroyDatasetMeta(i);\n }\n }\n\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const {canvas, ctx} = this;\n\n this._stop();\n this.config.clearCache();\n\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n\n delete instances[this.id];\n\n this.notifyPlugins('afterDestroy');\n }\n\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n\n /**\n\t * @private\n\t */\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n\n /**\n * @private\n */\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n\n const listener = (e, x, y) => {\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n\n each(this.options.events, (type) => _add(type, listener));\n }\n\n /**\n * @private\n */\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener) => {\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n\n const listener = (width, height) => {\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n\n let detached; // eslint-disable-line prefer-const\n const attached = () => {\n _remove('attach', attached);\n\n this.attached = true;\n this.resize();\n\n _add('resize', listener);\n _add('detach', detached);\n };\n\n detached = () => {\n this.attached = false;\n\n _remove('resize', listener);\n\n // Stop animating and remove metasets, so when re-attached, the animations start from beginning.\n this._stop();\n this._resize(0, 0);\n\n _add('attach', attached);\n };\n\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n\n /**\n\t * @private\n\t */\n unbindEvents() {\n each(this._listeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n\n each(this._responsiveListeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n\n /**\n\t * Get active (hovered) elements\n\t * @returns array\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active (hovered) elements\n\t * @param {array} activeElements New active data points\n\t */\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n\n if (changed) {\n this._active = active;\n // Make sure we don't use the previous mouse event to override the active elements in update.\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n\n /**\n\t * Calls enabled plugins on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {Object} [args] - Extra arguments to apply to the hook call.\n * @param {import('./core.plugins.js').filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n\n /**\n * Check if a plugin with the specific ID is registered and enabled\n * @param {string} pluginId - The ID of the plugin of which to check if it is enabled\n * @returns {boolean}\n */\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter(p => p.plugin.id === pluginId).length === 1;\n }\n\n /**\n\t * @private\n\t */\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b) => a.filter(x => !b.some(y => x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n\n /**\n\t * @private\n\t */\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type);\n\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n\n const changed = this._handleEvent(e, replay, args.inChartArea);\n\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n\n if (changed || args.changed) {\n this.render();\n }\n\n return this;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e the event to handle\n\t * @param {boolean} [replay] - true if the event was replayed by `update`\n * @param {boolean} [inChartArea] - true if the event is inside chartArea\n\t * @return {boolean} true if the chart needs to re-render\n\t * @private\n\t */\n _handleEvent(e, replay, inChartArea) {\n const {_active: lastActive = [], options} = this;\n\n // If the event is replayed from `update`, we should evaluate with the final positions.\n //\n // The `replay`:\n // It's the last event (excluding click) that has occurred before `update`.\n // So mouse has not moved. It's also over the chart, because there is a `replay`.\n //\n // The why:\n // If animations are active, the elements haven't moved yet compared to state before update.\n // But if they will, we are activating the elements that would be active, if this check\n // was done after the animations have completed. => \"final positions\".\n // If there is no animations, the \"final\" and \"current\" positions are equal.\n // This is done so we do not have to evaluate the active elements each animation frame\n // - it would be expensive.\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n\n if (inChartArea) {\n // Set _lastEvent to null while we are processing the event handlers.\n // This prevents recursion if the handler calls chart.update()\n this._lastEvent = null;\n\n // Invoke onHover hook\n callCallback(options.onHover, [e, active, this], this);\n\n if (isClick) {\n callCallback(options.onClick, [e, active, this], this);\n }\n }\n\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n\n this._lastEvent = lastEvent;\n\n return changed;\n }\n\n /**\n * @param {ChartEvent} e - The event\n * @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements\n * @param {boolean} inChartArea - Is the envent inside chartArea\n * @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after animation) element positions\n * @returns {import('../types/index.js').ActiveElement[]} - The active elements\n * @pravate\n */\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n return lastActive;\n }\n\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\n\n// @ts-ignore\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart) => chart._plugins.invalidate());\n}\n\nexport default Chart;\n","import Element from '../core/core.element.js';\nimport {_angleBetween, getAngleFromPoint, TAU, HALF_PI, valueOrDefault} from '../helpers/index.js';\nimport {PI, _isBetween, _limitValue} from '../helpers/helpers.math.js';\nimport {_readValueToProps} from '../helpers/helpers.options.js';\nimport type {ArcOptions, Point} from '../types/index.js';\n\n\nfunction clipArc(ctx: CanvasRenderingContext2D, element: ArcElement, endAngle: number) {\n const {startAngle, pixelMargin, x, y, outerRadius, innerRadius} = element;\n let angleMargin = pixelMargin / outerRadius;\n\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\n\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, ['outerStart', 'outerEnd', 'innerStart', 'innerEnd']);\n}\n\n/**\n * Parse border radius from the provided options\n */\nfunction parseBorderRadius(arc: ArcElement, innerRadius: number, outerRadius: number, angleDelta: number) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val) => {\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit),\n };\n}\n\n/**\n * Convert (r, 𝜃) to (x, y)\n */\nfunction rThetaToXY(r: number, theta: number, x: number, y: number) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta),\n };\n}\n\n\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */\nfunction pathArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n end: number,\n circular: boolean,\n) {\n const {x, y, startAngle: start, pixelMargin, innerRadius: innerR} = element;\n\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n\n let spacingOffset = 0;\n const alpha = end - start;\n\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? (alpha * avNogSpacingRadius) / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const {outerStart, outerEnd, innerStart, innerEnd} = parseBorderRadius(element, innerRadius, outerRadius, endAngle - startAngle);\n\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n\n ctx.beginPath();\n\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = ((endAngle - (innerEnd / innerRadius)) + (startAngle + (innerStart / innerRadius))) / 2;\n ctx.arc(x, y, innerRadius, endAngle - (innerEnd / innerRadius), innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + (innerStart / innerRadius), true);\n\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n\n ctx.closePath();\n}\n\nfunction drawArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference} = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\n\nfunction drawBorder(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference, options} = element;\n const {borderWidth, borderJoinStyle, borderDash, borderDashOffset} = options;\n const inner = options.borderAlign === 'inner';\n\n if (!borderWidth) {\n return;\n }\n\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\n\nexport interface ArcProps extends Point {\n startAngle: number;\n endAngle: number;\n innerRadius: number;\n outerRadius: number;\n circumference: number;\n}\n\nexport default class ArcElement extends Element {\n\n static id = 'arc';\n\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true,\n };\n\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash'\n };\n\n circumference: number;\n endAngle: number;\n fullCircles: number;\n innerRadius: number;\n outerRadius: number;\n pixelMargin: number;\n startAngle: number;\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(chartX: number, chartY: number, useFinalPosition: boolean) {\n const point = this.getProps(['x', 'y'], useFinalPosition);\n const {angle, distance} = getAngleFromPoint(point, {x: chartX, y: chartY});\n const {startAngle, endAngle, innerRadius, outerRadius, circumference} = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n\n return (betweenAngles && withinRadius);\n }\n\n getCenterPoint(useFinalPosition: boolean) {\n const {x, y, startAngle, endAngle, innerRadius, outerRadius} = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ], useFinalPosition);\n const {offset, spacing} = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n\n tooltipPosition(useFinalPosition: boolean) {\n return this.getCenterPoint(useFinalPosition);\n }\n\n draw(ctx: CanvasRenderingContext2D) {\n const {options, circumference} = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = (options.borderAlign === 'inner') ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n\n ctx.save();\n\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n\n ctx.restore();\n }\n}\n","import Element from '../core/core.element.js';\nimport {_bezierInterpolation, _pointInLine, _steppedInterpolation} from '../helpers/helpers.interpolation.js';\nimport {_computeSegments, _boundSegments} from '../helpers/helpers.segment.js';\nimport {_steppedLineTo, _bezierCurveTo} from '../helpers/helpers.canvas.js';\nimport {_updateBezierControlPoints} from '../helpers/helpers.curve.js';\nimport {valueOrDefault} from '../helpers/index.js';\n\n/**\n * @typedef { import('./element.point.js').default } PointElement\n */\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\n\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @returns {any}\n */\nfunction getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n\n return lineTo;\n}\n\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const {start: paramsStart = 0, end: paramsEnd = count - 1} = params;\n const {start: segmentStart, end: segmentEnd} = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction pathSegment(ctx, line, segment, params) {\n const {points, options} = line;\n const {count, start, loop, ilen} = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n // eslint-disable-next-line prefer-const\n let {move = true, reverse} = params || {};\n let i, point, prev;\n\n for (i = 0; i <= ilen; ++i) {\n point = points[(start + (reverse ? ilen - i : i)) % count];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n prev = point;\n }\n\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n return !!loop;\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const {count, start, ilen} = pathVars(points, segment, params);\n const {move = true, reverse} = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n\n const pointIndex = (index) => (start + (reverse ? ilen - index : index)) % count;\n const drawX = () => {\n if (minY !== maxY) {\n // Draw line to maxY and minY, using the average x-coordinate\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n // Line to y-value of last point in group. So the line continues\n // from correct position. Not using move, to have solid path.\n ctx.lineTo(avgX, lastY);\n }\n };\n\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n\n for (i = 0; i <= ilen; ++i) {\n point = points[pointIndex(i)];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n }\n\n const x = point.x;\n const y = point.y;\n const truncX = x | 0; // truncated x-coordinate\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n // Draw line to next x-position, using the first (or only)\n // y-value in that group\n ctx.lineTo(x, y);\n\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n // Keep track of the last y-value in group\n lastY = y;\n }\n drawX();\n}\n\n/**\n * @param {LineElement} line - the line\n * @returns {function}\n * @private\n */\nfunction _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n\n/**\n * @private\n */\nfunction _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n\n return _pointInLine;\n}\n\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\n\nfunction strokePathDirect(ctx, line, start, count) {\n const {segments, options} = line;\n const segmentMethod = _getSegmentMethod(line);\n\n for (const segment of segments) {\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {start, end: start + count - 1})) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\n\nconst usePath2D = typeof Path2D === 'function';\n\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\n\nexport default class LineElement extends Element {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0,\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash' && name !== 'fill',\n };\n\n\n constructor(cfg) {\n super();\n\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n\n get points() {\n return this._points;\n }\n\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n\n /**\n\t * First non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n\n /**\n\t * Last non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n\n /**\n\t * Interpolate a point in this line at the same value on `property` as\n\t * the reference `point` provided\n\t * @param {PointElement} point - the reference point\n\t * @param {string} property - the property to match on\n\t * @returns {PointElement|undefined}\n\t */\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {property, start: value, end: value});\n\n if (!segments.length) {\n return;\n }\n\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for (i = 0, ilen = segments.length; i < ilen; ++i) {\n const {start, end} = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n\n /**\n\t * Append a segment of this line to current path.\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} segment\n\t * @param {number} segment.start - start index of the segment, referring the points array\n \t * @param {number} segment.end - end index of the segment, referring the points array\n \t * @param {boolean} segment.loop - indicates that the segment is a loop\n\t * @param {object} params\n\t * @param {boolean} params.move - move to starting point (vs line to it)\n\t * @param {boolean} params.reverse - path the segment from end to start\n\t * @param {number} params.start - limit segment to points starting from `start` index\n\t * @param {number} params.end - limit segment to points ending at `start` + `count` index\n\t * @returns {undefined|boolean} - true if the segment is a full loop (path should be closed)\n\t */\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n\n /**\n\t * Append all segments of this line to current path.\n\t * @param {CanvasRenderingContext2D|Path2D} ctx\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t * @returns {undefined|boolean} - true if line is a full loop (path should be closed)\n\t */\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n\n start = start || 0;\n count = count || (this.points.length - start);\n\n for (const segment of segments) {\n loop &= segmentMethod(ctx, this, segment, {start, end: start + count - 1});\n }\n return !!loop;\n }\n\n /**\n\t * Draw\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} chartArea\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t */\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n\n if (points.length && options.borderWidth) {\n ctx.save();\n\n draw(ctx, this, start, count);\n\n ctx.restore();\n }\n\n if (this.animated) {\n // When line is animated, the control points and path are not cached.\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n","import Element from '../core/core.element.js';\nimport {drawPoint, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport type {\n CartesianParsedData,\n ChartArea,\n Point,\n PointHoverOptions,\n PointOptions,\n} from '../types/index.js';\n\nfunction inRange(el: PointElement, pos: number, axis: 'x' | 'y', useFinalPosition?: boolean) {\n const options = el.options;\n const {[axis]: value} = el.getProps([axis], useFinalPosition);\n\n return (Math.abs(pos - value) < options.radius + options.hitRadius);\n}\n\nexport type PointProps = Point\n\nexport default class PointElement extends Element {\n\n static id = 'point';\n\n parsed: CartesianParsedData;\n skip?: boolean;\n stop?: boolean;\n\n /**\n * @type {any}\n */\n static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean) {\n const options = this.options;\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return ((Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2)) < Math.pow(options.hitRadius + options.radius, 2));\n }\n\n inXRange(mouseX: number, useFinalPosition?: boolean) {\n return inRange(this, mouseX, 'x', useFinalPosition);\n }\n\n inYRange(mouseY: number, useFinalPosition?: boolean) {\n return inRange(this, mouseY, 'y', useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition?: boolean) {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y};\n }\n\n size(options?: Partial) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n\n draw(ctx: CanvasRenderingContext2D, area: ChartArea) {\n const options = this.options;\n\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n","import Element from '../core/core.element.js';\nimport {isObject, _isBetween, _limitValue} from '../helpers/index.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {toTRBL, toTRBLCorners} from '../helpers/helpers.options.js';\n\n/** @typedef {{ x: number, y: number, base: number, horizontal: boolean, width: number, height: number }} BarProps */\n\n/**\n * Helper function to get the bounds of the bar regardless of the orientation\n * @param {BarElement} bar the bar\n * @param {boolean} [useFinalPosition]\n * @return {object} bounds of the bar\n * @private\n */\nfunction getBarBounds(bar, useFinalPosition) {\n const {x, y, base, width, height} = /** @type {BarProps} */ (bar.getProps(['x', 'y', 'base', 'width', 'height'], useFinalPosition));\n\n let left, right, top, bottom, half;\n\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n\n return {left, top, right, bottom};\n}\n\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\n\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\n\nfunction parseBorderRadius(bar, maxW, maxH) {\n const {enableBorderRadius} = bar.getProps(['enableBorderRadius']);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n\n // If the value is an object, assume the user knows what they are doing\n // and apply as directed.\n const enableBorder = enableBorderRadius || isObject(value);\n\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\n\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)),\n }\n }\n };\n}\n\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n\n return bounds\n\t\t&& (skipX || _isBetween(x, bounds.left, bounds.right))\n\t\t&& (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\n\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n\n/**\n * Add a path of a rectangle to the current sub-path\n * @param {CanvasRenderingContext2D} ctx Context\n * @param {*} rect Bounding rect\n */\nfunction addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\n\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\n\nexport default class BarElement extends Element {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n draw(ctx) {\n const {inflateAmount, options: {borderColor, backgroundColor}} = this;\n const {inner, outer} = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n\n ctx.save();\n\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n\n ctx.restore();\n }\n\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition) {\n const {x, y, base, horizontal} = /** @type {BarProps} */ (this.getProps(['x', 'y', 'base', 'horizontal'], useFinalPosition));\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n","import {DoughnutController, PolarAreaController} from '../index.js';\nimport type {Chart, ChartDataset} from '../types.js';\n\nexport interface ColorsPluginOptions {\n enabled?: boolean;\n forceOverride?: boolean;\n}\n\ninterface ColorsDescriptor {\n backgroundColor?: unknown;\n borderColor?: unknown;\n}\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)', // blue\n 'rgb(255, 99, 132)', // red\n 'rgb(255, 159, 64)', // orange\n 'rgb(255, 205, 86)', // yellow\n 'rgb(75, 192, 192)', // green\n 'rgb(153, 102, 255)', // purple\n 'rgb(201, 203, 207)' // grey\n];\n\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map(color => color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\n\nfunction getBorderColor(i: number) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\n\nfunction getBackgroundColor(i: number) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\n\nfunction colorizeDefaultDataset(dataset: ChartDataset, i: number) {\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n\n return ++i;\n}\n\nfunction colorizeDoughnutDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBorderColor(i++));\n\n return i;\n}\n\nfunction colorizePolarAreaDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBackgroundColor(i++));\n\n return i;\n}\n\nfunction getColorizer(chart: Chart) {\n let i = 0;\n\n return (dataset: ChartDataset, datasetIndex: number) => {\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n\n if (controller instanceof DoughnutController) {\n i = colorizeDoughnutDataset(dataset, i);\n } else if (controller instanceof PolarAreaController) {\n i = colorizePolarAreaDataset(dataset, i);\n } else if (controller) {\n i = colorizeDefaultDataset(dataset, i);\n }\n };\n}\n\nfunction containsColorsDefinitions(\n descriptors: ColorsDescriptor[] | Record\n) {\n let k: number | string;\n\n for (k in descriptors) {\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction containsColorsDefinition(\n descriptor: ColorsDescriptor\n) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\n\nexport default {\n id: 'colors',\n\n defaults: {\n enabled: true,\n forceOverride: false\n } as ColorsPluginOptions,\n\n beforeLayout(chart: Chart, _args, options: ColorsPluginOptions) {\n if (!options.enabled) {\n return;\n }\n\n const {\n data: {datasets},\n options: chartOptions\n } = chart.config;\n const {elements} = chartOptions;\n\n if (!options.forceOverride && (containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || (elements && containsColorsDefinitions(elements)))) {\n return;\n }\n\n const colorizer = getColorizer(chart);\n\n datasets.forEach(colorizer);\n }\n};\n","import {_limitValue, _lookupByKey, isNullOrUndef, resolve} from '../helpers/index.js';\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n /**\n * Implementation of the Largest Triangle Three Buckets algorithm.\n *\n * This implementation is based on the original implementation by Sveinn Steinarsson\n * in https://github.com/sveinn-steinarsson/flot-downsample/blob/master/jquery.flot.downsample.js\n *\n * The original implementation is MIT licensed.\n */\n const samples = options.samples || availableWidth;\n // There are less points than the threshold, returning the whole array\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n\n const decimated = [];\n\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n // Starting from offset\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n\n decimated[sampledIndex++] = data[a];\n\n for (i = 0; i < samples - 2; i++) {\n let avgX = 0;\n let avgY = 0;\n let j;\n\n // Adding offset\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n\n for (j = avgRangeStart; j < avgRangeEnd; j++) {\n avgX += data[j].x;\n avgY += data[j].y;\n }\n\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n\n // Adding offset\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const {x: pointAx, y: pointAy} = data[a];\n\n // Note that this is changed from the original algorithm which initializes these\n // values to 1. The reason for this change is that if the area is small, nextA\n // would never be set and thus a crash would occur in the next loop as `a` would become\n // `undefined`. Since the area is always positive, but could be 0 in the case of a flat trace,\n // initializing with a negative number is the correct solution.\n maxArea = area = -1;\n\n for (j = rangeOffs; j < rangeTo; j++) {\n area = 0.5 * Math.abs(\n (pointAx - avgX) * (data[j].y - pointAy) -\n (pointAx - data[j].x) * (avgY - pointAy)\n );\n\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n\n // Include the last point\n decimated[sampledIndex++] = data[endIndex];\n\n return decimated;\n}\n\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n\n for (i = start; i < start + count; ++i) {\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n // Use point.x here because we're computing the average data `x` value\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n // Push up to 4 points, 3 for the last interval and the first point for this interval\n const lastIndex = i - 1;\n\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n // The interval is defined by 4 points: start, min, max, end.\n // The starting point is already considered at this point, so we need to determine which\n // of the other points to add. We need to sort these points to ensure the decimated data\n // is still sorted and then ensure there are no duplicates.\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX,\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n\n // lastIndex === startIndex will occur when a range has only 1 point which could\n // happen with very uneven data\n if (i > 0 && lastIndex !== startIndex) {\n // Last point in the previous interval\n decimated.push(data[lastIndex]);\n }\n\n // Start of the new interval\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n\n return decimated;\n}\n\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data,\n });\n }\n}\n\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset) => {\n cleanDecimatedDataset(dataset);\n });\n}\n\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n\n let start = 0;\n let count;\n\n const {iScale} = meta;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n\n return {start, count};\n}\n\nexport default {\n id: 'decimation',\n\n defaults: {\n algorithm: 'min-max',\n enabled: false,\n },\n\n beforeElementsUpdate: (chart, args, options) => {\n if (!options.enabled) {\n // The decimation plugin may have been previously enabled. Need to remove old `dataset._data` handlers\n cleanDecimatedData(chart);\n return;\n }\n\n // Assume the entire chart is available to show a few more points than needed\n const availableWidth = chart.width;\n\n chart.data.datasets.forEach((dataset, datasetIndex) => {\n const {_data, indexAxis} = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n\n if (resolve([indexAxis, chart.options.indexAxis]) === 'y') {\n // Decimation is only supported for lines that have an X indexAxis\n return;\n }\n\n if (!meta.controller.supportsDecimation) {\n // Only line datasets are supported\n return;\n }\n\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n // Only linear interpolation is supported\n return;\n }\n\n if (chart.options.parsing) {\n // Plugin only supports data that does not need parsing\n return;\n }\n\n let {start, count} = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n // No decimation is required until we are above this threshold\n cleanDecimatedDataset(dataset);\n return;\n }\n\n if (isNullOrUndef(_data)) {\n // First time we are seeing this dataset\n // We override the 'data' property with a setter that stores the\n // raw data in _data, but reads the decimated data from _decimated\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n\n // Point the chart to the decimated data\n let decimated;\n switch (options.algorithm) {\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n\n dataset._decimated = decimated;\n });\n },\n\n destroy(chart) {\n cleanDecimatedData(chart);\n }\n};\n","import {_boundSegment, _boundSegments, _normalizeAngle} from '../../helpers/index.js';\n\nexport function _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n\n for (const segment of segments) {\n let {start, end} = segment;\n end = _findSegmentEnd(start, end, points);\n\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n\n if (!target.segments) {\n // Special case for boundary not supporting `segments` (simpleArc)\n // Bounds are provided as `target` for partial circle, or undefined for full circle\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n\n // Get all segments from `target` that intersect the bounds of current segment of `line`\n const targetSegments = _boundSegments(target, bounds);\n\n for (const tgt of targetSegments) {\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n\n for (const fillSource of fillSources) {\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\n\nexport function _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {property, start, end};\n}\n\nexport function _pointsFromSegments(boundary, line) {\n const {x = null, y = null} = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({start, end}) => {\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({x: first.x, y});\n points.push({x: last.x, y});\n } else if (x !== null) {\n points.push({x, y: first.y});\n points.push({x, y: last.y});\n }\n });\n return points;\n}\n\nexport function _findSegmentEnd(start, end, points) {\n for (;end > start; end--) {\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\n\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {isArray} from '../../helpers/index.js';\nimport {_pointsFromSegments} from './filler.segment.js';\n\n/**\n * @param {PointElement[] | { x: number; y: number; }} boundary\n * @param {LineElement} line\n * @return {LineElement?}\n */\nexport function _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n\n if (isArray(boundary)) {\n _loop = true;\n // @ts-ignore\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n\n return points.length ? new LineElement({\n points,\n options: {tension: 0},\n _loop,\n _fullLoop: _loop\n }) : null;\n}\n\nexport function _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n","import {isObject, isFinite, valueOrDefault} from '../../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.line.js').default } LineElement\n * @typedef { import('../../types/index.js').FillTarget } FillTarget\n * @typedef { import('../../types/index.js').ComplexFillTarget } ComplexFillTarget\n */\n\nexport function _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [index];\n let target;\n\n if (!propagate) {\n return fill;\n }\n\n while (fill !== false && visited.indexOf(fill) === -1) {\n if (!isFinite(fill)) {\n return fill;\n }\n\n target = sources[fill];\n if (!target) {\n return false;\n }\n\n if (target.visible) {\n return fill;\n }\n\n visited.push(fill);\n fill = target.fill;\n }\n\n return false;\n}\n\n/**\n * @param {LineElement} line\n * @param {number} index\n * @param {number} count\n */\nexport function _decodeFill(line, index, count) {\n /** @type {string | {value: number}} */\n const fill = parseFillOption(line);\n\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n\n let target = parseFloat(fill);\n\n if (isFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n\n return ['origin', 'start', 'end', 'stack', 'shape'].indexOf(fill) >= 0 && fill;\n}\n\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n\n return target;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @returns {number | null}\n */\nexport function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n // @ts-ignore\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @param {number} startValue\n * @returns {number | undefined}\n */\nexport function _getTargetValue(fill, scale, startValue) {\n let value;\n\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n // @ts-ignore\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n\n/**\n * @param {LineElement} line\n */\nfunction parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n\n if (fill === false || fill === null) {\n return false;\n }\n\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {_isBetween} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\n\n/**\n * @param {{ chart: Chart; scale: Scale; index: number; line: LineElement; }} source\n * @return {LineElement}\n */\nexport function _buildStackLine(source) {\n const {scale, index, line} = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({x: null, y: scale.bottom}, line));\n\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n for (let j = segment.start; j <= segment.end; j++) {\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({points, options: {}});\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @return {LineElement[]}\n */\nfunction getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n\n for (let i = 0; i < metas.length; i++) {\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n\n/**\n * @param {PointElement[]} points\n * @param {PointElement} sourcePoint\n * @param {LineElement[]} linesBelow\n */\nfunction addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for (let j = 0; j < linesBelow.length; j++) {\n const line = linesBelow[j];\n const {first, last, point} = findPoint(line, sourcePoint, 'x');\n\n if (!point || (first && last)) {\n continue;\n }\n if (first) {\n // First point of an segment -> need to add another point before this,\n // from next line below.\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n // In the middle of an segment, no need to add more points.\n break;\n }\n }\n }\n points.push(...postponed);\n}\n\n/**\n * @param {LineElement} line\n * @param {PointElement} sourcePoint\n * @param {string} property\n * @returns {{point?: PointElement, first?: boolean, last?: boolean}}\n */\nfunction findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {first, last, point};\n}\n","import {TAU} from '../../helpers/index.js';\n\n// TODO: use elements.ArcElement instead\nexport class simpleArc {\n constructor(opts) {\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n\n pathSegment(ctx, bounds, opts) {\n const {x, y, radius} = this;\n bounds = bounds || {start: 0, end: TAU};\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n\n interpolate(point) {\n const {x, y, radius} = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n","import {isFinite} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\nimport {_getTargetPixel, _getTargetValue} from './filler.options.js';\nimport {_buildStackLine} from './filler.target.stack.js';\nimport {simpleArc} from './simpleArc.js';\n\n/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nexport function _getTarget(source) {\n const {chart, fill, line} = source;\n\n if (isFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n\n if (fill === 'shape') {\n return true;\n }\n\n const boundary = computeBoundary(source);\n\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n\n return _createBoundaryLine(boundary, line);\n}\n\n/**\n * @param {Chart} chart\n * @param {number} index\n */\nfunction getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\n\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\n\n\nfunction computeLinearBoundary(source) {\n const {scale = {}, fill} = source;\n const pixel = _getTargetPixel(fill, scale);\n\n if (isFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n\n return null;\n}\n\nfunction computeCircularBoundary(source) {\n const {scale, fill} = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n\n for (let i = 0; i < length; ++i) {\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\n","import {clipArea, unclipArea} from '../../helpers/index.js';\nimport {_findSegmentEnd, _getBounds, _segments} from './filler.segment.js';\nimport {_getTarget} from './filler.target.js';\n\nexport function _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const {line, scale, axis} = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const {above = color, below = color} = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {line, target, above, below, area, scale, axis});\n unclipArea(ctx);\n }\n}\n\nfunction doFill(ctx, cfg) {\n const {line, target, above, below, area, scale} = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n\n ctx.save();\n\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {line, target, color: above, scale, property});\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {line, target, color: below, scale, property});\n\n ctx.restore();\n}\n\nfunction clipVertical(ctx, target, clipY) {\n const {segments, points} = target;\n let first = true;\n let lineLoop = false;\n\n ctx.beginPath();\n for (const segment of segments) {\n const {start, end} = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {move: lineLoop});\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\n\nfunction fill(ctx, cfg) {\n const {line, target, property, color, scale} = cfg;\n const segments = _segments(line, target, property);\n\n for (const {source: src, target: tgt, start, end} of segments) {\n const {style: {backgroundColor = color} = {}} = src;\n const notShape = target !== true;\n\n ctx.save();\n ctx.fillStyle = backgroundColor;\n\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n\n ctx.beginPath();\n\n const lineLoop = !!line.pathSegment(ctx, src);\n\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n\n const targetLoop = !!target.pathSegment(ctx, tgt, {move: lineLoop, reverse: true});\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n\n ctx.restore();\n }\n}\n\nfunction clipBounds(ctx, scale, bounds) {\n const {top, bottom} = scale.chart.chartArea;\n const {property, start, end} = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\n\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\n","/**\n * Plugin based on discussion from the following Chart.js issues:\n * @see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569\n * @see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897\n */\n\nimport LineElement from '../../elements/element.line.js';\nimport {_drawfill} from './filler.drawing.js';\nimport {_shouldApplyFill} from './filler.helper.js';\nimport {_decodeFill, _resolveTarget} from './filler.options.js';\n\nexport default {\n id: 'filler',\n\n afterDatasetsUpdate(chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n\n for (i = 0; i < count; ++i) {\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line,\n };\n }\n\n meta.$filler = source;\n sources.push(source);\n }\n\n for (i = 0; i < count; ++i) {\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n\n beforeDraw(chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n\n beforeDatasetsDraw(chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n\n const metasets = chart.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n\n beforeDatasetDraw(chart, args, options) {\n const source = args.meta.$filler;\n\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n","import defaults from '../core/core.defaults.js';\nimport Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {addRoundedRectPath, drawPointLegend, renderText} from '../helpers/helpers.canvas.js';\nimport {\n _isBetween,\n callback as call,\n clipArea,\n getRtlAdapter,\n overrideTextDirection,\n restoreTextDirection,\n toFont,\n toPadding,\n unclipArea,\n valueOrDefault,\n} from '../helpers/index.js';\nimport {_alignStartEnd, _textX, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {toTRBLCorners} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n */\n\nconst getBoxSize = (labelOpts, fontSize) => {\n let {boxHeight = fontSize, boxWidth = fontSize} = labelOpts;\n\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\n\nconst itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\n\nexport class Legend extends Element {\n\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this._added = false;\n\n // Contains hit boxes for each dataset (in dataset order)\n this.legendHitBoxes = [];\n\n /**\n \t\t * @private\n \t\t */\n this._hoveredItem = null;\n\n // Are we in doughnut mode which has a different data type\n this.doughnutMode = false;\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = call(labelOpts.generateLabels, [this.chart], this) || [];\n\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));\n }\n\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, this.chart.data));\n }\n\n if (this.options.reverse) {\n legendItems.reverse();\n }\n\n this.legendItems = legendItems;\n }\n\n fit() {\n const {options, ctx} = this;\n\n // The legend may not be displayed for a variety of reasons including\n // the fact that the defaults got set to `false`.\n // When the legend is not displayed, there are no guarantees that the options\n // are correctly formatted so we need to bail out as early as possible.\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const {boxWidth, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n let width, height;\n\n ctx.font = labelFont.string;\n\n if (this.isHorizontal()) {\n width = this.maxWidth; // fill all the width\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight; // fill all the height\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n\n /**\n\t * @private\n\t */\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const {ctx, maxWidth, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one\n const lineWidths = this.lineWidths = [0];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i) => {\n const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n\n hitboxes[i] = {left: 0, top, row, width: itemWidth, height: itemHeight};\n\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n\n return totalHeight;\n }\n\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const {ctx, maxHeight, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n\n let left = 0;\n let col = 0;\n\n this.legendItems.forEach((legendItem, i) => {\n const {itemWidth, itemHeight} = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n\n // If too tall, go to new column\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n\n // Store the hitbox width and height here. Final position will be updated in `draw`\n hitboxes[i] = {left, top: currentColHeight, col, width: itemWidth, height: itemHeight};\n\n // Get max width\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n\n totalWidth += currentColWidth;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n\n return totalWidth;\n }\n\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const {legendHitBoxes: hitboxes, options: {align, labels: {padding}, rtl}} = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes) {\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes) {\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n\n this._draw();\n\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @private\n\t */\n _draw() {\n const {options: opts, columnSizes, lineWidths, ctx} = this;\n const {align, labels: labelOpts} = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const {padding} = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n\n this.drawTitle();\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n\n const {boxWidth, boxHeight, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n // current position\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n\n // Set the ctx for the box\n ctx.save();\n\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n\n if (labelOpts.usePointStyle) {\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n\n // Draw pointStyle as legend symbol\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n // Draw box as legend symbol\n // Adjust position when boxHeight < fontSize (want it centered)\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n\n ctx.beginPath();\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n\n ctx.restore();\n };\n\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + (itemHeight / 2), labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n\n // Horizontal\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n\n overrideTextDirection(this.ctx, opts.textDirection);\n\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i) => {\n ctx.strokeStyle = legendItem.fontColor; // for strikethrough effect\n ctx.fillStyle = legendItem.fontColor; // render in correct colour\n\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n\n rtlHelper.setWidth(this.width);\n\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n\n const realX = rtlHelper.x(x);\n\n drawLegendBox(realX, y, legendItem);\n\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n\n // Fill the actual label\n fillText(rtlHelper.x(x), y, legendItem);\n\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n\n if (!titleOpts.display) {\n return;\n }\n\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n\n // These defaults are used when the legend is vertical.\n // When horizontal, they are computed below.\n let left = this.left;\n let maxWidth = this.width;\n\n if (this.isHorizontal()) {\n // Move left / right so that the title is above the legend lines\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n // Move down so that the title is above the legend stack in every alignment\n const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n\n // Now that we know the left edge of the inner legend box, compute the correct\n // X coordinate from the title alignment\n const x = _alignStartEnd(position, left, left + maxWidth);\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n\n /**\n\t * @private\n\t */\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n\n /**\n\t * @private\n\t */\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n\n if (_isBetween(x, this.left, this.right)\n && _isBetween(y, this.top, this.bottom)) {\n // See if we are touching one of the dataset boxes\n lh = this.legendHitBoxes;\n for (i = 0; i < lh.length; ++i) {\n hitBox = lh[i];\n\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width)\n && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n // Touching an element\n return this.legendItems[i];\n }\n }\n }\n\n return null;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t */\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n\n // Chart event already has relative position in it\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n call(opts.onLeave, [e, previous, this], this);\n }\n\n this._hoveredItem = hoveredItem;\n\n if (hoveredItem && !sameItem) {\n call(opts.onHover, [e, hoveredItem, this], this);\n }\n } else if (hoveredItem) {\n call(opts.onClick, [e, hoveredItem, this], this);\n }\n }\n}\n\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {itemWidth, itemHeight};\n}\n\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b) => a.length > b.length ? a : b);\n }\n return boxWidth + (labelFont.size / 2) + ctx.measureText(legendItemText).width;\n}\n\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\n\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\n\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\n\nexport default {\n id: 'legend',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Legend,\n\n start(chart, _args, options) {\n const legend = chart.legend = new Legend({ctx: chart.ctx, options, chart});\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n\n stop(chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n\n // During the beforeUpdate step, the layout configuration needs to run\n // This ensures that if the legend position changes (via an option update)\n // the layout system respects the change. See https://github.com/chartjs/Chart.js/issues/7527\n beforeUpdate(chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n\n // The labels need to be built after datasets are updated to ensure that colors\n // and other styling are correct. See https://github.com/chartjs/Chart.js/issues/6968\n afterUpdate(chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n\n\n afterEvent(chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n\n // a callback that will handle\n onClick(e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n\n onHover: null,\n onLeave: null,\n\n labels: {\n color: (ctx) => ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n // Generates labels shown in the legend\n // Valid properties to return:\n // text : text to display\n // fillStyle : fill of coloured box\n // strokeStyle: stroke of coloured box\n // hidden : if this legend item refers to a hidden item\n // lineCap : cap style for line\n // lineDash\n // lineDashOffset :\n // lineJoin :\n // lineWidth :\n generateLabels(chart) {\n const datasets = chart.data.datasets;\n const {labels: {usePointStyle, pointStyle, textAlign, color, useBorderRadius, borderRadius}} = chart.legend.options;\n\n return chart._getSortedDatasetMetas().map((meta) => {\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n\n // Below is extra data used for toggling the datasets\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n\n title: {\n color: (ctx) => ctx.chart.options.color,\n display: false,\n position: 'center',\n text: '',\n }\n },\n\n descriptors: {\n _scriptable: (name) => !name.startsWith('on'),\n labels: {\n _scriptable: (name) => !['generateLabels', 'filter', 'sort'].includes(name),\n }\n },\n};\n","import Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {PI, isArray, toPadding, toFont} from '../helpers/index.js';\nimport {_toLeftRightCenter, _alignStartEnd} from '../helpers/helpers.extras.js';\nimport {renderText} from '../helpers/helpers.canvas.js';\n\nexport class Title extends Element {\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight) {\n const opts = this.options;\n\n this.left = 0;\n this.top = 0;\n\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n\n _drawArgs(offset) {\n const {top, left, bottom, right, options} = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {titleX, titleY, maxWidth, rotation};\n }\n\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n\n if (!opts.display) {\n return;\n }\n\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const {titleX, titleY, maxWidth, rotation} = this._drawArgs(offset);\n\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n}\n\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\n\nexport default {\n id: 'title',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Title,\n\n start(chart, _args, options) {\n createTitle(chart, options);\n },\n\n stop(chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n\n beforeUpdate(chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold',\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000 // by default greater than legend (1000) to be above\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import {Title} from './plugin.title.js';\nimport layouts from '../core/core.layouts.js';\n\nconst map = new WeakMap();\n\nexport default {\n id: 'subtitle',\n\n start(chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n\n stop(chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n\n beforeUpdate(chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal',\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500 // by default greater than legend (1000) and smaller than title (2000)\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import Animations from '../core/core.animations.js';\nimport Element from '../core/core.element.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {each, noop, isNullOrUndef, isArray, _elementsEqual, isObject} from '../helpers/helpers.core.js';\nimport {toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\nimport {getRtlAdapter, overrideTextDirection, restoreTextDirection} from '../helpers/helpers.rtl.js';\nimport {distanceBetweenPoints, _limitValue} from '../helpers/helpers.math.js';\nimport {createContext, drawPoint} from '../helpers/index.js';\n\n/**\n * @typedef { import('../platform/platform.base.js').Chart } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').ActiveElement } ActiveElement\n * @typedef { import('../core/core.interaction.js').InteractionItem } InteractionItem\n */\n\nconst positioners = {\n /**\n\t * Average mode places the tooltip at the average position of the elements shown\n\t */\n average(items) {\n if (!items.length) {\n return false;\n }\n\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n\n return {\n x: x / count,\n y: y / count\n };\n },\n\n /**\n\t * Gets the tooltip position nearest of the item nearest to the event position\n\t */\n nearest(items, eventPosition) {\n if (!items.length) {\n return false;\n }\n\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n\n return {\n x,\n y\n };\n }\n};\n\n// Helper to push or concat based on if the 2nd parameter is an array or not\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n}\n\n/**\n * Returns array of strings split by newline\n * @param {*} str - The value to split by newline.\n * @returns {string|string[]} value if newline present - Returned from String split() method\n * @function\n */\nfunction splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n\n\n/**\n * Private helper to create a tooltip item model\n * @param {Chart} chart\n * @param {ActiveElement} item - {element, index, datasetIndex} to create the tooltip item for\n * @return new tooltip item\n */\nfunction createTooltipItem(chart, item) {\n const {element, datasetIndex, index} = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const {label, value} = controller.getLabelAndValue(index);\n\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n\n/**\n * Get the size of the tooltip\n */\nfunction getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const {body, footer, title} = tooltip;\n const {boxWidth, boxHeight} = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n\n // Count of all lines in the body\n let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight\n\t\t\t+ (titleLineCount - 1) * options.titleSpacing\n\t\t\t+ options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n // Body lines may include some extra height depending on boxHeight\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight\n\t\t\t+ (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight\n\t\t\t+ (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop\n\t\t\t+ footerLineCount * footerFont.lineHeight\n\t\t\t+ (footerLineCount - 1) * options.footerSpacing;\n }\n\n // Title width\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n\n ctx.save();\n\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n\n // Body width\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n\n // Body lines may include some extra width due to the color box\n widthPadding = options.displayColors ? (boxWidth + 2 + options.boxPadding) : 0;\n each(body, (bodyItem) => {\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n\n // Reset back to 0\n widthPadding = 0;\n\n // Footer width\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n\n ctx.restore();\n\n // Add padding\n width += padding.width;\n\n return {width, height};\n}\n\nfunction determineYAlign(chart, size) {\n const {y, height} = size;\n\n if (y < height / 2) {\n return 'top';\n } else if (y > (chart.height - height / 2)) {\n return 'bottom';\n }\n return 'center';\n}\n\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const {x, width} = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\n\nfunction determineXAlign(chart, options, size, yAlign) {\n const {x, width} = size;\n const {width: chartWidth, chartArea: {left, right}} = chart;\n let xAlign = 'center';\n\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n\n return xAlign;\n}\n\n/**\n * Helper to get the alignment of a tooltip given the size\n */\nfunction determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\n\nfunction alignX(size, xAlign) {\n let {x, width} = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= (width / 2);\n }\n return x;\n}\n\nfunction alignY(size, yAlign, paddingAndSize) {\n // eslint-disable-next-line prefer-const\n let {y, height} = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= (height / 2);\n }\n return y;\n}\n\n/**\n * Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment\n */\nfunction getBackgroundPoint(options, size, alignment, chart) {\n const {caretSize, caretPadding, cornerRadius} = options;\n const {xAlign, yAlign} = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\n\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n\n return align === 'center'\n ? tooltip.x + tooltip.width / 2\n : align === 'right'\n ? tooltip.x + tooltip.width - padding.right\n : tooltip.x + padding.left;\n}\n\n/**\n * Helper to build before and after body lines\n */\nfunction getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\n\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\n\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\n\nconst defaultCallbacks = {\n // Args are: (tooltipItems, data)\n beforeTitle: noop,\n title(tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n\n return '';\n },\n afterTitle: noop,\n\n // Args are: (tooltipItems, data)\n beforeBody: noop,\n\n // Args are: (tooltipItem, data)\n beforeLabel: noop,\n label(tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n\n let label = tooltipItem.dataset.label || '';\n\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0,\n };\n },\n labelTextColor() {\n return this.options.bodyColor;\n },\n labelPointStyle(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation,\n };\n },\n afterLabel: noop,\n\n // Args are: (tooltipItems, data)\n afterBody: noop,\n\n // Args are: (tooltipItems, data)\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n\n/**\n * Invoke callback from object with context and arguments.\n * If callback returns `undefined`, then will be invoked default callback.\n * @param {Record} callbacks\n * @param {keyof typeof defaultCallbacks} name\n * @param {*} ctx\n * @param {*} arg\n * @returns {any}\n */\nfunction invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n\n return result;\n}\n\nexport class Tooltip extends Element {\n\n /**\n * @namespace Chart.Tooltip.positioners\n */\n static positioners = positioners;\n\n constructor(config) {\n super();\n\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n // TODO: V4, make this private, rename to `_labelStyles`, and combine with `labelPointStyles`\n // and `labelTextColors` to create a single variable\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n\n /**\n\t * @private\n\t */\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n\n if (cached) {\n return cached;\n }\n\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n\n return animations;\n }\n\n /**\n\t * @protected\n\t */\n getContext() {\n return this.$context ||\n\t\t\t(this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n\n getTitle(context, options) {\n const {callbacks} = options;\n\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n\n return lines;\n }\n\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems)\n );\n }\n\n getBody(tooltipItems, options) {\n const {callbacks} = options;\n const bodyItems = [];\n\n each(tooltipItems, (context) => {\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n\n bodyItems.push(bodyItem);\n });\n\n return bodyItems;\n }\n\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems)\n );\n }\n\n // Get the footer and beforeFooter and afterFooter lines\n getFooter(tooltipItems, options) {\n const {callbacks} = options;\n\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n\n return lines;\n }\n\n /**\n\t * @private\n\t */\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n\n for (i = 0, len = active.length; i < len; ++i) {\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n\n // If the user provided a filter function, use it to modify the tooltip items\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array) => options.filter(element, index, array, data));\n }\n\n // If the user provided a sorting function, use it to modify the tooltip items\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b) => options.itemSort(a, b, data));\n }\n\n // Determine colors for boxes\n each(tooltipItems, (context) => {\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n\n if (changed && options.external) {\n options.external.call(this, {chart: this.chart, tooltip: this, replay});\n }\n }\n\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n\n getCaretPosition(tooltipPoint, size, options) {\n const {xAlign, yAlign} = this;\n const {caretSize, cornerRadius} = options;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n const {x: ptX, y: ptY} = tooltipPoint;\n const {width, height} = size;\n let x1, x2, x3, y1, y2, y3;\n\n if (yAlign === 'center') {\n y2 = ptY + (height / 2);\n\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n\n // Left draws bottom -> top, this y1 is on the bottom\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n\n // Right draws top -> bottom, thus y1 is on the top\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + (caretSize);\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n\n // Top draws left -> right, thus x1 is on the left\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n\n // Bottom draws right -> left, thus x1 is on the right\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {x1, x2, x3, y1, y2, y3};\n }\n\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.titleAlign, options);\n\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing; // Line Height and spacing\n\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing\n }\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const {boxHeight, boxWidth} = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2, // fit the circle in the box\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n\n // Fill the point with white so that colours merge nicely if the opacity is < 1\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n\n // Draw the point\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n // Border\n ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : (labelColor.borderWidth || 1); // TODO, v4 remove fallback\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n\n // Fill a white rect so that colours merge nicely if the opacity is < 1\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = toTRBLCorners(labelColor.borderRadius);\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n ctx.fill();\n ctx.stroke();\n\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n // Normal rect\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n\n // restore fillStyle\n ctx.fillStyle = this.labelTextColors[i];\n }\n\n drawBody(pt, ctx, options) {\n const {body} = this;\n const {bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding} = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n\n // Before body lines\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right'\n ? bodyAlign === 'center' ? (boxWidth / 2 + boxPadding) : (boxWidth + 2 + boxPadding)\n : 0;\n\n // Draw body lines now\n for (i = 0, ilen = body.length; i < ilen; ++i) {\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n\n lines = bodyItem.lines;\n // Draw Legend-like boxes if needed\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n\n for (j = 0, jlen = lines.length; j < jlen; ++j) {\n fillLineOfText(lines[j]);\n // Reset for any lines that don't include colorbox\n bodyLineHeight = bodyFont.lineHeight;\n }\n\n each(bodyItem.after, fillLineOfText);\n }\n\n // Reset back to 0 for after body\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n\n // After body lines\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing; // Remove last body spacing\n }\n\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n\n footerFont = toFont(options.footerFont);\n\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n\n drawBackground(pt, ctx, tooltipSize, options) {\n const {xAlign, yAlign} = this;\n const {x, y} = pt;\n const {width, height} = tooltipSize;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(options.cornerRadius);\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n\n ctx.fill();\n\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n\n /**\n\t * Update x/y animation targets when _active elements are animating too\n\t * @private\n\t */\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n\n /**\n * Determine if the tooltip will draw anything\n * @returns {boolean} True if the tooltip will render\n */\n _willRender() {\n return !!this.opacity;\n }\n\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n\n if (!opacity) {\n return;\n }\n\n this._updateAnimationTarget(options);\n\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n\n // IE11/Edge does not like very small opacities, so snap to 0\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n\n const padding = toPadding(options.padding);\n\n // Truthy/falsey value for empty tooltip\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n\n // Draw Background\n this.drawBackground(pt, ctx, tooltipSize, options);\n\n overrideTextDirection(ctx, options.textDirection);\n\n pt.y += padding.top;\n\n // Titles\n this.drawTitle(pt, ctx, options);\n\n // Body\n this.drawBody(pt, ctx, options);\n\n // Footer\n this.drawFooter(pt, ctx, options);\n\n restoreTextDirection(ctx, options.textDirection);\n\n ctx.restore();\n }\n }\n\n /**\n\t * Get active elements in the tooltip\n\t * @returns {Array} Array of elements that are active in the tooltip\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active elements in the tooltip\n\t * @param {array} activeElements Array of active datasetIndex/index pairs.\n\t * @param {object} eventPosition Synthetic event position used in positioning\n\t */\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.chart.getDatasetMeta(datasetIndex);\n\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {boolean} true if the tooltip changed\n\t */\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n\n // When there are multiple items shown, but the tooltip position is nearest mode\n // an update may need to be made because our position may have changed even though\n // the items are the same as before.\n const positionChanged = this._positionChanged(active, e);\n\n // Remember Last Actives\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n\n // Only handle target event on tooltip change\n if (changed) {\n this._active = active;\n\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n\n this.update(true, replay);\n }\n }\n\n return changed;\n }\n\n /**\n\t * Helper for determining the active elements for event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {InteractionItem[]} lastActive - Previously active elements\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {InteractionItem[]} - Active elements\n\t * @private\n\t */\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n return lastActive;\n }\n\n // Find Active Elements for tooltips\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n\n if (options.reverse) {\n active.reverse();\n }\n\n return active;\n }\n\n /**\n\t * Determine if the active elements + event combination changes the\n\t * tooltip position\n\t * @param {array} active - Active elements\n\t * @param {ChartEvent} e - Event that triggered the position change\n\t * @returns {boolean} True if the position has changed\n\t */\n _positionChanged(active, e) {\n const {caretX, caretY, options} = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\n\nexport default {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n\n afterInit(chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({chart, options});\n }\n },\n\n beforeUpdate(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n reset(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n afterDraw(chart) {\n const tooltip = chart.tooltip;\n\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n\n if (chart.notifyPlugins('beforeTooltipDraw', {...args, cancelable: true}) === false) {\n return;\n }\n\n tooltip.draw(chart.ctx);\n\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n\n afterEvent(chart, args) {\n if (chart.tooltip) {\n // If the event is replayed from `update`, we should evaluate with the final positions.\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n // notify chart about the change, so it will render\n args.changed = true;\n }\n }\n },\n\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold',\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {\n },\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold',\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts) => opts.bodyFont.size,\n boxWidth: (ctx, opts) => opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart',\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'width', 'height', 'caretX', 'caretY'],\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n\n descriptors: {\n _scriptable: (name) => name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false,\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n\n // Resolve additionally from `interaction` options and defaults.\n additionalOptionScopes: ['interaction']\n};\n","import Scale from '../core/core.scale.js';\nimport {isNullOrUndef, valueOrDefault, _limitValue} from '../helpers/index.js';\n\nconst addIfString = (labels, raw, index, addedLabels) => {\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({index, label: raw});\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\n\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\n\nconst validIndex = (index, max) => index === null ? null : _limitValue(Math.round(index), 0, max);\n\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\n\nexport default class CategoryScale extends Scale {\n\n static id = 'category';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const {index, label} of added) {\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index\n : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n\n determineDataLimits() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this.getMinMax(true);\n\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n\n // If we are viewing some subset of labels, slice the original array\n labels = (min === 0 && max === labels.length - 1) ? labels : labels.slice(min, max + 1);\n\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n\n for (let value = min; value <= max; value++) {\n ticks.push({value});\n }\n return ticks;\n }\n\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n super.configure();\n\n if (!this.isHorizontal()) {\n // For backward compatibility, vertical category scale reverse is inverted.\n this._reversePixels = !this._reversePixels;\n }\n }\n\n // Used to get data value locations. Value can either be an index or a numerical value\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n // Must override base implementation because it calls getPixelForValue\n // and category scale can have duplicate values\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n\n getBasePixel() {\n return this.bottom;\n }\n}\n","import {isNullOrUndef} from '../helpers/helpers.core.js';\nimport {almostEquals, almostWhole, niceNum, _decimalPlaces, _setMinAndMaxByKey, sign, toRadians} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\n\n/**\n * Generate a set of linear ticks for an axis\n * 1. If generationOptions.min, generationOptions.max, and generationOptions.step are defined:\n * if (max - min) / step is an integer, ticks are generated as [min, min + step, ..., max]\n * Note that the generationOptions.maxCount setting is respected in this scenario\n *\n * 2. If generationOptions.min, generationOptions.max, and generationOptions.count is defined\n * spacing = (max - min) / count\n * Ticks are generated as [min, min + spacing, ..., max]\n *\n * 3. If generationOptions.count is defined\n * spacing = (niceMax - niceMin) / count\n *\n * 4. Compute optimal spacing of ticks using niceNum algorithm\n *\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, dataRange) {\n const ticks = [];\n // To get a \"nice\" value for the tick spacing, we will use the appropriately named\n // \"nice number\" algorithm. See https://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks\n // for details.\n\n const MIN_SPACING = 1e-14;\n const {bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds} = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const {min: rmin, max: rmax} = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n\n // Beyond MIN_SPACING floating point numbers being to lose precision\n // such that we can't do the math necessary to generate ticks\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [{value: rmin}, {value: rmax}];\n }\n\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n // If the calculated num of spaces exceeds maxNumSpaces, recalculate it\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n\n if (!isNullOrUndef(precision)) {\n // If the user specified a precision, round to that number of decimal places\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n // Case 1: If min, max and stepSize are set and they make an evenly spaced scale use it.\n // spacing = step;\n // numSpaces = (max - min) / spacing;\n // Note that we round here to handle the case where almostWhole translated an FP error\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n // Cases 2 & 3, we have a count specified. Handle optional user defined edges to the range.\n // Sometimes these are no-ops, but it makes the code a lot clearer\n // and when a user defined range is specified, we want the correct ticks\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n // Case 4\n numSpaces = (niceMax - niceMin) / spacing;\n\n // If very close to our rounded value, use it.\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n\n // The spacing will have changed in cases 1, 2, and 3 so the factor cannot be computed\n // until this point\n const decimalPlaces = Math.max(\n _decimalPlaces(spacing),\n _decimalPlaces(niceMin)\n );\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({value: min});\n\n if (niceMin < min) {\n j++; // Skip niceMin\n }\n // If the next nice tick is close to min, skip it\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n\n for (; j < numSpaces; ++j) {\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) {\n break;\n }\n ticks.push({value: tickValue});\n }\n\n if (maxDefined && includeBounds && niceMax !== max) {\n // If the previous tick is too close to max, replace it with max, else add max\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({value: max});\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({value: niceMax});\n }\n\n return ticks;\n}\n\nfunction relativeLabelSize(value, minSpacing, {horizontal, minRotation}) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\n\nexport default class LinearScaleBase extends Scale {\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n /** @type {number} */\n this._endValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n\n return +raw;\n }\n\n handleTickRangeOptions() {\n const {beginAtZero} = this.options;\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n\n setMax(max + offset);\n\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n\n getTickLimit() {\n const tickOpts = this.options.ticks;\n // eslint-disable-next-line prefer-const\n let {maxTicksLimit, stepSize} = tickOpts;\n let maxTicks;\n\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n\n return maxTicks;\n }\n\n /**\n\t * @protected\n\t */\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n // Figure out what the max number of ticks we can support it is based on the size of\n // the axis area. For now, we say that the minimum tick spacing in pixels must be 40\n // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n // the graph. Make sure we always have at least 2 ticks\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks(numericGeneratorOptions, dataRange);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n\n super.configure();\n\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n","import {isFinite} from '../helpers/helpers.core.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {toRadians} from '../helpers/index.js';\n\nexport default class LinearScale extends LinearScaleBase {\n\n static id = 'linear';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? min : 0;\n this.max = isFinite(max) ? max : 1;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n \t */\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n\n // Utils\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n","import {finiteOrDefault, isFinite} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {_setMinAndMaxByKey, log10} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\n\nconst log10Floor = v => Math.floor(log10(v));\nconst changeExponent = (v, m) => Math.pow(10, log10Floor(v) + m);\n\nfunction isMajor(tickVal) {\n const remain = tickVal / (Math.pow(10, log10Floor(tickVal)));\n return remain === 1;\n}\n\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\n\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while (steps(min, max, rangeExp) > 10) {\n rangeExp++;\n }\n while (steps(min, max, rangeExp) < 10) {\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n\n\n/**\n * Generate a set of logarithmic ticks\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, {min, max}) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while (value < max) {\n ticks.push({value, major: isMajor(value), significand});\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({value: lastTick, major: isMajor(lastTick), significand});\n\n return ticks;\n}\n\nexport default class LogarithmicScale extends Scale {\n\n static id = 'logarithmic';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [raw, index]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isFinite(value) && value > 0 ? value : null;\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? Math.max(0, min) : null;\n this.max = isFinite(max) ? Math.max(0, max) : null;\n\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n\n // if data has `0` in it or `beginAtZero` is true, min (non zero) value is at bottom\n // of scale, and it does not equal suggestedMin, lower the min bound by one exp.\n if (this._zero && this.min !== this._suggestedMin && !isFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n\n this.handleTickRangeOptions();\n }\n\n handleTickRangeOptions() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (min === max) {\n if (min <= 0) { // includes null\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n\n setMax(changeExponent(min, +1));\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const opts = this.options;\n\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value === undefined\n ? '0'\n : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const start = this.min;\n\n super.configure();\n\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min\n ? 0\n : (log10(value) - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n","import defaults from '../core/core.defaults.js';\nimport {_longestText, addRoundedRectPath, renderText, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport {HALF_PI, TAU, toDegrees, toRadians, _normalizeAngle, PI} from '../helpers/helpers.math.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {valueOrDefault, isArray, isFinite, callback as callCallback, isNullOrUndef} from '../helpers/helpers.core.js';\nimport {createContext, toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\n\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [label];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\n\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - (size / 2),\n end: pos + (size / 2)\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n\n return {\n start: pos,\n end: pos + size\n };\n}\n\n/**\n * Helper function to fit a radial linear scale with point labels\n */\nfunction fitWithPointLabels(scale) {\n\n // Right, this is really confusing and there is a lot of maths going on here\n // The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n //\n // Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n //\n // Solution:\n //\n // We assume the radius of the polygon is half the size of the canvas at first\n // at each index we check if the text overlaps.\n //\n // Where it does, we store that angle and that index.\n //\n // After finding the largest index and angle we calculate how much we need to remove\n // from the shape radius to move the point inwards by that x.\n //\n // We average the left and right distances to get the maximum shape radius that can fit in the box\n // along with labels.\n //\n // Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n // on each side, removing that from the size, halving it and adding the left x protrusion width.\n //\n // This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n // and position it in the most space efficient manner\n //\n // https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n\n // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n\n for (let i = 0; i < valueCount; i++) {\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n\n scale.setCenterPoint(\n orig.l - limits.l,\n limits.r - orig.r,\n orig.t - limits.t,\n limits.b - orig.b\n );\n\n // Now that text size is determined, compute the full positions\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\n\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\n\nfunction createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const {extra, additionalAngle, padding, size} = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n // if to draw or overlapped\n visible: true,\n\n // Text position\n x: pointLabelPosition.x,\n y,\n\n // Text rendering data\n textAlign,\n\n // Bounding box\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\n\nfunction isNotOverlapped(item, area) {\n if (!area) {\n return true;\n }\n const {left, top, right, bottom} = item;\n const apexesInArea = _isPointInArea({x: left, y: top}, area) || _isPointInArea({x: left, y: bottom}, area) ||\n _isPointInArea({x: right, y: top}, area) || _isPointInArea({x: right, y: bottom}, area);\n return !apexesInArea;\n}\n\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const {centerPointLabels, display} = opts.pointLabels;\n const itemOpts = {\n extra: getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? PI / valueCount : 0\n };\n let area;\n\n for (let i = 0; i < valueCount; i++) {\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n\n const item = createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === 'auto') {\n item.visible = isNotOverlapped(item, area);\n if (item.visible) {\n area = item;\n }\n }\n }\n return items;\n}\n\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n\n return 'right';\n}\n\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= (w / 2);\n }\n return x;\n}\n\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= (h / 2);\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\n\nfunction drawPointLabelBox(ctx, opts, item) {\n const {left, top, right, bottom} = item;\n const {backdropColor} = opts;\n\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(opts.borderRadius);\n const padding = toPadding(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n}\n\nfunction drawPointLabels(scale, labelCount) {\n const {ctx, options: {pointLabels}} = scale;\n\n for (let i = labelCount - 1; i >= 0; i--) {\n const item = scale._pointLabelItems[i];\n if (!item.visible) {\n // overlapping\n continue;\n }\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = toFont(optsAtIndex.font);\n const {x, y, textAlign} = item;\n\n renderText(\n ctx,\n scale._pointLabels[i],\n x,\n y + (plFont.lineHeight / 2),\n plFont,\n {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n }\n );\n }\n}\n\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const {ctx} = scale;\n if (circular) {\n // Draw circular arcs between the points\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n // Draw straight lines connecting each index\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n\n for (let i = 1; i < labelCount; i++) {\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\n\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n\n const {color, lineWidth} = gridLineOpts;\n\n if ((!circular && !labelCount) || !color || !lineWidth || radius < 0) {\n return;\n }\n\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\n\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\n\nexport default class RadialLinearScale extends LinearScaleBase {\n\n static id = 'radialLinear';\n\n /**\n * @type {any}\n */\n static defaults = {\n display: true,\n\n // Boolean - Whether to animate scaling the chart from the centre\n animate: true,\n position: 'chartArea',\n\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n\n grid: {\n circular: false\n },\n\n startAngle: 0,\n\n // label settings\n ticks: {\n // Boolean - Show a backdrop to the scale label\n showLabelBackdrop: true,\n\n callback: Ticks.formatters.numeric\n },\n\n pointLabels: {\n backdropColor: undefined,\n\n // Number - The backdrop padding above & below the label in pixels\n backdropPadding: 2,\n\n // Boolean - if true, show point labels\n display: true,\n\n // Number - Point label font size in pixels\n font: {\n size: 10\n },\n\n // Function - Used to convert point labels\n callback(label) {\n return label;\n },\n\n // Number - Additionl padding between scale and pointLabel\n padding: 5,\n\n // Boolean - if true, center point labels to slices in polar chart\n centerPointLabels: false\n }\n };\n\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.xCenter = undefined;\n /** @type {number} */\n this.yCenter = undefined;\n /** @type {number} */\n this.drawingArea = undefined;\n /** @type {string[]} */\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(false);\n\n this.min = isFinite(min) && !isNaN(min) ? min : 0;\n this.max = isFinite(max) && !isNaN(max) ? max : 0;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n\t */\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n\n // Point labels\n this._pointLabels = this.getLabels()\n .map((value, index) => {\n const label = callCallback(this.options.pointLabels.callback, [value, index], this);\n return label || label === 0 ? label : '';\n })\n .filter((v, i) => this.chart.getDataVisibility(i));\n }\n\n fit() {\n const opts = this.options;\n\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n\n // Take into account half font size + the yPadding of the top value\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n\n getPointLabelPosition(index) {\n const {left, top, right, bottom} = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom,\n };\n }\n\n /**\n\t * @protected\n\t */\n drawBackground() {\n const {backgroundColor, grid: {circular}} = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const {angleLines, grid, border} = opts;\n const labelCount = this._pointLabels.length;\n\n let i, offset, position;\n\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n\n if (grid.display) {\n this.ticks.forEach((tick, index) => {\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n\n if (angleLines.display) {\n ctx.save();\n\n for (i = labelCount - 1; i >= 0; i--) {\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const {color, lineWidth} = optsAtIndex;\n\n if (!lineWidth || !color) {\n continue;\n }\n\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {}\n\n /**\n\t * @protected\n\t */\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n if (!tickOpts.display) {\n return;\n }\n\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n\n this.ticks.forEach((tick, index) => {\n if (index === 0 && !opts.reverse) {\n return;\n }\n\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(\n -width / 2 - padding.left,\n -offset - tickFont.size / 2 - padding.top,\n width + padding.width,\n tickFont.size + padding.height\n );\n }\n\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth,\n });\n });\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {}\n}\n","import adapters from '../core/core.adapters.js';\nimport {callback as call, isFinite, isNullOrUndef, mergeIf, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toRadians, isNumber, _limitValue} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {_arrayUnique, _filterBetween, _lookup} from '../helpers/helpers.collection.js';\n\n/**\n * @typedef { import('../core/core.adapters.js').TimeUnit } Unit\n * @typedef {{common: boolean, size: number, steps?: number}} Interval\n * @typedef { import('../core/core.adapters.js').DateAdapter } DateAdapter\n */\n\n/**\n * @type {Object}\n */\nconst INTERVALS = {\n millisecond: {common: true, size: 1, steps: 1000},\n second: {common: true, size: 1000, steps: 60},\n minute: {common: true, size: 60000, steps: 60},\n hour: {common: true, size: 3600000, steps: 24},\n day: {common: true, size: 86400000, steps: 30},\n week: {common: false, size: 604800000, steps: 4},\n month: {common: true, size: 2.628e9, steps: 12},\n quarter: {common: false, size: 7.884e9, steps: 4},\n year: {common: true, size: 3.154e10}\n};\n\n/**\n * @type {Unit[]}\n */\nconst UNITS = /** @type Unit[] */ /* #__PURE__ */ (Object.keys(INTERVALS));\n\n/**\n * @param {number} a\n * @param {number} b\n */\nfunction sorter(a, b) {\n return a - b;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {*} input\n * @return {number}\n */\nfunction parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n\n const adapter = scale._adapter;\n const {parser, round, isoWeekday} = scale._parseOpts;\n let value = input;\n\n if (typeof parser === 'function') {\n value = parser(value);\n }\n\n // Only parse if it's not a timestamp already\n if (!isFinite(value)) {\n value = typeof parser === 'string'\n ? adapter.parse(value, /** @type {Unit} */ (parser))\n : adapter.parse(value);\n }\n\n if (value === null) {\n return null;\n }\n\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true)\n ? adapter.startOf(value, 'isoWeek', isoWeekday)\n : adapter.startOf(value, round);\n }\n\n return +value;\n}\n\n/**\n * Figures out what unit results in an appropriate number of auto-generated ticks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @param {number} capacity\n * @return {object}\n */\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n\n for (let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n\n return UNITS[ilen - 1];\n}\n\n/**\n * Figures out what unit to format a set of ticks with\n * @param {TimeScale} scale\n * @param {number} numTicks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @return {Unit}\n */\nfunction determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for (let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n\n/**\n * @param {Unit} unit\n * @return {object}\n */\nfunction determineMajorUnit(unit) {\n for (let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n\n/**\n * @param {object} ticks\n * @param {number} time\n * @param {number[]} [timestamps] - if defined, snap to these timestamps\n */\nfunction addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const {lo, hi} = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n\n/**\n * @param {TimeScale} scale\n * @param {object[]} ticks\n * @param {object} map\n * @param {Unit} majorUnit\n * @return {object[]}\n */\nfunction setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n\n for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {number[]} values\n * @param {Unit|undefined} [majorUnit]\n * @return {object[]}\n */\nfunction ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n /** @type {Object} */\n const map = {};\n const ilen = values.length;\n let i, value;\n\n for (i = 0; i < ilen; ++i) {\n value = values[i];\n map[value] = i;\n\n ticks.push({\n value,\n major: false\n });\n }\n\n // We set the major ticks separately from the above loop because calling startOf for every tick\n // is expensive when there is a large number of ticks\n return (ilen === 0 || !majorUnit) ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\n\nexport default class TimeScale extends Scale {\n\n static id = 'time';\n\n /**\n * @type {any}\n */\n static defaults = {\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 2.7.0\n */\n bounds: 'data',\n\n adapters: {},\n time: {\n parser: false, // false == a pattern string from or a custom callback that converts its argument to a timestamp\n unit: false, // false == automatic or override with week, month, year, etc.\n round: false, // none, or override with week, month, year, etc.\n isoWeekday: false, // override week start day\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n /**\n * Ticks generation input values:\n * - 'auto': generates \"optimal\" ticks based on scale size and time options.\n * - 'data': generates ticks from data (including labels from data {t|x|y} objects).\n * - 'labels': generates ticks from user given `data.labels` values ONLY.\n * @see https://github.com/chartjs/Chart.js/pull/4507\n * @since 2.7.0\n */\n source: 'auto',\n\n callback: false,\n\n major: {\n enabled: false\n }\n }\n };\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {{data: number[], labels: number[], all: number[]}} */\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n\n /** @type {Unit} */\n this._unit = 'day';\n /** @type {Unit=} */\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n /** @type {DateAdapter} */\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n\n adapter.init(opts);\n\n // Backward compatibility: before introducing adapter, `displayFormats` was\n // supposed to contain *all* unit/string pairs but this can't be resolved\n // when loading the scale (adapters are loaded afterward), so let's populate\n // missing formats on update\n mergeIf(time.displayFormats, adapter.formats());\n\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n\n super.init(scaleOpts);\n\n this._normalized = opts.normalized;\n }\n\n /**\n\t * @param {*} raw\n\t * @param {number?} [index]\n\t * @return {number}\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n // eslint-disable-next-line prefer-const\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n\n /**\n\t\t * @param {object} bounds\n\t\t */\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n\n // If we have user provided `min` and `max` labels / data bounds can be ignored\n if (!minDefined || !maxDefined) {\n // Labels are always considered, when user did not force bounds\n _applyBounds(this._getLabelBounds());\n\n // If `bounds` is `'ticks'` and `ticks.source` is `'labels'`,\n // data bounds are ignored (and don't need to be determined)\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n\n min = isFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n\n // Make sure that max is strictly higher than min (required by the timeseries lookup table)\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n\n /**\n\t * @private\n\t */\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {min, max};\n }\n\n /**\n\t * @return {object[]}\n\t */\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n\n const min = this.min;\n const max = this.max;\n\n const ticks = _filterBetween(timestamps, min, max);\n\n // PRIVATE\n // determineUnitForFormatting relies on the number of ticks so we don't use it when\n // autoSkip is enabled because we don't yet know what the final number of ticks will be\n this._unit = timeOpts.unit || (tickOpts.autoSkip\n ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min))\n : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined\n : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n\n if (options.reverse) {\n ticks.reverse();\n }\n\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n\n afterAutoSkip() {\n // Offsets for bar charts need to be handled with the auto skipped\n // ticks. Once ticks have been skipped, we re-compute the offsets.\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map(tick => +tick.value));\n }\n }\n\n /**\n\t * Returns the start and end offsets from edges in the form of {start, end}\n\t * where each value is a relative width to the scale and ranges between 0 and 1.\n\t * They add extra margins on the both sides by scaling down the original scale.\n\t * Offsets are added when the `offset` option is true.\n\t * @param {number[]} timestamps\n\t * @protected\n\t */\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n\n this._offsets = {start, end, factor: 1 / (start + 1 + end)};\n }\n\n /**\n\t * Generates a maximum of `capacity` timestamps between min and max, rounded to the\n\t * `minor` unit using the given scale time `options`.\n\t * Important: this method can return ticks outside the min and max range, it's the\n\t * responsibility of the calling code to clamp values if needed.\n\t * @protected\n\t */\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n // @ts-ignore\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n\n // For 'week' unit, handle the first day of week option\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n\n // Align first ticks on unit\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n\n // Prevent browser from freezing in case user options request millions of milliseconds\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) {\n addTick(ticks, time, timestamps);\n }\n\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n\n // @ts-ignore\n return Object.keys(ticks).sort(sorter).map(x => +x);\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n\n /**\n\t * @param {number} value\n\t * @param {string|undefined} format\n\t * @return {string}\n\t */\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n\n /**\n\t * Function to format an individual tick mark\n\t * @param {number} time\n\t * @param {number} index\n\t * @param {object[]} ticks\n\t * @param {string|undefined} [format]\n\t * @return {string}\n\t * @private\n\t */\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n\n if (formatter) {\n return call(formatter, [time, index, ticks], this);\n }\n\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n\n /**\n\t * @param {object[]} ticks\n\t */\n generateTickLabels(ticks) {\n let i, ilen, tick;\n\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n\n /**\n\t * @param {string} label\n\t * @return {{w:number, h:number}}\n\t * @private\n\t */\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n\n return {\n w: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation),\n h: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation)\n };\n }\n\n /**\n\t * @param {number} exampleTime\n\t * @return {number}\n\t * @private\n\t */\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n\n // pick the longest format (milliseconds) for guesstimation\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [exampleTime], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n // subtract 1 - if offset then there's one less label than tick\n // if not offset then one half label padding is added to each end leaving room for one less label\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n\n /**\n\t * @protected\n\t */\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const metas = this.getMatchingVisibleMetas();\n\n if (this._normalized && metas.length) {\n return (this._cache.data = metas[0].controller.getAllParsedValues(this));\n }\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n\n return (this._cache.data = this.normalize(timestamps));\n }\n\n /**\n\t * @protected\n\t */\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const labels = this.getLabels();\n for (i = 0, ilen = labels.length; i < ilen; ++i) {\n timestamps.push(parse(this, labels[i]));\n }\n\n return (this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps));\n }\n\n /**\n\t * @param {number[]} values\n\t * @protected\n\t */\n normalize(values) {\n // It seems to be somewhat faster to do sorting first\n return _arrayUnique(values.sort(sorter));\n }\n}\n","import TimeScale from './scale.time.js';\nimport {_lookupByKey} from '../helpers/helpers.collection.js';\n\n/**\n * Linearly interpolates the given source `val` using the table. If value is out of bounds, values\n * at edges are used for the interpolation.\n * @param {object} table\n * @param {number} val\n * @param {boolean} [reverse] lookup time based on position instead of vice versa\n * @return {object}\n */\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({lo, hi} = _lookupByKey(table, 'pos', val));\n }\n ({pos: prevSource, time: prevTarget} = table[lo]);\n ({pos: nextSource, time: nextTarget} = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({lo, hi} = _lookupByKey(table, 'time', val));\n }\n ({time: prevSource, pos: prevTarget} = table[lo]);\n ({time: nextSource, pos: nextTarget} = table[hi]);\n }\n\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\n\nclass TimeSeriesScale extends TimeScale {\n\n static id = 'timeseries';\n\n /**\n * @type {any}\n */\n static defaults = TimeScale.defaults;\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {object[]} */\n this._table = [];\n /** @type {number} */\n this._minPos = undefined;\n /** @type {number} */\n this._tableRange = undefined;\n }\n\n /**\n\t * @protected\n\t */\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n\n /**\n\t * Returns an array of {time, pos} objects used to interpolate a specific `time` or position\n\t * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is\n\t * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other\n\t * extremity (left + width or top + height). Note that it would be more optimized to directly\n\t * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need\n\t * to create the lookup table. The table ALWAYS contains at least two items: min and max.\n\t * @param {number[]} timestamps\n\t * @return {object[]}\n\t * @protected\n\t */\n buildLookupTable(timestamps) {\n const {min, max} = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n\n for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n\n if (items.length < 2) {\n // In case there is less that 2 timestamps between min and max, the scale is defined by min and max\n return [\n {time: min, pos: 0},\n {time: max, pos: 1}\n ];\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n\n // only add points that breaks the scale linearity\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({time: curr, pos: i / (ilen - 1)});\n }\n }\n return table;\n }\n\n /**\n * Generates all timestamps defined in the data.\n * Important: this method can return ticks outside the min and max range, it's the\n * responsibility of the calling code to clamp values if needed.\n * @protected\n */\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) {\n timestamps.splice(0, 0, min);\n }\n if (!timestamps.includes(max) || timestamps.length === 1) {\n timestamps.push(max);\n }\n return timestamps.sort((a, b) => a - b);\n }\n\n /**\n\t * Returns all timestamps\n\t * @return {number[]}\n\t * @private\n\t */\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n // If combining labels and data (data might not contain all labels),\n // we need to recheck uniqueness and sort\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n\n return timestamps;\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\n\nexport default TimeSeriesScale;\n","export * from './controllers/index.js';\nexport * from './core/index.js';\nexport * from './elements/index.js';\nexport * from './platform/index.js';\nexport * from './plugins/index.js';\nexport * from './scales/index.js';\n\nimport * as controllers from './controllers/index.js';\nimport * as elements from './elements/index.js';\nimport * as plugins from './plugins/index.js';\nimport * as scales from './scales/index.js';\n\nexport {\n controllers,\n elements,\n plugins,\n scales,\n};\n\nexport const registerables = [\n controllers,\n elements,\n plugins,\n scales,\n];\n","export function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });\n } else obj[key] = value;\n\n return obj;\n}\nexport { _define_property as _ };\n","/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */\nimport { Color } from '@kurkle/color';\n\n/**\n * @namespace Chart.helpers\n */ /**\n * An empty function that can be used, for example, for optional callback.\n */ function noop() {\n/* noop */ }\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */ const uid = (()=>{\n let id = 0;\n return ()=>id++;\n})();\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isNullOrUndef(value) {\n return value === null || typeof value === 'undefined';\n}\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */ function isArray(value) {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isObject(value) {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */ function isNumberFinite(value) {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */ function finiteOrDefault(value, defaultValue) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */ function valueOrDefault(value, defaultValue) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\nconst toPercentage = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 : +value / dimension;\nconst toDimension = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 * dimension : +value;\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */ function callback(fn, args, thisArg) {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\nfunction each(loopable, fn, thisArg, reverse) {\n let i, len, keys;\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for(i = len - 1; i >= 0; i--){\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */ function _elementsEqual(a0, a1) {\n let i, ilen, v0, v1;\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n for(i = 0, ilen = a0.length; i < ilen; ++i){\n v0 = a0[i];\n v1 = a1[i];\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n return true;\n}\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */ function clone(source) {\n if (isArray(source)) {\n return source.map(clone);\n }\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n for(; k < klen; ++k){\n target[keys[k]] = clone(source[keys[k]]);\n }\n return target;\n }\n return source;\n}\nfunction isValidKey(key) {\n return [\n '__proto__',\n 'prototype',\n 'constructor'\n ].indexOf(key) === -1;\n}\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */ function _merger(key, target, source, options) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone(sval);\n }\n}\nfunction merge(target, source, options) {\n const sources = isArray(source) ? source : [\n source\n ];\n const ilen = sources.length;\n if (!isObject(target)) {\n return target;\n }\n options = options || {};\n const merger = options.merger || _merger;\n let current;\n for(let i = 0; i < ilen; ++i){\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n const keys = Object.keys(current);\n for(let k = 0, klen = keys.length; k < klen; ++k){\n merger(keys[k], target, current, options);\n }\n }\n return target;\n}\nfunction mergeIf(target, source) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge(target, source, {\n merger: _mergerIf\n });\n}\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */ function _mergerIf(key, target, source) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone(sval);\n }\n}\n/**\n * @private\n */ function _deprecated(scope, value, previous, current) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous + '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': (v)=>v,\n // default resolvers\n x: (o)=>o.x,\n y: (o)=>o.y\n};\n/**\n * @private\n */ function _splitKey(key) {\n const parts = key.split('.');\n const keys = [];\n let tmp = '';\n for (const part of parts){\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\nfunction _getKeyResolver(key) {\n const keys = _splitKey(key);\n return (obj)=>{\n for (const k of keys){\n if (k === '') {\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\nfunction resolveObjectKey(obj, key) {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n/**\n * @private\n */ function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst defined = (value)=>typeof value !== 'undefined';\nconst isFunction = (value)=>typeof value === 'function';\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nconst setsEqual = (a, b)=>{\n if (a.size !== b.size) {\n return false;\n }\n for (const item of a){\n if (!b.has(item)) {\n return false;\n }\n }\n return true;\n};\n/**\n * @param e - The event\n * @private\n */ function _isClickEvent(e) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */ const PI = Math.PI;\nconst TAU = 2 * PI;\nconst PITAU = TAU + PI;\nconst INFINITY = Number.POSITIVE_INFINITY;\nconst RAD_PER_DEG = PI / 180;\nconst HALF_PI = PI / 2;\nconst QUARTER_PI = PI / 4;\nconst TWO_THIRDS_PI = PI * 2 / 3;\nconst log10 = Math.log10;\nconst sign = Math.sign;\nfunction almostEquals(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n}\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */ function niceNum(range) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */ function _factorize(value) {\n const result = [];\n const sqrt = Math.sqrt(value);\n let i;\n for(i = 1; i < sqrt; i++){\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) {\n result.push(sqrt);\n }\n result.sort((a, b)=>a - b).pop();\n return result;\n}\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction almostWhole(x, epsilon) {\n const rounded = Math.round(x);\n return rounded - epsilon <= x && rounded + epsilon >= x;\n}\n/**\n * @private\n */ function _setMinAndMaxByKey(array, target, property) {\n let i, ilen, value;\n for(i = 0, ilen = array.length; i < ilen; i++){\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\nfunction toRadians(degrees) {\n return degrees * (PI / 180);\n}\nfunction toDegrees(radians) {\n return radians * (180 / PI);\n}\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */ function _decimalPlaces(x) {\n if (!isNumberFinite(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while(Math.round(x * e) / e !== x){\n e *= 10;\n p++;\n }\n return p;\n}\n// Gets the angle from vertical upright to the point about a centre.\nfunction getAngleFromPoint(centrePoint, anglePoint) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n if (angle < -0.5 * PI) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\nfunction distanceBetweenPoints(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */ function _angleDiff(a, b) {\n return (a - b + PITAU) % TAU - PI;\n}\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */ function _normalizeAngle(a) {\n return (a % TAU + TAU) % TAU;\n}\n/**\n * @private\n */ function _angleBetween(angle, start, end, sameAngleIsFullCircle) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle;\n}\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */ function _limitValue(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n/**\n * @param {number} value\n * @private\n */ function _int16Range(value) {\n return _limitValue(value, -32768, 32767);\n}\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */ function _isBetween(value, start, end, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n\nfunction _lookup(table, value, cmp) {\n cmp = cmp || ((index)=>table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid;\n while(hi - lo > 1){\n mid = lo + hi >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return {\n lo,\n hi\n };\n}\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */ const _lookupByKey = (table, key, value, last)=>_lookup(table, value, last ? (index)=>{\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n } : (index)=>table[index][key] < value);\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */ const _rlookupByKey = (table, key, value)=>_lookup(table, value, (index)=>table[index][key] >= value);\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */ function _filterBetween(values, min, max) {\n let start = 0;\n let end = values.length;\n while(start < end && values[start] < min){\n start++;\n }\n while(end > start && values[end - 1] > max){\n end--;\n }\n return start > 0 || end < values.length ? values.slice(start, end) : values;\n}\nconst arrayEvents = [\n 'push',\n 'pop',\n 'shift',\n 'splice',\n 'unshift'\n];\nfunction listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [\n listener\n ]\n }\n });\n arrayEvents.forEach((key)=>{\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value (...args) {\n const res = base.apply(this, args);\n array._chartjs.listeners.forEach((object)=>{\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n return res;\n }\n });\n });\n}\nfunction unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n if (listeners.length > 0) {\n return;\n }\n arrayEvents.forEach((key)=>{\n delete array[key];\n });\n delete array._chartjs;\n}\n/**\n * @param items\n */ function _arrayUnique(items) {\n const set = new Set(items);\n if (set.size === items.length) {\n return items;\n }\n return Array.from(set);\n}\n\nfunction fontString(pixelSize, fontStyle, fontFamily) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n/**\n* Request animation polyfill\n*/ const requestAnimFrame = function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}();\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */ function throttled(fn, thisArg) {\n let argsToUse = [];\n let ticking = false;\n return function(...args) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, ()=>{\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n/**\n * Debounces calling `fn` for `delay` ms\n */ function debounce(fn, delay) {\n let timeout;\n return function(...args) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */ const _toLeftRightCenter = (align)=>align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */ const _alignStartEnd = (align, start, end)=>align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */ const _textX = (align, left, right, rtl)=>{\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n/**\n * Return start and count of visible points.\n * @private\n */ function _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {\n const pointCount = points.length;\n let start = 0;\n let count = pointCount;\n if (meta._sorted) {\n const { iScale , _parsed } = meta;\n const axis = iScale.axis;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(Math.min(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, axis, min).lo, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1), start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n return {\n start,\n count\n };\n}\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */ function _scaleRangesChanged(meta) {\n const { xScale , yScale , _scaleRanges } = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n\nconst atEdge = (t)=>t === 0 || t === 1;\nconst elasticIn = (t, s, p)=>-(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t, s, p)=>Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */ const effects = {\n linear: (t)=>t,\n easeInQuad: (t)=>t * t,\n easeOutQuad: (t)=>-t * (t - 2),\n easeInOutQuad: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1),\n easeInCubic: (t)=>t * t * t,\n easeOutCubic: (t)=>(t -= 1) * t * t + 1,\n easeInOutCubic: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2),\n easeInQuart: (t)=>t * t * t * t,\n easeOutQuart: (t)=>-((t -= 1) * t * t * t - 1),\n easeInOutQuart: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2),\n easeInQuint: (t)=>t * t * t * t * t,\n easeOutQuint: (t)=>(t -= 1) * t * t * t * t + 1,\n easeInOutQuint: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2),\n easeInSine: (t)=>-Math.cos(t * HALF_PI) + 1,\n easeOutSine: (t)=>Math.sin(t * HALF_PI),\n easeInOutSine: (t)=>-0.5 * (Math.cos(PI * t) - 1),\n easeInExpo: (t)=>t === 0 ? 0 : Math.pow(2, 10 * (t - 1)),\n easeOutExpo: (t)=>t === 1 ? 1 : -Math.pow(2, -10 * t) + 1,\n easeInOutExpo: (t)=>atEdge(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n easeInCirc: (t)=>t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1),\n easeOutCirc: (t)=>Math.sqrt(1 - (t -= 1) * t),\n easeInOutCirc: (t)=>(t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n easeInElastic: (t)=>atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n easeOutElastic: (t)=>atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n easeInOutElastic (t) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t : t < 0.5 ? 0.5 * elasticIn(t * 2, s, p) : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n easeInBack (t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n easeOutBack (t) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n easeInOutBack (t) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);\n },\n easeInBounce: (t)=>1 - effects.easeOutBounce(1 - t),\n easeOutBounce (t) {\n const m = 7.5625;\n const d = 2.75;\n if (t < 1 / d) {\n return m * t * t;\n }\n if (t < 2 / d) {\n return m * (t -= 1.5 / d) * t + 0.75;\n }\n if (t < 2.5 / d) {\n return m * (t -= 2.25 / d) * t + 0.9375;\n }\n return m * (t -= 2.625 / d) * t + 0.984375;\n },\n easeInOutBounce: (t)=>t < 0.5 ? effects.easeInBounce(t * 2) * 0.5 : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5\n};\n\nfunction isPatternOrGradient(value) {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n return false;\n}\nfunction color(value) {\n return isPatternOrGradient(value) ? value : new Color(value);\n}\nfunction getHoverColor(value) {\n return isPatternOrGradient(value) ? value : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n\nconst numbers = [\n 'x',\n 'y',\n 'borderWidth',\n 'radius',\n 'tension'\n];\nconst colors = [\n 'color',\n 'borderColor',\n 'backgroundColor'\n];\nfunction applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined\n });\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name)=>name !== 'onProgress' && name !== 'onComplete' && name !== 'fn'\n });\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n }\n });\n defaults.describe('animations', {\n _fallback: 'animation'\n });\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0\n }\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: (v)=>v | 0\n }\n }\n }\n });\n}\n\nfunction applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n\nconst intlCache = new Map();\nfunction getNumberFormat(locale, options) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\nfunction formatNumber(num, locale, options) {\n return getNumberFormat(locale, options).format(num);\n}\n\nconst formatters = {\n values (value) {\n return isArray(value) ? value : '' + value;\n },\n numeric (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue;\n if (ticks.length > 1) {\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n delta = calculateDelta(tickValue, ticks);\n }\n const logDelta = log10(Math.abs(delta));\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n const options = {\n notation,\n minimumFractionDigits: numDecimal,\n maximumFractionDigits: numDecimal\n };\n Object.assign(options, this.options.ticks.format);\n return formatNumber(tickValue, locale, options);\n },\n logarithmic (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || tickValue / Math.pow(10, Math.floor(log10(tickValue)));\n if ([\n 1,\n 2,\n 3,\n 5,\n 10,\n 15\n ].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n};\nfunction calculateDelta(tickValue, ticks) {\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n var Ticks = {\n formatters\n};\n\nfunction applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n bounds: 'ticks',\n clip: true,\n grace: 0,\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options)=>options.lineWidth,\n tickColor: (_ctx, options)=>options.color,\n offset: false\n },\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n title: {\n display: false,\n text: '',\n padding: {\n top: 4,\n bottom: 4\n }\n },\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2\n }\n });\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name)=>!name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name)=>name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash'\n });\n defaults.describe('scales', {\n _fallback: 'scale'\n });\n defaults.describe('scale.ticks', {\n _scriptable: (name)=>name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name)=>name !== 'backdropPadding'\n });\n}\n\nconst overrides = Object.create(null);\nconst descriptors = Object.create(null);\n function getScope$1(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for(let i = 0, n = keys.length; i < n; ++i){\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope$1(root, scope), values);\n }\n return merge(getScope$1(root, ''), scope);\n}\n class Defaults {\n constructor(_descriptors, _appliers){\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context)=>context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options)=>getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options)=>getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options)=>getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n set(scope, values) {\n return set(this, scope, values);\n }\n get(scope) {\n return getScope$1(this, scope);\n }\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n override(scope, values) {\n return set(overrides, scope, values);\n }\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope$1(this, scope);\n const targetScopeObject = getScope$1(this, targetScope);\n const privateName = '_' + name;\n Object.defineProperties(scopeObject, {\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n [name]: {\n enumerable: true,\n get () {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set (value) {\n this[privateName] = value;\n }\n }\n });\n }\n apply(appliers) {\n appliers.forEach((apply)=>apply(this));\n }\n}\nvar defaults = /* #__PURE__ */ new Defaults({\n _scriptable: (name)=>!name.startsWith('on'),\n _indexable: (name)=>name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false\n }\n}, [\n applyAnimationsDefaults,\n applyLayoutsDefaults,\n applyScaleDefaults\n]);\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */ function toFontString(font) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n return (font.style ? font.style + ' ' : '') + (font.weight ? font.weight + ' ' : '') + font.size + 'px ' + font.family;\n}\n/**\n * @private\n */ function _measureText(ctx, data, gc, longest, string) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n/**\n * @private\n */ // eslint-disable-next-line complexity\nfunction _longestText(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n ctx.save();\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i, j, jlen, thing, nestedThing;\n for(i = 0; i < ilen; i++){\n thing = arrayOfThings[i];\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !isArray(thing)) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for(j = 0, jlen = thing.length; j < jlen; j++){\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n ctx.restore();\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for(i = 0; i < gcLen; i++){\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */ function _alignPixel(chart, pixel, width) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n/**\n * Clears the entire canvas.\n */ function clearCanvas(canvas, ctx) {\n ctx = ctx || canvas.getContext('2d');\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\nfunction drawPoint(ctx, options, x, y) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n drawPointLegend(ctx, options, x, y, null);\n}\n// eslint-disable-next-line complexity\nfunction drawPointLegend(ctx, options, x, y, w) {\n let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n ctx.beginPath();\n switch(style){\n // Default includes circle\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n /* falls through */ case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n /* falls through */ case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */ function _isPointInArea(point, area, margin) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;\n}\nfunction clipArea(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\nfunction unclipArea(ctx) {\n ctx.restore();\n}\n/**\n * @private\n */ function _steppedLineTo(ctx, previous, target, flip, mode) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n/**\n * @private\n */ function _bezierCurveTo(ctx, previous, target, flip) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y);\n}\nfunction setRenderOpts(ctx, opts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\nfunction decorateText(ctx, x, y, line, opts) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */ const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\nfunction drawBackdrop(ctx, opts) {\n const oldColor = ctx.fillStyle;\n ctx.fillStyle = opts.color;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n/**\n * Render text onto the canvas\n */ function renderText(ctx, text, x, y, font, opts = {}) {\n const lines = isArray(text) ? text : [\n text\n ];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i, line;\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n for(i = 0; i < lines.length; ++i){\n line = lines[i];\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n y += Number(font.lineHeight);\n }\n ctx.restore();\n}\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */ function addRoundedRectPath(ctx, rect) {\n const { x , y , w , h , radius } = rect;\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n/**\n * @alias Chart.helpers.options\n * @namespace\n */ /**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */ function toLineHeight(value, size) {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n value = +matches[2];\n switch(matches[3]){\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n }\n return size * value;\n}\nconst numberOrZero = (v)=>+v || 0;\nfunction _readValueToProps(value, props) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value) ? objProps ? (prop)=>valueOrDefault(value[prop], value[props[prop]]) : (prop)=>value[prop] : ()=>value;\n for (const prop of keys){\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */ function toTRBL(value) {\n return _readValueToProps(value, {\n top: 'y',\n right: 'x',\n bottom: 'y',\n left: 'x'\n });\n}\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */ function toTRBLCorners(value) {\n return _readValueToProps(value, [\n 'topLeft',\n 'topRight',\n 'bottomLeft',\n 'bottomRight'\n ]);\n}\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */ function toPadding(value) {\n const obj = toTRBL(value);\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n return obj;\n}\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */ function toFont(options, fallback) {\n options = options || {};\n fallback = fallback || defaults.font;\n let size = valueOrDefault(options.size, fallback.size);\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n font.string = toFontString(font);\n return font;\n}\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */ function resolve(inputs, context, index, info) {\n let cacheable = true;\n let i, ilen, value;\n for(i = 0, ilen = inputs.length; i < ilen; ++i){\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */ function _addGrace(minmax, grace, beginAtZero) {\n const { min , max } = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value, add)=>beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\nfunction createContext(parentContext, context) {\n return Object.assign(Object.create(parentContext), context);\n}\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */ function _createResolver(scopes, prefixes = [\n ''\n], rootScopes, fallback, getTarget = ()=>scopes[0]) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === 'undefined') {\n fallback = _resolve('_fallback', scopes);\n }\n const cache = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope)=>_createResolver([\n scope,\n ...scopes\n ], prefixes, finalRootScopes, fallback)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop) {\n return _cached(target, prop, ()=>_resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys (target) {\n return getKeysFromAllScopes(target);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n });\n}\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */ function _attachContext(proxy, context, subProxy, descriptorDefaults) {\n const cache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx)=>_attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope)=>_attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop, receiver) {\n return _cached(target, prop, ()=>_resolveWithContext(target, prop, receiver));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? {\n enumerable: true,\n configurable: true\n } : undefined : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(proxy);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return Reflect.has(proxy, prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys () {\n return Reflect.ownKeys(proxy);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n });\n}\n/**\n * @private\n */ function _descriptors(proxy, defaults = {\n scriptable: true,\n indexable: true\n}) {\n const { _scriptable =defaults.scriptable , _indexable =defaults.indexable , _allKeys =defaults.allKeys } = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : ()=>_scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : ()=>_indexable\n };\n}\nconst readKey = (prefix, name)=>prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop, value)=>isObject(value) && prop !== 'adapters' && (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction _cached(target, prop, resolve) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) {\n return target[prop];\n }\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\nfunction _resolveWithContext(target, prop, receiver) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n let value = _proxy[prop]; // resolve from proxy\n // resolve with context\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n // if the resolved value is an object, create a sub resolver for it\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\nfunction _resolveScriptable(prop, getValue, target, receiver) {\n const { _proxy , _context , _subProxy , _stack } = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n // When scriptable option returns an object, create a resolver on that.\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\nfunction _resolveArray(prop, value, target, isIndexable) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n return value[_context.index % value.length];\n } else if (isObject(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter((s)=>s !== arr);\n value = [];\n for (const item of arr){\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\nfunction resolveFallback(fallback, prop, value) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\nconst getScope = (key, parent)=>key === true ? parent : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\nfunction addScopes(set, parentScopes, key, parentFallback, value) {\n for (const parent of parentScopes){\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n }\n } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n }\n return false;\n}\nfunction createSubResolver(parentScopes, resolver, prop, value) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [\n ...parentScopes,\n ...rootScopes\n ];\n const set = new Set();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (typeof fallback !== 'undefined' && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [\n ''\n ], rootScopes, fallback, ()=>subGetTarget(resolver, prop, value));\n}\nfunction addScopesFromKey(set, allScopes, key, fallback, item) {\n while(key){\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\nfunction subGetTarget(resolver, prop, value) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n // For array of objects, the object is used to store updated values\n return value;\n }\n return target || {};\n}\nfunction _resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n let value;\n for (const prefix of prefixes){\n value = _resolve(readKey(prefix, prop), scopes);\n if (typeof value !== 'undefined') {\n return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value;\n }\n }\n}\nfunction _resolve(key, scopes) {\n for (const scope of scopes){\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n}\nfunction getKeysFromAllScopes(target) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\nfunction resolveKeysFromAllScopes(scopes) {\n const set = new Set();\n for (const scope of scopes){\n for (const key of Object.keys(scope).filter((k)=>!k.startsWith('_'))){\n set.add(key);\n }\n }\n return Array.from(set);\n}\nfunction _parseObjectDataRadialScale(meta, data, start, count) {\n const { iScale } = meta;\n const { key ='r' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n\nconst EPSILON = Number.EPSILON || 1e-14;\nconst getPoint = (points, i)=>i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis)=>indexAxis === 'x' ? 'y' : 'x';\nfunction splineCurve(firstPoint, middlePoint, afterPoint, t) {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n // This function must also respect \"skipped\" points\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n/**\n * Adjust tangents to ensure monotonic properties\n */ function monotoneAdjust(points, deltaK, mK) {\n const pointsLen = points.length;\n let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen - 1; ++i){\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\nfunction monotoneCompute(points, mK, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */ function splineCurveMonotone(points, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK = Array(pointsLen).fill(0);\n const mK = Array(pointsLen);\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : sign(deltaK[i - 1]) !== sign(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n monotoneAdjust(points, deltaK, mK);\n monotoneCompute(points, mK, indexAxis);\n}\nfunction capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n}\nfunction capBezierPoints(points, area) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for(i = 0, ilen = points.length; i < ilen; ++i){\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n/**\n * @private\n */ function _updateBezierControlPoints(points, options, area, loop, indexAxis) {\n let i, ilen, point, controlPoints;\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt)=>!pt.skip);\n }\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for(i = 0, ilen = points.length; i < ilen; ++i){\n point = points[i];\n controlPoints = splineCurve(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension);\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */ /**\n * @private\n */ function _isDomSupported() {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n/**\n * @private\n */ function _getParentNode(domNode) {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = parent.host;\n }\n return parent;\n}\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */ function parseMaxStyle(styleValue, node, parentProperty) {\n let valueInPixels;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n return valueInPixels;\n}\nconst getComputedStyle = (element)=>element.ownerDocument.defaultView.getComputedStyle(element, null);\nfunction getStyle(el, property) {\n return getComputedStyle(el).getPropertyValue(property);\n}\nconst positions = [\n 'top',\n 'right',\n 'bottom',\n 'left'\n];\nfunction getPositionedStyle(styles, style, suffix) {\n const result = {};\n suffix = suffix ? '-' + suffix : '';\n for(let i = 0; i < 4; i++){\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\nconst useOffsetPos = (x, y, target)=>(x > 0 || y > 0) && (!target || !target.shadowRoot);\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */ function getCanvasPosition(e, canvas) {\n const touches = e.touches;\n const source = touches && touches.length ? touches[0] : e;\n const { offsetX , offsetY } = source;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {\n x,\n y,\n box\n };\n}\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */ function getRelativePosition(event, chart) {\n if ('native' in event) {\n return event;\n }\n const { canvas , currentDevicePixelRatio } = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const { x , y , box } = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n let { width , height } = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\nfunction getContainerSize(canvas, width, height) {\n let maxWidth, maxHeight;\n if (width === undefined || height === undefined) {\n const container = _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\nconst round1 = (v)=>Math.round(v * 10) / 10;\n// eslint-disable-next-line complexity\nfunction getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let { width , height } = containerSize;\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n return {\n width,\n height\n };\n}\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */ function retinaScale(chart, forceRatio, forceStyle) {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n const canvas = chart.canvas;\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */ const supportsEventListenerOptions = function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive () {\n passiveSupported = true;\n return false;\n }\n };\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}();\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */ function readUsedSize(element, property) {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n\n/**\n * @private\n */ function _pointInLine(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n/**\n * @private\n */ function _steppedInterpolation(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y : mode === 'after' ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y\n };\n}\n/**\n * @private\n */ function _bezierInterpolation(p1, p2, t, mode) {\n const cp1 = {\n x: p1.cp2x,\n y: p1.cp2y\n };\n const cp2 = {\n x: p2.cp1x,\n y: p2.cp1y\n };\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n\nconst getRightToLeftAdapter = function(rectX, width) {\n return {\n x (x) {\n return rectX + rectX + width - x;\n },\n setWidth (w) {\n width = w;\n },\n textAlign (align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus (x, value) {\n return x - value;\n },\n leftForLtr (x, itemWidth) {\n return x - itemWidth;\n }\n };\n};\nconst getLeftToRightAdapter = function() {\n return {\n x (x) {\n return x;\n },\n setWidth (w) {},\n textAlign (align) {\n return align;\n },\n xPlus (x, value) {\n return x + value;\n },\n leftForLtr (x, _itemWidth) {\n return x;\n }\n };\n};\nfunction getRtlAdapter(rtl, rectX, width) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\nfunction overrideTextDirection(ctx, direction) {\n let style, original;\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction')\n ];\n style.setProperty('direction', direction, 'important');\n ctx.prevTextDirection = original;\n }\n}\nfunction restoreTextDirection(ctx, original) {\n if (original !== undefined) {\n delete ctx.prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle\n };\n }\n return {\n between: _isBetween,\n compare: (a, b)=>a - b,\n normalize: (x)=>x\n };\n}\nfunction normalizeSegment({ start , end , count , loop , style }) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\nfunction getSegment(segment, points, bounds) {\n const { property , start: startBound , end: endBound } = bounds;\n const { between , normalize } = propertyFn(property);\n const count = points.length;\n let { start , end , loop } = segment;\n let i, ilen;\n if (loop) {\n start += count;\n end += count;\n for(i = 0, ilen = count; i < ilen; ++i){\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n if (end < start) {\n end += count;\n }\n return {\n start,\n end,\n loop,\n style: segment.style\n };\n}\n function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [\n segment\n ];\n }\n const { property , start: startBound , end: endBound } = bounds;\n const count = points.length;\n const { compare , between , normalize } = propertyFn(property);\n const { start , end , loop , style } = getSegment(segment, points, bounds);\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n const startIsBefore = ()=>between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = ()=>compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = ()=>inside || startIsBefore();\n const shouldStop = ()=>!inside || endIsBefore();\n for(let i = start, prev = start; i <= end; ++i){\n point = points[i % count];\n if (point.skip) {\n continue;\n }\n value = normalize(point[property]);\n if (value === prevValue) {\n continue;\n }\n inside = between(value, startBound, endBound);\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({\n start: subStart,\n end: i,\n loop,\n count,\n style\n }));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n if (subStart !== null) {\n result.push(normalizeSegment({\n start: subStart,\n end,\n loop,\n count,\n style\n }));\n }\n return result;\n}\n function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n for(let i = 0; i < segments.length; i++){\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n function findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n if (loop && !spanGaps) {\n while(start < count && !points[start].skip){\n start++;\n }\n }\n while(start < count && points[start].skip){\n start++;\n }\n start %= count;\n if (loop) {\n end += start;\n }\n while(end > start && points[end % count].skip){\n end--;\n }\n end %= count;\n return {\n start,\n end\n };\n}\n function solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n for(end = start + 1; end <= max; ++end){\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({\n start: start % count,\n end: (end - 1) % count,\n loop\n });\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n if (last !== null) {\n result.push({\n start: start % count,\n end: last % count,\n loop\n });\n }\n return result;\n}\n function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n if (!count) {\n return [];\n }\n const loop = !!line._loop;\n const { start , end } = findStartAndEnd(points, count, loop, spanGaps);\n if (spanGaps === true) {\n return splitByStyles(line, [\n {\n start,\n end,\n loop\n }\n ], points, segmentOptions);\n }\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n function splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n function doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const { _datasetIndex: datasetIndex , options: { spanGaps } } = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n s += count;\n while(points[s % count].skip){\n s -= dir;\n }\n while(points[e % count].skip){\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({\n start: s % count,\n end: e % count,\n loop: l,\n style: st\n });\n prevStyle = st;\n start = e % count;\n }\n }\n for (const segment of segments){\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for(i = start + 1; i <= segment.end; i++){\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n return result;\n}\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\nfunction styleChanged(style, prevStyle) {\n if (!prevStyle) {\n return false;\n }\n const cache = [];\n const replacer = function(key, value) {\n if (!isPatternOrGradient(value)) {\n return value;\n }\n if (!cache.includes(value)) {\n cache.push(value);\n }\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n\nexport { unclipArea as $, _rlookupByKey as A, _lookupByKey as B, _isPointInArea as C, getAngleFromPoint as D, toPadding as E, each as F, getMaximumSize as G, HALF_PI as H, _getParentNode as I, readUsedSize as J, supportsEventListenerOptions as K, throttled as L, _isDomSupported as M, _factorize as N, finiteOrDefault as O, PI as P, callback as Q, _addGrace as R, _limitValue as S, TAU as T, toDegrees as U, _measureText as V, _int16Range as W, _alignPixel as X, clipArea as Y, renderText as Z, _arrayUnique as _, resolve as a, fontString as a$, toFont as a0, _toLeftRightCenter as a1, _alignStartEnd as a2, overrides as a3, merge as a4, _capitalize as a5, descriptors as a6, isFunction as a7, _attachContext as a8, _createResolver as a9, overrideTextDirection as aA, _textX as aB, restoreTextDirection as aC, drawPointLegend as aD, distanceBetweenPoints as aE, noop as aF, _setMinAndMaxByKey as aG, niceNum as aH, almostWhole as aI, almostEquals as aJ, _decimalPlaces as aK, Ticks as aL, log10 as aM, _longestText as aN, _filterBetween as aO, _lookup as aP, isPatternOrGradient as aQ, getHoverColor as aR, clone as aS, _merger as aT, _mergerIf as aU, _deprecated as aV, _splitKey as aW, toFontString as aX, splineCurve as aY, splineCurveMonotone as aZ, getStyle as a_, _descriptors as aa, mergeIf as ab, uid as ac, debounce as ad, retinaScale as ae, clearCanvas as af, setsEqual as ag, _elementsEqual as ah, _isClickEvent as ai, _isBetween as aj, _readValueToProps as ak, _updateBezierControlPoints as al, _computeSegments as am, _boundSegments as an, _steppedInterpolation as ao, _bezierInterpolation as ap, _pointInLine as aq, _steppedLineTo as ar, _bezierCurveTo as as, drawPoint as at, addRoundedRectPath as au, toTRBL as av, toTRBLCorners as aw, _boundSegment as ax, _normalizeAngle as ay, getRtlAdapter as az, isArray as b, toLineHeight as b0, PITAU as b1, INFINITY as b2, RAD_PER_DEG as b3, QUARTER_PI as b4, TWO_THIRDS_PI as b5, _angleDiff as b6, color as c, defaults as d, effects as e, resolveObjectKey as f, isNumberFinite as g, defined as h, isObject as i, createContext as j, isNullOrUndef as k, listenArrayEvents as l, toPercentage as m, toDimension as n, formatNumber as o, _angleBetween as p, _getStartAndCountOfVisiblePoints as q, requestAnimFrame as r, sign as s, toRadians as t, unlistenArrayEvents as u, valueOrDefault as v, _scaleRangesChanged as w, isNumber as x, _parseObjectDataRadialScale as y, getRelativePosition as z };\n//# sourceMappingURL=helpers.segment.js.map\n","/**\n * @namespace Chart.helpers\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ActiveDataPoint, ChartEvent} from '../types/index.js';\n\n/**\n * An empty function that can be used, for example, for optional callback.\n */\nexport function noop() {\n /* noop */\n}\n\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */\nexport const uid = (() => {\n let id = 0;\n return () => id++;\n})();\n\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isNullOrUndef(value: unknown): value is null | undefined {\n return value === null || typeof value === 'undefined';\n}\n\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */\nexport function isArray(value: unknown): value is T[] {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isObject(value: unknown): value is AnyObject {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */\nfunction isNumberFinite(value: unknown): value is number {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\nexport {\n isNumberFinite as isFinite,\n};\n\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */\nexport function finiteOrDefault(value: unknown, defaultValue: number) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */\nexport function valueOrDefault(value: T | undefined, defaultValue: T) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\n\nexport const toPercentage = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100\n : +value / dimension;\n\nexport const toDimension = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100 * dimension\n : +value;\n\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */\nexport function callback R, TA, R>(\n fn: T | undefined,\n args: unknown[],\n thisArg?: TA\n): R | undefined {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\n\n/**\n * Note(SB) for performance sake, this method should only be used when loopable type\n * is unknown or in none intensive code (not called often and small loopable). Else\n * it's preferable to use a regular for() loop and save extra function calls.\n * @param loopable - The object or array to be iterated.\n * @param fn - The function to call for each item.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n * @param [reverse] - If true, iterates backward on the loopable.\n */\nexport function each(\n loopable: Record,\n fn: (this: TA, v: T, i: string) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each(\n loopable: T[],\n fn: (this: TA, v: T, i: number) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each(\n loopable: T[] | Record,\n fn: (this: TA, v: T, i: any) => void,\n thisArg?: TA,\n reverse?: boolean\n) {\n let i: number, len: number, keys: string[];\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for (i = len - 1; i >= 0; i--) {\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */\nexport function _elementsEqual(a0: ActiveDataPoint[], a1: ActiveDataPoint[]) {\n let i: number, ilen: number, v0: ActiveDataPoint, v1: ActiveDataPoint;\n\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n\n for (i = 0, ilen = a0.length; i < ilen; ++i) {\n v0 = a0[i];\n v1 = a1[i];\n\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */\nexport function clone(source: T): T {\n if (isArray(source)) {\n return source.map(clone) as unknown as T;\n }\n\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n\n for (; k < klen; ++k) {\n target[keys[k]] = clone(source[keys[k]]);\n }\n\n return target;\n }\n\n return source;\n}\n\nfunction isValidKey(key: string) {\n return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;\n}\n\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */\nexport function _merger(key: string, target: AnyObject, source: AnyObject, options: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone(sval);\n }\n}\n\nexport interface MergeOptions {\n merger?: (key: string, target: AnyObject, source: AnyObject, options?: AnyObject) => void;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` with the given `options`.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @param [options] - Merging options:\n * @param [options.merger] - The merge method (key, target, source, options)\n * @returns The `target` object.\n */\nexport function merge(target: T, source: [], options?: MergeOptions): T;\nexport function merge(target: T, source: S1, options?: MergeOptions): T & S1;\nexport function merge(target: T, source: [S1], options?: MergeOptions): T & S1;\nexport function merge(target: T, source: [S1, S2], options?: MergeOptions): T & S1 & S2;\nexport function merge(target: T, source: [S1, S2, S3], options?: MergeOptions): T & S1 & S2 & S3;\nexport function merge(\n target: T,\n source: [S1, S2, S3, S4],\n options?: MergeOptions\n): T & S1 & S2 & S3 & S4;\nexport function merge(target: T, source: AnyObject[], options?: MergeOptions): AnyObject;\nexport function merge(target: T, source: AnyObject[], options?: MergeOptions): AnyObject {\n const sources = isArray(source) ? source : [source];\n const ilen = sources.length;\n\n if (!isObject(target)) {\n return target as AnyObject;\n }\n\n options = options || {};\n const merger = options.merger || _merger;\n let current: AnyObject;\n\n for (let i = 0; i < ilen; ++i) {\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n\n const keys = Object.keys(current);\n for (let k = 0, klen = keys.length; k < klen; ++k) {\n merger(keys[k], target, current, options as AnyObject);\n }\n }\n\n return target;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` *only* if not defined in target.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @returns The `target` object.\n */\nexport function mergeIf(target: T, source: []): T;\nexport function mergeIf(target: T, source: S1): T & S1;\nexport function mergeIf(target: T, source: [S1]): T & S1;\nexport function mergeIf(target: T, source: [S1, S2]): T & S1 & S2;\nexport function mergeIf(target: T, source: [S1, S2, S3]): T & S1 & S2 & S3;\nexport function mergeIf(target: T, source: [S1, S2, S3, S4]): T & S1 & S2 & S3 & S4;\nexport function mergeIf(target: T, source: AnyObject[]): AnyObject;\nexport function mergeIf(target: T, source: AnyObject[]): AnyObject {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge(target, source, {merger: _mergerIf});\n}\n\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */\nexport function _mergerIf(key: string, target: AnyObject, source: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone(sval);\n }\n}\n\n/**\n * @private\n */\nexport function _deprecated(scope: string, value: unknown, previous: string, current: string) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous +\n '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': v => v,\n // default resolvers\n x: o => o.x,\n y: o => o.y\n};\n\n/**\n * @private\n */\nexport function _splitKey(key: string) {\n const parts = key.split('.');\n const keys: string[] = [];\n let tmp = '';\n for (const part of parts) {\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\n\nfunction _getKeyResolver(key: string) {\n const keys = _splitKey(key);\n return obj => {\n for (const k of keys) {\n if (k === '') {\n // For backward compatibility:\n // Chart.helpers.core resolveObjectKey should break at empty key\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\n\nexport function resolveObjectKey(obj: AnyObject, key: string): any {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n\n/**\n * @private\n */\nexport function _capitalize(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n\nexport const defined = (value: unknown) => typeof value !== 'undefined';\n\nexport const isFunction = (value: unknown): value is (...args: any[]) => any => typeof value === 'function';\n\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nexport const setsEqual = (a: Set, b: Set) => {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const item of a) {\n if (!b.has(item)) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * @param e - The event\n * @private\n */\nexport function _isClickEvent(e: ChartEvent) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n","import type {Point} from '../types/geometric.js';\nimport {isFinite as isFiniteNumber} from './helpers.core.js';\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */\n\nexport const PI = Math.PI;\nexport const TAU = 2 * PI;\nexport const PITAU = TAU + PI;\nexport const INFINITY = Number.POSITIVE_INFINITY;\nexport const RAD_PER_DEG = PI / 180;\nexport const HALF_PI = PI / 2;\nexport const QUARTER_PI = PI / 4;\nexport const TWO_THIRDS_PI = PI * 2 / 3;\n\nexport const log10 = Math.log10;\nexport const sign = Math.sign;\n\nexport function almostEquals(x: number, y: number, epsilon: number) {\n return Math.abs(x - y) < epsilon;\n}\n\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */\nexport function niceNum(range: number) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */\nexport function _factorize(value: number) {\n const result: number[] = [];\n const sqrt = Math.sqrt(value);\n let i: number;\n\n for (i = 1; i < sqrt; i++) {\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) { // if value is a square number\n result.push(sqrt);\n }\n\n result.sort((a, b) => a - b).pop();\n return result;\n}\n\nexport function isNumber(n: unknown): n is number {\n return !isNaN(parseFloat(n as string)) && isFinite(n as number);\n}\n\nexport function almostWhole(x: number, epsilon: number) {\n const rounded = Math.round(x);\n return ((rounded - epsilon) <= x) && ((rounded + epsilon) >= x);\n}\n\n/**\n * @private\n */\nexport function _setMinAndMaxByKey(\n array: Record[],\n target: { min: number, max: number },\n property: string\n) {\n let i: number, ilen: number, value: number;\n\n for (i = 0, ilen = array.length; i < ilen; i++) {\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\n\nexport function toRadians(degrees: number) {\n return degrees * (PI / 180);\n}\n\nexport function toDegrees(radians: number) {\n return radians * (180 / PI);\n}\n\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */\nexport function _decimalPlaces(x: number) {\n if (!isFiniteNumber(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while (Math.round(x * e) / e !== x) {\n e *= 10;\n p++;\n }\n return p;\n}\n\n// Gets the angle from vertical upright to the point about a centre.\nexport function getAngleFromPoint(\n centrePoint: Point,\n anglePoint: Point\n) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n\n if (angle < (-0.5 * PI)) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\n\nexport function distanceBetweenPoints(pt1: Point, pt2: Point) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */\nexport function _angleDiff(a: number, b: number) {\n return (a - b + PITAU) % TAU - PI;\n}\n\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */\nexport function _normalizeAngle(a: number) {\n return (a % TAU + TAU) % TAU;\n}\n\n/**\n * @private\n */\nexport function _angleBetween(angle: number, start: number, end: number, sameAngleIsFullCircle?: boolean) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || (sameAngleIsFullCircle && s === e)\n || (angleToStart > angleToEnd && startToAngle < endToAngle);\n}\n\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */\nexport function _limitValue(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\n/**\n * @param {number} value\n * @private\n */\nexport function _int16Range(value: number) {\n return _limitValue(value, -32768, 32767);\n}\n\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */\nexport function _isBetween(value: number, start: number, end: number, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n","import {_capitalize} from './helpers.core.js';\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param value - value to find\n * @param cmp\n * @private\n */\nexport function _lookup(\n table: number[],\n value: number,\n cmp?: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup(\n table: T[],\n value: number,\n cmp: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup(\n table: unknown[],\n value: number,\n cmp?: (value: number) => boolean\n) {\n cmp = cmp || ((index) => table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid: number;\n\n while (hi - lo > 1) {\n mid = (lo + hi) >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n\n return {lo, hi};\n}\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */\nexport const _lookupByKey = (\n table: Record[],\n key: string,\n value: number,\n last?: boolean\n) =>\n _lookup(table, value, last\n ? index => {\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n }\n : index => table[index][key] < value);\n\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */\nexport const _rlookupByKey = (\n table: Record[],\n key: string,\n value: number\n) =>\n _lookup(table, value, index => table[index][key] >= value);\n\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */\nexport function _filterBetween(values: number[], min: number, max: number) {\n let start = 0;\n let end = values.length;\n\n while (start < end && values[start] < min) {\n start++;\n }\n while (end > start && values[end - 1] > max) {\n end--;\n }\n\n return start > 0 || end < values.length\n ? values.slice(start, end)\n : values;\n}\n\nconst arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'] as const;\n\nexport interface ArrayListener {\n _onDataPush?(...item: T[]): void;\n _onDataPop?(): void;\n _onDataShift?(): void;\n _onDataSplice?(index: number, deleteCount: number, ...items: T[]): void;\n _onDataUnshift?(...item: T[]): void;\n}\n\n/**\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\n * called on the '_onData*' callbacks (e.g. _onDataPush, etc.) with same arguments.\n */\nexport function listenArrayEvents(array: T[], listener: ArrayListener): void;\nexport function listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n\n arrayEvents.forEach((key) => {\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value(...args) {\n const res = base.apply(this, args);\n\n array._chartjs.listeners.forEach((object) => {\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n\n return res;\n }\n });\n });\n}\n\n\n/**\n * Removes the given array event listener and cleanup extra attached properties (such as\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\n */\nexport function unlistenArrayEvents(array: T[], listener: ArrayListener): void;\nexport function unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n\n if (listeners.length > 0) {\n return;\n }\n\n arrayEvents.forEach((key) => {\n delete array[key];\n });\n\n delete array._chartjs;\n}\n\n/**\n * @param items\n */\nexport function _arrayUnique(items: T[]) {\n const set = new Set(items);\n\n if (set.size === items.length) {\n return items;\n }\n\n return Array.from(set);\n}\n","import type {ChartMeta, PointElement} from '../types/index.js';\n\nimport {_limitValue} from './helpers.math.js';\nimport {_lookupByKey} from './helpers.collection.js';\n\nexport function fontString(pixelSize: number, fontStyle: string, fontFamily: string) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n\n/**\n* Request animation polyfill\n*/\nexport const requestAnimFrame = (function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}());\n\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */\nexport function throttled>(\n fn: (...args: TArgs) => void,\n thisArg: any,\n) {\n let argsToUse = [] as TArgs;\n let ticking = false;\n\n return function(...args: TArgs) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, () => {\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n\n/**\n * Debounces calling `fn` for `delay` ms\n */\nexport function debounce>(fn: (...args: TArgs) => void, delay: number) {\n let timeout;\n return function(...args: TArgs) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */\nexport const _toLeftRightCenter = (align: 'start' | 'end' | 'center') => align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */\nexport const _alignStartEnd = (align: 'start' | 'end' | 'center', start: number, end: number) => align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */\nexport const _textX = (align: 'left' | 'right' | 'center', left: number, right: number, rtl: boolean) => {\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n\n/**\n * Return start and count of visible points.\n * @private\n */\nexport function _getStartAndCountOfVisiblePoints(meta: ChartMeta<'line' | 'scatter'>, points: PointElement[], animationsDisabled: boolean) {\n const pointCount = points.length;\n\n let start = 0;\n let count = pointCount;\n\n if (meta._sorted) {\n const {iScale, _parsed} = meta;\n const axis = iScale.axis;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(Math.min(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, axis, min).lo,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo),\n 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1),\n start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n\n return {start, count};\n}\n\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */\nexport function _scaleRangesChanged(meta) {\n const {xScale, yScale, _scaleRanges} = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min\n\t\t|| _scaleRanges.xmax !== xScale.max\n\t\t|| _scaleRanges.ymin !== yScale.min\n\t\t|| _scaleRanges.ymax !== yScale.max;\n\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n","import {PI, TAU, HALF_PI} from './helpers.math.js';\n\nconst atEdge = (t: number) => t === 0 || t === 1;\nconst elasticIn = (t: number, s: number, p: number) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t: number, s: number, p: number) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */\nconst effects = {\n linear: (t: number) => t,\n\n easeInQuad: (t: number) => t * t,\n\n easeOutQuad: (t: number) => -t * (t - 2),\n\n easeInOutQuad: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t\n : -0.5 * ((--t) * (t - 2) - 1),\n\n easeInCubic: (t: number) => t * t * t,\n\n easeOutCubic: (t: number) => (t -= 1) * t * t + 1,\n\n easeInOutCubic: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t\n : 0.5 * ((t -= 2) * t * t + 2),\n\n easeInQuart: (t: number) => t * t * t * t,\n\n easeOutQuart: (t: number) => -((t -= 1) * t * t * t - 1),\n\n easeInOutQuart: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t\n : -0.5 * ((t -= 2) * t * t * t - 2),\n\n easeInQuint: (t: number) => t * t * t * t * t,\n\n easeOutQuint: (t: number) => (t -= 1) * t * t * t * t + 1,\n\n easeInOutQuint: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t * t\n : 0.5 * ((t -= 2) * t * t * t * t + 2),\n\n easeInSine: (t: number) => -Math.cos(t * HALF_PI) + 1,\n\n easeOutSine: (t: number) => Math.sin(t * HALF_PI),\n\n easeInOutSine: (t: number) => -0.5 * (Math.cos(PI * t) - 1),\n\n easeInExpo: (t: number) => (t === 0) ? 0 : Math.pow(2, 10 * (t - 1)),\n\n easeOutExpo: (t: number) => (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1,\n\n easeInOutExpo: (t: number) => atEdge(t) ? t : t < 0.5\n ? 0.5 * Math.pow(2, 10 * (t * 2 - 1))\n : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n\n easeInCirc: (t: number) => (t >= 1) ? t : -(Math.sqrt(1 - t * t) - 1),\n\n easeOutCirc: (t: number) => Math.sqrt(1 - (t -= 1) * t),\n\n easeInOutCirc: (t: number) => ((t /= 0.5) < 1)\n ? -0.5 * (Math.sqrt(1 - t * t) - 1)\n : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n\n easeInElastic: (t: number) => atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n\n easeOutElastic: (t: number) => atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n\n easeInOutElastic(t: number) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t :\n t < 0.5\n ? 0.5 * elasticIn(t * 2, s, p)\n : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n\n easeInBack(t: number) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n\n easeOutBack(t: number) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n\n easeInOutBack(t: number) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n },\n\n easeInBounce: (t: number) => 1 - effects.easeOutBounce(1 - t),\n\n easeOutBounce(t: number) {\n const m = 7.5625;\n const d = 2.75;\n if (t < (1 / d)) {\n return m * t * t;\n }\n if (t < (2 / d)) {\n return m * (t -= (1.5 / d)) * t + 0.75;\n }\n if (t < (2.5 / d)) {\n return m * (t -= (2.25 / d)) * t + 0.9375;\n }\n return m * (t -= (2.625 / d)) * t + 0.984375;\n },\n\n easeInOutBounce: (t: number) => (t < 0.5)\n ? effects.easeInBounce(t * 2) * 0.5\n : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5,\n} as const;\n\nexport type EasingFunction = keyof typeof effects\n\nexport default effects;\n","import {Color} from '@kurkle/color';\n\nexport function isPatternOrGradient(value: unknown): value is CanvasPattern | CanvasGradient {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n\n return false;\n}\n\nexport function color(value: CanvasGradient): CanvasGradient;\nexport function color(value: CanvasPattern): CanvasPattern;\nexport function color(\n value:\n | string\n | { r: number; g: number; b: number; a: number }\n | [number, number, number]\n | [number, number, number, number]\n): Color;\nexport function color(value) {\n return isPatternOrGradient(value) ? value : new Color(value);\n}\n\nexport function getHoverColor(value: CanvasGradient): CanvasGradient;\nexport function getHoverColor(value: CanvasPattern): CanvasPattern;\nexport function getHoverColor(value: string): string;\nexport function getHoverColor(value) {\n return isPatternOrGradient(value)\n ? value\n : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n","const numbers = ['x', 'y', 'borderWidth', 'radius', 'tension'];\nconst colors = ['color', 'borderColor', 'backgroundColor'];\n\nexport function applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined,\n });\n\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name) => name !== 'onProgress' && name !== 'onComplete' && name !== 'fn',\n });\n\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n },\n });\n\n defaults.describe('animations', {\n _fallback: 'animation',\n });\n\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0 // show immediately\n },\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: v => v | 0 // for keeping the dataset visible all the way through the animation\n },\n }\n }\n });\n}\n","export function applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n","\nconst intlCache = new Map();\n\nfunction getNumberFormat(locale: string, options?: Intl.NumberFormatOptions) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\n\nexport function formatNumber(num: number, locale: string, options?: Intl.NumberFormatOptions) {\n return getNumberFormat(locale, options).format(num);\n}\n","import {isArray} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {log10} from '../helpers/helpers.math.js';\n\n/**\n * Namespace to hold formatters for different types of ticks\n * @namespace Chart.Ticks.formatters\n */\nconst formatters = {\n /**\n * Formatter for value labels\n * @method Chart.Ticks.formatters.values\n * @param value the value to display\n * @return {string|string[]} the label to display\n */\n values(value) {\n return isArray(value) ? /** @type {string[]} */ (value) : '' + value;\n },\n\n /**\n * Formatter for numeric ticks\n * @method Chart.Ticks.formatters.numeric\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n numeric(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0'; // never show decimal places for 0\n }\n\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue; // This is used when there are less than 2 ticks as the tick interval.\n\n if (ticks.length > 1) {\n // all ticks are small or there huge numbers; use scientific notation\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n\n delta = calculateDelta(tickValue, ticks);\n }\n\n const logDelta = log10(Math.abs(delta));\n\n // When datasets have values approaching Number.MAX_VALUE, the tick calculations might result in\n // infinity and eventually NaN. Passing NaN for minimumFractionDigits or maximumFractionDigits\n // will make the number formatter throw. So instead we check for isNaN and use a fallback value.\n //\n // toFixed has a max of 20 decimal places\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n\n const options = {notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal};\n Object.assign(options, this.options.ticks.format);\n\n return formatNumber(tickValue, locale, options);\n },\n\n\n /**\n * Formatter for logarithmic ticks\n * @method Chart.Ticks.formatters.logarithmic\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n logarithmic(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || (tickValue / (Math.pow(10, Math.floor(log10(tickValue)))));\n if ([1, 2, 3, 5, 10, 15].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n\n};\n\n\nfunction calculateDelta(tickValue, ticks) {\n // Figure out how many digits to show\n // The space between the first two ticks might be smaller than normal spacing\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n\n // If we have a number like 2.5 as the delta, figure out how many decimal places we need\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n // not an integer\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n\n/**\n * Namespace to hold static tick generation functions\n * @namespace Chart.Ticks\n */\nexport default {formatters};\n","import Ticks from './core.ticks.js';\n\nexport function applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 3.0.0\n */\n bounds: 'ticks',\n\n clip: true,\n\n /**\n * Addition grace added to max and reduced from min data value.\n * @since 3.0.0\n */\n grace: 0,\n\n // grid line settings\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options) => options.lineWidth,\n tickColor: (_ctx, options) => options.color,\n offset: false,\n },\n\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n\n // scale title\n title: {\n // display property\n display: false,\n\n // actual label\n text: '',\n\n // top/bottom padding\n padding: {\n top: 4,\n bottom: 4\n }\n },\n\n // label settings\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2,\n }\n });\n\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name) => !name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name) => name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash',\n });\n\n defaults.describe('scales', {\n _fallback: 'scale',\n });\n\n defaults.describe('scale.ticks', {\n _scriptable: (name) => name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name) => name !== 'backdropPadding',\n });\n}\n","import {getHoverColor} from '../helpers/helpers.color.js';\nimport {isObject, merge, valueOrDefault} from '../helpers/helpers.core.js';\nimport {applyAnimationsDefaults} from './core.animations.defaults.js';\nimport {applyLayoutsDefaults} from './core.layouts.defaults.js';\nimport {applyScaleDefaults} from './core.scale.defaults.js';\n\nexport const overrides = Object.create(null);\nexport const descriptors = Object.create(null);\n\n/**\n * @param {object} node\n * @param {string} key\n * @return {object}\n */\nfunction getScope(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for (let i = 0, n = keys.length; i < n; ++i) {\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\n\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope(root, scope), values);\n }\n return merge(getScope(root, ''), scope);\n}\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Defaults {\n constructor(_descriptors, _appliers) {\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options) => getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n set(scope, values) {\n return set(this, scope, values);\n }\n\n /**\n\t * @param {string} scope\n\t */\n get(scope) {\n return getScope(this, scope);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n\n override(scope, values) {\n return set(overrides, scope, values);\n }\n\n /**\n\t * Routes the named defaults to fallback to another scope/name.\n\t * This routing is useful when those target values, like defaults.color, are changed runtime.\n\t * If the values would be copied, the runtime change would not take effect. By routing, the\n\t * fallback is evaluated at each access, so its always up to date.\n\t *\n\t * Example:\n\t *\n\t * \tdefaults.route('elements.arc', 'backgroundColor', '', 'color')\n\t * - reads the backgroundColor from defaults.color when undefined locally\n\t *\n\t * @param {string} scope Scope this route applies to.\n\t * @param {string} name Property name that should be routed to different namespace when not defined here.\n\t * @param {string} targetScope The namespace where those properties should be routed to.\n\t * Empty string ('') is the root of defaults.\n\t * @param {string} targetName The target name in the target scope the property should be routed to.\n\t */\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope(this, scope);\n const targetScopeObject = getScope(this, targetScope);\n const privateName = '_' + name;\n\n Object.defineProperties(scopeObject, {\n // A private property is defined to hold the actual value, when this property is set in its scope (set in the setter)\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n // The actual property is defined as getter/setter so we can do the routing when value is not locally set.\n [name]: {\n enumerable: true,\n get() {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set(value) {\n this[privateName] = value;\n }\n }\n });\n }\n\n apply(appliers) {\n appliers.forEach((apply) => apply(this));\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Defaults({\n _scriptable: (name) => !name.startsWith('on'),\n _indexable: (name) => name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false,\n }\n}, [applyAnimationsDefaults, applyLayoutsDefaults, applyScaleDefaults]);\n","import type {\n Chart,\n Point,\n FontSpec,\n CanvasFontSpec,\n PointStyle,\n RenderTextOpts,\n BackdropOptions\n} from '../types/index.js';\nimport type {\n TRBL,\n SplinePoint,\n RoundedRect,\n TRBLCorners\n} from '../types/geometric.js';\nimport {isArray, isNullOrUndef} from './helpers.core.js';\nimport {PI, TAU, HALF_PI, QUARTER_PI, TWO_THIRDS_PI, RAD_PER_DEG} from './helpers.math.js';\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */\nexport function toFontString(font: FontSpec) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n\n return (font.style ? font.style + ' ' : '')\n\t\t+ (font.weight ? font.weight + ' ' : '')\n\t\t+ font.size + 'px '\n\t\t+ font.family;\n}\n\n/**\n * @private\n */\nexport function _measureText(\n ctx: CanvasRenderingContext2D,\n data: Record,\n gc: string[],\n longest: number,\n string: string\n) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n\ntype Thing = string | undefined | null\ntype Things = (Thing | Thing[])[]\n\n/**\n * @private\n */\n// eslint-disable-next-line complexity\nexport function _longestText(\n ctx: CanvasRenderingContext2D,\n font: string,\n arrayOfThings: Things,\n cache?: {data?: Record, garbageCollect?: string[], font?: string}\n) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n\n ctx.save();\n\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i: number, j: number, jlen: number, thing: Thing | Thing[], nestedThing: Thing | Thing[];\n for (i = 0; i < ilen; i++) {\n thing = arrayOfThings[i];\n\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !isArray(thing)) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for (j = 0, jlen = thing.length; j < jlen; j++) {\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n\n ctx.restore();\n\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for (i = 0; i < gcLen; i++) {\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */\nexport function _alignPixel(chart: Chart, pixel: number, width: number) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n\n/**\n * Clears the entire canvas.\n */\nexport function clearCanvas(canvas: HTMLCanvasElement, ctx?: CanvasRenderingContext2D) {\n ctx = ctx || canvas.getContext('2d');\n\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\n\nexport interface DrawPointOptions {\n pointStyle: PointStyle;\n rotation?: number;\n radius: number;\n borderWidth: number;\n}\n\nexport function drawPoint(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number\n) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n drawPointLegend(ctx, options, x, y, null);\n}\n\n// eslint-disable-next-line complexity\nexport function drawPointLegend(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number,\n w: number\n) {\n let type: string, xOffset: number, yOffset: number, size: number, cornerRadius: number, width: number, xOffsetW: number, yOffsetW: number;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n\n ctx.beginPath();\n\n switch (style) {\n // Default includes circle\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n /* falls through */\n case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n /* falls through */\n case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */\nexport function _isPointInArea(\n point: Point,\n area: TRBL,\n margin?: number\n) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n\n return !area || (point && point.x > area.left - margin && point.x < area.right + margin &&\n\t\tpoint.y > area.top - margin && point.y < area.bottom + margin);\n}\n\nexport function clipArea(ctx: CanvasRenderingContext2D, area: TRBL) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\n\nexport function unclipArea(ctx: CanvasRenderingContext2D) {\n ctx.restore();\n}\n\n/**\n * @private\n */\nexport function _steppedLineTo(\n ctx: CanvasRenderingContext2D,\n previous: Point,\n target: Point,\n flip?: boolean,\n mode?: string\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @private\n */\nexport function _bezierCurveTo(\n ctx: CanvasRenderingContext2D,\n previous: SplinePoint,\n target: SplinePoint,\n flip?: boolean\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(\n flip ? previous.cp1x : previous.cp2x,\n flip ? previous.cp1y : previous.cp2y,\n flip ? target.cp2x : target.cp1x,\n flip ? target.cp2y : target.cp1y,\n target.x,\n target.y);\n}\n\nfunction setRenderOpts(ctx: CanvasRenderingContext2D, opts: RenderTextOpts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\n\nfunction decorateText(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n line: string,\n opts: RenderTextOpts\n) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */\n const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\n\nfunction drawBackdrop(ctx: CanvasRenderingContext2D, opts: BackdropOptions) {\n const oldColor = ctx.fillStyle;\n\n ctx.fillStyle = opts.color as string;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n\n/**\n * Render text onto the canvas\n */\nexport function renderText(\n ctx: CanvasRenderingContext2D,\n text: string | string[],\n x: number,\n y: number,\n font: CanvasFontSpec,\n opts: RenderTextOpts = {}\n) {\n const lines = isArray(text) ? text : [text];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i: number, line: string;\n\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n\n for (i = 0; i < lines.length; ++i) {\n line = lines[i];\n\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n\n y += Number(font.lineHeight);\n }\n\n ctx.restore();\n}\n\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */\nexport function addRoundedRectPath(\n ctx: CanvasRenderingContext2D,\n rect: RoundedRect & { radius: TRBLCorners }\n) {\n const {x, y, w, h, radius} = rect;\n\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\n","import defaults from '../core/core.defaults.js';\nimport {isArray, isObject, toDimension, valueOrDefault} from './helpers.core.js';\nimport {toFontString} from './helpers.canvas.js';\nimport type {ChartArea, FontSpec, Point} from '../types/index.js';\nimport type {TRBL, TRBLCorners} from '../types/geometric.js';\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n\n/**\n * @alias Chart.helpers.options\n * @namespace\n */\n/**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */\nexport function toLineHeight(value: number | string, size: number): number {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n\n value = +matches[2];\n\n switch (matches[3]) {\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n default:\n break;\n }\n\n return size * value;\n}\n\nconst numberOrZero = (v: unknown) => +v || 0;\n\n/**\n * @param value\n * @param props\n */\nexport function _readValueToProps(value: number | Record, props: K[]): Record;\nexport function _readValueToProps(value: number | Record, props: Record): Record;\nexport function _readValueToProps(value: number | Record, props: string[] | Record) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value)\n ? objProps\n ? prop => valueOrDefault(value[prop], value[props[prop]])\n : prop => value[prop]\n : () => value;\n\n for (const prop of keys) {\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */\nexport function toTRBL(value: number | TRBL | Point) {\n return _readValueToProps(value, {top: 'y', right: 'x', bottom: 'y', left: 'x'});\n}\n\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */\nexport function toTRBLCorners(value: number | TRBLCorners) {\n return _readValueToProps(value, ['topLeft', 'topRight', 'bottomLeft', 'bottomRight']);\n}\n\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */\nexport function toPadding(value?: number | TRBL): ChartArea {\n const obj = toTRBL(value) as ChartArea;\n\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n\n return obj;\n}\n\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */\n\nexport function toFont(options: Partial, fallback?: Partial) {\n options = options || {};\n fallback = fallback || defaults.font as FontSpec;\n\n let size = valueOrDefault(options.size, fallback.size);\n\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n\n font.string = toFontString(font);\n return font;\n}\n\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */\nexport function resolve(inputs: Array, context?: object, index?: number, info?: { cacheable: boolean }) {\n let cacheable = true;\n let i: number, ilen: number, value: unknown;\n\n for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */\nexport function _addGrace(minmax: { min: number; max: number; }, grace: number | string, beginAtZero: boolean) {\n const {min, max} = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value: number, add: number) => beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\n\n/**\n * Create a context inheriting parentContext\n * @param parentContext\n * @param context\n * @returns\n */\nexport function createContext(parentContext: null, context: T): T;\nexport function createContext(parentContext: P, context: T): P & T;\nexport function createContext(parentContext: object, context: object) {\n return Object.assign(Object.create(parentContext), context);\n}\n","/* eslint-disable @typescript-eslint/no-use-before-define */\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartMeta} from '../types/index.js';\nimport type {\n ResolverObjectKey,\n ResolverCache,\n ResolverProxy,\n DescriptorDefaults,\n Descriptor,\n ContextCache,\n ContextProxy\n} from './helpers.config.types.js';\nimport {isArray, isFunction, isObject, resolveObjectKey, _capitalize} from './helpers.core.js';\n\nexport * from './helpers.config.types.js';\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */\nexport function _createResolver<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n scopes: T,\n prefixes = [''],\n rootScopes?: R,\n fallback?: ResolverObjectKey,\n getTarget = () => scopes[0]\n) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === 'undefined') {\n fallback = _resolve('_fallback', scopes);\n }\n const cache: ResolverCache = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope: AnyObject) => _createResolver([scope, ...scopes], prefixes, finalRootScopes, fallback),\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop: string) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string) {\n return _cached(target, prop,\n () => _resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop: string) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys(target) {\n return getKeysFromAllScopes(target);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop: string, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n }) as ResolverProxy;\n}\n\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */\nexport function _attachContext<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n proxy: ResolverProxy,\n context: AnyObject,\n subProxy?: ResolverProxy,\n descriptorDefaults?: DescriptorDefaults\n) {\n const cache: ContextCache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx: AnyObject) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope: AnyObject) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string, receiver) {\n return _cached(target, prop,\n () => _resolveWithContext(target, prop, receiver));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return target._descriptors.allKeys\n ? Reflect.has(proxy, prop) ? {enumerable: true, configurable: true} : undefined\n : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(proxy);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop) {\n return Reflect.has(proxy, prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys() {\n return Reflect.ownKeys(proxy);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n }) as ContextProxy;\n}\n\n/**\n * @private\n */\nexport function _descriptors(\n proxy: ResolverCache,\n defaults: DescriptorDefaults = {scriptable: true, indexable: true}\n): Descriptor {\n const {_scriptable = defaults.scriptable, _indexable = defaults.indexable, _allKeys = defaults.allKeys} = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : () => _indexable\n };\n}\n\nconst readKey = (prefix: string, name: string) => prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop: string, value: unknown) => isObject(value) && prop !== 'adapters' &&\n (Object.getPrototypeOf(value) === null || value.constructor === Object);\n\nfunction _cached(\n target: AnyObject,\n prop: string,\n resolve: () => unknown\n) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) {\n return target[prop];\n }\n\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\n\nfunction _resolveWithContext(\n target: ContextCache,\n prop: string,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n let value = _proxy[prop]; // resolve from proxy\n\n // resolve with context\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n // if the resolved value is an object, create a sub resolver for it\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\n\nfunction _resolveScriptable(\n prop: string,\n getValue: (ctx: AnyObject, sub: AnyObject) => unknown,\n target: ContextCache,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _stack} = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n // When scriptable option returns an object, create a resolver on that.\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\n\nfunction _resolveArray(\n prop: string,\n value: unknown[],\n target: ContextCache,\n isIndexable: (key: string) => boolean\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n\n if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n return value[_context.index % value.length];\n } else if (isObject(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter(s => s !== arr);\n value = [];\n for (const item of arr) {\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\n\nfunction resolveFallback(\n fallback: ResolverObjectKey | ((prop: ResolverObjectKey, value: unknown) => ResolverObjectKey),\n prop: ResolverObjectKey,\n value: unknown\n) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\n\nconst getScope = (key: ResolverObjectKey, parent: AnyObject) => key === true ? parent\n : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\n\nfunction addScopes(\n set: Set,\n parentScopes: AnyObject[],\n key: ResolverObjectKey,\n parentFallback: ResolverObjectKey,\n value: unknown\n) {\n for (const parent of parentScopes) {\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n }\n } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n }\n return false;\n}\n\nfunction createSubResolver(\n parentScopes: AnyObject[],\n resolver: ResolverCache,\n prop: ResolverObjectKey,\n value: unknown\n) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [...parentScopes, ...rootScopes];\n const set = new Set();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (typeof fallback !== 'undefined' && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [''], rootScopes, fallback,\n () => subGetTarget(resolver, prop as string, value));\n}\n\nfunction addScopesFromKey(\n set: Set,\n allScopes: AnyObject[],\n key: ResolverObjectKey,\n fallback: ResolverObjectKey,\n item: unknown\n) {\n while (key) {\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\n\nfunction subGetTarget(\n resolver: ResolverCache,\n prop: string,\n value: unknown\n) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n // For array of objects, the object is used to store updated values\n return value;\n }\n return target || {};\n}\n\nfunction _resolveWithPrefixes(\n prop: string,\n prefixes: string[],\n scopes: AnyObject[],\n proxy: ResolverProxy\n) {\n let value: unknown;\n for (const prefix of prefixes) {\n value = _resolve(readKey(prefix, prop), scopes);\n if (typeof value !== 'undefined') {\n return needsSubResolver(prop, value)\n ? createSubResolver(scopes, proxy, prop, value)\n : value;\n }\n }\n}\n\nfunction _resolve(key: string, scopes: AnyObject[]) {\n for (const scope of scopes) {\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n}\n\nfunction getKeysFromAllScopes(target: ResolverCache) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\n\nfunction resolveKeysFromAllScopes(scopes: AnyObject[]) {\n const set = new Set();\n for (const scope of scopes) {\n for (const key of Object.keys(scope).filter(k => !k.startsWith('_'))) {\n set.add(key);\n }\n }\n return Array.from(set);\n}\n\nexport function _parseObjectDataRadialScale(\n meta: ChartMeta<'line' | 'scatter'>,\n data: AnyObject[],\n start: number,\n count: number\n) {\n const {iScale} = meta;\n const {key = 'r'} = this._parsing;\n const parsed = new Array<{r: unknown}>(count);\n let i: number, ilen: number, index: number, item: AnyObject;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n","import {almostEquals, distanceBetweenPoints, sign} from './helpers.math.js';\nimport {_isPointInArea} from './helpers.canvas.js';\nimport type {ChartArea} from '../types/index.js';\nimport type {SplinePoint} from '../types/geometric.js';\n\nconst EPSILON = Number.EPSILON || 1e-14;\n\ntype OptionalSplinePoint = SplinePoint | false\nconst getPoint = (points: SplinePoint[], i: number): OptionalSplinePoint => i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis: 'x' | 'y') => indexAxis === 'x' ? 'y' : 'x';\n\nexport function splineCurve(\n firstPoint: SplinePoint,\n middlePoint: SplinePoint,\n afterPoint: SplinePoint,\n t: number\n): {\n previous: SplinePoint\n next: SplinePoint\n } {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n\n // This function must also respect \"skipped\" points\n\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n\n/**\n * Adjust tangents to ensure monotonic properties\n */\nfunction monotoneAdjust(points: SplinePoint[], deltaK: number[], mK: number[]) {\n const pointsLen = points.length;\n\n let alphaK: number, betaK: number, tauK: number, squaredMagnitude: number, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n for (let i = 0; i < pointsLen - 1; ++i) {\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\n\nfunction monotoneCompute(points: SplinePoint[], mK: number[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta: number, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (let i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */\nexport function splineCurveMonotone(points: SplinePoint[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK: number[] = Array(pointsLen).fill(0);\n const mK: number[] = Array(pointsLen);\n\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i]\n : !pointAfter ? deltaK[i - 1]\n : (sign(deltaK[i - 1]) !== sign(deltaK[i])) ? 0\n : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n\n monotoneAdjust(points, deltaK, mK);\n\n monotoneCompute(points, mK, indexAxis);\n}\n\nfunction capControlPoint(pt: number, min: number, max: number) {\n return Math.max(Math.min(pt, max), min);\n}\n\nfunction capBezierPoints(points: SplinePoint[], area: ChartArea) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n\n/**\n * @private\n */\nexport function _updateBezierControlPoints(\n points: SplinePoint[],\n options,\n area: ChartArea,\n loop: boolean,\n indexAxis: 'x' | 'y'\n) {\n let i: number, ilen: number, point: SplinePoint, controlPoints: ReturnType;\n\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt) => !pt.skip);\n }\n\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n point = points[i];\n controlPoints = splineCurve(\n prev,\n point,\n points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen],\n options.tension\n );\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n","import type {ChartArea, Scale} from '../types/index.js';\nimport type Chart from '../core/core.controller.js';\nimport type {ChartEvent} from '../types.js';\nimport {INFINITY} from './helpers.math.js';\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */\n\n/**\n * @private\n */\nexport function _isDomSupported(): boolean {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * @private\n */\nexport function _getParentNode(domNode: HTMLCanvasElement): HTMLCanvasElement {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = (parent as ShadowRoot).host;\n }\n return parent as HTMLCanvasElement;\n}\n\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */\n\nfunction parseMaxStyle(styleValue: string | number, node: HTMLElement, parentProperty: string) {\n let valueInPixels: number;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = (valueInPixels / 100) * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n\n return valueInPixels;\n}\n\nconst getComputedStyle = (element: HTMLElement): CSSStyleDeclaration =>\n element.ownerDocument.defaultView.getComputedStyle(element, null);\n\nexport function getStyle(el: HTMLElement, property: string): string {\n return getComputedStyle(el).getPropertyValue(property);\n}\n\nconst positions = ['top', 'right', 'bottom', 'left'];\nfunction getPositionedStyle(styles: CSSStyleDeclaration, style: string, suffix?: string): ChartArea {\n const result = {} as ChartArea;\n suffix = suffix ? '-' + suffix : '';\n for (let i = 0; i < 4; i++) {\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\n\nconst useOffsetPos = (x: number, y: number, target: HTMLElement | EventTarget) =>\n (x > 0 || y > 0) && (!target || !(target as HTMLElement).shadowRoot);\n\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */\nfunction getCanvasPosition(\n e: Event | TouchEvent | MouseEvent,\n canvas: HTMLCanvasElement\n): {\n x: number;\n y: number;\n box: boolean;\n } {\n const touches = (e as TouchEvent).touches;\n const source = (touches && touches.length ? touches[0] : e) as MouseEvent;\n const {offsetX, offsetY} = source as MouseEvent;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {x, y, box};\n}\n\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */\n\nexport function getRelativePosition(\n event: Event | ChartEvent | TouchEvent | MouseEvent,\n chart: Chart\n): { x: number; y: number } {\n if ('native' in event) {\n return event;\n }\n\n const {canvas, currentDevicePixelRatio} = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const {x, y, box} = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n\n let {width, height} = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\n\nfunction getContainerSize(canvas: HTMLCanvasElement, width: number, height: number): Partial {\n let maxWidth: number, maxHeight: number;\n\n if (width === undefined || height === undefined) {\n const container = _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\n\nconst round1 = (v: number) => Math.round(v * 10) / 10;\n\n// eslint-disable-next-line complexity\nexport function getMaximumSize(\n canvas: HTMLCanvasElement,\n bbWidth?: number,\n bbHeight?: number,\n aspectRatio?: number\n): { width: number; height: number } {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let {width, height} = containerSize;\n\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n\n return {width, height};\n}\n\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */\nexport function retinaScale(\n chart: Chart,\n forceRatio: number,\n forceStyle?: boolean\n): boolean | void {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n\n const canvas = chart.canvas;\n\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || (!canvas.style.height && !canvas.style.width))) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n\n if (chart.currentDevicePixelRatio !== pixelRatio\n || canvas.height !== deviceHeight\n || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */\nexport const supportsEventListenerOptions = (function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive() { // This function will be called when the browser attempts to access the passive property.\n passiveSupported = true;\n return false;\n }\n } as EventListenerOptions;\n\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}());\n\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */\n\nexport function readUsedSize(\n element: HTMLElement,\n property: 'width' | 'height'\n): number | undefined {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n","import type {Point, SplinePoint} from '../types/geometric.js';\n\n/**\n * @private\n */\nexport function _pointInLine(p1: Point, p2: Point, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n\n/**\n * @private\n */\nexport function _steppedInterpolation(\n p1: Point,\n p2: Point,\n t: number, mode: 'middle' | 'after' | unknown\n) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y\n : mode === 'after' ? t < 1 ? p1.y : p2.y\n : t > 0 ? p2.y : p1.y\n };\n}\n\n/**\n * @private\n */\nexport function _bezierInterpolation(p1: SplinePoint, p2: SplinePoint, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n const cp1 = {x: p1.cp2x, y: p1.cp2y};\n const cp2 = {x: p2.cp1x, y: p2.cp1y};\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n","export interface RTLAdapter {\n x(x: number): number;\n setWidth(w: number): void;\n textAlign(align: 'center' | 'left' | 'right'): 'center' | 'left' | 'right';\n xPlus(x: number, value: number): number;\n leftForLtr(x: number, itemWidth: number): number;\n}\n\nconst getRightToLeftAdapter = function(rectX: number, width: number): RTLAdapter {\n return {\n x(x) {\n return rectX + rectX + width - x;\n },\n setWidth(w) {\n width = w;\n },\n textAlign(align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus(x, value) {\n return x - value;\n },\n leftForLtr(x, itemWidth) {\n return x - itemWidth;\n },\n };\n};\n\nconst getLeftToRightAdapter = function(): RTLAdapter {\n return {\n x(x) {\n return x;\n },\n setWidth(w) { // eslint-disable-line no-unused-vars\n },\n textAlign(align) {\n return align;\n },\n xPlus(x, value) {\n return x + value;\n },\n leftForLtr(x, _itemWidth) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return x;\n },\n };\n};\n\nexport function getRtlAdapter(rtl: boolean, rectX: number, width: number) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\n\nexport function overrideTextDirection(ctx: CanvasRenderingContext2D, direction: 'ltr' | 'rtl') {\n let style: CSSStyleDeclaration, original: [string, string];\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction'),\n ];\n\n style.setProperty('direction', direction, 'important');\n (ctx as { prevTextDirection?: [string, string] }).prevTextDirection = original;\n }\n}\n\nexport function restoreTextDirection(ctx: CanvasRenderingContext2D, original?: [string, string]) {\n if (original !== undefined) {\n delete (ctx as { prevTextDirection?: [string, string] }).prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n","import {_angleBetween, _angleDiff, _isBetween, _normalizeAngle} from './helpers.math.js';\nimport {createContext} from './helpers.options.js';\nimport {isPatternOrGradient} from './helpers.color.js';\n\n/**\n * @typedef { import('../elements/element.line.js').default } LineElement\n * @typedef { import('../elements/element.point.js').default } PointElement\n * @typedef {{start: number, end: number, loop: boolean, style?: any}} Segment\n */\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle,\n };\n }\n return {\n between: _isBetween,\n compare: (a, b) => a - b,\n normalize: x => x\n };\n}\n\nfunction normalizeSegment({start, end, count, loop, style}) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\n\nfunction getSegment(segment, points, bounds) {\n const {property, start: startBound, end: endBound} = bounds;\n const {between, normalize} = propertyFn(property);\n const count = points.length;\n // eslint-disable-next-line prefer-const\n let {start, end, loop} = segment;\n let i, ilen;\n\n if (loop) {\n start += count;\n end += count;\n for (i = 0, ilen = count; i < ilen; ++i) {\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n\n if (end < start) {\n end += count;\n }\n return {start, end, loop, style: segment.style};\n}\n\n/**\n * Returns the sub-segment(s) of a line segment that fall in the given bounds\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} [segment.style] - segment style\n * @param {PointElement[]} points - the points that this segment refers to\n * @param {object} [bounds]\n * @param {string} bounds.property - the property of a `PointElement` we are bounding. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the property\n * @param {number} bounds.end - end value of the property\n * @private\n **/\nexport function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [segment];\n }\n\n const {property, start: startBound, end: endBound} = bounds;\n const count = points.length;\n const {compare, between, normalize} = propertyFn(property);\n const {start, end, loop, style} = getSegment(segment, points, bounds);\n\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n\n const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = () => inside || startIsBefore();\n const shouldStop = () => !inside || endIsBefore();\n\n for (let i = start, prev = start; i <= end; ++i) {\n point = points[i % count];\n\n if (point.skip) {\n continue;\n }\n\n value = normalize(point[property]);\n\n if (value === prevValue) {\n continue;\n }\n\n inside = between(value, startBound, endBound);\n\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({start: subStart, end: i, loop, count, style}));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n\n if (subStart !== null) {\n result.push(normalizeSegment({start: subStart, end, loop, count, style}));\n }\n\n return result;\n}\n\n\n/**\n * Returns the segments of the line that are inside given bounds\n * @param {LineElement} line\n * @param {object} [bounds]\n * @param {string} bounds.property - the property we are bounding with. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the `property`\n * @param {number} bounds.end - end value of the `property`\n * @private\n */\nexport function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n\n for (let i = 0; i < segments.length; i++) {\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n\n/**\n * Find start and end index of a line.\n */\nfunction findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n\n if (loop && !spanGaps) {\n // loop and not spanning gaps, first find a gap to start from\n while (start < count && !points[start].skip) {\n start++;\n }\n }\n\n // find first non skipped point (after the first gap possibly)\n while (start < count && points[start].skip) {\n start++;\n }\n\n // if we looped to count, start needs to be 0\n start %= count;\n\n if (loop) {\n // loop will go past count, if start > 0\n end += start;\n }\n\n while (end > start && points[end % count].skip) {\n end--;\n }\n\n // end could be more than count, normalize\n end %= count;\n\n return {start, end};\n}\n\n/**\n * Compute solid segments from Points, when spanGaps === false\n * @param {PointElement[]} points - the points\n * @param {number} start - start index\n * @param {number} max - max index (can go past count on a loop)\n * @param {boolean} loop - boolean indicating that this would be a loop if no gaps are found\n */\nfunction solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n\n for (end = start + 1; end <= max; ++end) {\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({start: start % count, end: (end - 1) % count, loop});\n // @ts-ignore\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n\n if (last !== null) {\n result.push({start: start % count, end: last % count, loop});\n }\n\n return result;\n}\n\n/**\n * Compute the continuous segments that define the whole line\n * There can be skipped points within a segment, if spanGaps is true.\n * @param {LineElement} line\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n * @private\n */\nexport function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n\n if (!count) {\n return [];\n }\n\n const loop = !!line._loop;\n const {start, end} = findStartAndEnd(points, count, loop, spanGaps);\n\n if (spanGaps === true) {\n return splitByStyles(line, [{start, end, loop}], points, segmentOptions);\n }\n\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n\n/**\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n\n/**\n * @param {LineElement} line\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const {_datasetIndex: datasetIndex, options: {spanGaps}} = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n // Style can not start/end on a skipped point, adjust indices accordingly\n s += count;\n while (points[s % count].skip) {\n s -= dir;\n }\n while (points[e % count].skip) {\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({start: s % count, end: e % count, loop: l, style: st});\n prevStyle = st;\n start = e % count;\n }\n }\n\n for (const segment of segments) {\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for (i = start + 1; i <= segment.end; i++) {\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n\n return result;\n}\n\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\n\nfunction styleChanged(style, prevStyle) {\n if (!prevStyle) {\n return false;\n }\n const cache = [];\n const replacer = function(key, value) {\n if (!isPatternOrGradient(value)) {\n return value;\n }\n if (!cache.includes(value)) {\n cache.push(value);\n }\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n","/*!\n * @kurkle/color v0.3.2\n * https://github.com/kurkle/color#readme\n * (c) 2023 Jukka Kurkela\n * Released under the MIT License\n */\nfunction round(v) {\n return v + 0.5 | 0;\n}\nconst lim = (v, l, h) => Math.max(Math.min(v, h), l);\nfunction p2b(v) {\n return lim(round(v * 2.55), 0, 255);\n}\nfunction b2p(v) {\n return lim(round(v / 2.55), 0, 100);\n}\nfunction n2b(v) {\n return lim(round(v * 255), 0, 255);\n}\nfunction b2n(v) {\n return lim(round(v / 2.55) / 100, 0, 1);\n}\nfunction n2p(v) {\n return lim(round(v * 100), 0, 100);\n}\n\nconst map$1 = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15};\nconst hex = [...'0123456789ABCDEF'];\nconst h1 = b => hex[b & 0xF];\nconst h2 = b => hex[(b & 0xF0) >> 4] + hex[b & 0xF];\nconst eq = b => ((b & 0xF0) >> 4) === (b & 0xF);\nconst isShort = v => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);\nfunction hexParse(str) {\n var len = str.length;\n var ret;\n if (str[0] === '#') {\n if (len === 4 || len === 5) {\n ret = {\n r: 255 & map$1[str[1]] * 17,\n g: 255 & map$1[str[2]] * 17,\n b: 255 & map$1[str[3]] * 17,\n a: len === 5 ? map$1[str[4]] * 17 : 255\n };\n } else if (len === 7 || len === 9) {\n ret = {\n r: map$1[str[1]] << 4 | map$1[str[2]],\n g: map$1[str[3]] << 4 | map$1[str[4]],\n b: map$1[str[5]] << 4 | map$1[str[6]],\n a: len === 9 ? (map$1[str[7]] << 4 | map$1[str[8]]) : 255\n };\n }\n }\n return ret;\n}\nconst alpha = (a, f) => a < 255 ? f(a) : '';\nfunction hexString(v) {\n var f = isShort(v) ? h1 : h2;\n return v\n ? '#' + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f)\n : undefined;\n}\n\nconst HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction hsl2rgbn(h, s, l) {\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [f(0), f(8), f(4)];\n}\nfunction hsv2rgbn(h, s, v) {\n const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n return [f(5), f(3), f(1)];\n}\nfunction hwb2rgbn(h, w, b) {\n const rgb = hsl2rgbn(h, 1, 0.5);\n let i;\n if (w + b > 1) {\n i = 1 / (w + b);\n w *= i;\n b *= i;\n }\n for (i = 0; i < 3; i++) {\n rgb[i] *= 1 - w - b;\n rgb[i] += w;\n }\n return rgb;\n}\nfunction hueValue(r, g, b, d, max) {\n if (r === max) {\n return ((g - b) / d) + (g < b ? 6 : 0);\n }\n if (g === max) {\n return (b - r) / d + 2;\n }\n return (r - g) / d + 4;\n}\nfunction rgb2hsl(v) {\n const range = 255;\n const r = v.r / range;\n const g = v.g / range;\n const b = v.b / range;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s, d;\n if (max !== min) {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = hueValue(r, g, b, d, max);\n h = h * 60 + 0.5;\n }\n return [h | 0, s || 0, l];\n}\nfunction calln(f, a, b, c) {\n return (\n Array.isArray(a)\n ? f(a[0], a[1], a[2])\n : f(a, b, c)\n ).map(n2b);\n}\nfunction hsl2rgb(h, s, l) {\n return calln(hsl2rgbn, h, s, l);\n}\nfunction hwb2rgb(h, w, b) {\n return calln(hwb2rgbn, h, w, b);\n}\nfunction hsv2rgb(h, s, v) {\n return calln(hsv2rgbn, h, s, v);\n}\nfunction hue(h) {\n return (h % 360 + 360) % 360;\n}\nfunction hueParse(str) {\n const m = HUE_RE.exec(str);\n let a = 255;\n let v;\n if (!m) {\n return;\n }\n if (m[5] !== v) {\n a = m[6] ? p2b(+m[5]) : n2b(+m[5]);\n }\n const h = hue(+m[2]);\n const p1 = +m[3] / 100;\n const p2 = +m[4] / 100;\n if (m[1] === 'hwb') {\n v = hwb2rgb(h, p1, p2);\n } else if (m[1] === 'hsv') {\n v = hsv2rgb(h, p1, p2);\n } else {\n v = hsl2rgb(h, p1, p2);\n }\n return {\n r: v[0],\n g: v[1],\n b: v[2],\n a: a\n };\n}\nfunction rotate(v, deg) {\n var h = rgb2hsl(v);\n h[0] = hue(h[0] + deg);\n h = hsl2rgb(h);\n v.r = h[0];\n v.g = h[1];\n v.b = h[2];\n}\nfunction hslString(v) {\n if (!v) {\n return;\n }\n const a = rgb2hsl(v);\n const h = a[0];\n const s = n2p(a[1]);\n const l = n2p(a[2]);\n return v.a < 255\n ? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`\n : `hsl(${h}, ${s}%, ${l}%)`;\n}\n\nconst map = {\n x: 'dark',\n Z: 'light',\n Y: 're',\n X: 'blu',\n W: 'gr',\n V: 'medium',\n U: 'slate',\n A: 'ee',\n T: 'ol',\n S: 'or',\n B: 'ra',\n C: 'lateg',\n D: 'ights',\n R: 'in',\n Q: 'turquois',\n E: 'hi',\n P: 'ro',\n O: 'al',\n N: 'le',\n M: 'de',\n L: 'yello',\n F: 'en',\n K: 'ch',\n G: 'arks',\n H: 'ea',\n I: 'ightg',\n J: 'wh'\n};\nconst names$1 = {\n OiceXe: 'f0f8ff',\n antiquewEte: 'faebd7',\n aqua: 'ffff',\n aquamarRe: '7fffd4',\n azuY: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '0',\n blanKedOmond: 'ffebcd',\n Xe: 'ff',\n XeviTet: '8a2be2',\n bPwn: 'a52a2a',\n burlywood: 'deb887',\n caMtXe: '5f9ea0',\n KartYuse: '7fff00',\n KocTate: 'd2691e',\n cSO: 'ff7f50',\n cSnflowerXe: '6495ed',\n cSnsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: 'ffff',\n xXe: '8b',\n xcyan: '8b8b',\n xgTMnPd: 'b8860b',\n xWay: 'a9a9a9',\n xgYF: '6400',\n xgYy: 'a9a9a9',\n xkhaki: 'bdb76b',\n xmagFta: '8b008b',\n xTivegYF: '556b2f',\n xSange: 'ff8c00',\n xScEd: '9932cc',\n xYd: '8b0000',\n xsOmon: 'e9967a',\n xsHgYF: '8fbc8f',\n xUXe: '483d8b',\n xUWay: '2f4f4f',\n xUgYy: '2f4f4f',\n xQe: 'ced1',\n xviTet: '9400d3',\n dAppRk: 'ff1493',\n dApskyXe: 'bfff',\n dimWay: '696969',\n dimgYy: '696969',\n dodgerXe: '1e90ff',\n fiYbrick: 'b22222',\n flSOwEte: 'fffaf0',\n foYstWAn: '228b22',\n fuKsia: 'ff00ff',\n gaRsbSo: 'dcdcdc',\n ghostwEte: 'f8f8ff',\n gTd: 'ffd700',\n gTMnPd: 'daa520',\n Way: '808080',\n gYF: '8000',\n gYFLw: 'adff2f',\n gYy: '808080',\n honeyMw: 'f0fff0',\n hotpRk: 'ff69b4',\n RdianYd: 'cd5c5c',\n Rdigo: '4b0082',\n ivSy: 'fffff0',\n khaki: 'f0e68c',\n lavFMr: 'e6e6fa',\n lavFMrXsh: 'fff0f5',\n lawngYF: '7cfc00',\n NmoncEffon: 'fffacd',\n ZXe: 'add8e6',\n ZcSO: 'f08080',\n Zcyan: 'e0ffff',\n ZgTMnPdLw: 'fafad2',\n ZWay: 'd3d3d3',\n ZgYF: '90ee90',\n ZgYy: 'd3d3d3',\n ZpRk: 'ffb6c1',\n ZsOmon: 'ffa07a',\n ZsHgYF: '20b2aa',\n ZskyXe: '87cefa',\n ZUWay: '778899',\n ZUgYy: '778899',\n ZstAlXe: 'b0c4de',\n ZLw: 'ffffe0',\n lime: 'ff00',\n limegYF: '32cd32',\n lRF: 'faf0e6',\n magFta: 'ff00ff',\n maPon: '800000',\n VaquamarRe: '66cdaa',\n VXe: 'cd',\n VScEd: 'ba55d3',\n VpurpN: '9370db',\n VsHgYF: '3cb371',\n VUXe: '7b68ee',\n VsprRggYF: 'fa9a',\n VQe: '48d1cc',\n VviTetYd: 'c71585',\n midnightXe: '191970',\n mRtcYam: 'f5fffa',\n mistyPse: 'ffe4e1',\n moccasR: 'ffe4b5',\n navajowEte: 'ffdead',\n navy: '80',\n Tdlace: 'fdf5e6',\n Tive: '808000',\n TivedBb: '6b8e23',\n Sange: 'ffa500',\n SangeYd: 'ff4500',\n ScEd: 'da70d6',\n pOegTMnPd: 'eee8aa',\n pOegYF: '98fb98',\n pOeQe: 'afeeee',\n pOeviTetYd: 'db7093',\n papayawEp: 'ffefd5',\n pHKpuff: 'ffdab9',\n peru: 'cd853f',\n pRk: 'ffc0cb',\n plum: 'dda0dd',\n powMrXe: 'b0e0e6',\n purpN: '800080',\n YbeccapurpN: '663399',\n Yd: 'ff0000',\n Psybrown: 'bc8f8f',\n PyOXe: '4169e1',\n saddNbPwn: '8b4513',\n sOmon: 'fa8072',\n sandybPwn: 'f4a460',\n sHgYF: '2e8b57',\n sHshell: 'fff5ee',\n siFna: 'a0522d',\n silver: 'c0c0c0',\n skyXe: '87ceeb',\n UXe: '6a5acd',\n UWay: '708090',\n UgYy: '708090',\n snow: 'fffafa',\n sprRggYF: 'ff7f',\n stAlXe: '4682b4',\n tan: 'd2b48c',\n teO: '8080',\n tEstN: 'd8bfd8',\n tomato: 'ff6347',\n Qe: '40e0d0',\n viTet: 'ee82ee',\n JHt: 'f5deb3',\n wEte: 'ffffff',\n wEtesmoke: 'f5f5f5',\n Lw: 'ffff00',\n LwgYF: '9acd32'\n};\nfunction unpack() {\n const unpacked = {};\n const keys = Object.keys(names$1);\n const tkeys = Object.keys(map);\n let i, j, k, ok, nk;\n for (i = 0; i < keys.length; i++) {\n ok = nk = keys[i];\n for (j = 0; j < tkeys.length; j++) {\n k = tkeys[j];\n nk = nk.replace(k, map[k]);\n }\n k = parseInt(names$1[ok], 16);\n unpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];\n }\n return unpacked;\n}\n\nlet names;\nfunction nameParse(str) {\n if (!names) {\n names = unpack();\n names.transparent = [0, 0, 0, 0];\n }\n const a = names[str.toLowerCase()];\n return a && {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length === 4 ? a[3] : 255\n };\n}\n\nconst RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction rgbParse(str) {\n const m = RGB_RE.exec(str);\n let a = 255;\n let r, g, b;\n if (!m) {\n return;\n }\n if (m[7] !== r) {\n const v = +m[7];\n a = m[8] ? p2b(v) : lim(v * 255, 0, 255);\n }\n r = +m[1];\n g = +m[3];\n b = +m[5];\n r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));\n g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));\n b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\nfunction rgbString(v) {\n return v && (\n v.a < 255\n ? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`\n : `rgb(${v.r}, ${v.g}, ${v.b})`\n );\n}\n\nconst to = v => v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst from = v => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction interpolate(rgb1, rgb2, t) {\n const r = from(b2n(rgb1.r));\n const g = from(b2n(rgb1.g));\n const b = from(b2n(rgb1.b));\n return {\n r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),\n g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),\n b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),\n a: rgb1.a + t * (rgb2.a - rgb1.a)\n };\n}\n\nfunction modHSL(v, i, ratio) {\n if (v) {\n let tmp = rgb2hsl(v);\n tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n tmp = hsl2rgb(tmp);\n v.r = tmp[0];\n v.g = tmp[1];\n v.b = tmp[2];\n }\n}\nfunction clone(v, proto) {\n return v ? Object.assign(proto || {}, v) : v;\n}\nfunction fromObject(input) {\n var v = {r: 0, g: 0, b: 0, a: 255};\n if (Array.isArray(input)) {\n if (input.length >= 3) {\n v = {r: input[0], g: input[1], b: input[2], a: 255};\n if (input.length > 3) {\n v.a = n2b(input[3]);\n }\n }\n } else {\n v = clone(input, {r: 0, g: 0, b: 0, a: 1});\n v.a = n2b(v.a);\n }\n return v;\n}\nfunction functionParse(str) {\n if (str.charAt(0) === 'r') {\n return rgbParse(str);\n }\n return hueParse(str);\n}\nclass Color {\n constructor(input) {\n if (input instanceof Color) {\n return input;\n }\n const type = typeof input;\n let v;\n if (type === 'object') {\n v = fromObject(input);\n } else if (type === 'string') {\n v = hexParse(input) || nameParse(input) || functionParse(input);\n }\n this._rgb = v;\n this._valid = !!v;\n }\n get valid() {\n return this._valid;\n }\n get rgb() {\n var v = clone(this._rgb);\n if (v) {\n v.a = b2n(v.a);\n }\n return v;\n }\n set rgb(obj) {\n this._rgb = fromObject(obj);\n }\n rgbString() {\n return this._valid ? rgbString(this._rgb) : undefined;\n }\n hexString() {\n return this._valid ? hexString(this._rgb) : undefined;\n }\n hslString() {\n return this._valid ? hslString(this._rgb) : undefined;\n }\n mix(color, weight) {\n if (color) {\n const c1 = this.rgb;\n const c2 = color.rgb;\n let w2;\n const p = weight === w2 ? 0.5 : weight;\n const w = 2 * p - 1;\n const a = c1.a - c2.a;\n const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n w2 = 1 - w1;\n c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n c1.a = p * c1.a + (1 - p) * c2.a;\n this.rgb = c1;\n }\n return this;\n }\n interpolate(color, t) {\n if (color) {\n this._rgb = interpolate(this._rgb, color._rgb, t);\n }\n return this;\n }\n clone() {\n return new Color(this.rgb);\n }\n alpha(a) {\n this._rgb.a = n2b(a);\n return this;\n }\n clearer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 - ratio;\n return this;\n }\n greyscale() {\n const rgb = this._rgb;\n const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n rgb.r = rgb.g = rgb.b = val;\n return this;\n }\n opaquer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 + ratio;\n return this;\n }\n negate() {\n const v = this._rgb;\n v.r = 255 - v.r;\n v.g = 255 - v.g;\n v.b = 255 - v.b;\n return this;\n }\n lighten(ratio) {\n modHSL(this._rgb, 2, ratio);\n return this;\n }\n darken(ratio) {\n modHSL(this._rgb, 2, -ratio);\n return this;\n }\n saturate(ratio) {\n modHSL(this._rgb, 1, ratio);\n return this;\n }\n desaturate(ratio) {\n modHSL(this._rgb, 1, -ratio);\n return this;\n }\n rotate(deg) {\n rotate(this._rgb, deg);\n return this;\n }\n}\n\nfunction index_esm(input) {\n return new Color(input);\n}\n\nexport { Color, b2n, b2p, index_esm as default, hexParse, hexString, hsl2rgb, hslString, hsv2rgb, hueParse, hwb2rgb, lim, n2b, n2p, nameParse, p2b, rgb2hsl, rgbParse, rgbString, rotate, round };\n","/**!\n * Sortable 1.15.1\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n return target;\n}\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n return _typeof(obj);\n}\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = _objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.1\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction matches( /**HTMLElement*/el, /**String*/selector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n return false;\n}\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n return null;\n}\nvar R_SPACE = /\\s+/g;\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\nfunction css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n } while (!selfOnly && (el = el.parentNode));\n }\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n return list;\n }\n return [];\n}\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect();\n\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n } while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n\n/**\r\n * Returns the content rect of the element (bounding rect minus border and padding)\r\n * @param {HTMLElement} el \r\n */\nfunction getContentRect(el) {\n var rect = getRect(el);\n var paddingLeft = parseInt(css(el, 'padding-left')),\n paddingTop = parseInt(css(el, 'padding-top')),\n paddingRight = parseInt(css(el, 'padding-right')),\n paddingBottom = parseInt(css(el, 'padding-bottom'));\n rect.top += paddingTop + parseInt(css(el, 'border-top-width'));\n rect.left += paddingLeft + parseInt(css(el, 'border-left-width'));\n // Client Width/Height includes padding only\n rect.width = el.clientWidth - paddingLeft - paddingRight;\n rect.height = el.clientHeight - paddingTop - paddingBottom;\n rect.bottom = rect.top + rect.height;\n rect.right = rect.left + rect.width;\n return rect;\n}\n\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n\n /* jshint boss:true */\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n currentChild++;\n }\n i++;\n }\n return null;\n}\n\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n return last || null;\n}\n\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */\nfunction index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) {\n return -1;\n }\n\n /* jshint boss:true */\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n return index;\n}\n\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n return [offsetLeft, offsetTop];\n}\n\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n } while (elem = elem.parentNode);\n return getWindowScrollingElement();\n}\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n return dst;\n}\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar _throttleTimeout;\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);\n\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&\n // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n }\n\n // if fromRect != toRect: animate\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) {\n time = _this.options.animation;\n }\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction repaint(target) {\n return target.offsetWidth;\n}\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n\n // Add default options from plugin\n _extends(defaults, initialized.defaults);\n });\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\n ghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n\n _silent = false,\n savedInputChecked = [];\n\n/** @const */\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\n supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return;\n // false when <= IE11\n if (IE11OrLess) {\n return false;\n }\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n }(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n },\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n },\n /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n },\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n },\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n },\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n };\n\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[expando]._onDragOver(event);\n }\n }\n};\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n this.el = el; // root element\n this.options = options = _extends({}, options);\n\n // Export instance\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults);\n\n // Set default options\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n _prepareGroup(options);\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n }\n\n // Bind events\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n sortables.push(this.el);\n\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n\n // Add animation state manager\n _extends(this, AnimationStateManager());\n}\nSortable.prototype = /** @lends Sortable.prototype */{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {\n if (!evt.cancelable) return;\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n _saveInputCheckedState(el);\n\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if (dragEl) {\n return;\n }\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n }\n\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) {\n return;\n }\n\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n target = closest(target, options.draggable, el, false);\n if (target && target.animated) {\n return;\n }\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n }\n\n // Get the index of the dragged element within its parent\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable);\n\n // Check filter\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n }\n\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n }\n\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n\n // Drag start event\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n });\n\n // Chosen item\n toggleClass(dragEl, options.chosenClass, true);\n };\n\n // Disable \"draggable\"\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop);\n\n // Make dragEl draggable (must be before delay for FireFox)\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n pluginEvent('delayStart', this, {\n evt: evt\n });\n\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n awaitingDragStarted = false;\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n var options = this.options;\n\n // Apply effect\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost();\n\n // Drag start event\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n _hideGhostForTarget();\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n target = parent; // store last element\n }\n /* jshint boss:true */ while (parent = parent.parentNode);\n }\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n\n // only set the status to dragging, when we are actually dragging\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n this._onDragStart(evt, true);\n }\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options;\n\n // Position absolutely\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl);\n\n // Set transform-origin\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n pluginEvent('setupClone', this);\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n this._hideClone();\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n }\n\n // #1143: IFrame support workaround\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n _this._hideClone();\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true);\n\n // Set proper drop events\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n on(document, 'drop', _this);\n\n // #1276 fix:\n css(dragEl, 'transform', 'translateZ(0)');\n }\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver( /**Event*/evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n if (_silent) return;\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n\n // Capture animation state\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n _this.captureAnimationState();\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n }\n\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n }\n\n // Animation\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n\n // Null lastTarget if it is not inside a previously swapped element\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n }\n\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n\n // Do not detect for empty insert if already inserted\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n\n // Call when dragEl has been inserted\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n if (revert) {\n parentEl = rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent('revert');\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n return completed(true);\n }\n var elLastChild = lastChild(el, options.draggable);\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n }\n\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n if (target) {\n targetRect = getRect(target);\n }\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n if (firstChild === dragEl) {\n return completed(false);\n }\n target = firstChild;\n targetRect = getRect(target);\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n }\n\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n parentEl = dragEl.parentNode; // actualization\n\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n changed();\n return completed(true);\n }\n }\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop( /**Event*/evt) {\n var el = this.el,\n options = this.options;\n\n // Get the index of the dragged element within its parent\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode;\n\n // Get again after plugin event\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n if (Sortable.eventCanceled) {\n this._nulling();\n return;\n }\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n _cancelNextTick(this.cloneId);\n _cancelNextTick(this._dragStartId);\n\n // Unbind events\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n css(dragEl, 'transform', '');\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n _disableDraggable(dragEl);\n dragEl.style['will-change'] = '';\n\n // Remove classes\n // ghostClass is added in dragStarted\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n toggleClass(dragEl, this.options.chosenClass, false);\n\n // Drag stop event\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n // Remove event\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // drag from one list and drop into another\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent( /**Event*/evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n break;\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n _globalDragOver(evt);\n }\n break;\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n for (; i < n; i++) {\n el = children[i];\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n return;\n }\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return;\n\n // show clone at dragEl or original position\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\nfunction _globalDragOver( /**Event*/evt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n evt.cancelable && evt.preventDefault();\n}\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n return retVal;\n}\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\nfunction _unsilent() {\n _silent = false;\n}\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var sortableContentRect = getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX < sortableContentRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < sortableContentRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction _ghostIsLast(evt, vertical, sortable) {\n var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var sortableContentRect = getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX > sortableContentRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > sortableContentRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n return 0;\n}\n\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n while (i--) {\n sum += str.charCodeAt(i);\n }\n return sum.toString(36);\n}\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n}\n\n// Fixed #973:\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n}\n\n// Export utils\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\nSortable.get = function (element) {\n return element[expando];\n};\n\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n};\n\n// Export\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt;\n\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback);\n\n // Listener for pointer element change\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn;\n\n // New scroll root, set scrollEl\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n var layersOut = 0;\n var currentParent = scrollEl;\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n }\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction Revert() {}\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n this.sortable.animateAll();\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\nfunction Remove() {}\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\n multiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\n folding = false,\n // Folding any other time\n dragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n dataTransfer.setData('Text', data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n });\n\n // Sort multi-drag elements\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n\n sortable.captureAnimationState();\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n }\n\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute);\n\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n }\n\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n activeSortable._showClone(sortable);\n\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children;\n\n // Multi-drag selection\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n }\n\n // Multi-drag drop\n if (dragStarted && this.isMultiDrag) {\n folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n multiDragIndex++;\n });\n\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent('update');\n dispatchSortableEvent('sort');\n }\n }\n }\n\n // Must be done after capturing individual rects (scroll bar)\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n multiDragSortable = toSortable;\n }\n\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return;\n\n // Only deselect if selection is in this sortable\n if (multiDragSortable !== this.sortable) return;\n\n // Only deselect if target is not item in this sortable\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n multiDragSortable = sortable;\n }\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n\n // multiDragElements will already be sorted if folding\n var newIndex;\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n return key;\n }\n }\n });\n}\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","export async function animationFrame(): Promise {\n return new Promise((resolve) => {\n requestAnimationFrame(resolve);\n });\n}\n","import {\n Model,\n ModelElementObject,\n ModelElementId,\n ModelElementArray,\n ModelRecord,\n} from './model';\n\nconst stockIds = [\n 'capacityOfNewlyProducedPhones',\n 'capacityOfRecycledMaterials',\n 'capacityOfRefurbishedPhones',\n 'capacityOfRepairedPhones',\n 'phonesInUse',\n 'supplyOfBrokenPhones',\n 'supplyOfDisposedPhones',\n 'supplyOfHibernatingPhones',\n 'supplyOfNewlyProducedPhones',\n 'supplyOfRecycledMaterials',\n 'supplyOfRefurbishedPhones',\n 'supplyOfRepairedPhones',\n] as const;\n\nconst flowIds = [\n 'abandon',\n 'acquireNewlyProduced',\n 'acquireRefurbished',\n 'acquireRepaired',\n 'acquireUsed',\n 'capacityOfNewlyProducedPhonesAdjustment',\n 'capacityOfRecycledMaterialsAdjustment',\n 'capacityOfRefurbishedPhonesAdjustment',\n 'disposeBroken',\n 'disposeHibernating',\n 'goBroken',\n 'landfill',\n 'produceFromNaturalResources',\n 'produceFromRecycledMaterials',\n 'recycle',\n 'refurbish',\n 'repair',\n 'repairShopCapcityAdjustment',\n] as const;\n\nconst variableIds = [\n 'demandForNaturalResources',\n 'demandForNewlyProducedPhones',\n 'demandForPhones',\n 'demandForRecycledMaterials',\n 'demandForRecycling',\n 'demandForRefurbishedPhones',\n 'demandForRefurbishment',\n 'demandForRepair',\n 'demandForRepairedPhones',\n 'demandForResources',\n 'demandForReusedPhones',\n 'inflowIncentiveSumForPhonesInUse',\n 'phoneGoal',\n 'phonesInUseExcess',\n 'supplyOfBrokenPhonesForDisposal',\n 'supplyOfBrokenPhonesForRepair',\n 'supplyOfDisposedPhonesForLandfilling',\n 'supplyOfDisposedPhonesForRecycling',\n 'supplyOfHibernatingPhonesForDisposal',\n 'supplyOfHibernatingPhonesForRefurbishment',\n 'supplyOfHibernatingPhonesForReuse',\n] as const;\n\nconst parameterIds = [\n 'abandonExcessRate',\n 'abandonRate',\n 'acquireRate',\n 'breakRate',\n 'capacityAdjustmentRate',\n 'disposeIncentive',\n 'disposeRate',\n 'landfillIncentive',\n 'landfillRate',\n 'naturalResourcesIncentive',\n 'newPhoneProductionRate',\n 'newlyProducedPhoneIncentive',\n 'numberOfUsers',\n 'phonesPerUserGoal',\n 'recycleRate',\n 'recyclingIncentive',\n 'refurbishmentIncentive',\n 'refurbishmentRate',\n 'repairIncentive',\n 'repairRate',\n 'reuseIncentive',\n] as const;\n\ntype StockIds = typeof stockIds;\ntype StockId = ModelElementId;\ntype Stocks = ModelElementObject;\ntype StockArray = ModelElementArray;\n\ntype FlowIds = typeof flowIds;\ntype FlowId = ModelElementId;\ntype Flows = ModelElementObject;\ntype FlowArray = ModelElementArray;\n\ntype VariableIds = typeof variableIds;\ntype VariableId = ModelElementId;\ntype Variables = ModelElementObject;\ntype VariableArray = ModelElementArray;\n\ntype ParameterIds = typeof parameterIds;\ntype ParameterId = ModelElementId;\ntype Parameters = ModelElementObject;\ntype ParameterArray = ModelElementArray;\n\ntype Record = ModelRecord;\n\nclass CircularEconomyModel extends Model<\n StockIds,\n FlowIds,\n VariableIds,\n ParameterIds\n> {\n public static readonly initialStocks: Readonly = {\n capacityOfNewlyProducedPhones: 0,\n capacityOfRecycledMaterials: 0,\n capacityOfRefurbishedPhones: 0,\n capacityOfRepairedPhones: 0,\n phonesInUse: 0,\n supplyOfBrokenPhones: 0,\n supplyOfDisposedPhones: 0,\n supplyOfHibernatingPhones: 0,\n supplyOfNewlyProducedPhones: 0,\n supplyOfRecycledMaterials: 0,\n supplyOfRefurbishedPhones: 0,\n supplyOfRepairedPhones: 0,\n };\n\n public static readonly defaultParameters: Readonly = {\n abandonExcessRate: 0.5,\n abandonRate: 0.1,\n acquireRate: 1,\n breakRate: 0.1,\n capacityAdjustmentRate: 0.1,\n disposeIncentive: 0.5,\n disposeRate: 0.5,\n landfillIncentive: 0.5,\n landfillRate: 1,\n naturalResourcesIncentive: 0.5,\n newPhoneProductionRate: 0.5,\n newlyProducedPhoneIncentive: 0.82,\n numberOfUsers: 1000000,\n phonesPerUserGoal: 1,\n recycleRate: 1,\n recyclingIncentive: 0.89,\n refurbishmentIncentive: 0.5,\n refurbishmentRate: 1,\n repairIncentive: 0.5,\n repairRate: 1,\n reuseIncentive: 0.86,\n };\n\n constructor() {\n super(stockIds, flowIds, variableIds, parameterIds);\n }\n\n // eslint-disable-next-line class-methods-use-this\n public evaluate(stocks: Stocks, parameters: Parameters, t: number): Record {\n const {\n capacityOfNewlyProducedPhones,\n capacityOfRecycledMaterials,\n capacityOfRefurbishedPhones,\n capacityOfRepairedPhones,\n phonesInUse,\n supplyOfBrokenPhones,\n supplyOfDisposedPhones,\n supplyOfHibernatingPhones,\n supplyOfNewlyProducedPhones,\n supplyOfRecycledMaterials,\n supplyOfRefurbishedPhones,\n supplyOfRepairedPhones,\n } = stocks;\n const {\n abandonExcessRate,\n abandonRate,\n acquireRate,\n breakRate,\n capacityAdjustmentRate,\n disposeIncentive,\n disposeRate,\n landfillIncentive,\n landfillRate,\n naturalResourcesIncentive,\n newPhoneProductionRate,\n newlyProducedPhoneIncentive,\n numberOfUsers,\n phonesPerUserGoal,\n recycleRate,\n recyclingIncentive,\n refurbishmentIncentive,\n refurbishmentRate,\n repairIncentive,\n repairRate,\n reuseIncentive,\n } = parameters;\n\n const phoneGoal = numberOfUsers * phonesPerUserGoal;\n const phonesInUseExcess = Math.max(phonesInUse - phoneGoal, 0);\n const abandon =\n abandonRate * phonesInUse + abandonExcessRate * phonesInUseExcess;\n const inflowIncentiveSumForPhonesInUse =\n reuseIncentive +\n repairIncentive +\n refurbishmentIncentive +\n newlyProducedPhoneIncentive;\n const goBroken = breakRate * phonesInUse;\n const demandForPhones = Math.max(\n 0,\n phoneGoal - phonesInUse + goBroken + abandon,\n );\n const demandForNewlyProducedPhones =\n (newlyProducedPhoneIncentive / inflowIncentiveSumForPhonesInUse) *\n demandForPhones;\n const acquireNewlyProduced =\n acquireRate *\n Math.min(supplyOfNewlyProducedPhones, demandForNewlyProducedPhones);\n const demandForRefurbishedPhones =\n (refurbishmentIncentive / inflowIncentiveSumForPhonesInUse) *\n demandForPhones;\n const acquireRefurbished =\n acquireRate *\n Math.min(demandForRefurbishedPhones, supplyOfRefurbishedPhones);\n const demandForRepairedPhones =\n (repairIncentive / inflowIncentiveSumForPhonesInUse) * demandForPhones;\n const acquireRepaired =\n acquireRate * Math.min(demandForRepairedPhones, supplyOfRepairedPhones);\n const supplyOfHibernatingPhonesForReuse =\n (reuseIncentive /\n (reuseIncentive + refurbishmentIncentive + disposeIncentive)) *\n supplyOfHibernatingPhones;\n const demandForReusedPhones =\n (reuseIncentive / inflowIncentiveSumForPhonesInUse) * demandForPhones;\n const acquireUsed =\n acquireRate *\n Math.min(supplyOfHibernatingPhonesForReuse, demandForReusedPhones);\n const capacityOfNewlyProducedPhonesAdjustment =\n capacityAdjustmentRate *\n (demandForNewlyProducedPhones - capacityOfNewlyProducedPhones);\n const demandForResources = Math.max(\n capacityOfNewlyProducedPhones -\n supplyOfNewlyProducedPhones +\n acquireNewlyProduced,\n 0,\n );\n const demandForRecycledMaterials =\n (recyclingIncentive / (naturalResourcesIncentive + recyclingIncentive)) *\n demandForResources;\n const capacityOfRecycledMaterialsAdjustment =\n capacityAdjustmentRate *\n (demandForRecycledMaterials - capacityOfRecycledMaterials);\n const capacityOfRefurbishedPhonesAdjustment =\n capacityAdjustmentRate *\n (demandForRefurbishedPhones - capacityOfRefurbishedPhones);\n const supplyOfBrokenPhonesForDisposal =\n (disposeIncentive / (repairIncentive + disposeIncentive)) *\n supplyOfBrokenPhones;\n const disposeBroken = disposeRate * supplyOfBrokenPhonesForDisposal;\n const supplyOfHibernatingPhonesForDisposal =\n (disposeIncentive /\n (reuseIncentive + refurbishmentIncentive + disposeIncentive)) *\n supplyOfHibernatingPhones;\n const disposeHibernating =\n disposeRate * supplyOfHibernatingPhonesForDisposal;\n const supplyOfDisposedPhonesForLandfilling =\n (landfillIncentive / (recyclingIncentive + landfillIncentive)) *\n supplyOfDisposedPhones;\n const landfill = landfillRate * supplyOfDisposedPhonesForLandfilling;\n const demandForNaturalResources =\n (naturalResourcesIncentive /\n (naturalResourcesIncentive + recyclingIncentive)) *\n demandForResources;\n const produceFromNaturalResources =\n newPhoneProductionRate * demandForNaturalResources;\n const produceFromRecycledMaterials =\n newPhoneProductionRate *\n Math.min(demandForRecycledMaterials, supplyOfRecycledMaterials);\n const supplyOfDisposedPhonesForRecycling =\n (recyclingIncentive / (recyclingIncentive + landfillIncentive)) *\n supplyOfDisposedPhones;\n const demandForRecycling = Math.max(\n capacityOfRecycledMaterials -\n supplyOfRecycledMaterials +\n produceFromRecycledMaterials,\n 0,\n );\n const recycle =\n recycleRate *\n Math.min(supplyOfDisposedPhonesForRecycling, demandForRecycling);\n const supplyOfHibernatingPhonesForRefurbishment =\n (refurbishmentIncentive /\n (reuseIncentive + refurbishmentIncentive + disposeIncentive)) *\n supplyOfHibernatingPhones;\n const demandForRefurbishment = Math.max(\n capacityOfRefurbishedPhones -\n supplyOfRefurbishedPhones +\n acquireRefurbished,\n 0,\n );\n const refurbish =\n refurbishmentRate *\n Math.min(\n supplyOfHibernatingPhonesForRefurbishment,\n demandForRefurbishment,\n );\n const demandForRepair = Math.max(\n capacityOfRepairedPhones - supplyOfRepairedPhones + acquireRepaired,\n 0,\n );\n const repair = repairRate * Math.min(supplyOfBrokenPhones, demandForRepair);\n const repairShopCapcityAdjustment =\n capacityAdjustmentRate *\n (demandForRepairedPhones - capacityOfRepairedPhones);\n const supplyOfBrokenPhonesForRepair =\n (repairIncentive / (repairIncentive + disposeIncentive)) *\n supplyOfBrokenPhones;\n\n const variables = {\n demandForNaturalResources,\n demandForNewlyProducedPhones,\n demandForPhones,\n demandForRecycledMaterials,\n demandForRecycling,\n demandForRefurbishedPhones,\n demandForRefurbishment,\n demandForRepair,\n demandForRepairedPhones,\n demandForResources,\n demandForReusedPhones,\n inflowIncentiveSumForPhonesInUse,\n phoneGoal,\n phonesInUseExcess,\n supplyOfBrokenPhonesForDisposal,\n supplyOfBrokenPhonesForRepair,\n supplyOfDisposedPhonesForLandfilling,\n supplyOfDisposedPhonesForRecycling,\n supplyOfHibernatingPhonesForDisposal,\n supplyOfHibernatingPhonesForRefurbishment,\n supplyOfHibernatingPhonesForReuse,\n };\n const flows = {\n abandon,\n acquireNewlyProduced,\n acquireRefurbished,\n acquireRepaired,\n acquireUsed,\n capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhonesAdjustment,\n disposeBroken,\n disposeHibernating,\n goBroken,\n landfill,\n produceFromNaturalResources,\n produceFromRecycledMaterials,\n recycle,\n refurbish,\n repair,\n repairShopCapcityAdjustment,\n };\n\n return { t, stocks, parameters, variables, flows };\n }\n\n // eslint-disable-next-line class-methods-use-this\n public accumulateFlowsPerStock(flows: Flows): Stocks {\n const {\n abandon,\n acquireNewlyProduced,\n acquireRefurbished,\n acquireRepaired,\n acquireUsed,\n capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhonesAdjustment,\n disposeBroken,\n disposeHibernating,\n goBroken,\n landfill,\n produceFromNaturalResources,\n produceFromRecycledMaterials,\n recycle,\n refurbish,\n repair,\n repairShopCapcityAdjustment,\n } = flows;\n\n const flowPerStock: Stocks = {\n capacityOfNewlyProducedPhones: capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterials: capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhones: capacityOfRefurbishedPhonesAdjustment,\n capacityOfRepairedPhones: repairShopCapcityAdjustment,\n phonesInUse:\n acquireNewlyProduced +\n acquireRefurbished +\n acquireRepaired +\n acquireUsed -\n (abandon + goBroken),\n supplyOfBrokenPhones: goBroken - (disposeBroken + repair),\n supplyOfDisposedPhones:\n disposeBroken + disposeHibernating - (landfill + recycle),\n supplyOfHibernatingPhones:\n abandon - (acquireUsed + disposeHibernating + refurbish),\n supplyOfNewlyProducedPhones:\n produceFromNaturalResources +\n produceFromRecycledMaterials -\n acquireNewlyProduced,\n supplyOfRecycledMaterials: recycle - produceFromRecycledMaterials,\n supplyOfRefurbishedPhones: refurbish - acquireRefurbished,\n supplyOfRepairedPhones: repair - acquireRepaired,\n };\n\n return flowPerStock;\n }\n}\nexport type {\n StockIds,\n StockId,\n Stocks,\n StockArray,\n FlowIds,\n FlowId,\n Flows,\n FlowArray,\n VariableIds,\n VariableId,\n Variables,\n VariableArray,\n ParameterIds,\n ParameterId,\n Parameters,\n ParameterArray,\n Record,\n};\n\nexport default CircularEconomyModel;\n","import {\n step,\n FlowEvaluator,\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n} from './box-model/box-model';\nimport type {\n ConvertTupleToUnion,\n ConvertTupleToObject,\n ConvertTupleItemType,\n} from './util/type-helpers';\n\ntype ModelElementIds = readonly string[];\ntype ModelElementId = ConvertTupleToUnion;\ntype ModelElementObject = ConvertTupleToObject<\n I,\n number\n>;\ntype ModelElementArray = ConvertTupleItemType<\n I,\n number\n>;\n\ntype ModelRecord<\n S extends ModelElementIds,\n F extends ModelElementIds,\n V extends ModelElementIds,\n P extends ModelElementIds,\n> = {\n t: number;\n stocks: ModelElementObject;\n flows: ModelElementObject;\n variables: ModelElementObject;\n parameters: ModelElementObject

;\n};\n\nabstract class Model<\n S extends ModelElementIds,\n F extends ModelElementIds,\n V extends ModelElementIds,\n P extends ModelElementIds,\n> {\n public static elementIds = [\n 'stocks',\n 'parameters',\n 'variables',\n 'flows',\n ] as const;\n\n public readonly stockIds: S;\n\n public readonly flowIds: F;\n\n public readonly variableIds: V;\n\n public readonly parameterIds: P;\n\n protected constructor(\n stocksIds: S,\n flowIds: F,\n variableIds: V,\n parameterIds: P,\n ) {\n this.stockIds = stocksIds;\n this.flowIds = flowIds;\n this.variableIds = variableIds;\n this.parameterIds = parameterIds;\n }\n\n public static elementObjectToArray(\n ids: I,\n object: Readonly>,\n ): ModelElementArray {\n return ids.map(\n (id: ModelElementId) => object[id],\n ) as ModelElementArray;\n }\n\n public static arrayToElementObject(\n ids: I,\n array: readonly [...ModelElementArray],\n ): ModelElementObject {\n const result: Partial> = {};\n for (let i = 0; i < ids.length; i += 1) {\n const id: ModelElementId = ids[i];\n result[id] = array[i];\n }\n return result as ModelElementObject;\n }\n\n public stocksToStockArray(\n stocks: Readonly>,\n ): ModelElementArray {\n return Model.elementObjectToArray(this.stockIds, stocks);\n }\n\n public stockArrayToStocks(\n stockArray: readonly [...ModelElementArray],\n ): ModelElementObject {\n return Model.arrayToElementObject(this.stockIds, stockArray);\n }\n\n public flowsToFlowArray(\n flows: Readonly>,\n ): ModelElementArray {\n return Model.elementObjectToArray(this.flowIds, flows);\n }\n\n public flowArrayToFlows(\n flowArray: readonly [...ModelElementArray],\n ): ModelElementObject {\n return Model.arrayToElementObject(this.flowIds, flowArray);\n }\n\n public variablesToVariableArray(\n variables: Readonly>,\n ): ModelElementArray {\n return Model.elementObjectToArray(this.variableIds, variables);\n }\n\n public variableArrayToVariables(\n variableArray: readonly [...ModelElementArray],\n ): ModelElementObject {\n return Model.arrayToElementObject(this.variableIds, variableArray);\n }\n\n public parametersToParameterArray(\n parameters: Readonly>,\n ): ModelElementArray

{\n return Model.elementObjectToArray(this.parameterIds, parameters);\n }\n\n public parameterArrayToParameters(\n parameterArray: readonly [...ModelElementArray

],\n ): ModelElementObject

{\n return Model.arrayToElementObject(this.parameterIds, parameterArray);\n }\n\n public abstract evaluate(\n stocks: ModelElementObject,\n parameters: ModelElementObject

,\n t: number,\n ): ModelRecord;\n\n public abstract accumulateFlowsPerStock(\n flows: ModelElementObject,\n ): ModelElementObject;\n\n public evaluateFlowPerStock(\n stocks: ModelElementObject,\n parameters: ModelElementObject

,\n t: number,\n ): ModelElementObject {\n const { flows } = this.evaluate(stocks, parameters, t);\n return this.accumulateFlowsPerStock(flows);\n }\n\n public createFlowEvaluator(\n parameters: Readonly>,\n ): FlowEvaluator> {\n const result = (\n stocksArray: IntegrationEngineInputArray>,\n t: number,\n ): IntegrationEngineOutputArray> => {\n const stocks = this.stockArrayToStocks(stocksArray);\n const flowsPerStock = this.evaluateFlowPerStock(stocks, parameters, t);\n const flowPerStockArray = this.stocksToStockArray(flowsPerStock);\n return flowPerStockArray;\n };\n return result;\n }\n\n public step(\n stocks: Readonly>,\n t: number,\n h: number,\n flowEvaluator: FlowEvaluator>,\n ): ModelElementObject {\n const stocksArray: ModelElementArray = this.stocksToStockArray(stocks);\n const newStocksArray = step>(\n stocksArray,\n t,\n h,\n flowEvaluator,\n );\n return this.stockArrayToStocks(newStocksArray);\n }\n}\n\nexport type {\n ModelElementIds,\n ModelElementId,\n ModelElementObject,\n ModelElementArray,\n ModelRecord,\n};\n\nexport { Model };\n","import type { FlowEvaluator, ConvergenceCriterion } from './types';\nimport { step as stepImpl, converge as convergeImpl } from './engine';\nimport {\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n IVPIntegrator,\n} from './types';\n\nfunction step5(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray {\n return stepImpl(stocksAtT, t, h, computeFlows, integrator);\n}\n\nfunction step6(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray {\n const mutableFlowsAtT: IntegrationEngineOutputArray = [...flowsAtT];\n const getFlows: FlowEvaluator = (y, x) =>\n x === t ? mutableFlowsAtT : computeFlows(y, x);\n return stepImpl(stocksAtT, t, h, getFlows, integrator);\n}\n\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray;\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray;\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n tOrFlowsAtT: number | IntegrationEngineInputArray,\n tOrH: number,\n hOrComputeFlows: number | FlowEvaluator,\n computeFlowsOrIntegrator?: FlowEvaluator | IVPIntegrator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray {\n if (typeof tOrFlowsAtT === 'number')\n return step5(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as FlowEvaluator,\n computeFlowsOrIntegrator as IVPIntegrator,\n );\n\n return step6(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as number,\n computeFlowsOrIntegrator as FlowEvaluator,\n integrator as IVPIntegrator,\n );\n}\n\nfunction converge6(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C {\n return convergeImpl(stocksAtT, t, h, computeFlows, criterion, integrator);\n}\n\nfunction converge7(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C {\n const mutableFlowsAtT: IntegrationEngineOutputArray = [...flowsAtT];\n const getFlows: FlowEvaluator = (y, x) =>\n x === t ? mutableFlowsAtT : computeFlows(y, x);\n return convergeImpl(stocksAtT, t, h, getFlows, criterion, integrator);\n}\n\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C;\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C;\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n tOrFlowsAtT: number | IntegrationEngineInputArray,\n tOrH: number,\n hOrComputeFlows: number | FlowEvaluator,\n computeFlowsOrCriterion: FlowEvaluator | ConvergenceCriterion,\n criterionOrIntegrator?: ConvergenceCriterion | IVPIntegrator,\n integrator?: IVPIntegrator,\n): C {\n if (typeof tOrFlowsAtT === 'number')\n return converge6(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as FlowEvaluator,\n computeFlowsOrCriterion as ConvergenceCriterion,\n criterionOrIntegrator as IVPIntegrator,\n );\n\n return converge7(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as number,\n computeFlowsOrCriterion as FlowEvaluator,\n criterionOrIntegrator as ConvergenceCriterion,\n integrator as IVPIntegrator,\n );\n}\n\nexport type {\n FlowEvaluator,\n ConvergenceCriterion,\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n};\nexport { step, converge };\n","import {\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n FlowEvaluator,\n IVPIntegrator,\n ConvergenceCriterion,\n} from './types';\nimport { rk4 } from './ode';\n\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n getFlows: FlowEvaluator,\n integrator: IVPIntegrator = rk4,\n): IntegrationEngineOutputArray {\n return integrator(stocksAtT, t, h, getFlows);\n}\n\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n getFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator: IVPIntegrator = rk4,\n): C {\n let iterations = 0;\n let { userdata, done } = criterion(stocksAtT, t, undefined, iterations);\n\n if (!done) {\n let newT = t;\n let newStocks: IntegrationEngineOutputArray | undefined;\n\n do {\n newStocks = integrator(newStocks ?? stocksAtT, newT, h, getFlows);\n newT += h;\n iterations += 1;\n ({ userdata, done } = criterion(newStocks, newT, userdata, iterations));\n } while (!done);\n }\n\n return userdata;\n}\n\nexport type { FlowEvaluator, ConvergenceCriterion };\nexport { step, converge };\n","import {\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n} from './types';\n\nexport function euler(\n y: IntegrationEngineInputArray,\n x: number,\n h: number,\n derivatives: (\n y: IntegrationEngineInputArray,\n x: number,\n ) => IntegrationEngineOutputArray,\n): IntegrationEngineOutputArray {\n const n: number = y.length;\n const dydx = derivatives(y, x);\n const yTemp = dydx; // Reuse array for result to avoid allocation and GC\n for (let i = 0; i < n; i += 1) yTemp[i] = y[i] + h * dydx[i];\n return yTemp;\n}\n\nexport function rk4(\n y: IntegrationEngineInputArray,\n x: number,\n h: number,\n derivatives: (\n y: IntegrationEngineInputArray,\n x: number,\n ) => IntegrationEngineOutputArray,\n): IntegrationEngineOutputArray {\n const n: number = y.length;\n\n const dydx = derivatives(y, x);\n const yTemp = new Array(n) as IntegrationEngineOutputArray;\n\n const h2 = h / 2.0;\n const h6 = h / 6.0;\n const xhh = x + h2;\n\n for (let i = 0; i < n; i += 1) yTemp[i] = y[i] + h2 * dydx[i];\n let dydxTemp = derivatives(yTemp, xhh);\n\n for (let i = 0; i < n; i += 1) yTemp[i] = y[i] + h2 * dydxTemp[i];\n const dydxM = derivatives(yTemp, xhh);\n\n for (let i = 0; i < n; i += 1) {\n yTemp[i] = y[i] + h * dydxM[i];\n dydxM[i] += dydxTemp[i];\n }\n dydxTemp = derivatives(yTemp, x + h);\n\n for (let i = 0; i < n; i += 1)\n yTemp[i] = y[i] + h6 * (dydx[i] + dydxTemp[i] + 2.0 * dydxM[i]);\n return yTemp;\n}\n","import type {\n ModelElementIds,\n ModelElementArray,\n ModelElementObject,\n ModelRecord,\n} from './model';\nimport { Model } from './model';\n\nimport { FlowEvaluator } from './box-model/types';\n\nclass ModelSimulator<\n S extends ModelElementIds,\n F extends ModelElementIds,\n V extends ModelElementIds,\n P extends ModelElementIds,\n> {\n public readonly model: Model;\n\n public readonly parameters: ModelElementObject

;\n\n public record: ModelRecord;\n\n public h: number;\n\n protected flowPerStockCache: {\n t: number;\n value: readonly [...ModelElementArray];\n } | null;\n\n protected flowEvaluator: FlowEvaluator>;\n\n protected flowEvaluatorWithCache: FlowEvaluator>;\n\n constructor(\n model: Model,\n stocks: ModelElementObject,\n parameters: ModelElementObject

,\n t: number,\n h: number,\n ) {\n this.model = model;\n this.parameters = parameters;\n this.flowPerStockCache = null;\n this.record = this.model.evaluate(stocks, parameters, t);\n this.h = h;\n this.flowEvaluator = this.model.createFlowEvaluator(parameters);\n this.flowEvaluatorWithCache = this.evaluateFlowPerStockWithCache.bind(this);\n }\n\n protected evaluateFlowPerStockWithCache(\n stockArray: readonly [...ModelElementArray],\n t: number,\n ): [...ModelElementArray] {\n if (this.flowPerStockCache !== null && this.flowPerStockCache.t === t)\n return [...this.flowPerStockCache.value];\n\n return this.flowEvaluator(stockArray, t);\n }\n\n step(): ModelRecord {\n const { stocks, parameters, t } = this.record;\n const newStocks = this.model.step(\n stocks,\n t,\n this.h,\n this.flowEvaluatorWithCache,\n );\n const newRecord = this.model.evaluate(newStocks, parameters, t + this.h);\n this.flowPerStockCache = {\n t: newRecord.t,\n value: this.model.stocksToStockArray(\n this.model.accumulateFlowsPerStock(newRecord.flows),\n ),\n };\n this.record = newRecord;\n return newRecord;\n }\n}\n\nexport default ModelSimulator;\n","import kebabCase from 'lodash/kebabCase';\n\nimport { ModelElementObject } from './model';\nimport CircularEconomyModel, { Record } from './circular-economy-model';\nimport { loadSvg } from './util/load-svg';\nimport { guardedQuerySelector } from './util/guarded-query-selectors';\n\nconst svgUrl = new URL('../svg/model.svg', import.meta.url);\n\nconst mainFlowIds = [\n 'abandon',\n 'acquireNewlyProduced',\n 'acquireRefurbished',\n 'acquireRepaired',\n 'acquireUsed',\n 'disposeBroken',\n 'disposeHibernating',\n 'goBroken',\n 'landfill',\n 'produceFromNaturalResources',\n 'produceFromRecycledMaterials',\n 'recycle',\n 'refurbish',\n 'repair',\n] as const;\n\ntype MainFlowIds = typeof mainFlowIds;\n\nconst flowVizSigns: ModelElementObject = {\n abandon: +1,\n acquireNewlyProduced: -1,\n acquireRefurbished: -1,\n acquireRepaired: -1,\n acquireUsed: -1,\n disposeBroken: -1,\n disposeHibernating: -1,\n goBroken: -1,\n landfill: -1,\n produceFromNaturalResources: -1,\n produceFromRecycledMaterials: -1,\n recycle: -1,\n refurbish: -1,\n repair: -1,\n};\n\nconst dashGap = 30; // FIXME: Calculate from CSS\nconst lineWidth = 10; // FIXME: Calculate from CSS\nconst dotRadius = 20; // FIXME: Calculate from CSS\nconst lineSegmentArea = lineWidth * dashGap;\nconst dotWithoutLineSegmentArea =\n Math.sqrt(dotRadius ** 2 - lineWidth ** 2) * lineWidth;\nconst averageFlowVizWidth = lineSegmentArea + dotWithoutLineSegmentArea;\nconsole.log(lineSegmentArea, dotWithoutLineSegmentArea, averageFlowVizWidth);\nconst quantityScaleFactor = 30000.0;\nexport default class Visualization {\n protected readonly model: CircularEconomyModel;\n\n public readonly element: HTMLDivElement;\n\n protected readonly svg: SVGSVGElement;\n\n protected constructor(model: CircularEconomyModel, svg: SVGSVGElement) {\n this.model = model;\n this.svg = svg;\n\n this.element = document.createElement('div');\n this.element.append(this.svg);\n }\n\n protected updateSvgFlows(\n deltaMs: DOMHighResTimeStamp,\n stepSize: number,\n record: Record,\n ) {\n const { flows } = record;\n const flowVizScale =\n (stepSize * (quantityScaleFactor / record.parameters.numberOfUsers)) /\n averageFlowVizWidth;\n mainFlowIds.forEach((id) => {\n const flow = flows[id];\n const flowVizSign = flowVizSigns[id];\n const elementId = `${kebabCase(id)}-flow`;\n const element = guardedQuerySelector(\n this.svg,\n `#${elementId}`,\n SVGPathElement,\n );\n const lastDashOffset = parseFloat(\n element.getAttribute('stroke-dashoffset') ?? '0',\n );\n // The dash offset step must not be small compared to the dash gap.\n // Otherwise, the flow animation may appear to move backwards.\n const dashOffsetStep = Math.max(\n -0.3 * dashGap,\n Math.min(flowVizSign * (deltaMs * flow) * flowVizScale, 0.1 * dashGap),\n );\n const dashOffset =\n (Number.isNaN(lastDashOffset) ? 0 : lastDashOffset) + dashOffsetStep;\n\n element.setAttribute('stroke-dashoffset', `${dashOffset}`);\n element.setAttribute('stroke-dasharray', `0 ${dashGap}`);\n });\n }\n\n protected updateSvgStocks(\n deltaMs: DOMHighResTimeStamp,\n stepSize: number,\n record: Record,\n ) {\n const { stocks } = record;\n const stockVizScale = quantityScaleFactor / record.parameters.numberOfUsers;\n this.model.stockIds.forEach((id) => {\n const elementId = kebabCase(id);\n const element = this.svg.getElementById(elementId);\n if (element === null) {\n throw new Error(\n `SVG element with id ${elementId} for stock ${id} not found.`,\n );\n }\n if (!(element instanceof SVGCircleElement)) {\n throw new Error(\n `Stock element for stock ${id} with id ${elementId} is not an SVG circle element.`,\n );\n }\n const stock = stocks[id];\n const radius = Math.sqrt((stock * stockVizScale) / Math.PI);\n element.setAttribute('r', `${radius}`);\n });\n }\n\n protected updateSvg(\n deltaMs: DOMHighResTimeStamp,\n stepSize: number,\n record: Record,\n ) {\n this.updateSvgFlows(deltaMs, stepSize, record);\n this.updateSvgStocks(deltaMs, stepSize, record);\n }\n\n public update(\n deltaMs: DOMHighResTimeStamp,\n stepSize: number,\n record: Record,\n ) {\n this.updateSvg(deltaMs, stepSize, record);\n }\n\n public static prepareSvg(model: CircularEconomyModel, svg: SVGSVGElement) {\n const createSVGElement = (tagName: string) =>\n svg.ownerDocument.createElementNS('http://www.w3.org/2000/svg', tagName);\n\n svg.classList.add('model-visualization');\n svg.querySelectorAll('circle, rect, path, text').forEach((element) => {\n element.removeAttribute('style');\n });\n\n const elementsToRemove = [...svg.children];\n\n const labelLayer = createSVGElement('g');\n labelLayer.classList.add('labels');\n\n const supplyLayer = createSVGElement('g');\n supplyLayer.classList.add('supplies');\n\n const capacityLayer = createSVGElement('g');\n capacityLayer.classList.add('capacities');\n\n const flowLayer = createSVGElement('g');\n flowLayer.classList.add('flows');\n svg.append(capacityLayer, flowLayer, supplyLayer, labelLayer);\n\n svg.querySelectorAll('text').forEach((baseElement) => {\n const clone = baseElement.cloneNode(true) as SVGTextElement;\n clone.classList.add('label');\n labelLayer.append(clone);\n });\n\n svg.querySelectorAll('rect').forEach((baseElement) => {\n const clone = baseElement.cloneNode(false) as SVGRectElement;\n clone.classList.add('capacity');\n capacityLayer.append(clone);\n });\n\n model.stockIds\n .filter((id) => id.startsWith('supplyOf'))\n .forEach((id) => {\n const baseElementId = kebabCase(id.replace(/^supplyOf/, ''));\n const baseElement = guardedQuerySelector(\n svg,\n `#${baseElementId}`,\n SVGGeometryElement,\n );\n\n const clone = baseElement.cloneNode(false) as SVGGeometryElement;\n clone.id = `supply-of-${baseElement.id}`;\n clone.classList.add('stock', 'supply');\n supplyLayer.append(clone);\n });\n const phonesInUse = guardedQuerySelector(\n svg,\n '#phones-in-use',\n SVGGeometryElement,\n );\n const phonesInUseClone = phonesInUse.cloneNode(false) as SVGGeometryElement;\n supplyLayer.append(phonesInUseClone);\n\n model.stockIds\n .filter((id) => id.startsWith('capacityOf'))\n .forEach((id) => {\n const baseElementId = kebabCase(id.replace(/^capacityOf/, ''));\n const baseElement = guardedQuerySelector(\n svg,\n `#${baseElementId}`,\n SVGGeometryElement,\n );\n\n const clone = baseElement.cloneNode(false) as SVGGeometryElement;\n clone.id = `capacity-of-${baseElementId}`;\n clone.classList.add('stock', 'capacity');\n capacityLayer.append(clone);\n });\n mainFlowIds.forEach((id) => {\n const baseElementId = kebabCase(id);\n const baseElement = guardedQuerySelector(\n svg,\n `#${baseElementId}`,\n SVGGeometryElement,\n );\n\n const edge = baseElement.cloneNode(false) as SVGGeometryElement;\n edge.id = `${baseElementId}-edge`;\n edge.removeAttribute('style');\n edge.classList.add('flow', 'edge');\n flowLayer.append(edge);\n\n const flow = baseElement.cloneNode(false) as SVGGeometryElement;\n flow.id = `${baseElementId}-flow`;\n flow.removeAttribute('style');\n flow.classList.add('flow', 'anim-edge');\n flowLayer.append(flow);\n });\n\n elementsToRemove.forEach((element) => element.remove());\n }\n\n public static async create(model: CircularEconomyModel) {\n const svg = await loadSvg(svgUrl);\n this.prepareSvg(model, svg);\n return new Visualization(model, svg);\n }\n}\n","var createCompounder = require('./_createCompounder');\n\n/**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\nvar kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n});\n\nmodule.exports = kebabCase;\n","var arrayReduce = require('./_arrayReduce'),\n deburr = require('./deburr'),\n words = require('./words');\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\";\n\n/** Used to match apostrophes. */\nvar reApos = RegExp(rsApos, 'g');\n\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\nfunction createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n}\n\nmodule.exports = createCompounder;\n","/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduce;\n","var deburrLetter = require('./_deburrLetter'),\n toString = require('./toString');\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */\nvar reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n/** Used to compose unicode character classes. */\nvar rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;\n\n/** Used to compose unicode capture groups. */\nvar rsCombo = '[' + rsComboRange + ']';\n\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\nvar reComboMark = RegExp(rsCombo, 'g');\n\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\nfunction deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n}\n\nmodule.exports = deburr;\n","var basePropertyOf = require('./_basePropertyOf');\n\n/** Used to map Latin Unicode letters to basic Latin letters. */\nvar deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n};\n\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\nvar deburrLetter = basePropertyOf(deburredLetters);\n\nmodule.exports = deburrLetter;\n","/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = basePropertyOf;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var asciiWords = require('./_asciiWords'),\n hasUnicodeWord = require('./_hasUnicodeWord'),\n toString = require('./toString'),\n unicodeWords = require('./_unicodeWords');\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\nfunction words(string, pattern, guard) {\n string = toString(string);\n pattern = guard ? undefined : pattern;\n\n if (pattern === undefined) {\n return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);\n }\n return string.match(pattern) || [];\n}\n\nmodule.exports = words;\n","/** Used to match words composed of alphanumeric characters. */\nvar reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction asciiWords(string) {\n return string.match(reAsciiWord) || [];\n}\n\nmodule.exports = asciiWords;\n","/** Used to detect strings that need a more robust regexp to match words. */\nvar reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\nfunction hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n}\n\nmodule.exports = hasUnicodeWord;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\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',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\",\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;\n\n/** Used to match complex or compound words. */\nvar reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n].join('|'), 'g');\n\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n}\n\nmodule.exports = unicodeWords;\n","/**\n * Loads an external SVG file and returns the DOM tree of its first element.\n *\n * @param {string|URL} uri\n * @param {boolean} clearStyles\n * If true removes the style elements from the file\n * @return {Promise}\n */\nexport async function loadSvg(uri: string | URL, clearStyles = true) {\n const response = await fetch(uri);\n if (response.status < 200 || response.status >= 300) {\n throw new Error(\n `Server returned status ${response.status} (${\n response.statusText\n }) loading ${new URL(uri).href}.`,\n );\n }\n const svgText = await response.text();\n const div = document.createElement('div');\n div.innerHTML = svgText;\n const svgDoc = div.querySelector('svg');\n if (svgDoc === null) {\n throw new Error(`No SVG element found in ${new URL(uri).href}.`);\n }\n\n if (clearStyles) {\n svgDoc.querySelectorAll('style')?.forEach((s) => s.remove());\n }\n\n return svgDoc;\n}\n","export function guardedQuerySelector(\n elem: Element | Document,\n selector: string,\n type: { new (...args: unknown[]): T },\n): T {\n const result = elem.querySelector(selector);\n if (result === null) {\n throw new Error(`No element found matching selector ${selector}.`);\n }\n if (!(result instanceof type)) {\n throw new Error(\n `Element matching selector ${selector} has the wrong type.`,\n );\n }\n return result;\n}\n\nexport function guardedQuerySelectorAll(\n elem: Element | Document,\n selector: string,\n type: { new (...args: unknown[]): T },\n): NodeListOf {\n const results = elem.querySelectorAll(selector);\n results.forEach((result) => {\n if (!(result instanceof type)) {\n throw new Error(\n `An element matching selector ${selector} has the wrong type.`,\n );\n }\n });\n\n return results as NodeListOf;\n}\n","module.exports = require('./helpers/bundle-url').getBundleURL('c39XQ') + \"model.f8e270f6.svg\";","export async function documentReady() {\n return new Promise((resolve) => {\n const state = document.readyState;\n if (state === 'complete' || state === 'interactive') {\n setTimeout(resolve, 0);\n }\n\n document.addEventListener('DOMContentLoaded', () => resolve());\n });\n}\n","import isVarName from '../util/is-var-name';\n\nimport FunctionParameterTransform, {\n PararameterTransformFunction,\n} from './function-parameter-transform';\nimport { ModelElementIds, ModelElementObject } from '../model';\n\nexport default class ScriptedParameterTransform<\n P extends ModelElementIds,\n> extends FunctionParameterTransform

{\n public readonly script: string;\n\n constructor(i18nKey: string, parameterIds: P, script: string) {\n super(\n i18nKey,\n ScriptedParameterTransform.createFunction(parameterIds, script),\n );\n this.script = script;\n }\n\n static createFunction

(\n parameterIds: P,\n script: string,\n ): PararameterTransformFunction

{\n parameterIds.forEach((parameterId) => {\n if (!isVarName(parameterId)) {\n throw new Error(\n `Parameter name '${parameterId}' can not be used as a variable`,\n );\n }\n });\n\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const wrappedScript = new Function(script).toString();\n\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const func = new Function(\n `{ ${parameterIds.join(', ')} }`,\n `(${wrappedScript})(); return { ${parameterIds.join(', ')} }`,\n ) as PararameterTransformFunction

;\n\n return >(parameters: T) => {\n const transformedParameters = func(parameters);\n Object.assign(parameters, transformedParameters);\n return parameters;\n };\n }\n}\n","export default function isVarName(str: unknown): boolean {\n if (typeof str !== 'string') {\n return false;\n }\n\n if (str.trim() !== str) {\n return false;\n }\n\n if (str.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/) === null) {\n return false;\n }\n\n return true;\n}\n","import ParameterTransform from './parameter-transform';\nimport { ModelElementIds, ModelElementObject } from '../model';\n\nexport type PararameterTransformFunction

= <\n T extends ModelElementObject

,\n>(\n parameters: T,\n) => T;\n\nexport default class FunctionParameterTransform<\n P extends ModelElementIds,\n> extends ParameterTransform

{\n protected readonly callable: PararameterTransformFunction

;\n\n constructor(i18nKey: string, callable: PararameterTransformFunction

) {\n super(i18nKey);\n this.callable = callable;\n }\n\n applyTo>(parameters: T): T {\n this.callable(parameters);\n return parameters;\n }\n}\n","import type { ModelElementIds, ModelElementObject } from '../model';\n\nexport default abstract class ParameterTransform

{\n public readonly i18nKey: string;\n\n protected constructor(i18nKey: string) {\n this.i18nKey = i18nKey;\n }\n\n abstract applyTo>(parameters: T): T;\n}\n"],"names":["$96d3e3c23d8fed31$var$names","id","callback","$parcel$global","globalThis","self","window","global","$parcel$interopDefault","a","__esModule","default","$parcel$modules","$parcel$inits","parcelRequire","exports","init","module","call","err","Error","code","register","parcelRegister","Constructor","protoProps","staticProps","$8edfd2951adbea03$var$isDeepEqual","$8edfd2951adbea03$var$isDeepStrictEqual","$2fLxs","$8edfd2951adbea03$var$_typeof","o","Symbol","iterator","constructor","prototype","$8edfd2951adbea03$var$_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","$8edfd2951adbea03$var$_toPropertyKey","arg","key","$8edfd2951adbea03$var$_toPrimitive","input","hint","prim","toPrimitive","undefined","res","TypeError","String","Number","$8edfd2951adbea03$var$_require$codes","$fgTSu","codes","$8edfd2951adbea03$var$ERR_AMBIGUOUS_ARGUMENT","ERR_AMBIGUOUS_ARGUMENT","$8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE","ERR_INVALID_ARG_TYPE","$8edfd2951adbea03$var$ERR_INVALID_ARG_VALUE","ERR_INVALID_ARG_VALUE","$8edfd2951adbea03$var$ERR_INVALID_RETURN_VALUE","ERR_INVALID_RETURN_VALUE","$8edfd2951adbea03$var$ERR_MISSING_ARGS","ERR_MISSING_ARGS","$7aMwq","$gQylu","$8edfd2951adbea03$var$inspect","inspect","$8edfd2951adbea03$require$_require$types","types","$8edfd2951adbea03$var$isPromise","isPromise","$8edfd2951adbea03$var$isRegExp","isRegExp","$8edfd2951adbea03$var$objectAssign","$8edfd2951adbea03$var$objectIs","$8edfd2951adbea03$var$RegExpPrototypeTest","$8edfd2951adbea03$var$lazyLoadComparison","comparison","isDeepEqual","isDeepStrictEqual","$8edfd2951adbea03$var$warned","$8edfd2951adbea03$var$assert","$8edfd2951adbea03$var$ok","$8edfd2951adbea03$var$NO_EXCEPTION_SENTINEL","$8edfd2951adbea03$var$innerFail","obj","message","$8edfd2951adbea03$var$innerOk","fn","argLen","value","generatedMessage","actual","expected","operator","stackStartFn","_len","arguments","args","Array","_key","apply","concat","fail","$8edfd2951adbea03$var$fail","internalMessage","argsLen","warn","emitWarning","console","bind","errArgs","AssertionError","ok","equal","notEqual","deepEqual","notDeepEqual","deepStrictEqual","notDeepStrictEqual","$8edfd2951adbea03$var$notDeepStrictEqual","strictEqual","notStrictEqual","$8edfd2951adbea03$var$Comparison","Comparison","keys","_this","$8edfd2951adbea03$var$_classCallCheck","instance","forEach","$8edfd2951adbea03$var$expectedException","msg","name","push","$8edfd2951adbea03$var$compareExceptionKey","isPrototypeOf","$8edfd2951adbea03$var$getActual","e","$8edfd2951adbea03$var$checkIsPromise","then","catch","$8edfd2951adbea03$var$waitForActual","promiseFn","Promise","resolve","resultPromise","$8edfd2951adbea03$var$expectsError","error","details","fnType","$8edfd2951adbea03$var$expectsNoError","$8edfd2951adbea03$var$internalMatch","string","regexp","fnName","match","throws","_len2","_key2","rejects","_len3","_key3","result","doesNotThrow","_len4","_key4","doesNotReject","_len5","_key5","ifError","newErr","origStack","stack","tmp2","split","shift","tmp1","pos","indexOf","slice","join","doesNotMatch","strict","$8edfd2951adbea03$var$strict","_len6","_key6","$1a41dbb141a3c8c6$var$cachedSetTimeout","$1a41dbb141a3c8c6$var$cachedClearTimeout","$1a41dbb141a3c8c6$var$currentQueue","$1a41dbb141a3c8c6$var$process","$1a41dbb141a3c8c6$var$defaultSetTimout","$1a41dbb141a3c8c6$var$defaultClearTimeout","$1a41dbb141a3c8c6$var$runTimeout","fun","setTimeout","clearTimeout","$1a41dbb141a3c8c6$var$queue","$1a41dbb141a3c8c6$var$draining","$1a41dbb141a3c8c6$var$queueIndex","$1a41dbb141a3c8c6$var$cleanUpNextTick","$1a41dbb141a3c8c6$var$drainQueue","timeout","len","run","$1a41dbb141a3c8c6$var$runClearTimeout","marker","$1a41dbb141a3c8c6$var$Item","array","$1a41dbb141a3c8c6$var$noop","nextTick","title","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","$b1e3b1d2b38bd4b2$var$_typeof","$b1e3b1d2b38bd4b2$var$_defineProperties","$b1e3b1d2b38bd4b2$var$_toPropertyKey","$b1e3b1d2b38bd4b2$var$_toPrimitive","$b1e3b1d2b38bd4b2$var$_setPrototypeOf","p","setPrototypeOf","__proto__","$b1e3b1d2b38bd4b2$var$_getPrototypeOf","getPrototypeOf","get","$b1e3b1d2b38bd4b2$export$e45cb6485273080e","set","v","$b1e3b1d2b38bd4b2$var$assert","$b1e3b1d2b38bd4b2$var$util","$b1e3b1d2b38bd4b2$var$codes","$b1e3b1d2b38bd4b2$var$createErrorType","Base","NodeError","_Base","$b1e3b1d2b38bd4b2$var$_inherits","subClass","superClass","create","hasNativeReflectConstruct","_super","$b1e3b1d2b38bd4b2$var$_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","valueOf","Super","NewTarget","$b1e3b1d2b38bd4b2$var$_possibleConstructorReturn","$b1e3b1d2b38bd4b2$var$_assertThisInitialized","ReferenceError","arg1","arg2","arg3","$b1e3b1d2b38bd4b2$var$_classCallCheck","$b1e3b1d2b38bd4b2$var$oneOf","thing","isArray","map","search","str","substr","determiner","replace","this_len","substring","start","type","$b1e3b1d2b38bd4b2$var$includes","reason","inspected","RangeError","$c43c250226d47bfa$var$getOwnPropertyDescriptors","getOwnPropertyDescriptors","descriptors","getOwnPropertyDescriptor","$c43c250226d47bfa$var$formatRegExp","format","f","$c43c250226d47bfa$var$isString","objects","$c43c250226d47bfa$var$inspect","x","JSON","stringify","_","$c43c250226d47bfa$var$isNull","$c43c250226d47bfa$var$isObject","deprecate","noDeprecation","warned","throwDeprecation","traceDeprecation","trace","$c43c250226d47bfa$var$debugs","$c43c250226d47bfa$var$debugEnvRegex","opts","ctx","seen","stylize","$c43c250226d47bfa$var$stylizeNoColor","depth","colors","$c43c250226d47bfa$var$isBoolean","showHidden","_extend","$c43c250226d47bfa$var$isUndefined","customInspect","$c43c250226d47bfa$var$stylizeWithColor","$c43c250226d47bfa$var$formatValue","styleType","style","styles","recurseTimes","$c43c250226d47bfa$var$isFunction","base","braces","numLinesEst","hash","output","ret","primitive","$c43c250226d47bfa$var$formatPrimitive","simple","$c43c250226d47bfa$var$isNumber","visibleKeys","val","idx","getOwnPropertyNames","$c43c250226d47bfa$var$isError","$c43c250226d47bfa$var$formatError","$c43c250226d47bfa$var$isRegExp","RegExp","toString","$c43c250226d47bfa$var$isDate","Date","$c43c250226d47bfa$var$isArray","toUTCString","$c43c250226d47bfa$var$formatArray","l","$c43c250226d47bfa$var$hasOwnProperty","$c43c250226d47bfa$var$formatProperty","pop","reduce","prev","cur","desc","line","ar","re","$c43c250226d47bfa$var$objectToString","d","$c43c250226d47bfa$var$pad","n","debuglog","toUpperCase","test","pid","isBoolean","isNull","isNullOrUndefined","isNumber","isString","isSymbol","isUndefined","isObject","isDate","isError","isNativeError","isFunction","isPrimitive","isBuffer","$c43c250226d47bfa$var$months","prop","hasOwnProperty","log","time","getHours","getMinutes","getSeconds","getDate","getMonth","inherits","origin","add","$c43c250226d47bfa$var$kCustomPromisifiedSymbol","$c43c250226d47bfa$var$callbackifyOnRejected","cb","newReason","promisify","original","promiseResolve","promiseReject","promise","reject","defineProperties","custom","callbackify","callbackified","maybeCb","rej","$avzh7","$9mPZQ","$6Sxxf","$bbrRm","$9fcb3c45d02987bb$var$uncurryThis","$9fcb3c45d02987bb$var$BigIntSupported","BigInt","$9fcb3c45d02987bb$var$SymbolSupported","$9fcb3c45d02987bb$var$ObjectToString","$9fcb3c45d02987bb$var$numberValue","$9fcb3c45d02987bb$var$stringValue","$9fcb3c45d02987bb$var$booleanValue","$9fcb3c45d02987bb$var$bigIntValue","$9fcb3c45d02987bb$var$symbolValue","$9fcb3c45d02987bb$var$checkBoxedPrimitive","prototypeValueOf","$9fcb3c45d02987bb$var$isMapToString","$9fcb3c45d02987bb$var$isSetToString","$9fcb3c45d02987bb$var$isWeakMapToString","$9fcb3c45d02987bb$var$isWeakSetToString","$9fcb3c45d02987bb$var$isArrayBufferToString","$9fcb3c45d02987bb$var$isArrayBuffer","ArrayBuffer","working","$9fcb3c45d02987bb$var$isDataViewToString","$9fcb3c45d02987bb$var$isDataView","DataView","isArgumentsObject","isGeneratorFunction","isTypedArray","isArrayBufferView","isView","isUint8Array","isUint8ClampedArray","isUint16Array","isUint32Array","isInt8Array","isInt16Array","isInt32Array","isFloat32Array","isFloat64Array","isBigInt64Array","isBigUint64Array","Map","isMap","Set","isSet","WeakMap","isWeakMap","WeakSet","isWeakSet","isArrayBuffer","isDataView","$9fcb3c45d02987bb$var$SharedArrayBufferCopy","SharedArrayBuffer","$9fcb3c45d02987bb$var$isSharedArrayBufferToString","$9fcb3c45d02987bb$var$isSharedArrayBuffer","$9fcb3c45d02987bb$var$isNumberObject","$9fcb3c45d02987bb$var$isStringObject","$9fcb3c45d02987bb$var$isBooleanObject","$9fcb3c45d02987bb$var$isBigIntObject","$9fcb3c45d02987bb$var$isSymbolObject","isSharedArrayBuffer","isAsyncFunction","isMapIterator","isSetIterator","isGeneratorObject","isWebAssemblyCompiledModule","isNumberObject","isStringObject","isBooleanObject","isBigIntObject","isSymbolObject","isBoxedPrimitive","isAnyArrayBuffer","Uint8Array","method","$7a682982bd21c890$var$hasToStringTag","$7a682982bd21c890$var$$toString","$3e3ab","$7a682982bd21c890$var$isStandardArguments","toStringTag","$7a682982bd21c890$var$isLegacyArguments","callee","$7a682982bd21c890$var$supportsStandardArguments","isLegacyArguments","$grYrm","getOwnPropertySymbols","sym","symObj","syms","propertyIsEnumerable","$2VTxt","$70X2U","$2595220fe67fde3d$var$$indexOf","allowMissing","intrinsic","$222bfc848c4c2d20$var$$SyntaxError","SyntaxError","$222bfc848c4c2d20$var$$Function","Function","$222bfc848c4c2d20$var$$TypeError","$222bfc848c4c2d20$var$getEvalledConstructor","expressionSyntax","$222bfc848c4c2d20$var$$gOPD","$222bfc848c4c2d20$var$throwTypeError","$222bfc848c4c2d20$var$ThrowTypeError","calleeThrows","gOPDthrows","$222bfc848c4c2d20$var$hasSymbols","$222bfc848c4c2d20$var$hasProto","$222bfc848c4c2d20$var$getProto","$222bfc848c4c2d20$var$needsEval","$222bfc848c4c2d20$var$TypedArray","$222bfc848c4c2d20$var$INTRINSICS","AggregateError","Atomics","BigInt64Array","BigUint64Array","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","isNaN","Math","parseFloat","parseInt","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakRef","$222bfc848c4c2d20$var$errorProto","$222bfc848c4c2d20$var$doEval","doEval","gen","$222bfc848c4c2d20$var$LEGACY_ALIASES","$l7UhJ","$G9Faa","$222bfc848c4c2d20$var$$concat","$222bfc848c4c2d20$var$$spliceApply","splice","$222bfc848c4c2d20$var$$replace","$222bfc848c4c2d20$var$$strSlice","$222bfc848c4c2d20$var$$exec","exec","$222bfc848c4c2d20$var$rePropName","$222bfc848c4c2d20$var$reEscapeChar","$222bfc848c4c2d20$var$stringToPath","first","last","number","quote","subString","$222bfc848c4c2d20$var$getBaseIntrinsic","alias","intrinsicName","parts","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","$9b342ea1c5e1f709$var$origSymbol","$1f56262e97e17693$var$test","foo","$1f56262e97e17693$var$$Object","$6LzS1","$4ed2f4f644981d90$var$toStr","$4ed2f4f644981d90$var$max","max","$4ed2f4f644981d90$var$concatty","b","arr","j","$4ed2f4f644981d90$var$slicy","arrLike","offset","$4ed2f4f644981d90$var$joiny","joiner","that","bound","$4ed2f4f644981d90$var$ERROR_MESSAGE","boundLength","boundArgs","Empty","$07eb6b366f8e40b5$var$call","$07eb6b366f8e40b5$var$$hasOwn","$5A9i6","$0151647adf448d23$var$$TypeError","$0151647adf448d23$var$$apply","$0151647adf448d23$var$$call","$0151647adf448d23$var$$reflectApply","$0151647adf448d23$var$$defineProperty","$0151647adf448d23$var$$max","originalFunction","func","$0151647adf448d23$var$applyBind","$eHoge","$4107858ba1a6bd6b$var$hasDescriptors","$do5eO","$4107858ba1a6bd6b$var$$TypeError","$4107858ba1a6bd6b$var$$floor","loose","functionLengthIsConfigurable","functionLengthIsWritable","$ab37e68af3e9e6be$var$hasPropertyDescriptors","$ab37e68af3e9e6be$var$$defineProperty","$ab37e68af3e9e6be$var$$SyntaxError","$ab37e68af3e9e6be$var$$TypeError","property","nonEnumerable","nonWritable","nonConfigurable","$be49f289de13b757$var$$defineProperty","$be49f289de13b757$var$hasPropertyDescriptors","hasArrayLengthDefineBug","$9bf19466cddb0914$var$$gOPD","$6d1e808f9d1ac98b$var$GeneratorFunction","$6d1e808f9d1ac98b$var$toStr","$6d1e808f9d1ac98b$var$fnToStr","$6d1e808f9d1ac98b$var$isFnRegex","$6d1e808f9d1ac98b$var$hasToStringTag","$6d1e808f9d1ac98b$var$getProto","$6d1e808f9d1ac98b$var$getGeneratorFunc","generatorFunc","$98Y2N","$fHmwU","$5021cc9e64bc53c4$var$$toString","$5021cc9e64bc53c4$var$hasToStringTag","$5021cc9e64bc53c4$var$g","$5021cc9e64bc53c4$var$typedArrays","$5021cc9e64bc53c4$var$$slice","$5021cc9e64bc53c4$var$getPrototypeOf","$5021cc9e64bc53c4$var$$indexOf","$5021cc9e64bc53c4$var$cache","typedArray","proto","$5021cc9e64bc53c4$var$tryTypedArrays","found","getter","$5021cc9e64bc53c4$var$trySlices","tag","$d13gJ","$6a836ff0bde6ce0d$var$toStr","$6a836ff0bde6ce0d$var$hasOwnProperty","$6a836ff0bde6ce0d$var$forEachArray","receiver","$6a836ff0bde6ce0d$var$forEachString","charAt","$6a836ff0bde6ce0d$var$forEachObject","object","k","list","thisArg","$979de77de5cc0a8e$var$badArrayLike","$979de77de5cc0a8e$var$isCallableMarker","$979de77de5cc0a8e$var$fnToStr","$979de77de5cc0a8e$var$reflectApply","$979de77de5cc0a8e$var$constructorRegex","$979de77de5cc0a8e$var$isES6ClassFn","fnStr","$979de77de5cc0a8e$var$tryFunctionObject","$979de77de5cc0a8e$var$toStr","$979de77de5cc0a8e$var$hasToStringTag","$979de77de5cc0a8e$var$isIE68","$979de77de5cc0a8e$var$isDDA","document","$979de77de5cc0a8e$var$all","all","strClass","$b6dc5923138db0e6$var$possibleNames","$b6dc5923138db0e6$var$g","out","copy","fill","readUInt8","ctor","superCtor","super_","TempCtor","$538f1b056a09a255$var$ownKeys","r","t","filter","$538f1b056a09a255$var$_objectSpread","$538f1b056a09a255$var$_toPropertyKey","$538f1b056a09a255$var$_defineProperties","$538f1b056a09a255$var$_toPrimitive","$538f1b056a09a255$var$_typeof","$538f1b056a09a255$var$_possibleConstructorReturn","$538f1b056a09a255$var$_assertThisInitialized","$538f1b056a09a255$var$_wrapNativeSuper","Class","_cache","has","Wrapper","$538f1b056a09a255$var$_construct","$538f1b056a09a255$var$_getPrototypeOf","$538f1b056a09a255$var$_setPrototypeOf","Parent","$538f1b056a09a255$var$_isNativeReflectConstruct","$538f1b056a09a255$var$inspect","$538f1b056a09a255$var$ERR_INVALID_ARG_TYPE","$538f1b056a09a255$var$endsWith","$538f1b056a09a255$var$blue","$538f1b056a09a255$var$green","$538f1b056a09a255$var$red","$538f1b056a09a255$var$white","$538f1b056a09a255$var$kReadableOperator","strictEqualObject","notStrictEqualObject","notIdentical","$538f1b056a09a255$var$copyError","source","$538f1b056a09a255$var$inspectValue","compact","maxArrayLength","Infinity","breakLength","showProxy","sorted","getters","$538f1b056a09a255$var$AssertionError","_Error","_inspect$custom","$538f1b056a09a255$var$_inherits","options","$538f1b056a09a255$var$_classCallCheck","limit","stackTraceLimit","stderr","isTTY","getColorDepth","$538f1b056a09a255$var$createErrDiff","other","lastPos","end","skipped","actualInspected","actualLines","expectedLines","indicator","inputLength","columns","$538f1b056a09a255$var$repeat","count","floor","maxCount","maxLines","_actualLines","printedLines","skippedMsg","expectedLine","actualLine","divergingLines","_res","knownOperators","captureStackTrace","$8A6bc","$019f13f070986299$var$lacksProperEnumerationOrder","assign","letters","$019f13f070986299$var$assignHasPendingExceptions","preventExtensions","thrower","$gK6Se","$63f67aa80e2e6d42$var$hasSymbols","$63f67aa80e2e6d42$var$toObject","$63f67aa80e2e6d42$var$$push","$63f67aa80e2e6d42$var$$propIsEnumerable","$63f67aa80e2e6d42$var$originalGetSymbols","source1","to","s","from","getSymbols","nextKey","propValue","$c3064632e4f346e0$var$slice","$alwvH","$c3064632e4f346e0$var$origKeys","$c3064632e4f346e0$var$keysShim","$c3064632e4f346e0$var$originalKeys","shim","$7885156e7e68aa1f$var$toStr","isArgs","$212e5b7e1daff425$var$keysShim","$212e5b7e1daff425$var$has","$212e5b7e1daff425$var$toStr","$212e5b7e1daff425$var$isArgs","$212e5b7e1daff425$var$isEnumerable","$212e5b7e1daff425$var$hasDontEnumBug","$212e5b7e1daff425$var$hasProtoEnumBug","$212e5b7e1daff425$var$dontEnums","$212e5b7e1daff425$var$equalsConstructorPrototype","$212e5b7e1daff425$var$excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","$212e5b7e1daff425$var$hasAutomationEqualityBug","$212e5b7e1daff425$var$equalsConstructorPrototypeIfNotBuggy","isArguments","theKeys","skipProto","skipConstructor","$bX2ce","is","$8b36e887b63475ea$var$numberIsNaN","$1ec742ad58c16dc0$var$_slicedToArray","$1ec742ad58c16dc0$var$_arrayWithHoles","$1ec742ad58c16dc0$var$_iterableToArrayLimit","u","next","done","return","$1ec742ad58c16dc0$var$_unsupportedIterableToArray","minLen","$1ec742ad58c16dc0$var$_arrayLikeToArray","$1ec742ad58c16dc0$var$_nonIterableRest","arr2","$1ec742ad58c16dc0$var$_typeof","$1ec742ad58c16dc0$var$regexFlagsSupported","flags","$1ec742ad58c16dc0$var$arrayFromSet","$1ec742ad58c16dc0$var$arrayFromMap","$1ec742ad58c16dc0$var$objectIs","$1ec742ad58c16dc0$var$objectGetOwnPropertySymbols","$1ec742ad58c16dc0$var$numberIsNaN","$1ec742ad58c16dc0$var$uncurryThis","$1ec742ad58c16dc0$var$hasOwnProperty","$1ec742ad58c16dc0$var$propertyIsEnumerable","$1ec742ad58c16dc0$var$objectToString","$1ec742ad58c16dc0$require$_require$types","$1ec742ad58c16dc0$var$isAnyArrayBuffer","$1ec742ad58c16dc0$var$isArrayBufferView","$1ec742ad58c16dc0$var$isDate","$1ec742ad58c16dc0$var$isMap","$1ec742ad58c16dc0$var$isRegExp","$1ec742ad58c16dc0$var$isSet","$1ec742ad58c16dc0$var$isNativeError","$1ec742ad58c16dc0$var$isBoxedPrimitive","$1ec742ad58c16dc0$var$isNumberObject","$1ec742ad58c16dc0$var$isStringObject","$1ec742ad58c16dc0$var$isBooleanObject","$1ec742ad58c16dc0$var$isBigIntObject","$1ec742ad58c16dc0$var$isSymbolObject","$1ec742ad58c16dc0$var$isFloat32Array","$1ec742ad58c16dc0$var$isFloat64Array","$1ec742ad58c16dc0$var$isNonIndex","charCodeAt","$1ec742ad58c16dc0$var$getOwnNonIndexProperties","$1ec742ad58c16dc0$var$compare","y","min","$1ec742ad58c16dc0$var$ONLY_ENUMERABLE","$1ec742ad58c16dc0$var$innerDeepEqual","val1","val2","memos","val1Tag","keys1","keys2","$1ec742ad58c16dc0$var$keyCheck","getTime","$1ec742ad58c16dc0$var$areSimilarFloatArrays","byteLength","buffer","byteOffset","_keys","_keys2","size","buf1","buf2","$1ec742ad58c16dc0$var$getEnumerables","iterationType","aKeys","bKeys","symbolKeysA","symbolKeysB","_symbolKeysB","position","val2MemoA","val2MemoB","areEq","$1ec742ad58c16dc0$var$objEquiv","$1ec742ad58c16dc0$var$setEquiv","memo","aValues","$1ec742ad58c16dc0$var$setMightHaveLoosePrim","altValue","$1ec742ad58c16dc0$var$findLooseMatchingPrimitives","bValues","_i","_val","$1ec742ad58c16dc0$var$setHasEqualElement","$1ec742ad58c16dc0$var$mapEquiv","aEntries","_aEntries$i","item1","item2","$1ec742ad58c16dc0$var$mapMightHaveLoosePrim","item","curB","bEntries","_i2","_bEntries$_i","$1ec742ad58c16dc0$var$mapHasEqualEntry","keysA","delete","setValues","key1","key2","$8VOI3","$bxl1N","$ePB6U","$b8cb099cb9d2d4c2$var$polyfill","getPolyfill","implementation","$680afb7864027f81$var$hasSymbols","$680afb7864027f81$var$toStr","$680afb7864027f81$var$concat","$680afb7864027f81$var$supportsDescriptors","$680afb7864027f81$var$defineProperty","predicate","$680afb7864027f81$var$defineProperties","predicates","supportsDescriptors","polyfill","$aS0hY","$03yTy","$hK2wk","$15d943fc9df10d4c$var$polyfill","NaN","$cgw1K","$d732417b6401265c$export$1e71eb4bef00f6b0","$96d3e3c23d8fed31$export$2077e0241d6afd3c","$96d3e3c23d8fed31$export$837ba5c449269406","h","$96d3e3c23d8fed31$export$bcc6e673dfa14d36","$96d3e3c23d8fed31$export$ed9bd8dcaeba14f6","$96d3e3c23d8fed31$export$dbf961a8d278dbef","$96d3e3c23d8fed31$export$aa35ef1f24408ab9","$96d3e3c23d8fed31$var$map$1","A","B","C","D","E","F","c","$96d3e3c23d8fed31$var$hex","$96d3e3c23d8fed31$var$h1","$96d3e3c23d8fed31$var$h2","$96d3e3c23d8fed31$var$eq","$96d3e3c23d8fed31$var$isShort","g","$96d3e3c23d8fed31$var$alpha","$96d3e3c23d8fed31$var$HUE_RE","$96d3e3c23d8fed31$var$hsl2rgbn","$96d3e3c23d8fed31$var$hsv2rgbn","$96d3e3c23d8fed31$var$hwb2rgbn","w","rgb","$96d3e3c23d8fed31$export$b5ba70b240f8f7f","$96d3e3c23d8fed31$var$calln","$96d3e3c23d8fed31$var$hue","$96d3e3c23d8fed31$var$map","Z","Y","X","W","V","U","T","S","R","Q","P","O","N","M","L","K","G","H","I","J","$96d3e3c23d8fed31$var$names$1","OiceXe","antiquewEte","aqua","aquamarRe","azuY","beige","bisque","black","blanKedOmond","Xe","XeviTet","bPwn","burlywood","caMtXe","KartYuse","KocTate","cSO","cSnflowerXe","cSnsilk","crimson","cyan","xXe","xcyan","xgTMnPd","xWay","xgYF","xgYy","xkhaki","xmagFta","xTivegYF","xSange","xScEd","xYd","xsOmon","xsHgYF","xUXe","xUWay","xUgYy","xQe","xviTet","dAppRk","dApskyXe","dimWay","dimgYy","dodgerXe","fiYbrick","flSOwEte","foYstWAn","fuKsia","gaRsbSo","ghostwEte","gTd","gTMnPd","Way","gYF","gYFLw","gYy","honeyMw","hotpRk","RdianYd","Rdigo","ivSy","khaki","lavFMr","lavFMrXsh","lawngYF","NmoncEffon","ZXe","ZcSO","Zcyan","ZgTMnPdLw","ZWay","ZgYF","ZgYy","ZpRk","ZsOmon","ZsHgYF","ZskyXe","ZUWay","ZUgYy","ZstAlXe","ZLw","lime","limegYF","lRF","magFta","maPon","VaquamarRe","VXe","VScEd","VpurpN","VsHgYF","VUXe","VsprRggYF","VQe","VviTetYd","midnightXe","mRtcYam","mistyPse","moccasR","navajowEte","navy","Tdlace","Tive","TivedBb","Sange","SangeYd","ScEd","pOegTMnPd","pOegYF","pOeQe","pOeviTetYd","papayawEp","pHKpuff","peru","pRk","plum","powMrXe","purpN","YbeccapurpN","Yd","Psybrown","PyOXe","saddNbPwn","sOmon","sandybPwn","sHgYF","sHshell","siFna","silver","skyXe","UXe","UWay","UgYy","snow","sprRggYF","stAlXe","tan","teO","tEstN","tomato","Qe","viTet","JHt","wEte","wEtesmoke","Lw","LwgYF","$96d3e3c23d8fed31$var$RGB_RE","$96d3e3c23d8fed31$var$to","pow","$96d3e3c23d8fed31$var$from","$96d3e3c23d8fed31$var$modHSL","ratio","tmp","$96d3e3c23d8fed31$var$clone","$96d3e3c23d8fed31$var$fromObject","$96d3e3c23d8fed31$export$892596cec99bc70e","valid","_valid","_rgb","rgbString","hexString","hslString","$96d3e3c23d8fed31$export$a197af1c58e6260c","mix","color","weight","w2","c1","c2","w1","interpolate","$96d3e3c23d8fed31$var$interpolate","rgb1","rgb2","clone","alpha","clearer","greyscale","opaquer","negate","lighten","darken","saturate","desaturate","rotate","deg","$96d3e3c23d8fed31$export$625a38b961e8b5e9","$96d3e3c23d8fed31$export$b2f06b640faad956","$96d3e3c23d8fed31$var$unpack","nk","unpacked","tkeys","transparent","toLowerCase","$96d3e3c23d8fed31$export$91aedb20f296e541","m","$96d3e3c23d8fed31$export$5e91288c399be4f9","p1","p2","$02b6f511cc6c123c$export$cf2f7c5792f80b46","$02b6f511cc6c123c$export$2219238a014317b0","$02b6f511cc6c123c$export$342063e11d6c3cad","$02b6f511cc6c123c$export$8b22cf2602fb60ce","$02b6f511cc6c123c$export$23f2a1d2818174ef","$02b6f511cc6c123c$export$39b482c5e57630a8","$02b6f511cc6c123c$export$c4ce752e73470fba","defaultValue","$02b6f511cc6c123c$export$90a7f3efeed30595","$02b6f511cc6c123c$export$953cecd6e717a553","dimension","endsWith","$02b6f511cc6c123c$export$7ccc53e8f1e7dfc5","$02b6f511cc6c123c$export$3722cfe417b6ed86","$02b6f511cc6c123c$export$d66501df72047452","loopable","reverse","$02b6f511cc6c123c$export$995eb9fca571757","a0","a1","ilen","v0","v1","datasetIndex","index","$02b6f511cc6c123c$export$d377dcb2b61d6c4e","klen","$02b6f511cc6c123c$var$isValidKey","$02b6f511cc6c123c$export$667d3bf0c5f83305","tval","sval","$02b6f511cc6c123c$export$efca4cbe5dd06740","current","sources","merger","$02b6f511cc6c123c$export$555508cbc6add439","$02b6f511cc6c123c$export$317a3d46287192d8","$02b6f511cc6c123c$var$keyResolvers","$02b6f511cc6c123c$export$2d1720544b23b823","resolver","$02b6f511cc6c123c$var$_getKeyResolver","$02b6f511cc6c123c$export$9d0e2d13d04f7070","$02b6f511cc6c123c$export$a8550f7dbe79f93a","$02b6f511cc6c123c$export$dda1d9f60106f0e9","$02b6f511cc6c123c$export$a93c5207d687da10","$02b6f511cc6c123c$export$ee7c8ad385a60b7b","$02b6f511cc6c123c$export$56c0d5a1e737357d","PI","$02b6f511cc6c123c$export$971d5caa766a69d7","$02b6f511cc6c123c$export$d29e374196577086","$02b6f511cc6c123c$export$2ec5befb9e6c97d4","POSITIVE_INFINITY","$02b6f511cc6c123c$export$53c86fa97d611818","$02b6f511cc6c123c$export$7f8ddf7c7c20b3cd","$02b6f511cc6c123c$export$39c1cc7c062529d4","$02b6f511cc6c123c$export$7a0bdf7d4a91ea88","$02b6f511cc6c123c$export$9f4f30ee63539e24","log10","$02b6f511cc6c123c$export$2408f22a0fab9ae5","sign","$02b6f511cc6c123c$export$a05254e7c3aeba6e","epsilon","abs","$02b6f511cc6c123c$export$a33b77bbdbb8366c","range","roundedRange","round","niceRange","fraction","niceFraction","$02b6f511cc6c123c$export$d141bba7fdc215a3","$02b6f511cc6c123c$export$53a70dd1ebbae346","$02b6f511cc6c123c$export$625550452a3fa3ec","degrees","$02b6f511cc6c123c$export$23ebac1979863676","$02b6f511cc6c123c$export$96f57966bedc81b4","centrePoint","anglePoint","distanceFromXCenter","distanceFromYCenter","angle","atan2","distance","sqrt","$02b6f511cc6c123c$export$158acd800e1ef08b","pt1","pt2","$02b6f511cc6c123c$export$c18d01048907ea92","$02b6f511cc6c123c$export$28f7fcd39efa255","$02b6f511cc6c123c$export$ffb5f4729a158638","sameAngleIsFullCircle","angleToStart","angleToEnd","startToAngle","endToAngle","$02b6f511cc6c123c$export$25ce5a424b770e84","$02b6f511cc6c123c$export$3b513254972cfc9c","$02b6f511cc6c123c$export$2ed0fc6709e59212","table","cmp","mid","hi","lo","$02b6f511cc6c123c$export$ef35774e6d314e91","ti","$02b6f511cc6c123c$export$ebd11618f299a286","$02b6f511cc6c123c$var$arrayEvents","$02b6f511cc6c123c$export$3b14a55fb2447963","listener","stub","_chartjs","$02b6f511cc6c123c$export$71511d61b312f219","items","$02b6f511cc6c123c$export$43caf9889c228507","requestAnimationFrame","$02b6f511cc6c123c$export$61196ced6d74a310","argsToUse","ticking","$02b6f511cc6c123c$export$3c2fa207a37baaea","align","$02b6f511cc6c123c$export$ce26c07117d59d6a","$02b6f511cc6c123c$export$9d398bebfec1c039","left","right","rtl","$02b6f511cc6c123c$export$9e5f44173e64f162","meta","points","animationsDisabled","pointCount","_sorted","iScale","_parsed","axis","minDefined","maxDefined","getUserBounds","getPixelForValue","$02b6f511cc6c123c$export$efccba1c4a2ef57b","xScale","yScale","_scaleRanges","newRanges","xmin","xmax","ymin","ymax","changed","$02b6f511cc6c123c$var$atEdge","$02b6f511cc6c123c$var$elasticIn","sin","$02b6f511cc6c123c$var$elasticOut","$02b6f511cc6c123c$export$f1e1789686576879","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","cos","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce","$02b6f511cc6c123c$export$f96d196f7728bb5","$02b6f511cc6c123c$export$db3b6bfb95261072","$02b6f511cc6c123c$export$738ab4df8bf92ae9","$02b6f511cc6c123c$var$numbers","$02b6f511cc6c123c$var$colors","$02b6f511cc6c123c$var$intlCache","$02b6f511cc6c123c$export$ae1af26003f05816","num","locale","$02b6f511cc6c123c$var$getNumberFormat","cacheKey","formatter","Intl","NumberFormat","$02b6f511cc6c123c$var$formatters","values","numeric","tickValue","ticks","notation","chart","delta","maxTick","logDelta","numDecimal","minimumFractionDigits","maximumFractionDigits","logarithmic","remain","significand","includes","$02b6f511cc6c123c$export$91477dc880baac21","formatters","$02b6f511cc6c123c$export$6559d589eb85fbb6","$02b6f511cc6c123c$export$2e2af4578d910ddf","$02b6f511cc6c123c$var$getScope$1","node","$02b6f511cc6c123c$var$set","root","scope","$02b6f511cc6c123c$export$4368d992c4eafac0","describe","override","route","targetScope","targetName","scopeObject","targetScopeObject","privateName","local","appliers","_descriptors","_appliers","animation","backgroundColor","borderColor","datasets","devicePixelRatio","context","platform","getDevicePixelRatio","elements","events","font","family","lineHeight","hover","hoverBackgroundColor","hoverBorderColor","hoverColor","indexAxis","interaction","mode","intersect","includeInvisible","maintainAspectRatio","onHover","onClick","parsing","plugins","responsive","scale","scales","showLine","drawActiveElementsOnTop","_scriptable","startsWith","_indexable","_fallback","defaults","delay","duration","easing","loop","properties","numbers","active","resize","show","animations","visible","hide","autoPadding","padding","top","bottom","display","beginAtZero","bounds","clip","grace","grid","lineWidth","drawOnChartArea","drawTicks","tickLength","tickWidth","_ctx","tickColor","border","dash","dashOffset","width","text","minRotation","maxRotation","mirror","textStrokeWidth","textStrokeColor","autoSkip","autoSkipPadding","labelOffset","minor","major","crossAlign","showLabelBackdrop","backdropColor","backdropPadding","$02b6f511cc6c123c$export$e7c866399fa523f5","data","gc","longest","textWidth","measureText","$02b6f511cc6c123c$export$78acf4525d8a74c4","pixel","currentDevicePixelRatio","halfWidth","$02b6f511cc6c123c$export$c9170ad7d4cd7e57","canvas","getContext","save","resetTransform","clearRect","height","restore","$02b6f511cc6c123c$export$493d36ec626b6698","$02b6f511cc6c123c$export$24baa2b76016ce0e","xOffset","yOffset","cornerRadius","xOffsetW","yOffsetW","pointStyle","rotation","radius","rad","translate","drawImage","beginPath","ellipse","arc","closePath","moveTo","lineTo","SQRT1_2","rect","borderWidth","stroke","$02b6f511cc6c123c$export$e7094788287c5e9b","point","area","margin","$02b6f511cc6c123c$export$8743009a87fcb00f","$02b6f511cc6c123c$export$3d8c2f653ac9d0b9","$02b6f511cc6c123c$export$d24c54395ce0c509","previous","flip","midpoint","$02b6f511cc6c123c$export$6554612db691658e","bezierCurveTo","cp1x","cp2x","cp1y","cp2y","$02b6f511cc6c123c$export$dc98b0b04f4c7758","lines","strokeWidth","strokeColor","translation","fillStyle","textAlign","textBaseline","backdrop","$02b6f511cc6c123c$var$drawBackdrop","oldColor","fillRect","strokeStyle","strokeText","maxWidth","fillText","$02b6f511cc6c123c$var$decorateText","strikethrough","underline","metrics","actualBoundingBoxLeft","actualBoundingBoxRight","actualBoundingBoxAscent","actualBoundingBoxDescent","yDecoration","decorationWidth","$02b6f511cc6c123c$export$1fbe638ecf81657e","topLeft","bottomLeft","bottomRight","topRight","$02b6f511cc6c123c$var$LINE_HEIGHT","$02b6f511cc6c123c$var$FONT_STYLE","$02b6f511cc6c123c$var$numberOrZero","$02b6f511cc6c123c$export$21579262ef46735b","objProps","read","$02b6f511cc6c123c$export$d66dc83d8cfc8dd","$02b6f511cc6c123c$export$92108d983e8ee699","$02b6f511cc6c123c$export$a9c23c6ac3fc3eca","$02b6f511cc6c123c$export$34aec0b863436764","fallback","$02b6f511cc6c123c$export$8c78c7c36408ea29","matches","$02b6f511cc6c123c$export$407448d2b89b1813","inputs","info","cacheable","$02b6f511cc6c123c$export$35e795649ee09318","parentContext","$02b6f511cc6c123c$export$a9c996f45e5784d0","scopes","prefixes","rootScopes","getTarget","finalRootScopes","$02b6f511cc6c123c$var$_resolve","cache","_cacheable","_scopes","_rootScopes","_getTarget","deleteProperty","$02b6f511cc6c123c$var$_cached","$02b6f511cc6c123c$var$_resolveWithPrefixes","proxy","prefix","$02b6f511cc6c123c$var$readKey","$02b6f511cc6c123c$var$needsSubResolver","$02b6f511cc6c123c$var$createSubResolver","$02b6f511cc6c123c$var$getKeysFromAllScopes","ownKeys","storage","_storage","$02b6f511cc6c123c$export$c3950d9923825c02","subProxy","descriptorDefaults","_proxy","_context","_subProxy","_stack","$02b6f511cc6c123c$export$7910e0436ed8d1de","setContext","$02b6f511cc6c123c$var$_resolveWithContext","isScriptable","$02b6f511cc6c123c$var$_resolveScriptable","getValue","$02b6f511cc6c123c$var$_resolveArray","isIndexable","allKeys","scriptable","indexable","_allKeys","$02b6f511cc6c123c$var$getScope","parent","parentScopes","allScopes","$02b6f511cc6c123c$var$addScopesFromKey","$02b6f511cc6c123c$var$subGetTarget","$02b6f511cc6c123c$var$addScopes","parentFallback","$02b6f511cc6c123c$var$resolveKeysFromAllScopes","$02b6f511cc6c123c$export$4a5767248b18ef41","_parsing","parsed","parse","$02b6f511cc6c123c$var$EPSILON","EPSILON","$02b6f511cc6c123c$var$getPoint","skip","$02b6f511cc6c123c$var$getValueAxis","$02b6f511cc6c123c$var$capControlPoint","pt","$02b6f511cc6c123c$export$3a1a48c8f6ef640e","$02b6f511cc6c123c$export$9bb611d729802a56","domNode","parentNode","host","$02b6f511cc6c123c$var$parseMaxStyle","styleValue","parentProperty","valueInPixels","$02b6f511cc6c123c$var$getComputedStyle","element","ownerDocument","defaultView","getComputedStyle","$02b6f511cc6c123c$var$positions","$02b6f511cc6c123c$var$getPositionedStyle","suffix","$02b6f511cc6c123c$var$useOffsetPos","shadowRoot","$02b6f511cc6c123c$export$df995fae86a55f06","event","borderBox","boxSizing","paddings","borders","box","$02b6f511cc6c123c$var$getCanvasPosition","touches","offsetX","offsetY","getBoundingClientRect","clientX","clientY","$02b6f511cc6c123c$var$round1","$02b6f511cc6c123c$export$f787f51d84a910ad","forceRatio","forceStyle","pixelRatio","deviceHeight","deviceWidth","setTransform","$02b6f511cc6c123c$export$3466f893ebf79586","passiveSupported","passive","addEventListener","removeEventListener","$02b6f511cc6c123c$export$b4171a6734a65d42","getPropertyValue","$02b6f511cc6c123c$export$8a5498727ef6be21","$02b6f511cc6c123c$export$7a38258bbe170828","$02b6f511cc6c123c$export$2f6ca3d3b1f80bf5","cp1","cp2","$02b6f511cc6c123c$export$3d12bd131bb975d1","rectX","setWidth","xPlus","leftForLtr","itemWidth","_itemWidth","$02b6f511cc6c123c$export$91c6e00c14e7e6fd","direction","getPropertyPriority","setProperty","prevTextDirection","$02b6f511cc6c123c$export$890c4ad488842ce7","$02b6f511cc6c123c$var$propertyFn","between","compare","normalize","$02b6f511cc6c123c$var$normalizeSegment","$02b6f511cc6c123c$export$9fa96a7d116ea3ce","segment","prevValue","startBound","endBound","$02b6f511cc6c123c$var$getSegment","inside","subStart","startIsBefore","endIsBefore","shouldStart","shouldStop","$02b6f511cc6c123c$export$306ddfe3a8403e2","segments","sub","$02b6f511cc6c123c$var$splitByStyles","segmentOptions","$02b6f511cc6c123c$var$doSplitByStyles","chartContext","_chart","baseStyle","$02b6f511cc6c123c$var$readStyle","_datasetIndex","spanGaps","prevStyle","addStyle","st","$02b6f511cc6c123c$var$styleChanged","replacer","p0","p0DataIndex","p1DataIndex","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","$77dc20320068f1ee$export$a424a0aa8f687495","_notify","anims","date","callbacks","numSteps","initial","currentStep","_refresh","_request","_running","_update","now","remaining","_charts","running","draw","_active","_total","tick","_lastDate","_getAnims","charts","complete","progress","listen","acc","_duration","stop","cancel","remove","$77dc20320068f1ee$var$transparent","$77dc20320068f1ee$var$interpolators","boolean","factor","c0","$77dc20320068f1ee$export$c35d437ae5945fcd","update","cfg","currentValue","_target","_prop","elapsed","_start","_loop","_to","_from","_easing","_fn","wait","promises","_promises","resolved","$77dc20320068f1ee$export$8ab227dac26677d","configure","config","animationOptions","animatedProps","_properties","option","_animateOptions","newOptions","$77dc20320068f1ee$var$resolveTargetOptions","$shared","$animations","_createAnimations","$77dc20320068f1ee$var$awaitAll","anim","$77dc20320068f1ee$var$scaleClip","allowedOverflow","$77dc20320068f1ee$var$getSortedDatasetIndices","filterVisible","metasets","_getSortedDatasetMetas","$77dc20320068f1ee$var$applyStack","dsIndex","otherValue","singleMode","$77dc20320068f1ee$var$isStacked","stacked","$77dc20320068f1ee$var$getLastIndexInStack","vScale","positive","getMatchingVisibleMetas","$77dc20320068f1ee$var$updateStacks","controller","_cachedMeta","stacks","_stacks","iAxis","vAxis","indexScale","valueScale","itemStacks","$77dc20320068f1ee$var$getOrCreateStack","stackKey","indexValue","subStack","_top","_bottom","visualValues","_visualValues","$77dc20320068f1ee$var$getFirstScaleId","$77dc20320068f1ee$var$clearStacks","$77dc20320068f1ee$var$isDirectUpdateMode","$77dc20320068f1ee$var$cloneIfNotShared","cached","shared","$77dc20320068f1ee$var$createStack","canStack","hidden","_stacked","$77dc20320068f1ee$export$75572ec5c55b4048","initialize","linkScales","addElements","isPluginEnabled","updateIndex","dataset","getDataset","chooseId","xid","xAxisID","yid","yAxisID","rid","rAxisID","iid","iAxisID","vid","vAxisID","getScaleForId","rScale","getMeta","getDatasetMeta","scaleID","_getOtherScale","reset","_destroy","_data","_dataCheck","$77dc20320068f1ee$var$convertObjectDataToArray","adata","isExtensible","_syncList","datasetElementType","buildOrUpdateElements","resetNewElements","stackChanged","oldStacked","_resyncElements","scopeKeys","datasetScopeKeys","_type","getOptionScopes","createResolver","_cachedDataOpts","parseArrayData","parseObjectData","parsePrimitiveData","isNotInOrderComparedToPrev","labels","getLabels","singleScale","xAxisKey","yAxisKey","getParsed","getDataElement","applyStack","updateRangeFromParsed","parsedValue","getMinMax","otherScale","NEGATIVE_INFINITY","otherMin","otherMax","$77dc20320068f1ee$var$getUserBounds","_skip","getAllParsedValues","getMaxOverflow","getLabelAndValue","label","getLabelForValue","_clip","$77dc20320068f1ee$var$defaultClip","disabled","chartArea","_drawStart","_drawCount","getStyle","resolveDatasetElementOptions","resolveDataElementOptions","$context","dataIndex","raw","_resolveElementOptions","dataElementType","elementType","sharing","enableOptionSharing","datasetElementScopeKeys","names","resolveNamedOptions","freeze","_resolveAnimations","transition","datasetAnimationScopeKeys","getSharedOptions","_sharedOptions","includeOptions","sharedOptions","_animationsDisabled","_getSharedOptions","firstOpts","previouslySharedOptions","updateSharedOptions","updateElement","_setStyle","removeHoverStyle","setHoverStyle","_removeDatasetHoverStyle","_setDatasetHoverStyle","numMeta","numData","_insertElements","_removeElements","move","updateElements","removed","_sync","_dataChanges","_onDataPush","_onDataPop","_onDataShift","_onDataSplice","newCount","_onDataUnshift","_objectData","supportsDecimation","$77dc20320068f1ee$var$parseValue","entry","$77dc20320068f1ee$var$parseFloatBar","startValue","endValue","barStart","barEnd","_custom","$77dc20320068f1ee$var$parseArrayOrPrimitive","$77dc20320068f1ee$var$isFloatBar","$77dc20320068f1ee$var$parseEdge","edge","orig","$77dc20320068f1ee$var$startEnd","$77dc20320068f1ee$export$e97d5dc64e999004","iAxisKey","vAxisKey","bars","getBasePixel","horizontal","isHorizontal","ruler","_getRuler","vpixels","head","_calculateBarValuePixels","ipixels","_calculateBarIndexPixels","enableBorderRadius","center","$77dc20320068f1ee$var$setBorderSkipped","borderSkipped","$77dc20320068f1ee$var$setInflateAmount","inflateAmount","_getStacks","grouped","skipNull","_getStackCount","_getStackIndex","pixels","barThickness","$77dc20320068f1ee$var$computeMinSampleSize","curr","$77dc20320068f1ee$var$getAllScaleValues","$bar","visibleMetas","sort","_length","updateMinAndPrev","getPixelForTick","_startPixel","_endPixel","stackCount","categoryPercentage","barPercentage","baseValue","minBarLength","actualBase","floating","getDataVisibility","startPixel","getPixelForDecimal","endPixel","getValueForPixel","halfGrid","getLineWidthForValue","maxBarThickness","$77dc20320068f1ee$var$computeFlexCategoryTraits","percent","chunk","$77dc20320068f1ee$var$computeFitCategoryTraits","thickness","stackIndex","rects","_index_","_value_","$77dc20320068f1ee$export$19b5c4773f17abe","iPixel","vPixel","$77dc20320068f1ee$export$e04603e7d8b77172","_getRotation","_getCircumference","circumference","_getRotationExtents","isDatasetVisible","arcs","spacing","getMaxBorderWidth","getMaxOffset","maxSize","cutout","chartWeight","_getRingWeight","ratioX","ratioY","$77dc20320068f1ee$var$getRatioAndOffset","endAngle","startAngle","startX","startY","endX","endY","calcMax","calcMin","maxX","maxY","minX","minY","maxHeight","outerRadius","innerRadius","radiusLength","_getVisibleDatasetWeightTotal","total","calculateTotal","_getRingWeightOffset","_circumference","animateRotate","calculateCircumference","animationOpts","centerX","centerY","animateScale","metaData","borderAlign","hoverBorderWidth","hoverOffset","ringWeightOffset","aspectRatio","legend","generateLabels","fontColor","legendItem","toggleDataVisibility","$77dc20320068f1ee$export$3c9b5d28c11cbfd0","_dataset","_decimated","animated","maxGapLength","directUpdate","pointsCount","prevParsed","nullData","firstPoint","lastPoint","updateControlPoints","$77dc20320068f1ee$export$2a270b3a0d973c85","_updateRadius","minSize","cutoutPercentage","getVisibleDatasetCount","xCenter","yCenter","datasetStartAngle","getIndexAngle","defaultAngle","countVisibleElements","_computeAngle","getDistanceFromCenterForValue","angleLines","circular","pointLabels","$77dc20320068f1ee$export$b21a3f1286706191","$77dc20320068f1ee$export$48dbc6ac651bf8be","_fullLoop","pointPosition","getPointPositionForValue","$77dc20320068f1ee$export$b2f2bae6713db87","registry","getElement","$77dc20320068f1ee$export$a6506504f799c5d5","BarController","BubbleController","DoughnutController","LineController","PieController","PolarAreaController","RadarController","ScatterController","$77dc20320068f1ee$var$abstract","$77dc20320068f1ee$var$DateAdapterBase","members","formats","diff","startOf","endOf","$77dc20320068f1ee$export$f32766ea09ec8bc4","_date","$77dc20320068f1ee$var$evaluateInteractionItems","handler","getSortedVisibleDatasetMetas","$77dc20320068f1ee$var$binarySearch","metaset","lookupMethod","_reversePixels","el","getRange","$77dc20320068f1ee$var$getIntersectItems","useFinalPosition","isPointInArea","inRange","$77dc20320068f1ee$var$getNearestItems","$77dc20320068f1ee$var$getNearestCartesianItems","distanceMetric","$77dc20320068f1ee$var$getDistanceMetricForAxis","useX","useY","deltaX","deltaY","minDistance","getCenterPoint","pointInArea","getProps","$77dc20320068f1ee$var$getAxisItems","rangeMethod","intersectsItem","$77dc20320068f1ee$export$a13296960cae0384","modes","nearest","$77dc20320068f1ee$var$STATIC_POSITIONS","$77dc20320068f1ee$var$filterByPosition","$77dc20320068f1ee$var$filterDynamicPositionByAxis","$77dc20320068f1ee$var$sortByWeight","$77dc20320068f1ee$var$getCombinedMax","maxPadding","$77dc20320068f1ee$var$updateMaxPadding","boxPadding","$77dc20320068f1ee$var$fitBoxes","boxes","params","layout","refit","refitBoxes","$77dc20320068f1ee$var$getMargins","positions","same","$77dc20320068f1ee$var$updateDims","getPadding","newWidth","outerWidth","newHeight","outerHeight","widthChanged","heightChanged","fullSize","$77dc20320068f1ee$var$setBoxDims","$77dc20320068f1ee$var$placeBoxes","userPadding","placed","stackWeight","$77dc20320068f1ee$export$1ecca0613f5e56d2","addBox","_layers","z","removeBox","layoutItem","minPadding","availableWidth","availableHeight","$77dc20320068f1ee$var$buildLayoutBoxes","layoutBoxes","$77dc20320068f1ee$var$wrapBoxes","wrap","centerHorizontal","centerVertical","leftAndTop","rightAndBottom","vertical","verticalBoxes","horizontalBoxes","beforeLayout","visibleVerticalBoxCount","vBoxMaxWidth","hBoxMaxHeight","$77dc20320068f1ee$var$setLayoutDims","layouts","$77dc20320068f1ee$var$buildStacks","$77dc20320068f1ee$var$handleMaxPadding","updatePos","change","$77dc20320068f1ee$export$7b1aeb87f31f7da8","acquireContext","releaseContext","getMaximumSize","isAttached","updateConfig","$77dc20320068f1ee$export$a40a96b24b46cf35","$77dc20320068f1ee$var$EXPANDO_KEY","$77dc20320068f1ee$var$EVENT_TYPES","touchstart","touchmove","touchend","pointerenter","pointerdown","pointermove","pointerup","pointerleave","pointerout","$77dc20320068f1ee$var$isNullOrEmpty","$77dc20320068f1ee$var$eventListenerOptions","$77dc20320068f1ee$var$removeListener","$77dc20320068f1ee$var$nodeListContains","nodeList","contains","$77dc20320068f1ee$var$createAttachObserver","observer","MutationObserver","entries","trigger","addedNodes","removedNodes","observe","childList","subtree","$77dc20320068f1ee$var$createDetachObserver","$77dc20320068f1ee$var$drpListeningCharts","$77dc20320068f1ee$var$oldDevicePixelRatio","$77dc20320068f1ee$var$onWindowResize","dpr","$77dc20320068f1ee$var$createResizeObserver","container","clientWidth","ResizeObserver","contentRect","$77dc20320068f1ee$var$releaseObserver","disconnect","$77dc20320068f1ee$var$createProxyAndListen","$77dc20320068f1ee$var$fromNativeEvent","native","$77dc20320068f1ee$var$addListener","$77dc20320068f1ee$export$f02da7f882cf6b2e","$77dc20320068f1ee$var$initCanvas","renderHeight","getAttribute","renderWidth","displayWidth","displayHeight","removeAttribute","setAttribute","proxies","$proxies","handlers","attach","detach","bbWidth","bbHeight","margins","containerSize","$02b6f511cc6c123c$var$getContainerSize","containerStyle","containerBorder","containerPadding","clientHeight","maintainHeight","isConnected","$77dc20320068f1ee$export$db77ccec0bb4ccac","tooltipPosition","hasValue","final","$77dc20320068f1ee$var$skip","newTicks","majorStart","majorEnd","ceil","$77dc20320068f1ee$var$reverseAlign","$77dc20320068f1ee$var$offsetFromEdge","$77dc20320068f1ee$var$getTicksLimit","ticksLength","maxTicksLimit","$77dc20320068f1ee$var$sample","numItems","increment","$77dc20320068f1ee$var$getTickMarkLength","$77dc20320068f1ee$var$getTitleHeight","$77dc20320068f1ee$export$d60cfc58d3c358b6","_userMin","_userMax","_suggestedMin","suggestedMin","_suggestedMax","suggestedMax","metas","paddingLeft","paddingTop","paddingRight","paddingBottom","getTicks","xLabels","yLabels","getLabelItems","_labelItems","_computeLabelItems","_dataLimitsCached","beforeUpdate","tickOpts","sampleSize","_margins","_labelSizes","_gridLineItems","beforeSetDimensions","setDimensions","afterSetDimensions","_maxLength","beforeDataLimits","determineDataLimits","afterDataLimits","_range","minmax","keepZero","beforeBuildTicks","buildTicks","afterBuildTicks","samplingEnabled","_convertTicksToLabels","beforeCalculateLabelRotation","calculateLabelRotation","afterCalculateLabelRotation","$77dc20320068f1ee$var$autoSkip","determinedMaxTicks","$77dc20320068f1ee$var$determineMaxTicks","_tickSize","maxScale","maxChart","ticksLimit","majorIndices","enabled","$77dc20320068f1ee$var$getMajorIndices","numMajorIndices","$77dc20320068f1ee$var$skipMajors","$77dc20320068f1ee$var$calculateSpacing","evenMajorSpacing","$77dc20320068f1ee$var$getEvenSpacing","factors","avgMajorSpacing","afterAutoSkip","beforeFit","fit","afterFit","afterUpdate","reversePixels","_alignToPixels","alignToPixels","_callHooks","notifyPlugins","beforeTickToLabelConversion","generateTickLabels","afterTickToLabelConversion","maxLabelDiagonal","numTicks","labelRotation","_isVisible","labelSizes","_getLabelSizes","maxLabelWidth","widest","maxLabelHeight","highest","radians","asin","titleOpts","gridOpts","titleHeight","tickPadding","angleRadians","labelHeight","labelWidth","_calculatePadding","_handleMargins","isRotated","labelsBelowTicks","offsetLeft","offsetRight","isFullSize","_computeLabelSizes","jlen","tickFont","fontString","nestedLabel","_longestTextCache","caches","widths","heights","widestLabelSize","highestLabelSize","_resolveTickFontOptions","gcLen","valueAt","decimal","getDecimalForPixel","getBaseValue","optionTicks","rot","_computeGridLineItems","borderValue","lineValue","alignedLineValue","tx1","ty1","tx2","ty2","x1","y1","x2","y2","tl","borderOpts","axisWidth","axisHalfWidth","alignBorderValue","positionAxisID","step","optsAtIndex","optsAtIndexBorder","lineColor","tickBorderDash","tickBorderDashOffset","$77dc20320068f1ee$var$getPixelForGridLine","offsetGridLines","validIndex","_ticksLength","_borderValue","lineCount","textOffset","tickAndPadding","hTickAndPadding","_getXAxisLabelAlignment","_getYAxisLabelAlignment","halfCount","tickTextAlign","labelPadding","_computeLabelArea","drawBackground","findIndex","drawGrid","drawLine","setLineDash","lineDashOffset","drawBorder","lastLineWidth","drawLabels","renderTextOptions","drawTitle","titleX","titleY","$77dc20320068f1ee$var$titleArgs","tz","gz","bz","axisID","_maxDigits","fontSize","$77dc20320068f1ee$var$TypedRegistry","isForType","parentScope","$77dc20320068f1ee$var$registerDefaults","itemDefaults","defaultRoutes","$77dc20320068f1ee$var$routeDefaults","routes","propertyParts","sourceName","sourceScope","overrides","unregister","$77dc20320068f1ee$export$4bb7493d241fd8a5","_each","addControllers","controllers","addPlugins","addScales","getController","_get","getPlugin","getScale","removeControllers","removeElements","removePlugins","removeScales","typedRegistry","reg","_getRegistryForType","_exec","itemReg","component","camelMethod","_typedRegistries","$77dc20320068f1ee$var$PluginService","notify","hook","_init","_createDescriptors","plugin","cancelable","invalidate","_oldCache","_notifyStateChanges","$77dc20320068f1ee$var$allPlugins","localIds","$77dc20320068f1ee$var$createDescriptors","$77dc20320068f1ee$var$pluginOpts","pluginScopeKeys","previousDescriptors","some","$77dc20320068f1ee$var$getIndexAxis","datasetDefaults","datasetOptions","$77dc20320068f1ee$var$idMatchesAxis","$77dc20320068f1ee$var$determineAxis","scaleOptions","$77dc20320068f1ee$var$getAxisFromDataset","$77dc20320068f1ee$var$initOptions","$77dc20320068f1ee$var$mergeScaleConfig","chartDefaults","configScales","chartIndexAxis","scaleConf","$77dc20320068f1ee$var$retrieveAxisFromDatasets","boundDs","defaultId","defaultScaleOptions","defaultID","$77dc20320068f1ee$var$initData","$77dc20320068f1ee$var$keyCache","$77dc20320068f1ee$var$keysCached","$77dc20320068f1ee$var$cachedKeys","generate","$77dc20320068f1ee$var$addIfFound","$77dc20320068f1ee$var$Config","_config","clearCache","_scopeCache","clear","_resolverCache","datasetType","additionalOptionScopes","_cachedScopes","mainScope","resetCache","keyLists","chartOptionScopes","subPrefixes","$77dc20320068f1ee$var$getResolver","$77dc20320068f1ee$var$needContext","$77dc20320068f1ee$var$hasFunction","subResolver","resolverCache","$77dc20320068f1ee$var$KNOWN_POSITIONS","$77dc20320068f1ee$var$positionIsHorizontal","$77dc20320068f1ee$var$compare2Level","l1","l2","$77dc20320068f1ee$var$onAnimationsComplete","onComplete","$77dc20320068f1ee$var$onAnimationProgress","onProgress","$77dc20320068f1ee$var$getCanvas","getElementById","$77dc20320068f1ee$var$instances","$77dc20320068f1ee$var$getChart","$77dc20320068f1ee$var$getSizeForArea","field","$77dc20320068f1ee$export$acaa6426d77a227e","$77dc20320068f1ee$var$invalidatePlugins","_aspectRatio","_options","_initialize","bindEvents","_resizeBeforeDraw","_resize","newSize","newRatio","onResize","attached","_doResize","render","ensureScalesHaveIDs","scalesOptions","axisOptions","buildOrUpdateScales","scaleOpts","updated","isRadial","dposition","dtype","scaleType","scaleClass","hasUpdated","_updateMetasets","_metasets","_destroyDatasetMeta","_sortedMetasets","_removeUnreferencedMetasets","buildOrUpdateControllers","newControllers","order","ControllerClass","_resetElements","animsDisabled","_updateScales","_checkEventBindings","_updateHiddenIndices","_plugins","_minPadding","_updateLayout","_updateDatasets","_lastEvent","_eventHandler","_updateHoverStyles","existingEvents","_listeners","newEvents","_responsiveListeners","unbindEvents","_hiddenIndices","changes","_getUniformDataChanges","$77dc20320068f1ee$var$moveNumericKeys","intKey","datasetCount","makeSet","changeSet","noArea","_idx","_updateDataset","layers","_drawDatasets","_drawDataset","useClip","$77dc20320068f1ee$var$getDatasetArea","getElementsAtEventForMode","setDatasetVisibility","_updateVisibility","_stop","destroy","toBase64Image","toDataURL","bindUserEvents","bindResponsiveEvents","_add","detached","_remove","updateHoverStyle","getActiveElements","setActiveElements","activeElements","lastActive","pluginId","replay","hoverOptions","deactivated","activated","inChartArea","eventFilter","_handleEvent","lastEvent","_getActiveElements","isClick","userConfig","initialCanvas","existingChart","OffscreenCanvas","resizeDelay","instances","$77dc20320068f1ee$var$rThetaToXY","theta","$77dc20320068f1ee$var$pathArc","pixelMargin","innerR","spacingOffset","noSpacingOuterRadius","avNogSpacingRadius","noSpacingInnerRadius","beta","angleOffset","outerStart","outerEnd","innerStart","innerEnd","$77dc20320068f1ee$var$parseBorderRadius$1","angleDelta","borderRadius","halfThickness","innerLimit","computeOuterLimit","outerArcLimit","outerStartAdjustedRadius","outerEndAdjustedRadius","outerStartAdjustedAngle","outerEndAdjustedAngle","innerStartAdjustedRadius","innerEndAdjustedRadius","innerStartAdjustedAngle","innerEndAdjustedAngle","outerMidAdjustedAngle","pCenter","p4","innerMidAdjustedAngle","p8","outerStartX","outerStartY","outerEndX","outerEndY","$77dc20320068f1ee$export$d48203c759d6a1fc","chartX","chartY","rAdjust","betweenAngles","withinRadius","halfAngle","halfRadius","fullCircles","fix","radiusOffset","$77dc20320068f1ee$var$drawArc","$77dc20320068f1ee$var$drawBorder","inner","lineJoin","$77dc20320068f1ee$var$clipArc","angleMargin","$77dc20320068f1ee$var$setStyle","lineCap","$77dc20320068f1ee$var$lineTo","$77dc20320068f1ee$var$pathVars","paramsStart","paramsEnd","segmentStart","segmentEnd","$77dc20320068f1ee$var$pathSegment","lineMethod","stepped","tension","cubicInterpolationMode","$77dc20320068f1ee$var$fastPathSegment","prevX","lastY","avgX","countX","pointIndex","drawX","truncX","$77dc20320068f1ee$var$_getSegmentMethod","useFastPath","$77dc20320068f1ee$var$usePath2D","Path2D","$77dc20320068f1ee$export$55e463fa7bcd3469","_pointsUpdated","controlPoints","$02b6f511cc6c123c$export$527e9aa3390079e9","pointBefore","pointCurrent","valueAxis","pointsLen","deltaK","mK","pointAfter","slopeDelta","$02b6f511cc6c123c$var$monotoneAdjust","alphaK","betaK","tauK","squaredMagnitude","$02b6f511cc6c123c$var$monotoneCompute","$02b6f511cc6c123c$export$e171bab687b50e0","middlePoint","afterPoint","d01","d12","s01","s12","fa","fb","capBezierPoints","$02b6f511cc6c123c$var$capBezierPoints","inArea","inAreaPrev","inAreaNext","_points","_segments","_path","$02b6f511cc6c123c$var$findStartAndEnd","completeLoop","$02b6f511cc6c123c$var$solidSegments","_interpolate","interpolated","pathSegment","segmentMethod","path","$77dc20320068f1ee$var$draw","$77dc20320068f1ee$var$strokePathWithCache","$77dc20320068f1ee$var$strokePathDirect","$77dc20320068f1ee$var$inRange$1","hitRadius","$77dc20320068f1ee$export$bd159b522b230b7a","mouseX","mouseY","inXRange","inYRange","hoverRadius","$77dc20320068f1ee$var$getBarBounds","bar","half","$77dc20320068f1ee$var$skipOrLimit","$77dc20320068f1ee$var$inRange","skipX","skipY","$77dc20320068f1ee$var$addNormalRectPath","$77dc20320068f1ee$var$inflateRect","amount","refRect","$77dc20320068f1ee$export$a16ed71bf4b07672","outer","$77dc20320068f1ee$var$boundingRects","$77dc20320068f1ee$var$parseBorderWidth","maxW","maxH","$77dc20320068f1ee$var$parseBorderRadius","maxR","enableBorder","addRectPath","$77dc20320068f1ee$var$hasRadius","$77dc20320068f1ee$export$7a5d735b2ab6389d","ArcElement","BarElement","LineElement","PointElement","$77dc20320068f1ee$var$BORDER_COLORS","$77dc20320068f1ee$var$BACKGROUND_COLORS","$77dc20320068f1ee$var$getBorderColor","$77dc20320068f1ee$var$getBackgroundColor","$77dc20320068f1ee$var$containsColorsDefinitions","$77dc20320068f1ee$var$cleanDecimatedDataset","$77dc20320068f1ee$var$cleanDecimatedData","$77dc20320068f1ee$var$_getBounds","$77dc20320068f1ee$var$_findSegmentEnd","$77dc20320068f1ee$var$_getEdge","$77dc20320068f1ee$var$_createBoundaryLine","boundary","$77dc20320068f1ee$var$_pointsFromSegments","linePoints","$77dc20320068f1ee$var$_shouldApplyFill","$77dc20320068f1ee$var$simpleArc","$77dc20320068f1ee$var$_drawfill","$77dc20320068f1ee$var$_getTarget","$77dc20320068f1ee$var$getLineByIndex","$77dc20320068f1ee$var$_buildStackLine","sourcePoints","linesBelow","$77dc20320068f1ee$var$getLinesBelow","below","unshift","$77dc20320068f1ee$var$addPointsBelow","sourcePoint","postponed","$77dc20320068f1ee$var$findPoint","pointValue","firstValue","lastValue","$77dc20320068f1ee$var$computeBoundary","$77dc20320068f1ee$var$computeCircularBoundary","$77dc20320068f1ee$var$computeLinearBoundary","lineOpts","fillOption","above","$77dc20320068f1ee$var$doFill","$77dc20320068f1ee$var$clipVertical","$77dc20320068f1ee$var$fill","clipY","lineLoop","$77dc20320068f1ee$var$_segments","tpoints","targetSegments","tgt","subBounds","fillSources","fillSource","src","notShape","$77dc20320068f1ee$var$clipBounds","$77dc20320068f1ee$var$interpolatedLineTo","targetLoop","interpolatedPoint","$77dc20320068f1ee$var$getBoxSize","labelOpts","boxHeight","boxWidth","usePointStyle","pointStyleWidth","itemHeight","$77dc20320068f1ee$var$itemsEqual","$77dc20320068f1ee$var$Legend","buildLabels","legendItems","labelFont","_computeTitleHeight","_fitRows","_fitCols","hitboxes","legendHitBoxes","lineWidths","totalHeight","row","_itemHeight","columnSizes","heightLimit","totalWidth","currentColWidth","currentColHeight","col","$77dc20320068f1ee$var$calculateItemSize","fontLineHeight","legendItemText","$77dc20320068f1ee$var$calculateLegendItemHeight","adjustHitBoxes","rtlHelper","hitbox","_draw","cursor","defaultColor","halfFontSize","drawLegendBox","lineDash","drawOptions","SQRT2","yBoxTop","xBoxLeft","textDirection","realX","titleFont","titlePadding","topPaddingPlusHalfFontSize","_getLegendItemAt","hitBox","lh","handleEvent","onLeave","hoveredItem","_hoveredItem","sameItem","_added","doughnutMode","$77dc20320068f1ee$var$Title","_padding","textSize","_drawArgs","fontOpts","$77dc20320068f1ee$var$map","$77dc20320068f1ee$var$positioners","average","eventPosition","nearestElement","tp","$77dc20320068f1ee$var$pushOrConcat","toPush","$77dc20320068f1ee$var$splitNewlines","$77dc20320068f1ee$var$getTooltipSize","tooltip","body","footer","bodyFont","footerFont","titleLineCount","footerLineCount","bodyLineItemCount","combinedBodyLength","bodyItem","before","after","beforeBody","afterBody","titleSpacing","titleMarginBottom","bodyLineHeight","displayColors","bodySpacing","footerMarginTop","footerSpacing","widthPadding","maxLineWidth","$77dc20320068f1ee$var$determineAlignment","yAlign","$77dc20320068f1ee$var$determineYAlign","xAlign","$77dc20320068f1ee$var$determineXAlign","chartWidth","$77dc20320068f1ee$var$doesNotFitWithAlign","caret","caretSize","caretPadding","$77dc20320068f1ee$var$getBackgroundPoint","alignment","paddingAndSize","$77dc20320068f1ee$var$alignX","$77dc20320068f1ee$var$alignY","$77dc20320068f1ee$var$getAlignedX","$77dc20320068f1ee$var$overrideCallbacks","$77dc20320068f1ee$var$defaultCallbacks","beforeTitle","tooltipItems","labelCount","afterTitle","beforeLabel","tooltipItem","formattedValue","labelColor","labelTextColor","bodyColor","labelPointStyle","afterLabel","beforeFooter","afterFooter","$77dc20320068f1ee$var$invokeCallbackWithFallback","$77dc20320068f1ee$var$Tooltip","_cachedAnimations","_tooltipItems","getTitle","getBeforeBody","getBody","bodyItems","scoped","getAfterBody","getFooter","_createItems","labelColors","labelPointStyles","labelTextColors","$77dc20320068f1ee$var$createTooltipItem","itemSort","dataPoints","_eventPosition","_size","positionAndSize","backgroundPoint","opacity","caretX","caretY","external","drawCaret","tooltipPoint","caretPosition","getCaretPosition","x3","y3","ptX","ptY","titleAlign","titleColor","_drawColorBox","colorX","rtlColorX","yOffSet","colorY","multiKeyBackground","outerX","innerX","strokeRect","drawBody","textColor","bodyAlign","xLinePadding","fillLineOfText","bodyAlignForCalculation","drawFooter","footerAlign","footerColor","tooltipSize","quadraticCurveTo","_updateAnimationTarget","animX","animY","_willRender","hasTooltipContent","globalAlpha","positionChanged","_positionChanged","_ignoreReplayEvents","$77dc20320068f1ee$export$8b3ca321c77fdea6","Colors","forceOverride","_args","chartOptions","colorizer","Decimation","algorithm","beforeElementsUpdate","decimated","xAxis","$77dc20320068f1ee$var$getStartAndCountOfVisiblePointsSimplified","threshold","$77dc20320068f1ee$var$lttbDecimation","maxAreaPoint","maxArea","nextA","samples","bucketWidth","sampledIndex","endIndex","avgY","avgRangeStart","avgRangeEnd","avgRangeLength","rangeOffs","rangeTo","pointAx","pointAy","$77dc20320068f1ee$var$minMaxDecimation","minIndex","maxIndex","startIndex","xMin","xMax","dx","lastIndex","intermediateIndex1","intermediateIndex2","Filler","afterDatasetsUpdate","$77dc20320068f1ee$var$_decodeFill","firstCh","$77dc20320068f1ee$var$parseFillOption","$filler","$77dc20320068f1ee$var$_resolveTarget","propagate","visited","beforeDraw","drawTime","beforeDatasetsDraw","beforeDatasetDraw","Legend","_element","afterEvent","ci","useBorderRadius","SubTitle","Title","$77dc20320068f1ee$var$createTitle","titleBlock","Tooltip","positioners","afterInit","afterDraw","$77dc20320068f1ee$var$addIfString","addedLabels","$77dc20320068f1ee$var$validIndex","$77dc20320068f1ee$var$_getLabelForValue","$77dc20320068f1ee$export$29e663ba4d09fe7","added","_addedLabels","$77dc20320068f1ee$var$findOrAddLabel","lastIndexOf","_valueRange","_startValue","$77dc20320068f1ee$var$relativeLabelSize","minSpacing","$77dc20320068f1ee$var$LinearScaleBase","handleTickRangeOptions","setMin","setMax","minSign","maxSign","getTickLimit","maxTicks","stepSize","computeTickLimit","numericGeneratorOptions","precision","maxDigits","includeBounds","dataRange","$77dc20320068f1ee$var$generateTicks$1","generationOptions","niceMin","niceMax","numSpaces","unit","maxSpaces","rmin","rmax","countDefined","rounded","decimalPlaces","_endValue","$77dc20320068f1ee$export$e7f4e5e8656f0b93","$77dc20320068f1ee$var$log10Floor","$77dc20320068f1ee$var$changeExponent","$77dc20320068f1ee$var$isMajor","tickVal","$77dc20320068f1ee$var$steps","rangeExp","rangeStep","$77dc20320068f1ee$export$85295eaf7cb3ac3e","_zero","$77dc20320068f1ee$var$generateTicks","minExp","exp","$77dc20320068f1ee$var$startExp","lastTick","$77dc20320068f1ee$var$getTickBackdropHeight","$77dc20320068f1ee$var$determineLimits","$77dc20320068f1ee$var$pathRadiusLine","getPointPosition","$77dc20320068f1ee$export$cfafc36d95386d38","drawingArea","_pointLabels","$77dc20320068f1ee$var$fitWithPointLabels","limits","valueCount","pointLabelOpts","additionalAngle","centerPointLabels","getPointLabelContext","plFont","arrayOfThings","nestedThing","garbageCollect","hLimits","vLimits","$77dc20320068f1ee$var$updateLimits","setCenterPoint","_pointLabelItems","$77dc20320068f1ee$var$buildPointLabelItems","itemOpts","extra","$77dc20320068f1ee$var$createPointLabelItem","outerDistance","pointLabelPosition","$77dc20320068f1ee$var$isNotOverlapped","apexesInArea","leftMovement","rightMovement","topMovement","bottomMovement","angleMultiplier","scalingFactor","getValueForDistanceFromCenter","scaledDistance","pointLabel","distanceFromCenter","getBasePosition","getPointLabelPosition","$77dc20320068f1ee$var$drawPointLabels","$77dc20320068f1ee$var$drawPointLabelBox","backdropLeft","backdropTop","backdropWidth","backdropHeight","$77dc20320068f1ee$var$drawRadiusLine","gridLineOpts","animate","$77dc20320068f1ee$var$INTERVALS","millisecond","common","steps","second","minute","hour","day","week","month","quarter","year","$77dc20320068f1ee$var$UNITS","$77dc20320068f1ee$var$sorter","$77dc20320068f1ee$var$parse","adapter","_adapter","parser","isoWeekday","_parseOpts","$77dc20320068f1ee$var$determineUnitForAutoTicks","minUnit","capacity","interval","MAX_SAFE_INTEGER","$77dc20320068f1ee$var$addTick","timestamps","timestamp","$77dc20320068f1ee$var$ticksFromTimestamps","majorUnit","$77dc20320068f1ee$var$setMajorTicks","$77dc20320068f1ee$export$a894c72689ff3ec","adapters","displayFormats","_normalized","normalized","_applyBounds","_getLabelBounds","getLabelTimestamps","timeOpts","_generate","_unit","_getLabelCapacity","$77dc20320068f1ee$var$determineUnitForFormatting","_majorUnit","$77dc20320068f1ee$var$determineMajorUnit","initOffsets","offsetAfterAutoskip","getDecimalForValue","_offsets","weekday","hasWeekday","getDataTimestamps","tooltipFormat","datetime","fmt","_tickFormatFunction","minorFormat","majorFormat","offsets","_getLabelSize","ticksOpts","tickLabelWidth","cosRotation","sinRotation","tickFontSize","exampleTime","exampleLabel","$77dc20320068f1ee$var$interpolate","prevSource","nextSource","prevTarget","nextTarget","span","$77dc20320068f1ee$export$85df64a8eb6dc986","_getTimestampsForTable","_table","buildLookupTable","_minPos","_tableRange","$77dc20320068f1ee$export$bcac1c16f1530ec2","CategoryScale","LinearScale","LogarithmicScale","RadialLinearScale","TimeScale","TimeSeriesScale","$3bc6321cdb0e9401$var$ownKeys","enumerableOnly","symbols","$3bc6321cdb0e9401$var$_objectSpread2","$3bc6321cdb0e9401$var$_typeof","$3bc6321cdb0e9401$var$_extends","$3bc6321cdb0e9401$var$userAgent","pattern","navigator","userAgent","$3bc6321cdb0e9401$var$IE11OrLess","$3bc6321cdb0e9401$var$Edge","$3bc6321cdb0e9401$var$FireFox","$3bc6321cdb0e9401$var$Safari","$3bc6321cdb0e9401$var$IOS","$3bc6321cdb0e9401$var$ChromeForAndroid","$3bc6321cdb0e9401$var$captureMode","capture","$3bc6321cdb0e9401$var$on","$3bc6321cdb0e9401$var$off","$3bc6321cdb0e9401$var$matches","selector","msMatchesSelector","webkitMatchesSelector","$3bc6321cdb0e9401$var$closest","includeCTX","nodeType","$3bc6321cdb0e9401$var$R_SPACE","$3bc6321cdb0e9401$var$toggleClass","state","classList","className","$3bc6321cdb0e9401$var$css","currentStyle","$3bc6321cdb0e9401$var$matrix","selfOnly","appliedTransforms","transform","matrixFn","DOMMatrix","WebKitCSSMatrix","CSSMatrix","MSCSSMatrix","$3bc6321cdb0e9401$var$find","tagName","getElementsByTagName","$3bc6321cdb0e9401$var$getWindowScrollingElement","scrollingElement","documentElement","$3bc6321cdb0e9401$var$getRect","relativeToContainingBlock","relativeToNonStaticParent","undoScale","elRect","innerHeight","innerWidth","containerRect","elMatrix","scaleX","scaleY","$3bc6321cdb0e9401$var$getContentRect","$3bc6321cdb0e9401$var$isScrolledPast","elSide","parentSide","$3bc6321cdb0e9401$var$getParentAutoScrollElement","elSideVal","parentSideVal","$3bc6321cdb0e9401$var$getChild","childNum","includeDragEl","currentChild","children","$3bc6321cdb0e9401$export$31b3ca70d8f57423","ghost","dragged","draggable","$3bc6321cdb0e9401$var$lastChild","lastElementChild","previousElementSibling","$3bc6321cdb0e9401$var$index","nodeName","$3bc6321cdb0e9401$var$getRelativeScrollOffset","offsetTop","winScroller","scrollLeft","scrollTop","includeSelf","elem","gotSelf","scrollWidth","scrollHeight","elemCSS","overflowX","overflowY","$3bc6321cdb0e9401$var$isRectEqual","rect1","rect2","$3bc6321cdb0e9401$var$throttle","ms","$3bc6321cdb0e9401$var$_throttleTimeout","$3bc6321cdb0e9401$var$scrollBy","$3bc6321cdb0e9401$var$clone","Polymer","$","jQuery","Zepto","dom","cloneNode","$3bc6321cdb0e9401$var$expando","$3bc6321cdb0e9401$var$plugins","$3bc6321cdb0e9401$var$defaults","initializeByDefault","$3bc6321cdb0e9401$var$PluginManager","mount","pluginName","pluginEvent","eventName","sortable","evt","eventCanceled","eventNameGlobal","initializePlugins","initialized","modified","modifyOption","getEventProperties","eventProperties","modifiedValue","optionListeners","$3bc6321cdb0e9401$var$_excluded","$3bc6321cdb0e9401$var$pluginEvent","_ref","originalEvent","$3bc6321cdb0e9401$var$_objectWithoutProperties","excluded","$3bc6321cdb0e9401$var$_objectWithoutPropertiesLoose","sourceKeys","sourceSymbolKeys","dragEl","$3bc6321cdb0e9401$var$dragEl","parentEl","$3bc6321cdb0e9401$var$parentEl","ghostEl","$3bc6321cdb0e9401$var$ghostEl","rootEl","$3bc6321cdb0e9401$var$rootEl","nextEl","$3bc6321cdb0e9401$var$nextEl","lastDownEl","$3bc6321cdb0e9401$var$lastDownEl","cloneEl","$3bc6321cdb0e9401$var$cloneEl","cloneHidden","$3bc6321cdb0e9401$var$cloneHidden","dragStarted","$3bc6321cdb0e9401$var$moved","putSortable","$3bc6321cdb0e9401$var$putSortable","activeSortable","oldIndex","$3bc6321cdb0e9401$var$oldIndex","oldDraggableIndex","$3bc6321cdb0e9401$var$oldDraggableIndex","newIndex","$3bc6321cdb0e9401$var$newIndex","newDraggableIndex","$3bc6321cdb0e9401$var$newDraggableIndex","hideGhostForTarget","$3bc6321cdb0e9401$var$_hideGhostForTarget","unhideGhostForTarget","$3bc6321cdb0e9401$var$_unhideGhostForTarget","cloneNowHidden","cloneNowShown","dispatchSortableEvent","$3bc6321cdb0e9401$var$_dispatchEvent","$3bc6321cdb0e9401$var$dispatchEvent","targetEl","toEl","fromEl","extraEventProperties","onName","CustomEvent","createEvent","initEvent","bubbles","pullMode","lastPutMode","allEventProperties","dispatchEvent","$3bc6321cdb0e9401$var$activeGroup","$3bc6321cdb0e9401$var$tapEvt","$3bc6321cdb0e9401$var$touchEvt","$3bc6321cdb0e9401$var$lastDx","$3bc6321cdb0e9401$var$lastDy","$3bc6321cdb0e9401$var$tapDistanceLeft","$3bc6321cdb0e9401$var$tapDistanceTop","$3bc6321cdb0e9401$var$lastTarget","$3bc6321cdb0e9401$var$lastDirection","$3bc6321cdb0e9401$var$targetMoveDistance","$3bc6321cdb0e9401$var$ghostRelativeParent","$3bc6321cdb0e9401$var$awaitingDragStarted","$3bc6321cdb0e9401$var$ignoreNextClick","$3bc6321cdb0e9401$var$sortables","$3bc6321cdb0e9401$var$pastFirstInvertThresh","$3bc6321cdb0e9401$var$isCircumstantialInvert","$3bc6321cdb0e9401$var$ghostRelativeParentInitialScroll","$3bc6321cdb0e9401$var$_silent","$3bc6321cdb0e9401$var$savedInputChecked","$3bc6321cdb0e9401$var$documentExists","$3bc6321cdb0e9401$var$CSSFloatProperty","$3bc6321cdb0e9401$var$supportDraggable","createElement","$3bc6321cdb0e9401$var$supportCssPointerEvents","cssText","pointerEvents","$3bc6321cdb0e9401$var$_detectDirection","elCSS","elWidth","borderLeftWidth","borderRightWidth","child1","child2","firstChildCSS","secondChildCSS","firstChildWidth","marginLeft","marginRight","secondChildWidth","flexDirection","gridTemplateColumns","touchingSideChild2","$3bc6321cdb0e9401$var$_dragElInRowColumn","dragRect","targetRect","dragElS1Opp","dragElS2Opp","dragElOppLength","targetS1Opp","targetS2Opp","targetOppLength","$3bc6321cdb0e9401$var$_detectNearestEmptySortable","emptyInsertThreshold","insideHorizontally","insideVertically","$3bc6321cdb0e9401$var$_prepareGroup","toFn","pull","sameGroup","group","otherGroup","originalGroup","checkPull","checkPut","put","revertClone","preventDefault","stopPropagation","stopImmediatePropagation","$3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent","_onDragOver","$3bc6321cdb0e9401$var$_checkOutsideTargetEl","_isOutsideThisEl","animationCallbackId","animationStates","store","handle","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","ghostClass","chosenClass","dragClass","ignore","preventOnFilter","setData","dataTransfer","textContent","dropBubble","dragoverBubble","dataIdAttr","delayOnTouchOnly","touchStartThreshold","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","nativeDraggable","_onTapStart","captureAnimationState","child","fromRect","thisAnimationDuration","childMatrix","addAnimationState","removeAnimationState","$3bc6321cdb0e9401$var$indexOfObject","animateAll","animating","animationTime","toRect","prevFromRect","prevToRect","animatingRect","targetMatrix","animationResetTimer","currentRect","translateX","translateY","animatingX","animatingY","forRepaintDummy","offsetWidth","$3bc6321cdb0e9401$var$_onMove","willInsertAfter","retVal","onMoveFn","onMove","draggedRect","related","relatedRect","$3bc6321cdb0e9401$var$_disableDraggable","$3bc6321cdb0e9401$var$_unsilent","$3bc6321cdb0e9401$var$_nextTick","$3bc6321cdb0e9401$var$_cancelNextTick","_getDirection","touch","pointerType","originalTarget","composedPath","$3bc6321cdb0e9401$var$_saveInputCheckedState","checked","button","isContentEditable","criteria","trim","_prepareDragStart","dragStartFn","nextSibling","_lastX","_lastY","_onDrop","_disableDelayedDragEvents","_triggerDragStart","_disableDelayedDrag","_delayedDragTouchMoveHandler","_dragStartTimer","_onTouchMove","_onDragStart","selection","empty","getSelection","removeAllRanges","_dragStarted","_appendGhost","_nulling","_emulateDragOver","elementFromPoint","inserted","ghostMatrix","relativeScrollOffset","$3bc6321cdb0e9401$var$PositionGhostAbsolutely","dy","cssMatrix","appendChild","_hideClone","cloneId","insertBefore","_loopId","setInterval","effectAllowed","_dragStartId","revert","isOwner","canSort","fromSortable","completedFired","dragOverEvent","_ignoreWhileAnimating","completed","elLastChild","$3bc6321cdb0e9401$var$_ghostIsLast","lastElRect","sortableContentRect","firstElRect","firstChild","sibling","targetBeforeFirstSwap","differentLevel","differentRowCol","side1","scrolledPastTop","scrollBefore","$3bc6321cdb0e9401$var$_getSwapDirection","isLastTarget","mouseOnAxis","targetLength","targetS1","targetS2","invert","dragIndex","nextElementSibling","moveVector","insertion","_showClone","_offMoveEvents","_offUpEvents","clearInterval","removeChild","dropEffect","toArray","$3bc6321cdb0e9401$var$_generateId","href","sum","useAnimation","closest","querySelectorAll","utils","css","find","extend","dst","throttle","toggleClass","cancelNextTick","detectDirection","getChild","$3bc6321cdb0e9401$var$scrollEl","$3bc6321cdb0e9401$var$scrollRootEl","$3bc6321cdb0e9401$var$lastAutoScrollX","$3bc6321cdb0e9401$var$lastAutoScrollY","$3bc6321cdb0e9401$var$touchEvt$1","$3bc6321cdb0e9401$var$pointerElemChangedInterval","$3bc6321cdb0e9401$var$autoScrolls","$3bc6321cdb0e9401$var$scrolling","$3bc6321cdb0e9401$var$clearAutoScrolls","autoScroll","$3bc6321cdb0e9401$var$clearPointerElemChangedInterval","$3bc6321cdb0e9401$var$autoScroll","isFallback","scroll","scrollCustomFn","sens","scrollSensitivity","speed","scrollSpeed","scrollThisInstance","scrollFn","layersOut","currentParent","canScrollX","canScrollY","scrollPosX","scrollPosY","vx","vy","layer","scrollOffsetY","scrollOffsetX","bubbleScroll","$3bc6321cdb0e9401$var$drop","toSortable","changedTouches","onSpill","$3bc6321cdb0e9401$var$Revert","$3bc6321cdb0e9401$var$Remove","$48e8ed6252738c92$export$1402cba6a733f33a","$6a8d624098efe915$export$926181dbdeb3ce30","derivatives","dydx","yTemp","h2","h6","xhh","dydxTemp","dydxM","$867aa247f14d8746$export$35d34bc0ed591a92","stocksAtT","getFlows","integrator","dragStart","_ref2","_ref3","drop","_ref4","parentSortable","AutoScroll","forceAutoScrollFallback","_handleAutoScroll","_handleFallbackAutoScroll","dragOverCompleted","dragOverBubble","nulling","ogElemScroller","newElem","$84b4e0427207f64e$export$a1edc412be3e1841","elementObjectToArray","ids","arrayToElementObject","stocksToStockArray","stocks","stockIds","stockArrayToStocks","stockArray","flowsToFlowArray","flows","flowIds","flowArrayToFlows","flowArray","variablesToVariableArray","variables","variableIds","variableArrayToVariables","variableArray","parametersToParameterArray","parameters","parameterIds","parameterArrayToParameters","parameterArray","evaluateFlowPerStock","evaluate","accumulateFlowsPerStock","createFlowEvaluator","stocksArray","flowsPerStock","flowPerStockArray","flowEvaluator","computeFlowsOrIntegrator","newStocksArray","$c7f17e22947729fa$var$step6","flowsAtT","computeFlows","mutableFlowsAtT","stocksIds","elementIds","$921d098521bb0b85$var$stockIds","$921d098521bb0b85$var$flowIds","$921d098521bb0b85$var$variableIds","$921d098521bb0b85$var$parameterIds","$921d098521bb0b85$var$CircularEconomyModel","capacityOfNewlyProducedPhones","capacityOfRecycledMaterials","capacityOfRefurbishedPhones","capacityOfRepairedPhones","phonesInUse","supplyOfBrokenPhones","supplyOfDisposedPhones","supplyOfHibernatingPhones","supplyOfNewlyProducedPhones","supplyOfRecycledMaterials","supplyOfRefurbishedPhones","supplyOfRepairedPhones","abandonExcessRate","abandonRate","acquireRate","breakRate","capacityAdjustmentRate","disposeIncentive","disposeRate","landfillIncentive","landfillRate","naturalResourcesIncentive","newPhoneProductionRate","newlyProducedPhoneIncentive","numberOfUsers","phonesPerUserGoal","recycleRate","recyclingIncentive","refurbishmentIncentive","refurbishmentRate","repairIncentive","repairRate","reuseIncentive","phoneGoal","phonesInUseExcess","abandon","inflowIncentiveSumForPhonesInUse","goBroken","demandForPhones","demandForNewlyProducedPhones","acquireNewlyProduced","demandForRefurbishedPhones","acquireRefurbished","demandForRepairedPhones","acquireRepaired","supplyOfHibernatingPhonesForReuse","demandForReusedPhones","demandForResources","demandForRecycledMaterials","supplyOfBrokenPhonesForDisposal","supplyOfHibernatingPhonesForDisposal","supplyOfDisposedPhonesForLandfilling","demandForNaturalResources","produceFromRecycledMaterials","supplyOfDisposedPhonesForRecycling","demandForRecycling","supplyOfHibernatingPhonesForRefurbishment","demandForRefurbishment","demandForRepair","supplyOfBrokenPhonesForRepair","acquireUsed","capacityOfNewlyProducedPhonesAdjustment","capacityOfRecycledMaterialsAdjustment","capacityOfRefurbishedPhonesAdjustment","disposeBroken","disposeHibernating","landfill","produceFromNaturalResources","recycle","refurbish","repair","repairShopCapcityAdjustment","initialStocks","defaultParameters","$106ba4e13cc3399a$export$2e2bcd8739ae039","evaluateFlowPerStockWithCache","flowPerStockCache","record","newStocks","model","flowEvaluatorWithCache","newRecord","$1e97a6829bac4722$exports","$4f1a1606e7098a1b$exports","iteratee","accumulator","initAccum","$36afe5eae89b9d7e$exports","$b1b879fc8198071f$exports","$f2e9e481daee7666$exports","$76c6dc58ca6da032$exports","$1879420c2201e4f5$exports","$16a1c88c6274b89e$exports","$99453366d0047353$exports","$967238627eb0c90e$var$freeSelf","$967238627eb0c90e$exports","$eee618309e39ba8f$exports","$ac048cd2ac6bb018$exports","$558e04b299841d71$exports","$49a2e995e5c6b149$exports","$4a7cc576fba0dac1$exports","$4a7cc576fba0dac1$var$objectProto","$4a7cc576fba0dac1$var$hasOwnProperty","$4a7cc576fba0dac1$var$nativeObjectToString","$4a7cc576fba0dac1$var$symToStringTag","unmasked","$04062fd85b2020b2$exports","$04062fd85b2020b2$var$nativeObjectToString","$04062fd85b2020b2$var$objectProto","$49a2e995e5c6b149$var$symToStringTag","$ba1663caad3bd751$exports","$1879420c2201e4f5$var$INFINITY","$1879420c2201e4f5$var$symbolProto","$1879420c2201e4f5$var$symbolToString","$1879420c2201e4f5$var$baseToString","$36afe5eae89b9d7e$var$reLatin","$36afe5eae89b9d7e$var$reComboMark","$ab91531510e64339$exports","$3b3532336f4ee99d$exports","$3b3532336f4ee99d$var$reAsciiWord","$a612d359136754bd$exports","$a612d359136754bd$var$reHasUnicodeWord","$cdffef05f24fe61a$exports","$cdffef05f24fe61a$var$rsAstralRange","$cdffef05f24fe61a$var$rsDingbatRange","$cdffef05f24fe61a$var$rsLowerRange","$cdffef05f24fe61a$var$rsUpperRange","$cdffef05f24fe61a$var$rsBreakRange","$cdffef05f24fe61a$var$rsMathOpRange","$cdffef05f24fe61a$var$rsApos","$cdffef05f24fe61a$var$rsBreak","$cdffef05f24fe61a$var$rsLower","$cdffef05f24fe61a$var$rsMisc","$cdffef05f24fe61a$var$rsRegional","$cdffef05f24fe61a$var$rsSurrPair","$cdffef05f24fe61a$var$rsUpper","$cdffef05f24fe61a$var$rsMiscLower","$cdffef05f24fe61a$var$rsOptContrLower","$cdffef05f24fe61a$var$rsOptContrUpper","$cdffef05f24fe61a$var$reOptMod","$cdffef05f24fe61a$var$rsModifier","$cdffef05f24fe61a$var$rsOptVar","$cdffef05f24fe61a$var$rsOptJoin","$cdffef05f24fe61a$var$rsEmoji","$cdffef05f24fe61a$var$reUnicodeWord","$cdffef05f24fe61a$var$rsMiscUpper","guard","$3213226c6f6709d1$var$reApos","$9209478113a893f2$export$b6a2e78b63791dfa","uri","clearStyles","_svgDoc_querySelectorAll","response","fetch","status","statusText","URL","svgText","div","innerHTML","svgDoc","querySelector","$7b1f0afa5e19a5a4$export$99496351b147462","word","$dac2d623b8646eea$exports","getBundleURL","$f48791a249d3586b$var$svgUrl","$f48791a249d3586b$var$mainFlowIds","$f48791a249d3586b$var$flowVizSigns","$f48791a249d3586b$var$dotWithoutLineSegmentArea","$f48791a249d3586b$var$dotRadius","$f48791a249d3586b$var$averageFlowVizWidth","$f48791a249d3586b$var$lineSegmentArea","$f48791a249d3586b$var$lineWidth","$f48791a249d3586b$export$2e2bcd8739ae039","updateSvgFlows","deltaMs","flowVizScale","$f48791a249d3586b$var$quantityScaleFactor","_element_getAttribute","flow","flowVizSign","elementId","svg","SVGPathElement","lastDashOffset","updateSvgStocks","stockVizScale","SVGCircleElement","stock","updateSvg","prepareSvg","createSVGElement","createElementNS","elementsToRemove","labelLayer","supplyLayer","capacityLayer","flowLayer","append","baseElement","baseElementId","SVGGeometryElement","phonesInUseClone","$e412526fc10a648a$export$3e2b244719956741","readyState","$30abf6595c867a38$export$2e2bcd8739ae039","i18nKey","$4af93babe4ef46c3$export$2e2bcd8739ae039","applyTo","callable","$5023ecf4320e7a5e$export$2e2bcd8739ae039","createFunction","script","parameterId","wrappedScript","transformedParameters","$0bf1d6c4c7fae0ba$var$initialParameters","$0bf1d6c4c7fae0ba$var$init","modelSimulator","availableParameterTransformsContainer","HTMLElement","activeParameterTransformsContainer","availableParameterTransforms","updateParameters","parameterTransform","backupParameters","distinctParameters","getDistinctParameters","removeOnSpill","onSort","parameterTransforms","dummyElement","parameterTransformElement","idElement","HTMLInputElement","scriptElement","HTMLTextAreaElement","sliderContainer","sliderElementLabel","sliderElement","updateSliderValue","innerText","sliderWrapperElement","circularityIndex","circularityIndexElement","userSatisfaction","userSatisfactionElement","visualization","toChartRecord","prepend","initialChartRecord","chartCanvas","stepSimulation","updateIndices","circularityIndexTarget","toFixed","userSatisfactionTarget","chartRecord","runCheckBox","loopSimulation","lastTimeMs","currentTimeMs","circularEconomy","Animator","requestAnimFrame","interpolators","helpersColor","Animation","effects","Animations","resolveTargetOptions","awaitAll","animator","scaleClip","defaultClip","toClip","getSortedDatasetIndices","convertObjectDataToArray","isStacked","getStackKey","getOrCreateStack","getLastIndexInStack","updateStacks","getFirstScaleId","createDatasetContext","createContext","createDataContext","clearStacks","isDirectUpdateMode","cloneIfNotShared","createStack","DatasetController","valueOrDefault","unlistenArrayEvents","listenArrayEvents","resolveObjectKey","defined","getAllScaleValues","_arrayUnique","computeMinSampleSize","computeFitCategoryTraits","isNullOrUndef","computeFlexCategoryTraits","parseFloatBar","parseValue","parseArrayOrPrimitive","isFloatBar","barSign","borderProps","setBorderSkipped","parseEdge","swap","startEnd","v2","setInflateAmount","getRatioAndOffset","TAU","_angleBetween","HALF_PI","toRadians","toPercentage","maxRadius","toDimension","formatNumber","_getStartAndCountOfVisiblePoints","_scaleRangesChanged","_parseObjectDataRadialScale","abstract","DateAdapterBase","binarySearch","_rlookupByKey","_lookupByKey","evaluateInteractionItems","getDistanceMetricForAxis","getIntersectItems","evaluationFunc","_isPointInArea","getNearestRadialItems","getAngleFromPoint","getNearestCartesianItems","getNearestItems","getAxisItems","getRelativePosition","STATIC_POSITIONS","filterByPosition","filterDynamicPositionByAxis","sortByWeight","wrapBoxes","buildStacks","setLayoutDims","buildLayoutBoxes","getCombinedMax","updateMaxPadding","updateDims","handleMaxPadding","getMargins","marginForPositions","fitBoxes","setBoxDims","placeBoxes","toPadding","each","BasePlatform","BasicPlatform","EXPANDO_KEY","EVENT_TYPES","isNullOrEmpty","initCanvas","readUsedSize","eventListenerOptions","supportsEventListenerOptions","fromNativeEvent","nodeListContains","createAttachObserver","createDetachObserver","drpListeningCharts","oldDevicePixelRatio","onWindowResize","listenDevicePixelRatioChanges","unlistenDevicePixelRatioChanges","createResizeObserver","_getParentNode","throttled","releaseObserver","createProxyAndListen","DomPlatform","_detectPlatform","_isDomSupported","Element","determineMaxTicks","getMajorIndices","skipMajors","calculateSpacing","getEvenSpacing","_factorize","reverseAlign","offsetFromEdge","getTicksLimit","sample","getPixelForGridLine","getTickMarkLength","getTitleHeight","toFont","createScaleContext","createTickContext","_toLeftRightCenter","titleArgs","_alignStartEnd","Scale","finiteOrDefault","_addGrace","_limitValue","toDegrees","_measureText","_int16Range","_alignPixel","clipArea","renderText","unclipArea","TypedRegistry","isIChartComponent","registerDefaults","merge","routeDefaults","Registry","_capitalize","PluginService","callCallback","allPlugins","createDescriptors","getOpts","pluginOpts","getIndexAxis","getAxisFromDefaultScaleID","getDefaultScaleIDFromAxis","idMatchesAxis","axisFromPosition","determineAxis","getAxisFromDataset","retrieveAxisFromDatasets","mergeScaleConfig","mergeIf","initOptions","initData","initConfig","keyCache","keysCached","cachedKeys","addIfFound","Config","getResolver","needContext","_attachContext","_createResolver","hasFunction","KNOWN_POSITIONS","positionIsHorizontal","compare2Level","onAnimationsComplete","onAnimationProgress","getCanvas","getChart","moveNumericKeys","determineLastEvent","getSizeForArea","getDatasetArea","Chart","invalidatePlugins","uid","debounce","retinaScale","clearCanvas","setsEqual","Interaction","_elementsEqual","_isClickEvent","clipArc","toRadiusCorners","_readValueToProps","parseBorderRadius","rThetaToXY","pathArc","adjustedAngle","drawArc","_isBetween","setStyle","getLineMethod","_steppedLineTo","_bezierCurveTo","pathVars","outside","fastPathSegment","_getSegmentMethod","_getInterpolationMethod","_steppedInterpolation","_bezierInterpolation","_pointInLine","strokePathWithCache","strokePathDirect","usePath2D","_updateBezierControlPoints","_computeSegments","_boundSegments","drawPoint","getBarBounds","skipOrLimit","parseBorderWidth","toTRBL","toTRBLCorners","boundingRects","skipBoth","hasRadius","addNormalRectPath","inflateRect","addRoundedRectPath","BORDER_COLORS","BACKGROUND_COLORS","getBorderColor","getBackgroundColor","colorizeDefaultDataset","colorizeDoughnutDataset","colorizePolarAreaDataset","getColorizer","containsColorsDefinitions","containsColorsDefinition","lttbDecimation","minMaxDecimation","cleanDecimatedDataset","cleanDecimatedData","getStartAndCountOfVisiblePointsSimplified","_findSegmentEnd","_getBounds","_boundSegment","_getEdge","_normalizeAngle","_pointsFromSegments","_createBoundaryLine","_shouldApplyFill","_resolveTarget","_decodeFill","parseFillOption","decodeTargetIndex","_getTargetPixel","_getTargetValue","_buildStackLine","getLinesBelow","addPointsBelow","findPoint","simpleArc","getLineByIndex","computeBoundary","computeCircularBoundary","computeLinearBoundary","_drawfill","doFill","clipVertical","clipBounds","interpolatedLineTo","getBoxSize","itemsEqual","calculateItemSize","getRtlAdapter","drawPointLegend","overrideTextDirection","_textX","calculateLegendItemHeight","restoreTextDirection","isListened","calculateItemWidth","calculateItemHeight","createTitle","distanceBetweenPoints","pushOrConcat","splitNewlines","createTooltipItem","getTooltipSize","determineYAlign","doesNotFitWithAlign","determineXAlign","determineAlignment","alignX","alignY","getBackgroundPoint","getAlignedX","getBeforeAfterBodyLines","createTooltipContext","overrideCallbacks","defaultCallbacks","noop","invokeCallbackWithFallback","addIfString","findOrAddLabel","_getLabelForValue","generateTicks","MIN_SPACING","niceNum","almostWhole","almostEquals","_decimalPlaces","relativeLabelSize","LinearScaleBase","_setMinAndMaxByKey","Ticks","log10Floor","changeExponent","isMajor","startExp","getTickBackdropHeight","measureLabelSize","_longestText","determineLimits","fitWithPointLabels","updateLimits","buildPointLabelItems","createPointLabelItem","yForAngle","getTextAlignForAngle","leftForTextAlign","isNotOverlapped","drawPointLabelBox","drawPointLabels","pathRadiusLine","drawRadiusLine","createPointLabelContext","INTERVALS","UNITS","sorter","determineUnitForAutoTicks","determineUnitForFormatting","determineMajorUnit","addTick","_lookup","setMajorTicks","ticksFromTimestamps","_filterBetween","registerables","isNumberFinite","isValidKey","_merger","_mergerIf","_deprecated","keyResolvers","_splitKey","_getKeyResolver","PITAU","INFINITY","RAD_PER_DEG","QUARTER_PI","TWO_THIRDS_PI","isFiniteNumber","radialDistanceFromCenter","_angleDiff","arrayEvents","pixelSize","fontStyle","fontFamily","check","atEdge","elasticIn","elasticOut","isPatternOrGradient","Color","getHoverColor","applyAnimationsDefaults","applyLayoutsDefaults","intlCache","getNumberFormat","calculateDelta","applyScaleDefaults","getScope","Defaults","toFontString","setRenderOpts","decorateText","drawBackdrop","LINE_HEIGHT","FONT_STYLE","toLineHeight","numberOrZero","_resolve","_cached","_resolveWithPrefixes","getKeysFromAllScopes","_resolveWithContext","readKey","needsSubResolver","_resolveScriptable","_resolveArray","createSubResolver","resolveFallback","addScopes","addScopesFromKey","subGetTarget","resolveKeysFromAllScopes","getPoint","getValueAxis","splineCurve","monotoneAdjust","monotoneCompute","splineCurveMonotone","capControlPoint","parseMaxStyle","getPositionedStyle","useOffsetPos","getCanvasPosition","getContainerSize","round1","getRightToLeftAdapter","getLeftToRightAdapter","propertyFn","normalizeSegment","getSegment","findStartAndEnd","solidSegments","splitByStyles","doSplitByStyles","readStyle","styleChanged"],"version":3,"file":"index.20493566.js.map"} \ No newline at end of file diff --git a/assets/index.7e1ba3ae.js b/assets/index.97bcdae1.js similarity index 56% rename from assets/index.7e1ba3ae.js rename to assets/index.97bcdae1.js index ba506aa..ac39616 100644 --- a/assets/index.7e1ba3ae.js +++ b/assets/index.97bcdae1.js @@ -1,4 +1,4 @@ -let t,e;var i,r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function n(t){return t&&t.__esModule?t.default:t}var o={},a={},s=r.parcelRequirec7f3;null==s&&((s=function(t){if(t in o)return o[t].exports;if(t in a){var e=a[t];delete a[t];var i={id:t,exports:{}};return o[t]=i,e.call(i.exports,i,i.exports),i.exports}var r=Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(t,e){a[t]=e},r.parcelRequirec7f3=s);var l=s.register;l("GE7rZ",function(t,e){// Currently in sync with Node.js lib/assert.js +let t,e;var i,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function r(t){return t&&t.__esModule?t.default:t}var o={},a={},s=n.parcelRequirec7f3;null==s&&((s=function(t){if(t in o)return o[t].exports;if(t in a){var e=a[t];delete a[t];var i={id:t,exports:{}};return o[t]=i,e.call(i.exports,i,i.exports),i.exports}var n=Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(t,e){a[t]=e},n.parcelRequirec7f3=s);var l=s.register;l("GE7rZ",function(t,e){// Currently in sync with Node.js lib/assert.js // https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b // Originally from narwhal.js (http://narwhaljs.org) // Copyright (c) 2009 Thomas Robinson <280north.com> @@ -19,26 +19,26 @@ let t,e;var i,r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof se // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -var i,r,n,o,a,l=s("bYqme");function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t,e){for(var i=0;i1?i-1:0),n=1;n1?i-1:0),n=1;n1?i-1:0),n=1;n1?i-1:0),n=1;n1?i-1:0),r=1;r1?i-1:0),r=1;r1?i-1:0),r=1;r1?i-1:0),r=1;r1)for(var i=1;i2)?"one of ".concat(e," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",function(t,e,r){if((void 0===l&&(l=s("GE7rZ")),l("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(n="not ",e.substr(!o||o<0?0:+o,n.length)===n))?(u="must not be",e=e.replace(/^not /,"")):u="must be",a=" argument",(void 0===c||c>t.length)&&(c=t.length),t.substring(c-a.length,c)===a)f="The ".concat(t," ").concat(u," ").concat(d(e,"type"));else{var n,o,a,c,h,u,f,p=("number"!=typeof h&&(h=0),h+1>t.length||-1===t.indexOf(".",h))?"argument":"property";f='The "'.concat(t,'" ').concat(p," ").concat(u," ").concat(d(e,"type"))}return(// TODO(BridgeAR): Improve the output by showing `null` and similar. -f+". Received type ".concat(i(r)))},TypeError),u("ERR_INVALID_ARG_VALUE",function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===c&&(c=s("5d0kT"));var r=c.inspect(e);return r.length>128&&(r="".concat(r.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(i,". Received ").concat(r)},TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",function(t,e,r){var n;return n=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(i(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(n,".")},TypeError),u("ERR_MISSING_ARGS",function(){for(var t=arguments.length,e=Array(t),i=0;i0,"At least one arg needs to be specified");var r="The ",n=e.length;switch(e=e.map(function(t){return'"'.concat(t,'"')}),n){case 1:r+="".concat(e[0]," argument");break;case 2:r+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:r+=e.slice(0,n-1).join(", ")+", and ".concat(e[n-1]," arguments")}return"".concat(r," must be specified")},TypeError),a=h}),l("5d0kT",function(t,e){// Copyright Joyent, Inc. and other Node contributors. +function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){for(var n=0;n2)?"one of ".concat(e," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",function(t,e,n){if((void 0===l&&(l=s("GE7rZ")),l("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(r="not ",e.substr(!o||o<0?0:+o,r.length)===r))?(u="must not be",e=e.replace(/^not /,"")):u="must be",a=" argument",(void 0===c||c>t.length)&&(c=t.length),t.substring(c-a.length,c)===a)f="The ".concat(t," ").concat(u," ").concat(d(e,"type"));else{var r,o,a,c,h,u,f,p=("number"!=typeof h&&(h=0),h+1>t.length||-1===t.indexOf(".",h))?"argument":"property";f='The "'.concat(t,'" ').concat(p," ").concat(u," ").concat(d(e,"type"))}return(// TODO(BridgeAR): Improve the output by showing `null` and similar. +f+". Received type ".concat(i(n)))},TypeError),u("ERR_INVALID_ARG_VALUE",function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===c&&(c=s("5d0kT"));var n=c.inspect(e);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(i,". Received ").concat(n)},TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",function(t,e,n){var r;return r=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(i(n)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(r,".")},TypeError),u("ERR_MISSING_ARGS",function(){for(var t=arguments.length,e=Array(t),i=0;i0,"At least one arg needs to be specified");var n="The ",r=e.length;switch(e=e.map(function(t){return'"'.concat(t,'"')}),r){case 1:n+="".concat(e[0]," argument");break;case 2:n+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:n+=e.slice(0,r-1).join(", ")+", and ".concat(e[r-1]," arguments")}return"".concat(n," must be specified")},TypeError),a=h}),l("5d0kT",function(t,e){// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the @@ -94,27 +94,27 @@ f+". Received type ".concat(i(r)))},TypeError),u("ERR_INVALID_ARG_VALUE",functio // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -var i=s("bYqme"),r=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),i={},r=0;r=o)return t;switch(t){case"%s":return String(r[i++]);case"%d":return Number(r[i++]);case"%j":try{return JSON.stringify(r[i++])}catch(t){return"[Circular]"}default:return t}}),s=r[i];i=o)return t;switch(t){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(t){return"[Circular]"}default:return t}}),s=n[i];i=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(i)?r.showHidden=i:i&&t.exports._extend(r,i),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=c),u(r,e,r.depth)}function c(t,e){var i=l.styles[e];return i?"\x1b["+l.colors[i][0]+"m"+t+"\x1b["+l.colors[i][1]+"m":t}function h(t,e){return t}function u(e,i,r){// Provide a hook for user-specified inspect functions. +var n={seen:[],stylize:h};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(i)?n.showHidden=i:i&&t.exports._extend(n,i),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),u(n,e,n.depth)}function c(t,e){var i=l.styles[e];return i?"\x1b["+l.colors[i][0]+"m"+t+"\x1b["+l.colors[i][1]+"m":t}function h(t,e){return t}function u(e,i,n){// Provide a hook for user-specified inspect functions. // Check that value is an object with an inspect function on it if(e.customInspect&&i&&O(i.inspect)&&// Filter out the util module, it's inspect function is special i.inspect!==t.exports.inspect&&// Also filter out any prototype objects using the circular check. -!(i.constructor&&i.constructor.prototype===i)){var n,o,a,s,l,c=i.inspect(r,e);return y(c)||(c=u(e,c,r)),c}// Primitive types cannot have properties +!(i.constructor&&i.constructor.prototype===i)){var r,o,a,s,l,c=i.inspect(n,e);return y(c)||(c=u(e,c,n)),c}// Primitive types cannot have properties var h=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(y(e)){var i="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(i,"string")}return b(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(e,i);if(h)return h;// Look up the keys of the object. var _=Object.keys(i),M=(s={},_.forEach(function(t,e){s[t]=!0}),s);// IE doesn't make error fields non-enumerable // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx if(e.showHidden&&(_=Object.getOwnPropertyNames(i)),S(i)&&(_.indexOf("message")>=0||_.indexOf("description")>=0))return d(i);// Some type of object without properties can be shortcutted. -if(0===_.length){if(O(i)){var k=i.name?": "+i.name:"";return e.stylize("[Function"+k+"]","special")}if(x(i))return e.stylize(RegExp.prototype.toString.call(i),"regexp");if(w(i))return e.stylize(Date.prototype.toString.call(i),"date");if(S(i))return d(i)}var P="",A=!1,D=["{","}"];return(p(i)&&(A=!0,D=["[","]"]),O(i)&&(P=" [Function"+(i.name?": "+i.name:"")+"]"),x(i)&&(P=" "+RegExp.prototype.toString.call(i)),w(i)&&(P=" "+Date.prototype.toUTCString.call(i)),S(i)&&(P=" "+d(i)),0!==_.length||A&&0!=i.length)?r<0?x(i)?e.stylize(RegExp.prototype.toString.call(i),"regexp"):e.stylize("[Object]","special"):(e.seen.push(i),l=A?function(t,e,i,r,n){for(var o=[],a=0,s=e.length;a=0&&a++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?o[0]+(""===n?"":n+"\n ")+" "+l.join(",\n ")+" "+o[1]:o[0]+n+" "+l.join(", ")+" "+o[1]):D[0]+P+D[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,i,r,n,o){var a,s,l;if((l=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),E(r,n)||(a="["+n+"]"),!s&&(0>t.seen.indexOf(l.value)?(s=m(i)?u(t,l.value,null):u(t,l.value,i-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").slice(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),v(a)){if(o&&n.match(/^\d+$/))return s;(a=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function p(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function y(t){return"string"==typeof t}function v(t){return void 0===t}function x(t){return _(t)&&"[object RegExp]"===M(t)}function _(t){return"object"==typeof t&&null!==t}function w(t){return _(t)&&"[object Date]"===M(t)}function S(t){return _(t)&&("[object Error]"===M(t)||t instanceof Error)}function O(t){return"function"==typeof t}function M(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}t.exports.debuglog=function(e){if(!o[e=e.toUpperCase()]){if(a.test(e)){var r=i.pid;o[e]=function(){var i=t.exports.format.apply(t.exports,arguments);console.error("%s %d: %s",e,r,i)}}else o[e]=function(){}}return o[e]},t.exports.inspect=l,// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +if(0===_.length){if(O(i)){var k=i.name?": "+i.name:"";return e.stylize("[Function"+k+"]","special")}if(x(i))return e.stylize(RegExp.prototype.toString.call(i),"regexp");if(w(i))return e.stylize(Date.prototype.toString.call(i),"date");if(S(i))return d(i)}var P="",A=!1,D=["{","}"];return(p(i)&&(A=!0,D=["[","]"]),O(i)&&(P=" [Function"+(i.name?": "+i.name:"")+"]"),x(i)&&(P=" "+RegExp.prototype.toString.call(i)),w(i)&&(P=" "+Date.prototype.toUTCString.call(i)),S(i)&&(P=" "+d(i)),0!==_.length||A&&0!=i.length)?n<0?x(i)?e.stylize(RegExp.prototype.toString.call(i),"regexp"):e.stylize("[Object]","special"):(e.seen.push(i),l=A?function(t,e,i,n,r){for(var o=[],a=0,s=e.length;a=0&&a++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?o[0]+(""===r?"":r+"\n ")+" "+l.join(",\n ")+" "+o[1]:o[0]+r+" "+l.join(", ")+" "+o[1]):D[0]+P+D[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,i,n,r,o){var a,s,l;if((l=Object.getOwnPropertyDescriptor(e,r)||{value:e[r]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),E(n,r)||(a="["+r+"]"),!s&&(0>t.seen.indexOf(l.value)?(s=m(i)?u(t,l.value,null):u(t,l.value,i-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").slice(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),v(a)){if(o&&r.match(/^\d+$/))return s;(a=JSON.stringify(""+r)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function p(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function y(t){return"string"==typeof t}function v(t){return void 0===t}function x(t){return _(t)&&"[object RegExp]"===M(t)}function _(t){return"object"==typeof t&&null!==t}function w(t){return _(t)&&"[object Date]"===M(t)}function S(t){return _(t)&&("[object Error]"===M(t)||t instanceof Error)}function O(t){return"function"==typeof t}function M(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}t.exports.debuglog=function(e){if(!o[e=e.toUpperCase()]){if(a.test(e)){var n=i.pid;o[e]=function(){var i=t.exports.format.apply(t.exports,arguments);console.error("%s %d: %s",e,n,i)}}else o[e]=function(){}}return o[e]},t.exports.inspect=l,// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},// Don't use 'blue' not visible on cmd.exe l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",// "name": intentionally not styling regexp:"red"},// NOTE: These type checking functions intentionally don't use `instanceof` @@ -134,48 +134,48 @@ t.exports.log=function(){var e,i;console.log("%s - %s",(i=[k((e=new Date).getHou * prototype. * @param {function} superCtor Constructor function to inherit prototype from. */t.exports.inherits=s("fgp9u"),t.exports._extend=function(t,e){// Don't do anything if add isn't an object -if(!e||!_(e))return t;for(var i=Object.keys(e),r=i.length;r--;)t[i[r]]=e[i[r]];return t};var A="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function D(t,e){// `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). +if(!e||!_(e))return t;for(var i=Object.keys(e),n=i.length;n--;)t[i[n]]=e[i[n]];return t};var A="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function D(t,e){// `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). // Because `null` is a special error value in callbacks which means "no error // occurred", we error-wrap so the callback consumer can distinguish between // "the promise rejected with null" or "the promise fulfilled with undefined". -if(!t){var i=Error("Promise was rejected with a falsy value");i.reason=t,t=i}return e(t)}t.exports.promisify=function(t){if("function"!=typeof t)throw TypeError('The "original" argument must be of type Function');if(A&&t[A]){var e=t[A];if("function"!=typeof e)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,A,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,i,r=new Promise(function(t,r){e=t,i=r}),n=[],o=0;o=0&&"[object Array]"!==r(t)&&"[object Function]"===r(t.callee)},a=function(){return n(arguments)}();n.isLegacyArguments=o,t.exports=a?n:o}),l("hlgT2",function(t,e){var i=s("iswqS");t.exports=function(){return i()&&!!Symbol.toStringTag}}),l("iswqS",function(t,e){/* eslint complexity: [2, 18], max-statements: [2, 33] */t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(e in t[e]=42,t)return!1;// eslint-disable-line no-restricted-syntax, no-unreachable-loop -if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}}),l("9rEHq",function(t,e){var i=s("cbV5a"),r=s("6gXjj"),n=r(i("String.prototype.indexOf"));t.exports=function(t,e){var o=i(t,!!e);return"function"==typeof o&&n(t,".prototype.")>-1?r(o):o}}),l("cbV5a",function(t,e){var i=SyntaxError,r=Function,n=TypeError,o=function(t){try{return r('"use strict"; return ('+t+").constructor;")()}catch(t){}},a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch(t){a=null;// this is IE 8, which has a broken gOPD -}var l=function(){throw new n},c=a?function(){try{return(// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties +function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},t.exports.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):o(t)||O(t)},t.exports.isUint8Array=function(t){return"Uint8Array"===r(t)},t.exports.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===r(t)},t.exports.isUint16Array=function(t){return"Uint16Array"===r(t)},t.exports.isUint32Array=function(t){return"Uint32Array"===r(t)},t.exports.isInt8Array=function(t){return"Int8Array"===r(t)},t.exports.isInt16Array=function(t){return"Int16Array"===r(t)},t.exports.isInt32Array=function(t){return"Int32Array"===r(t)},t.exports.isFloat32Array=function(t){return"Float32Array"===r(t)},t.exports.isFloat64Array=function(t){return"Float64Array"===r(t)},t.exports.isBigInt64Array=function(t){return"BigInt64Array"===r(t)},t.exports.isBigUint64Array=function(t){return"BigUint64Array"===r(t)},b.working="undefined"!=typeof Map&&b(new Map),t.exports.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},y.working="undefined"!=typeof Set&&y(new Set),t.exports.isSet=function(t){return"undefined"!=typeof Set&&(y.working?y(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),t.exports.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},x.working="undefined"!=typeof WeakSet&&x(new WeakSet),t.exports.isWeakSet=function(t){return x(t)},_.working="undefined"!=typeof ArrayBuffer&&_(new ArrayBuffer),t.exports.isArrayBuffer=w,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),t.exports.isDataView=O;// Store a copy of SharedArrayBuffer in case it's deleted elsewhere +var M="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function k(t){return"[object SharedArrayBuffer]"===h(t)}function P(t){return void 0!==M&&(void 0===k.working&&(k.working=k(new M)),k.working?k(t):t instanceof M)}function E(t){return m(t,u)}function A(t){return m(t,d)}function D(t){return m(t,f)}function T(t){return l&&m(t,p)}function R(t){return c&&m(t,g)}t.exports.isSharedArrayBuffer=P,t.exports.isAsyncFunction=function(t){return"[object AsyncFunction]"===h(t)},t.exports.isMapIterator=function(t){return"[object Map Iterator]"===h(t)},t.exports.isSetIterator=function(t){return"[object Set Iterator]"===h(t)},t.exports.isGeneratorObject=function(t){return"[object Generator]"===h(t)},t.exports.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===h(t)},t.exports.isNumberObject=E,t.exports.isStringObject=A,t.exports.isBooleanObject=D,t.exports.isBigIntObject=T,t.exports.isSymbolObject=R,t.exports.isBoxedPrimitive=function(t){return E(t)||A(t)||D(t)||T(t)||R(t)},t.exports.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(w(t)||P(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t.exports,e,{enumerable:!1,value:function(){throw Error(e+" is not supported in userland")}})})}),l("hQsBH",function(t,e){var i=s("hlgT2")(),n=s("9rEHq")("Object.prototype.toString"),r=function(t){return(!i||!t||"object"!=typeof t||!(Symbol.toStringTag in t))&&"[object Arguments]"===n(t)},o=function(t){return!!r(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==n(t)&&"[object Function]"===n(t.callee)},a=function(){return r(arguments)}();r.isLegacyArguments=o,t.exports=a?r:o}),l("hlgT2",function(t,e){var i=s("iswqS");t.exports=function(){return i()&&!!Symbol.toStringTag}}),l("iswqS",function(t,e){/* eslint complexity: [2, 18], max-statements: [2, 33] */t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(e in t[e]=42,t)return!1;// eslint-disable-line no-restricted-syntax, no-unreachable-loop +if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(t,e);if(42!==r.value||!0!==r.enumerable)return!1}return!0}}),l("9rEHq",function(t,e){var i=s("cbV5a"),n=s("6gXjj"),r=n(i("String.prototype.indexOf"));t.exports=function(t,e){var o=i(t,!!e);return"function"==typeof o&&r(t,".prototype.")>-1?n(o):o}}),l("cbV5a",function(t,e){var i=SyntaxError,n=Function,r=TypeError,o=function(t){try{return n('"use strict"; return ('+t+").constructor;")()}catch(t){}},a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch(t){a=null;// this is IE 8, which has a broken gOPD +}var l=function(){throw new r},c=a?function(){try{return(// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties arguments.callee,l)}catch(t){try{// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') return a(arguments,"callee").get}catch(t){return l}}}():l,h=s("iAT3w")(),u=s("5I7PD")(),d=Object.getPrototypeOf||(u?function(t){return t.__proto__}// eslint-disable-line no-proto -:null),f={},p="undefined"!=typeof Uint8Array&&d?d(Uint8Array):void 0,g={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":h&&d?d([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?void 0:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":r,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&d?d(d([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h&&d?d(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h&&d?d(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&d?d(""[Symbol.iterator]()):void 0,"%Symbol%":h?Symbol:void 0,"%SyntaxError%":i,"%ThrowTypeError%":c,"%TypedArray%":p,"%TypeError%":n,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet};if(d)try{null.error;// eslint-disable-line no-unused-expressions +:null),f={},p="undefined"!=typeof Uint8Array&&d?d(Uint8Array):void 0,g={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":h&&d?d([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?void 0:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":n,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&d?d(d([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h&&d?d(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h&&d?d(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&d?d(""[Symbol.iterator]()):void 0,"%Symbol%":h?Symbol:void 0,"%SyntaxError%":i,"%ThrowTypeError%":c,"%TypedArray%":p,"%TypeError%":r,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet};if(d)try{null.error;// eslint-disable-line no-unused-expressions }catch(t){// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 -var m=d(d(t));g["%Error.prototype%"]=m}var b=function t(e){var i;if("%AsyncFunction%"===e)i=o("async function () {}");else if("%GeneratorFunction%"===e)i=o("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=o("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(i=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&d&&(i=d(n.prototype))}return g[e]=i,i},y={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=s("eSJCt"),x=s("hhJZr"),_=v.call(Function.call,Array.prototype.concat),w=v.call(Function.apply,Array.prototype.splice),S=v.call(Function.call,String.prototype.replace),O=v.call(Function.call,String.prototype.slice),M=v.call(Function.call,RegExp.prototype.exec),k=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,P=/\\(\\)?/g,E=function(t){var e=O(t,0,1),r=O(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return S(t,k,function(t,e,i,r){n[n.length]=i?S(r,P,"$1"):e||t}),n},A=function(t,e){var r,o=t;if(x(y,o)&&(o="%"+(r=y[o])[0]+"%"),x(g,o)){var a=g[o];if(a===f&&(a=b(o)),void 0===a&&!e)throw new n("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:o,value:a}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new n("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new n('"allowMissing" argument must be a boolean');if(null===M(/^%?[^%]*%?$/,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=E(t),o=r.length>0?r[0]:"",s=A("%"+o+"%",e),l=s.name,c=s.value,h=!1,u=s.alias;u&&(o=u[0],w(r,_([0,1],u)));for(var d=1,f=!0;d=r.length){var y=a(c,p);// By convention, when a data property is converted to an accessor +var m=d(d(t));g["%Error.prototype%"]=m}var b=function t(e){var i;if("%AsyncFunction%"===e)i=o("async function () {}");else if("%GeneratorFunction%"===e)i=o("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=o("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(i=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var r=t("%AsyncGenerator%");r&&d&&(i=d(r.prototype))}return g[e]=i,i},y={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=s("eSJCt"),x=s("hhJZr"),_=v.call(Function.call,Array.prototype.concat),w=v.call(Function.apply,Array.prototype.splice),S=v.call(Function.call,String.prototype.replace),O=v.call(Function.call,String.prototype.slice),M=v.call(Function.call,RegExp.prototype.exec),k=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,P=/\\(\\)?/g,E=function(t){var e=O(t,0,1),n=O(t,-1);if("%"===e&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return S(t,k,function(t,e,i,n){r[r.length]=i?S(n,P,"$1"):e||t}),r},A=function(t,e){var n,o=t;if(x(y,o)&&(o="%"+(n=y[o])[0]+"%"),x(g,o)){var a=g[o];if(a===f&&(a=b(o)),void 0===a&&!e)throw new r("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:a}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new r("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new r('"allowMissing" argument must be a boolean');if(null===M(/^%?[^%]*%?$/,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=E(t),o=n.length>0?n[0]:"",s=A("%"+o+"%",e),l=s.name,c=s.value,h=!1,u=s.alias;u&&(o=u[0],w(n,_([0,1],u)));for(var d=1,f=!0;d=n.length){var y=a(c,p);// By convention, when a data property is converted to an accessor // property to emulate a data property that does not suffer from // the override mistake, that accessor's getter is marked with // an `originalValue` property. Here, when we detect this, we // uphold the illusion by pretending to see that original data // property, i.e., returning the value rather than the getter // itself. -c=(f=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:c[p]}else f=x(c,p),c=c[p];f&&!h&&(g[l]=c)}}return c}}),l("iAT3w",function(t,e){var i="undefined"!=typeof Symbol&&Symbol,r=s("iswqS");t.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&r()}}),l("5I7PD",function(t,e){var i={foo:{}},r=Object;t.exports=function(){return({__proto__:i}).foo===i.foo&&!(({__proto__:null})instanceof r)}}),l("eSJCt",function(t,e){var i=s("7uTAw");t.exports=Function.prototype.bind||i}),l("7uTAw",function(t,e){var i=Object.prototype.toString,r=Math.max,n=function(t,e){for(var i=[],r=0;r p is keyof o} */t.exports=n.call(i,r)}),l("6gXjj",function(t,e){var i=s("eSJCt"),r=s("cbV5a"),n=s("8wQgk"),o=r("%TypeError%"),a=r("%Function.prototype.apply%"),l=r("%Function.prototype.call%"),c=r("%Reflect.apply%",!0)||i.call(l,a),h=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(h)try{h({},"a",{value:1})}catch(t){// IE 8 has a broken defineProperty -h=null}t.exports=function(t){if("function"!=typeof t)throw new o("a function is required");var e=c(i,l,arguments);return n(e,1+u(0,t.length-(arguments.length-1)),!0)};var d=function(){return c(i,a,arguments)};h?h(t.exports,"apply",{value:d}):t.exports.apply=d}),l("8wQgk",function(t,e){var i=s("cbV5a"),r=s("dEYu7"),n=s("gaPDk")(),o=s("lpldP"),a=i("%TypeError%"),l=i("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||l(e)!==e)throw new a("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],s=!0,c=!0;if("length"in t&&o){var h=o(t,"length");h&&!h.configurable&&(s=!1),h&&!h.writable&&(c=!1)}return(s||c||!i)&&(n?r(t,"length",e,!0,!0):r(t,"length",e)),t}}),l("dEYu7",function(t,e){var i=s("gaPDk")(),r=s("cbV5a"),n=i&&r("%Object.defineProperty%",!0);if(n)try{n({},"a",{value:1})}catch(t){// IE 8 has a broken defineProperty -n=!1}var o=r("%SyntaxError%"),a=r("%TypeError%"),l=s("lpldP");/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */t.exports=function(t,e,i){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var r=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,h=arguments.length>6&&arguments[6],u=!!l&&l(t,e);if(n)n(t,e,{configurable:null===c&&u?u.configurable:!c,enumerable:null===r&&u?u.enumerable:!r,value:i,writable:null===s&&u?u.writable:!s});else if(!h&&(r||s||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");else t[e]=i;// eslint-disable-line no-param-reassign -}}),l("gaPDk",function(t,e){var i=s("cbV5a")("%Object.defineProperty%",!0),r=function(){if(i)try{return i({},"a",{value:1}),!0}catch(t){}return!1};r.hasArrayLengthDefineBug=function(){// node v0.6 has a bug where array lengths can be Set but not Defined -if(!r())return null;try{return 1!==i([],"length",{value:1}).length}catch(t){// In Firefox 4-22, defining length on an array throws an exception. -return!0}},t.exports=r}),l("lpldP",function(t,e){var i=s("cbV5a")("%Object.getOwnPropertyDescriptor%",!0);if(i)try{i([],"length")}catch(t){// IE 8 has a broken gOPD -i=null}t.exports=i}),l("lCUJL",function(t,e){var i,r=Object.prototype.toString,n=Function.prototype.toString,o=/^\s*(?:function)?\*/,a=s("hlgT2")(),l=Object.getPrototypeOf,c=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}};t.exports=function(t){if("function"!=typeof t)return!1;if(o.test(n.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===r.call(t);if(!l)return!1;if(void 0===i){var e=c();i=!!e&&l(e)}return l(t)===i}}),l("iVfsl",function(t,e){var i=s("e6WPe"),n=s("i6TQG"),o=s("6gXjj"),a=s("9rEHq"),l=s("lpldP"),c=a("Object.prototype.toString"),h=s("hlgT2")(),u="undefined"==typeof globalThis?r:globalThis,d=n(),f=a("String.prototype.slice"),p=Object.getPrototypeOf,g=a("Array.prototype.indexOf",!0)||function(t,e){for(var i=0;i-1?e:"Object"===e&&y(t)}return l?b(t):null}}),l("e6WPe",function(t,e){var i=s("liz7M"),r=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=function(t,e,i){for(var r=0,o=t.length;r=3&&(s=n),"[object Array]"===r.call(t)?o(t,e,s):"string"==typeof t?a(t,e,s):l(t,e,s)}}),l("liz7M",function(t,e){var i,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{i=Object.defineProperty({},"length",{get:function(){throw r}}),r={},// eslint-disable-next-line no-throw-literal -o(function(){throw 42},null,i)}catch(t){t!==r&&(o=null)}else o=null;var a=/^\s*class\b/,s=function(t){try{var e=n.call(t);return a.test(e)}catch(t){return!1;// not a function -}},l=function(t){try{if(s(t))return!1;return n.call(t),!0}catch(t){return!1}},c=Object.prototype.toString,h="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),d=function(){return!1};if("object"==typeof document){// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly +c=(f=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:c[p]}else f=x(c,p),c=c[p];f&&!h&&(g[l]=c)}}return c}}),l("iAT3w",function(t,e){var i="undefined"!=typeof Symbol&&Symbol,n=s("iswqS");t.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&n()}}),l("5I7PD",function(t,e){var i={foo:{}},n=Object;t.exports=function(){return({__proto__:i}).foo===i.foo&&!(({__proto__:null})instanceof n)}}),l("eSJCt",function(t,e){var i=s("7uTAw");t.exports=Function.prototype.bind||i}),l("7uTAw",function(t,e){var i=Object.prototype.toString,n=Math.max,r=function(t,e){for(var i=[],n=0;n p is keyof o} */t.exports=r.call(i,n)}),l("6gXjj",function(t,e){var i=s("eSJCt"),n=s("cbV5a"),r=s("8wQgk"),o=n("%TypeError%"),a=n("%Function.prototype.apply%"),l=n("%Function.prototype.call%"),c=n("%Reflect.apply%",!0)||i.call(l,a),h=n("%Object.defineProperty%",!0),u=n("%Math.max%");if(h)try{h({},"a",{value:1})}catch(t){// IE 8 has a broken defineProperty +h=null}t.exports=function(t){if("function"!=typeof t)throw new o("a function is required");var e=c(i,l,arguments);return r(e,1+u(0,t.length-(arguments.length-1)),!0)};var d=function(){return c(i,a,arguments)};h?h(t.exports,"apply",{value:d}):t.exports.apply=d}),l("8wQgk",function(t,e){var i=s("cbV5a"),n=s("dEYu7"),r=s("gaPDk")(),o=s("lpldP"),a=i("%TypeError%"),l=i("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||l(e)!==e)throw new a("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],s=!0,c=!0;if("length"in t&&o){var h=o(t,"length");h&&!h.configurable&&(s=!1),h&&!h.writable&&(c=!1)}return(s||c||!i)&&(r?n(t,"length",e,!0,!0):n(t,"length",e)),t}}),l("dEYu7",function(t,e){var i=s("gaPDk")(),n=s("cbV5a"),r=i&&n("%Object.defineProperty%",!0);if(r)try{r({},"a",{value:1})}catch(t){// IE 8 has a broken defineProperty +r=!1}var o=n("%SyntaxError%"),a=n("%TypeError%"),l=s("lpldP");/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */t.exports=function(t,e,i){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,h=arguments.length>6&&arguments[6],u=!!l&&l(t,e);if(r)r(t,e,{configurable:null===c&&u?u.configurable:!c,enumerable:null===n&&u?u.enumerable:!n,value:i,writable:null===s&&u?u.writable:!s});else if(!h&&(n||s||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");else t[e]=i;// eslint-disable-line no-param-reassign +}}),l("gaPDk",function(t,e){var i=s("cbV5a")("%Object.defineProperty%",!0),n=function(){if(i)try{return i({},"a",{value:1}),!0}catch(t){}return!1};n.hasArrayLengthDefineBug=function(){// node v0.6 has a bug where array lengths can be Set but not Defined +if(!n())return null;try{return 1!==i([],"length",{value:1}).length}catch(t){// In Firefox 4-22, defining length on an array throws an exception. +return!0}},t.exports=n}),l("lpldP",function(t,e){var i=s("cbV5a")("%Object.getOwnPropertyDescriptor%",!0);if(i)try{i([],"length")}catch(t){// IE 8 has a broken gOPD +i=null}t.exports=i}),l("lCUJL",function(t,e){var i,n=Object.prototype.toString,r=Function.prototype.toString,o=/^\s*(?:function)?\*/,a=s("hlgT2")(),l=Object.getPrototypeOf,c=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}};t.exports=function(t){if("function"!=typeof t)return!1;if(o.test(r.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===n.call(t);if(!l)return!1;if(void 0===i){var e=c();i=!!e&&l(e)}return l(t)===i}}),l("iVfsl",function(t,e){var i=s("e6WPe"),r=s("i6TQG"),o=s("6gXjj"),a=s("9rEHq"),l=s("lpldP"),c=a("Object.prototype.toString"),h=s("hlgT2")(),u="undefined"==typeof globalThis?n:globalThis,d=r(),f=a("String.prototype.slice"),p=Object.getPrototypeOf,g=a("Array.prototype.indexOf",!0)||function(t,e){for(var i=0;i-1?e:"Object"===e&&y(t)}return l?b(t):null}}),l("e6WPe",function(t,e){var i=s("liz7M"),n=Object.prototype.toString,r=Object.prototype.hasOwnProperty,o=function(t,e,i){for(var n=0,o=t.length;n=3&&(s=r),"[object Array]"===n.call(t)?o(t,e,s):"string"==typeof t?a(t,e,s):l(t,e,s)}}),l("liz7M",function(t,e){var i,n,r=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{i=Object.defineProperty({},"length",{get:function(){throw n}}),n={},// eslint-disable-next-line no-throw-literal +o(function(){throw 42},null,i)}catch(t){t!==n&&(o=null)}else o=null;var a=/^\s*class\b/,s=function(t){try{var e=r.call(t);return a.test(e)}catch(t){return!1;// not a function +}},l=function(t){try{if(s(t))return!1;return r.call(t),!0}catch(t){return!1}},c=Object.prototype.toString,h="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),d=function(){return!1};if("object"==typeof document){// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly var f=document.all;c.call(f)===c.call(document.all)&&(d=function(t){/* globals document: false */// in IE 6-8, typeof document.all is "object" and it's truthy if((u||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e// opera 12.16 ||"[object Object]"===e// IE 6-8 )&&null==t("");// eslint-disable-line eqeqeq -}catch(t){}return!1})}t.exports=o?function(t){if(d(t))return!0;if(!t||"function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,i)}catch(t){if(t!==r)return!1}return!s(t)&&l(t)}:function(t){if(d(t))return!0;if(!t||"function"!=typeof t&&"object"!=typeof t)return!1;if(h)return l(t);if(s(t))return!1;var e=c.call(t);return!!("[object Function]"===e||"[object GeneratorFunction]"===e||/^\[object HTML/.test(e))&&l(t)}}),l("i6TQG",function(t,e){var i=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"==typeof globalThis?r:globalThis;t.exports=function(){for(var t=[],e=0;et.length)&&(i=t.length),t.substring(i-e.length,i)===e}var v="",x="",_="",w="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function O(t){var e=Object.keys(t),i=Object.create(Object.getPrototypeOf(t));return e.forEach(function(e){i[e]=t[e]}),Object.defineProperty(i,"message",{value:t.message}),i}function M(t){// The util.inspect default values could be changed. This makes sure the // error messages contain the necessary information nevertheless. return m(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,// Assert compares only enumerable properties (with a few exceptions). @@ -186,60 +186,60 @@ showHidden:!1,// Having a long line as error is better than wrapping the line fo // in what line the property starts and ends). breakLength:1/0,// Assert does not detect proxies currently. showProxy:!1,sorted:!0,// Inspect getters as we also check them when comparing entries. -getters:!0})}var k=/*#__PURE__*/function(t,e){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(h,t);var r,a,s=(r=d(),function(){var t,e=p(h);if(r){var i=p(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return l(this,t)});function h(t){if(function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,h),"object"!==g(t)||null===t)throw new b("options","Object",t);var e,r=t.message,n=t.operator,o=t.stackStartFn,a=t.actual,u=t.expected,d=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)e=s.call(this,String(r));else if(i.stderr&&i.stderr.isTTY&&(i.stderr&&i.stderr.getColorDepth&&1!==i.stderr.getColorDepth()?(v="\x1b[34m",x="\x1b[32m",w="\x1b[39m",_="\x1b[31m"):(v="",x="",w="",_="")),"object"===g(a)&&null!==a&&"object"===g(u)&&null!==u&&"stack"in a&&a instanceof Error&&"stack"in u&&u instanceof Error&&(a=O(a),u=O(u)),"deepStrictEqual"===n||"strictEqual"===n)e=s.call(this,function(t,e,r){var n="",o="",a=0,s="",l=!1,c=M(t),h=c.split("\n"),u=M(e).split("\n"),d=0,f="";// If "actual" and "expected" fit on a single line and they are not strictly +getters:!0})}var k=/*#__PURE__*/function(t,e){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(h,t);var n,a,s=(n=d(),function(){var t,e=p(h);if(n){var i=p(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return l(this,t)});function h(t){if(function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,h),"object"!==g(t)||null===t)throw new b("options","Object",t);var e,n=t.message,r=t.operator,o=t.stackStartFn,a=t.actual,u=t.expected,d=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=n)e=s.call(this,String(n));else if(i.stderr&&i.stderr.isTTY&&(i.stderr&&i.stderr.getColorDepth&&1!==i.stderr.getColorDepth()?(v="\x1b[34m",x="\x1b[32m",w="\x1b[39m",_="\x1b[31m"):(v="",x="",w="",_="")),"object"===g(a)&&null!==a&&"object"===g(u)&&null!==u&&"stack"in a&&a instanceof Error&&"stack"in u&&u instanceof Error&&(a=O(a),u=O(u)),"deepStrictEqual"===r||"strictEqual"===r)e=s.call(this,function(t,e,n){var r="",o="",a=0,s="",l=!1,c=M(t),h=c.split("\n"),u=M(e).split("\n"),d=0,f="";// If "actual" and "expected" fit on a single line and they are not strictly // equal, check further special handling. -if("strictEqual"===r&&"object"===g(t)&&"object"===g(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===h.length&&1===u.length&&h[0]!==u[0]){var p=h[0].length+u[0].length;// If the character length of "actual" and "expected" together is less than +if("strictEqual"===n&&"object"===g(t)&&"object"===g(e)&&null!==t&&null!==e&&(n="strictEqualObject"),1===h.length&&1===u.length&&h[0]!==u[0]){var p=h[0].length+u[0].length;// If the character length of "actual" and "expected" together is less than // kMaxShortLength and if neither is an object and at least one of them is // not `zero`, use the strict equal comparison to visualize the output. -if(p<=10){if(("object"!==g(t)||null===t)&&("object"!==g(e)||null===e)&&(0!==t||0!==e))return"".concat(S[r],"\n\n")+"".concat(h[0]," !== ").concat(u[0],"\n")}else if("strictEqualObject"!==r&&p<(i.stderr&&i.stderr.isTTY?i.stderr.columns:80)){for(;h[0][d]===u[0][d];)d++;// Ignore the first characters. +if(p<=10){if(("object"!==g(t)||null===t)&&("object"!==g(e)||null===e)&&(0!==t||0!==e))return"".concat(S[n],"\n\n")+"".concat(h[0]," !== ").concat(u[0],"\n")}else if("strictEqualObject"!==n&&p<(i.stderr&&i.stderr.isTTY?i.stderr.columns:80)){for(;h[0][d]===u[0][d];)d++;// Ignore the first characters. d>2&&(// Add position indicator for the first mismatch in case it is a // single line and the input length is less than the column length. f="\n ".concat(// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var i=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,i-t.length)}(" ",d),"^"),d=0)}}for(// Remove all ending lines that match (this optimizes the output for // readability by reducing the number of total changed lines). -var m=h[h.length-1],b=u[u.length-1];m===b&&(d++<2?s="\n ".concat(m).concat(s):n=m,h.pop(),u.pop(),0!==h.length&&0!==u.length);)m=h[h.length-1],b=u[u.length-1];var O=Math.max(h.length,u.length);// Strict equal with identical objects that are not identical by reference. +var m=h[h.length-1],b=u[u.length-1];m===b&&(d++<2?s="\n ".concat(m).concat(s):r=m,h.pop(),u.pop(),0!==h.length&&0!==u.length);)m=h[h.length-1],b=u[u.length-1];var O=Math.max(h.length,u.length);// Strict equal with identical objects that are not identical by reference. // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() }) if(0===O){// We have to get the result again. The lines were all removed before. var k=c.split("\n");// Only remove lines in case it makes sense to collapse those. // TODO: Accept env to always show the full error. -if(k.length>30)for(k[26]="".concat(v,"...").concat(w);k.length>27;)k.pop();return"".concat(S.notIdentical,"\n\n").concat(k.join("\n"),"\n")}d>3&&(s="\n".concat(v,"...").concat(w).concat(s),l=!0),""!==n&&(s="\n ".concat(n).concat(s),n="");var P=0,E=S[r]+"\n".concat(x,"+ actual").concat(w," ").concat(_,"- expected").concat(w),A=" ".concat(v,"...").concat(w," Lines skipped");for(d=0;d30)for(k[26]="".concat(v,"...").concat(w);k.length>27;)k.pop();return"".concat(S.notIdentical,"\n\n").concat(k.join("\n"),"\n")}d>3&&(s="\n".concat(v,"...").concat(w).concat(s),l=!0),""!==r&&(s="\n ".concat(r).concat(s),r="");var P=0,E=S[n]+"\n".concat(x,"+ actual").concat(w," ").concat(_,"- expected").concat(w),A=" ".concat(v,"...").concat(w," Lines skipped");for(d=0;d1&&d>2&&(D>4?(o+="\n".concat(v,"...").concat(w),l=!0):D>3&&(o+="\n ".concat(u[d-2]),P++),o+="\n ".concat(u[d-1]),P++),// Mark the current line as the last diverging one. a=d,// Add the expected line to the cache. -n+="\n".concat(_,"-").concat(w," ").concat(u[d]),P++;else if(u.length1&&d>2&&(D>4?(o+="\n".concat(v,"...").concat(w),l=!0):D>3&&(o+="\n ".concat(h[d-2]),P++),o+="\n ".concat(h[d-1]),P++),// Mark the current line as the last diverging one. +r+="\n".concat(_,"-").concat(w," ").concat(u[d]),P++;else if(u.length1&&d>2&&(D>4?(o+="\n".concat(v,"...").concat(w),l=!0):D>3&&(o+="\n ".concat(h[d-2]),P++),o+="\n ".concat(h[d-1]),P++),// Mark the current line as the last diverging one. a=d,// Add the actual line to the result. o+="\n".concat(x,"+").concat(w," ").concat(h[d]),P++;else{var T=u[d],R=h[d],C=R!==T&&(!y(R,",")||R.slice(0,-1)!==T);C&&y(T,",")&&T.slice(0,-1)===R&&(C=!1,R+=","),C?(D>1&&d>2&&(D>4?(o+="\n".concat(v,"...").concat(w),l=!0):D>3&&(o+="\n ".concat(h[d-2]),P++),o+="\n ".concat(h[d-1]),P++),// Mark the current line as the last diverging one. a=d,// Add the actual line to the result and cache the expected diverging // line so consecutive diverging lines show up as +++--- and not +-+-+-. -o+="\n".concat(x,"+").concat(w," ").concat(R),n+="\n".concat(_,"-").concat(w," ").concat(T),P+=2):(// Add all cached information to the result before adding other things +o+="\n".concat(x,"+").concat(w," ").concat(R),r+="\n".concat(_,"-").concat(w," ").concat(T),P+=2):(// Add all cached information to the result before adding other things // and reset the cache. -o+=n,n="",(1===D||0===d)&&(o+="\n ".concat(R),P++))}// Inspected object to big (Show ~20 rows max) -if(P>20&&d20&&d30)for(p[26]="".concat(v,"...").concat(w);p.length>27;)p.pop();e=1===p.length?s.call(this,"".concat(f," ").concat(p[0])):s.call(this,"".concat(f,"\n\n").concat(p.join("\n"),"\n"))}else{var m=M(a),k="",P=S[n];"notDeepEqual"===n||"notEqual"===n?(m="".concat(S[n],"\n\n").concat(m)).length>1024&&(m="".concat(m.slice(0,1021),"...")):(k="".concat(M(u)),m.length>512&&(m="".concat(m.slice(0,509),"...")),k.length>512&&(k="".concat(k.slice(0,509),"...")),"deepEqual"===n||"equal"===n?m="".concat(P,"\n\n").concat(m,"\n\nshould equal\n\n"):k=" ".concat(n," ").concat(k)),e=s.call(this,"".concat(m).concat(k))}return Error.stackTraceLimit=d,e.generatedMessage=!r,Object.defineProperty(c(e),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),e.code="ERR_ASSERTION",e.actual=a,e.expected=u,e.operator=n,Error.captureStackTrace&&Error.captureStackTrace(c(e),o),// Create error message including the error code in the name. +if("notStrictEqual"===r&&"object"===g(a)&&null!==a&&(f=S.notStrictEqualObject),p.length>30)for(p[26]="".concat(v,"...").concat(w);p.length>27;)p.pop();e=1===p.length?s.call(this,"".concat(f," ").concat(p[0])):s.call(this,"".concat(f,"\n\n").concat(p.join("\n"),"\n"))}else{var m=M(a),k="",P=S[r];"notDeepEqual"===r||"notEqual"===r?(m="".concat(S[r],"\n\n").concat(m)).length>1024&&(m="".concat(m.slice(0,1021),"...")):(k="".concat(M(u)),m.length>512&&(m="".concat(m.slice(0,509),"...")),k.length>512&&(k="".concat(k.slice(0,509),"...")),"deepEqual"===r||"equal"===r?m="".concat(P,"\n\n").concat(m,"\n\nshould equal\n\n"):k=" ".concat(r," ").concat(k)),e=s.call(this,"".concat(m).concat(k))}return Error.stackTraceLimit=d,e.generatedMessage=!n,Object.defineProperty(c(e),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),e.code="ERR_ASSERTION",e.actual=a,e.expected=u,e.operator=r,Error.captureStackTrace&&Error.captureStackTrace(c(e),o),// Create error message including the error code in the name. e.stack,// Reset the name. e.name="AssertionError",l(e)}return o(h.prototype,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:e,value:function(t,e){// This limits the `actual` and `expected` property default inspection to // the minimum depth. Otherwise those values would be too verbose compared // to the actual error message which contains a combined view of these two // input values. -return m(this,n(n({},e),{},{customInspect:!1,depth:0}))}}]),a&&o(h,a),Object.defineProperty(h,"prototype",{writable:!1}),h}(/*#__PURE__*/h(Error),m.custom);t.exports=k}),l("5AA81",function(t,e){var i=s("4pa7q"),r=function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),i={},r=0;r=0&&"[object Function]"===i.call(t.callee)),r}}),l("1utM5",function(t,e){var i;if(!Object.keys){// modified from https://github.com/es-shims/es5-shim -var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=s("1ie2q"),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call(function(){},"prototype"),h=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(t){var e=t.constructor;return e&&e.prototype===t},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){/* global window */if("undefined"==typeof window)return!1;for(var t in window)try{if(!d["$"+t]&&r.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{u(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),p=function(t){/* global window */if("undefined"==typeof window||!f)return u(t);try{return u(t)}catch(t){return!1}};i=function(t){var e=null!==t&&"object"==typeof t,i="[object Function]"===n.call(t),a=o(t),s=e&&"[object String]"===n.call(t),u=[];if(!e&&!i&&!a)throw TypeError("Object.keys called on a non-object");var d=c&&i;if(s&&t.length>0&&!r.call(t,0))for(var f=0;f0)for(var g=0;gt.length)&&(e=t.length);for(var i=0,r=Array(e);i10)return!0;for(var e=0;e57)return!0}// The maximum size for an array is 2 ** 32 -1. +r[b]=y;// step 3.a.iii.2.b +}}}return r;// step 4 +}}),l("dOa0R",function(t,e){var i=Array.prototype.slice,n=s("1ie2q"),r=Object.keys,o=r?function(t){return r(t)}:s("1utM5"),a=Object.keys;o.shim=function(){return Object.keys?!function(){// Safari 5.0 bug +var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)&&(Object.keys=function(t){return n(t)?a(i.call(t)):a(t)}):Object.keys=o,Object.keys||o},t.exports=o}),l("1ie2q",function(t,e){var i=Object.prototype.toString;t.exports=function(t){var e=i.call(t),n="[object Arguments]"===e;return n||(n="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===i.call(t.callee)),n}}),l("1utM5",function(t,e){var i;if(!Object.keys){// modified from https://github.com/es-shims/es5-shim +var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=s("1ie2q"),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call(function(){},"prototype"),h=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(t){var e=t.constructor;return e&&e.prototype===t},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){/* global window */if("undefined"==typeof window)return!1;for(var t in window)try{if(!d["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{u(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),p=function(t){/* global window */if("undefined"==typeof window||!f)return u(t);try{return u(t)}catch(t){return!1}};i=function(t){var e=null!==t&&"object"==typeof t,i="[object Function]"===r.call(t),a=o(t),s=e&&"[object String]"===r.call(t),u=[];if(!e&&!i&&!a)throw TypeError("Object.keys called on a non-object");var d=c&&i;if(s&&t.length>0&&!n.call(t,0))for(var f=0;f0)for(var g=0;gt.length)&&(e=t.length);for(var i=0,n=Array(e);i10)return!0;for(var e=0;e57)return!0}// The maximum size for an array is 2 ** 32 -1. return 10===t.length&&t>=4294967296}function C(t){return Object.keys(t).filter(R).concat(h(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}// Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js // original notice: /*! @@ -247,7 +247,7 @@ return 10===t.length&&t>=4294967296}function C(t){return Object.keys(t).filter(R * * @author Feross Aboukhadijeh * @license MIT - */function j(t,e){if(t===e)return 0;for(var i=t.length,r=e.length,n=0,o=Math.min(i,r);n=4294967296}function C(t){return Object.keys(t).filter(R // For strict comparison, objects should have // a) The same built-in type tags // b) The same prototypes. -function F(t,e,i,r){// All identical values are equivalent, as determined by ===. +function F(t,e,i,n){// All identical values are equivalent, as determined by ===. if(t===e)return 0!==t||!i||c(t,e);// Check more closely if val1 and val2 are equal. -if(i){if("object"!==n(t))return"number"==typeof t&&u(t)&&u(e);if("object"!==n(e)||null===t||null===e||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==n(t))return(null===e||"object"!==n(e))&&t==e;if(null===e||"object"!==n(e))return!1}var a=g(t);if(a!==g(e))return!1;if(Array.isArray(t)){// Check for sparse arrays and general fast path -if(t.length!==e.length)return!1;var s=C(t,I),l=C(e,I);return s.length===l.length&&N(t,e,i,r,1,s)}// [browserify] This triggers on certain types in IE (Map/Set) so we don't +if(i){if("object"!==r(t))return"number"==typeof t&&u(t)&&u(e);if("object"!==r(e)||null===t||null===e||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==r(t))return(null===e||"object"!==r(e))&&t==e;if(null===e||"object"!==r(e))return!1}var a=g(t);if(a!==g(e))return!1;if(Array.isArray(t)){// Check for sparse arrays and general fast path +if(t.length!==e.length)return!1;var s=C(t,I),l=C(e,I);return s.length===l.length&&N(t,e,i,n,1,s)}// [browserify] This triggers on certain types in IE (Map/Set) so we don't // wan't to early return out of the rest of the checks. However we can check // if the second value is one of these values and the first isn't. if("[object Object]"===a&&(!x(t)&&x(e)||!w(t)&&w(e)))return!1;if(v(t)){if(!v(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(_(t)){if(!_(e)||(o?t.source!==e.source||t.flags!==e.flags:RegExp.prototype.toString.call(t)!==RegExp.prototype.toString.call(e)))return!1}else if(S(t)||t instanceof Error)// Do not compare the stack as it might differ even though the error itself @@ -276,7 +276,7 @@ if("[object Object]"===a&&(!x(t)&&x(e)||!w(t)&&w(e)))return!1;if(v(t)){if(!v(e)| {if(t.message!==e.message||t.name!==e.name)return!1}else if(y(t)){if(!i&&(D(t)||T(t))){if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var i=0;i2?arguments[2]:{},a=i(e);r&&(a=o.call(a,Object.getOwnPropertySymbols(e)));for(var s=0;s2?arguments[2]:{},a=i(e);n&&(a=o.call(a,Object.getOwnPropertySymbols(e)));for(var s=0;sMath.max(Math.min(t,i),e);function f(t){return d(u(2.55*t),0,255)}function p(t){return d(u(255*t),0,255)}function g(t){return d(u(t/2.55)/100,0,1)}function m(t){return d(u(100*t),0,100)}const b={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},y=[..."0123456789ABCDEF"],v=t=>y[15&t],x=t=>y[(240&t)>>4]+y[15&t],_=t=>(240&t)>>4==(15&t),w=t=>_(t.r)&&_(t.g)&&_(t.b)&&_(t.a),S=(t,e)=>t<255?e(t):"",O=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function M(t,e,i){let r=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-r*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function k(t,e,i){let r=(r,n=(r+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[r(5),r(3),r(1)]}function P(t,e,i){let r;let n=M(t,1,.5);for(e+i>1&&(r=1/(e+i),e*=r,i*=r),r=0;r<3;r++)n[r]*=1-e-i,n[r]+=e;return n}function E(t){let e,i,r;let n=t.r/255,o=t.g/255,a=t.b/255,s=Math.max(n,o,a),l=Math.min(n,o,a),c=(s+l)/2;return s!==l&&(r=s-l,i=c>.5?r/(2-s-l):r/(s+l),e=60*(e=n===s?(o-a)/r+(ot<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,I=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function F(t,e,i){if(t){let r=E(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*i,0===e?360:1)),r=A(M,r,void 0,void 0),t.r=r[0],t.g=r[1],t.b=r[2]}}function L(t,e){return t?Object.assign(e||{},t):t}function N(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=p(t[3]))):(e=L(t,{r:0,g:0,b:0,a:1})).a=p(e.a),e}class z{get valid(){return this._valid}get rgb(){var t=L(this._rgb);return t&&(t.a=g(t.a)),t}set rgb(t){this._rgb=N(t)}rgbString(){var t;return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${g(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0}hexString(){var t,e;return this._valid?(e=w(t=this._rgb)?v:x,t?"#"+e(t.r)+e(t.g)+e(t.b)+S(t.a,e):void 0):void 0}hslString(){return this._valid?function(t){if(!t)return;let e=E(t),i=e[0],r=m(e[1]),n=m(e[2]);return t.a<255?`hsla(${i}, ${r}%, ${n}%, ${g(t.a)})`:`hsl(${i}, ${r}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){let i;let r=this.rgb,n=t.rgb,o=e===i?.5:e,a=2*o-1,s=r.a-n.a,l=((a*s==-1?a:(a+s)/(1+a*s))+1)/2;i=1-l,r.r=255&l*r.r+i*n.r+.5,r.g=255&l*r.g+i*n.g+.5,r.b=255&l*r.b+i*n.b+.5,r.a=o*r.a+(1-o)*n.a,this.rgb=r}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){let r=I(g(t.r)),n=I(g(t.g)),o=I(g(t.b));return{r:p(j(r+i*(I(g(e.r))-r))),g:p(j(n+i*(I(g(e.g))-n))),b:p(j(o+i*(I(g(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new z(this.rgb)}alpha(t){return this._rgb.a=p(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=u(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return F(this._rgb,2,t),this}darken(t){return F(this._rgb,2,-t),this}saturate(t){return F(this._rgb,1,t),this}desaturate(t){return F(this._rgb,1,-t),this}rotate(t){var e,i;return(i=E(e=this._rgb))[0]=D(i[0]+t),i=A(M,i,void 0,void 0),e.r=i[0],e.g=i[1],e.b=i[2],this}constructor(e){let i;if(e instanceof z)return e;let r=typeof e;if("object"===r)i=N(e);else if("string"===r){var n,o;o=e.length,"#"===e[0]&&(4===o||5===o?n={r:255&17*b[e[1]],g:255&17*b[e[2]],b:255&17*b[e[3]],a:5===o?17*b[e[4]]:255}:(7===o||9===o)&&(n={r:b[e[1]]<<4|b[e[2]],g:b[e[3]]<<4|b[e[4]],b:b[e[5]]<<4|b[e[6]],a:9===o?b[e[7]]<<4|b[e[8]]:255})),i=n||function(e){t||((t=function(){let t,e,i,r,n;let o={},a=Object.keys(R),s=Object.keys(T);for(t=0;t>16&255,i>>8&255,255&i]}return o}()).transparent=[0,0,0,0]);let i=t[e.toLowerCase()];return i&&{r:i[0],g:i[1],b:i[2],a:4===i.length?i[3]:255}}(e)||("r"===e.charAt(0)?function(t){let e,i,r;let n=C.exec(t),o=255;if(n){if(n[7]!==e){let t=+n[7];o=n[8]?f(t):d(255*t,0,255)}return e=+n[1],i=+n[3],r=+n[5],{r:e=255&(n[2]?f(e):d(e,0,255)),g:i=255&(n[4]?f(i):d(i,0,255)),b:r=255&(n[6]?f(r):d(r,0,255)),a:o}}}(e):function(t){let e;let i=O.exec(t),r=255;if(!i)return;i[5]!==e&&(r=i[6]?f(+i[5]):p(+i[5]));let n=D(+i[2]),o=+i[3]/100,a=+i[4]/100;return{r:(e="hwb"===i[1]?A(P,n,o,a):"hsv"===i[1]?A(k,n,o,a):A(M,n,o,a))[0],g:e[1],b:e[2],a:r}}(e))}this._rgb=i,this._valid=!!i}}/** + */function u(t){return t+.5|0}const d=(t,e,i)=>Math.max(Math.min(t,i),e);function f(t){return d(u(2.55*t),0,255)}function p(t){return d(u(255*t),0,255)}function g(t){return d(u(t/2.55)/100,0,1)}function m(t){return d(u(100*t),0,100)}const b={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},y=[..."0123456789ABCDEF"],v=t=>y[15&t],x=t=>y[(240&t)>>4]+y[15&t],_=t=>(240&t)>>4==(15&t),w=t=>_(t.r)&&_(t.g)&&_(t.b)&&_(t.a),S=(t,e)=>t<255?e(t):"",O=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function M(t,e,i){let n=e*Math.min(i,1-i),r=(e,r=(e+t/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function k(t,e,i){let n=(n,r=(n+t/60)%6)=>i-i*e*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function P(t,e,i){let n;let r=M(t,1,.5);for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)r[n]*=1-e-i,r[n]+=e;return r}function E(t){let e,i,n;let r=t.r/255,o=t.g/255,a=t.b/255,s=Math.max(r,o,a),l=Math.min(r,o,a),c=(s+l)/2;return s!==l&&(n=s-l,i=c>.5?n/(2-s-l):n/(s+l),e=60*(e=r===s?(o-a)/n+(ot<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,I=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function F(t,e,i){if(t){let n=E(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=A(M,n,void 0,void 0),t.r=n[0],t.g=n[1],t.b=n[2]}}function L(t,e){return t?Object.assign(e||{},t):t}function N(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=p(t[3]))):(e=L(t,{r:0,g:0,b:0,a:1})).a=p(e.a),e}class z{get valid(){return this._valid}get rgb(){var t=L(this._rgb);return t&&(t.a=g(t.a)),t}set rgb(t){this._rgb=N(t)}rgbString(){var t;return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${g(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0}hexString(){var t,e;return this._valid?(e=w(t=this._rgb)?v:x,t?"#"+e(t.r)+e(t.g)+e(t.b)+S(t.a,e):void 0):void 0}hslString(){return this._valid?function(t){if(!t)return;let e=E(t),i=e[0],n=m(e[1]),r=m(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${r}%, ${g(t.a)})`:`hsl(${i}, ${n}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){let i;let n=this.rgb,r=t.rgb,o=e===i?.5:e,a=2*o-1,s=n.a-r.a,l=((a*s==-1?a:(a+s)/(1+a*s))+1)/2;i=1-l,n.r=255&l*n.r+i*r.r+.5,n.g=255&l*n.g+i*r.g+.5,n.b=255&l*n.b+i*r.b+.5,n.a=o*n.a+(1-o)*r.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){let n=I(g(t.r)),r=I(g(t.g)),o=I(g(t.b));return{r:p(j(n+i*(I(g(e.r))-n))),g:p(j(r+i*(I(g(e.g))-r))),b:p(j(o+i*(I(g(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new z(this.rgb)}alpha(t){return this._rgb.a=p(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=u(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return F(this._rgb,2,t),this}darken(t){return F(this._rgb,2,-t),this}saturate(t){return F(this._rgb,1,t),this}desaturate(t){return F(this._rgb,1,-t),this}rotate(t){var e,i;return(i=E(e=this._rgb))[0]=D(i[0]+t),i=A(M,i,void 0,void 0),e.r=i[0],e.g=i[1],e.b=i[2],this}constructor(e){let i;if(e instanceof z)return e;let n=typeof e;if("object"===n)i=N(e);else if("string"===n){var r,o;o=e.length,"#"===e[0]&&(4===o||5===o?r={r:255&17*b[e[1]],g:255&17*b[e[2]],b:255&17*b[e[3]],a:5===o?17*b[e[4]]:255}:(7===o||9===o)&&(r={r:b[e[1]]<<4|b[e[2]],g:b[e[3]]<<4|b[e[4]],b:b[e[5]]<<4|b[e[6]],a:9===o?b[e[7]]<<4|b[e[8]]:255})),i=r||function(e){t||((t=function(){let t,e,i,n,r;let o={},a=Object.keys(R),s=Object.keys(T);for(t=0;t>16&255,i>>8&255,255&i]}return o}()).transparent=[0,0,0,0]);let i=t[e.toLowerCase()];return i&&{r:i[0],g:i[1],b:i[2],a:4===i.length?i[3]:255}}(e)||("r"===e.charAt(0)?function(t){let e,i,n;let r=C.exec(t),o=255;if(r){if(r[7]!==e){let t=+r[7];o=r[8]?f(t):d(255*t,0,255)}return e=+r[1],i=+r[3],n=+r[5],{r:e=255&(r[2]?f(e):d(e,0,255)),g:i=255&(r[4]?f(i):d(i,0,255)),b:n=255&(r[6]?f(n):d(n,0,255)),a:o}}}(e):function(t){let e;let i=O.exec(t),n=255;if(!i)return;i[5]!==e&&(n=i[6]?f(+i[5]):p(+i[5]));let r=D(+i[2]),o=+i[3]/100,a=+i[4]/100;return{r:(e="hwb"===i[1]?A(P,r,o,a):"hsv"===i[1]?A(k,r,o,a):A(M,r,o,a))[0],g:e[1],b:e[2],a:n}}(e))}this._rgb=i,this._valid=!!i}}/** * @namespace Chart.helpers *//** * An empty function that can be used, for example, for optional callback. @@ -364,41 +364,41 @@ case"number":if(u(t))return!1}return!0}function V(t,e,i,r,n,o){for(var s=a(t),l= * @param fn - The function to call. * @param args - The arguments with which `fn` should be called. * @param [thisArg] - The value of `this` provided for the call to `fn`. - */function Z(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function J(t,e,i,r){let n,o,a;if(H(t)){if(o=t.length,r)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;n=0;r--)e.call(i,t[r],r);else for(r=0;rt,// default resolvers x:t=>t.x,y:t=>t.y};function ta(t,e){let i=to[e]||(to[e]=function(t){let e=/** * @private - */function(t){let e=t.split("."),i=[],r="";for(let t of e)(r+=t).endsWith("\\")?r=r.slice(0,-1)+".":(i.push(r),r="");return i}(t);return t=>{for(let i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}/** + */function(t){let e=t.split("."),i=[],n="";for(let t of e)(n+=t).endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(let i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}/** * @private */function ts(t){return t.charAt(0).toUpperCase()+t.slice(1)}const tl=t=>void 0!==t,tc=t=>"function"==typeof t,th=(t,e)=>{if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0},tu=Math.PI,td=2*tu,tf=td+tu,tp=Number.POSITIVE_INFINITY,tg=tu/180,tm=tu/2,tb=tu/4,ty=2*tu/3,tv=Math.log10,tx=Math.sign;function t_(t,e,i){return Math.abs(t-e)l&&cl&&c=Math.min(e,i)-r&&t<=Math.max(e,i)+r}function tj(t,e,i){let r;i=i||(i=>t[i]1;)i(r=o+n>>1)?o=r:n=r;return{lo:o,hi:n}}/** + */function tC(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function tj(t,e,i){let n;i=i||(i=>t[i]1;)i(n=o+r>>1)?o=n:r=n;return{lo:o,hi:r}}/** * Binary search * @param table - the table search. must be sorted! * @param key - property name for the value in each entry * @param value - value to find * @param last - lookup last index * @private - */const tI=(t,e,i,r)=>tj(t,i,r?r=>{let n=t[r][e];return nt[r][e]tj(t,i,r=>t[r][e]>=i),tL=["push","pop","shift","splice","unshift"];function tN(t,e){let i=t._chartjs;if(!i)return;let r=i.listeners,n=r.indexOf(e);-1!==n&&r.splice(n,1),r.length>0||(tL.forEach(e=>{delete t[e]}),delete t._chartjs)}/** + */const tI=(t,e,i,n)=>tj(t,i,n?n=>{let r=t[n][e];return rt[n][e]tj(t,i,n=>t[n][e]>=i),tL=["push","pop","shift","splice","unshift"];function tN(t,e){let i=t._chartjs;if(!i)return;let n=i.listeners,r=n.indexOf(e);-1!==r&&n.splice(r,1),n.length>0||(tL.forEach(e=>{delete t[e]}),delete t._chartjs)}/** * @param items */function tz(t){let e=new Set(t);return e.size===t.length?t:Array.from(e)}/** * Request animation polyfill */const tB="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;/** * Throttles calling `fn` once per animation frame * Latest arguments are used on the actual call - */function tV(t,e){let i=[],r=!1;return function(...n){// Save the args for use later -i=n,r||(r=!0,tB.call(window,()=>{r=!1,t.apply(e,i)}))}}/** + */function tV(t,e){let i=[],n=!1;return function(...r){// Save the args for use later +i=r,n||(n=!0,tB.call(window,()=>{n=!1,t.apply(e,i)}))}}/** * Converts 'start' to 'left', 'end' to 'right' and others to 'center' * @private - */const tW=t=>"start"===t?"left":"end"===t?"right":"center",tH=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,tU=(t,e,i,r)=>t===(r?"left":"right")?i:"center"===t?(e+i)/2:e;/** + */const tW=t=>"start"===t?"left":"end"===t?"right":"center",tH=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,tU=(t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e;/** * Return start and count of visible points. * @private - */function t$(t,e,i){let r=e.length,n=0,o=r;if(t._sorted){let{iScale:a,_parsed:s}=t,l=a.axis,{min:c,max:h,minDefined:u,maxDefined:d}=a.getUserBounds();u&&(n=tR(Math.min(tI(s,l,c).lo,i?r:tI(e,l,a.getPixelForValue(c)).lo),0,r-1)),o=d?tR(Math.max(tI(s,a.axis,h,!0).hi+1,i?0:tI(e,l,a.getPixelForValue(h),!0).hi+1),n,r)-n:r-n}return{start:n,count:o}}/** + */function t$(t,e,i){let n=e.length,r=0,o=n;if(t._sorted){let{iScale:a,_parsed:s}=t,l=a.axis,{min:c,max:h,minDefined:u,maxDefined:d}=a.getUserBounds();u&&(r=tR(Math.min(tI(s,l,c).lo,i?n:tI(e,l,a.getPixelForValue(c)).lo),0,n-1)),o=d?tR(Math.max(tI(s,a.axis,h,!0).hi+1,i?0:tI(e,l,a.getPixelForValue(h),!0).hi+1),r,n)-r:n-r}return{start:r,count:o}}/** * Checks if the scale ranges have changed. * @param {object} meta - dataset meta. * @returns {boolean} * @private - */function tq(t){let{xScale:e,yScale:i,_scaleRanges:r}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!r)return t._scaleRanges=n,!0;let o=r.xmin!==e.min||r.xmax!==e.max||r.ymin!==i.min||r.ymax!==i.max;return Object.assign(r,n),o}const tY=t=>0===t||1===t,tG=(t,e,i)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*td/i)),tX=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*td/i)+1,tZ={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*tm)+1,easeOutSine:t=>Math.sin(t*tm),easeInOutSine:t=>-.5*(Math.cos(tu*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>tY(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(-Math.pow(2,-10*(2*t-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>tY(t)?t:tG(t,.075,.3),easeOutElastic:t=>tY(t)?t:tX(t,.075,.3),easeInOutElastic:t=>tY(t)?t:t<.5?.5*tG(2*t,.1125,.45):.5+.5*tX(2*t-1,.1125,.45),easeInBack:t=>t*t*(2.70158*t-1.70158),easeOutBack:t=>(t-=1)*t*(2.70158*t+1.70158)+1,easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-tZ.easeOutBounce(1-t),easeOutBounce:t=>t<.36363636363636365?7.5625*t*t:t<.7272727272727273?7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?7.5625*(t-=.8181818181818182)*t+.9375:7.5625*(t-=.9545454545454546)*t+.984375,easeInOutBounce:t=>t<.5?.5*tZ.easeInBounce(2*t):.5*tZ.easeOutBounce(2*t-1)+.5};function tJ(t){if(t&&"object"==typeof t){let e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function tK(t){return tJ(t)?t:new z(t)}function tQ(t){return tJ(t)?t:new z(t).saturate(.5).darken(.1).hexString()}const t0=["x","y","borderWidth","radius","tension"],t1=["color","borderColor","backgroundColor"],t2=new Map;function t5(t,e,i){return(function(t,e){e=e||{};let i=t+JSON.stringify(e),r=t2.get(i);return r||(r=new Intl.NumberFormat(t,e),t2.set(i,r)),r})(e,i).format(t)}const t3={values:t=>H(t)?t:""+t,numeric(t,e,i){let r;if(0===t)return"0";let n=this.chart.options.locale,o=t;if(i.length>1){let e;let n=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(n<1e-4||n>1e15)&&(r="scientific"),Math.abs(e=i.length>3?i[2].value-i[1].value:i[1].value-i[0].value)>=1&&t!==Math.floor(t)&&(e=t-Math.floor(t)),o=e}let a=tv(Math.abs(o)),s=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:r,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),t5(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";let r=i[e].significand||t/Math.pow(10,Math.floor(tv(t)));return[1,2,3,5,10,15].includes(r)||e>.8*i.length?t3.numeric.call(this,t,e,i):""}};var t8={formatters:t3};const t6=Object.create(null),t4=Object.create(null);function t7(t,e){if(!e)return t;let i=e.split(".");for(let e=0,r=i.length;et(this))}constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>tQ(e.backgroundColor),this.hoverBorderColor=(t,e)=>tQ(e.borderColor),this.hoverColor=(t,e)=>tQ(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:t1},numbers:{type:"number",properties:t0}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:t8.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);/** + */function tq(t){let{xScale:e,yScale:i,_scaleRanges:n}=t,r={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=r,!0;let o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,r),o}const tY=t=>0===t||1===t,tG=(t,e,i)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*td/i)),tX=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*td/i)+1,tZ={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*tm)+1,easeOutSine:t=>Math.sin(t*tm),easeInOutSine:t=>-.5*(Math.cos(tu*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>tY(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(-Math.pow(2,-10*(2*t-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>tY(t)?t:tG(t,.075,.3),easeOutElastic:t=>tY(t)?t:tX(t,.075,.3),easeInOutElastic:t=>tY(t)?t:t<.5?.5*tG(2*t,.1125,.45):.5+.5*tX(2*t-1,.1125,.45),easeInBack:t=>t*t*(2.70158*t-1.70158),easeOutBack:t=>(t-=1)*t*(2.70158*t+1.70158)+1,easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-tZ.easeOutBounce(1-t),easeOutBounce:t=>t<.36363636363636365?7.5625*t*t:t<.7272727272727273?7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?7.5625*(t-=.8181818181818182)*t+.9375:7.5625*(t-=.9545454545454546)*t+.984375,easeInOutBounce:t=>t<.5?.5*tZ.easeInBounce(2*t):.5*tZ.easeOutBounce(2*t-1)+.5};function tJ(t){if(t&&"object"==typeof t){let e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function tK(t){return tJ(t)?t:new z(t)}function tQ(t){return tJ(t)?t:new z(t).saturate(.5).darken(.1).hexString()}const t0=["x","y","borderWidth","radius","tension"],t1=["color","borderColor","backgroundColor"],t2=new Map;function t5(t,e,i){return(function(t,e){e=e||{};let i=t+JSON.stringify(e),n=t2.get(i);return n||(n=new Intl.NumberFormat(t,e),t2.set(i,n)),n})(e,i).format(t)}const t3={values:t=>H(t)?t:""+t,numeric(t,e,i){let n;if(0===t)return"0";let r=this.chart.options.locale,o=t;if(i.length>1){let e;let r=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(r<1e-4||r>1e15)&&(n="scientific"),Math.abs(e=i.length>3?i[2].value-i[1].value:i[1].value-i[0].value)>=1&&t!==Math.floor(t)&&(e=t-Math.floor(t)),o=e}let a=tv(Math.abs(o)),s=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),t5(t,r,l)},logarithmic(t,e,i){if(0===t)return"0";let n=i[e].significand||t/Math.pow(10,Math.floor(tv(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?t3.numeric.call(this,t,e,i):""}};var t8={formatters:t3};const t6=Object.create(null),t4=Object.create(null);function t9(t,e){if(!e)return t;let i=e.split(".");for(let e=0,n=i.length;et(this))}constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>tQ(e.backgroundColor),this.hoverBorderColor=(t,e)=>tQ(e.borderColor),this.hoverColor=(t,e)=>tQ(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:t1},numbers:{type:"number",properties:t0}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:t8.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);/** * @private - */function ee(t,e,i,r,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>r&&(r=o),r}/** + */function ee(t,e,i,n,r){let o=e[r];return o||(o=e[r]=t.measureText(r).width,i.push(r)),o>n&&(n=o),n}/** * Returns the aligned pixel value to avoid anti-aliasing blur * @param chart - The chart instance. * @param pixel - A pixel value. * @param width - The width of the element. * @returns The aligned pixel value. * @private - */function ei(t,e,i){let r=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*r)/r+n}/** + */function ei(t,e,i){let n=t.currentDevicePixelRatio,r=0!==i?Math.max(i/2,.5):0;return Math.round((e-r)*n)/n+r}/** * Clears the entire canvas. - */function er(t,e){(e=e||t.getContext("2d")).save(),// canvas.width and canvas.height do not consider the canvas transform, + */function en(t,e){(e=e||t.getContext("2d")).save(),// canvas.width and canvas.height do not consider the canvas transform, // while clearRect does -e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function en(t,e,i,r){// eslint-disable-next-line @typescript-eslint/no-use-before-define -eo(t,e,i,r,null)}// eslint-disable-next-line complexity -function eo(t,e,i,r,n){let o,a,s,l,c,h,u,d;let f=e.pointStyle,p=e.rotation,g=e.radius,m=(p||0)*tg;if(f&&"object"==typeof f&&("[object HTMLImageElement]"===(o=f.toString())||"[object HTMLCanvasElement]"===o)){t.save(),t.translate(i,r),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),t.restore();return}if(!isNaN(g)&&!(g<=0)){switch(t.beginPath(),f){// Default includes circle -default:n?t.ellipse(i,r,n/2,g,0,0,td):t.arc(i,r,g,0,td),t.closePath();break;case"triangle":h=n?n/2:g,t.moveTo(i+Math.sin(m)*h,r-Math.cos(m)*g),m+=ty,t.lineTo(i+Math.sin(m)*h,r-Math.cos(m)*g),m+=ty,t.lineTo(i+Math.sin(m)*h,r-Math.cos(m)*g),t.closePath();break;case"rectRounded":// NOTE: the rounded rect implementation changed to use `arc` instead of +e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function er(t,e,i,n){// eslint-disable-next-line @typescript-eslint/no-use-before-define +eo(t,e,i,n,null)}// eslint-disable-next-line complexity +function eo(t,e,i,n,r){let o,a,s,l,c,h,u,d;let f=e.pointStyle,p=e.rotation,g=e.radius,m=(p||0)*tg;if(f&&"object"==typeof f&&("[object HTMLImageElement]"===(o=f.toString())||"[object HTMLCanvasElement]"===o)){t.save(),t.translate(i,n),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),t.restore();return}if(!isNaN(g)&&!(g<=0)){switch(t.beginPath(),f){// Default includes circle +default:r?t.ellipse(i,n,r/2,g,0,0,td):t.arc(i,n,g,0,td),t.closePath();break;case"triangle":h=r?r/2:g,t.moveTo(i+Math.sin(m)*h,n-Math.cos(m)*g),m+=ty,t.lineTo(i+Math.sin(m)*h,n-Math.cos(m)*g),m+=ty,t.lineTo(i+Math.sin(m)*h,n-Math.cos(m)*g),t.closePath();break;case"rectRounded":// NOTE: the rounded rect implementation changed to use `arc` instead of // `quadraticCurveTo` since it generates better results when rect is // almost a circle. 0.516 (instead of 0.5) produces results with visually // closer proportion to the previous impl and it is inscribed in the // circle with `radius`. For more details, see the following PRs: // https://github.com/chartjs/Chart.js/issues/5597 // https://github.com/chartjs/Chart.js/issues/5858 -c=.516*g,a=Math.cos(m+tb)*(l=g-c),u=Math.cos(m+tb)*(n?n/2-c:l),s=Math.sin(m+tb)*l,d=Math.sin(m+tb)*(n?n/2-c:l),t.arc(i-u,r-s,c,m-tu,m-tm),t.arc(i+d,r-a,c,m-tm,m),t.arc(i+u,r+s,c,m,m+tm),t.arc(i-d,r+a,c,m+tm,m+tu),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=n?n/2:l,t.rect(i-h,r-l,2*h,2*l);break}m+=tb;/* falls through */case"rectRot":u=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,d=Math.sin(m)*(n?n/2:g),t.moveTo(i-u,r-s),t.lineTo(i+d,r-a),t.lineTo(i+u,r+s),t.lineTo(i-d,r+a),t.closePath();break;case"crossRot":m+=tb;/* falls through */case"cross":u=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,d=Math.sin(m)*(n?n/2:g),t.moveTo(i-u,r-s),t.lineTo(i+u,r+s),t.moveTo(i+d,r-a),t.lineTo(i-d,r+a);break;case"star":u=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,d=Math.sin(m)*(n?n/2:g),t.moveTo(i-u,r-s),t.lineTo(i+u,r+s),t.moveTo(i+d,r-a),t.lineTo(i-d,r+a),m+=tb,u=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,d=Math.sin(m)*(n?n/2:g),t.moveTo(i-u,r-s),t.lineTo(i+u,r+s),t.moveTo(i+d,r-a),t.lineTo(i-d,r+a);break;case"line":a=n?n/2:Math.cos(m)*g,s=Math.sin(m)*g,t.moveTo(i-a,r-s),t.lineTo(i+a,r+s);break;case"dash":t.moveTo(i,r),t.lineTo(i+Math.cos(m)*(n?n/2:g),r+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}/** +c=.516*g,a=Math.cos(m+tb)*(l=g-c),u=Math.cos(m+tb)*(r?r/2-c:l),s=Math.sin(m+tb)*l,d=Math.sin(m+tb)*(r?r/2-c:l),t.arc(i-u,n-s,c,m-tu,m-tm),t.arc(i+d,n-a,c,m-tm,m),t.arc(i+u,n+s,c,m,m+tm),t.arc(i-d,n+a,c,m+tm,m+tu),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=r?r/2:l,t.rect(i-h,n-l,2*h,2*l);break}m+=tb;/* falls through */case"rectRot":u=Math.cos(m)*(r?r/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,d=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-s),t.lineTo(i+d,n-a),t.lineTo(i+u,n+s),t.lineTo(i-d,n+a),t.closePath();break;case"crossRot":m+=tb;/* falls through */case"cross":u=Math.cos(m)*(r?r/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,d=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-s),t.lineTo(i+u,n+s),t.moveTo(i+d,n-a),t.lineTo(i-d,n+a);break;case"star":u=Math.cos(m)*(r?r/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,d=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-s),t.lineTo(i+u,n+s),t.moveTo(i+d,n-a),t.lineTo(i-d,n+a),m+=tb,u=Math.cos(m)*(r?r/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,d=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-s),t.lineTo(i+u,n+s),t.moveTo(i+d,n-a),t.lineTo(i-d,n+a);break;case"line":a=r?r/2:Math.cos(m)*g,s=Math.sin(m)*g,t.moveTo(i-a,n-s),t.lineTo(i+a,n+s);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(m)*(r?r/2:g),n+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}/** * Returns true if the point is inside the rectangle * @param point - The point to test * @param area - The rectangle @@ -475,29 +475,29 @@ c=.516*g,a=Math.cos(m+tb)*(l=g-c),u=Math.cos(m+tb)*(n?n/2-c:l),s=Math.sin(m+tb)* * @private */function ea(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;for(t.save(),t.font=n.string,o.translation&&t.translate(o.translation[0],o.translation[1]),W(o.rotation)||t.rotate(o.rotation),o.color&&(t.fillStyle=o.color),o.textAlign&&(t.textAlign=o.textAlign),o.textBaseline&&(t.textBaseline=o.textBaseline),a=0;a0&&""!==o.strokeColor;for(t.save(),t.font=r.string,o.translation&&t.translate(o.translation[0],o.translation[1]),W(o.rotation)||t.rotate(o.rotation),o.color&&(t.fillStyle=o.color),o.textAlign&&(t.textAlign=o.textAlign),o.textBaseline&&(t.textBaseline=o.textBaseline),a=0;a+t||0;function em(t,e){let i={},r=U(e),n=r?Object.keys(e):e,o=U(t)?r?i=>Y(t[i],t[e[i]]):e=>t[e]:()=>t;for(let t of n)i[t]=eg(o(t));return i}/** + */function ed(t,e){let{x:i,y:n,w:r,h:o,radius:a}=e;// top left arc +t.arc(i+a.topLeft,n+a.topLeft,a.topLeft,1.5*tu,tu,!0),// line from top left to bottom left +t.lineTo(i,n+o-a.bottomLeft),// bottom left arc +t.arc(i+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,tu,tm,!0),// line from bottom left to bottom right +t.lineTo(i+r-a.bottomRight,n+o),// bottom right arc +t.arc(i+r-a.bottomRight,n+o-a.bottomRight,a.bottomRight,tm,0,!0),// line from bottom right to top right +t.lineTo(i+r,n+a.topRight),// top right arc +t.arc(i+r-a.topRight,n+a.topRight,a.topRight,0,-tm,!0),// line from top right to top left +t.lineTo(i+a.topLeft,n)}const ef=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ep=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/,eg=t=>+t||0;function em(t,e){let i={},n=U(e),r=n?Object.keys(e):e,o=U(t)?n?i=>Y(t[i],t[e[i]]):e=>t[e]:()=>t;for(let t of r)i[t]=eg(o(t));return i}/** * Converts the given value into a TRBL object. * @param value - If a number, set the value to all TRBL component, * else, if an object, use defined properties and sets undefined ones to 0. @@ -523,7 +523,7 @@ t.lineTo(i+a.topLeft,r)}const ef=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ep=/^(no * @param fallback - A object that contains fallback font options. * @return The font object. * @private - */function ex(t,e){t=t||{},e=e||et.font;let i=Y(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let r=Y(t.style,e.style);r&&!(""+r).match(ep)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);let n={family:Y(t.family,e.family),lineHeight:/** + */function ex(t,e){t=t||{},e=e||et.font;let i=Y(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=Y(t.style,e.style);n&&!(""+n).match(ep)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);let r={family:Y(t.family,e.family),lineHeight:/** * @alias Chart.helpers.options * @namespace *//** @@ -533,7 +533,7 @@ t.lineTo(i+a.topLeft,r)}const ef=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ep=/^(no * @returns The effective line height in pixels (size * 1.2 if value is invalid). * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height * @since 2.7.0 - */function(t,e){let i=(""+t).match(ef);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}(Y(t.lineHeight,e.lineHeight),i),size:i,style:r,weight:Y(t.weight,e.weight),string:""};return n.string=!n||W(n.size)||W(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family,n}/** + */function(t,e){let i=(""+t).match(ef);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}(Y(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:Y(t.weight,e.weight),string:""};return r.string=!r||W(r.size)||W(r.family)?null:(r.style?r.style+" ":"")+(r.weight?r.weight+" ":"")+r.size+"px "+r.family,r}/** * Evaluates the given `inputs` sequentially and returns the first defined value. * @param inputs - An array of values, falling back to the last value. * @param context - If defined and the current value is a function, the value @@ -543,7 +543,7 @@ t.lineTo(i+a.topLeft,r)}const ef=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ep=/^(no * @param info - object to return information about resolution in * @param info.cacheable - Will be set to `false` if option is not cacheable. * @since 2.7.0 - */function e_(t,e,i,r){let n,o,a,s=!0;for(n=0,o=t.length;nt[0]){let o=i||t;void 0===r&&(r=eR("_fallback",t));let a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:r,_getTarget:n,override:i=>eS([i,...t],e,o,r)};return new Proxy(a,{/** + */function eS(t,e=[""],i,n,r=()=>t[0]){let o=i||t;void 0===n&&(n=eR("_fallback",t));let a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:n,_getTarget:r,override:i=>eS([i,...t],e,o,n)};return new Proxy(a,{/** * A trap for the delete operator. */deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),/** * A trap for getting property values. - */get:(i,r)=>eE(i,r,()=>(function(t,e,i,r){let n;for(let o of e)if(void 0!==(n=eR(ek(o,t),i)))return eP(t,n)?eD(i,r,t,n):n})(r,e,t,i)),/** + */get:(i,n)=>eE(i,n,()=>(function(t,e,i,n){let r;for(let o of e)if(void 0!==(r=eR(ek(o,t),i)))return eP(t,r)?eD(i,n,t,r):r})(n,e,t,i)),/** * A trap for Object.getOwnPropertyDescriptor. * Also used by Object.hasOwnProperty. */getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),/** @@ -567,19 +567,19 @@ t.lineTo(i+a.topLeft,r)}const ef=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ep=/^(no * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols. */ownKeys:t=>eC(t),/** * A trap for setting property values. - */set(t,e,i){let r=t._storage||(t._storage=n());return t[e]=r[e]=i,delete t._keys,!0}})}/** + */set(t,e,i){let n=t._storage||(t._storage=r());return t[e]=n[e]=i,delete t._keys,!0}})}/** * Returns an Proxy for resolving option values with context. * @param proxy - The Proxy returned by `_createResolver` * @param context - Context object for scriptable/indexable options * @param subProxy - The proxy provided for scriptable options * @param descriptorDefaults - Defaults for descriptors * @private - */function eO(t,e,i,r){let n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:eM(t,r),setContext:e=>eO(t,e,i,r),override:n=>eO(t.override(n),e,i,r)};return new Proxy(n,{/** + */function eO(t,e,i,n){let r={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:eM(t,n),setContext:e=>eO(t,e,i,n),override:r=>eO(t.override(r),e,i,n)};return new Proxy(r,{/** * A trap for the delete operator. */deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),/** * A trap for getting property values. - */get:(t,e,i)=>eE(t,e,()=>(function(t,e,i){let{_proxy:r,_context:n,_subProxy:o,_descriptors:a}=t,s=r[e];return tc(s)&&a.isScriptable(e)&&(s=function(t,e,i,r){let{_proxy:n,_context:o,_subProxy:a,_stack:s}=i;if(s.has(t))throw Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t);let l=e(o,a||r);return s.delete(t),eP(t,l)&&(l=eD(n._scopes,n,t,l)),l}(e,s,t,i)),H(s)&&s.length&&(s=function(t,e,i,r){let{_proxy:n,_context:o,_subProxy:a,_descriptors:s}=i;if(void 0!==o.index&&r(t))return e[o.index%e.length];if(U(e[0])){// Array of objects, return array or resolvers - let i=e,r=n._scopes.filter(t=>t!==i);for(let l of(e=[],i)){let i=eD(r,n,t,l);e.push(eO(i,o,a&&a[t],s))}}return e}(e,s,t,a.isIndexable)),eP(e,s)&&(s=eO(s,n,o&&o[e],a)),s})(t,e,i)),/** + */get:(t,e,i)=>eE(t,e,()=>(function(t,e,i){let{_proxy:n,_context:r,_subProxy:o,_descriptors:a}=t,s=n[e];return tc(s)&&a.isScriptable(e)&&(s=function(t,e,i,n){let{_proxy:r,_context:o,_subProxy:a,_stack:s}=i;if(s.has(t))throw Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t);let l=e(o,a||n);return s.delete(t),eP(t,l)&&(l=eD(r._scopes,r,t,l)),l}(e,s,t,i)),H(s)&&s.length&&(s=function(t,e,i,n){let{_proxy:r,_context:o,_subProxy:a,_descriptors:s}=i;if(void 0!==o.index&&n(t))return e[o.index%e.length];if(U(e[0])){// Array of objects, return array or resolvers + let i=e,n=r._scopes.filter(t=>t!==i);for(let l of(e=[],i)){let i=eD(n,r,t,l);e.push(eO(i,o,a&&a[t],s))}}return e}(e,s,t,a.isIndexable)),eP(e,s)&&(s=eO(s,r,o&&o[e],a)),s})(t,e,i)),/** * A trap for Object.getOwnPropertyDescriptor. * Also used by Object.hasOwnProperty. */getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),/** @@ -590,12 +590,12 @@ t.lineTo(i+a.topLeft,r)}const ef=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ep=/^(no * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols. */ownKeys:()=>Reflect.ownKeys(t),/** * A trap for setting property values. - */set:(e,i,r)=>(t[i]=r,delete e[i],!0)})}/** + */set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}/** * @private - */function eM(t,e={scriptable:!0,indexable:!0}){let{_scriptable:i=e.scriptable,_indexable:r=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:r,isScriptable:tc(i)?i:()=>i,isIndexable:tc(r)?r:()=>r}}const ek=(t,e)=>t?t+ts(e):e,eP=(t,e)=>U(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function eE(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];let r=i();return(// cache the resolved value -t[e]=r,r)}const eA=(t,e)=>!0===t?e:"string"==typeof t?ta(e,t):void 0;function eD(t,e,i,r){var n;let o=e._rootScopes,a=tc(n=e._fallback)?n(i,r):n,s=[...t,...o],l=new Set;l.add(r);let c=eT(l,s,i,a||i,r);return null!==c&&(void 0===a||a===i||null!==(c=eT(l,s,a,c,r)))&&eS(Array.from(l),[""],o,a,()=>(function(t,e,i){let r=t._getTarget();e in r||(r[e]={});let n=r[e];return H(n)&&U(i)?i:n||{}})(e,i,r))}function eT(t,e,i,r,n){for(;i;)i=function(t,e,i,r,n){for(let a of e){let e=eA(i,a);if(e){var o;t.add(e);let a=tc(o=e._fallback)?o(i,n):o;if(void 0!==a&&a!==i&&a!==r)// The fallback will resume to that new scope. -return a}else if(!1===e&&void 0!==r&&i!==r)// For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations` -return null}return!1}(t,e,i,r,n);return i}function eR(t,e){for(let i of e){if(!i)continue;let e=i[t];if(void 0!==e)return e}}function eC(t){let e=t._keys;return e||(e=t._keys=function(t){let e=new Set;for(let i of t)for(let t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function ej(t,e,i,r){let n,o,a;let{iScale:s}=t,{key:l="r"}=this._parsing,c=Array(r);for(n=0;ne"x"===t?"y":"x";function eN(t,e,i){return Math.max(Math.min(t,i),e)}/** + */function eM(t,e={scriptable:!0,indexable:!0}){let{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:i,indexable:n,isScriptable:tc(i)?i:()=>i,isIndexable:tc(n)?n:()=>n}}const ek=(t,e)=>t?t+ts(e):e,eP=(t,e)=>U(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function eE(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];let n=i();return(// cache the resolved value +t[e]=n,n)}const eA=(t,e)=>!0===t?e:"string"==typeof t?ta(e,t):void 0;function eD(t,e,i,n){var r;let o=e._rootScopes,a=tc(r=e._fallback)?r(i,n):r,s=[...t,...o],l=new Set;l.add(n);let c=eT(l,s,i,a||i,n);return null!==c&&(void 0===a||a===i||null!==(c=eT(l,s,a,c,n)))&&eS(Array.from(l),[""],o,a,()=>(function(t,e,i){let n=t._getTarget();e in n||(n[e]={});let r=n[e];return H(r)&&U(i)?i:r||{}})(e,i,n))}function eT(t,e,i,n,r){for(;i;)i=function(t,e,i,n,r){for(let a of e){let e=eA(i,a);if(e){var o;t.add(e);let a=tc(o=e._fallback)?o(i,r):o;if(void 0!==a&&a!==i&&a!==n)// The fallback will resume to that new scope. +return a}else if(!1===e&&void 0!==n&&i!==n)// For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations` +return null}return!1}(t,e,i,n,r);return i}function eR(t,e){for(let i of e){if(!i)continue;let e=i[t];if(void 0!==e)return e}}function eC(t){let e=t._keys;return e||(e=t._keys=function(t){let e=new Set;for(let i of t)for(let t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function ej(t,e,i,n){let r,o,a;let{iScale:s}=t,{key:l="r"}=this._parsing,c=Array(n);for(r=0;re"x"===t?"y":"x";function eN(t,e,i){return Math.max(Math.min(t,i),e)}/** * Note: typedefs are auto-exported, so use a made-up `dom` namespace where * necessary to avoid duplicates with `export * from './helpers`; see * https://github.com/microsoft/TypeScript/issues/46011 @@ -608,21 +608,21 @@ return null}return!1}(t,e,i,r,n);return i}function eR(t,e){for(let i of e){if(!i */function eB(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}/** * convert max-width/max-height values that may be percentages into a number * @private - */function eV(t,e,i){let r;return"string"==typeof t?(r=parseInt(t,10),-1!==t.indexOf("%")&&(r=r/100*e.parentNode[i])):r=t,r}const eW=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),eH=["top","right","bottom","left"];function eU(t,e,i){let r={};i=i?"-"+i:"";for(let n=0;n<4;n++){let o=eH[n];r[o]=parseFloat(t[e+"-"+o+i])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const e$=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);/** + */function eV(t,e,i){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}const eW=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),eH=["top","right","bottom","left"];function eU(t,e,i){let n={};i=i?"-"+i:"";for(let r=0;r<4;r++){let o=eH[r];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const e$=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);/** * Gets an event's x, y coordinates, relative to the chart area * @param event * @param chart * @returns x and y coordinates of the event - */function eq(t,e){if("native"in t)return t;let{canvas:i,currentDevicePixelRatio:r}=e,n=eW(i),o="border-box"===n.boxSizing,a=eU(n,"padding"),s=eU(n,"border","width"),{x:l,y:c,box:h}=/** + */function eq(t,e){if("native"in t)return t;let{canvas:i,currentDevicePixelRatio:n}=e,r=eW(i),o="border-box"===r.boxSizing,a=eU(r,"padding"),s=eU(r,"border","width"),{x:l,y:c,box:h}=/** * @param e * @param canvas * @returns Canvas position - */function(t,e){let i,r;let n=t.touches,o=n&&n.length?n[0]:t,{offsetX:a,offsetY:s}=o,l=!1;if(e$(a,s,t.target))i=a,r=s;else{let t=e.getBoundingClientRect();i=o.clientX-t.left,r=o.clientY-t.top,l=!0}return{x:i,y:r,box:l}}(t,i),u=a.left+(h&&s.left),d=a.top+(h&&s.top),{width:f,height:p}=e;return o&&(f-=a.width+s.width,p-=a.height+s.height),{x:Math.round((l-u)/f*i.width/r),y:Math.round((c-d)/p*i.height/r)}}const eY=t=>Math.round(10*t)/10;/** + */function(t,e){let i,n;let r=t.touches,o=r&&r.length?r[0]:t,{offsetX:a,offsetY:s}=o,l=!1;if(e$(a,s,t.target))i=a,n=s;else{let t=e.getBoundingClientRect();i=o.clientX-t.left,n=o.clientY-t.top,l=!0}return{x:i,y:n,box:l}}(t,i),u=a.left+(h&&s.left),d=a.top+(h&&s.top),{width:f,height:p}=e;return o&&(f-=a.width+s.width,p-=a.height+s.height),{x:Math.round((l-u)/f*i.width/n),y:Math.round((c-d)/p*i.height/n)}}const eY=t=>Math.round(10*t)/10;/** * @param chart * @param forceRatio * @param forceStyle * @returns True if the canvas context size or transformation has changed. - */function eG(t,e,i){let r=e||1,n=Math.floor(t.height*r),o=Math.floor(t.width*r);t.height=Math.floor(t.height),t.width=Math.floor(t.width);let a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==r||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=r,a.height=n,a.width=o,t.ctx.setTransform(r,0,0,r,0,0),!0)}/** + */function eG(t,e,i){let n=e||1,r=Math.floor(t.height*n),o=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);let a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||a.height!==r||a.width!==o)&&(t.currentDevicePixelRatio=n,a.height=r,a.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}/** * Detects support for options object argument in addEventListener. * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support * @private @@ -635,13 +635,13 @@ return null}return!1}(t,e,i,r,n);return i}function eR(t,e){for(let i of e){if(!i * for example because of `display: none` on a parent node. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value * @returns Size in pixels or undefined if unknown. - */function eZ(t,e){let i=eW(t).getPropertyValue(e),r=i&&i.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}/** + */function eZ(t,e){let i=eW(t).getPropertyValue(e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}/** * @private - */function eJ(t,e,i,r){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}/** + */function eJ(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}/** * @private - */function eK(t,e,i,r){return{x:t.x+i*(e.x-t.x),y:"middle"===r?i<.5?t.y:e.y:"after"===r?i<1?t.y:e.y:i>0?e.y:t.y}}/** + */function eK(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}/** * @private - */function eQ(t,e,i,r){let n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=eJ(t,n,i),s=eJ(n,o,i),l=eJ(o,e,i),c=eJ(a,s,i),h=eJ(s,l,i);return eJ(c,h,i)}function e0(t,e,i){var r;return t?(r=i,{x:t=>e+e+r-t,setWidth(t){r=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function e1(t,e){let i,r;("ltr"===e||"rtl"===e)&&(r=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=r)}function e2(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function e5(t){return"angle"===t?{between:tT,compare:tA,normalize:tD}:{between:tC,compare:(t,e)=>t-e,normalize:t=>t}}function e3({start:t,end:e,count:i,loop:r,style:n}){return{start:t%i,end:e%i,loop:r&&(e-t+1)%i==0,style:n}}function e8(t,e,i){let r,n,o;if(!i)return[t];let{property:a,start:s,end:l}=i,c=e.length,{compare:h,between:u,normalize:d}=e5(a),{start:f,end:p,loop:g,style:m}=function(t,e,i){let r;let{property:n,start:o,end:a}=i,{between:s,normalize:l}=e5(n),c=e.length,{start:h,end:u,loop:d}=t;if(d){for(h+=c,u+=c,r=0;ru(s,o,r)&&0!==h(s,o),_=()=>0===h(l,r)||u(l,o,r),w=()=>y||x(),S=()=>!y||_();for(let t=f,i=f;t<=p;++t)(n=e[t%c]).skip||(r=d(n[a]))===o||(y=u(r,s,l),null===v&&w()&&(v=0===h(r,s)?t:i),null!==v&&S()&&(b.push(e3({start:v,end:t,loop:g,count:c,style:m})),v=null),i=t,o=r);return null!==v&&b.push(e3({start:v,end:p,loop:g,count:c,style:m})),b}function e6(t,e){let i=[],r=t.segments;for(let n=0;nr({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=tB.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{let n;if(!i.running||!i.items.length)return;let o=i.items,a=o.length-1,s=!1;for(;a>=0;--a)(n=o[a])._active?(n._total>i.duration&&(i.duration=n._total),n.tick(t),s=!0):(o[a]=o[o.length-1],o.pop());s&&(r.draw(),this._notify(r,i,t,"progress")),o.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!!e&&!!e.running&&!!e.items.length}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}};const it="transparent",ie={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){let r=tK(t||it),n=r.valid&&tK(e||it);return n&&n.valid?n.mix(r,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class ii{active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let r=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=e_([t.to,e,r,t.from]),this._from=e_([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e;let i=t-this._start,r=this._duration,n=this._prop,o=this._from,a=this._loop,s=this._to;if(this._active=o!==s&&(a||i1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[n]=this._fn(o,s,e)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let t=0;t{let n=t[r];if(!U(n))return;let o={};for(let t of e)o[t]=n[t];(H(n.properties)&&n.properties||[r]).forEach(t=>{t!==r&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){let i=e.options,r=function(t,e){if(!e)return;let i=t.options;if(!i){t.options=e;return}return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}(t,i);if(!r)return[];let n=this._createAnimations(r,i);return i.$shared&&(function(t,e){let i=[],r=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),n}_createAnimations(t,e){let i;let r=this._properties,n=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),s=Date.now();for(i=a.length-1;i>=0;--i){let l=a[i];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}let c=e[l],h=o[l],u=r.get(l);if(h){if(u&&h.active()){h.update(u,c,s);continue}h.cancel()}if(!u||!u.duration){t[l]=c;continue}o[l]=h=new ii(u,t,l,c),n.push(h)}return n}update(t,e){if(0===this._properties.size){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return e9.add(this._chart,i),!0}constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}}function io(t,e){let i=t&&t.options||{},r=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:r?o:n,end:r?n:o}}function ia(t,e){let i,r;let n=[],o=t._getSortedDatasetMetas(e);for(i=0,r=o.length;i0||!i&&e<0)return n.index}return null}function ih(t,e){let i;let{chart:r,_cachedMeta:n}=t,o=r._stacks||(r._stacks={}),{iScale:a,vScale:s,index:l}=n,c=a.axis,h=s.axis,u=`${a.id}.${s.id}.${n.stack||n.type}`,d=e.length;for(let t=0;ti[t].axis===e).shift()}function id(t,e){let i=t.controller.index,r=t.vScale&&t.vScale.axis;if(r)for(let n of e=e||t._parsed){let t=n._stacks;if(!t||void 0===t[r]||void 0===t[r][i])return;delete t[r][i],void 0!==t[r]._visualValues&&void 0!==t[r]._visualValues[i]&&delete t[r]._visualValues[i]}}const ip=t=>"reset"===t||"none"===t,ig=(t,e)=>e?t:Object.assign({},t),im=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:ia(i,!0),values:null};class ib{initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=il(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&id(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(t,e,i,r)=>"x"===t?e:"r"===t?r:i,n=e.xAxisID=Y(i.xAxisID,iu(t,"x")),o=e.yAxisID=Y(i.yAxisID,iu(t,"y")),a=e.rAxisID=Y(i.rAxisID,iu(t,"r")),s=e.indexAxis,l=e.iAxisID=r(s,n,o,a),c=e.vAxisID=r(s,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&tN(this._data,this),t._stacked&&id(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(U(e))this._data=function(t){let e,i,r;let n=Object.keys(t),o=Array(n.length);for(e=0,i=n.length;e{let i="_onData"+ts(e),r=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){let n=r.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),n}})})}(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),r=!1;this._dataCheck();let n=e._stacked;e._stacked=il(e.vScale,e),e.stack!==i.stack&&(r=!0,id(e),e.stack=i.stack),this._resyncElements(t),(r||n!==e._stacked)&&ih(this,e._parsed)}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let i,r,n;let{_cachedMeta:o,_data:a}=this,{iScale:s,_stacked:l}=o,c=s.axis,h=0===t&&e===a.length||o._sorted,u=t>0&&o._parsed[t-1];if(!1===this._parsing)o._parsed=a,o._sorted=!0,n=a;else{n=H(a[t])?this.parseArrayData(o,a,t,e):U(a[t])?this.parseObjectData(o,a,t,e):this.parsePrimitiveData(o,a,t,e);let s=()=>null===r[c]||u&&r[c]e||d=0;--i)if(!f()){this.updateRangeFromParsed(h,t,r,c);break}}return h}getAllParsedValues(t){let e,i,r;let n=this._cachedMeta._parsed,o=[];for(e=0,i=n.length;e=0&&tthis.getContext(i,r,e),h);return f.$shared&&(f.$shared=s,n[o]=Object.freeze(ig(f,s))),f}_resolveAnimations(t,e,i){let r;let n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,s=o[a];if(s)return s;if(!1!==n.options.animation){let n=this.chart.config,o=n.datasetAnimationScopeKeys(this._type,e),a=n.getOptionScopes(this.getDataset(),o);r=n.createResolver(a,this.getContext(t,i,e))}let l=new ir(n,r&&r.animations);return r&&r._cacheable&&(o[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ip(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==r;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,r){ip(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!ip(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;let n=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];let r=i.length,n=e.length,o=Math.min(n,r);o&&this.parse(0,o),n>r?this._insertElements(r,n-r,t):n{for(t.length+=e,r=t.length-1;r>=a;r--)t[r]=t[r-e]};for(s(o),r=t;rMath.abs(s)&&(l=s,c=a),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:n,end:o,min:a,max:s}}(t,e,i,r):e[i.axis]=i.parse(t,r),e}function iv(t,e,i,r){let n,o,a,s;let l=t.iScale,c=t.vScale,h=l.getLabels(),u=l===c,d=[];for(n=i,o=i+r;nt.x,o="left",a="right"):(n=t.baset.controller.options.grouped),n=i.options.stacked,o=[],a=t=>{let i=t.controller.getParsed(e),r=i&&i[t.vScale.axis];if(W(r)||isNaN(r))return!0};for(let i of r)if(!(void 0!==e&&a(i))&&((!1===n||-1===o.indexOf(i.stack)||void 0===n&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){let r=this._getStacks(t,i),n=void 0!==e?r.indexOf(e):-1;return -1===n?r.length-1:n}_getRuler(){let t,e;let i=this.options,r=this._cachedMeta,n=r.iScale,o=[];for(t=0,e=r.data.length;tt-e))}return t._cache.$bar}(o,t.type),s=o._length,l=()=>{32767!==r&&-32768!==r&&(tl(n)&&(s=Math.min(s,Math.abs(r-n)||s)),n=r)};for(e=0,i=a.length;e=l?1:-1))*s,d===l&&(m-=i/2);let t=r.getPixelForDecimal(0),a=r.getPixelForDecimal(1);e=(m=Math.max(Math.min(m,Math.max(t,a)),Math.min(t,a)))+i,n&&!u&&(c._stacks[r.axis]._visualValues[o]=r.getValueForPixel(e)-r.getValueForPixel(m))}if(m===r.getPixelForValue(l)){let t=tx(i)*r.getLineWidthForValue(l)/2;m+=t,i-=t}return{size:i,base:m,head:e,center:e+i/2}}_calculateBarIndexPixels(t,e){let i,r;let n=e.scale,o=this.options,a=o.skipNull,s=Y(o.maxBarThickness,1/0);if(e.grouped){let n=a?this._getStackCount(t):e.stackCount,l="flex"===o.barThickness?function(t,e,i,r){let n=e.pixels,o=n[t],a=t>0?n[t-1]:null,s=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:n}=e,o=this.getParsed(t),a=r.getLabelForValue(o.x),s=n.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+a+", "+s+(l?", "+l:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){let n="reset"===r,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:s,includeOptions:l}=this._getSharedOptions(e,r),c=o.axis,h=a.axis;for(let u=e;u+i[t];if(U(i[t])){let{key:t="value"}=this._parsing;a=e=>+ta(i[e],t)}for(n=t,o=t+e;ntT(e,t,s,!0)?1:Math.max(r,r*i,n,n*i),f=(e,r,n)=>tT(e,t,s,!0)?-1:Math.min(r,r*i,n,n*i),p=d(0,l,h),g=d(tm,c,u),m=f(tu,l,h),b=f(tu+tm,c,u);r=(p-m)/2,n=(g-b)/2,o=-(p+m)/2,a=-(g+b)/2}return{ratioX:r,ratioY:n,offsetX:o,offsetY:a}}(h,c,s),g=(i.width-o)/u,m=(i.height-o)/d,b=X(this.options.radius,Math.max(Math.min(g,m)/2,0)),y=Math.max(b*s,0),v=(b-y)/this._getVisibleDatasetWeightTotal();this.offsetX=f*b,this.offsetY=p*b,r.total=this.calculateTotal(),this.outerRadius=b-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){let i=this.options,r=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===r._parsed[t]||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*n/td)}updateElements(t,e,i,r){let n;let o="reset"===r,a=this.chart,s=a.chartArea,l=a.options,c=l.animation,h=(s.left+s.right)/2,u=(s.top+s.bottom)/2,d=o&&c.animateScale,f=d?0:this.innerRadius,p=d?0:this.outerRadius,{sharedOptions:g,includeOptions:m}=this._getSharedOptions(e,r),b=this._getRotation();for(n=0;n0&&!isNaN(t)?td*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,r=i.data.labels||[],n=t5(e._parsed[t],i.options.locale);return{label:r[t]||"",value:n}}getMaxBorderWidth(t){let e,i,r,n,o,a=0,s=this.chart;if(!t){for(e=0,i=s.data.datasets.length;e"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),h(iM,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((e,n)=>{let o=t.getDatasetMeta(0),a=o.controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ik extends ib{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:r=[],_dataset:n}=e,o=this.chart._animationsDisabled,{start:a,count:s}=t$(e,r,o);this._drawStart=a,this._drawCount=s,tq(e)&&(a=0,s=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=r;let l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(r,a,s,t)}updateElements(t,e,i,r){let n="reset"===r,{iScale:o,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(e,r),u=o.axis,d=a.axis,{spanGaps:f,segment:p}=this.options,g=tS(f)?f:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||n||"none"===r,b=e+i,y=t.length,v=e>0&&this.getParsed(e-1);for(let i=0;i=b){y.skip=!0;continue}let x=this.getParsed(i),_=W(x[d]),w=y[u]=o.getPixelForValue(x[u],i),S=y[d]=n||_?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,x,s):x[d],i);y.skip=isNaN(w)||isNaN(S)||_,y.stop=i>0&&Math.abs(x[u]-v[u])>g,p&&(y.parsed=x,y.raw=l.data[i]),h&&(y.options=c||this.resolveDataElementOptions(i,f.active?"active":r)),m||this.updateElement(f,i,y,r),v=x}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;let n=r[0].size(this.resolveDataElementOptions(0)),o=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,n,o)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}h(ik,"id","line"),h(ik,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),h(ik,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class iP extends ib{getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,r=i.data.labels||[],n=t5(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:n}}parseObjectData(t,e,i,r){return ej.bind(this)(t,e,i,r)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{let r=this.getParsed(i).r;!isNaN(r)&&this.chart.getDataVisibility(i)&&(re.max&&(e.max=r))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(r/2,0),o=Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0),a=(n-o)/t.getVisibleDatasetCount();this.outerRadius=n-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,r){let n;let o="reset"===r,a=this.chart,s=a.options,l=s.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,d=c.getIndexAngle(0)-.5*tu,f=d,p=360/this.countVisibleElements();for(n=0;n{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?tM(this.resolveDataElementOptions(t,e).angle||i):0}constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}}h(iP,"id","polarArea"),h(iP,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),h(iP,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((e,n)=>{let o=t.getDatasetMeta(0),a=o.controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class iE extends iM{}h(iE,"id","pie"),h(iE,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class iA extends ib{getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return ej.bind(this)(t,e,i,r)}update(t){let e=this._cachedMeta,i=e.dataset,r=e.data||[],n=e.iScale.getLabels();if(i.points=r,"resize"!==t){let e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);let o={_loop:!0,_fullLoop:n.length===r.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){let n=this._cachedMeta.rScale,o="reset"===r;for(let a=e;a0&&this.getParsed(e-1);for(let c=e;c0&&Math.abs(i[d]-y[d])>m,g&&(p.parsed=i,p.raw=l.data[c]),u&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":r)),b||this.updateElement(e,c,p,r),y=i}this.updateSharedOptions(h,r,c)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}let i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;let n=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,n,o)/2}}h(iD,"id","scatter"),h(iD,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),h(iD,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var iT=/*#__PURE__*/Object.freeze({__proto__:null,BarController:iS,BubbleController:iO,DoughnutController:iM,LineController:ik,PieController:iE,PolarAreaController:iP,RadarController:iA,ScatterController:iD});/** + */function eQ(t,e,i,n){let r={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=eJ(t,r,i),s=eJ(r,o,i),l=eJ(o,e,i),c=eJ(a,s,i),h=eJ(s,l,i);return eJ(c,h,i)}function e0(t,e,i){var n;return t?(n=i,{x:t=>e+e+n-t,setWidth(t){n=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function e1(t,e){let i,n;("ltr"===e||"rtl"===e)&&(n=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function e2(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function e5(t){return"angle"===t?{between:tT,compare:tA,normalize:tD}:{between:tC,compare:(t,e)=>t-e,normalize:t=>t}}function e3({start:t,end:e,count:i,loop:n,style:r}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:r}}function e8(t,e,i){let n,r,o;if(!i)return[t];let{property:a,start:s,end:l}=i,c=e.length,{compare:h,between:u,normalize:d}=e5(a),{start:f,end:p,loop:g,style:m}=function(t,e,i){let n;let{property:r,start:o,end:a}=i,{between:s,normalize:l}=e5(r),c=e.length,{start:h,end:u,loop:d}=t;if(d){for(h+=c,u+=c,n=0;nu(s,o,n)&&0!==h(s,o),_=()=>0===h(l,n)||u(l,o,n),w=()=>y||x(),S=()=>!y||_();for(let t=f,i=f;t<=p;++t)(r=e[t%c]).skip||(n=d(r[a]))===o||(y=u(n,s,l),null===v&&w()&&(v=0===h(n,s)?t:i),null!==v&&S()&&(b.push(e3({start:v,end:t,loop:g,count:c,style:m})),v=null),i=t,o=n);return null!==v&&b.push(e3({start:v,end:p,loop:g,count:c,style:m})),b}function e6(t,e){let i=[],n=t.segments;for(let r=0;rn({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=tB.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{let r;if(!i.running||!i.items.length)return;let o=i.items,a=o.length-1,s=!1;for(;a>=0;--a)(r=o[a])._active?(r._total>i.duration&&(i.duration=r._total),r.tick(t),s=!0):(o[a]=o[o.length-1],o.pop());s&&(n.draw(),this._notify(n,i,t,"progress")),o.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!!e&&!!e.running&&!!e.items.length}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}};const it="transparent",ie={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){let n=tK(t||it),r=n.valid&&tK(e||it);return r&&r.valid?r.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class ii{active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let n=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=e_([t.to,e,n,t.from]),this._from=e_([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e;let i=t-this._start,n=this._duration,r=this._prop,o=this._from,a=this._loop,s=this._to;if(this._active=o!==s&&(a||i1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[r]=this._fn(o,s,e)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let t=0;t{let r=t[n];if(!U(r))return;let o={};for(let t of e)o[t]=r[t];(H(r.properties)&&r.properties||[n]).forEach(t=>{t!==n&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){let i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i){t.options=e;return}return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}(t,i);if(!n)return[];let r=this._createAnimations(n,i);return i.$shared&&(function(t,e){let i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),r}_createAnimations(t,e){let i;let n=this._properties,r=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),s=Date.now();for(i=a.length-1;i>=0;--i){let l=a[i];if("$"===l.charAt(0))continue;if("options"===l){r.push(...this._animateOptions(t,e));continue}let c=e[l],h=o[l],u=n.get(l);if(h){if(u&&h.active()){h.update(u,c,s);continue}h.cancel()}if(!u||!u.duration){t[l]=c;continue}o[l]=h=new ii(u,t,l,c),r.push(h)}return r}update(t,e){if(0===this._properties.size){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return e7.add(this._chart,i),!0}constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}}function io(t,e){let i=t&&t.options||{},n=i.reverse,r=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:r,end:n?r:o}}function ia(t,e){let i,n;let r=[],o=t._getSortedDatasetMetas(e);for(i=0,n=o.length;i0||!i&&e<0)return r.index}return null}function ih(t,e){let i;let{chart:n,_cachedMeta:r}=t,o=n._stacks||(n._stacks={}),{iScale:a,vScale:s,index:l}=r,c=a.axis,h=s.axis,u=`${a.id}.${s.id}.${r.stack||r.type}`,d=e.length;for(let t=0;ti[t].axis===e).shift()}function id(t,e){let i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n)for(let r of e=e||t._parsed){let t=r._stacks;if(!t||void 0===t[n]||void 0===t[n][i])return;delete t[n][i],void 0!==t[n]._visualValues&&void 0!==t[n]._visualValues[i]&&delete t[n]._visualValues[i]}}const ip=t=>"reset"===t||"none"===t,ig=(t,e)=>e?t:Object.assign({},t),im=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:ia(i,!0),values:null};class ib{initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=il(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&id(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,r=e.xAxisID=Y(i.xAxisID,iu(t,"x")),o=e.yAxisID=Y(i.yAxisID,iu(t,"y")),a=e.rAxisID=Y(i.rAxisID,iu(t,"r")),s=e.indexAxis,l=e.iAxisID=n(s,r,o,a),c=e.vAxisID=n(s,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&tN(this._data,this),t._stacked&&id(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(U(e))this._data=function(t){let e,i,n;let r=Object.keys(t),o=Array(r.length);for(e=0,i=r.length;e{let i="_onData"+ts(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){let r=n.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),r}})})}(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),n=!1;this._dataCheck();let r=e._stacked;e._stacked=il(e.vScale,e),e.stack!==i.stack&&(n=!0,id(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&ih(this,e._parsed)}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let i,n,r;let{_cachedMeta:o,_data:a}=this,{iScale:s,_stacked:l}=o,c=s.axis,h=0===t&&e===a.length||o._sorted,u=t>0&&o._parsed[t-1];if(!1===this._parsing)o._parsed=a,o._sorted=!0,r=a;else{r=H(a[t])?this.parseArrayData(o,a,t,e):U(a[t])?this.parseObjectData(o,a,t,e):this.parsePrimitiveData(o,a,t,e);let s=()=>null===n[c]||u&&n[c]e||d=0;--i)if(!f()){this.updateRangeFromParsed(h,t,n,c);break}}return h}getAllParsedValues(t){let e,i,n;let r=this._cachedMeta._parsed,o=[];for(e=0,i=r.length;e=0&&tthis.getContext(i,n,e),h);return f.$shared&&(f.$shared=s,r[o]=Object.freeze(ig(f,s))),f}_resolveAnimations(t,e,i){let n;let r=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,s=o[a];if(s)return s;if(!1!==r.options.animation){let r=this.chart.config,o=r.datasetAnimationScopeKeys(this._type,e),a=r.getOptionScopes(this.getDataset(),o);n=r.createResolver(a,this.getContext(t,i,e))}let l=new ir(r,n&&n.animations);return n&&n._cacheable&&(o[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ip(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,n){ip(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ip(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;let r=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];let n=i.length,r=e.length,o=Math.min(r,n);o&&this.parse(0,o),r>n?this._insertElements(n,r-n,t):r{for(t.length+=e,n=t.length-1;n>=a;n--)t[n]=t[n-e]};for(s(o),n=t;nMath.abs(s)&&(l=s,c=a),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:r,end:o,min:a,max:s}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function iv(t,e,i,n){let r,o,a,s;let l=t.iScale,c=t.vScale,h=l.getLabels(),u=l===c,d=[];for(r=i,o=i+n;rt.x,o="left",a="right"):(r=t.baset.controller.options.grouped),r=i.options.stacked,o=[],a=t=>{let i=t.controller.getParsed(e),n=i&&i[t.vScale.axis];if(W(n)||isNaN(n))return!0};for(let i of n)if(!(void 0!==e&&a(i))&&((!1===r||-1===o.indexOf(i.stack)||void 0===r&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){let n=this._getStacks(t,i),r=void 0!==e?n.indexOf(e):-1;return -1===r?n.length-1:r}_getRuler(){let t,e;let i=this.options,n=this._cachedMeta,r=n.iScale,o=[];for(t=0,e=n.data.length;tt-e))}return t._cache.$bar}(o,t.type),s=o._length,l=()=>{32767!==n&&-32768!==n&&(tl(r)&&(s=Math.min(s,Math.abs(n-r)||s)),r=n)};for(e=0,i=a.length;e=l?1:-1))*s,d===l&&(m-=i/2);let t=n.getPixelForDecimal(0),a=n.getPixelForDecimal(1);e=(m=Math.max(Math.min(m,Math.max(t,a)),Math.min(t,a)))+i,r&&!u&&(c._stacks[n.axis]._visualValues[o]=n.getValueForPixel(e)-n.getValueForPixel(m))}if(m===n.getPixelForValue(l)){let t=tx(i)*n.getLineWidthForValue(l)/2;m+=t,i-=t}return{size:i,base:m,head:e,center:e+i/2}}_calculateBarIndexPixels(t,e){let i,n;let r=e.scale,o=this.options,a=o.skipNull,s=Y(o.maxBarThickness,1/0);if(e.grouped){let r=a?this._getStackCount(t):e.stackCount,l="flex"===o.barThickness?function(t,e,i,n){let r=e.pixels,o=r[t],a=t>0?r[t-1]:null,s=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:r}=e,o=this.getParsed(t),a=n.getLabelForValue(o.x),s=r.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+a+", "+s+(l?", "+l:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){let r="reset"===n,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:s,includeOptions:l}=this._getSharedOptions(e,n),c=o.axis,h=a.axis;for(let u=e;u+i[t];if(U(i[t])){let{key:t="value"}=this._parsing;a=e=>+ta(i[e],t)}for(r=t,o=t+e;rtT(e,t,s,!0)?1:Math.max(n,n*i,r,r*i),f=(e,n,r)=>tT(e,t,s,!0)?-1:Math.min(n,n*i,r,r*i),p=d(0,l,h),g=d(tm,c,u),m=f(tu,l,h),b=f(tu+tm,c,u);n=(p-m)/2,r=(g-b)/2,o=-(p+m)/2,a=-(g+b)/2}return{ratioX:n,ratioY:r,offsetX:o,offsetY:a}}(h,c,s),g=(i.width-o)/u,m=(i.height-o)/d,b=X(this.options.radius,Math.max(Math.min(g,m)/2,0)),y=Math.max(b*s,0),v=(b-y)/this._getVisibleDatasetWeightTotal();this.offsetX=f*b,this.offsetY=p*b,n.total=this.calculateTotal(),this.outerRadius=b-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*l,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){let i=this.options,n=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*r/td)}updateElements(t,e,i,n){let r;let o="reset"===n,a=this.chart,s=a.chartArea,l=a.options,c=l.animation,h=(s.left+s.right)/2,u=(s.top+s.bottom)/2,d=o&&c.animateScale,f=d?0:this.innerRadius,p=d?0:this.outerRadius,{sharedOptions:g,includeOptions:m}=this._getSharedOptions(e,n),b=this._getRotation();for(r=0;r0&&!isNaN(t)?td*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=t5(e._parsed[t],i.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){let e,i,n,r,o,a=0,s=this.chart;if(!t){for(e=0,i=s.data.datasets.length;e"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),h(iM,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map((e,r)=>{let o=t.getDatasetMeta(0),a=o.controller.getStyle(r);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:n,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ik extends ib{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:n=[],_dataset:r}=e,o=this.chart._animationsDisabled,{start:a,count:s}=t$(e,n,o);this._drawStart=a,this._drawCount=s,tq(e)&&(a=0,s=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=n;let l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(n,a,s,t)}updateElements(t,e,i,n){let r="reset"===n,{iScale:o,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(e,n),u=o.axis,d=a.axis,{spanGaps:f,segment:p}=this.options,g=tS(f)?f:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||r||"none"===n,b=e+i,y=t.length,v=e>0&&this.getParsed(e-1);for(let i=0;i=b){y.skip=!0;continue}let x=this.getParsed(i),_=W(x[d]),w=y[u]=o.getPixelForValue(x[u],i),S=y[d]=r||_?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,x,s):x[d],i);y.skip=isNaN(w)||isNaN(S)||_,y.stop=i>0&&Math.abs(x[u]-v[u])>g,p&&(y.parsed=x,y.raw=l.data[i]),h&&(y.options=c||this.resolveDataElementOptions(i,f.active?"active":n)),m||this.updateElement(f,i,y,n),v=x}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;let r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,o)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}h(ik,"id","line"),h(ik,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),h(ik,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class iP extends ib{getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=t5(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return ej.bind(this)(t,e,i,n)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{let n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(ne.max&&(e.max=n))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,n){let r;let o="reset"===n,a=this.chart,s=a.options,l=s.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,d=c.getIndexAngle(0)-.5*tu,f=d,p=360/this.countVisibleElements();for(r=0;r{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?tM(this.resolveDataElementOptions(t,e).angle||i):0}constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}}h(iP,"id","polarArea"),h(iP,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),h(iP,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map((e,r)=>{let o=t.getDatasetMeta(0),a=o.controller.getStyle(r);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:n,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class iE extends iM{}h(iE,"id","pie"),h(iE,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class iA extends ib{getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return ej.bind(this)(t,e,i,n)}update(t){let e=this._cachedMeta,i=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(i.points=n,"resize"!==t){let e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);let o={_loop:!0,_fullLoop:r.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){let r=this._cachedMeta.rScale,o="reset"===n;for(let a=e;a0&&this.getParsed(e-1);for(let c=e;c0&&Math.abs(i[d]-y[d])>m,g&&(p.parsed=i,p.raw=l.data[c]),u&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),b||this.updateElement(e,c,p,n),y=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}let i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;let r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,r,o)/2}}h(iD,"id","scatter"),h(iD,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),h(iD,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var iT=/*#__PURE__*/Object.freeze({__proto__:null,BarController:iS,BubbleController:iO,DoughnutController:iM,LineController:ik,PieController:iE,PolarAreaController:iP,RadarController:iA,ScatterController:iD});/** * @namespace Chart._adapters * @since 2.8.0 * @private @@ -660,20 +660,20 @@ return null}return!1}(t,e,i,r,n);return i}function eR(t,e){for(let i of e){if(!i * } * }) */static override(t){Object.assign(iC.prototype,t)}// eslint-disable-next-line @typescript-eslint/no-empty-function -init(){}formats(){return iR()}parse(){return iR()}format(){return iR()}add(){return iR()}diff(){return iR()}startOf(){return iR()}endOf(){return iR()}constructor(t){h(this,"options",void 0),this.options=t||{}}}var ij={_date:iC};function iI(t,e,i,r,n){let o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t{t[a](e[i],n)&&(o.push({element:t,datasetIndex:r,index:l}),s=s||t.inRange(e.x,e.y,n))}),r&&!s)?[]:o}var iz={modes:{index(t,e,i,r){let n=eq(e,t),o=i.axis||"x",a=i.includeInvisible||!1,s=i.intersect?iF(t,n,o,r,a):iL(t,n,o,!1,r,a),l=[];return s.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{let e=s[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,r){let n=eq(e,t),o=i.axis||"xy",a=i.includeInvisible||!1,s=i.intersect?iF(t,n,o,r,a):iL(t,n,o,!1,r,a);if(s.length>0){let e=s[0].datasetIndex,i=t.getDatasetMeta(e).data;s=[];for(let t=0;tt.pos===e)}function iW(t,e){return t.filter(t=>-1===iB.indexOf(t.pos)&&t.box.axis===e)}function iH(t,e){return t.sort((t,i)=>{let r=e?i:t,n=e?t:i;return r.weight===n.weight?r.index-n.index:r.weight-n.weight})}function iU(t,e,i,r){return Math.max(t[i],e[i])+Math.max(t[r],e[r])}function i$(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function iq(t,e,i,r){let n,o,a,s,l,c;let h=[];for(n=0,o=t.length,l=0;n{r[t]=Math.max(e[t],i[t])}),r}(t?["left","right"]:["top","bottom"])}(a.horizontal,e));let{same:o,other:u}=function(t,e,i,r){let{pos:n,box:o}=i,a=t.maxPadding;if(!U(n)){i.size&&(t[n]-=i.size);let e=r[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&i$(a,o.getPadding());let s=Math.max(0,e.outerWidth-iU(a,t,"left","right")),l=Math.max(0,e.outerHeight-iU(a,t,"top","bottom")),c=s!==t.w,h=l!==t.h;return t.w=s,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}(e,i,a,r);l|=o&&h.length,c=c||u,s.fullSize||h.push(a)}return l&&iq(h,e,i,r)||c}function iY(t,e,i,r,n){t.top=i,t.left=e,t.right=e+r,t.bottom=i+n,t.width=r,t.height=n}function iG(t,e,i,r){let n=i.padding,{x:o,y:a}=e;for(let s of t){let t=s.box,l=r[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){let r=e.w*c,o=l.size||t.height;tl(l.start)&&(a=l.start),t.fullSize?iY(t,n.left,a,i.outerWidth-n.right-n.left,o):iY(t,e.left+l.placed,a,r,o),l.start=a,l.placed+=r,a=t.bottom}else{let r=e.h*c,a=l.size||t.width;tl(l.start)&&(o=l.start),t.fullSize?iY(t,o,n.top,a,i.outerHeight-n.bottom-n.top):iY(t,o,e.top+l.placed,a,r),l.start=o,l.placed+=r,o=t.right}}e.x=o,e.y=a}var iX={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){let i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,r){if(!t)return;let n=ev(t.options.layout.padding),o=Math.max(e-n.width,0),a=Math.max(i-n.height,0),s=function(t){let e=function(t){let e,i,r,n,o,a;let s=[];for(e=0,i=(t||[]).length;et.box.fullSize),!0),r=iH(iV(e,"left"),!0),n=iH(iV(e,"right")),o=iH(iV(e,"top"),!0),a=iH(iV(e,"bottom")),s=iW(e,"x"),l=iW(e,"y");return{fullSize:i,leftAndTop:r.concat(o),rightAndBottom:n.concat(l).concat(a).concat(s),chartArea:iV(e,"chartArea"),vertical:r.concat(n).concat(l),horizontal:o.concat(a).concat(s)}}(t.boxes),l=s.vertical,c=s.horizontal;J(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});let h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),d=Object.assign({},n);i$(d,ev(r));let f=Object.assign({maxPadding:d,w:o,h:a,x:n.left,y:n.top},n),p=function(t,e){let i,r,n;let o=function(t){let e={};for(let i of t){let{stack:t,pos:r,stackWeight:n}=i;if(!t||!iB.includes(r))continue;let o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:a,hBoxMaxHeight:s}=e;for(i=0,r=t.length;i{let i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class iZ{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class iJ extends iZ{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const iK="$chartjs",iQ={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},i0=t=>null===t||""===t,i1=!!eX&&{passive:!0};function i2(t,e,i){t.canvas.removeEventListener(e,i,i1)}function i5(t,e){for(let i of t)if(i===e||i.contains(e))return!0}function i3(t,e,i){let r=t.canvas,n=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||i5(i.addedNodes,r))&&!i5(i.removedNodes,r);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function i8(t,e,i){let r=t.canvas,n=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||i5(i.removedNodes,r))&&!i5(i.addedNodes,r);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}const i6=new Map;let i4=0;function i7(){let t=window.devicePixelRatio;t!==i4&&(i4=t,i6.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function i9(t,e,i){let r=t.canvas,n=r&&eB(r);if(!n)return;let o=tV((t,e)=>{let r=n.clientWidth;i(t,e),r{let e=t[0],i=e.contentRect.width,r=e.contentRect.height;(0!==i||0!==r)&&o(i,r)});return a.observe(n),i6.size||window.addEventListener("resize",i7),i6.set(t,o),a}function rt(t,e,i){i&&i.disconnect(),"resize"===e&&(i6.delete(t),i6.size||window.removeEventListener("resize",i7))}function re(t,e,i){let r=t.canvas,n=tV(e=>{null!==t.ctx&&i(function(t,e){let i=iQ[t.type]||t.type,{x:r,y:n}=eq(t,e);return{type:i,chart:e,native:t,x:void 0!==r?r:null,y:void 0!==n?n:null}}(e,t))},t);return!function(t,e,i){t.addEventListener(e,i,i1)}(r,e,n),n}class ri extends iZ{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(!function(t,e){let i=t.style,r=t.getAttribute("height"),n=t.getAttribute("width");if(t[iK]={initial:{height:r,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",i0(n)){let e=eZ(t,"width");void 0!==e&&(t.width=e)}if(i0(r)){if(""===t.style.height)t.height=t.width/(e||2);else{let e=eZ(t,"height");void 0!==e&&(t.height=e)}}}(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[iK])return!1;let i=e[iK].initial;["height","width"].forEach(t=>{let r=i[t];W(r)?e.removeAttribute(t):e.setAttribute(t,r)});let r=i.style||{};return Object.keys(r).forEach(t=>{e.style[t]=r[t]}),e.width=e.width,delete e[iK],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let r=t.$proxies||(t.$proxies={}),n={attach:i3,detach:i8,resize:i9}[e]||re;r[e]=n(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;let n={attach:rt,detach:rt,resize:rt}[e]||i2;n(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return(// eslint-disable-next-line complexity -function(t,e,i,r){let n=eW(t),o=eU(n,"margin"),a=eV(n.maxWidth,t,"clientWidth")||tp,s=eV(n.maxHeight,t,"clientHeight")||tp,l=function(t,e,i){let r,n;if(void 0===e||void 0===i){let o=eB(t);if(o){let t=o.getBoundingClientRect(),a=eW(o),s=eU(a,"border","width"),l=eU(a,"padding");// this is the border box of the container -e=t.width-l.width-s.width,i=t.height-l.height-s.height,r=eV(a.maxWidth,o,"clientWidth"),n=eV(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:r||tp,maxHeight:n||tp}}(t,e,i),{width:c,height:h}=l;if("content-box"===n.boxSizing){let t=eU(n,"border","width"),e=eU(n,"padding");c-=e.width+t.width,h-=e.height+t.height}c=Math.max(0,c-o.width),h=Math.max(0,r?c/r:h-o.height),c=eY(Math.min(c,a,l.maxWidth)),h=eY(Math.min(h,s,l.maxHeight)),c&&!h&&// If the canvas has width, but no height, default to aspectRatio of 2 (canvas default) -(h=eY(c/2));let u=void 0!==e||void 0!==i;return u&&r&&l.height&&h>l.height&&(c=eY(Math.floor((h=l.height)*r))),{width:c,height:h}}(t,e,i,r))}isAttached(t){let e=eB(t);return!!(e&&e.isConnected)}}class rr{tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return tS(this.x)&&tS(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let r={};return t.forEach(t=>{r[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),r}constructor(){h(this,"x",void 0),h(this,"y",void 0),h(this,"active",!1),h(this,"options",void 0),h(this,"$animations",void 0)}}function rn(t,e,i,r,n){let o,a,s;let l=Y(r,0),c=Math.min(Y(n,t.length),t.length),h=0;for(i=Math.ceil(i),n&&(i=(o=n-r)/Math.floor(o/i)),s=l;s<0;)s=Math.round(l+ ++h*i);for(a=Math.max(l,0);a"left"===t?"right":"right"===t?"left":t,ra=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,rs=(t,e)=>Math.min(e||t,t);function rl(t,e){let i=[],r=t.length/e,n=t.length,o=0;for(;or?r:i,r=n&&i>r?i:r,{min:q(i,q(r,i)),max:q(r,q(i,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){let e=this._labelItems||(this._labelItems=this._computeLabelItems(t));return e}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Z(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:r,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=/** +init(){}formats(){return iR()}parse(){return iR()}format(){return iR()}add(){return iR()}diff(){return iR()}startOf(){return iR()}endOf(){return iR()}constructor(t){h(this,"options",void 0),this.options=t||{}}}var ij={_date:iC};function iI(t,e,i,n,r){let o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t{t[a](e[i],r)&&(o.push({element:t,datasetIndex:n,index:l}),s=s||t.inRange(e.x,e.y,r))}),n&&!s)?[]:o}var iz={modes:{index(t,e,i,n){let r=eq(e,t),o=i.axis||"x",a=i.includeInvisible||!1,s=i.intersect?iF(t,r,o,n,a):iL(t,r,o,!1,n,a),l=[];return s.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{let e=s[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,n){let r=eq(e,t),o=i.axis||"xy",a=i.includeInvisible||!1,s=i.intersect?iF(t,r,o,n,a):iL(t,r,o,!1,n,a);if(s.length>0){let e=s[0].datasetIndex,i=t.getDatasetMeta(e).data;s=[];for(let t=0;tt.pos===e)}function iW(t,e){return t.filter(t=>-1===iB.indexOf(t.pos)&&t.box.axis===e)}function iH(t,e){return t.sort((t,i)=>{let n=e?i:t,r=e?t:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight})}function iU(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function i$(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function iq(t,e,i,n){let r,o,a,s,l,c;let h=[];for(r=0,o=t.length,l=0;r{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}(a.horizontal,e));let{same:o,other:u}=function(t,e,i,n){let{pos:r,box:o}=i,a=t.maxPadding;if(!U(r)){i.size&&(t[r]-=i.size);let e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[r]+=i.size}o.getPadding&&i$(a,o.getPadding());let s=Math.max(0,e.outerWidth-iU(a,t,"left","right")),l=Math.max(0,e.outerHeight-iU(a,t,"top","bottom")),c=s!==t.w,h=l!==t.h;return t.w=s,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}(e,i,a,n);l|=o&&h.length,c=c||u,s.fullSize||h.push(a)}return l&&iq(h,e,i,n)||c}function iY(t,e,i,n,r){t.top=i,t.left=e,t.right=e+n,t.bottom=i+r,t.width=n,t.height=r}function iG(t,e,i,n){let r=i.padding,{x:o,y:a}=e;for(let s of t){let t=s.box,l=n[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){let n=e.w*c,o=l.size||t.height;tl(l.start)&&(a=l.start),t.fullSize?iY(t,r.left,a,i.outerWidth-r.right-r.left,o):iY(t,e.left+l.placed,a,n,o),l.start=a,l.placed+=n,a=t.bottom}else{let n=e.h*c,a=l.size||t.width;tl(l.start)&&(o=l.start),t.fullSize?iY(t,o,r.top,a,i.outerHeight-r.bottom-r.top):iY(t,o,e.top+l.placed,a,n),l.start=o,l.placed+=n,o=t.right}}e.x=o,e.y=a}var iX={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){let i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;let r=ev(t.options.layout.padding),o=Math.max(e-r.width,0),a=Math.max(i-r.height,0),s=function(t){let e=function(t){let e,i,n,r,o,a;let s=[];for(e=0,i=(t||[]).length;et.box.fullSize),!0),n=iH(iV(e,"left"),!0),r=iH(iV(e,"right")),o=iH(iV(e,"top"),!0),a=iH(iV(e,"bottom")),s=iW(e,"x"),l=iW(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:r.concat(l).concat(a).concat(s),chartArea:iV(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:o.concat(a).concat(s)}}(t.boxes),l=s.vertical,c=s.horizontal;J(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});let h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:r,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),d=Object.assign({},r);i$(d,ev(n));let f=Object.assign({maxPadding:d,w:o,h:a,x:r.left,y:r.top},r),p=function(t,e){let i,n,r;let o=function(t){let e={};for(let i of t){let{stack:t,pos:n,stackWeight:r}=i;if(!t||!iB.includes(n))continue;let o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return e}(t),{vBoxMaxWidth:a,hBoxMaxHeight:s}=e;for(i=0,n=t.length;i{let i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class iZ{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class iJ extends iZ{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const iK="$chartjs",iQ={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},i0=t=>null===t||""===t,i1=!!eX&&{passive:!0};function i2(t,e,i){t.canvas.removeEventListener(e,i,i1)}function i5(t,e){for(let i of t)if(i===e||i.contains(e))return!0}function i3(t,e,i){let n=t.canvas,r=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||i5(i.addedNodes,n))&&!i5(i.removedNodes,n);e&&i()});return r.observe(document,{childList:!0,subtree:!0}),r}function i8(t,e,i){let n=t.canvas,r=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||i5(i.removedNodes,n))&&!i5(i.addedNodes,n);e&&i()});return r.observe(document,{childList:!0,subtree:!0}),r}const i6=new Map;let i4=0;function i9(){let t=window.devicePixelRatio;t!==i4&&(i4=t,i6.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function i7(t,e,i){let n=t.canvas,r=n&&eB(n);if(!r)return;let o=tV((t,e)=>{let n=r.clientWidth;i(t,e),n{let e=t[0],i=e.contentRect.width,n=e.contentRect.height;(0!==i||0!==n)&&o(i,n)});return a.observe(r),i6.size||window.addEventListener("resize",i9),i6.set(t,o),a}function nt(t,e,i){i&&i.disconnect(),"resize"===e&&(i6.delete(t),i6.size||window.removeEventListener("resize",i9))}function ne(t,e,i){let n=t.canvas,r=tV(e=>{null!==t.ctx&&i(function(t,e){let i=iQ[t.type]||t.type,{x:n,y:r}=eq(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==r?r:null}}(e,t))},t);return!function(t,e,i){t.addEventListener(e,i,i1)}(n,e,r),r}class ni extends iZ{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(!function(t,e){let i=t.style,n=t.getAttribute("height"),r=t.getAttribute("width");if(t[iK]={initial:{height:n,width:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",i0(r)){let e=eZ(t,"width");void 0!==e&&(t.width=e)}if(i0(n)){if(""===t.style.height)t.height=t.width/(e||2);else{let e=eZ(t,"height");void 0!==e&&(t.height=e)}}}(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[iK])return!1;let i=e[iK].initial;["height","width"].forEach(t=>{let n=i[t];W(n)?e.removeAttribute(t):e.setAttribute(t,n)});let n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[iK],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let n=t.$proxies||(t.$proxies={}),r={attach:i3,detach:i8,resize:i7}[e]||ne;n[e]=r(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;let r={attach:nt,detach:nt,resize:nt}[e]||i2;r(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return(// eslint-disable-next-line complexity +function(t,e,i,n){let r=eW(t),o=eU(r,"margin"),a=eV(r.maxWidth,t,"clientWidth")||tp,s=eV(r.maxHeight,t,"clientHeight")||tp,l=function(t,e,i){let n,r;if(void 0===e||void 0===i){let o=eB(t);if(o){let t=o.getBoundingClientRect(),a=eW(o),s=eU(a,"border","width"),l=eU(a,"padding");// this is the border box of the container +e=t.width-l.width-s.width,i=t.height-l.height-s.height,n=eV(a.maxWidth,o,"clientWidth"),r=eV(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||tp,maxHeight:r||tp}}(t,e,i),{width:c,height:h}=l;if("content-box"===r.boxSizing){let t=eU(r,"border","width"),e=eU(r,"padding");c-=e.width+t.width,h-=e.height+t.height}c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=eY(Math.min(c,a,l.maxWidth)),h=eY(Math.min(h,s,l.maxHeight)),c&&!h&&// If the canvas has width, but no height, default to aspectRatio of 2 (canvas default) +(h=eY(c/2));let u=void 0!==e||void 0!==i;return u&&n&&l.height&&h>l.height&&(c=eY(Math.floor((h=l.height)*n))),{width:c,height:h}}(t,e,i,n))}isAttached(t){let e=eB(t);return!!(e&&e.isConnected)}}class nn{tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return tS(this.x)&&tS(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}constructor(){h(this,"x",void 0),h(this,"y",void 0),h(this,"active",!1),h(this,"options",void 0),h(this,"$animations",void 0)}}function nr(t,e,i,n,r){let o,a,s;let l=Y(n,0),c=Math.min(Y(r,t.length),t.length),h=0;for(i=Math.ceil(i),r&&(i=(o=r-n)/Math.floor(o/i)),s=l;s<0;)s=Math.round(l+ ++h*i);for(a=Math.max(l,0);a"left"===t?"right":"right"===t?"left":t,na=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,ns=(t,e)=>Math.min(e||t,t);function nl(t,e){let i=[],n=t.length/e,r=t.length,o=0;for(;on?n:i,n=r&&i>n?i:n,{min:q(i,q(n,i)),max:q(n,q(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){let e=this._labelItems||(this._labelItems=this._computeLabelItems(t));return e}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Z(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:n,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=/** * @param minmax * @param grace * @param beginAtZero * @private - */function(t,e,i){let{min:r,max:n}=t,o=X(e,(n-r)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(r,-Math.abs(o)),max:a(n,o)}}(this,n,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=an)return function(t,e,i,r){let n,o=0,a=i[0];for(n=0,r=Math.ceil(r);ni&&0===t?0:t+e;return{min:a(n,-Math.abs(o)),max:a(r,o)}}(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=ar)return function(t,e,i,n){let r,o=0,a=i[0];for(r=0,n=Math.ceil(n);rt-e).pop(),i}(r);for(let t=0,e=o.length-1;tn)return e}return Math.max(n,1)}(o,e,n);if(a>0){let t,i;let r=a>1?Math.round((l-s)/(a-1)):null;for(rn(e,c,h,W(r)?0:s-r,s),t=0,i=a-1;t=s||o<=1||!this.isHorizontal()){this.labelRotation=a;return}let c=this._getLabelSizes(),h=c.widest.width,u=c.highest.height,d=tR(this.chart.width-h,0,this.maxWidth);h+6>(t=r.offset?this.maxWidth/o:d/(o-1))&&(t=d/(o-(r.offset?.5:1)),e=this.maxHeight-rc(r.grid)-n.padding-rh(r.title,this.chart.options.font),i=Math.sqrt(h*h+u*u),l=Math.max(a,Math.min(s,l=Math.min(Math.asin(tR((c.highest.height+6)/t,-1,1)),Math.asin(tR(e/i,-1,1))-Math.asin(tR(u/i,-1,1)))*(180/tu)))),this.labelRotation=l}afterCalculateLabelRotation(){Z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Z(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let o=rh(r,e.options.font);if(a?(t.width=this.maxWidth,t.height=rc(n)+o):(t.height=this.maxHeight,t.width=rc(n)+o),i.display&&this.ticks.length){let{first:e,last:r,widest:n,highest:o}=this._getLabelSizes(),s=2*i.padding,l=tM(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(a){let e=i.mirror?0:h*n.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+s)}else{let e=i.mirror?0:c*n.width+h*o.height;t.width=Math.min(this.maxWidth,t.width+e+s)}this._calculatePadding(e,r,h,c)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){let{ticks:{align:n,padding:o},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){let a=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1),h=0,u=0;s?l?(h=r*t.width,u=i*e.height):(h=i*t.height,u=r*e.width):"start"===n?u=e.width:"end"===n?h=t.width:"inner"!==n&&(h=t.width/2,u=e.width/2),this.paddingLeft=Math.max((h-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((u-c+o)*this.width/(this.width-c),0)}else{let i=e.height/2,r=t.height/2;"start"===n?(i=0,r=t.height):"end"===n&&(i=e.height,r=0),this.paddingTop=i+o,this.paddingBottom=r+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Z(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{let i;let r=t.gc,n=r.length/2;if(n>e){for(i=0;i({width:m[t]||0,height:b[t]||0});return{first:S(0),last:S(e-1),widest:S(_),highest:S(w),widths:m,heights:b}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return tR(this._alignToPixels?ei(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&ta*r?a/i:s/r:s*r0}_computeGridLineItems(t){let e,i,r,n,o,a,s,l,c,h,u,d;let f=this.axis,p=this.chart,g=this.options,{grid:m,position:b,border:y}=g,v=m.offset,x=this.isHorizontal(),_=this.ticks,w=_.length+(v?1:0),S=rc(m),O=[],M=y.setContext(this.getContext()),k=M.display?M.width:0,P=k/2,E=function(t){return ei(p,t,k)};if("top"===b)e=E(this.bottom),a=this.bottom-S,l=e-P,h=E(t.top)+P,d=t.bottom;else if("bottom"===b)e=E(this.top),h=t.top,d=E(t.bottom)-P,a=e+P,l=this.top+S;else if("left"===b)e=E(this.right),o=this.right-S,s=e-P,c=E(t.left)+P,u=t.right;else if("right"===b)e=E(this.left),c=t.left,u=E(t.right)-P,o=e+P,s=this.left+S;else if("x"===f){if("center"===b)e=E((t.top+t.bottom)/2+.5);else if(U(b)){let t=Object.keys(b)[0],i=b[t];e=E(this.chart.scales[t].getPixelForValue(i))}h=t.top,d=t.bottom,l=(a=e+P)+S}else if("y"===f){if("center"===b)e=E((t.left+t.right)/2);else if(U(b)){let t=Object.keys(b)[0],i=b[t];e=E(this.chart.scales[t].getPixelForValue(i))}s=(o=e-P)-S,c=t.left,u=t.right}let A=Y(g.ticks.maxTicksLimit,w),D=Math.max(1,Math.ceil(w/A));for(i=0;is+1e-6)))return l}(this,i,v))&&(n=ei(p,r,g),x?o=s=c=u=n:a=l=h=d=n,O.push({tx1:o,ty1:a,tx2:s,ty2:l,x1:c,y1:h,x2:u,y2:d,width:g,color:b,borderDash:_,borderDashOffset:w,tickWidth:S,tickColor:M,tickBorderDash:k,tickBorderDashOffset:P}))}return this._ticksLength=w,this._borderValue=e,O}_computeLabelItems(t){let e,i,r,n,o,a,s,l,c,h,u;let d=this.axis,f=this.options,{position:p,ticks:g}=f,m=this.isHorizontal(),b=this.ticks,{align:y,crossAlign:v,padding:x,mirror:_}=g,w=rc(f.grid),S=w+x,O=_?-x:S,M=-tM(this.labelRotation),k=[],P="middle";if("top"===p)o=this.bottom-O,a=this._getXAxisLabelAlignment();else if("bottom"===p)o=this.top+O,a=this._getXAxisLabelAlignment();else if("left"===p){let t=this._getYAxisLabelAlignment(w);a=t.textAlign,n=t.x}else if("right"===p){let t=this._getYAxisLabelAlignment(w);a=t.textAlign,n=t.x}else if("x"===d){if("center"===p)o=(t.top+t.bottom)/2+S;else if(U(p)){let t=Object.keys(p)[0],e=p[t];o=this.chart.scales[t].getPixelForValue(e)+S}a=this._getXAxisLabelAlignment()}else if("y"===d){if("center"===p)n=(t.left+t.right)/2-S;else if(U(p)){let t=Object.keys(p)[0],e=p[t];n=this.chart.scales[t].getPixelForValue(e)}a=this._getYAxisLabelAlignment(w).textAlign}"y"===d&&("start"===y?P="top":"end"===y&&(P="bottom"));let E=this._getLabelSizes();for(e=0,i=b.length;ee.value===t);if(r>=0){let t=e.setContext(this.getContext(r));return t.lineWidth}return 0}drawGrid(t){let e,i;let r=this.options.grid,n=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),a=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(r.display)for(e=0,i=o.length;e{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){let e,i;let r=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",o=[];for(e=0,i=r.length;e{let r=i.split("."),n=r.pop(),o=[t].concat(r).join("."),a=e[i].split("."),s=a.pop(),l=a.join(".");et.route(o,n,l,s)})}(e,t.defaultRoutes),t.descriptors&&et.describe(e,t.descriptors)}(t,o,e),this.override&&et.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in et[r]&&(delete et[r][i],this.override&&delete t6[i])}constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}}var rf=/* #__PURE__ */new class{add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{let r=i||this._getRegistryForType(e);i||r.isForType(e)||r===this.plugins&&e.id?this._exec(t,r,e):J(e,e=>{let r=i||this._getRegistryForType(e);this._exec(t,r,e)})})}_exec(t,e,i){let r=ts(t);Z(i["before"+r],[],i),e[t](i),Z(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}constructor(){this._init=[]}}function rg(t,e){let i=et.datasets[t]||{},r=(e.datasets||{})[t]||{};return r.indexAxis||e.indexAxis||i.indexAxis||"x"}function rm(t){if("x"===t||"y"===t||"r"===t)return t}function rb(t,...e){if(rm(t))return t;for(let r of e){var i;let e=r.axis||("top"===(i=r.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&rm(t[0].toLowerCase());if(e)return e}throw Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function ry(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function rv(t){let e=t.options||(t.options={});e.plugins=Y(e.plugins,{}),e.scales=function(t,e){let i=t6[t.type]||{scales:{}},r=e.scales||{},n=rg(t.type,e),o=Object.create(null);return Object.keys(r).forEach(e=>{let a=r[e];if(!U(a))return console.error(`Invalid scale configuration for scale: ${e}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);let s=rb(e,a,function(t,e){if(e.data&&e.data.datasets){let i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return ry(t,"x",i[0])||ry(t,"y",i[0])}return{}}(e,t),et.scales[a.type]),l=s===n?"_index_":"_value_",c=i.scales||{};o[e]=tr(Object.create(null),[{axis:s},a,c[s],c[l]])}),t.data.datasets.forEach(i=>{let n=i.type||t.type,a=i.indexAxis||rg(n,e),s=t6[n]||{},l=s.scales||{};Object.keys(l).forEach(t=>{let e;let n=(e=t,"_index_"===t?e=a:"_value_"===t&&(e="x"===a?"y":"x"),e),s=i[n+"AxisID"]||n;o[s]=o[s]||Object.create(null),tr(o[s],[{axis:n},r[s],l[t]])})}),Object.keys(o).forEach(t=>{let e=o[t];tr(e,[et.scales[e.type],et.scale])}),o}(t,e)}function rx(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const r_=new Map,rw=new Set;function rS(t,e){let i=r_.get(t);return i||(i=e(),r_.set(t,i),rw.add(i)),i}const rO=(t,e,i)=>{let r=ta(e,i);void 0!==r&&t.add(r)};class rM{get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=rx(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),rv(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return rS(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return rS(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return rS(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return rS(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){let{options:r,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;let s=new Set;e.forEach(e=>{t&&(s.add(t),e.forEach(e=>rO(s,t,e))),e.forEach(t=>rO(s,r,t)),e.forEach(t=>rO(s,t6[n]||{},t)),e.forEach(t=>rO(s,et,t)),e.forEach(t=>rO(s,t4,t))});let l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),rw.has(e)&&o.set(e,l),l}chartOptionScopes(){let{options:t,type:e}=this;return[t,t6[e]||{},et.datasets[e]||{},{type:e},et,t4]}resolveNamedOptions(t,e,i,r=[""]){let n={$shared:!0},{resolver:o,subPrefixes:a}=rk(this._resolverCache,t,r),s=o;if(function(t,e){let{isScriptable:i,isIndexable:r}=eM(t);for(let n of e){let e=i(n),o=r(n),a=(o||e)&&t[n];if(e&&(tc(a)||rP(a))||o&&H(a))return!0}return!1}(o,e)){n.$shared=!1,i=tc(i)?i():i;let e=this.createResolver(t,i,a);s=eO(o,i,e)}for(let t of e)n[t]=s[t];return n}createResolver(t,e,i=[""],r){let{resolver:n}=rk(this._resolverCache,t,i);return U(e)?eO(n,e,void 0,r):n}constructor(t){var e;this._config=((e=(e=t)||{}).data=rx(e.data),rv(e),e),this._scopeCache=new Map,this._resolverCache=new Map}}function rk(t,e,i){let r=t.get(e);r||(r=new Map,t.set(e,r));let n=i.join(),o=r.get(n);if(!o){let t=eS(e,i);o={resolver:t,subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},r.set(n,o)}return o}const rP=t=>U(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||tc(t[i]),!1),rE=["top","bottom","left","right","chartArea"];function rA(t,e){return"top"===t||"bottom"===t||-1===rE.indexOf(t)&&"x"===e}function rD(t,e){return function(i,r){return i[t]===r[t]?i[e]-r[e]:i[t]-r[t]}}function rT(t){let e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Z(i&&i.onComplete,[t],e)}function rR(t){let e=t.chart,i=e.options.animation;Z(i&&i.onProgress,[t],e)}function rC(t){return ez()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const rj={},rI=t=>{let e=rC(t);return Object.values(rj).filter(t=>t.canvas===e).pop()};function rF(t,e,i){return t.options.clip?t[i]:e[i]}class rL{static register(...t){rf.add(...t),rN()}static unregister(...t){rf.remove(...t),rN()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:n}=this;return W(t)?e&&n?n:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return rf}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():eG(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return er(this.canvas,this.ctx),this}stop(){return e9.stop(this),this}resize(t,e){e9.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,r=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,eG(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Z(i.onResize,[this,o],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){let t=this.options,e=t.scales||{};J(e,(t,e)=>{t.id=e})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{}),n=[];e&&(n=n.concat(Object.keys(e).map(t=>{let i=e[t],r=rb(t,i),n="r"===r,o="x"===r;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}}))),J(n,e=>{let n=e.options,o=n.id,a=rb(o,n),s=Y(n.type,e.dtype);(void 0===n.position||rA(n.position,a)!==rA(e.dposition))&&(n.position=e.dposition),r[o]=!0;let l=null;if(o in i&&i[o].type===s)l=i[o];else{let t=rf.getScale(s);i[(l=new t({id:o,type:s,ctx:this.ctx,chart:this})).id]=l}l.init(n,t)}),J(r,(t,e)=>{t||delete i[e]}),J(i,t=>{iX.configure(this,t,t.options),iX.addBox(this,t)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){let t,e;let i=[],r=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=r.length;t{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;let n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(rD("z","_idx"));let{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){J(this.scales,t=>{iX.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);th(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:r,count:n}of e){let e="_removeElements"===i?-n:n;!function(t,e,i){let r=Object.keys(t);for(let n of r){let r=+n;if(r>=e){let o=t[n];delete t[n],(i>0||r>e)&&(t[r+i]=o)}}}(t,r,e)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),r=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;iX.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],J(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,r=!i.disabled,n=function(t,e){let{xScale:i,yScale:r}=t;return i&&r?{left:rF(i,e,"left"),right:rF(i,e,"right"),top:rF(r,e,"top"),bottom:rF(r,e,"bottom")}:e}(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(r&&es(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),r&&el(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ea(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){let n=iz.modes[e];return"function"==typeof n?n(this,t,i,r):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,r=i.filter(t=>t&&t._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=ew(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let r=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,r);tl(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update(e=>e.datasetIndex===t?r:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),e9.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,r),t[i]=r},r=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};J(this.options.events,t=>i(t,r))}bindResponsiveEvents(){let t;this._responsiveListeners||(this._responsiveListeners={});let e=this._responsiveListeners,i=this.platform,r=(t,r)=>{i.addEventListener(this,t,r),e[t]=r},n=(t,r)=>{e[t]&&(i.removeEventListener(this,t,r),delete e[t])},o=(t,e)=>{this.canvas&&this.resize(t,e)},a=()=>{n("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",t)};t=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),r("attach",a)},i.isAttached(this.canvas)?a():t()}unbindEvents(){J(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},J(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let r,n,o;let a=i?"set":"remove";for("dataset"===e&&this.getDatasetMeta(t[0].datasetIndex).controller["_"+a+"DatasetHoverStyle"](),n=0,o=t.length;n{let i=this.getDatasetMeta(t);if(!i)throw Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),r=!K(i,e);r&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){let r=this.options.hover,n=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,r))return;let n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){var r;let{_active:n=[],options:o}=this,a=this._getActiveElements(t,n,i,e),s="mouseup"===t.type||"click"===t.type||"contextmenu"===t.type,l=(r=this._lastEvent,i&&"mouseout"!==t.type?s?r:t:null);i&&(this._lastEvent=null,Z(o.onHover,[t,a,this],this),s&&Z(o.onClick,[t,a,this],this));let c=!K(a,n);return(c||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,r){if("mouseout"===t.type)return[];if(!i)return e;let n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,r)}constructor(t,e){var i,r;let n;let o=this.config=new rM(e),a=rC(t),s=rI(a);if(s)throw Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");let l=o.createResolver(o.chartOptionScopes(),this.getContext());this.platform=new(o.platform||(!ez()||"undefined"!=typeof OffscreenCanvas&&a instanceof OffscreenCanvas?iJ:ri)),this.platform.updateConfig(o);let c=this.platform.acquireContext(a,l.aspectRatio),h=c&&c.canvas,u=h&&h.height,d=h&&h.width;if(this.id=V(),this.ctx=c,this.canvas=h,this.width=d,this.height=u,this._options=l,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 rp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(i=t=>this.update(t),r=l.resizeDelay||0,function(...t){return r?(clearTimeout(n),n=setTimeout(i,r,t)):i.apply(this,t),r}),this._dataChanges=[],rj[this.id]=this,!c||!h){console.error("Failed to create chart: can't acquire context from the given item");return}e9.listen(this,"complete",rT),e9.listen(this,"progress",rR),this._initialize(),this.attached&&this.update()}}function rN(){return J(rL.instances,t=>t._plugins.invalidate())}/** + */function(t){let e;let i=[],n=Math.sqrt(t);for(e=1;et-e).pop(),i}(n);for(let t=0,e=o.length-1;tr)return e}return Math.max(r,1)}(o,e,r);if(a>0){let t,i;let n=a>1?Math.round((l-s)/(a-1)):null;for(nr(e,c,h,W(n)?0:s-n,s),t=0,i=a-1;t=s||o<=1||!this.isHorizontal()){this.labelRotation=a;return}let c=this._getLabelSizes(),h=c.widest.width,u=c.highest.height,d=tR(this.chart.width-h,0,this.maxWidth);h+6>(t=n.offset?this.maxWidth/o:d/(o-1))&&(t=d/(o-(n.offset?.5:1)),e=this.maxHeight-nc(n.grid)-r.padding-nh(n.title,this.chart.options.font),i=Math.sqrt(h*h+u*u),l=Math.max(a,Math.min(s,l=Math.min(Math.asin(tR((c.highest.height+6)/t,-1,1)),Math.asin(tR(e/i,-1,1))-Math.asin(tR(u/i,-1,1)))*(180/tu)))),this.labelRotation=l}afterCalculateLabelRotation(){Z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Z(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let o=nh(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=nc(r)+o):(t.height=this.maxHeight,t.width=nc(r)+o),i.display&&this.ticks.length){let{first:e,last:n,widest:r,highest:o}=this._getLabelSizes(),s=2*i.padding,l=tM(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(a){let e=i.mirror?0:h*r.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+s)}else{let e=i.mirror?0:c*r.width+h*o.height;t.width=Math.min(this.maxWidth,t.width+e+s)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){let{ticks:{align:r,padding:o},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){let a=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1),h=0,u=0;s?l?(h=n*t.width,u=i*e.height):(h=i*t.height,u=n*e.width):"start"===r?u=e.width:"end"===r?h=t.width:"inner"!==r&&(h=t.width/2,u=e.width/2),this.paddingLeft=Math.max((h-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((u-c+o)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===r?(i=0,n=t.height):"end"===r&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Z(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{let i;let n=t.gc,r=n.length/2;if(r>e){for(i=0;i({width:m[t]||0,height:b[t]||0});return{first:S(0),last:S(e-1),widest:S(_),highest:S(w),widths:m,heights:b}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return tR(this._alignToPixels?ei(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&ta*n?a/i:s/n:s*n0}_computeGridLineItems(t){let e,i,n,r,o,a,s,l,c,h,u,d;let f=this.axis,p=this.chart,g=this.options,{grid:m,position:b,border:y}=g,v=m.offset,x=this.isHorizontal(),_=this.ticks,w=_.length+(v?1:0),S=nc(m),O=[],M=y.setContext(this.getContext()),k=M.display?M.width:0,P=k/2,E=function(t){return ei(p,t,k)};if("top"===b)e=E(this.bottom),a=this.bottom-S,l=e-P,h=E(t.top)+P,d=t.bottom;else if("bottom"===b)e=E(this.top),h=t.top,d=E(t.bottom)-P,a=e+P,l=this.top+S;else if("left"===b)e=E(this.right),o=this.right-S,s=e-P,c=E(t.left)+P,u=t.right;else if("right"===b)e=E(this.left),c=t.left,u=E(t.right)-P,o=e+P,s=this.left+S;else if("x"===f){if("center"===b)e=E((t.top+t.bottom)/2+.5);else if(U(b)){let t=Object.keys(b)[0],i=b[t];e=E(this.chart.scales[t].getPixelForValue(i))}h=t.top,d=t.bottom,l=(a=e+P)+S}else if("y"===f){if("center"===b)e=E((t.left+t.right)/2);else if(U(b)){let t=Object.keys(b)[0],i=b[t];e=E(this.chart.scales[t].getPixelForValue(i))}s=(o=e-P)-S,c=t.left,u=t.right}let A=Y(g.ticks.maxTicksLimit,w),D=Math.max(1,Math.ceil(w/A));for(i=0;is+1e-6)))return l}(this,i,v))&&(r=ei(p,n,g),x?o=s=c=u=r:a=l=h=d=r,O.push({tx1:o,ty1:a,tx2:s,ty2:l,x1:c,y1:h,x2:u,y2:d,width:g,color:b,borderDash:_,borderDashOffset:w,tickWidth:S,tickColor:M,tickBorderDash:k,tickBorderDashOffset:P}))}return this._ticksLength=w,this._borderValue=e,O}_computeLabelItems(t){let e,i,n,r,o,a,s,l,c,h,u;let d=this.axis,f=this.options,{position:p,ticks:g}=f,m=this.isHorizontal(),b=this.ticks,{align:y,crossAlign:v,padding:x,mirror:_}=g,w=nc(f.grid),S=w+x,O=_?-x:S,M=-tM(this.labelRotation),k=[],P="middle";if("top"===p)o=this.bottom-O,a=this._getXAxisLabelAlignment();else if("bottom"===p)o=this.top+O,a=this._getXAxisLabelAlignment();else if("left"===p){let t=this._getYAxisLabelAlignment(w);a=t.textAlign,r=t.x}else if("right"===p){let t=this._getYAxisLabelAlignment(w);a=t.textAlign,r=t.x}else if("x"===d){if("center"===p)o=(t.top+t.bottom)/2+S;else if(U(p)){let t=Object.keys(p)[0],e=p[t];o=this.chart.scales[t].getPixelForValue(e)+S}a=this._getXAxisLabelAlignment()}else if("y"===d){if("center"===p)r=(t.left+t.right)/2-S;else if(U(p)){let t=Object.keys(p)[0],e=p[t];r=this.chart.scales[t].getPixelForValue(e)}a=this._getYAxisLabelAlignment(w).textAlign}"y"===d&&("start"===y?P="top":"end"===y&&(P="bottom"));let E=this._getLabelSizes();for(e=0,i=b.length;ee.value===t);if(n>=0){let t=e.setContext(this.getContext(n));return t.lineWidth}return 0}drawGrid(t){let e,i;let n=this.options.grid,r=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),a=(t,e,i)=>{i.width&&i.color&&(r.save(),r.lineWidth=i.width,r.strokeStyle=i.color,r.setLineDash(i.borderDash||[]),r.lineDashOffset=i.borderDashOffset,r.beginPath(),r.moveTo(t.x,t.y),r.lineTo(e.x,e.y),r.stroke(),r.restore())};if(n.display)for(e=0,i=o.length;e{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){let e,i;let n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",o=[];for(e=0,i=n.length;e{let n=i.split("."),r=n.pop(),o=[t].concat(n).join("."),a=e[i].split("."),s=a.pop(),l=a.join(".");et.route(o,r,l,s)})}(e,t.defaultRoutes),t.descriptors&&et.describe(e,t.descriptors)}(t,o,e),this.override&&et.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in et[n]&&(delete et[n][i],this.override&&delete t6[i])}constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}}var nf=/* #__PURE__ */new class{add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{let n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):J(e,e=>{let n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){let n=ts(t);Z(i["before"+n],[],i),e[t](i),Z(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}constructor(){this._init=[]}}function ng(t,e){let i=et.datasets[t]||{},n=(e.datasets||{})[t]||{};return n.indexAxis||e.indexAxis||i.indexAxis||"x"}function nm(t){if("x"===t||"y"===t||"r"===t)return t}function nb(t,...e){if(nm(t))return t;for(let n of e){var i;let e=n.axis||("top"===(i=n.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&nm(t[0].toLowerCase());if(e)return e}throw Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function ny(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function nv(t){let e=t.options||(t.options={});e.plugins=Y(e.plugins,{}),e.scales=function(t,e){let i=t6[t.type]||{scales:{}},n=e.scales||{},r=ng(t.type,e),o=Object.create(null);return Object.keys(n).forEach(e=>{let a=n[e];if(!U(a))return console.error(`Invalid scale configuration for scale: ${e}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);let s=nb(e,a,function(t,e){if(e.data&&e.data.datasets){let i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return ny(t,"x",i[0])||ny(t,"y",i[0])}return{}}(e,t),et.scales[a.type]),l=s===r?"_index_":"_value_",c=i.scales||{};o[e]=tn(Object.create(null),[{axis:s},a,c[s],c[l]])}),t.data.datasets.forEach(i=>{let r=i.type||t.type,a=i.indexAxis||ng(r,e),s=t6[r]||{},l=s.scales||{};Object.keys(l).forEach(t=>{let e;let r=(e=t,"_index_"===t?e=a:"_value_"===t&&(e="x"===a?"y":"x"),e),s=i[r+"AxisID"]||r;o[s]=o[s]||Object.create(null),tn(o[s],[{axis:r},n[s],l[t]])})}),Object.keys(o).forEach(t=>{let e=o[t];tn(e,[et.scales[e.type],et.scale])}),o}(t,e)}function nx(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const n_=new Map,nw=new Set;function nS(t,e){let i=n_.get(t);return i||(i=e(),n_.set(t,i),nw.add(i)),i}const nO=(t,e,i)=>{let n=ta(e,i);void 0!==n&&t.add(n)};class nM{get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=nx(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),nv(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return nS(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return nS(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return nS(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return nS(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){let{options:n,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;let s=new Set;e.forEach(e=>{t&&(s.add(t),e.forEach(e=>nO(s,t,e))),e.forEach(t=>nO(s,n,t)),e.forEach(t=>nO(s,t6[r]||{},t)),e.forEach(t=>nO(s,et,t)),e.forEach(t=>nO(s,t4,t))});let l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),nw.has(e)&&o.set(e,l),l}chartOptionScopes(){let{options:t,type:e}=this;return[t,t6[e]||{},et.datasets[e]||{},{type:e},et,t4]}resolveNamedOptions(t,e,i,n=[""]){let r={$shared:!0},{resolver:o,subPrefixes:a}=nk(this._resolverCache,t,n),s=o;if(function(t,e){let{isScriptable:i,isIndexable:n}=eM(t);for(let r of e){let e=i(r),o=n(r),a=(o||e)&&t[r];if(e&&(tc(a)||nP(a))||o&&H(a))return!0}return!1}(o,e)){r.$shared=!1,i=tc(i)?i():i;let e=this.createResolver(t,i,a);s=eO(o,i,e)}for(let t of e)r[t]=s[t];return r}createResolver(t,e,i=[""],n){let{resolver:r}=nk(this._resolverCache,t,i);return U(e)?eO(r,e,void 0,n):r}constructor(t){var e;this._config=((e=(e=t)||{}).data=nx(e.data),nv(e),e),this._scopeCache=new Map,this._resolverCache=new Map}}function nk(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));let r=i.join(),o=n.get(r);if(!o){let t=eS(e,i);o={resolver:t,subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(r,o)}return o}const nP=t=>U(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||tc(t[i]),!1),nE=["top","bottom","left","right","chartArea"];function nA(t,e){return"top"===t||"bottom"===t||-1===nE.indexOf(t)&&"x"===e}function nD(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function nT(t){let e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Z(i&&i.onComplete,[t],e)}function nR(t){let e=t.chart,i=e.options.animation;Z(i&&i.onProgress,[t],e)}function nC(t){return ez()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const nj={},nI=t=>{let e=nC(t);return Object.values(nj).filter(t=>t.canvas===e).pop()};function nF(t,e,i){return t.options.clip?t[i]:e[i]}class nL{static register(...t){nf.add(...t),nN()}static unregister(...t){nf.remove(...t),nN()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:r}=this;return W(t)?e&&r?r:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return nf}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():eG(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return en(this.canvas,this.ctx),this}stop(){return e7.stop(this),this}resize(t,e){e7.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,n=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,eG(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Z(i.onResize,[this,o],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){let t=this.options,e=t.scales||{};J(e,(t,e)=>{t.id=e})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{}),r=[];e&&(r=r.concat(Object.keys(e).map(t=>{let i=e[t],n=nb(t,i),r="r"===n,o="x"===n;return{options:i,dposition:r?"chartArea":o?"bottom":"left",dtype:r?"radialLinear":o?"category":"linear"}}))),J(r,e=>{let r=e.options,o=r.id,a=nb(o,r),s=Y(r.type,e.dtype);(void 0===r.position||nA(r.position,a)!==nA(e.dposition))&&(r.position=e.dposition),n[o]=!0;let l=null;if(o in i&&i[o].type===s)l=i[o];else{let t=nf.getScale(s);i[(l=new t({id:o,type:s,ctx:this.ctx,chart:this})).id]=l}l.init(r,t)}),J(n,(t,e)=>{t||delete i[e]}),J(i,t=>{iX.configure(this,t,t.options),iX.addBox(this,t)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){let t,e;let i=[],n=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=n.length;t{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(nD("z","_idx"));let{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){J(this.scales,t=>{iX.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);th(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:n,count:r}of e){let e="_removeElements"===i?-r:r;!function(t,e,i){let n=Object.keys(t);for(let r of n){let n=+r;if(n>=e){let o=t[r];delete t[r],(i>0||n>e)&&(t[n+i]=o)}}}(t,n,e)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;iX.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],J(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,n=!i.disabled,r=function(t,e){let{xScale:i,yScale:n}=t;return i&&n?{left:nF(i,e,"left"),right:nF(i,e,"right"),top:nF(n,e,"top"),bottom:nF(n,e,"bottom")}:e}(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(n&&es(e,{left:!1===i.left?0:r.left-i.left,right:!1===i.right?this.width:r.right+i.right,top:!1===i.top?0:r.top-i.top,bottom:!1===i.bottom?this.height:r.bottom+i.bottom}),t.controller.draw(),n&&el(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ea(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){let r=iz.modes[e];return"function"==typeof r?r(this,t,i,n):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=ew(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let n=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,n);tl(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),e7.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};J(this.options.events,t=>i(t,n))}bindResponsiveEvents(){let t;this._responsiveListeners||(this._responsiveListeners={});let e=this._responsiveListeners,i=this.platform,n=(t,n)=>{i.addEventListener(this,t,n),e[t]=n},r=(t,n)=>{e[t]&&(i.removeEventListener(this,t,n),delete e[t])},o=(t,e)=>{this.canvas&&this.resize(t,e)},a=()=>{r("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",t)};t=()=>{this.attached=!1,r("resize",o),this._stop(),this._resize(0,0),n("attach",a)},i.isAttached(this.canvas)?a():t()}unbindEvents(){J(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},J(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let n,r,o;let a=i?"set":"remove";for("dataset"===e&&this.getDatasetMeta(t[0].datasetIndex).controller["_"+a+"DatasetHoverStyle"](),r=0,o=t.length;r{let i=this.getDatasetMeta(t);if(!i)throw Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),n=!K(i,e);n&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){let n=this.options.hover,r=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;let r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){var n;let{_active:r=[],options:o}=this,a=this._getActiveElements(t,r,i,e),s="mouseup"===t.type||"click"===t.type||"contextmenu"===t.type,l=(n=this._lastEvent,i&&"mouseout"!==t.type?s?n:t:null);i&&(this._lastEvent=null,Z(o.onHover,[t,a,this],this),s&&Z(o.onClick,[t,a,this],this));let c=!K(a,r);return(c||e)&&(this._active=a,this._updateHoverStyles(a,r,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;let r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}constructor(t,e){var i,n;let r;let o=this.config=new nM(e),a=nC(t),s=nI(a);if(s)throw Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");let l=o.createResolver(o.chartOptionScopes(),this.getContext());this.platform=new(o.platform||(!ez()||"undefined"!=typeof OffscreenCanvas&&a instanceof OffscreenCanvas?iJ:ni)),this.platform.updateConfig(o);let c=this.platform.acquireContext(a,l.aspectRatio),h=c&&c.canvas,u=h&&h.height,d=h&&h.width;if(this.id=V(),this.ctx=c,this.canvas=h,this.width=d,this.height=u,this._options=l,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 np,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(i=t=>this.update(t),n=l.resizeDelay||0,function(...t){return n?(clearTimeout(r),r=setTimeout(i,n,t)):i.apply(this,t),n}),this._dataChanges=[],nj[this.id]=this,!c||!h){console.error("Failed to create chart: can't acquire context from the given item");return}e7.listen(this,"complete",nT),e7.listen(this,"progress",nR),this._initialize(),this.attached&&this.update()}}function nN(){return J(nL.instances,t=>t._plugins.invalidate())}/** * Convert (r, 𝜃) to (x, y) - */function rz(t,e,i,r){return{x:i+t*Math.cos(e),y:r+t*Math.sin(e)}}/** + */function nz(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}/** * Path the arc, respecting border radius by separating into left and right halves. * * Start End @@ -686,53 +686,53 @@ e=t.width-l.width-s.width,i=t.height-l.height-s.height,r=eV(a.maxWidth,o,"client * 7 4 * \ / * 6<---b<---5 Inner - */function rB(t,e,i,r,n,o){let{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:h}=e,u=Math.max(e.outerRadius+r+i-c,0),d=h>0?h+r+i+c:0,f=0,p=n-l;if(r){let t=u>0?u-r:0,e=((h>0?h-r:0)+t)/2;f=(p-(0!==e?p*e/(e+r):p))/2}let g=Math.max(.001,p*u-i/tu)/u,m=(p-g)/2,b=l+m+f,y=n-m-f,{outerStart:v,outerEnd:x,innerStart:_,innerEnd:w}=/** + */function nB(t,e,i,n,r,o){let{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:h}=e,u=Math.max(e.outerRadius+n+i-c,0),d=h>0?h+n+i+c:0,f=0,p=r-l;if(n){let t=u>0?u-n:0,e=((h>0?h-n:0)+t)/2;f=(p-(0!==e?p*e/(e+n):p))/2}let g=Math.max(.001,p*u-i/tu)/u,m=(p-g)/2,b=l+m+f,y=r-m-f,{outerStart:v,outerEnd:x,innerStart:_,innerEnd:w}=/** * Parse border radius from the provided options - */function(t,e,i,r){let n=em(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(i-e)/2,a=Math.min(o,r*e/2),s=t=>{let e=(i-Math.min(o,t))*r/2;return tR(t,0,Math.min(o,e))};return{outerStart:s(n.outerStart),outerEnd:s(n.outerEnd),innerStart:tR(n.innerStart,0,a),innerEnd:tR(n.innerEnd,0,a)}}(e,d,u,y-b),S=u-v,O=u-x,M=b+v/S,k=y-x/O,P=d+_,E=d+w,A=b+_/P,D=y-w/E;if(t.beginPath(),o){// The first arc segments from point 1 to point a to point 2 + */function(t,e,i,n){let r=em(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(i-e)/2,a=Math.min(o,n*e/2),s=t=>{let e=(i-Math.min(o,t))*n/2;return tR(t,0,Math.min(o,e))};return{outerStart:s(r.outerStart),outerEnd:s(r.outerEnd),innerStart:tR(r.innerStart,0,a),innerEnd:tR(r.innerEnd,0,a)}}(e,d,u,y-b),S=u-v,O=u-x,M=b+v/S,k=y-x/O,P=d+_,E=d+w,A=b+_/P,D=y-w/E;if(t.beginPath(),o){// The first arc segments from point 1 to point a to point 2 let e=(M+k)/2;// The corner segment from point 2 to point 3 -if(t.arc(a,s,u,M,e),t.arc(a,s,u,e,k),x>0){let e=rz(O,k,a,s);t.arc(e.x,e.y,x,k,y+tm)}// The line from point 3 to point 4 -let i=rz(E,y,a,s);// The corner segment from point 4 to point 5 -if(t.lineTo(i.x,i.y),w>0){let e=rz(E,D,a,s);t.arc(e.x,e.y,w,y+tm,D+Math.PI)}// The inner arc from point 5 to point b to point 6 -let r=(y-w/d+(b+_/d))/2;// The corner segment from point 6 to point 7 -if(t.arc(a,s,d,y-w/d,r,!0),t.arc(a,s,d,r,b+_/d,!0),_>0){let e=rz(P,A,a,s);t.arc(e.x,e.y,_,A+Math.PI,b-tm)}// The line from point 7 to point 8 -let n=rz(S,b,a,s);// The corner segment from point 8 to point 1 -if(t.lineTo(n.x,n.y),v>0){let e=rz(S,M,a,s);t.arc(e.x,e.y,v,b-tm,M)}}else{t.moveTo(a,s);let e=Math.cos(M)*u+a,i=Math.sin(M)*u+s;t.lineTo(e,i);let r=Math.cos(k)*u+a,n=Math.sin(k)*u+s;t.lineTo(r,n)}t.closePath()}h(rL,"defaults",et),h(rL,"instances",rj),h(rL,"overrides",t6),h(rL,"registry",rf),h(rL,"version","4.4.0"),h(rL,"getChart",rI);class rV extends rr{inRange(t,e,i){let r=this.getProps(["x","y"],i),{angle:n,distance:o}=tP(r,{x:t,y:e}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=(this.options.spacing+this.options.borderWidth)/2,d=Y(h,s-a),f=d>=td||tT(n,a,s),p=tC(o,l+u,c+u);return f&&p}getCenterPoint(t){let{x:e,y:i,startAngle:r,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:s,spacing:l}=this.options,c=(r+n)/2,h=(o+a+l+s)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,r=(e.offset||0)/4,n=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>td?Math.floor(i/td):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*r,Math.sin(a)*r);let s=1-Math.sin(Math.min(tu,i||0)),l=r*s;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,r,n){let{fullCircles:o,startAngle:a,circumference:s}=e,l=e.endAngle;if(o){rB(t,e,i,r,l,n);for(let e=0;e0){let e=nz(O,k,a,s);t.arc(e.x,e.y,x,k,y+tm)}// The line from point 3 to point 4 +let i=nz(E,y,a,s);// The corner segment from point 4 to point 5 +if(t.lineTo(i.x,i.y),w>0){let e=nz(E,D,a,s);t.arc(e.x,e.y,w,y+tm,D+Math.PI)}// The inner arc from point 5 to point b to point 6 +let n=(y-w/d+(b+_/d))/2;// The corner segment from point 6 to point 7 +if(t.arc(a,s,d,y-w/d,n,!0),t.arc(a,s,d,n,b+_/d,!0),_>0){let e=nz(P,A,a,s);t.arc(e.x,e.y,_,A+Math.PI,b-tm)}// The line from point 7 to point 8 +let r=nz(S,b,a,s);// The corner segment from point 8 to point 1 +if(t.lineTo(r.x,r.y),v>0){let e=nz(S,M,a,s);t.arc(e.x,e.y,v,b-tm,M)}}else{t.moveTo(a,s);let e=Math.cos(M)*u+a,i=Math.sin(M)*u+s;t.lineTo(e,i);let n=Math.cos(k)*u+a,r=Math.sin(k)*u+s;t.lineTo(n,r)}t.closePath()}h(nL,"defaults",et),h(nL,"instances",nj),h(nL,"overrides",t6),h(nL,"registry",nf),h(nL,"version","4.4.0"),h(nL,"getChart",nI);class nV extends nn{inRange(t,e,i){let n=this.getProps(["x","y"],i),{angle:r,distance:o}=tP(n,{x:t,y:e}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=(this.options.spacing+this.options.borderWidth)/2,d=Y(h,s-a),f=d>=td||tT(r,a,s),p=tC(o,l+u,c+u);return f&&p}getCenterPoint(t){let{x:e,y:i,startAngle:n,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:s,spacing:l}=this.options,c=(n+r)/2,h=(o+a+l+s)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,n=(e.offset||0)/4,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>td?Math.floor(i/td):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*n,Math.sin(a)*n);let s=1-Math.sin(Math.min(tu,i||0)),l=n*s;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,r){let{fullCircles:o,startAngle:a,circumference:s}=e,l=e.endAngle;if(o){nB(t,e,i,n,l,r);for(let e=0;en?(c=n/l,t.arc(o,a,l,i+c,r-c,!0)):t.arc(o,a,n,i+tm,r-tm),t.closePath(),t.clip()}(t,e,p),o||(rB(t,e,i,r,p,n),t.stroke())}(t,this,l,n,o),t.restore()}constructor(t){super(),h(this,"circumference",void 0),h(this,"endAngle",void 0),h(this,"fullCircles",void 0),h(this,"innerRadius",void 0),h(this,"outerRadius",void 0),h(this,"pixelMargin",void 0),h(this,"startAngle",void 0),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,t&&Object.assign(this,t)}}function rW(t,e,i=e){t.lineCap=Y(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Y(i.borderDash,e.borderDash)),t.lineDashOffset=Y(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Y(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Y(i.borderWidth,e.borderWidth),t.strokeStyle=Y(i.borderColor,e.borderColor)}function rH(t,e,i){t.lineTo(i.x,i.y)}function rU(t,e,i={}){let r=t.length,{start:n=0,end:o=r-1}=i,{start:a,end:s}=e,l=Math.max(n,a),c=Math.min(o,s);return{count:r,start:l,loop:e.loop,ilen:cs&&o>s)?r+c-l:c-l}}function r$(t,e,i,r){let n,o,a;let{points:s,options:l}=e,{count:c,start:h,loop:u,ilen:d}=rU(s,i,r),f=l.stepped?ec:l.tension||"monotone"===l.cubicInterpolationMode?eh:rH,{move:p=!0,reverse:g}=r||{};for(n=0;n<=d;++n)(o=s[(h+(g?d-n:n))%c]).skip||(p?(t.moveTo(o.x,o.y),p=!1):f(t,a,o,g,l.stepped),a=o);return u&&f(t,a,o=s[(h+(g?d:0))%c],g,l.stepped),!!u}function rq(t,e,i,r){let n,o,a,s,l,c;let h=e.points,{count:u,start:d,ilen:f}=rU(h,i,r),{move:p=!0,reverse:g}=r||{},m=0,b=0,y=t=>(d+(g?f-t:t))%u,v=()=>{s!==l&&(t.lineTo(m,l),t.lineTo(m,s),t.lineTo(m,c))};for(p&&(o=h[y(0)],t.moveTo(o.x,o.y)),n=0;n<=f;++n){if((o=h[y(n)]).skip)continue;let e=o.x,i=o.y,r=0|e;r===a?(il&&(l=i),m=(b*m+e)/++b):(v(),t.lineTo(e,i),a=r,b=0,s=l=i),c=i}v()}function rY(t){let e=t.options,i=e.borderDash&&e.borderDash.length,r=!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i;return r?rq:r$}h(rV,"id","arc"),h(rV,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),h(rV,"defaultRoutes",{backgroundColor:"backgroundColor"}),h(rV,"descriptors",{_scriptable:!0,_indexable:t=>"borderDash"!==t});const rG="function"==typeof Path2D;class rX extends rr{updateControlPoints(t,e){let i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){let r=i.spanGaps?this._loop:this._fullLoop;!/** +t.beginPath(),t.arc(o,a,s,n-c,i+c),l>r?(c=r/l,t.arc(o,a,l,i+c,n-c,!0)):t.arc(o,a,r,i+tm,n-tm),t.closePath(),t.clip()}(t,e,p),o||(nB(t,e,i,n,p,r),t.stroke())}(t,this,l,r,o),t.restore()}constructor(t){super(),h(this,"circumference",void 0),h(this,"endAngle",void 0),h(this,"fullCircles",void 0),h(this,"innerRadius",void 0),h(this,"outerRadius",void 0),h(this,"pixelMargin",void 0),h(this,"startAngle",void 0),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,t&&Object.assign(this,t)}}function nW(t,e,i=e){t.lineCap=Y(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Y(i.borderDash,e.borderDash)),t.lineDashOffset=Y(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Y(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Y(i.borderWidth,e.borderWidth),t.strokeStyle=Y(i.borderColor,e.borderColor)}function nH(t,e,i){t.lineTo(i.x,i.y)}function nU(t,e,i={}){let n=t.length,{start:r=0,end:o=n-1}=i,{start:a,end:s}=e,l=Math.max(r,a),c=Math.min(o,s);return{count:n,start:l,loop:e.loop,ilen:cs&&o>s)?n+c-l:c-l}}function n$(t,e,i,n){let r,o,a;let{points:s,options:l}=e,{count:c,start:h,loop:u,ilen:d}=nU(s,i,n),f=l.stepped?ec:l.tension||"monotone"===l.cubicInterpolationMode?eh:nH,{move:p=!0,reverse:g}=n||{};for(r=0;r<=d;++r)(o=s[(h+(g?d-r:r))%c]).skip||(p?(t.moveTo(o.x,o.y),p=!1):f(t,a,o,g,l.stepped),a=o);return u&&f(t,a,o=s[(h+(g?d:0))%c],g,l.stepped),!!u}function nq(t,e,i,n){let r,o,a,s,l,c;let h=e.points,{count:u,start:d,ilen:f}=nU(h,i,n),{move:p=!0,reverse:g}=n||{},m=0,b=0,y=t=>(d+(g?f-t:t))%u,v=()=>{s!==l&&(t.lineTo(m,l),t.lineTo(m,s),t.lineTo(m,c))};for(p&&(o=h[y(0)],t.moveTo(o.x,o.y)),r=0;r<=f;++r){if((o=h[y(r)]).skip)continue;let e=o.x,i=o.y,n=0|e;n===a?(il&&(l=i),m=(b*m+e)/++b):(v(),t.lineTo(e,i),a=n,b=0,s=l=i),c=i}v()}function nY(t){let e=t.options,i=e.borderDash&&e.borderDash.length,n=!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i;return n?nq:n$}h(nV,"id","arc"),h(nV,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),h(nV,"defaultRoutes",{backgroundColor:"backgroundColor"}),h(nV,"descriptors",{_scriptable:!0,_indexable:t=>"borderDash"!==t});const nG="function"==typeof Path2D;class nX extends nn{updateControlPoints(t,e){let i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){let n=i.spanGaps?this._loop:this._fullLoop;!/** * @private - */function(t,e,i,r,n){let o,a,s,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!/** + */function(t,e,i,n,r){let o,a,s,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!/** * This function calculates Bézier control points in a similar way than |splineCurve|, * but preserves monotonicity of the provided data and ensures no local extremums are added * between the dataset discrete points due to the interpolation. * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation - */function(t,e="x"){let i,r,n;let o=eL(e),a=t.length,s=Array(a).fill(0),l=Array(a),c=eF(t,0);for(i=0;in&&t[o%e].skip;)o--;return{start:n,end:o%=e}}(i,n,o,r);if(!0===r)return e4(t,[{start:a,end:s,loop:o}],i,e);let l=s"borderDash"!==t&&"fill"!==t});class rJ extends rr{inRange(t,e,i){let r=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)t.replace("rgb(","rgba(").replace(")",", 0.5)"));function r4(t){return r8[t%r8.length]}function r7(t){return r6[t%r6.length]}function r9(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function nt(t){if(t._decimated){let e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function ne(t){t.data.datasets.forEach(t=>{nt(t)})}function ni(t,e,i,r){if(r)return;let n=e[t],o=i[t];return"angle"===t&&(n=tD(n),o=tD(o)),{property:t,start:n,end:o}}function nr(t,e,i){for(;e>t;e--){let t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function nn(t,e,i,r){return t&&e?r(t[i],e[i]):t?t[i]:e?e[i]:0}function no(t,e){let i=[],r=!1;return H(t)?(r=!0,i=t):i=function(t,e){let{x:i=null,y:r=null}=t||{},n=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=nr(t,e,n);let a=n[t],s=n[e];null!==r?(o.push({x:a.x,y:r}),o.push({x:s.x,y:r})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:s.y}))}),o}(t,e),i.length?new rX({points:i,options:{tension:0},_loop:r,_fullLoop:r}):null}function na(t){return t&&!1!==t.fill}class ns{pathSegment(t,e,i){let{x:r,y:n,radius:o}=this;return e=e||{start:0,end:td},t.arc(r,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){let{x:e,y:i,radius:r}=this,n=t.angle;return{x:e+Math.cos(n)*r,y:i+Math.sin(n)*r,angle:n}}constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}}function nl(t,e,i){let r=function(t){let{chart:e,fill:i,line:r}=t;if($(i))return function(t,e){let i=t.getDatasetMeta(e),r=i&&t.isDatasetVisible(e);return r?i.dataset:null}(e,i);if("stack"===i)return function(t){let{scale:e,index:i,line:r}=t,n=[],o=r.segments,a=r.points,s=function(t,e){let i=[],r=t.getMatchingVisibleMetas("line");for(let t=0;t{let{boxHeight:i=e,boxWidth:r=e}=t;return t.usePointStyle&&(i=Math.min(i,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:i,itemHeight:Math.max(e,i)}},nf=(t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class np extends rr{update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=Z(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let t,e;let{options:i,ctx:r}=this;if(!i.display){this.width=this.height=0;return}let n=i.labels,o=ex(n.font),a=o.size,s=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=nd(n,a);r.font=o.string,this.isHorizontal()?(t=this.maxWidth,e=this._fitRows(s,a,l,c)+10):(e=this.maxHeight,t=this._fitCols(s,o,l,c)+10),this.width=Math.min(t,i.maxWidth||this.maxWidth),this.height=Math.min(e,i.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){let{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],c=r+a,h=t;n.textAlign="left",n.textBaseline="middle";let u=-1,d=-c;return this.legendItems.forEach((t,f)=>{let p=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+p+2*a>o)&&(h+=c,l[l.length-(f>0?0:1)]=0,d+=c,u++),s[f]={left:0,top:d,row:u,width:p,height:r},l[l.length-1]+=p+a}),h}_fitCols(t,e,i,r){let{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t,h=a,u=0,d=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{let{itemWidth:g,itemHeight:m}=function(t,e,i,r,n){var o;let a,s;let l=((a=r.text)&&"string"!=typeof a&&(a=a.reduce((t,e)=>t.length>e.length?t:e)),t+e.size/2+i.measureText(a).width),c=(o=e.lineHeight,s=n,"string"!=typeof r.text&&(s=ng(r,o)),s);return{itemWidth:l,itemHeight:c}}(i,e,n,t,r);o>0&&d+m+2*a>c&&(h+=u+a,l.push({width:u,height:d}),f+=u+a,p++,u=d=0),s[o]={left:f,top:d,col:p,width:g,height:m},u=Math.max(u,g),d+=m+a}),h+=u,l.push({width:u,height:d}),h}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:n}}=this,o=e0(n,this.left,this.width);if(this.isHorizontal()){let n=0,a=tH(i,this.left+r,this.right-this.lineWidths[n]);for(let s of e)n!==s.row&&(n=s.row,a=tH(i,this.left+r,this.right-this.lineWidths[n])),s.top+=this.top+t+r,s.left=o.leftForLtr(o.x(a),s.width),a+=s.width+r}else{let n=0,a=tH(i,this.top+t+r,this.bottom-this.columnSizes[n].height);for(let s of e)s.col!==n&&(n=s.col,a=tH(i,this.top+t+r,this.bottom-this.columnSizes[n].height)),s.top=a,s.left+=this.left+r,s.left=o.leftForLtr(o.x(s.left),s.width),a+=s.height+r}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){let t=this.ctx;es(t,this),this._draw(),el(t)}}_draw(){let t;let{options:e,columnSizes:i,lineWidths:r,ctx:n}=this,{align:o,labels:a}=e,s=et.color,l=e0(e.rtl,this.left,this.width),c=ex(a.font),{padding:h}=a,u=c.size,d=u/2;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;let{boxWidth:f,boxHeight:p,itemHeight:g}=nd(a,u),m=function(t,e,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;n.save();let r=Y(i.lineWidth,1);if(n.fillStyle=Y(i.fillStyle,s),n.lineCap=Y(i.lineCap,"butt"),n.lineDashOffset=Y(i.lineDashOffset,0),n.lineJoin=Y(i.lineJoin,"miter"),n.lineWidth=r,n.strokeStyle=Y(i.strokeStyle,s),n.setLineDash(Y(i.lineDash,[])),a.usePointStyle){let o={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:r},s=l.xPlus(t,f/2);eo(n,o,s,e+d,a.pointStyleWidth&&f)}else{let o=e+Math.max((u-p)/2,0),a=l.leftForLtr(t,f),s=ey(i.borderRadius);n.beginPath(),Object.values(s).some(t=>0!==t)?ed(n,{x:a,y:o,w:f,h:p,radius:s}):n.rect(a,o,f,p),n.fill(),0!==r&&n.stroke()}n.restore()},b=function(t,e,i){eu(n,i.text,t,e+g/2,c,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})},y=this.isHorizontal(),v=this._computeTitleHeight();t=y?{x:tH(o,this.left+h,this.right-r[0]),y:this.top+h+v,line:0}:{x:this.left+h,y:tH(o,this.top+v+h,this.bottom-i[0].height),line:0},e1(this.ctx,e.textDirection);let x=g+h;this.legendItems.forEach((s,u)=>{n.strokeStyle=s.fontColor,n.fillStyle=s.fontColor;let p=n.measureText(s.text).width,g=l.textAlign(s.textAlign||(s.textAlign=a.textAlign)),_=f+d+p,w=t.x,S=t.y;l.setWidth(this.width),y?u>0&&w+_+h>this.right&&(S=t.y+=x,t.line++,w=t.x=tH(o,this.left+h,this.right-r[t.line])):u>0&&S+x>this.bottom&&(w=t.x=w+i[t.line].width+h,t.line++,S=t.y=tH(o,this.top+v+h,this.bottom-i[t.line].height));let O=l.x(w);if(m(O,S,s),w=tU(g,w+f+d,y?w+_:this.right,e.rtl),b(l.x(w),S,s),y)t.x+=_+h;else if("string"!=typeof s.text){let e=c.lineHeight;t.y+=ng(s,e)+h}else t.y+=x}),e2(this.ctx,e.textDirection)}drawTitle(){let t;let e=this.options,i=e.title,r=ex(i.font),n=ev(i.padding);if(!i.display)return;let o=e0(e.rtl,this.left,this.width),a=this.ctx,s=i.position,l=r.size/2,c=n.top+l,h=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),t=this.top+c,h=tH(e.align,h,this.right-u);else{let i=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);t=c+tH(e.align,this.top,this.bottom-i-e.labels.padding-this._computeTitleHeight())}let d=tH(s,h,h+u);a.textAlign=o.textAlign(tW(s)),a.textBaseline="middle",a.strokeStyle=i.color,a.fillStyle=i.color,a.font=r.string,eu(a,i.text,d,t,r)}_computeTitleHeight(){let t=this.options.title,e=ex(t.font),i=ev(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,n;if(tC(t,this.left,this.right)&&tC(e,this.top,this.bottom)){for(i=0,n=this.legendHitBoxes;i-1?t.split("\n"):t}function n_(t,e){let i=t.chart.ctx,{body:r,footer:n,title:o}=t,{boxWidth:a,boxHeight:s}=e,l=ex(e.bodyFont),c=ex(e.titleFont),h=ex(e.footerFont),u=o.length,d=n.length,f=r.length,p=ev(e.padding),g=p.height,m=0,b=r.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(g+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){let t=e.displayColors?Math.max(s,l.lineHeight):l.lineHeight;g+=f*t+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*h.lineHeight+(d-1)*e.footerSpacing);let y=0,v=function(t){m=Math.max(m,i.measureText(t).width+y)};return i.save(),i.font=c.string,J(t.title,v),i.font=l.string,J(t.beforeBody.concat(t.afterBody),v),y=e.displayColors?a+2+e.boxPadding:0,J(r,t=>{J(t.before,v),J(t.lines,v),J(t.after,v)}),y=0,i.font=h.string,J(t.footer,v),i.restore(),{width:m+=p.width,height:g}}function nw(t,e,i){let r=i.yAlign||e.yAlign||function(t,e){let{y:i,height:r}=e;return it.height-r/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||function(t,e,i,r){let{x:n,width:o}=i,{width:a,chartArea:{left:s,right:l}}=t,c="center";return"center"===r?c=n<=(s+l)/2?"left":"right":n<=o/2?c="left":n>=a-o/2&&(c="right"),function(t,e,i,r){let{x:n,width:o}=r,a=i.caretSize+i.caretPadding;if("left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0)return!0}(c,t,e,i)&&(c="center"),c}(t,e,i,r),yAlign:r}}function nS(t,e,i,r){let{caretSize:n,caretPadding:o,cornerRadius:a}=t,{xAlign:s,yAlign:l}=i,c=n+o,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=ey(a),p=function(t,e){let{x:i,width:r}=t;return"right"===e?i-=r:"center"===e&&(i-=r/2),i}(e,s),g=function(t,e,i){let{y:r,height:n}=t;return"top"===e?r+=i:"bottom"===e?r-=n+i:r-=n/2,r}(e,l,c);return"center"===l?"left"===s?p+=c:"right"===s&&(p-=c):"left"===s?p-=Math.max(h,d)+n:"right"===s&&(p+=Math.max(u,f)+n),{x:tR(p,0,r.width-e.width),y:tR(g,0,r.height-e.height)}}function nO(t,e,i){let r=ev(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-r.right:t.x+r.left}function nM(t,e){let i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const nk={beforeTitle:B,title(t){if(t.length>0){let e=t[0],i=e.chart.data.labels,r=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex{let e={before:[],lines:[],after:[]},n=nM(i,t);nv(e.before,nx(nP(n,"beforeLabel",this,t))),nv(e.lines,nP(n,"label",this,t)),nv(e.after,nx(nP(n,"afterLabel",this,t))),r.push(e)}),r}getAfterBody(t,e){return nv([],nx(nP(e.callbacks,"afterBody",this,t)))}getFooter(t,e){let{callbacks:i}=e,r=nP(i,"beforeFooter",this,t),n=nP(i,"footer",this,t),o=nP(i,"afterFooter",this,t),a=[];return a=nv(a,nx(r)),a=nv(a,nx(n)),a=nv(a,nx(o))}_createItems(t){let e,i;let r=this._active,n=this.chart.data,o=[],a=[],s=[],l=[];for(e=0,i=r.length;et.filter(e,i,r,n))),t.itemSort&&(l=l.sort((e,i)=>t.itemSort(e,i,n))),J(l,e=>{let i=nM(t.callbacks,e);o.push(nP(i,"labelColor",this,e)),a.push(nP(i,"labelPointStyle",this,e)),s.push(nP(i,"labelTextColor",this,e))}),this.labelColors=o,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){let i;let r=this.options.setContext(this.getContext()),n=this._active,o=[];if(n.length){let t=ny[r.position].call(this,n,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);let e=this._size=n_(this,r),a=Object.assign({},t,e),s=nw(this.chart,r,a),l=nS(r,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){let n=this.getCaretPosition(t,i,r);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){let r,n,o,a,s,l;let{xAlign:c,yAlign:h}=this,{caretSize:u,cornerRadius:d}=i,{topLeft:f,topRight:p,bottomLeft:g,bottomRight:m}=ey(d),{x:b,y:y}=t,{width:v,height:x}=e;return"center"===h?(s=y+x/2,"left"===c?(n=(r=b)-u,a=s+u,l=s-u):(n=(r=b+v)+u,a=s-u,l=s+u),o=r):(n="left"===c?b+Math.max(f,g)+u:"right"===c?b+v-Math.max(p,m)-u:this.caretX,"top"===h?(s=(a=y)-u,r=n-u,o=n+u):(s=(a=y+x)+u,r=n+u,o=n-u),l=a),{x1:r,x2:n,x3:o,y1:a,y2:s,y3:l}}drawTitle(t,e,i){let r,n,o;let a=this.title,s=a.length;if(s){let l=e0(i.rtl,this.x,this.width);for(o=0,t.x=nO(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=ex(i.titleFont),n=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string;o0!==t)?(t.beginPath(),t.fillStyle=n.multiKeyBackground,ed(t,{x:e,y:f,w:l,h:s,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ed(t,{x:i,y:f+1,w:l-2,h:s-2,radius:a}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,f,l,s),t.strokeRect(e,f,l,s),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,s-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let r,n,o,a,s,l,c;let{body:h}=this,{bodySpacing:u,bodyAlign:d,displayColors:f,boxHeight:p,boxWidth:g,boxPadding:m}=i,b=ex(i.bodyFont),y=b.lineHeight,v=0,x=e0(i.rtl,this.x,this.width),_=function(i){e.fillText(i,x.x(t.x+v),t.y+y/2),t.y+=y+u},w=x.textAlign(d);for(e.textAlign=d,e.textBaseline="middle",e.font=b.string,t.x=nO(this,w,i),e.fillStyle=i.bodyColor,J(this.beforeBody,_),v=f&&"right"!==w?"center"===d?g/2+m:g+2+m:0,a=0,l=h.length;a0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,r=i&&i.x,n=i&&i.y;if(r||n){let i=ny[t.position].call(this,this._active,this._eventPosition);if(!i)return;let o=this._size=n_(this,t),a=Object.assign({},i,this._size),s=nw(e,t,a),l=nS(t,a,s,e);(r._to!==l.x||n._to!==l.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let r={width:this.width,height:this.height},n={x:this.x,y:this.y};i=.001>Math.abs(i)?0:i;let o=ev(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,r,e),e1(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),e2(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,r=t.map(({datasetIndex:t,index:e})=>{let i=this.chart.getDatasetMeta(t);if(!i)throw Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),n=!K(i,r),o=this._positionChanged(r,e);(n||o)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),a=this._positionChanged(o,t),s=e||!K(o,n)||a;return s&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}_getActiveElements(t,e,i,r){let n=this.options;if("mouseout"===t.type)return[];if(!r)return e;let o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){let{caretX:i,caretY:r,options:n}=this,o=ny[n.position].call(this,t,e);return!1!==o&&(i!==o.x||r!==o.y)}constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}}h(nE,"positioners",ny);var nA=/*#__PURE__*/Object.freeze({__proto__:null,Colors:{id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){let r;if(!i.enabled)return;let{data:{datasets:n},options:o}=t.config,{elements:a}=o;if(!i.forceOverride&&(r9(n)||o&&(o.borderColor||o.backgroundColor)||a&&r9(a)))return;let s=(r=0,(e,i)=>{var n,o,a;let s=t.getDatasetMeta(i).controller;s instanceof iM?(n=r,e.backgroundColor=e.data.map(()=>r4(n++)),r=n):s instanceof iP?(o=r,e.backgroundColor=e.data.map(()=>r7(o++)),r=o):s&&(a=r,e.borderColor=r4(a),e.backgroundColor=r7(a),r=++a)});n.forEach(s)}},Decimation:{id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled){ne(t);return}let r=t.width;t.data.datasets.forEach((e,n)=>{let o;let{_data:a,indexAxis:s}=e,l=t.getDatasetMeta(n),c=a||e.data;if("y"===e_([s,t.options.indexAxis])||!l.controller.supportsDecimation)return;let h=t.scales[l.xAxisID];if("linear"!==h.type&&"time"!==h.type||t.options.parsing)return;let{start:u,count:d}=function(t,e){let i;let r=e.length,n=0,{iScale:o}=t,{min:a,max:s,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(n=tR(tI(e,o.axis,a).lo,0,r-1)),i=c?tR(tI(e,o.axis,s).hi+1,n,r)-n:r-n,{start:n,count:i}}(l,c),f=i.threshold||4*r;if(d<=f){nt(e);return}switch(W(a)&&(e._data=c,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":o=function(t,e,i,r,n){let o,a,s,l,c;let h=n.samples||r;if(h>=i)return t.slice(e,e+i);let u=[],d=(i-2)/(h-2),f=0,p=e+i-1,g=e;for(o=0,u[f++]=t[g];os&&(s=l,a=t[r],c=r);u[f++]=a,g=c}return u[f++]=t[p],u}(c,u,d,r,i);break;case"min-max":o=function(t,e,i,r){let n,o,a,s,l,c,h,u,d,f,p=0,g=0,m=[],b=t[e].x,y=t[e+i-1].x,v=y-b;for(n=e;nf&&(f=s,h=n),p=(g*p+o.x)/++g;else{let i=n-1;if(!W(c)&&!W(h)){let e=Math.min(c,h),r=Math.max(c,h);e!==u&&e!==i&&m.push({...t[e],x:p}),r!==u&&r!==i&&m.push({...t[r],x:p})}n>0&&i!==u&&m.push(t[i]),m.push(o),l=e,g=0,d=f=s,c=h=u=n}}return m}(c,u,d,r);break;default:throw Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=o})},destroy(t){ne(t)}},Filler:{id:"filler",afterDatasetsUpdate(t,e,i){let r,n,o,a;let s=(t.data.datasets||[]).length,l=[];for(n=0;n=i)&&n):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}(o,n,s),chart:t,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=a,l.push(a);for(n=0;n=0;--e){let i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),r&&i.fill&&nl(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;let r=t.getSortedVisibleDatasetMetas();for(let e=r.length-1;e>=0;--e){let i=r[e].$filler;na(i)&&nl(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){let r=e.meta.$filler;na(r)&&"beforeDatasetDraw"===i.drawTime&&nl(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Legend:{id:"legend",_element:np,start(t,e,i){let r=t.legend=new np({ctx:t.ctx,options:i,chart:t});iX.configure(t,r,i),iX.addBox(t,r)},stop(t){iX.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){let r=t.legend;iX.configure(t,r,i),r.options=i},afterUpdate(t){let e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){let r=e.datasetIndex,n=i.chart;n.isDatasetVisible(r)?(n.hide(r),e.hidden=!0):(n.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){let e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:r,textAlign:n,color:o,useBorderRadius:a,borderRadius:s}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{let l=t.controller.getStyle(i?0:void 0),c=ev(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.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:n||l.textAlign,borderRadius:a&&(s||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}},SubTitle:{id:"subtitle",start(t,e,i){let r=new nm({ctx:t.ctx,options:i,chart:t});iX.configure(t,r,i),iX.addBox(t,r),nb.set(t,r)},stop(t){iX.removeBox(t,nb.get(t)),nb.delete(t)},beforeUpdate(t,e,i){let r=nb.get(t);iX.configure(t,r,i),r.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Title:{id:"title",_element:nm,start(t,e,i){!function(t,e){let i=new nm({ctx:t.ctx,options:e,chart:t});iX.configure(t,i,e),iX.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){let e=t.titleBlock;iX.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){let r=t.titleBlock;iX.configure(t,r,i),r.options=i},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}},Tooltip:{id:"tooltip",_element:nE,positioners:ny,afterInit(t,e,i){i&&(t.tooltip=new nE({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){let e=t.tooltip;if(e&&e._willRender()){let i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){let i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:nk},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]}});const nD=(t,e,i,r)=>("string"==typeof e?(i=t.push(e)-1,r.unshift({index:i,label:e})):isNaN(e)&&(i=null),i),nT=(t,e)=>null===t?null:tR(Math.round(t),0,e);function nR(t){let e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}}function nj(t,e,{horizontal:i,minRotation:r}){let n=tM(r),o=.75*e*(""+t).length;return Math.min(e/((i?Math.sin(n):Math.cos(n))||.001),o)}h(nC,"id","category"),h(nC,"defaults",{ticks:{callback:nR}});class nI extends ru{parse(t,e){return W(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:r,max:n}=this,o=t=>r=e?r:t,a=t=>n=i?n:t;if(t){let t=tx(r),e=tx(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(r===n){let e=0===n?1:Math.abs(.05*n);a(n+e),t||o(r-e)}this.min=r,this.max=n}getTickLimit(){let t;let e=this.options.ticks,{maxTicksLimit:i,stepSize:r}=e;return r?(t=Math.ceil(this.max/r)-Math.floor(this.min/r)+1)>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3):(t=this.computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},n=this._range||this,o=function(t,e){let i,r,n,o;let a=[],{bounds:s,step:l,min:c,max:h,precision:u,count:d,maxTicks:f,maxDigits:p,includeBounds:g}=t,m=l||1,b=f-1,{min:y,max:v}=e,x=!W(c),_=!W(h),w=!W(d),S=(v-y)/(p+1),O=tw((v-y)/b/m)*m;if(O<1e-14&&!x&&!_)return[{value:y},{value:v}];(o=Math.ceil(v/O)-Math.floor(y/O))>b&&(O=tw(o*O/b/m)*m),W(u)||(O=Math.ceil(O*(i=Math.pow(10,u)))/i),"ticks"===s?(r=Math.floor(y/O)*O,n=Math.ceil(v/O)*O):(r=y,n=v),x&&_&&l&&function(t,e){let i=Math.round(t);return i-e<=t&&i+e>=t}((h-c)/l,O/1e3)?(o=Math.round(Math.min((h-c)/O,f)),O=(h-c)/o,r=c,n=h):w?(r=x?c:r,O=((n=_?h:n)-r)/(o=d-1)):o=t_(o=(n-r)/O,Math.round(o),O/1e3)?Math.round(o):Math.ceil(o);let M=Math.max(tk(O),tk(r));r=Math.round(r*(i=Math.pow(10,W(u)?M:u)))/i,n=Math.round(n*i)/i;let k=0;for(x&&(g&&r!==c?(a.push({value:c}),rh)break;a.push({value:t})}return _&&g&&n!==h?a.length&&t_(a[a.length-1].value,h,nj(h,S,t))?a[a.length-1].value=h:a.push({value:h}):_&&n!==h||a.push({value:n}),a}(r,n);return"ticks"===t.bounds&&tO(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return t5(t,this.chart.options.locale,this.options.ticks.format)}constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}}class nF extends nI{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?t:0,this.max=$(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=tM(this.options.ticks.minRotation),r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/((t?Math.sin(i):Math.cos(i))||.001)))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}h(nF,"id","linear"),h(nF,"defaults",{ticks:{callback:t8.formatters.numeric}});const nL=t=>Math.floor(tv(t)),nN=(t,e)=>Math.pow(10,nL(t)+e);function nz(t){let e=t/Math.pow(10,nL(t));return 1===e}function nB(t,e,i){let r=Math.pow(10,i);return Math.ceil(e/r)-Math.floor(t/r)}class nV extends ru{parse(t,e){let i=nI.prototype.parse.apply(this,[t,e]);if(0===i){this._zero=!0;return}return $(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?Math.max(0,t):null,this.max=$(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!$(this._userMin)&&(this.min=t===nN(this.min,0)?nN(this.min,-1):nN(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,r=this.max,n=e=>i=t?i:e,o=t=>r=e?r:t;i===r&&(i<=0?(n(1),o(10)):(n(nN(i,-1)),o(nN(r,1)))),i<=0&&n(nN(r,-1)),r<=0&&o(nN(i,1)),this.min=i,this.max=r}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=function(t,{min:e,max:i}){e=q(t.min,e);let r=[],n=nL(e),o=function(t,e){let i=e-t,r=nL(i);for(;nB(t,e,r)>10;)r++;for(;10>nB(t,e,r);)r--;return Math.min(r,nL(t))}(e,i),a=o<0?Math.pow(10,Math.abs(o)):1,s=Math.pow(10,o),l=n>o?Math.pow(10,n):0,c=Math.round((e-l)*a)/a,h=Math.floor((e-l)/s/10)*s*10,u=Math.floor((c-h)/Math.pow(10,o)),d=q(t.min,Math.round((l+h+u*Math.pow(10,o))*a)/a);for(;d=10?u=u<15?15:20:u++,u>=20&&(u=2,a=++o>=0?1:a),d=Math.round((l+h+u*Math.pow(10,o))*a)/a;let f=q(t.max,d);return r.push({value:f,major:nz(f),significand:u}),r}(e,this);return"ticks"===t.bounds&&tO(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return void 0===t?"0":t5(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=tv(t),this._valueRange=tv(this.max)-tv(t)}getPixelForValue(t){return((void 0===t||0===t)&&(t=this.min),null===t||isNaN(t))?NaN:this.getPixelForDecimal(t===this.min?0:(tv(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}}function nW(t){let e=t.ticks;if(e.display&&t.display){let t=ev(e.backdropPadding);return Y(e.font&&e.font.size,et.font.size)+t.height}return 0}function nH(t,e,i,r,n){return t===r||t===n?{start:e-i/2,end:e+i/2}:tn?{start:e-i,end:e}:{start:e,end:e+i}}function nU(t,e,i,r){let{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,td);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let o=1;o{let i=Z(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){let t=this.options;t.display&&t.pointLabels.display?function(t){let e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),r=[],n=[],o=t._pointLabels.length,a=t.options.pointLabels,s=a.centerPointLabels?tu/o:0;for(let h=0;hr&&t[o%e].skip;)o--;return{start:r,end:o%=e}}(i,r,o,n);if(!0===n)return e4(t,[{start:a,end:s,loop:o}],i,e);let l=s"borderDash"!==t&&"fill"!==t});class nJ extends nn{inRange(t,e,i){let n=this.options,{x:r,y:o}=this.getProps(["x","y"],i);return Math.pow(t-r,2)+Math.pow(e-o,2)t.replace("rgb(","rgba(").replace(")",", 0.5)"));function n4(t){return n8[t%n8.length]}function n9(t){return n6[t%n6.length]}function n7(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function rt(t){if(t._decimated){let e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function re(t){t.data.datasets.forEach(t=>{rt(t)})}function ri(t,e,i,n){if(n)return;let r=e[t],o=i[t];return"angle"===t&&(r=tD(r),o=tD(o)),{property:t,start:r,end:o}}function rn(t,e,i){for(;e>t;e--){let t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function rr(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function ro(t,e){let i=[],n=!1;return H(t)?(n=!0,i=t):i=function(t,e){let{x:i=null,y:n=null}=t||{},r=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=rn(t,e,r);let a=r[t],s=r[e];null!==n?(o.push({x:a.x,y:n}),o.push({x:s.x,y:n})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:s.y}))}),o}(t,e),i.length?new nX({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function ra(t){return t&&!1!==t.fill}class rs{pathSegment(t,e,i){let{x:n,y:r,radius:o}=this;return e=e||{start:0,end:td},t.arc(n,r,o,e.end,e.start,!0),!i.bounds}interpolate(t){let{x:e,y:i,radius:n}=this,r=t.angle;return{x:e+Math.cos(r)*n,y:i+Math.sin(r)*n,angle:r}}constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}}function rl(t,e,i){let n=function(t){let{chart:e,fill:i,line:n}=t;if($(i))return function(t,e){let i=t.getDatasetMeta(e),n=i&&t.isDatasetVisible(e);return n?i.dataset:null}(e,i);if("stack"===i)return function(t){let{scale:e,index:i,line:n}=t,r=[],o=n.segments,a=n.points,s=function(t,e){let i=[],n=t.getMatchingVisibleMetas("line");for(let t=0;t{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}},rf=(t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class rp extends nn{update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=Z(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let t,e;let{options:i,ctx:n}=this;if(!i.display){this.width=this.height=0;return}let r=i.labels,o=ex(r.font),a=o.size,s=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=rd(r,a);n.font=o.string,this.isHorizontal()?(t=this.maxWidth,e=this._fitRows(s,a,l,c)+10):(e=this.maxHeight,t=this._fitCols(s,o,l,c)+10),this.width=Math.min(t,i.maxWidth||this.maxWidth),this.height=Math.min(e,i.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){let{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+a,h=t;r.textAlign="left",r.textBaseline="middle";let u=-1,d=-c;return this.legendItems.forEach((t,f)=>{let p=i+e/2+r.measureText(t.text).width;(0===f||l[l.length-1]+p+2*a>o)&&(h+=c,l[l.length-(f>0?0:1)]=0,d+=c,u++),s[f]={left:0,top:d,row:u,width:p,height:n},l[l.length-1]+=p+a}),h}_fitCols(t,e,i,n){let{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t,h=a,u=0,d=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{let{itemWidth:g,itemHeight:m}=function(t,e,i,n,r){var o;let a,s;let l=((a=n.text)&&"string"!=typeof a&&(a=a.reduce((t,e)=>t.length>e.length?t:e)),t+e.size/2+i.measureText(a).width),c=(o=e.lineHeight,s=r,"string"!=typeof n.text&&(s=rg(n,o)),s);return{itemWidth:l,itemHeight:c}}(i,e,r,t,n);o>0&&d+m+2*a>c&&(h+=u+a,l.push({width:u,height:d}),f+=u+a,p++,u=d=0),s[o]={left:f,top:d,col:p,width:g,height:m},u=Math.max(u,g),d+=m+a}),h+=u,l.push({width:u,height:d}),h}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:r}}=this,o=e0(r,this.left,this.width);if(this.isHorizontal()){let r=0,a=tH(i,this.left+n,this.right-this.lineWidths[r]);for(let s of e)r!==s.row&&(r=s.row,a=tH(i,this.left+n,this.right-this.lineWidths[r])),s.top+=this.top+t+n,s.left=o.leftForLtr(o.x(a),s.width),a+=s.width+n}else{let r=0,a=tH(i,this.top+t+n,this.bottom-this.columnSizes[r].height);for(let s of e)s.col!==r&&(r=s.col,a=tH(i,this.top+t+n,this.bottom-this.columnSizes[r].height)),s.top=a,s.left+=this.left+n,s.left=o.leftForLtr(o.x(s.left),s.width),a+=s.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){let t=this.ctx;es(t,this),this._draw(),el(t)}}_draw(){let t;let{options:e,columnSizes:i,lineWidths:n,ctx:r}=this,{align:o,labels:a}=e,s=et.color,l=e0(e.rtl,this.left,this.width),c=ex(a.font),{padding:h}=a,u=c.size,d=u/2;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=c.string;let{boxWidth:f,boxHeight:p,itemHeight:g}=rd(a,u),m=function(t,e,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;r.save();let n=Y(i.lineWidth,1);if(r.fillStyle=Y(i.fillStyle,s),r.lineCap=Y(i.lineCap,"butt"),r.lineDashOffset=Y(i.lineDashOffset,0),r.lineJoin=Y(i.lineJoin,"miter"),r.lineWidth=n,r.strokeStyle=Y(i.strokeStyle,s),r.setLineDash(Y(i.lineDash,[])),a.usePointStyle){let o={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},s=l.xPlus(t,f/2);eo(r,o,s,e+d,a.pointStyleWidth&&f)}else{let o=e+Math.max((u-p)/2,0),a=l.leftForLtr(t,f),s=ey(i.borderRadius);r.beginPath(),Object.values(s).some(t=>0!==t)?ed(r,{x:a,y:o,w:f,h:p,radius:s}):r.rect(a,o,f,p),r.fill(),0!==n&&r.stroke()}r.restore()},b=function(t,e,i){eu(r,i.text,t,e+g/2,c,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})},y=this.isHorizontal(),v=this._computeTitleHeight();t=y?{x:tH(o,this.left+h,this.right-n[0]),y:this.top+h+v,line:0}:{x:this.left+h,y:tH(o,this.top+v+h,this.bottom-i[0].height),line:0},e1(this.ctx,e.textDirection);let x=g+h;this.legendItems.forEach((s,u)=>{r.strokeStyle=s.fontColor,r.fillStyle=s.fontColor;let p=r.measureText(s.text).width,g=l.textAlign(s.textAlign||(s.textAlign=a.textAlign)),_=f+d+p,w=t.x,S=t.y;l.setWidth(this.width),y?u>0&&w+_+h>this.right&&(S=t.y+=x,t.line++,w=t.x=tH(o,this.left+h,this.right-n[t.line])):u>0&&S+x>this.bottom&&(w=t.x=w+i[t.line].width+h,t.line++,S=t.y=tH(o,this.top+v+h,this.bottom-i[t.line].height));let O=l.x(w);if(m(O,S,s),w=tU(g,w+f+d,y?w+_:this.right,e.rtl),b(l.x(w),S,s),y)t.x+=_+h;else if("string"!=typeof s.text){let e=c.lineHeight;t.y+=rg(s,e)+h}else t.y+=x}),e2(this.ctx,e.textDirection)}drawTitle(){let t;let e=this.options,i=e.title,n=ex(i.font),r=ev(i.padding);if(!i.display)return;let o=e0(e.rtl,this.left,this.width),a=this.ctx,s=i.position,l=n.size/2,c=r.top+l,h=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),t=this.top+c,h=tH(e.align,h,this.right-u);else{let i=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);t=c+tH(e.align,this.top,this.bottom-i-e.labels.padding-this._computeTitleHeight())}let d=tH(s,h,h+u);a.textAlign=o.textAlign(tW(s)),a.textBaseline="middle",a.strokeStyle=i.color,a.fillStyle=i.color,a.font=n.string,eu(a,i.text,d,t,n)}_computeTitleHeight(){let t=this.options.title,e=ex(t.font),i=ev(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if(tC(t,this.left,this.right)&&tC(e,this.top,this.bottom)){for(i=0,r=this.legendHitBoxes;i-1?t.split("\n"):t}function r_(t,e){let i=t.chart.ctx,{body:n,footer:r,title:o}=t,{boxWidth:a,boxHeight:s}=e,l=ex(e.bodyFont),c=ex(e.titleFont),h=ex(e.footerFont),u=o.length,d=r.length,f=n.length,p=ev(e.padding),g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(g+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){let t=e.displayColors?Math.max(s,l.lineHeight):l.lineHeight;g+=f*t+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*h.lineHeight+(d-1)*e.footerSpacing);let y=0,v=function(t){m=Math.max(m,i.measureText(t).width+y)};return i.save(),i.font=c.string,J(t.title,v),i.font=l.string,J(t.beforeBody.concat(t.afterBody),v),y=e.displayColors?a+2+e.boxPadding:0,J(n,t=>{J(t.before,v),J(t.lines,v),J(t.after,v)}),y=0,i.font=h.string,J(t.footer,v),i.restore(),{width:m+=p.width,height:g}}function rw(t,e,i){let n=i.yAlign||e.yAlign||function(t,e){let{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||function(t,e,i,n){let{x:r,width:o}=i,{width:a,chartArea:{left:s,right:l}}=t,c="center";return"center"===n?c=r<=(s+l)/2?"left":"right":r<=o/2?c="left":r>=a-o/2&&(c="right"),function(t,e,i,n){let{x:r,width:o}=n,a=i.caretSize+i.caretPadding;if("left"===t&&r+o+a>e.width||"right"===t&&r-o-a<0)return!0}(c,t,e,i)&&(c="center"),c}(t,e,i,n),yAlign:n}}function rS(t,e,i,n){let{caretSize:r,caretPadding:o,cornerRadius:a}=t,{xAlign:s,yAlign:l}=i,c=r+o,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=ey(a),p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,s),g=function(t,e,i){let{y:n,height:r}=t;return"top"===e?n+=i:"bottom"===e?n-=r+i:n-=r/2,n}(e,l,c);return"center"===l?"left"===s?p+=c:"right"===s&&(p-=c):"left"===s?p-=Math.max(h,d)+r:"right"===s&&(p+=Math.max(u,f)+r),{x:tR(p,0,n.width-e.width),y:tR(g,0,n.height-e.height)}}function rO(t,e,i){let n=ev(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function rM(t,e){let i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const rk={beforeTitle:B,title(t){if(t.length>0){let e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex{let e={before:[],lines:[],after:[]},r=rM(i,t);rv(e.before,rx(rP(r,"beforeLabel",this,t))),rv(e.lines,rP(r,"label",this,t)),rv(e.after,rx(rP(r,"afterLabel",this,t))),n.push(e)}),n}getAfterBody(t,e){return rv([],rx(rP(e.callbacks,"afterBody",this,t)))}getFooter(t,e){let{callbacks:i}=e,n=rP(i,"beforeFooter",this,t),r=rP(i,"footer",this,t),o=rP(i,"afterFooter",this,t),a=[];return a=rv(a,rx(n)),a=rv(a,rx(r)),a=rv(a,rx(o))}_createItems(t){let e,i;let n=this._active,r=this.chart.data,o=[],a=[],s=[],l=[];for(e=0,i=n.length;et.filter(e,i,n,r))),t.itemSort&&(l=l.sort((e,i)=>t.itemSort(e,i,r))),J(l,e=>{let i=rM(t.callbacks,e);o.push(rP(i,"labelColor",this,e)),a.push(rP(i,"labelPointStyle",this,e)),s.push(rP(i,"labelTextColor",this,e))}),this.labelColors=o,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){let i;let n=this.options.setContext(this.getContext()),r=this._active,o=[];if(r.length){let t=ry[n.position].call(this,r,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);let e=this._size=r_(this,n),a=Object.assign({},t,e),s=rw(this.chart,n,a),l=rS(n,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){let r=this.getCaretPosition(t,i,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){let n,r,o,a,s,l;let{xAlign:c,yAlign:h}=this,{caretSize:u,cornerRadius:d}=i,{topLeft:f,topRight:p,bottomLeft:g,bottomRight:m}=ey(d),{x:b,y:y}=t,{width:v,height:x}=e;return"center"===h?(s=y+x/2,"left"===c?(r=(n=b)-u,a=s+u,l=s-u):(r=(n=b+v)+u,a=s-u,l=s+u),o=n):(r="left"===c?b+Math.max(f,g)+u:"right"===c?b+v-Math.max(p,m)-u:this.caretX,"top"===h?(s=(a=y)-u,n=r-u,o=r+u):(s=(a=y+x)+u,n=r+u,o=r-u),l=a),{x1:n,x2:r,x3:o,y1:a,y2:s,y3:l}}drawTitle(t,e,i){let n,r,o;let a=this.title,s=a.length;if(s){let l=e0(i.rtl,this.x,this.width);for(o=0,t.x=rO(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",n=ex(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=n.string;o0!==t)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ed(t,{x:e,y:f,w:l,h:s,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ed(t,{x:i,y:f+1,w:l-2,h:s-2,radius:a}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,f,l,s),t.strokeRect(e,f,l,s),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,s-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let n,r,o,a,s,l,c;let{body:h}=this,{bodySpacing:u,bodyAlign:d,displayColors:f,boxHeight:p,boxWidth:g,boxPadding:m}=i,b=ex(i.bodyFont),y=b.lineHeight,v=0,x=e0(i.rtl,this.x,this.width),_=function(i){e.fillText(i,x.x(t.x+v),t.y+y/2),t.y+=y+u},w=x.textAlign(d);for(e.textAlign=d,e.textBaseline="middle",e.font=b.string,t.x=rO(this,w,i),e.fillStyle=i.bodyColor,J(this.beforeBody,_),v=f&&"right"!==w?"center"===d?g/2+m:g+2+m:0,a=0,l=h.length;a0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){let i=ry[t.position].call(this,this._active,this._eventPosition);if(!i)return;let o=this._size=r_(this,t),a=Object.assign({},i,this._size),s=rw(e,t,a),l=rS(t,a,s,e);(n._to!==l.x||r._to!==l.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=.001>Math.abs(i)?0:i;let o=ev(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,n,e),e1(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),e2(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,n=t.map(({datasetIndex:t,index:e})=>{let i=this.chart.getDatasetMeta(t);if(!i)throw Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),r=!K(i,n),o=this._positionChanged(n,e);(r||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let n=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),s=e||!K(o,r)||a;return s&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}_getActiveElements(t,e,i,n){let r=this.options;if("mouseout"===t.type)return[];if(!n)return e;let o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){let{caretX:i,caretY:n,options:r}=this,o=ry[r.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}}h(rE,"positioners",ry);var rA=/*#__PURE__*/Object.freeze({__proto__:null,Colors:{id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){let n;if(!i.enabled)return;let{data:{datasets:r},options:o}=t.config,{elements:a}=o;if(!i.forceOverride&&(n7(r)||o&&(o.borderColor||o.backgroundColor)||a&&n7(a)))return;let s=(n=0,(e,i)=>{var r,o,a;let s=t.getDatasetMeta(i).controller;s instanceof iM?(r=n,e.backgroundColor=e.data.map(()=>n4(r++)),n=r):s instanceof iP?(o=n,e.backgroundColor=e.data.map(()=>n9(o++)),n=o):s&&(a=n,e.borderColor=n4(a),e.backgroundColor=n9(a),n=++a)});r.forEach(s)}},Decimation:{id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled){re(t);return}let n=t.width;t.data.datasets.forEach((e,r)=>{let o;let{_data:a,indexAxis:s}=e,l=t.getDatasetMeta(r),c=a||e.data;if("y"===e_([s,t.options.indexAxis])||!l.controller.supportsDecimation)return;let h=t.scales[l.xAxisID];if("linear"!==h.type&&"time"!==h.type||t.options.parsing)return;let{start:u,count:d}=function(t,e){let i;let n=e.length,r=0,{iScale:o}=t,{min:a,max:s,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(r=tR(tI(e,o.axis,a).lo,0,n-1)),i=c?tR(tI(e,o.axis,s).hi+1,r,n)-r:n-r,{start:r,count:i}}(l,c),f=i.threshold||4*n;if(d<=f){rt(e);return}switch(W(a)&&(e._data=c,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":o=function(t,e,i,n,r){let o,a,s,l,c;let h=r.samples||n;if(h>=i)return t.slice(e,e+i);let u=[],d=(i-2)/(h-2),f=0,p=e+i-1,g=e;for(o=0,u[f++]=t[g];os&&(s=l,a=t[n],c=n);u[f++]=a,g=c}return u[f++]=t[p],u}(c,u,d,n,i);break;case"min-max":o=function(t,e,i,n){let r,o,a,s,l,c,h,u,d,f,p=0,g=0,m=[],b=t[e].x,y=t[e+i-1].x,v=y-b;for(r=e;rf&&(f=s,h=r),p=(g*p+o.x)/++g;else{let i=r-1;if(!W(c)&&!W(h)){let e=Math.min(c,h),n=Math.max(c,h);e!==u&&e!==i&&m.push({...t[e],x:p}),n!==u&&n!==i&&m.push({...t[n],x:p})}r>0&&i!==u&&m.push(t[i]),m.push(o),l=e,g=0,d=f=s,c=h=u=r}}return m}(c,u,d,n);break;default:throw Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=o})},destroy(t){re(t)}},Filler:{id:"filler",afterDatasetsUpdate(t,e,i){let n,r,o,a;let s=(t.data.datasets||[]).length,l=[];for(r=0;r=i)&&r):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}(o,r,s),chart:t,axis:n.controller.options.indexAxis,scale:n.vScale,line:o}),n.$filler=a,l.push(a);for(r=0;r=0;--e){let i=r[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),n&&i.fill&&rl(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;let n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){let i=n[e].$filler;ra(i)&&rl(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){let n=e.meta.$filler;ra(n)&&"beforeDatasetDraw"===i.drawTime&&rl(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Legend:{id:"legend",_element:rp,start(t,e,i){let n=t.legend=new rp({ctx:t.ctx,options:i,chart:t});iX.configure(t,n,i),iX.addBox(t,n)},stop(t){iX.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){let n=t.legend;iX.configure(t,n,i),n.options=i},afterUpdate(t){let e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){let n=e.datasetIndex,r=i.chart;r.isDatasetVisible(n)?(r.hide(n),e.hidden=!0):(r.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){let e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:r,color:o,useBorderRadius:a,borderRadius:s}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{let l=t.controller.getStyle(i?0:void 0),c=ev(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:r||l.textAlign,borderRadius:a&&(s||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}},SubTitle:{id:"subtitle",start(t,e,i){let n=new rm({ctx:t.ctx,options:i,chart:t});iX.configure(t,n,i),iX.addBox(t,n),rb.set(t,n)},stop(t){iX.removeBox(t,rb.get(t)),rb.delete(t)},beforeUpdate(t,e,i){let n=rb.get(t);iX.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Title:{id:"title",_element:rm,start(t,e,i){!function(t,e){let i=new rm({ctx:t.ctx,options:e,chart:t});iX.configure(t,i,e),iX.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){let e=t.titleBlock;iX.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){let n=t.titleBlock;iX.configure(t,n,i),n.options=i},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}},Tooltip:{id:"tooltip",_element:rE,positioners:ry,afterInit(t,e,i){i&&(t.tooltip=new rE({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){let e=t.tooltip;if(e&&e._willRender()){let i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){let i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:rk},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]}});const rD=(t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i),rT=(t,e)=>null===t?null:tR(Math.round(t),0,e);function rR(t){let e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}}function rj(t,e,{horizontal:i,minRotation:n}){let r=tM(n),o=.75*e*(""+t).length;return Math.min(e/((i?Math.sin(r):Math.cos(r))||.001),o)}h(rC,"id","category"),h(rC,"defaults",{ticks:{callback:rR}});class rI extends nu{parse(t,e){return W(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:n,max:r}=this,o=t=>n=e?n:t,a=t=>r=i?r:t;if(t){let t=tx(n),e=tx(r);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(n===r){let e=0===r?1:Math.abs(.05*r);a(r+e),t||o(n-e)}this.min=n,this.max=r}getTickLimit(){let t;let e=this.options.ticks,{maxTicksLimit:i,stepSize:n}=e;return n?(t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1)>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3):(t=this.computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let n={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},r=this._range||this,o=function(t,e){let i,n,r,o;let a=[],{bounds:s,step:l,min:c,max:h,precision:u,count:d,maxTicks:f,maxDigits:p,includeBounds:g}=t,m=l||1,b=f-1,{min:y,max:v}=e,x=!W(c),_=!W(h),w=!W(d),S=(v-y)/(p+1),O=tw((v-y)/b/m)*m;if(O<1e-14&&!x&&!_)return[{value:y},{value:v}];(o=Math.ceil(v/O)-Math.floor(y/O))>b&&(O=tw(o*O/b/m)*m),W(u)||(O=Math.ceil(O*(i=Math.pow(10,u)))/i),"ticks"===s?(n=Math.floor(y/O)*O,r=Math.ceil(v/O)*O):(n=y,r=v),x&&_&&l&&function(t,e){let i=Math.round(t);return i-e<=t&&i+e>=t}((h-c)/l,O/1e3)?(o=Math.round(Math.min((h-c)/O,f)),O=(h-c)/o,n=c,r=h):w?(n=x?c:n,O=((r=_?h:r)-n)/(o=d-1)):o=t_(o=(r-n)/O,Math.round(o),O/1e3)?Math.round(o):Math.ceil(o);let M=Math.max(tk(O),tk(n));n=Math.round(n*(i=Math.pow(10,W(u)?M:u)))/i,r=Math.round(r*i)/i;let k=0;for(x&&(g&&n!==c?(a.push({value:c}),nh)break;a.push({value:t})}return _&&g&&r!==h?a.length&&t_(a[a.length-1].value,h,rj(h,S,t))?a[a.length-1].value=h:a.push({value:h}):_&&r!==h||a.push({value:r}),a}(n,r);return"ticks"===t.bounds&&tO(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return t5(t,this.chart.options.locale,this.options.ticks.format)}constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}}class rF extends rI{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?t:0,this.max=$(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=tM(this.options.ticks.minRotation),n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/((t?Math.sin(i):Math.cos(i))||.001)))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}h(rF,"id","linear"),h(rF,"defaults",{ticks:{callback:t8.formatters.numeric}});const rL=t=>Math.floor(tv(t)),rN=(t,e)=>Math.pow(10,rL(t)+e);function rz(t){let e=t/Math.pow(10,rL(t));return 1===e}function rB(t,e,i){let n=Math.pow(10,i);return Math.ceil(e/n)-Math.floor(t/n)}class rV extends nu{parse(t,e){let i=rI.prototype.parse.apply(this,[t,e]);if(0===i){this._zero=!0;return}return $(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?Math.max(0,t):null,this.max=$(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!$(this._userMin)&&(this.min=t===rN(this.min,0)?rN(this.min,-1):rN(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,n=this.max,r=e=>i=t?i:e,o=t=>n=e?n:t;i===n&&(i<=0?(r(1),o(10)):(r(rN(i,-1)),o(rN(n,1)))),i<=0&&r(rN(n,-1)),n<=0&&o(rN(i,1)),this.min=i,this.max=n}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=function(t,{min:e,max:i}){e=q(t.min,e);let n=[],r=rL(e),o=function(t,e){let i=e-t,n=rL(i);for(;rB(t,e,n)>10;)n++;for(;10>rB(t,e,n);)n--;return Math.min(n,rL(t))}(e,i),a=o<0?Math.pow(10,Math.abs(o)):1,s=Math.pow(10,o),l=r>o?Math.pow(10,r):0,c=Math.round((e-l)*a)/a,h=Math.floor((e-l)/s/10)*s*10,u=Math.floor((c-h)/Math.pow(10,o)),d=q(t.min,Math.round((l+h+u*Math.pow(10,o))*a)/a);for(;d=10?u=u<15?15:20:u++,u>=20&&(u=2,a=++o>=0?1:a),d=Math.round((l+h+u*Math.pow(10,o))*a)/a;let f=q(t.max,d);return n.push({value:f,major:rz(f),significand:u}),n}(e,this);return"ticks"===t.bounds&&tO(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return void 0===t?"0":t5(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=tv(t),this._valueRange=tv(this.max)-tv(t)}getPixelForValue(t){return((void 0===t||0===t)&&(t=this.min),null===t||isNaN(t))?NaN:this.getPixelForDecimal(t===this.min?0:(tv(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}}function rW(t){let e=t.ticks;if(e.display&&t.display){let t=ev(e.backdropPadding);return Y(e.font&&e.font.size,et.font.size)+t.height}return 0}function rH(t,e,i,n,r){return t===n||t===r?{start:e-i/2,end:e+i/2}:tr?{start:e-i,end:e}:{start:e,end:e+i}}function rU(t,e,i,n){let{ctx:r}=t;if(i)r.arc(t.xCenter,t.yCenter,e,0,td);else{let i=t.getPointPosition(0,e);r.moveTo(i.x,i.y);for(let o=1;o{let i=Z(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){let t=this.options;t.display&&t.pointLabels.display?function(t){let e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],r=[],o=t._pointLabels.length,a=t.options.pointLabels,s=a.centerPointLabels?tu/o:0;for(let h=0;hi.length){for(n=0;ne.r&&(s=(r.end-e.r)/o,t.r=Math.max(t.r,e.r+s)),n.starte.b&&(l=(n.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}(i,e,p,m,b)}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){let r;let n=[],o=t._pointLabels.length,a=t.options,{centerPointLabels:s,display:l}=a.pointLabels,c={extra:nW(a)/2,additionalAngle:s?tu/o:0};for(let a=0;a270||f<90)&&(r-=n),r),g=0===f||180===f?"center":f<180?"left":"right",m=(o=d.x,a=u.w,"right"===g?o-=a:"center"===g&&(o-=a/2),o);return{visible:!0,x:d.x,y:p,textAlign:g,left:m,top:p,right:m+u.w,bottom:p+u.h}}(t,a,c);n.push(o),"auto"===l&&(o.visible=function(t,e){if(!e)return!0;let{left:i,top:r,right:n,bottom:o}=t,a=ea({x:i,y:r},e)||ea({x:i,y:o},e)||ea({x:n,y:r},e)||ea({x:n,y:o},e);return!a}(o,r),o.visible&&(r=o))}return n}(t,r,n)}(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){let e=td/(this._pointLabels.length||1),i=this.options.startAngle||0;return tD(t*e+tM(i))}getDistanceFromCenterForValue(t){if(W(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(W(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t=0;n--){let e=t._pointLabelItems[n];if(!e.visible)continue;let o=r.setContext(t.getPointLabelContext(n));!function(t,e,i){let{left:r,top:n,right:o,bottom:a}=i,{backdropColor:s}=e;if(!W(s)){let i=ey(e.borderRadius),l=ev(e.backdropPadding);t.fillStyle=s;let c=r-l.left,h=n-l.top,u=o-r+l.width,d=a-n+l.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),ed(t,{x:c,y:h,w:u,h:d,radius:i}),t.fill()):t.fillRect(c,h,u,d)}}(i,o,e);let a=ex(o.font),{x:s,y:l,textAlign:c}=e;eu(i,t._pointLabels[n],s,l+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,l),a.display&&this.ticks.forEach((t,i)=>{if(0!==i){e=this.getDistanceFromCenterForValue(t.value);let r=this.getContext(i),n=a.setContext(r),o=s.setContext(r);!function(t,e,i,r,n){let o=t.ctx,a=e.circular,{color:s,lineWidth:l}=e;(a||r)&&s&&l&&!(i<0)&&(o.save(),o.strokeStyle=s,o.lineWidth=l,o.setLineDash(n.dash),o.lineDashOffset=n.dashOffset,o.beginPath(),nU(t,i,a,r),o.closePath(),o.stroke(),o.restore())}(this,n,e,l,o)}}),o.display){for(r.save(),t=l-1;t>=0;t--){let a=o.setContext(this.getPointLabelContext(t)),{color:s,lineWidth:l}=a;l&&s&&(r.lineWidth=l,r.strokeStyle=s,r.setLineDash(a.borderDash),r.lineDashOffset=a.borderDashOffset,e=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),i=this.getPointPosition(t,e),r.beginPath(),r.moveTo(this.xCenter,this.yCenter),r.lineTo(i.x,i.y),r.stroke())}r.restore()}}drawBorder(){}drawLabels(){let t,e;let i=this.ctx,r=this.options,n=r.ticks;if(!n.display)return;let o=this.getIndexAngle(0);i.save(),i.translate(this.xCenter,this.yCenter),i.rotate(o),i.textAlign="center",i.textBaseline="middle",this.ticks.forEach((o,a)=>{if(0===a&&!r.reverse)return;let s=n.setContext(this.getContext(a)),l=ex(s.font);if(t=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){i.font=l.string,e=i.measureText(o.label).width,i.fillStyle=s.backdropColor;let r=ev(s.backdropPadding);i.fillRect(-e/2-r.left,-t-l.size/2-r.top,e+r.width,l.size+r.height)}eu(i,o.label,0,-t,l,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),i.restore()}drawTitle(){}constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}}h(n$,"id","radialLinear"),h(n$,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:t8.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}}),h(n$,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),h(n$,"descriptors",{angleLines:{_fallback:"grid"}});const nq={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}},nY=/* #__PURE__ */Object.keys(nq);function nG(t,e){return t-e}function nX(t,e){if(W(e))return null;let i=t._adapter,{parser:r,round:n,isoWeekday:o}=t._parseOpts,a=e;return("function"==typeof r&&(a=r(a)),$(a)||(a="string"==typeof r?i.parse(a,r):i.parse(a)),null===a)?null:(n&&(a="week"===n&&(tS(o)||!0===o)?i.startOf(a,"isoWeek",o):i.startOf(a,n)),+a)}function nZ(t,e,i,r){let n=nY.length;for(let o=nY.indexOf(t);o=e?i[r]:i[n];t[o]=!0}}else t[e]=!0}function nK(t,e,i){let r,n;let o=[],a={},s=e.length;for(r=0;r=0&&(e[o].major=!0);return e}(t,o,a,i):o}class nQ extends ru{init(t,e={}){let i=t.time||(t.time={}),r=this._adapter=new ij._date(t.adapters.date);r.init(e),tr(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:nX(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:r,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();function s(t){o||isNaN(t.min)||(r=Math.min(r,t.min)),a||isNaN(t.max)||(n=Math.max(n,t.max))}o&&a||(s(this._getLabelBounds()),("ticks"!==t.bounds||"labels"!==t.ticks.source)&&s(this.getMinMax(!1))),r=$(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),n=$(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,n-1),this.max=Math.max(r+1,n)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let t=this.options,e=t.time,i=t.ticks,r="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);let n=this.min,o=this.max,a=/** +null==(l=s[o])||H(l)||(u=ee(t,c,h,u,l))}else u=ee(t,c,h,u,s);t.restore();let f=h.length/2;if(f>i.length){for(r=0;re.r&&(s=(n.end-e.r)/o,t.r=Math.max(t.r,e.r+s)),r.starte.b&&(l=(r.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}(i,e,p,m,b)}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){let n;let r=[],o=t._pointLabels.length,a=t.options,{centerPointLabels:s,display:l}=a.pointLabels,c={extra:rW(a)/2,additionalAngle:s?tu/o:0};for(let a=0;a270||f<90)&&(n-=r),n),g=0===f||180===f?"center":f<180?"left":"right",m=(o=d.x,a=u.w,"right"===g?o-=a:"center"===g&&(o-=a/2),o);return{visible:!0,x:d.x,y:p,textAlign:g,left:m,top:p,right:m+u.w,bottom:p+u.h}}(t,a,c);r.push(o),"auto"===l&&(o.visible=function(t,e){if(!e)return!0;let{left:i,top:n,right:r,bottom:o}=t,a=ea({x:i,y:n},e)||ea({x:i,y:o},e)||ea({x:r,y:n},e)||ea({x:r,y:o},e);return!a}(o,n),o.visible&&(n=o))}return r}(t,n,r)}(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){let e=td/(this._pointLabels.length||1),i=this.options.startAngle||0;return tD(t*e+tM(i))}getDistanceFromCenterForValue(t){if(W(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(W(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t=0;r--){let e=t._pointLabelItems[r];if(!e.visible)continue;let o=n.setContext(t.getPointLabelContext(r));!function(t,e,i){let{left:n,top:r,right:o,bottom:a}=i,{backdropColor:s}=e;if(!W(s)){let i=ey(e.borderRadius),l=ev(e.backdropPadding);t.fillStyle=s;let c=n-l.left,h=r-l.top,u=o-n+l.width,d=a-r+l.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),ed(t,{x:c,y:h,w:u,h:d,radius:i}),t.fill()):t.fillRect(c,h,u,d)}}(i,o,e);let a=ex(o.font),{x:s,y:l,textAlign:c}=e;eu(i,t._pointLabels[r],s,l+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,l),a.display&&this.ticks.forEach((t,i)=>{if(0!==i){e=this.getDistanceFromCenterForValue(t.value);let n=this.getContext(i),r=a.setContext(n),o=s.setContext(n);!function(t,e,i,n,r){let o=t.ctx,a=e.circular,{color:s,lineWidth:l}=e;(a||n)&&s&&l&&!(i<0)&&(o.save(),o.strokeStyle=s,o.lineWidth=l,o.setLineDash(r.dash),o.lineDashOffset=r.dashOffset,o.beginPath(),rU(t,i,a,n),o.closePath(),o.stroke(),o.restore())}(this,r,e,l,o)}}),o.display){for(n.save(),t=l-1;t>=0;t--){let a=o.setContext(this.getPointLabelContext(t)),{color:s,lineWidth:l}=a;l&&s&&(n.lineWidth=l,n.strokeStyle=s,n.setLineDash(a.borderDash),n.lineDashOffset=a.borderDashOffset,e=this.getDistanceFromCenterForValue(r.ticks.reverse?this.min:this.max),i=this.getPointPosition(t,e),n.beginPath(),n.moveTo(this.xCenter,this.yCenter),n.lineTo(i.x,i.y),n.stroke())}n.restore()}}drawBorder(){}drawLabels(){let t,e;let i=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;let o=this.getIndexAngle(0);i.save(),i.translate(this.xCenter,this.yCenter),i.rotate(o),i.textAlign="center",i.textBaseline="middle",this.ticks.forEach((o,a)=>{if(0===a&&!n.reverse)return;let s=r.setContext(this.getContext(a)),l=ex(s.font);if(t=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){i.font=l.string,e=i.measureText(o.label).width,i.fillStyle=s.backdropColor;let n=ev(s.backdropPadding);i.fillRect(-e/2-n.left,-t-l.size/2-n.top,e+n.width,l.size+n.height)}eu(i,o.label,0,-t,l,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),i.restore()}drawTitle(){}constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}}h(r$,"id","radialLinear"),h(r$,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:t8.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}}),h(r$,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),h(r$,"descriptors",{angleLines:{_fallback:"grid"}});const rq={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}},rY=/* #__PURE__ */Object.keys(rq);function rG(t,e){return t-e}function rX(t,e){if(W(e))return null;let i=t._adapter,{parser:n,round:r,isoWeekday:o}=t._parseOpts,a=e;return("function"==typeof n&&(a=n(a)),$(a)||(a="string"==typeof n?i.parse(a,n):i.parse(a)),null===a)?null:(r&&(a="week"===r&&(tS(o)||!0===o)?i.startOf(a,"isoWeek",o):i.startOf(a,r)),+a)}function rZ(t,e,i,n){let r=rY.length;for(let o=rY.indexOf(t);o=e?i[n]:i[r];t[o]=!0}}else t[e]=!0}function rK(t,e,i){let n,r;let o=[],a={},s=e.length;for(n=0;n=0&&(e[o].major=!0);return e}(t,o,a,i):o}class rQ extends nu{init(t,e={}){let i=t.time||(t.time={}),n=this._adapter=new ij._date(t.adapters.date);n.init(e),tn(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:rX(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:n,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function s(t){o||isNaN(t.min)||(n=Math.min(n,t.min)),a||isNaN(t.max)||(r=Math.max(r,t.max))}o&&a||(s(this._getLabelBounds()),("ticks"!==t.bounds||"labels"!==t.ticks.source)&&s(this.getMinMax(!1))),n=$(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),r=$(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,r-1),this.max=Math.max(n+1,r)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);let r=this.min,o=this.max,a=/** * Return subset of `values` between `min` and `max` inclusive. * Values are assumed to be in sorted order. * @param values - sorted array of values * @param min - min value * @param max - max value - */function(t,e,i){let r=0,n=t.length;for(;rr&&t[n-1]>i;)n--;return r>0||n=nY.indexOf(i);o--){let i=nY[o];if(nq[i].common&&t._adapter.diff(n,r,i)>=e-1)return i}return nY[i?nY.indexOf(i):0]}(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=nY.indexOf(t)+1,i=nY.length;e+t.value))}initOffsets(t=[]){let e,i,r=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),r=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);let o=t.length<3?.5:.25;r=tR(r,0,o),n=tR(n,0,o),this._offsets={start:r,end:n,factor:1/(r+1+n)}}_generate(){let t,e;let i=this._adapter,r=this.min,n=this.max,o=this.options,a=o.time,s=a.unit||nZ(a.minUnit,r,n,this._getLabelCapacity(r)),l=Y(o.ticks.stepSize,1),c="week"===s&&a.isoWeekday,h=tS(c)||!0===c,u={},d=r;if(h&&(d=+i.startOf(d,"isoWeek",c)),d=+i.startOf(d,h?"day":s),i.diff(n,r,s)>1e5*l)throw Error(r+" and "+n+" are too far apart with stepSize of "+l+" "+s);let f="data"===o.ticks.source&&this.getDataTimestamps();for(t=d,e=0;t+t)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){let i=this.options,r=i.time.displayFormats,n=this._unit,o=e||r[n];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,r){let n=this.options,o=n.ticks.callback;if(o)return Z(o,[t,e,i],this);let a=n.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&a[s],h=l&&a[l],u=i[e],d=l&&h&&u&&u.major;return this._adapter.format(t,r||(d?h:c))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,e=r.length;t=t[s].pos&&e<=t[l].pos&&({lo:s,hi:l}=tI(t,"pos",e)),{pos:r,time:o}=t[s],{pos:n,time:a}=t[l]):(e>=t[s].time&&e<=t[l].time&&({lo:s,hi:l}=tI(t,"time",e)),{time:r,pos:o}=t[s],{time:n,pos:a}=t[l]);let c=n-r;return c?o+(a-o)*(e-r)/c:o}h(nQ,"id","time"),h(nQ,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});class n1 extends nQ{initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=n0(e,this.min),this._tableRange=n0(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let e,i,r;let{min:n,max:o}=this,a=[],s=[];for(e=0,i=t.length;e=n&&r<=o&&a.push(r);if(a.length<2)return[{time:n,pos:0},{time:o,pos:1}];for(e=0,i=a.length;et-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t}getDecimalForValue(t){return(n0(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return n0(this._table,i*this._tableRange+this._minPos,!0)}constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}}h(n1,"id","timeseries"),h(n1,"defaults",nQ.defaults);var n2=/*#__PURE__*/Object.freeze({__proto__:null,CategoryScale:nC,LinearScale:nF,LogarithmicScale:nV,RadialLinearScale:n$,TimeScale:nQ,TimeSeriesScale:n1});/**! + */function(t,e,i){let n=0,r=t.length;for(;nn&&t[r-1]>i;)r--;return n>0||r=rY.indexOf(i);o--){let i=rY[o];if(rq[i].common&&t._adapter.diff(r,n,i)>=e-1)return i}return rY[i?rY.indexOf(i):0]}(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=rY.indexOf(t)+1,i=rY.length;e+t.value))}initOffsets(t=[]){let e,i,n=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),r=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);let o=t.length<3?.5:.25;n=tR(n,0,o),r=tR(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){let t,e;let i=this._adapter,n=this.min,r=this.max,o=this.options,a=o.time,s=a.unit||rZ(a.minUnit,n,r,this._getLabelCapacity(n)),l=Y(o.ticks.stepSize,1),c="week"===s&&a.isoWeekday,h=tS(c)||!0===c,u={},d=n;if(h&&(d=+i.startOf(d,"isoWeek",c)),d=+i.startOf(d,h?"day":s),i.diff(r,n,s)>1e5*l)throw Error(n+" and "+r+" are too far apart with stepSize of "+l+" "+s);let f="data"===o.ticks.source&&this.getDataTimestamps();for(t=d,e=0;t+t)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){let i=this.options,n=i.time.displayFormats,r=this._unit,o=e||n[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,n){let r=this.options,o=r.ticks.callback;if(o)return Z(o,[t,e,i],this);let a=r.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&a[s],h=l&&a[l],u=i[e],d=l&&h&&u&&u.major;return this._adapter.format(t,n||(d?h:c))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;let n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[s].pos&&e<=t[l].pos&&({lo:s,hi:l}=tI(t,"pos",e)),{pos:n,time:o}=t[s],{pos:r,time:a}=t[l]):(e>=t[s].time&&e<=t[l].time&&({lo:s,hi:l}=tI(t,"time",e)),{time:n,pos:o}=t[s],{time:r,pos:a}=t[l]);let c=r-n;return c?o+(a-o)*(e-n)/c:o}h(rQ,"id","time"),h(rQ,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});class r1 extends rQ{initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=r0(e,this.min),this._tableRange=r0(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let e,i,n;let{min:r,max:o}=this,a=[],s=[];for(e=0,i=t.length;e=r&&n<=o&&a.push(n);if(a.length<2)return[{time:r,pos:0},{time:o,pos:1}];for(e=0,i=a.length;et-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t}getDecimalForValue(t){return(r0(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return r0(this._table,i*this._tableRange+this._minPos,!0)}constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}}h(r1,"id","timeseries"),h(r1,"defaults",rQ.defaults);var r2=/*#__PURE__*/Object.freeze({__proto__:null,CategoryScale:rC,LinearScale:rF,LogarithmicScale:rV,RadialLinearScale:r$,TimeScale:rQ,TimeSeriesScale:r1});/**! * Sortable 1.15.1 * @author RubaXa * @author owenm * @license MIT - */function n5(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)}return i}function n3(t){for(var e=1;e"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){}return!1}}function ol(/**HTMLElement*/t,/**String*/e,/**HTMLElement*/i,r){if(t){var n;i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&os(t,e):os(t,e))||r&&t===i)return t;if(t===i)break;/* jshint boss:true */}while(t=(n=t).host&&n!==document&&n.host.nodeType?n.host:n.parentNode)}return null}var oc=/\s+/g;function oh(t,e,i){if(t&&e){if(t.classList)t.classList[i?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(oc," ").replace(" "+e+" "," ");t.className=(r+(i?" "+e:"")).replace(oc," ")}}}function ou(t,e,i){var r=t&&t.style;if(r){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in r||-1!==e.indexOf("webkit")||(e="-webkit-"+e),r[e]=i+("string"==typeof i?"":"px")}}function od(t,e){var i="";if("string"==typeof t)i=t;else do{var r=ou(t,"transform");r&&"none"!==r&&(i=r+" "+i);/* jshint boss:true */}while(!e&&(t=t.parentNode))var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;/*jshint -W056 */return n&&new n(i)}function of(t,e,i){if(t){var r=t.getElementsByTagName(e),n=0,o=r.length;if(i)for(;n"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){}return!1}}function ol(/**HTMLElement*/t,/**String*/e,/**HTMLElement*/i,n){if(t){var r;i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&os(t,e):os(t,e))||n&&t===i)return t;if(t===i)break;/* jshint boss:true */}while(t=(r=t).host&&r!==document&&r.host.nodeType?r.host:r.parentNode)}return null}var oc=/\s+/g;function oh(t,e,i){if(t&&e){if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(oc," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(oc," ")}}}function ou(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||-1!==e.indexOf("webkit")||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function od(t,e){var i="";if("string"==typeof t)i=t;else do{var n=ou(t,"transform");n&&"none"!==n&&(i=n+" "+i);/* jshint boss:true */}while(!e&&(t=t.parentNode))var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;/*jshint -W056 */return r&&new r(i)}function of(t,e,i){if(t){var n=t.getElementsByTagName(e),r=0,o=n.length;if(i)for(;r=o:n<=o))return r;if(r===op())break;r=ow(r,!1)}return!1}/** + */function ob(t,e,i){/* jshint boss:true */for(var n=ow(t,!0),r=og(t)[e];n;){var o=og(n)[i];if(!("top"===i||"left"===i?r>=o:r<=o))return n;if(n===op())break;n=ow(n,!1)}return!1}/** * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible) * and non-draggable elements * @param {HTMLElement} el The parent element * @param {Number} childNum The index of the child * @param {Object} options Parent Sortable's options * @return {HTMLElement} The child at index childNum, or null if not found - */function oy(t,e,i,r){for(var n=0,o=0,a=t.children;o2&&void 0!==arguments[2]?arguments[2]:{},r=i.evt,n=function(t,e){if(null==t)return{};var i,r,n=function(t,e){if(null==t)return{};var i,r,n={},o=Object.keys(t);for(r=0;r=0||(n[i]=t[i]);return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}(i,oT);oD.pluginEvent.bind(am)(t,e,n3({dragEl:oI,parentEl:oF,ghostEl:oL,rootEl:oN,nextEl:oz,lastDownEl:oB,cloneEl:oV,cloneHidden:oW,dragStarted:o1,putSortable:oG,activeSortable:am.active,originalEvent:r,oldIndex:oH,oldDraggableIndex:o$,newIndex:oU,newDraggableIndex:oq,hideGhostForTarget:ad,unhideGhostForTarget:af,cloneNowHidden:function(){oW=!0},cloneNowShown:function(){oW=!1},dispatchSortableEvent:function(t){oC({sortable:e,name:t,originalEvent:r})}},n))};function oC(t){!function(t){var e=t.sortable,i=t.rootEl,r=t.name,n=t.targetEl,o=t.cloneEl,a=t.toEl,s=t.fromEl,l=t.oldIndex,c=t.newIndex,h=t.oldDraggableIndex,u=t.newDraggableIndex,d=t.originalEvent,f=t.putSortable,p=t.extraEventProperties;if(e=e||i&&i[oP]){var g,m=e.options,b="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||n7||n9?(g=document.createEvent("Event")).initEvent(r,!0,!0):g=new CustomEvent(r,{bubbles:!0,cancelable:!0}),g.to=a||i,g.from=s||i,g.item=n||i,g.clone=o,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=h,g.newDraggableIndex=u,g.originalEvent=d,g.pullMode=f?f.lastPutMode:void 0;var y=n3(n3({},p),oD.getEventProperties(r,e));for(var v in y)g[v]=y[v];i&&i.dispatchEvent(g),m[b]&&m[b].call(e,g)}}(n3({putSortable:oG,cloneEl:oV,targetEl:oI,rootEl:oN,oldIndex:oH,oldDraggableIndex:o$,newIndex:oU,newDraggableIndex:oq},t))}var oj,oI,oF,oL,oN,oz,oB,oV,oW,oH,oU,o$,oq,oY,oG,oX,oZ,oJ,oK,oQ,o0,o1,o2,o5,o3,o8,o6=!1,o4=!1,o7=[],o9=!1,at=!1,ae=[],ai=!1,ar=[],an="undefined"!=typeof document,ao=n9||n7?"cssFloat":"float",aa=an&&!or&&!oi&&"draggable"in document.createElement("div"),as=function(){if(an){// false when <= IE11 -if(n7)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),al=function(t,e){var i=ou(t),r=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),n=oy(t,0,e),o=oy(t,1,e),a=n&&ou(n),s=o&&ou(o),l=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+og(n).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+og(o).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(n&&a.float&&"none"!==a.float){var h="left"===a.float?"left":"right";return o&&("both"===s.clear||s.clear===h)?"vertical":"horizontal"}return n&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||l>=r&&"none"===i[ao]||o&&"none"===i[ao]&&l+c>r)?"vertical":"horizontal"},ac=function(t,e,i){var r=i?t.left:t.top,n=i?t.right:t.bottom,o=i?t.width:t.height,a=i?e.left:e.top,s=i?e.right:e.bottom,l=i?e.width:e.height;return r===a||n===s||r+o/2===a+l/2},/** + */function o_(t){var e=0,i=0,n=op();if(t)do{var r=od(t),o=r.a,a=r.d;e+=t.scrollLeft*o,i+=t.scrollTop*a}while(t!==n&&(t=t.parentNode))return[e,i]}function ow(t,e){// skip to window +if(!t||!t.getBoundingClientRect)return op();var i=t,n=!1;do if(i.clientWidth2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,r=function(t,e){if(null==t)return{};var i,n,r=function(t,e){if(null==t)return{};var i,n,r={},o=Object.keys(t);for(n=0;n=0||(r[i]=t[i]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(r[i]=t[i])}return r}(i,oT);oD.pluginEvent.bind(am)(t,e,r3({dragEl:oI,parentEl:oF,ghostEl:oL,rootEl:oN,nextEl:oz,lastDownEl:oB,cloneEl:oV,cloneHidden:oW,dragStarted:o1,putSortable:oG,activeSortable:am.active,originalEvent:n,oldIndex:oH,oldDraggableIndex:o$,newIndex:oU,newDraggableIndex:oq,hideGhostForTarget:ad,unhideGhostForTarget:af,cloneNowHidden:function(){oW=!0},cloneNowShown:function(){oW=!1},dispatchSortableEvent:function(t){oC({sortable:e,name:t,originalEvent:n})}},r))};function oC(t){!function(t){var e=t.sortable,i=t.rootEl,n=t.name,r=t.targetEl,o=t.cloneEl,a=t.toEl,s=t.fromEl,l=t.oldIndex,c=t.newIndex,h=t.oldDraggableIndex,u=t.newDraggableIndex,d=t.originalEvent,f=t.putSortable,p=t.extraEventProperties;if(e=e||i&&i[oP]){var g,m=e.options,b="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||r9||r7?(g=document.createEvent("Event")).initEvent(n,!0,!0):g=new CustomEvent(n,{bubbles:!0,cancelable:!0}),g.to=a||i,g.from=s||i,g.item=r||i,g.clone=o,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=h,g.newDraggableIndex=u,g.originalEvent=d,g.pullMode=f?f.lastPutMode:void 0;var y=r3(r3({},p),oD.getEventProperties(n,e));for(var v in y)g[v]=y[v];i&&i.dispatchEvent(g),m[b]&&m[b].call(e,g)}}(r3({putSortable:oG,cloneEl:oV,targetEl:oI,rootEl:oN,oldIndex:oH,oldDraggableIndex:o$,newIndex:oU,newDraggableIndex:oq},t))}var oj,oI,oF,oL,oN,oz,oB,oV,oW,oH,oU,o$,oq,oY,oG,oX,oZ,oJ,oK,oQ,o0,o1,o2,o5,o3,o8,o6=!1,o4=!1,o9=[],o7=!1,at=!1,ae=[],ai=!1,an=[],ar="undefined"!=typeof document,ao=r7||r9?"cssFloat":"float",aa=ar&&!on&&!oi&&"draggable"in document.createElement("div"),as=function(){if(ar){// false when <= IE11 +if(r9)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),al=function(t,e){var i=ou(t),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=oy(t,0,e),o=oy(t,1,e),a=r&&ou(r),s=o&&ou(o),l=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+og(r).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+og(o).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&"none"!==a.float){var h="left"===a.float?"left":"right";return o&&("both"===s.clear||s.clear===h)?"vertical":"horizontal"}return r&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||l>=n&&"none"===i[ao]||o&&"none"===i[ao]&&l+c>n)?"vertical":"horizontal"},ac=function(t,e,i){var n=i?t.left:t.top,r=i?t.right:t.bottom,o=i?t.width:t.height,a=i?e.left:e.top,s=i?e.right:e.bottom,l=i?e.width:e.height;return n===a||r===s||n+o/2===a+l/2},/** * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold. * @param {Number} x X position * @param {Number} y Y position * @return {HTMLElement} Element of the first found nearest Sortable - */ah=function(t,e){var i;return o7.some(function(r){var n=r[oP].options.emptyInsertThreshold;if(!(!n||ov(r))){var o=og(r),a=t>=o.left-n&&t<=o.right+n,s=e>=o.top-n&&e<=o.bottom+n;if(a&&s)return i=r}}),i},au=function(t){function e(t,i){return function(r,n,o,a){var s=r.options.group.name&&n.options.group.name&&r.options.group.name===n.options.group.name;if(null==t&&(i||s))// Default pull and put value if same group -return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"==typeof t)return e(t(r,n,o,a),i)(r,n,o,a);var l=(i?r:n).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var i={},r=t.group;r&&"object"==n8(r)||(r={name:r}),i.name=r.name,i.checkPull=e(r.pull,!0),i.checkPut=e(r.put),i.revertClone=r.revertClone,t.group=i},ad=function(){!as&&oL&&ou(oL,"display","none")},af=function(){!as&&oL&&ou(oL,"display","")};an&&!or&&document.addEventListener("click",function(t){if(o4)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),o4=!1,!1},!0);var ap=function(t){if(oI){var e=ah((t=t.touches?t.touches[0]:t).clientX,t.clientY);if(e){// Create imitation event -var i={};for(var r in t)t.hasOwnProperty(r)&&(i[r]=t[r]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[oP]._onDragOver(i)}}},ag=function(t){oI&&oI.parentNode[oP]._isOutsideThisEl(t.target)};/** + */ah=function(t,e){var i;return o9.some(function(n){var r=n[oP].options.emptyInsertThreshold;if(!(!r||ov(n))){var o=og(n),a=t>=o.left-r&&t<=o.right+r,s=e>=o.top-r&&e<=o.bottom+r;if(a&&s)return i=n}}),i},au=function(t){function e(t,i){return function(n,r,o,a){var s=n.options.group.name&&r.options.group.name&&n.options.group.name===r.options.group.name;if(null==t&&(i||s))// Default pull and put value if same group +return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"==typeof t)return e(t(n,r,o,a),i)(n,r,o,a);var l=(i?n:r).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var i={},n=t.group;n&&"object"==r8(n)||(n={name:n}),i.name=n.name,i.checkPull=e(n.pull,!0),i.checkPut=e(n.put),i.revertClone=n.revertClone,t.group=i},ad=function(){!as&&oL&&ou(oL,"display","none")},af=function(){!as&&oL&&ou(oL,"display","")};ar&&!on&&document.addEventListener("click",function(t){if(o4)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),o4=!1,!1},!0);var ap=function(t){if(oI){var e=ah((t=t.touches?t.touches[0]:t).clientX,t.clientY);if(e){// Create imitation event +var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[oP]._onDragOver(i)}}},ag=function(t){oI&&oI.parentNode[oP]._isOutsideThisEl(t.target)};/** * @class Sortable * @param {HTMLElement} el * @param {Object} [options] - */function am(t,e){if(!(t&&t.nodeType&&1===t.nodeType))throw"Sortable: `el` must be an HTMLElement, not ".concat(({}).toString.call(t));this.el=t,this.options=e=n6({},e),// Export instance -t[oP]=this;var i,r,n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,// percentage; 0 <= x <= 1 + */function am(t,e){if(!(t&&t.nodeType&&1===t.nodeType))throw"Sortable: `el` must be an HTMLElement, not ".concat(({}).toString.call(t));this.el=t,this.options=e=r6({},e),// Export instance +t[oP]=this;var i,n,r={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,// percentage; 0 <= x <= 1 invertSwap:!1,// invert always invertedSwapThreshold:null,// will be set to same as swapThreshold if default removeCloneOnHide:!0,direction:function(){return al(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==am.supportPointer&&"PointerEvent"in window&&!oe,emptyInsertThreshold:5};// Set default options -for(var o in oD.initializePlugins(this,t,n),n)o in e||(e[o]=n[o]);// Bind all private methods +for(var o in oD.initializePlugins(this,t,r),r)o in e||(e[o]=r[o]);// Bind all private methods for(var a in au(e),this)"_"===a.charAt(0)&&"function"==typeof this[a]&&(this[a]=this[a].bind(this));// Setup drag mode -this.nativeDraggable=!e.forceFallback&&aa,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?oo(t,"pointerdown",this._onTapStart):(oo(t,"mousedown",this._onTapStart),oo(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(oo(t,"dragover",this),oo(t,"dragenter",this)),o7.push(this.el),// Restore sorting +this.nativeDraggable=!e.forceFallback&&aa,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?oo(t,"pointerdown",this._onTapStart):(oo(t,"mousedown",this._onTapStart),oo(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(oo(t,"dragover",this),oo(t,"dragenter",this)),o9.push(this.el),// Restore sorting e.store&&e.store.get&&this.sort(e.store.get(this)||[]),// Add animation state manager -n6(this,(r=[],{captureAnimationState:function(){r=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if("none"!==ou(t,"display")&&t!==am.ghost){r.push({target:t,rect:og(t)});var e=n3({},r[r.length-1].rect);// If animating: compensate for current animation -if(t.thisAnimationDuration){var i=od(t,!0);i&&(e.top-=i.f,e.left-=i.e)}t.fromRect=e}})},addAnimationState:function(t){r.push(t)},removeAnimationState:function(t){r.splice(/** +r6(this,(n=[],{captureAnimationState:function(){n=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if("none"!==ou(t,"display")&&t!==am.ghost){n.push({target:t,rect:og(t)});var e=r3({},n[n.length-1].rect);// If animating: compensate for current animation +if(t.thisAnimationDuration){var i=od(t,!0);i&&(e.top-=i.f,e.left-=i.e)}t.fromRect=e}})},addAnimationState:function(t){n.push(t)},removeAnimationState:function(t){n.splice(/** * Returns the index of the object within the given array * @param {Array} arr Array that may or may not hold the object * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find * @return {Number} The index of the object in the array, or -1 - */function(t,e){for(var i in t)if(t.hasOwnProperty(i)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===t[i][r])return Number(i)}return -1}(r,{target:t}),1)},animateAll:function(t){var e=this;if(!this.options.animation){clearTimeout(i),"function"==typeof t&&t();return}var n=!1,o=0;r.forEach(function(t){var i,r=0,a=t.target,s=a.fromRect,l=og(a),c=a.prevFromRect,h=a.prevToRect,u=t.rect,d=od(a,!0);d&&(// Compensate for current animation + */function(t,e){for(var i in t)if(t.hasOwnProperty(i)){for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t[i][n])return Number(i)}return -1}(n,{target:t}),1)},animateAll:function(t){var e=this;if(!this.options.animation){clearTimeout(i),"function"==typeof t&&t();return}var r=!1,o=0;n.forEach(function(t){var i,n=0,a=t.target,s=a.fromRect,l=og(a),c=a.prevFromRect,h=a.prevToRect,u=t.rect,d=od(a,!0);d&&(// Compensate for current animation l.top-=d.f,l.left-=d.e),a.toRect=l,a.thisAnimationDuration&&oS(c,l)&&!oS(s,l)&&// Make sure animatingRect is on line between toRect & fromRect -(u.top-l.top)/(u.left-l.left)==(s.top-l.top)/(s.left-l.left)&&(i=e.options,r=Math.sqrt(Math.pow(c.top-u.top,2)+Math.pow(c.left-u.left,2))/Math.sqrt(Math.pow(c.top-h.top,2)+Math.pow(c.left-h.left,2))*i.animation),oS(l,s)||(a.prevFromRect=s,a.prevToRect=l,r||(r=e.options.animation),e.animate(a,u,l,r)),r&&(n=!0,o=Math.max(o,r),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout(function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null},r),a.thisAnimationDuration=r)}),clearTimeout(i),n?i=setTimeout(function(){"function"==typeof t&&t()},o):"function"==typeof t&&t(),r=[]},animate:function(t,e,i,r){if(r){ou(t,"transition",""),ou(t,"transform","");var n=od(this.el),o=n&&n.a,a=n&&n.d,s=(e.left-i.left)/(o||1),l=(e.top-i.top)/(a||1);t.animatingX=!!s,t.animatingY=!!l,ou(t,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=t.offsetWidth,ou(t,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),ou(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){ou(t,"transition",""),ou(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},r)}}}))}function ab(t,e,i,r,n,o,a,s){var l,c,h=t[oP],u=h.options.onMove;return!window.CustomEvent||n7||n9?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=i,l.draggedRect=r,l.related=n||e,l.relatedRect=o||og(e),l.willInsertAfter=s,l.originalEvent=a,t.dispatchEvent(l),u&&(c=u.call(h,l,a)),c}function ay(t){t.draggable=!1}function av(){ai=!1}function ax(t){return setTimeout(t,0)}function a_(t){return clearTimeout(t)}am.prototype=/** @lends Sortable.prototype */{constructor:am,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(o2=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,oI):this.options.direction},_onTapStart:function(/** Event|TouchEvent */t){if(t.cancelable){var e=this,i=this.el,r=this.options,n=r.preventOnFilter,o=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,s=(a||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=r.filter;// Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group. -if(function(t){ar.length=0;for(var e=t.getElementsByTagName("input"),i=e.length;i--;){var r=e[i];r.checked&&ar.push(r)}}(i),!(oI||/mousedown|pointerdown/.test(o)&&0!==t.button||r.disabled||l.isContentEditable||!this.nativeDraggable&&oe&&s&&"SELECT"===s.tagName.toUpperCase()||(s=ol(s,r.draggable,i,!1))&&s.animated)&&oB!==s){// Check filter +(u.top-l.top)/(u.left-l.left)==(s.top-l.top)/(s.left-l.left)&&(i=e.options,n=Math.sqrt(Math.pow(c.top-u.top,2)+Math.pow(c.left-u.left,2))/Math.sqrt(Math.pow(c.top-h.top,2)+Math.pow(c.left-h.left,2))*i.animation),oS(l,s)||(a.prevFromRect=s,a.prevToRect=l,n||(n=e.options.animation),e.animate(a,u,l,n)),n&&(r=!0,o=Math.max(o,n),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout(function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null},n),a.thisAnimationDuration=n)}),clearTimeout(i),r?i=setTimeout(function(){"function"==typeof t&&t()},o):"function"==typeof t&&t(),n=[]},animate:function(t,e,i,n){if(n){ou(t,"transition",""),ou(t,"transform","");var r=od(this.el),o=r&&r.a,a=r&&r.d,s=(e.left-i.left)/(o||1),l=(e.top-i.top)/(a||1);t.animatingX=!!s,t.animatingY=!!l,ou(t,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=t.offsetWidth,ou(t,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),ou(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){ou(t,"transition",""),ou(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},n)}}}))}function ab(t,e,i,n,r,o,a,s){var l,c,h=t[oP],u=h.options.onMove;return!window.CustomEvent||r9||r7?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=i,l.draggedRect=n,l.related=r||e,l.relatedRect=o||og(e),l.willInsertAfter=s,l.originalEvent=a,t.dispatchEvent(l),u&&(c=u.call(h,l,a)),c}function ay(t){t.draggable=!1}function av(){ai=!1}function ax(t){return setTimeout(t,0)}function a_(t){return clearTimeout(t)}am.prototype=/** @lends Sortable.prototype */{constructor:am,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(o2=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,oI):this.options.direction},_onTapStart:function(/** Event|TouchEvent */t){if(t.cancelable){var e=this,i=this.el,n=this.options,r=n.preventOnFilter,o=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,s=(a||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=n.filter;// Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group. +if(function(t){an.length=0;for(var e=t.getElementsByTagName("input"),i=e.length;i--;){var n=e[i];n.checked&&an.push(n)}}(i),!(oI||/mousedown|pointerdown/.test(o)&&0!==t.button||n.disabled||l.isContentEditable||!this.nativeDraggable&&oe&&s&&"SELECT"===s.tagName.toUpperCase()||(s=ol(s,n.draggable,i,!1))&&s.animated)&&oB!==s){// Check filter if(// Get the index of the dragged element within its parent -oH=ox(s),o$=ox(s,r.draggable),"function"==typeof c){if(c.call(this,t,s,this)){oC({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:i,fromEl:i}),oR("filter",e,{evt:t}),n&&t.cancelable&&t.preventDefault();return;// cancel dnd -}}else if(c&&(c=c.split(",").some(function(r){if(r=ol(l,r.trim(),i,!1))return oC({sortable:e,rootEl:r,name:"filter",targetEl:s,fromEl:i,toEl:i}),oR("filter",e,{evt:t}),!0}))){n&&t.cancelable&&t.preventDefault();return;// cancel dnd -}(!r.handle||ol(l,r.handle,i,!1))&&// Prepare `dragstart` -this._prepareDragStart(t,a,s)}}},_prepareDragStart:function(/** Event */t,/** Touch */e,/** HTMLElement */i){var r,n=this,o=n.el,a=n.options,s=o.ownerDocument;if(i&&!oI&&i.parentNode===o){var l=og(i);// Delay is impossible for native DnD in Edge or IE -if(oN=o,oF=(oI=i).parentNode,oz=oI.nextSibling,oB=i,oY=a.group,am.dragged=oI,oQ=(oX={target:oI,clientX:(e||t).clientX,clientY:(e||t).clientY}).clientX-l.left,o0=oX.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,oI.style["will-change"]="all",r=function(){if(oR("delayEnded",n,{evt:t}),am.eventCanceled){n._onDrop();return}// Delayed drag has been triggered +oH=ox(s),o$=ox(s,n.draggable),"function"==typeof c){if(c.call(this,t,s,this)){oC({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:i,fromEl:i}),oR("filter",e,{evt:t}),r&&t.cancelable&&t.preventDefault();return;// cancel dnd +}}else if(c&&(c=c.split(",").some(function(n){if(n=ol(l,n.trim(),i,!1))return oC({sortable:e,rootEl:n,name:"filter",targetEl:s,fromEl:i,toEl:i}),oR("filter",e,{evt:t}),!0}))){r&&t.cancelable&&t.preventDefault();return;// cancel dnd +}(!n.handle||ol(l,n.handle,i,!1))&&// Prepare `dragstart` +this._prepareDragStart(t,a,s)}}},_prepareDragStart:function(/** Event */t,/** Touch */e,/** HTMLElement */i){var n,r=this,o=r.el,a=r.options,s=o.ownerDocument;if(i&&!oI&&i.parentNode===o){var l=og(i);// Delay is impossible for native DnD in Edge or IE +if(oN=o,oF=(oI=i).parentNode,oz=oI.nextSibling,oB=i,oY=a.group,am.dragged=oI,oQ=(oX={target:oI,clientX:(e||t).clientX,clientY:(e||t).clientY}).clientX-l.left,o0=oX.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,oI.style["will-change"]="all",n=function(){if(oR("delayEnded",r,{evt:t}),am.eventCanceled){r._onDrop();return}// Delayed drag has been triggered // we can re-enable the events: touchmove/mousemove -n._disableDelayedDragEvents(),!ot&&n.nativeDraggable&&(oI.draggable=!0),// Bind the events: dragstart/dragend -n._triggerDragStart(t,e),// Drag start event -oC({sortable:n,name:"choose",originalEvent:t}),// Chosen item +r._disableDelayedDragEvents(),!ot&&r.nativeDraggable&&(oI.draggable=!0),// Bind the events: dragstart/dragend +r._triggerDragStart(t,e),// Drag start event +oC({sortable:r,name:"choose",originalEvent:t}),// Chosen item oh(oI,a.chosenClass,!0)},// Disable "draggable" -a.ignore.split(",").forEach(function(t){of(oI,t.trim(),ay)}),oo(s,"dragover",ap),oo(s,"mousemove",ap),oo(s,"touchmove",ap),oo(s,"mouseup",n._onDrop),oo(s,"touchend",n._onDrop),oo(s,"touchcancel",n._onDrop),ot&&this.nativeDraggable&&(this.options.touchStartThreshold=4,oI.draggable=!0),oR("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(n9||n7))r();else{if(am.eventCanceled){this._onDrop();return}// If the user moves the pointer or let go the click or touch +a.ignore.split(",").forEach(function(t){of(oI,t.trim(),ay)}),oo(s,"dragover",ap),oo(s,"mousemove",ap),oo(s,"touchmove",ap),oo(s,"mouseup",r._onDrop),oo(s,"touchend",r._onDrop),oo(s,"touchcancel",r._onDrop),ot&&this.nativeDraggable&&(this.options.touchStartThreshold=4,oI.draggable=!0),oR("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(r7||r9))n();else{if(am.eventCanceled){this._onDrop();return}// If the user moves the pointer or let go the click or touch // before the delay has been reached: // disable the delayed drag -oo(s,"mouseup",n._disableDelayedDrag),oo(s,"touchend",n._disableDelayedDrag),oo(s,"touchcancel",n._disableDelayedDrag),oo(s,"mousemove",n._delayedDragTouchMoveHandler),oo(s,"touchmove",n._delayedDragTouchMoveHandler),a.supportPointer&&oo(s,"pointermove",n._delayedDragTouchMoveHandler),n._dragStartTimer=setTimeout(r,a.delay)}}},_delayedDragTouchMoveHandler:function(/** TouchEvent|PointerEvent **/t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){oI&&ay(oI),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;oa(t,"mouseup",this._disableDelayedDrag),oa(t,"touchend",this._disableDelayedDrag),oa(t,"touchcancel",this._disableDelayedDrag),oa(t,"mousemove",this._delayedDragTouchMoveHandler),oa(t,"touchmove",this._delayedDragTouchMoveHandler),oa(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(/** Event */t,/** Touch */e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?oo(document,"pointermove",this._onTouchMove):e?oo(document,"touchmove",this._onTouchMove):oo(document,"mousemove",this._onTouchMove):(oo(oI,"dragend",this),oo(oN,"dragstart",this._onDragStart));try{document.selection?ax(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(o6=!1,oN&&oI){oR("dragStarted",this,{evt:e}),this.nativeDraggable&&oo(document,"dragover",ag);var i=this.options;// Apply effect +oo(s,"mouseup",r._disableDelayedDrag),oo(s,"touchend",r._disableDelayedDrag),oo(s,"touchcancel",r._disableDelayedDrag),oo(s,"mousemove",r._delayedDragTouchMoveHandler),oo(s,"touchmove",r._delayedDragTouchMoveHandler),a.supportPointer&&oo(s,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(n,a.delay)}}},_delayedDragTouchMoveHandler:function(/** TouchEvent|PointerEvent **/t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){oI&&ay(oI),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;oa(t,"mouseup",this._disableDelayedDrag),oa(t,"touchend",this._disableDelayedDrag),oa(t,"touchcancel",this._disableDelayedDrag),oa(t,"mousemove",this._delayedDragTouchMoveHandler),oa(t,"touchmove",this._delayedDragTouchMoveHandler),oa(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(/** Event */t,/** Touch */e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?oo(document,"pointermove",this._onTouchMove):e?oo(document,"touchmove",this._onTouchMove):oo(document,"mousemove",this._onTouchMove):(oo(oI,"dragend",this),oo(oN,"dragstart",this._onDragStart));try{document.selection?ax(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(o6=!1,oN&&oI){oR("dragStarted",this,{evt:e}),this.nativeDraggable&&oo(document,"dragover",ag);var i=this.options;// Apply effect t||oh(oI,i.dragClass,!1),oh(oI,i.ghostClass,!0),am.active=this,t&&this._appendGhost(),// Drag start event oC({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(oZ){this._lastX=oZ.clientX,this._lastY=oZ.clientY,ad();for(var t=document.elementFromPoint(oZ.clientX,oZ.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(oZ.clientX,oZ.clientY))!==e;)e=t;if(oI.parentNode[oP]._isOutsideThisEl(t),e)do{if(e[oP]&&e[oP]._onDragOver({clientX:oZ.clientX,clientY:oZ.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break;t=e;// store last element -}while(e=e.parentNode)af()}},_onTouchMove:function(/**TouchEvent*/t){if(oX){var e=this.options,i=e.fallbackTolerance,r=e.fallbackOffset,n=t.touches?t.touches[0]:t,o=oL&&od(oL,!0),a=oL&&o&&o.a,s=oL&&o&&o.d,l=oi&&o8&&o_(o8),c=(n.clientX-oX.clientX+r.x)/(a||1)+(l?l[0]-ae[0]:0)/(a||1),h=(n.clientY-oX.clientY+r.y)/(s||1)+(l?l[1]-ae[1]:0)/(s||1);// only set the status to dragging, when we are actually dragging -if(!am.active&&!o6){if(i&&Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))v.right+10||t.clientY>y.bottom&&t.clientX>y.left:t.clientY>v.bottom+10||t.clientX>y.right&&t.clientY>y.top)&&!g.animated)){// Insert to end of list +_onDragOver:function(/**Event*/t){var e,i,n,r,o=this.el,a=t.target,s=this.options,l=s.group,c=am.active,h=oY===l,u=s.sort,d=oG||c,f=this,p=!1;if(!ai){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),a=ol(a,s.draggable,o,!0),I("dragOver"),am.eventCanceled)return p;if(oI.contains(t.target)||a.animated&&a.animatingX&&a.animatingY||f._ignoreWhileAnimating===a)return L(!1);if(o4=!1,c&&!s.disabled&&(h?u||(n=oF!==oN// Reverting item into the original list +):oG===this||(this.lastPutMode=oY.checkPull(this,c,oI,t))&&l.checkPut(this,c,oI,t))){if(r="vertical"===this._getDirection(t,a),e=og(oI),I("dragOverValid"),am.eventCanceled)return p;if(n)return oF=oN,F(),this._hideClone(),I("revert"),am.eventCanceled||(oz?oN.insertBefore(oI,oz):oN.appendChild(oI)),L(!0);var g=ov(o,s.draggable);if(!g||(b=r,y=og(ov(this.el,this.options.draggable)),v=om(this.el),(b?t.clientX>v.right+10||t.clientY>y.bottom&&t.clientX>y.left:t.clientY>v.bottom+10||t.clientX>y.right&&t.clientY>y.top)&&!g.animated)){// Insert to end of list // If already at end of list: Do not insert -if(g===oI)return L(!1);if(g&&o===t.target&&(a=g),a&&(i=og(a)),!1!==ab(oN,o,oI,e,a,i,t,!!a))return F(),g&&g.nextSibling?o.insertBefore(oI,g.nextSibling):o.appendChild(oI),oF=o,N(),L(!0)}else if(g&&(x=n,_=og(oy(this.el,0,this.options,!0)),w=om(this.el),x?t.clientXh+c*o/2:lh+c*o/2:lu-o3)return-o5}else // Regular -if(l>h+c*(1-n)/2&&lu-c*o/2)?l>h+c/2?1:-1:0}(t,a,i,n,P?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,at,o2===a))){// Check if target is beside dragEl in respective direction (ignoring hidden elements) +if(l>h+c*(1-r)/2&&lu-c*o/2)?l>h+c/2?1:-1:0}(t,a,i,r,P?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,at,o2===a))){// Check if target is beside dragEl in respective direction (ignoring hidden elements) var T=ox(oI);do T-=M,S=oF.children[T];while(S&&("none"===ou(S,"display")||S===oL))}// If dragEl is already beside target: Do not insert -if(0===M||S===a)return L(!1);o2=a,o5=M;var R=a.nextElementSibling,C=!1,j=ab(oN,o,oI,e,a,i,t,C=1===M);if(!1!==j)return(1===j||-1===j)&&(C=1===j),ai=!0,setTimeout(av,30),F(),C&&!R?o.appendChild(oI):a.parentNode.insertBefore(oI,C?R:a),A&&oM(A,0,D-A.scrollTop),oF=oI.parentNode,void 0===O||at||(o3=Math.abs(O-og(a)[E])),N(),L(!0)}if(o.contains(oI))return L(!1)}return!1}function I(s,l){oR(s,f,n3({evt:t,isOwner:h,axis:n?"vertical":"horizontal",revert:r,dragRect:e,targetRect:i,canSort:u,fromSortable:d,target:a,completed:L,onMove:function(i,r){return ab(oN,o,oI,e,i,og(i),t,r)},changed:N},l))}// Capture animation state +if(0===M||S===a)return L(!1);o2=a,o5=M;var R=a.nextElementSibling,C=!1,j=ab(oN,o,oI,e,a,i,t,C=1===M);if(!1!==j)return(1===j||-1===j)&&(C=1===j),ai=!0,setTimeout(av,30),F(),C&&!R?o.appendChild(oI):a.parentNode.insertBefore(oI,C?R:a),A&&oM(A,0,D-A.scrollTop),oF=oI.parentNode,void 0===O||at||(o3=Math.abs(O-og(a)[E])),N(),L(!0)}if(o.contains(oI))return L(!1)}return!1}function I(s,l){oR(s,f,r3({evt:t,isOwner:h,axis:r?"vertical":"horizontal",revert:n,dragRect:e,targetRect:i,canSort:u,fromSortable:d,target:a,completed:L,onMove:function(i,n){return ab(oN,o,oI,e,i,og(i),t,n)},changed:N},l))}// Capture animation state function F(){I("dragOverAnimationCapture"),f.captureAnimationState(),f!==d&&d.captureAnimationState()}// Return invocation when dragEl is inserted (or completed) function L(e){return I("dragOverCompleted",{insertion:e}),e&&(h?c._hideClone():c._showClone(f),f!==d&&(// Set ghost class to new sortable's ghost class oh(oI,oG?oG.options.ghostClass:c.options.ghostClass,!1),oh(oI,s.ghostClass,!0)),oG!==f&&f!==am.active?oG=f:f===am.active&&oG&&(oG=null),d===f&&(f._ignoreWhileAnimating=a),f.animateAll(function(){I("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(a!==oI||oI.animated)&&(a!==o||a.animated)||(o2=null),s.dragoverBubble||t.rootEl||a===document||(oI.parentNode[oP]._isOutsideThisEl(t.target),// Do not detect for empty insert if already inserted e||ap(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),p=!0}// Call when dragEl has been inserted function N(){oU=ox(oI),oq=ox(oI,s.draggable),oC({sortable:f,name:"change",toEl:o,newIndex:oU,newDraggableIndex:oq,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){oa(document,"mousemove",this._onTouchMove),oa(document,"touchmove",this._onTouchMove),oa(document,"pointermove",this._onTouchMove),oa(document,"dragover",ap),oa(document,"mousemove",ap),oa(document,"touchmove",ap)},_offUpEvents:function(){var t=this.el.ownerDocument;oa(t,"mouseup",this._onDrop),oa(t,"touchend",this._onDrop),oa(t,"pointerup",this._onDrop),oa(t,"touchcancel",this._onDrop),oa(document,"selectstart",this)},_onDrop:function(/**Event*/t){var e=this.el,i=this.options;if(// Get the index of the dragged element within its parent oU=ox(oI),oq=ox(oI,i.draggable),oR("drop",this,{evt:t}),oF=oI&&oI.parentNode,// Get again after plugin event -oU=ox(oI),oq=ox(oI,i.draggable),am.eventCanceled){this._nulling();return}o6=!1,at=!1,o9=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),a_(this.cloneId),a_(this._dragStartId),this.nativeDraggable&&(oa(document,"drop",this),oa(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),oe&&ou(document.body,"user-select",""),ou(oI,"transform",""),t&&(o1&&(t.cancelable&&t.preventDefault(),i.dropBubble||t.stopPropagation()),oL&&oL.parentNode&&oL.parentNode.removeChild(oL),(oN===oF||oG&&"clone"!==oG.lastPutMode)&&oV&&oV.parentNode&&oV.parentNode.removeChild(oV),oI&&(this.nativeDraggable&&oa(oI,"dragend",this),ay(oI),oI.style["will-change"]="",o1&&!o6&&oh(oI,oG?oG.options.ghostClass:this.options.ghostClass,!1),oh(oI,this.options.chosenClass,!1),// Drag stop event +oU=ox(oI),oq=ox(oI,i.draggable),am.eventCanceled){this._nulling();return}o6=!1,at=!1,o7=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),a_(this.cloneId),a_(this._dragStartId),this.nativeDraggable&&(oa(document,"drop",this),oa(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),oe&&ou(document.body,"user-select",""),ou(oI,"transform",""),t&&(o1&&(t.cancelable&&t.preventDefault(),i.dropBubble||t.stopPropagation()),oL&&oL.parentNode&&oL.parentNode.removeChild(oL),(oN===oF||oG&&"clone"!==oG.lastPutMode)&&oV&&oV.parentNode&&oV.parentNode.removeChild(oV),oI&&(this.nativeDraggable&&oa(oI,"dragend",this),ay(oI),oI.style["will-change"]="",o1&&!o6&&oh(oI,oG?oG.options.ghostClass:this.options.ghostClass,!1),oh(oI,this.options.chosenClass,!1),// Drag stop event oC({sortable:this,name:"unchoose",toEl:oF,newIndex:null,newDraggableIndex:null,originalEvent:t}),oN!==oF?(oU>=0&&(// Add event oC({rootEl:oF,name:"add",toEl:oF,fromEl:oN,originalEvent:t}),// Remove event oC({sortable:this,name:"remove",toEl:oF,originalEvent:t}),// drag from one list and drop into another oC({rootEl:oF,name:"sort",toEl:oF,fromEl:oN,originalEvent:t}),oC({sortable:this,name:"sort",toEl:oF,originalEvent:t})),oG&&oG.save()):oU!==oH&&oU>=0&&(// drag & drop within the same list oC({sortable:this,name:"update",toEl:oF,originalEvent:t}),oC({sortable:this,name:"sort",toEl:oF,originalEvent:t})),am.active&&((null==oU||-1===oU)&&(oU=oH,oq=o$),oC({sortable:this,name:"end",toEl:oF,originalEvent:t}),// Save sorting -this.save()))),this._nulling()},_nulling:function(){oR("nulling",this),oN=oI=oF=oL=oz=oV=oB=oW=oX=oZ=o1=oU=oq=oH=o$=o2=o5=oG=oY=am.dragged=am.ghost=am.clone=am.active=null,ar.forEach(function(t){t.checked=!0}),ar.length=oJ=oK=0},handleEvent:function(/**Event*/t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":oI&&(this._onDragOver(t),t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault());break;case"selectstart":t.preventDefault()}},/** +this.save()))),this._nulling()},_nulling:function(){oR("nulling",this),oN=oI=oF=oL=oz=oV=oB=oW=oX=oZ=o1=oU=oq=oH=o$=o2=o5=oG=oY=am.dragged=am.ghost=am.clone=am.active=null,an.forEach(function(t){t.checked=!0}),an.length=oJ=oK=0},handleEvent:function(/**Event*/t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":oI&&(this._onDragOver(t),t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault());break;case"selectstart":t.preventDefault()}},/** * Serializes the item into an array of string. * @returns {String[]} - */toArray:function(){for(var t,e=[],i=this.el.children,r=0,n=i.length,o=this.options;r{requestAnimationFrame(t)})}function aL(t,e,i,r){let n=t.length,o=r(t,e),a=Array(n),s=i/2,l=i/6,c=e+s;for(let e=0;e{requestAnimationFrame(t)})}function aL(t,e,i,n){let r=t.length,o=n(t,e),a=Array(r),s=i/2,l=i/6,c=e+s;for(let e=0;ee[t])}static arrayToElementObject(t,e){let i={};for(let r=0;r{let r=this.stockArrayToStocks(e),n=this.evaluateFlowPerStock(r,t,i),o=this.stocksToStockArray(n);return o}}step(t,e,i,r){var n;let o=this.stocksToStockArray(t),a="number"==typeof e?aN(o,e,i,r,n):function(t,e,i,r,n,o){let a=[...e];return aN(t,i,r,(t,e)=>e===i?a:n(t,e),o)}(o,e,i,r,n,void 0);return this.stockArrayToStocks(a)}constructor(t,e,i,r){this.stockIds=t,this.flowIds=e,this.variableIds=i,this.parameterIds=r}}az.elementIds=["stocks","parameters","variables","flows"];const aB=["capacityOfNewlyProducedPhones","capacityOfRecycledMaterials","capacityOfRefurbishedPhones","capacityOfRepairedPhones","phonesInUse","supplyOfBrokenPhones","supplyOfDisposedPhones","supplyOfHibernatingPhones","supplyOfNewlyProducedPhones","supplyOfRecycledMaterials","supplyOfRefurbishedPhones","supplyOfRepairedPhones"],aV=["abandon","acquireNewlyProduced","acquireRefurbished","acquireRepaired","acquireUsed","capacityOfNewlyProducedPhonesAdjustment","capacityOfRecycledMaterialsAdjustment","capacityOfRefurbishedPhonesAdjustment","disposeBroken","disposeHibernating","goBroken","landfill","produceFromNaturalResources","produceFromRecycledMaterials","recycle","refurbish","repair","repairShopCapcityAdjustment"],aW=["demandForNaturalResources","demandForNewlyProducedPhones","demandForPhones","demandForRecycledMaterials","demandForRefurbishedPhones","demandForRefurbishment","demandForRepairedPhones","demandForReusedPhones","inflowIncentiveSumForPhonesInUse","phoneGoal","phonesInUseExcess","recycleDemand","repairDemand","resourceDemand","supplyOfBrokenPhonesForDisposal","supplyOfBrokenPhonesForRepair","supplyOfDisposedPhonesForLandfilling","supplyOfDisposedPhonesForRecycling"],aH=["abandonExcessRate","abandonRate","acquireRate","breakRate","capacityAdjustmentRate","disposeIncentive","disposeRate","durability","landfillIncentive","landfillRate","naturalResourcesIncentive","newPhoneProductionRate","newlyProducedPhoneIncentive","numberOfUsers","phonesPerUserGoal","recycleRate","recyclingIncentive","refurbishmentIncentive","refurbishmentRate","repairIncentive","repairRate","reuseIncentive"];class aU extends az{// eslint-disable-next-line class-methods-use-this -evaluate(t,e,i){let{capacityOfNewlyProducedPhones:r,capacityOfRecycledMaterials:n,capacityOfRefurbishedPhones:o,capacityOfRepairedPhones:a,phonesInUse:s,supplyOfBrokenPhones:l,supplyOfDisposedPhones:c,supplyOfHibernatingPhones:h,supplyOfNewlyProducedPhones:u,supplyOfRecycledMaterials:d,supplyOfRefurbishedPhones:f,supplyOfRepairedPhones:p}=t,{abandonExcessRate:g,abandonRate:m,acquireRate:b,breakRate:y,capacityAdjustmentRate:v,disposeIncentive:x,disposeRate:_,durability:w,landfillIncentive:S,landfillRate:O,naturalResourcesIncentive:M,newPhoneProductionRate:k,newlyProducedPhoneIncentive:P,numberOfUsers:E,phonesPerUserGoal:A,recycleRate:D,recyclingIncentive:T,refurbishmentIncentive:R,refurbishmentRate:C,repairIncentive:j,repairRate:I,reuseIncentive:F}=e,L=E*A,N=Math.max(s-L,0),z=F+j+R+P,B=Math.max(0,L-s),V=P/z*B,W=R/z*B,H=j/z*B,U=F/z*B,$=Math.max(r-u,0),q=T/(M+T)*$,Y=x/(j+x)*l,G=S/(T+S)*c,X=M/(M+T)*$,Z=T/(T+S)*c,J=Math.max(n-d,0),K=Math.max(o-f,0),Q=Math.max(a-p,0);return{t:i,stocks:t,parameters:e,variables:{demandForNaturalResources:X,demandForNewlyProducedPhones:V,demandForPhones:B,demandForRecycledMaterials:q,demandForRefurbishedPhones:W,demandForRefurbishment:K,demandForRepairedPhones:H,demandForReusedPhones:U,inflowIncentiveSumForPhonesInUse:z,phoneGoal:L,phonesInUseExcess:N,recycleDemand:J,repairDemand:Q,resourceDemand:$,supplyOfBrokenPhonesForDisposal:Y,supplyOfBrokenPhonesForRepair:j/(j+x)*l,supplyOfDisposedPhonesForLandfilling:G,supplyOfDisposedPhonesForRecycling:Z},flows:{abandon:m*s+g*N,acquireNewlyProduced:b*Math.min(u,V),acquireRefurbished:b*Math.min(W,f),acquireRepaired:b*Math.min(H,p),acquireUsed:b*Math.min(h,U),capacityOfNewlyProducedPhonesAdjustment:v*(V-r),capacityOfRecycledMaterialsAdjustment:v*(q-n),capacityOfRefurbishedPhonesAdjustment:v*(W-o),disposeBroken:_*Y,disposeHibernating:_*h,goBroken:y/w*s,landfill:O*G,produceFromNaturalResources:k*X,produceFromRecycledMaterials:k*Math.min(q,d),recycle:D*Math.min(Z,J),refurbish:C*Math.min(h,K),repair:I*Math.min(l,Q),repairShopCapcityAdjustment:v*(H-a)}}}// eslint-disable-next-line class-methods-use-this -accumulateFlowsPerStock(t){let{abandon:e,acquireNewlyProduced:i,acquireRefurbished:r,acquireRepaired:n,acquireUsed:o,capacityOfNewlyProducedPhonesAdjustment:a,capacityOfRecycledMaterialsAdjustment:s,capacityOfRefurbishedPhonesAdjustment:l,disposeBroken:c,disposeHibernating:h,goBroken:u,landfill:d,produceFromNaturalResources:f,produceFromRecycledMaterials:p,recycle:g,refurbish:m,repair:b,repairShopCapcityAdjustment:y}=t;return{capacityOfNewlyProducedPhones:a,capacityOfRecycledMaterials:s,capacityOfRefurbishedPhones:l,capacityOfRepairedPhones:y,phonesInUse:i+r+n+o-(e+u),supplyOfBrokenPhones:u-(c+b),supplyOfDisposedPhones:c+h-(d+g),supplyOfHibernatingPhones:e-(o+h+m),supplyOfNewlyProducedPhones:f+p-i,supplyOfRecycledMaterials:g-p,supplyOfRefurbishedPhones:m-r,supplyOfRepairedPhones:b-n}}constructor(){super(aB,aV,aW,aH)}}aU.initialStocks={capacityOfNewlyProducedPhones:0,capacityOfRecycledMaterials:0,capacityOfRefurbishedPhones:0,capacityOfRepairedPhones:0,phonesInUse:0,supplyOfBrokenPhones:0,supplyOfDisposedPhones:0,supplyOfHibernatingPhones:0,supplyOfNewlyProducedPhones:0,supplyOfRecycledMaterials:0,supplyOfRefurbishedPhones:0,supplyOfRepairedPhones:0},aU.defaultParameters={abandonExcessRate:.5,abandonRate:.1,acquireRate:1,breakRate:.1,capacityAdjustmentRate:.1,disposeIncentive:.5,disposeRate:.5,durability:1,landfillIncentive:.5,landfillRate:1,naturalResourcesIncentive:.5,newPhoneProductionRate:.5,newlyProducedPhoneIncentive:.82,numberOfUsers:1e6,phonesPerUserGoal:1,recycleRate:1,recyclingIncentive:.89,refurbishmentIncentive:.5,refurbishmentRate:1,repairIncentive:.5,repairRate:1,reuseIncentive:.86};var a$=class{evaluateFlowPerStockWithCache(t,e){return null!==this.flowPerStockCache&&this.flowPerStockCache.t===e?[...this.flowPerStockCache.value]:this.flowEvaluator(t,e)}step(){let{stocks:t,parameters:e,t:i}=this.record,r=this.model.step(t,i,this.h,this.flowEvaluatorWithCache),n=this.model.evaluate(r,e,i+this.h);return this.flowPerStockCache={t:n.t,value:this.model.stocksToStockArray(this.model.accumulateFlowsPerStock(n.flows))},this.record=n,n}constructor(t,e,i,r,n){this.model=t,this.parameters=i,this.flowPerStockCache=null,this.record=this.model.evaluate(e,i,r),this.h=n,this.flowEvaluator=this.model.createFlowEvaluator(i),this.flowEvaluatorWithCache=this.evaluateFlowPerStockWithCache.bind(this)}},aq={},aY={};aY=/** +if(ak=t,e||this.options.forceAutoScrollFallback||r7||r9||oe){aR(t,this.options,o,e);// Listener for pointer element change +var a=ow(o,!0);aA&&(!aP||n!==aO||r!==aM)&&(aP&&aT(),// Detect for pointer elem change, emulating native DnD behaviour +aP=setInterval(function(){var o=ow(document.elementFromPoint(n,r),!0);o!==a&&(a=o,aD()),aR(t,i.options,o,e)},10),aO=n,aM=r)}else{// if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll +if(!this.options.bubbleScroll||ow(o,!0)===op()){aD();return}aR(t,this.options,ow(o,!1),!1)}}},r6(t,{pluginName:"scroll",initializeByDefault:!0})}),am.mount(aI,aj);class az{static elementObjectToArray(t,e){return t.map(t=>e[t])}static arrayToElementObject(t,e){let i={};for(let n=0;n{let n=this.stockArrayToStocks(e),r=this.evaluateFlowPerStock(n,t,i),o=this.stocksToStockArray(r);return o}}step(t,e,i,n){var r;let o=this.stocksToStockArray(t),a="number"==typeof e?aN(o,e,i,n,r):function(t,e,i,n,r,o){let a=[...e];return aN(t,i,n,(t,e)=>e===i?a:r(t,e),o)}(o,e,i,n,r,void 0);return this.stockArrayToStocks(a)}constructor(t,e,i,n){this.stockIds=t,this.flowIds=e,this.variableIds=i,this.parameterIds=n}}az.elementIds=["stocks","parameters","variables","flows"];const aB=["capacityOfNewlyProducedPhones","capacityOfRecycledMaterials","capacityOfRefurbishedPhones","capacityOfRepairedPhones","phonesInUse","supplyOfBrokenPhones","supplyOfDisposedPhones","supplyOfHibernatingPhones","supplyOfNewlyProducedPhones","supplyOfRecycledMaterials","supplyOfRefurbishedPhones","supplyOfRepairedPhones"],aV=["abandon","acquireNewlyProduced","acquireRefurbished","acquireRepaired","acquireUsed","capacityOfNewlyProducedPhonesAdjustment","capacityOfRecycledMaterialsAdjustment","capacityOfRefurbishedPhonesAdjustment","disposeBroken","disposeHibernating","goBroken","landfill","produceFromNaturalResources","produceFromRecycledMaterials","recycle","refurbish","repair","repairShopCapcityAdjustment"],aW=["demandForNaturalResources","demandForNewlyProducedPhones","demandForPhones","demandForRecycledMaterials","demandForRecycling","demandForRefurbishedPhones","demandForRefurbishment","demandForRepair","demandForRepairedPhones","demandForResources","demandForReusedPhones","inflowIncentiveSumForPhonesInUse","phoneGoal","phonesInUseExcess","supplyOfBrokenPhonesForDisposal","supplyOfBrokenPhonesForRepair","supplyOfDisposedPhonesForLandfilling","supplyOfDisposedPhonesForRecycling","supplyOfHibernatingPhonesForDisposal","supplyOfHibernatingPhonesForRefurbishment","supplyOfHibernatingPhonesForReuse"],aH=["abandonExcessRate","abandonRate","acquireRate","breakRate","capacityAdjustmentRate","disposeIncentive","disposeRate","landfillIncentive","landfillRate","naturalResourcesIncentive","newPhoneProductionRate","newlyProducedPhoneIncentive","numberOfUsers","phonesPerUserGoal","recycleRate","recyclingIncentive","refurbishmentIncentive","refurbishmentRate","repairIncentive","repairRate","reuseIncentive"];class aU extends az{// eslint-disable-next-line class-methods-use-this +evaluate(t,e,i){let{capacityOfNewlyProducedPhones:n,capacityOfRecycledMaterials:r,capacityOfRefurbishedPhones:o,capacityOfRepairedPhones:a,phonesInUse:s,supplyOfBrokenPhones:l,supplyOfDisposedPhones:c,supplyOfHibernatingPhones:h,supplyOfNewlyProducedPhones:u,supplyOfRecycledMaterials:d,supplyOfRefurbishedPhones:f,supplyOfRepairedPhones:p}=t,{abandonExcessRate:g,abandonRate:m,acquireRate:b,breakRate:y,capacityAdjustmentRate:v,disposeIncentive:x,disposeRate:_,landfillIncentive:w,landfillRate:S,naturalResourcesIncentive:O,newPhoneProductionRate:M,newlyProducedPhoneIncentive:k,numberOfUsers:P,phonesPerUserGoal:E,recycleRate:A,recyclingIncentive:D,refurbishmentIncentive:T,refurbishmentRate:R,repairIncentive:C,repairRate:j,reuseIncentive:I}=e,F=P*E,L=Math.max(s-F,0),N=m*s+g*L,z=I+C+T+k,B=y*s,V=Math.max(0,F-s+B+N),W=k/z*V,H=b*Math.min(u,W),U=T/z*V,$=b*Math.min(U,f),q=C/z*V,Y=b*Math.min(q,p),G=I/(I+T+x)*h,X=I/z*V,Z=Math.max(n-u+H,0),J=D/(O+D)*Z,K=x/(C+x)*l,Q=x/(I+T+x)*h,tt=w/(D+w)*c,te=O/(O+D)*Z,ti=M*Math.min(J,d),tn=D/(D+w)*c,tr=Math.max(r-d+ti,0),to=T/(I+T+x)*h,ta=Math.max(o-f+$,0),ts=Math.max(a-p+Y,0);return{t:i,stocks:t,parameters:e,variables:{demandForNaturalResources:te,demandForNewlyProducedPhones:W,demandForPhones:V,demandForRecycledMaterials:J,demandForRecycling:tr,demandForRefurbishedPhones:U,demandForRefurbishment:ta,demandForRepair:ts,demandForRepairedPhones:q,demandForResources:Z,demandForReusedPhones:X,inflowIncentiveSumForPhonesInUse:z,phoneGoal:F,phonesInUseExcess:L,supplyOfBrokenPhonesForDisposal:K,supplyOfBrokenPhonesForRepair:C/(C+x)*l,supplyOfDisposedPhonesForLandfilling:tt,supplyOfDisposedPhonesForRecycling:tn,supplyOfHibernatingPhonesForDisposal:Q,supplyOfHibernatingPhonesForRefurbishment:to,supplyOfHibernatingPhonesForReuse:G},flows:{abandon:N,acquireNewlyProduced:H,acquireRefurbished:$,acquireRepaired:Y,acquireUsed:b*Math.min(G,X),capacityOfNewlyProducedPhonesAdjustment:v*(W-n),capacityOfRecycledMaterialsAdjustment:v*(J-r),capacityOfRefurbishedPhonesAdjustment:v*(U-o),disposeBroken:_*K,disposeHibernating:_*Q,goBroken:B,landfill:S*tt,produceFromNaturalResources:M*te,produceFromRecycledMaterials:ti,recycle:A*Math.min(tn,tr),refurbish:R*Math.min(to,ta),repair:j*Math.min(l,ts),repairShopCapcityAdjustment:v*(q-a)}}}// eslint-disable-next-line class-methods-use-this +accumulateFlowsPerStock(t){let{abandon:e,acquireNewlyProduced:i,acquireRefurbished:n,acquireRepaired:r,acquireUsed:o,capacityOfNewlyProducedPhonesAdjustment:a,capacityOfRecycledMaterialsAdjustment:s,capacityOfRefurbishedPhonesAdjustment:l,disposeBroken:c,disposeHibernating:h,goBroken:u,landfill:d,produceFromNaturalResources:f,produceFromRecycledMaterials:p,recycle:g,refurbish:m,repair:b,repairShopCapcityAdjustment:y}=t;return{capacityOfNewlyProducedPhones:a,capacityOfRecycledMaterials:s,capacityOfRefurbishedPhones:l,capacityOfRepairedPhones:y,phonesInUse:i+n+r+o-(e+u),supplyOfBrokenPhones:u-(c+b),supplyOfDisposedPhones:c+h-(d+g),supplyOfHibernatingPhones:e-(o+h+m),supplyOfNewlyProducedPhones:f+p-i,supplyOfRecycledMaterials:g-p,supplyOfRefurbishedPhones:m-n,supplyOfRepairedPhones:b-r}}constructor(){super(aB,aV,aW,aH)}}aU.initialStocks={capacityOfNewlyProducedPhones:0,capacityOfRecycledMaterials:0,capacityOfRefurbishedPhones:0,capacityOfRepairedPhones:0,phonesInUse:0,supplyOfBrokenPhones:0,supplyOfDisposedPhones:0,supplyOfHibernatingPhones:0,supplyOfNewlyProducedPhones:0,supplyOfRecycledMaterials:0,supplyOfRefurbishedPhones:0,supplyOfRepairedPhones:0},aU.defaultParameters={abandonExcessRate:.5,abandonRate:.1,acquireRate:1,breakRate:.1,capacityAdjustmentRate:.1,disposeIncentive:.5,disposeRate:.5,landfillIncentive:.5,landfillRate:1,naturalResourcesIncentive:.5,newPhoneProductionRate:.5,newlyProducedPhoneIncentive:.82,numberOfUsers:1e6,phonesPerUserGoal:1,recycleRate:1,recyclingIncentive:.89,refurbishmentIncentive:.5,refurbishmentRate:1,repairIncentive:.5,repairRate:1,reuseIncentive:.86};var a$=class{evaluateFlowPerStockWithCache(t,e){return null!==this.flowPerStockCache&&this.flowPerStockCache.t===e?[...this.flowPerStockCache.value]:this.flowEvaluator(t,e)}step(){let{stocks:t,parameters:e,t:i}=this.record,n=this.model.step(t,i,this.h,this.flowEvaluatorWithCache),r=this.model.evaluate(n,e,i+this.h);return this.flowPerStockCache={t:r.t,value:this.model.stocksToStockArray(this.model.accumulateFlowsPerStock(r.flows))},this.record=r,r}constructor(t,e,i,n,r){this.model=t,this.parameters=i,this.flowPerStockCache=null,this.record=this.model.evaluate(e,i,n),this.h=r,this.flowEvaluator=this.model.createFlowEvaluator(i),this.flowEvaluatorWithCache=this.evaluateFlowPerStockWithCache.bind(this)}},aq={},aY={};aY=/** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * @@ -927,7 +927,7 @@ accumulateFlowsPerStock(t){let{abandon:e,acquireNewlyProduced:i,acquireRefurbish * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. - */function(t,e,i,r){var n=-1,o=null==t?0:t.length;for(r&&o&&(i=t[++n]);++n false - */function(t){return"symbol"==typeof t||sn(t)&&"[object Symbol]"==a8(t)};/** Used as references for various `Number` constants. */var so=1/0,sa=aQ?aQ.prototype:void 0,ss=sa?sa.toString:void 0;aK=/** + */function(t){return"symbol"==typeof t||sr(t)&&"[object Symbol]"==a8(t)};/** Used as references for various `Number` constants. */var so=1/0,sa=aQ?aQ.prototype:void 0,ss=sa?sa.toString:void 0;aK=/** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * @@ -1088,14 +1088,14 @@ if("string"==typeof e)return e;if(a5(e))return a2(e,t)+"";if(a3(e))return ss?ss. * @param {boolean} clearStyles * If true removes the style elements from the file * @return {Promise} - */async function sL(t,e=!0){var i;let r=await fetch(t);if(r.status<200||r.status>=300)throw Error(`Server returned status ${r.status} (${r.statusText}) loading ${new URL(t).href}.`);let n=await r.text(),o=document.createElement("div");o.innerHTML=n;let a=o.querySelector("svg");if(null===a)throw Error(`No SVG element found in ${new URL(t).href}.`);return e&&(null===(i=a.querySelectorAll("style"))||void 0===i||i.forEach(t=>t.remove())),a}function sN(t,e,i){let r=t.querySelector(e);if(null===r)throw Error(`No element found matching selector ${e}.`);if(!(r instanceof i))throw Error(`Element matching selector ${e} has the wrong type.`);return r}i=function(t,e,i){return t+(i?"-":"")+e.toLowerCase()},aq=function(t){return aY(sh(aG(t).replace(sF,"")),i,"")};var sz={};sz=s("9v928").getBundleURL("kdWl4")+"model.f8e270f6.svg";const sB=new URL(sz),sV=["abandon","acquireNewlyProduced","acquireRefurbished","acquireRepaired","acquireUsed","disposeBroken","disposeHibernating","goBroken","landfill","produceFromNaturalResources","produceFromRecycledMaterials","recycle","refurbish","repair"],sW={abandon:1,acquireNewlyProduced:-1,acquireRefurbished:-1,acquireRepaired:-1,acquireUsed:-1,disposeBroken:-1,disposeHibernating:-1,goBroken:-1,landfill:-1,produceFromNaturalResources:-1,produceFromRecycledMaterials:-1,recycle:-1,refurbish:-1,repair:-1};class sH{updateSvgFlows(t,e){let{flows:i}=e,r=5/e.parameters.numberOfUsers;sV.forEach(e=>{var o;let a=i[e],s=sW[e],l=`${/*@__PURE__*/n(aq)(e)}-flow`,c=sN(this.svg,`#${l}`,SVGPathElement),h=parseFloat(null!==(o=c.getAttribute("stroke-dashoffset"))&&void 0!==o?o:"0"),u=(Number.isNaN(h)?0:h)+Math.max(-6,Math.min(s*(t*a)*r,2));c.setAttribute("stroke-dashoffset",`${u}`),c.setAttribute("stroke-dasharray","0 20")})}updateSvgStocks(t,e){let{stocks:i}=e,r=5e4/e.parameters.numberOfUsers;this.model.stockIds.forEach(t=>{let e=/*@__PURE__*/n(aq)(t),o=this.svg.getElementById(e);if(null===o)throw Error(`SVG element with id ${e} for stock ${t} not found.`);if(!(o instanceof SVGCircleElement))throw Error(`Stock element for stock ${t} with id ${e} is not an SVG circle element.`);let a=i[t];o.setAttribute("r",`${Math.sqrt(a*r/Math.PI)}`)})}updateSvg(t,e){this.updateSvgFlows(t,e),this.updateSvgStocks(t,e)}update(t,e){this.updateSvg(t,e)}static prepareSvg(t,e){let i=t=>e.ownerDocument.createElementNS("http://www.w3.org/2000/svg",t);e.classList.add("model-visualization"),e.querySelectorAll("circle, rect, path, text").forEach(t=>{t.removeAttribute("style")});let r=[...e.children],o=i("g");o.classList.add("labels");let a=i("g");a.classList.add("supplies");let s=i("g");s.classList.add("capacities");let l=i("g");l.classList.add("flows"),e.append(s,l,a,o),e.querySelectorAll("text").forEach(t=>{let e=t.cloneNode(!0);e.classList.add("label"),o.append(e)}),e.querySelectorAll("rect").forEach(t=>{let e=t.cloneNode(!1);e.classList.add("capacity"),s.append(e)}),t.stockIds.filter(t=>t.startsWith("supplyOf")).forEach(t=>{let i=/*@__PURE__*/n(aq)(t.replace(/^supplyOf/,"")),r=sN(e,`#${i}`,SVGGeometryElement),o=r.cloneNode(!1);o.id=`supply-of-${r.id}`,o.classList.add("stock","supply"),a.append(o)});let c=sN(e,"#phones-in-use",SVGGeometryElement),h=c.cloneNode(!1);a.append(h),t.stockIds.filter(t=>t.startsWith("capacityOf")).forEach(t=>{let i=/*@__PURE__*/n(aq)(t.replace(/^capacityOf/,"")),r=sN(e,`#${i}`,SVGGeometryElement),o=r.cloneNode(!1);o.id=`capacity-of-${i}`,o.classList.add("stock","capacity"),s.append(o)}),sV.forEach(t=>{let i=/*@__PURE__*/n(aq)(t),r=sN(e,`#${i}`,SVGGeometryElement),o=r.cloneNode(!1);o.id=`${i}-edge`,o.removeAttribute("style"),o.classList.add("flow","edge"),l.append(o);let a=r.cloneNode(!1);a.id=`${i}-flow`,a.removeAttribute("style"),a.classList.add("flow","anim-edge"),l.append(a)}),r.forEach(t=>t.remove())}static async create(t){let e=await sL(sB);return this.prepareSvg(t,e),new sH(t,e)}constructor(t,e){this.model=t,this.svg=e,this.element=document.createElement("div"),this.element.append(this.svg)}}async function sU(){return new Promise(t=>{let e=document.readyState;("complete"===e||"interactive"===e)&&setTimeout(t,0),document.addEventListener("DOMContentLoaded",()=>t())})}class s${constructor(t){this.i18nKey=t}}class sq extends s${applyTo(t){return this.callable(t),t}constructor(t,e){super(t),this.callable=e}}class sY extends sq{static createFunction(t,e){t.forEach(t=>{if(!("string"==typeof t&&t.trim()===t&&null!==t.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)))throw Error(`Parameter name '${t}' can not be used as a variable`)});// eslint-disable-next-line @typescript-eslint/no-implied-eval -let i=Function(e).toString(),r=Function(`{ ${t.join(", ")} }`,`(${i})(); return { ${t.join(", ")} }`);return t=>{let e=r(t);return Object.assign(t,e),t}}constructor(t,e,i){super(t,sY.createFunction(e,i)),this.script=i}}async function sG(){let t=new aU,e=new a$(t,{...aU.initialStocks},{...aU.defaultParameters},0,.01),i=sN(document,"#parameter-transforms .available",HTMLElement),r=sN(document,"#parameter-transforms .active",HTMLElement),n=new Map;function o(){let i={...aU.defaultParameters};[...r.children].forEach(e=>{(0,c.strict)(e instanceof HTMLElement);let r=e.getAttribute("data-id");(0,c.strict)(null!==r);let o=n.get(r);(0,c.strict)(void 0!==o);let a={...i};o.applyTo(i);let s=function(e,i){let r={};return t.parameterIds.forEach(t=>{e[t]!==i[t]&&(r[t]=i[t])}),r}(a,i);e.title=`${o.script} + */async function sL(t,e=!0){var i;let n=await fetch(t);if(n.status<200||n.status>=300)throw Error(`Server returned status ${n.status} (${n.statusText}) loading ${new URL(t).href}.`);let r=await n.text(),o=document.createElement("div");o.innerHTML=r;let a=o.querySelector("svg");if(null===a)throw Error(`No SVG element found in ${new URL(t).href}.`);return e&&(null===(i=a.querySelectorAll("style"))||void 0===i||i.forEach(t=>t.remove())),a}function sN(t,e,i){let n=t.querySelector(e);if(null===n)throw Error(`No element found matching selector ${e}.`);if(!(n instanceof i))throw Error(`Element matching selector ${e} has the wrong type.`);return n}i=function(t,e,i){return t+(i?"-":"")+e.toLowerCase()},aq=function(t){return aY(sh(aG(t).replace(sF,"")),i,"")};var sz={};sz=s("9v928").getBundleURL("kdWl4")+"model.f8e270f6.svg";const sB=new URL(sz),sV=["abandon","acquireNewlyProduced","acquireRefurbished","acquireRepaired","acquireUsed","disposeBroken","disposeHibernating","goBroken","landfill","produceFromNaturalResources","produceFromRecycledMaterials","recycle","refurbish","repair"],sW={abandon:1,acquireNewlyProduced:-1,acquireRefurbished:-1,acquireRepaired:-1,acquireUsed:-1,disposeBroken:-1,disposeHibernating:-1,goBroken:-1,landfill:-1,produceFromNaturalResources:-1,produceFromRecycledMaterials:-1,recycle:-1,refurbish:-1,repair:-1},sH=10*Math.sqrt(300),sU=300+sH;console.log(300,sH,sU);class s${updateSvgFlows(t,e,i){let{flows:n}=i,o=e*(3e4/i.parameters.numberOfUsers)/sU;sV.forEach(e=>{var i;let a=n[e],s=sW[e],l=`${/*@__PURE__*/r(aq)(e)}-flow`,c=sN(this.svg,`#${l}`,SVGPathElement),h=parseFloat(null!==(i=c.getAttribute("stroke-dashoffset"))&&void 0!==i?i:"0"),u=(Number.isNaN(h)?0:h)+Math.max(-9,Math.min(s*(t*a)*o,3));c.setAttribute("stroke-dashoffset",`${u}`),c.setAttribute("stroke-dasharray","0 30")})}updateSvgStocks(t,e,i){let{stocks:n}=i,o=3e4/i.parameters.numberOfUsers;this.model.stockIds.forEach(t=>{let e=/*@__PURE__*/r(aq)(t),i=this.svg.getElementById(e);if(null===i)throw Error(`SVG element with id ${e} for stock ${t} not found.`);if(!(i instanceof SVGCircleElement))throw Error(`Stock element for stock ${t} with id ${e} is not an SVG circle element.`);let a=n[t];i.setAttribute("r",`${Math.sqrt(a*o/Math.PI)}`)})}updateSvg(t,e,i){this.updateSvgFlows(t,e,i),this.updateSvgStocks(t,e,i)}update(t,e,i){this.updateSvg(t,e,i)}static prepareSvg(t,e){let i=t=>e.ownerDocument.createElementNS("http://www.w3.org/2000/svg",t);e.classList.add("model-visualization"),e.querySelectorAll("circle, rect, path, text").forEach(t=>{t.removeAttribute("style")});let n=[...e.children],o=i("g");o.classList.add("labels");let a=i("g");a.classList.add("supplies");let s=i("g");s.classList.add("capacities");let l=i("g");l.classList.add("flows"),e.append(s,l,a,o),e.querySelectorAll("text").forEach(t=>{let e=t.cloneNode(!0);e.classList.add("label"),o.append(e)}),e.querySelectorAll("rect").forEach(t=>{let e=t.cloneNode(!1);e.classList.add("capacity"),s.append(e)}),t.stockIds.filter(t=>t.startsWith("supplyOf")).forEach(t=>{let i=/*@__PURE__*/r(aq)(t.replace(/^supplyOf/,"")),n=sN(e,`#${i}`,SVGGeometryElement),o=n.cloneNode(!1);o.id=`supply-of-${n.id}`,o.classList.add("stock","supply"),a.append(o)});let c=sN(e,"#phones-in-use",SVGGeometryElement),h=c.cloneNode(!1);a.append(h),t.stockIds.filter(t=>t.startsWith("capacityOf")).forEach(t=>{let i=/*@__PURE__*/r(aq)(t.replace(/^capacityOf/,"")),n=sN(e,`#${i}`,SVGGeometryElement),o=n.cloneNode(!1);o.id=`capacity-of-${i}`,o.classList.add("stock","capacity"),s.append(o)}),sV.forEach(t=>{let i=/*@__PURE__*/r(aq)(t),n=sN(e,`#${i}`,SVGGeometryElement),o=n.cloneNode(!1);o.id=`${i}-edge`,o.removeAttribute("style"),o.classList.add("flow","edge"),l.append(o);let a=n.cloneNode(!1);a.id=`${i}-flow`,a.removeAttribute("style"),a.classList.add("flow","anim-edge"),l.append(a)}),n.forEach(t=>t.remove())}static async create(t){let e=await sL(sB);return this.prepareSvg(t,e),new s$(t,e)}constructor(t,e){this.model=t,this.svg=e,this.element=document.createElement("div"),this.element.append(this.svg)}}async function sq(){return new Promise(t=>{let e=document.readyState;("complete"===e||"interactive"===e)&&setTimeout(t,0),document.addEventListener("DOMContentLoaded",()=>t())})}class sY{constructor(t){this.i18nKey=t}}class sG extends sY{applyTo(t){return this.callable(t),t}constructor(t,e){super(t),this.callable=e}}class sX extends sG{static createFunction(t,e){t.forEach(t=>{if(!("string"==typeof t&&t.trim()===t&&null!==t.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)))throw Error(`Parameter name '${t}' can not be used as a variable`)});// eslint-disable-next-line @typescript-eslint/no-implied-eval +let i=Function(e).toString(),n=Function(`{ ${t.join(", ")} }`,`(${i})(); return { ${t.join(", ")} }`);return t=>{let e=n(t);return Object.assign(t,e),t}}constructor(t,e,i){super(t,sX.createFunction(e,i)),this.script=i}}const sZ={abandonExcessRate:.5,abandonRate:.02,acquireRate:1,breakRate:.01,capacityAdjustmentRate:.05,disposeIncentive:1.5,disposeRate:.5,landfillIncentive:1,landfillRate:1,naturalResourcesIncentive:1.5,newPhoneProductionRate:1,newlyProducedPhoneIncentive:2,numberOfUsers:1e6,phonesPerUserGoal:1.2,recycleRate:1,recyclingIncentive:.25,refurbishmentIncentive:.25,refurbishmentRate:1,repairIncentive:.5,repairRate:1,reuseIncentive:.25};async function sJ(){let t=new aU,e=new a$(t,{...aU.initialStocks},{...sZ},0,.1),i=sN(document,"#parameter-transforms .available",HTMLElement),n=sN(document,"#parameter-transforms .active",HTMLElement),r=new Map;function o(){let i={...sZ};[...n.children].forEach(e=>{(0,c.strict)(e instanceof HTMLElement);let n=e.getAttribute("data-id");(0,c.strict)(null!==n);let o=r.get(n);(0,c.strict)(void 0!==o);let a={...i};o.applyTo(i);let s=function(e,i){let n={};return t.parameterIds.forEach(t=>{e[t]!==i[t]&&(n[t]=i[t])}),n}(a,i);e.title=`${o.script} ${JSON.stringify(s,null,2)} -${JSON.stringify(i,null,2)}`}),Object.assign(e.parameters,i)}am.create(i,{group:{name:"sharedParameterTransforms",pull:"clone",put:!1}}),am.create(r,{group:{name:"sharedParameterTransforms"},removeOnSpill:!0,onSort:()=>o(),onSpill:t=>{t.item.remove(),o()}});let a={create:(e,r)=>{if(n.has(e))throw Error(`Parameter transform with id '${e}' already exists`);n.set(e,new sY("none",t.parameterIds,r));let o=document.createElement("div");o.innerHTML=`

${e}
`;let a=o.firstChild;(0,c.strict)(null!==a),i.append(a)},destroy:t=>{n.delete(t)}};sN(document,"#add-parameter-transform",HTMLElement).addEventListener("click",()=>{let t=sN(document,"#parameter-transform-id",HTMLInputElement),e=t.value,i=sN(document,"#parameter-transform-script",HTMLTextAreaElement),r=i.value;a.create(e,r)});let s=0,l=sN(document,"#circularity-index",HTMLElement),h=0,u=sN(document,"#user-satisfaction",HTMLElement),d=await sH.create(t);function f(t){return aU.elementIds.map(e=>Object.entries(t[e]).map(([t,e])=>({id:t,value:e}))).reduce((t,e)=>[...t,...e],[])}document.body.prepend(d.element);let p=f(e.record),g=document.getElementById("chart");(0,c.strict)(null!==g,"chart element not found");let m=new rL(g,{type:"bar",data:{labels:p.map(t=>t.id),datasets:[{label:"Values",data:p.map(t=>t.value)}]},options:{animation:!1}});function b(t){// TODO: pass deltaMs to modelSimulator.step() -let i=e.step();!function(t){let{phonesInUse:e}=t.stocks,{produceFromNaturalResources:i,acquireNewlyProduced:r,acquireUsed:n,acquireRepaired:o,acquireRefurbished:a,disposeHibernating:c,disposeBroken:d,landfill:f}=t.flows,{phoneGoal:p}=t.variables;s+=(Math.min(1-Math.min(1,i/(r+n+o+a)),1-Math.min(1,f/(c+d)))-s)*.5,l.innerText=`${(100*s).toFixed(2)}%`,h+=((et.value),m.update(),d.update(t,i)}let y=!1,v=document.getElementById("run");async function x(){y=!0;let t=null;for(;v.checked;){// eslint-disable-next-line no-await-in-loop -let e=await aF(),i=null===t?0:e-t;b(i),t=e}y=!1}return(0,c.strict)(null!==v,"run checkbox not found"),v.addEventListener("input",()=>{y||x().catch(t=>{throw t})}),b(0),{model:t,modelSimulator:e,parameterTransforms:a}}window.circularEconomy=sU().then(sG);//# sourceMappingURL=index.7e1ba3ae.js.map +${JSON.stringify(i,null,2)}`}),Object.assign(e.parameters,i)}am.create(i,{group:{name:"sharedParameterTransforms",pull:"clone",put:!1}}),am.create(n,{group:{name:"sharedParameterTransforms"},removeOnSpill:!0,onSort:()=>o(),onSpill:t=>{t.item.remove(),o()}});let a={create:(e,n)=>{if(r.has(e))throw Error(`Parameter transform with id '${e}' already exists`);r.set(e,new sX("none",t.parameterIds,n));let o=document.createElement("div");o.innerHTML=`
${e}
`;let a=o.firstChild;(0,c.strict)(null!==a),i.append(a)},destroy:t=>{r.delete(t)}};sN(document,"#add-parameter-transform",HTMLElement).addEventListener("click",()=>{let t=sN(document,"#parameter-transform-id",HTMLInputElement),e=t.value,i=sN(document,"#parameter-transform-script",HTMLTextAreaElement),n=i.value;a.create(e,n)});let s=sN(document,"#sliders",HTMLElement);t.parameterIds.filter(t=>"numberOfUsers"!==t).forEach(t=>{let e=document.createElement("div"),i=document.createElement("input");function n(){sZ[t]=Number.parseFloat(i.value),e.innerText=`${t} = ${sZ[t]}`,o()}i.type="range",i.min="0",i.max="4",i.step="0.001",i.value=`${sZ[t]}`,n(),i.addEventListener("input",n);let r=document.createElement("div");r.append(e,i),s.append(r)});let l=0,h=sN(document,"#circularity-index",HTMLElement),u=0,d=sN(document,"#user-satisfaction",HTMLElement),f=await s$.create(t);function p(t){return aU.elementIds.map(e=>Object.entries(t[e]).map(([t,e])=>({id:t,value:e}))).reduce((t,e)=>[...t,...e],[])}document.body.prepend(f.element);let g=p(e.record),m=document.getElementById("chart");(0,c.strict)(null!==m,"chart element not found");let b=new nL(m,{type:"bar",data:{labels:g.map(t=>t.id),datasets:[{label:"Values",data:g.map(t=>t.value)}]},options:{animation:!1}});function y(t){// TODO: pass deltaMs to modelSimulator.step() +let i=e.step();!function(t){let{phonesInUse:e}=t.stocks,{produceFromNaturalResources:i,acquireNewlyProduced:n,acquireUsed:r,acquireRepaired:o,acquireRefurbished:a,disposeHibernating:s,disposeBroken:c,landfill:f}=t.flows,{phoneGoal:p}=t.variables;l+=(Math.min(1-Math.min(1,i/(n+r+o+a)),1-Math.min(1,f/(s+c)))-l)*.5,h.innerText=`${(100*l).toFixed(1)}%`,u+=((et.value),b.update(),f.update(t,e.h,i)}let v=!1,x=document.getElementById("run");async function _(){v=!0;let t=null;for(;x.checked;){// eslint-disable-next-line no-await-in-loop +let e=await aF(),i=null===t?0:e-t;y(i),t=e}v=!1}return(0,c.strict)(null!==x,"run checkbox not found"),x.addEventListener("input",()=>{v||_().catch(t=>{throw t})}),y(0),{model:t,modelSimulator:e,parameterTransforms:a}}window.circularEconomy=sq().then(sJ);//# sourceMappingURL=index.97bcdae1.js.map -//# sourceMappingURL=index.7e1ba3ae.js.map +//# sourceMappingURL=index.97bcdae1.js.map diff --git a/assets/index.97bcdae1.js.map b/assets/index.97bcdae1.js.map new file mode 100644 index 0000000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IAAI,CAAC,OAAO,CAAG,EACf,IAAI,CAAC,WAAW,CAAG,EACnB,IAAI,CAAC,YAAY,CAAG,CACtB,CAwHF,CAvJe,GAMC,UAAA,CAAa,CACzB,SACA,aACA,YACA,QACD,CDvCH,MAAM,GAAW,CACf,gCACA,8BACA,8BACA,2BACA,cACA,uBACA,yBACA,4BACA,8BACA,4BACA,4BACA,yBACD,CAEK,GAAU,CACd,UACA,uBACA,qBACA,kBACA,cACA,0CACA,wCACA,wCACA,gBACA,qBACA,WACA,WACA,8BACA,+BACA,UACA,YACA,SACA,8BACD,CAEK,GAAc,CAClB,4BACA,+BACA,kBACA,6BACA,qBACA,6BACA,yBACA,kBACA,0BACA,qBACA,wBACA,mCACA,YACA,oBACA,kCACA,gCACA,uCACA,qCACA,uCACA,4CACA,oCACD,CAEK,GAAe,CACnB,oBACA,cACA,cACA,YACA,yBACA,mBACA,cACA,oBACA,eACA,4BACA,yBACA,8BACA,gBACA,oBACA,cACA,qBACA,yBACA,oBACA,kBACA,aACA,iBACD,AAwBD,OAAM,WAA6B,GAiDjC,kDAAkD;AAC3C,SAAS,CAAc,CAAE,CAAsB,CAAE,CAAS,CAAU,CACzE,GAAM,CAAA,8BACJ,CAA6B,CAAA,4BAC7B,CAA2B,CAAA,4BAC3B,CAA2B,CAAA,yBAC3B,CAAwB,CAAA,YACxB,CAAW,CAAA,qBACX,CAAoB,CAAA,uBACpB,CAAsB,CAAA,0BACtB,CAAyB,CAAA,4BACzB,CAA2B,CAAA,0BAC3B,CAAyB,CAAA,0BACzB,CAAyB,CAAA,uBACzB,CAAsB,CACvB,CAAG,EACE,CAAA,kBACJ,CAAiB,CAAA,YACjB,CAAW,CAAA,YACX,CAAW,CAAA,UACX,CAAS,CAAA,uBACT,CAAsB,CAAA,iBACtB,CAAgB,CAAA,YAChB,CAAW,CAAA,kBACX,CAAiB,CAAA,aACjB,CAAY,CAAA,0BACZ,CAAyB,CAAA,uBACzB,CAAsB,CAAA,4BACtB,CAA2B,CA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,CAGF,CAQA,OAAO,eAAe,CAAG,AAAA,KAAgB,IAAI,CAAC,G,4D","sources":["","node_modules/assert/build/assert.js","node_modules/process/browser.js","node_modules/assert/build/internal/errors.js","node_modules/util/util.js","node_modules/util/support/types.js","node_modules/is-arguments/index.js","node_modules/has-tostringtag/shams.js","node_modules/has-symbols/shams.js","node_modules/call-bind/callBound.js","node_modules/get-intrinsic/index.js","node_modules/has-symbols/index.js","node_modules/has-proto/index.js","node_modules/function-bind/index.js","node_modules/function-bind/implementation.js","node_modules/hasown/index.js","node_modules/call-bind/index.js","node_modules/set-function-length/index.js","node_modules/define-data-property/index.js","node_modules/has-property-descriptors/index.js","node_modules/gopd/index.js","node_modules/is-generator-function/index.js","node_modules/which-typed-array/index.js","node_modules/for-each/index.js","node_modules/is-callable/index.js","node_modules/available-typed-arrays/index.js","node_modules/is-typed-array/index.js","node_modules/util/support/isBufferBrowser.js","node_modules/inherits/inherits_browser.js","node_modules/assert/build/internal/assert/assertion_error.js","node_modules/object.assign/polyfill.js","node_modules/object.assign/implementation.js","node_modules/object-keys/index.js","node_modules/object-keys/isArguments.js","node_modules/object-keys/implementation.js","node_modules/object-is/polyfill.js","node_modules/object-is/implementation.js","node_modules/assert/build/internal/util/comparisons.js","node_modules/object-is/index.js","node_modules/define-properties/index.js","node_modules/object-is/shim.js","node_modules/is-nan/index.js","node_modules/is-nan/implementation.js","node_modules/is-nan/polyfill.js","node_modules/is-nan/shim.js","src/ts/index.ts","node_modules/chart.js/auto/auto.js","node_modules/chart.js/dist/chart.js","node_modules/chart.js/src/core/core.animator.js","node_modules/chart.js/src/core/core.animation.js","node_modules/chart.js/src/core/core.animations.js","node_modules/chart.js/src/core/core.datasetController.js","node_modules/chart.js/src/controllers/controller.bar.js","node_modules/chart.js/src/controllers/controller.bubble.js","node_modules/chart.js/src/controllers/controller.doughnut.js","node_modules/chart.js/src/controllers/controller.line.js","node_modules/chart.js/src/controllers/controller.polarArea.js","node_modules/chart.js/src/controllers/controller.pie.js","node_modules/chart.js/src/controllers/controller.radar.js","node_modules/chart.js/src/controllers/controller.scatter.js","node_modules/chart.js/src/core/core.adapters.ts","node_modules/chart.js/src/core/core.interaction.js","node_modules/chart.js/src/core/core.layouts.js","node_modules/chart.js/src/platform/platform.base.js","node_modules/chart.js/src/platform/platform.basic.js","node_modules/chart.js/src/platform/platform.dom.js","node_modules/chart.js/src/platform/index.js","node_modules/chart.js/src/core/core.element.ts","node_modules/chart.js/src/core/core.scale.autoskip.js","node_modules/chart.js/src/core/core.scale.js","node_modules/chart.js/src/core/core.typedRegistry.js","node_modules/chart.js/src/core/core.registry.js","node_modules/chart.js/src/core/core.plugins.js","node_modules/chart.js/src/core/core.config.js","node_modules/chart.js/src/core/core.controller.js","node_modules/chart.js/src/elements/element.arc.ts","node_modules/chart.js/src/elements/element.line.js","node_modules/chart.js/src/elements/element.point.ts","node_modules/chart.js/src/elements/element.bar.js","node_modules/chart.js/src/plugins/plugin.colors.ts","node_modules/chart.js/src/plugins/plugin.decimation.js","node_modules/chart.js/src/plugins/plugin.filler/filler.segment.js","node_modules/chart.js/src/plugins/plugin.filler/filler.helper.js","node_modules/chart.js/src/plugins/plugin.filler/filler.options.js","node_modules/chart.js/src/plugins/plugin.filler/filler.target.stack.js","node_modules/chart.js/src/plugins/plugin.filler/simpleArc.js","node_modules/chart.js/src/plugins/plugin.filler/filler.target.js","node_modules/chart.js/src/plugins/plugin.filler/filler.drawing.js","node_modules/chart.js/src/plugins/plugin.filler/index.js","node_modules/chart.js/src/plugins/plugin.legend.js","node_modules/chart.js/src/plugins/plugin.title.js","node_modules/chart.js/src/plugins/plugin.subtitle.js","node_modules/chart.js/src/plugins/plugin.tooltip.js","node_modules/chart.js/src/scales/scale.category.js","node_modules/chart.js/src/scales/scale.linearbase.js","node_modules/chart.js/src/scales/scale.linear.js","node_modules/chart.js/src/scales/scale.logarithmic.js","node_modules/chart.js/src/scales/scale.radialLinear.js","node_modules/chart.js/src/scales/scale.time.js","node_modules/chart.js/src/scales/scale.timeseries.js","node_modules/chart.js/src/index.ts","node_modules/@swc/helpers/esm/_define_property.js","node_modules/chart.js/dist/chunks/helpers.segment.js","node_modules/chart.js/src/helpers/helpers.core.ts","node_modules/chart.js/src/helpers/helpers.math.ts","node_modules/chart.js/src/helpers/helpers.collection.ts","node_modules/chart.js/src/helpers/helpers.extras.ts","node_modules/chart.js/src/helpers/helpers.easing.ts","node_modules/chart.js/src/helpers/helpers.color.ts","node_modules/chart.js/src/core/core.animations.defaults.js","node_modules/chart.js/src/core/core.layouts.defaults.js","node_modules/chart.js/src/helpers/helpers.intl.ts","node_modules/chart.js/src/core/core.ticks.js","node_modules/chart.js/src/core/core.scale.defaults.js","node_modules/chart.js/src/core/core.defaults.js","node_modules/chart.js/src/helpers/helpers.canvas.ts","node_modules/chart.js/src/helpers/helpers.options.ts","node_modules/chart.js/src/helpers/helpers.config.ts","node_modules/chart.js/src/helpers/helpers.curve.ts","node_modules/chart.js/src/helpers/helpers.dom.ts","node_modules/chart.js/src/helpers/helpers.interpolation.ts","node_modules/chart.js/src/helpers/helpers.rtl.ts","node_modules/chart.js/src/helpers/helpers.segment.js","node_modules/@kurkle/color/dist/color.esm.js","node_modules/sortablejs/modular/sortable.esm.js","src/ts/util/animation-frame.ts","src/ts/circular-economy-model.ts","src/ts/model.ts","src/ts/box-model/box-model.ts","src/ts/box-model/engine.ts","src/ts/box-model/ode.ts","src/ts/model-simulator.ts","src/ts/visualization.ts","node_modules/lodash/kebabCase.js","node_modules/lodash/_createCompounder.js","node_modules/lodash/_arrayReduce.js","node_modules/lodash/deburr.js","node_modules/lodash/_deburrLetter.js","node_modules/lodash/_basePropertyOf.js","node_modules/lodash/toString.js","node_modules/lodash/_baseToString.js","node_modules/lodash/_Symbol.js","node_modules/lodash/_root.js","node_modules/lodash/_freeGlobal.js","node_modules/lodash/_arrayMap.js","node_modules/lodash/isArray.js","node_modules/lodash/isSymbol.js","node_modules/lodash/_baseGetTag.js","node_modules/lodash/_getRawTag.js","node_modules/lodash/_objectToString.js","node_modules/lodash/isObjectLike.js","node_modules/lodash/words.js","node_modules/lodash/_asciiWords.js","node_modules/lodash/_hasUnicodeWord.js","node_modules/lodash/_unicodeWords.js","src/ts/util/load-svg.ts","src/ts/util/guarded-query-selectors.ts","node_modules/@parcel/runtime-js/lib/runtime-1f561a508aa967b2.js","src/ts/util/document-ready.ts","src/ts/parameter-transform/scripted-parameter-transform.ts","src/ts/util/is-var-name.ts","src/ts/parameter-transform/function-parameter-transform.ts","src/ts/parameter-transform/parameter-transform.ts"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec7f3\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec7f3\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"GE7rZ\", function(module, exports) {\n// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar $bYqme = parcelRequire(\"bYqme\");\n\"use strict\";\nfunction $08030b30a83dd10b$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $08030b30a83dd10b$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $08030b30a83dd10b$var$_typeof(o);\n}\nfunction $08030b30a83dd10b$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, $08030b30a83dd10b$var$_toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction $08030b30a83dd10b$var$_createClass(Constructor, protoProps, staticProps) {\n if (protoProps) $08030b30a83dd10b$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $08030b30a83dd10b$var$_defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction $08030b30a83dd10b$var$_toPropertyKey(arg) {\n var key = $08030b30a83dd10b$var$_toPrimitive(arg, \"string\");\n return $08030b30a83dd10b$var$_typeof(key) === \"symbol\" ? key : String(key);\n}\nfunction $08030b30a83dd10b$var$_toPrimitive(input, hint) {\n if ($08030b30a83dd10b$var$_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if ($08030b30a83dd10b$var$_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction $08030b30a83dd10b$var$_classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\n\nvar $idZmf = parcelRequire(\"idZmf\");\nvar $08030b30a83dd10b$var$_require$codes = $idZmf.codes, $08030b30a83dd10b$var$ERR_AMBIGUOUS_ARGUMENT = $08030b30a83dd10b$var$_require$codes.ERR_AMBIGUOUS_ARGUMENT, $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE = $08030b30a83dd10b$var$_require$codes.ERR_INVALID_ARG_TYPE, $08030b30a83dd10b$var$ERR_INVALID_ARG_VALUE = $08030b30a83dd10b$var$_require$codes.ERR_INVALID_ARG_VALUE, $08030b30a83dd10b$var$ERR_INVALID_RETURN_VALUE = $08030b30a83dd10b$var$_require$codes.ERR_INVALID_RETURN_VALUE, $08030b30a83dd10b$var$ERR_MISSING_ARGS = $08030b30a83dd10b$var$_require$codes.ERR_MISSING_ARGS;\n\nvar $dfdGN = parcelRequire(\"dfdGN\");\n\nvar $5d0kT = parcelRequire(\"5d0kT\");\nvar $08030b30a83dd10b$var$inspect = $5d0kT.inspect;\n\nvar $5d0kT = parcelRequire(\"5d0kT\");\nvar $08030b30a83dd10b$require$_require$types = $5d0kT.types;\nvar $08030b30a83dd10b$var$isPromise = $08030b30a83dd10b$require$_require$types.isPromise, $08030b30a83dd10b$var$isRegExp = $08030b30a83dd10b$require$_require$types.isRegExp;\n\nvar $08030b30a83dd10b$var$objectAssign = (parcelRequire(\"5AA81\"))();\n\nvar $08030b30a83dd10b$var$objectIs = (parcelRequire(\"2bLwM\"))();\n\nvar $08030b30a83dd10b$var$RegExpPrototypeTest = (parcelRequire(\"9rEHq\"))(\"RegExp.prototype.test\");\nvar $08030b30a83dd10b$var$errorCache = new Map();\nvar $08030b30a83dd10b$var$isDeepEqual;\nvar $08030b30a83dd10b$var$isDeepStrictEqual;\nvar $08030b30a83dd10b$var$parseExpressionAt;\nvar $08030b30a83dd10b$var$findNodeAround;\nvar $08030b30a83dd10b$var$decoder;\n\nfunction $08030b30a83dd10b$var$lazyLoadComparison() {\n var comparison = (parcelRequire(\"gz1S4\"));\n $08030b30a83dd10b$var$isDeepEqual = comparison.isDeepEqual;\n $08030b30a83dd10b$var$isDeepStrictEqual = comparison.isDeepStrictEqual;\n}\n// Escape control characters but not \\n and \\t to keep the line breaks and\n// indentation intact.\n// eslint-disable-next-line no-control-regex\nvar $08030b30a83dd10b$var$escapeSequencesRegExp = /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/g;\nvar $08030b30a83dd10b$var$meta = [\n \"\\\\u0000\",\n \"\\\\u0001\",\n \"\\\\u0002\",\n \"\\\\u0003\",\n \"\\\\u0004\",\n \"\\\\u0005\",\n \"\\\\u0006\",\n \"\\\\u0007\",\n \"\\\\b\",\n \"\",\n \"\",\n \"\\\\u000b\",\n \"\\\\f\",\n \"\",\n \"\\\\u000e\",\n \"\\\\u000f\",\n \"\\\\u0010\",\n \"\\\\u0011\",\n \"\\\\u0012\",\n \"\\\\u0013\",\n \"\\\\u0014\",\n \"\\\\u0015\",\n \"\\\\u0016\",\n \"\\\\u0017\",\n \"\\\\u0018\",\n \"\\\\u0019\",\n \"\\\\u001a\",\n \"\\\\u001b\",\n \"\\\\u001c\",\n \"\\\\u001d\",\n \"\\\\u001e\",\n \"\\\\u001f\"\n];\nvar $08030b30a83dd10b$var$escapeFn = function escapeFn(str) {\n return $08030b30a83dd10b$var$meta[str.charCodeAt(0)];\n};\nvar $08030b30a83dd10b$var$warned = false;\n// The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\nvar $08030b30a83dd10b$var$assert = module.exports = $08030b30a83dd10b$var$ok;\nvar $08030b30a83dd10b$var$NO_EXCEPTION_SENTINEL = {};\n// All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\nfunction $08030b30a83dd10b$var$innerFail(obj) {\n if (obj.message instanceof Error) throw obj.message;\n throw new $dfdGN(obj);\n}\nfunction $08030b30a83dd10b$var$fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length;\n var internalMessage;\n if (argsLen === 0) internalMessage = \"Failed\";\n else if (argsLen === 1) {\n message = actual;\n actual = undefined;\n } else {\n if ($08030b30a83dd10b$var$warned === false) {\n $08030b30a83dd10b$var$warned = true;\n var warn = $bYqme.emitWarning ? $bYqme.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n if (argsLen === 2) operator = \"!=\";\n }\n if (message instanceof Error) throw message;\n var errArgs = {\n actual: actual,\n expected: expected,\n operator: operator === undefined ? \"fail\" : operator,\n stackStartFn: stackStartFn || $08030b30a83dd10b$var$fail\n };\n if (message !== undefined) errArgs.message = message;\n var err = new $dfdGN(errArgs);\n if (internalMessage) {\n err.message = internalMessage;\n err.generatedMessage = true;\n }\n throw err;\n}\n$08030b30a83dd10b$var$assert.fail = $08030b30a83dd10b$var$fail;\n// The AssertionError is defined in internal/error.\n$08030b30a83dd10b$var$assert.AssertionError = $dfdGN;\nfunction $08030b30a83dd10b$var$innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = false;\n if (argLen === 0) {\n generatedMessage = true;\n message = \"No value argument passed to `assert.ok()`\";\n } else if (message instanceof Error) throw message;\n var err = new $dfdGN({\n actual: value,\n expected: true,\n message: message,\n operator: \"==\",\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\n// Pure assertion tests whether a value is truthy, as determined\n// by !!value.\nfunction $08030b30a83dd10b$var$ok() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];\n $08030b30a83dd10b$var$innerOk.apply(void 0, [\n $08030b30a83dd10b$var$ok,\n args.length\n ].concat(args));\n}\n$08030b30a83dd10b$var$assert.ok = $08030b30a83dd10b$var$ok;\n// The equality assertion tests shallow, coercive equality with ==.\n/* eslint-disable no-restricted-properties */ $08030b30a83dd10b$var$assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n // eslint-disable-next-line eqeqeq\n if (actual != expected) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"==\",\n stackStartFn: equal\n });\n};\n// The non-equality assertion tests for whether two objects are not\n// equal with !=.\n$08030b30a83dd10b$var$assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n // eslint-disable-next-line eqeqeq\n if (actual == expected) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n};\n// The equivalence assertion tests a deep equality relation.\n$08030b30a83dd10b$var$assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($08030b30a83dd10b$var$isDeepEqual === undefined) $08030b30a83dd10b$var$lazyLoadComparison();\n if (!$08030b30a83dd10b$var$isDeepEqual(actual, expected)) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n};\n// The non-equivalence assertion tests for any deep inequality.\n$08030b30a83dd10b$var$assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($08030b30a83dd10b$var$isDeepEqual === undefined) $08030b30a83dd10b$var$lazyLoadComparison();\n if ($08030b30a83dd10b$var$isDeepEqual(actual, expected)) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n};\n/* eslint-enable */ $08030b30a83dd10b$var$assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($08030b30a83dd10b$var$isDeepEqual === undefined) $08030b30a83dd10b$var$lazyLoadComparison();\n if (!$08030b30a83dd10b$var$isDeepStrictEqual(actual, expected)) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n};\n$08030b30a83dd10b$var$assert.notDeepStrictEqual = $08030b30a83dd10b$var$notDeepStrictEqual;\nfunction $08030b30a83dd10b$var$notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($08030b30a83dd10b$var$isDeepEqual === undefined) $08030b30a83dd10b$var$lazyLoadComparison();\n if ($08030b30a83dd10b$var$isDeepStrictEqual(actual, expected)) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: $08030b30a83dd10b$var$notDeepStrictEqual\n });\n}\n$08030b30a83dd10b$var$assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!$08030b30a83dd10b$var$objectIs(actual, expected)) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n};\n$08030b30a83dd10b$var$assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $08030b30a83dd10b$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($08030b30a83dd10b$var$objectIs(actual, expected)) $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n};\nvar $08030b30a83dd10b$var$Comparison = /*#__PURE__*/ $08030b30a83dd10b$var$_createClass(function Comparison(obj, keys, actual) {\n var _this = this;\n $08030b30a83dd10b$var$_classCallCheck(this, Comparison);\n keys.forEach(function(key) {\n if (key in obj) {\n if (actual !== undefined && typeof actual[key] === \"string\" && $08030b30a83dd10b$var$isRegExp(obj[key]) && $08030b30a83dd10b$var$RegExpPrototypeTest(obj[key], actual[key])) _this[key] = actual[key];\n else _this[key] = obj[key];\n }\n });\n});\nfunction $08030b30a83dd10b$var$compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !$08030b30a83dd10b$var$isDeepStrictEqual(actual[key], expected[key])) {\n if (!message) {\n // Create placeholder objects to create a nice output.\n var a = new $08030b30a83dd10b$var$Comparison(actual, keys);\n var b = new $08030b30a83dd10b$var$Comparison(expected, keys, actual);\n var err = new $dfdGN({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n err.actual = actual;\n err.expected = expected;\n err.operator = fn.name;\n throw err;\n }\n $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n}\nfunction $08030b30a83dd10b$var$expectedException(actual, expected, msg, fn) {\n if (typeof expected !== \"function\") {\n if ($08030b30a83dd10b$var$isRegExp(expected)) return $08030b30a83dd10b$var$RegExpPrototypeTest(expected, actual);\n // assert.doesNotThrow does not accept objects.\n if (arguments.length === 2) throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE(\"expected\", [\n \"Function\",\n \"RegExp\"\n ], expected);\n // Handle primitives properly.\n if ($08030b30a83dd10b$var$_typeof(actual) !== \"object\" || actual === null) {\n var err = new $dfdGN({\n actual: actual,\n expected: expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n err.operator = fn.name;\n throw err;\n }\n var keys = Object.keys(expected);\n // Special handle errors to make sure the name and the message are compared\n // as well.\n if (expected instanceof Error) keys.push(\"name\", \"message\");\n else if (keys.length === 0) throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n if ($08030b30a83dd10b$var$isDeepEqual === undefined) $08030b30a83dd10b$var$lazyLoadComparison();\n keys.forEach(function(key) {\n if (typeof actual[key] === \"string\" && $08030b30a83dd10b$var$isRegExp(expected[key]) && $08030b30a83dd10b$var$RegExpPrototypeTest(expected[key], actual[key])) return;\n $08030b30a83dd10b$var$compareExceptionKey(actual, expected, key, msg, keys, fn);\n });\n return true;\n }\n // Guard instanceof against arrow functions as they don't have a prototype.\n if (expected.prototype !== undefined && actual instanceof expected) return true;\n if (Error.isPrototypeOf(expected)) return false;\n return expected.call({}, actual) === true;\n}\nfunction $08030b30a83dd10b$var$getActual(fn) {\n if (typeof fn !== \"function\") throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return $08030b30a83dd10b$var$NO_EXCEPTION_SENTINEL;\n}\nfunction $08030b30a83dd10b$var$checkIsPromise(obj) {\n // Accept native ES6 promises and promises that are implemented in a similar\n // way. Do not accept thenables that use a function as `obj` and that have no\n // `catch` handler.\n // TODO: thenables are checked up until they have the correct methods,\n // but according to documentation, the `then` method should receive\n // the `fulfill` and `reject` arguments as well or it may be never resolved.\n return $08030b30a83dd10b$var$isPromise(obj) || obj !== null && $08030b30a83dd10b$var$_typeof(obj) === \"object\" && typeof obj.then === \"function\" && typeof obj.catch === \"function\";\n}\nfunction $08030b30a83dd10b$var$waitForActual(promiseFn) {\n return Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn === \"function\") {\n // Return a rejected promise if `promiseFn` throws synchronously.\n resultPromise = promiseFn();\n // Fail in case no promise is returned.\n if (!$08030b30a83dd10b$var$checkIsPromise(resultPromise)) throw new $08030b30a83dd10b$var$ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if ($08030b30a83dd10b$var$checkIsPromise(promiseFn)) resultPromise = promiseFn;\n else throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE(\"promiseFn\", [\n \"Function\",\n \"Promise\"\n ], promiseFn);\n return Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return $08030b30a83dd10b$var$NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n}\nfunction $08030b30a83dd10b$var$expectsError(stackStartFn, actual, error, message) {\n if (typeof error === \"string\") {\n if (arguments.length === 4) throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE(\"error\", [\n \"Object\",\n \"Error\",\n \"Function\",\n \"RegExp\"\n ], error);\n if ($08030b30a83dd10b$var$_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error) throw new $08030b30a83dd10b$var$ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error) throw new $08030b30a83dd10b$var$ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error;\n error = undefined;\n } else if (error != null && $08030b30a83dd10b$var$_typeof(error) !== \"object\" && typeof error !== \"function\") throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE(\"error\", [\n \"Object\",\n \"Error\",\n \"Function\",\n \"RegExp\"\n ], error);\n if (actual === $08030b30a83dd10b$var$NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n if (error && error.name) details += \" (\".concat(error.name, \")\");\n details += message ? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" ? \"rejection\" : \"exception\";\n $08030b30a83dd10b$var$innerFail({\n actual: undefined,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn: stackStartFn\n });\n }\n if (error && !$08030b30a83dd10b$var$expectedException(actual, error, message, stackStartFn)) throw actual;\n}\nfunction $08030b30a83dd10b$var$expectsNoError(stackStartFn, actual, error, message) {\n if (actual === $08030b30a83dd10b$var$NO_EXCEPTION_SENTINEL) return;\n if (typeof error === \"string\") {\n message = error;\n error = undefined;\n }\n if (!error || $08030b30a83dd10b$var$expectedException(actual, error)) {\n var details = message ? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"doesNotReject\" ? \"rejection\" : \"exception\";\n $08030b30a83dd10b$var$innerFail({\n actual: actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, \"\\n\") + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn: stackStartFn\n });\n }\n throw actual;\n}\n$08030b30a83dd10b$var$assert.throws = function throws(promiseFn) {\n for(var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++)args[_key2 - 1] = arguments[_key2];\n $08030b30a83dd10b$var$expectsError.apply(void 0, [\n throws,\n $08030b30a83dd10b$var$getActual(promiseFn)\n ].concat(args));\n};\n$08030b30a83dd10b$var$assert.rejects = function rejects(promiseFn) {\n for(var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++)args[_key3 - 1] = arguments[_key3];\n return $08030b30a83dd10b$var$waitForActual(promiseFn).then(function(result) {\n return $08030b30a83dd10b$var$expectsError.apply(void 0, [\n rejects,\n result\n ].concat(args));\n });\n};\n$08030b30a83dd10b$var$assert.doesNotThrow = function doesNotThrow(fn) {\n for(var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++)args[_key4 - 1] = arguments[_key4];\n $08030b30a83dd10b$var$expectsNoError.apply(void 0, [\n doesNotThrow,\n $08030b30a83dd10b$var$getActual(fn)\n ].concat(args));\n};\n$08030b30a83dd10b$var$assert.doesNotReject = function doesNotReject(fn) {\n for(var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++)args[_key5 - 1] = arguments[_key5];\n return $08030b30a83dd10b$var$waitForActual(fn).then(function(result) {\n return $08030b30a83dd10b$var$expectsNoError.apply(void 0, [\n doesNotReject,\n result\n ].concat(args));\n });\n};\n$08030b30a83dd10b$var$assert.ifError = function ifError(err) {\n if (err !== null && err !== undefined) {\n var message = \"ifError got unwanted exception: \";\n if ($08030b30a83dd10b$var$_typeof(err) === \"object\" && typeof err.message === \"string\") {\n if (err.message.length === 0 && err.constructor) message += err.constructor.name;\n else message += err.message;\n } else message += $08030b30a83dd10b$var$inspect(err);\n var newErr = new $dfdGN({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message: message,\n stackStartFn: ifError\n });\n // Make sure we actually have a stack trace!\n var origStack = err.stack;\n if (typeof origStack === \"string\") {\n // This will remove any duplicated frames from the error frames taken\n // from within `ifError` and add the original error frames to the newly\n // created ones.\n var tmp2 = origStack.split(\"\\n\");\n tmp2.shift();\n // Filter all frames existing in err.stack.\n var tmp1 = newErr.stack.split(\"\\n\");\n for(var i = 0; i < tmp2.length; i++){\n // Find the first occurrence of the frame.\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n // Only keep new frames.\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(\"\\n\"), \"\\n\").concat(tmp2.join(\"\\n\"));\n }\n throw newErr;\n }\n};\n// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a871df3dfb8ea663ef5e1f8f62701ec51384ecb\nfunction $08030b30a83dd10b$var$internalMatch(string, regexp, message, fn, fnName) {\n if (!$08030b30a83dd10b$var$isRegExp(regexp)) throw new $08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE(\"regexp\", \"RegExp\", regexp);\n var match = fnName === \"match\";\n if (typeof string !== \"string\" || $08030b30a83dd10b$var$RegExpPrototypeTest(regexp, string) !== match) {\n if (message instanceof Error) throw message;\n var generatedMessage = !message;\n // 'The input was expected to not match the regular expression ' +\n message = message || (typeof string !== \"string\" ? 'The \"string\" argument must be of type string. Received type ' + \"\".concat($08030b30a83dd10b$var$_typeof(string), \" (\").concat($08030b30a83dd10b$var$inspect(string), \")\") : (match ? \"The input did not match the regular expression \" : \"The input was expected to not match the regular expression \") + \"\".concat($08030b30a83dd10b$var$inspect(regexp), \". Input:\\n\\n\").concat($08030b30a83dd10b$var$inspect(string), \"\\n\"));\n var err = new $dfdGN({\n actual: string,\n expected: regexp,\n message: message,\n operator: fnName,\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\n$08030b30a83dd10b$var$assert.match = function match(string, regexp, message) {\n $08030b30a83dd10b$var$internalMatch(string, regexp, message, match, \"match\");\n};\n$08030b30a83dd10b$var$assert.doesNotMatch = function doesNotMatch(string, regexp, message) {\n $08030b30a83dd10b$var$internalMatch(string, regexp, message, doesNotMatch, \"doesNotMatch\");\n};\n// Expose a strict only variant of assert\nfunction $08030b30a83dd10b$var$strict() {\n for(var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++)args[_key6] = arguments[_key6];\n $08030b30a83dd10b$var$innerOk.apply(void 0, [\n $08030b30a83dd10b$var$strict,\n args.length\n ].concat(args));\n}\n$08030b30a83dd10b$var$assert.strict = $08030b30a83dd10b$var$objectAssign($08030b30a83dd10b$var$strict, $08030b30a83dd10b$var$assert, {\n equal: $08030b30a83dd10b$var$assert.strictEqual,\n deepEqual: $08030b30a83dd10b$var$assert.deepStrictEqual,\n notEqual: $08030b30a83dd10b$var$assert.notStrictEqual,\n notDeepEqual: $08030b30a83dd10b$var$assert.notDeepStrictEqual\n});\n$08030b30a83dd10b$var$assert.strict.strict = $08030b30a83dd10b$var$assert.strict;\n\n});\nparcelRegister(\"bYqme\", function(module, exports) {\n// shim for using process in browser\nvar $8b79be5a44896e9e$var$process = module.exports = {};\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\nvar $8b79be5a44896e9e$var$cachedSetTimeout;\nvar $8b79be5a44896e9e$var$cachedClearTimeout;\nfunction $8b79be5a44896e9e$var$defaultSetTimout() {\n throw new Error(\"setTimeout has not been defined\");\n}\nfunction $8b79be5a44896e9e$var$defaultClearTimeout() {\n throw new Error(\"clearTimeout has not been defined\");\n}\n(function() {\n try {\n if (typeof setTimeout === \"function\") $8b79be5a44896e9e$var$cachedSetTimeout = setTimeout;\n else $8b79be5a44896e9e$var$cachedSetTimeout = $8b79be5a44896e9e$var$defaultSetTimout;\n } catch (e) {\n $8b79be5a44896e9e$var$cachedSetTimeout = $8b79be5a44896e9e$var$defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === \"function\") $8b79be5a44896e9e$var$cachedClearTimeout = clearTimeout;\n else $8b79be5a44896e9e$var$cachedClearTimeout = $8b79be5a44896e9e$var$defaultClearTimeout;\n } catch (e) {\n $8b79be5a44896e9e$var$cachedClearTimeout = $8b79be5a44896e9e$var$defaultClearTimeout;\n }\n})();\nfunction $8b79be5a44896e9e$var$runTimeout(fun) {\n if ($8b79be5a44896e9e$var$cachedSetTimeout === setTimeout) //normal enviroments in sane situations\n return setTimeout(fun, 0);\n // if setTimeout wasn't available but was latter defined\n if (($8b79be5a44896e9e$var$cachedSetTimeout === $8b79be5a44896e9e$var$defaultSetTimout || !$8b79be5a44896e9e$var$cachedSetTimeout) && setTimeout) {\n $8b79be5a44896e9e$var$cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return $8b79be5a44896e9e$var$cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return $8b79be5a44896e9e$var$cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return $8b79be5a44896e9e$var$cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\nfunction $8b79be5a44896e9e$var$runClearTimeout(marker) {\n if ($8b79be5a44896e9e$var$cachedClearTimeout === clearTimeout) //normal enviroments in sane situations\n return clearTimeout(marker);\n // if clearTimeout wasn't available but was latter defined\n if (($8b79be5a44896e9e$var$cachedClearTimeout === $8b79be5a44896e9e$var$defaultClearTimeout || !$8b79be5a44896e9e$var$cachedClearTimeout) && clearTimeout) {\n $8b79be5a44896e9e$var$cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return $8b79be5a44896e9e$var$cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return $8b79be5a44896e9e$var$cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return $8b79be5a44896e9e$var$cachedClearTimeout.call(this, marker);\n }\n }\n}\nvar $8b79be5a44896e9e$var$queue = [];\nvar $8b79be5a44896e9e$var$draining = false;\nvar $8b79be5a44896e9e$var$currentQueue;\nvar $8b79be5a44896e9e$var$queueIndex = -1;\nfunction $8b79be5a44896e9e$var$cleanUpNextTick() {\n if (!$8b79be5a44896e9e$var$draining || !$8b79be5a44896e9e$var$currentQueue) return;\n $8b79be5a44896e9e$var$draining = false;\n if ($8b79be5a44896e9e$var$currentQueue.length) $8b79be5a44896e9e$var$queue = $8b79be5a44896e9e$var$currentQueue.concat($8b79be5a44896e9e$var$queue);\n else $8b79be5a44896e9e$var$queueIndex = -1;\n if ($8b79be5a44896e9e$var$queue.length) $8b79be5a44896e9e$var$drainQueue();\n}\nfunction $8b79be5a44896e9e$var$drainQueue() {\n if ($8b79be5a44896e9e$var$draining) return;\n var timeout = $8b79be5a44896e9e$var$runTimeout($8b79be5a44896e9e$var$cleanUpNextTick);\n $8b79be5a44896e9e$var$draining = true;\n var len = $8b79be5a44896e9e$var$queue.length;\n while(len){\n $8b79be5a44896e9e$var$currentQueue = $8b79be5a44896e9e$var$queue;\n $8b79be5a44896e9e$var$queue = [];\n while(++$8b79be5a44896e9e$var$queueIndex < len)if ($8b79be5a44896e9e$var$currentQueue) $8b79be5a44896e9e$var$currentQueue[$8b79be5a44896e9e$var$queueIndex].run();\n $8b79be5a44896e9e$var$queueIndex = -1;\n len = $8b79be5a44896e9e$var$queue.length;\n }\n $8b79be5a44896e9e$var$currentQueue = null;\n $8b79be5a44896e9e$var$draining = false;\n $8b79be5a44896e9e$var$runClearTimeout(timeout);\n}\n$8b79be5a44896e9e$var$process.nextTick = function(fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) for(var i = 1; i < arguments.length; i++)args[i - 1] = arguments[i];\n $8b79be5a44896e9e$var$queue.push(new $8b79be5a44896e9e$var$Item(fun, args));\n if ($8b79be5a44896e9e$var$queue.length === 1 && !$8b79be5a44896e9e$var$draining) $8b79be5a44896e9e$var$runTimeout($8b79be5a44896e9e$var$drainQueue);\n};\n// v8 likes predictible objects\nfunction $8b79be5a44896e9e$var$Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\n$8b79be5a44896e9e$var$Item.prototype.run = function() {\n this.fun.apply(null, this.array);\n};\n$8b79be5a44896e9e$var$process.title = \"browser\";\n$8b79be5a44896e9e$var$process.browser = true;\n$8b79be5a44896e9e$var$process.env = {};\n$8b79be5a44896e9e$var$process.argv = [];\n$8b79be5a44896e9e$var$process.version = \"\"; // empty string to avoid regexp issues\n$8b79be5a44896e9e$var$process.versions = {};\nfunction $8b79be5a44896e9e$var$noop() {}\n$8b79be5a44896e9e$var$process.on = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.addListener = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.once = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.off = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.removeListener = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.removeAllListeners = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.emit = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.prependListener = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.prependOnceListener = $8b79be5a44896e9e$var$noop;\n$8b79be5a44896e9e$var$process.listeners = function(name) {\n return [];\n};\n$8b79be5a44896e9e$var$process.binding = function(name) {\n throw new Error(\"process.binding is not supported\");\n};\n$8b79be5a44896e9e$var$process.cwd = function() {\n return \"/\";\n};\n$8b79be5a44896e9e$var$process.chdir = function(dir) {\n throw new Error(\"process.chdir is not supported\");\n};\n$8b79be5a44896e9e$var$process.umask = function() {\n return 0;\n};\n\n});\n\nparcelRegister(\"idZmf\", function(module, exports) {\n\n$parcel$export(module.exports, \"codes\", function () { return $d44909437516936e$export$e45cb6485273080e; }, function (v) { return $d44909437516936e$export$e45cb6485273080e = v; });\n// Currently in sync with Node.js lib/internal/errors.js\n// https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f\n/* eslint node-core/documented-errors: \"error\" */ /* eslint node-core/alphabetize-errors: \"error\" */ /* eslint node-core/prefer-util-format-errors: \"error\" */ var $d44909437516936e$export$e45cb6485273080e;\n\"use strict\";\n// The whole point behind this internal module is to allow Node.js to no\n// longer be forced to treat every error message change as a semver-major\n// change. The NodeError classes here all expose a `code` property whose\n// value statically and permanently identifies the error. While the error\n// message may change, the code should not.\nfunction $d44909437516936e$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $d44909437516936e$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $d44909437516936e$var$_typeof(o);\n}\nfunction $d44909437516936e$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, $d44909437516936e$var$_toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction $d44909437516936e$var$_createClass(Constructor, protoProps, staticProps) {\n if (protoProps) $d44909437516936e$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $d44909437516936e$var$_defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction $d44909437516936e$var$_toPropertyKey(arg) {\n var key = $d44909437516936e$var$_toPrimitive(arg, \"string\");\n return $d44909437516936e$var$_typeof(key) === \"symbol\" ? key : String(key);\n}\nfunction $d44909437516936e$var$_toPrimitive(input, hint) {\n if ($d44909437516936e$var$_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if ($d44909437516936e$var$_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction $d44909437516936e$var$_classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction $d44909437516936e$var$_inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) throw new TypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) $d44909437516936e$var$_setPrototypeOf(subClass, superClass);\n}\nfunction $d44909437516936e$var$_setPrototypeOf(o, p) {\n $d44909437516936e$var$_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return $d44909437516936e$var$_setPrototypeOf(o, p);\n}\nfunction $d44909437516936e$var$_createSuper(Derived) {\n var hasNativeReflectConstruct = $d44909437516936e$var$_isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = $d44909437516936e$var$_getPrototypeOf(Derived), result;\n if (hasNativeReflectConstruct) {\n var NewTarget = $d44909437516936e$var$_getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else result = Super.apply(this, arguments);\n return $d44909437516936e$var$_possibleConstructorReturn(this, result);\n };\n}\nfunction $d44909437516936e$var$_possibleConstructorReturn(self, call) {\n if (call && ($d44909437516936e$var$_typeof(call) === \"object\" || typeof call === \"function\")) return call;\n else if (call !== void 0) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return $d44909437516936e$var$_assertThisInitialized(self);\n}\nfunction $d44909437516936e$var$_assertThisInitialized(self) {\n if (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n}\nfunction $d44909437516936e$var$_isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n}\nfunction $d44909437516936e$var$_getPrototypeOf(o) {\n $d44909437516936e$var$_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return $d44909437516936e$var$_getPrototypeOf(o);\n}\nvar $d44909437516936e$var$codes = {};\n// Lazy loaded\nvar $d44909437516936e$var$assert;\nvar $d44909437516936e$var$util;\nfunction $d44909437516936e$var$createErrorType(code, message, Base) {\n if (!Base) Base = Error;\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === \"string\") return message;\n else return message(arg1, arg2, arg3);\n }\n var NodeError = /*#__PURE__*/ function(_Base) {\n $d44909437516936e$var$_inherits(NodeError, _Base);\n var _super = $d44909437516936e$var$_createSuper(NodeError);\n function NodeError(arg1, arg2, arg3) {\n var _this;\n $d44909437516936e$var$_classCallCheck(this, NodeError);\n _this = _super.call(this, getMessage(arg1, arg2, arg3));\n _this.code = code;\n return _this;\n }\n return $d44909437516936e$var$_createClass(NodeError);\n }(Base);\n $d44909437516936e$var$codes[code] = NodeError;\n}\n// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\nfunction $d44909437516936e$var$oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function(i) {\n return String(i);\n });\n if (len > 2) return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1];\n else if (len === 2) return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n else return \"of \".concat(thing, \" \").concat(expected[0]);\n } else return \"of \".concat(thing, \" \").concat(String(expected));\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\nfunction $d44909437516936e$var$startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction $d44909437516936e$var$endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) this_len = str.length;\n return str.substring(this_len - search.length, this_len) === search;\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\nfunction $d44909437516936e$var$includes(str, search, start) {\n if (typeof start !== \"number\") start = 0;\n if (start + search.length > str.length) return false;\n else return str.indexOf(search, start) !== -1;\n}\n$d44909437516936e$var$createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError);\n\n$d44909437516936e$var$createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n if ($d44909437516936e$var$assert === undefined) $d44909437516936e$var$assert = (parcelRequire(\"GE7rZ\"));\n $d44909437516936e$var$assert(typeof name === \"string\", \"'name' must be a string\");\n // determiner: 'must be' or 'must not be'\n var determiner;\n if (typeof expected === \"string\" && $d44909437516936e$var$startsWith(expected, \"not \")) {\n determiner = \"must not be\";\n expected = expected.replace(/^not /, \"\");\n } else determiner = \"must be\";\n var msg;\n if ($d44909437516936e$var$endsWith(name, \" argument\")) // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat($d44909437516936e$var$oneOf(expected, \"type\"));\n else {\n var type = $d44909437516936e$var$includes(name, \".\") ? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat($d44909437516936e$var$oneOf(expected, \"type\"));\n }\n // TODO(BridgeAR): Improve the output by showing `null` and similar.\n msg += \". Received type \".concat($d44909437516936e$var$_typeof(actual));\n return msg;\n}, TypeError);\n\n$d44909437516936e$var$createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"is invalid\";\n if ($d44909437516936e$var$util === undefined) $d44909437516936e$var$util = (parcelRequire(\"5d0kT\"));\n var inspected = $d44909437516936e$var$util.inspect(value);\n if (inspected.length > 128) inspected = \"\".concat(inspected.slice(0, 128), \"...\");\n return \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n}, TypeError, RangeError);\n$d44909437516936e$var$createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n if (value && value.constructor && value.constructor.name) type = \"instance of \".concat(value.constructor.name);\n else type = \"type \".concat($d44909437516936e$var$_typeof(value));\n return \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n}, TypeError);\n\n$d44909437516936e$var$createErrorType(\"ERR_MISSING_ARGS\", function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];\n if ($d44909437516936e$var$assert === undefined) $d44909437516936e$var$assert = (parcelRequire(\"GE7rZ\"));\n $d44909437516936e$var$assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \";\n var len = args.length;\n args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n });\n switch(len){\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \");\n msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n}, TypeError);\n$d44909437516936e$export$e45cb6485273080e = $d44909437516936e$var$codes;\n\n});\nparcelRegister(\"5d0kT\", function(module, exports) {\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar $bYqme = parcelRequire(\"bYqme\");\nvar $3cae6d5803bad4b3$var$getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for(var i = 0; i < keys.length; i++)descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n return descriptors;\n};\nvar $3cae6d5803bad4b3$var$formatRegExp = /%[sdj%]/g;\nmodule.exports.format = function(f) {\n if (!$3cae6d5803bad4b3$var$isString(f)) {\n var objects = [];\n for(var i = 0; i < arguments.length; i++)objects.push($3cae6d5803bad4b3$var$inspect(arguments[i]));\n return objects.join(\" \");\n }\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace($3cae6d5803bad4b3$var$formatRegExp, function(x) {\n if (x === \"%%\") return \"%\";\n if (i >= len) return x;\n switch(x){\n case \"%s\":\n return String(args[i++]);\n case \"%d\":\n return Number(args[i++]);\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return \"[Circular]\";\n }\n default:\n return x;\n }\n });\n for(var x = args[i]; i < len; x = args[++i])if ($3cae6d5803bad4b3$var$isNull(x) || !$3cae6d5803bad4b3$var$isObject(x)) str += \" \" + x;\n else str += \" \" + $3cae6d5803bad4b3$var$inspect(x);\n return str;\n};\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nmodule.exports.deprecate = function(fn, msg) {\n if (typeof $bYqme !== \"undefined\" && $bYqme.noDeprecation === true) return fn;\n // Allow for deprecating things in the process of starting up.\n if (typeof $bYqme === \"undefined\") return function() {\n return module.exports.deprecate(fn, msg).apply(this, arguments);\n };\n var warned = false;\n function deprecated() {\n if (!warned) {\n if ($bYqme.throwDeprecation) throw new Error(msg);\n else if ($bYqme.traceDeprecation) console.trace(msg);\n else console.error(msg);\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n return deprecated;\n};\nvar $3cae6d5803bad4b3$var$debugs = {};\nvar $3cae6d5803bad4b3$var$debugEnvRegex = /^$/;\nvar $3cae6d5803bad4b3$var$debugEnv;\nmodule.exports.debuglog = function(set) {\n set = set.toUpperCase();\n if (!$3cae6d5803bad4b3$var$debugs[set]) {\n if ($3cae6d5803bad4b3$var$debugEnvRegex.test(set)) {\n var pid = $bYqme.pid;\n $3cae6d5803bad4b3$var$debugs[set] = function() {\n var msg = module.exports.format.apply(module.exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else $3cae6d5803bad4b3$var$debugs[set] = function() {};\n }\n return $3cae6d5803bad4b3$var$debugs[set];\n};\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */ /* legacy: obj, showHidden, depth, colors*/ function $3cae6d5803bad4b3$var$inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: $3cae6d5803bad4b3$var$stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if ($3cae6d5803bad4b3$var$isBoolean(opts)) // legacy...\n ctx.showHidden = opts;\n else if (opts) // got an \"options\" object\n module.exports._extend(ctx, opts);\n // set default options\n if ($3cae6d5803bad4b3$var$isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if ($3cae6d5803bad4b3$var$isUndefined(ctx.depth)) ctx.depth = 2;\n if ($3cae6d5803bad4b3$var$isUndefined(ctx.colors)) ctx.colors = false;\n if ($3cae6d5803bad4b3$var$isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = $3cae6d5803bad4b3$var$stylizeWithColor;\n return $3cae6d5803bad4b3$var$formatValue(ctx, obj, ctx.depth);\n}\nmodule.exports.inspect = $3cae6d5803bad4b3$var$inspect;\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\n$3cae6d5803bad4b3$var$inspect.colors = {\n \"bold\": [\n 1,\n 22\n ],\n \"italic\": [\n 3,\n 23\n ],\n \"underline\": [\n 4,\n 24\n ],\n \"inverse\": [\n 7,\n 27\n ],\n \"white\": [\n 37,\n 39\n ],\n \"grey\": [\n 90,\n 39\n ],\n \"black\": [\n 30,\n 39\n ],\n \"blue\": [\n 34,\n 39\n ],\n \"cyan\": [\n 36,\n 39\n ],\n \"green\": [\n 32,\n 39\n ],\n \"magenta\": [\n 35,\n 39\n ],\n \"red\": [\n 31,\n 39\n ],\n \"yellow\": [\n 33,\n 39\n ]\n};\n// Don't use 'blue' not visible on cmd.exe\n$3cae6d5803bad4b3$var$inspect.styles = {\n \"special\": \"cyan\",\n \"number\": \"yellow\",\n \"boolean\": \"yellow\",\n \"undefined\": \"grey\",\n \"null\": \"bold\",\n \"string\": \"green\",\n \"date\": \"magenta\",\n // \"name\": intentionally not styling\n \"regexp\": \"red\"\n};\nfunction $3cae6d5803bad4b3$var$stylizeWithColor(str, styleType) {\n var style = $3cae6d5803bad4b3$var$inspect.styles[styleType];\n if (style) return \"\\x1b[\" + $3cae6d5803bad4b3$var$inspect.colors[style][0] + \"m\" + str + \"\\x1b[\" + $3cae6d5803bad4b3$var$inspect.colors[style][1] + \"m\";\n else return str;\n}\nfunction $3cae6d5803bad4b3$var$stylizeNoColor(str, styleType) {\n return str;\n}\nfunction $3cae6d5803bad4b3$var$arrayToHash(array) {\n var hash = {};\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n return hash;\n}\nfunction $3cae6d5803bad4b3$var$formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect && value && $3cae6d5803bad4b3$var$isFunction(value.inspect) && // Filter out the util module, it's inspect function is special\n value.inspect !== module.exports.inspect && // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!$3cae6d5803bad4b3$var$isString(ret)) ret = $3cae6d5803bad4b3$var$formatValue(ctx, ret, recurseTimes);\n return ret;\n }\n // Primitive types cannot have properties\n var primitive = $3cae6d5803bad4b3$var$formatPrimitive(ctx, value);\n if (primitive) return primitive;\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = $3cae6d5803bad4b3$var$arrayToHash(keys);\n if (ctx.showHidden) keys = Object.getOwnPropertyNames(value);\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if ($3cae6d5803bad4b3$var$isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0)) return $3cae6d5803bad4b3$var$formatError(value);\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if ($3cae6d5803bad4b3$var$isFunction(value)) {\n var name = value.name ? \": \" + value.name : \"\";\n return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n }\n if ($3cae6d5803bad4b3$var$isRegExp(value)) return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n if ($3cae6d5803bad4b3$var$isDate(value)) return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n if ($3cae6d5803bad4b3$var$isError(value)) return $3cae6d5803bad4b3$var$formatError(value);\n }\n var base = \"\", array = false, braces = [\n \"{\",\n \"}\"\n ];\n // Make Array say that they are Array\n if ($3cae6d5803bad4b3$var$isArray(value)) {\n array = true;\n braces = [\n \"[\",\n \"]\"\n ];\n }\n // Make functions say that they are functions\n if ($3cae6d5803bad4b3$var$isFunction(value)) {\n var n = value.name ? \": \" + value.name : \"\";\n base = \" [Function\" + n + \"]\";\n }\n // Make RegExps say that they are RegExps\n if ($3cae6d5803bad4b3$var$isRegExp(value)) base = \" \" + RegExp.prototype.toString.call(value);\n // Make dates with properties first say the date\n if ($3cae6d5803bad4b3$var$isDate(value)) base = \" \" + Date.prototype.toUTCString.call(value);\n // Make error with message first say the error\n if ($3cae6d5803bad4b3$var$isError(value)) base = \" \" + $3cae6d5803bad4b3$var$formatError(value);\n if (keys.length === 0 && (!array || value.length == 0)) return braces[0] + base + braces[1];\n if (recurseTimes < 0) {\n if ($3cae6d5803bad4b3$var$isRegExp(value)) return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n else return ctx.stylize(\"[Object]\", \"special\");\n }\n ctx.seen.push(value);\n var output;\n if (array) output = $3cae6d5803bad4b3$var$formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n else output = keys.map(function(key) {\n return $3cae6d5803bad4b3$var$formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n ctx.seen.pop();\n return $3cae6d5803bad4b3$var$reduceToSingleString(output, base, braces);\n}\nfunction $3cae6d5803bad4b3$var$formatPrimitive(ctx, value) {\n if ($3cae6d5803bad4b3$var$isUndefined(value)) return ctx.stylize(\"undefined\", \"undefined\");\n if ($3cae6d5803bad4b3$var$isString(value)) {\n var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return ctx.stylize(simple, \"string\");\n }\n if ($3cae6d5803bad4b3$var$isNumber(value)) return ctx.stylize(\"\" + value, \"number\");\n if ($3cae6d5803bad4b3$var$isBoolean(value)) return ctx.stylize(\"\" + value, \"boolean\");\n // For some reason typeof null is \"object\", so special case here.\n if ($3cae6d5803bad4b3$var$isNull(value)) return ctx.stylize(\"null\", \"null\");\n}\nfunction $3cae6d5803bad4b3$var$formatError(value) {\n return \"[\" + Error.prototype.toString.call(value) + \"]\";\n}\nfunction $3cae6d5803bad4b3$var$formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for(var i = 0, l = value.length; i < l; ++i)if ($3cae6d5803bad4b3$var$hasOwnProperty(value, String(i))) output.push($3cae6d5803bad4b3$var$formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));\n else output.push(\"\");\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) output.push($3cae6d5803bad4b3$var$formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));\n });\n return output;\n}\nfunction $3cae6d5803bad4b3$var$formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n };\n if (desc.get) {\n if (desc.set) str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n else str = ctx.stylize(\"[Getter]\", \"special\");\n } else if (desc.set) str = ctx.stylize(\"[Setter]\", \"special\");\n if (!$3cae6d5803bad4b3$var$hasOwnProperty(visibleKeys, key)) name = \"[\" + key + \"]\";\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if ($3cae6d5803bad4b3$var$isNull(recurseTimes)) str = $3cae6d5803bad4b3$var$formatValue(ctx, desc.value, null);\n else str = $3cae6d5803bad4b3$var$formatValue(ctx, desc.value, recurseTimes - 1);\n if (str.indexOf(\"\\n\") > -1) {\n if (array) str = str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\").slice(2);\n else str = \"\\n\" + str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\");\n }\n } else str = ctx.stylize(\"[Circular]\", \"special\");\n }\n if ($3cae6d5803bad4b3$var$isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) return str;\n name = JSON.stringify(\"\" + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.slice(1, -1);\n name = ctx.stylize(name, \"name\");\n } else {\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, \"string\");\n }\n }\n return name + \": \" + str;\n}\nfunction $3cae6d5803bad4b3$var$reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf(\"\\n\") >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, \"\").length + 1;\n }, 0);\n if (length > 60) return braces[0] + (base === \"\" ? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n \") + \" \" + braces[1];\n return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n}\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nmodule.exports.types = (parcelRequire(\"i6CGe\"));\nfunction $3cae6d5803bad4b3$var$isArray(ar) {\n return Array.isArray(ar);\n}\nmodule.exports.isArray = $3cae6d5803bad4b3$var$isArray;\nfunction $3cae6d5803bad4b3$var$isBoolean(arg) {\n return typeof arg === \"boolean\";\n}\nmodule.exports.isBoolean = $3cae6d5803bad4b3$var$isBoolean;\nfunction $3cae6d5803bad4b3$var$isNull(arg) {\n return arg === null;\n}\nmodule.exports.isNull = $3cae6d5803bad4b3$var$isNull;\nfunction $3cae6d5803bad4b3$var$isNullOrUndefined(arg) {\n return arg == null;\n}\nmodule.exports.isNullOrUndefined = $3cae6d5803bad4b3$var$isNullOrUndefined;\nfunction $3cae6d5803bad4b3$var$isNumber(arg) {\n return typeof arg === \"number\";\n}\nmodule.exports.isNumber = $3cae6d5803bad4b3$var$isNumber;\nfunction $3cae6d5803bad4b3$var$isString(arg) {\n return typeof arg === \"string\";\n}\nmodule.exports.isString = $3cae6d5803bad4b3$var$isString;\nfunction $3cae6d5803bad4b3$var$isSymbol(arg) {\n return typeof arg === \"symbol\";\n}\nmodule.exports.isSymbol = $3cae6d5803bad4b3$var$isSymbol;\nfunction $3cae6d5803bad4b3$var$isUndefined(arg) {\n return arg === void 0;\n}\nmodule.exports.isUndefined = $3cae6d5803bad4b3$var$isUndefined;\nfunction $3cae6d5803bad4b3$var$isRegExp(re) {\n return $3cae6d5803bad4b3$var$isObject(re) && $3cae6d5803bad4b3$var$objectToString(re) === \"[object RegExp]\";\n}\nmodule.exports.isRegExp = $3cae6d5803bad4b3$var$isRegExp;\nmodule.exports.types.isRegExp = $3cae6d5803bad4b3$var$isRegExp;\nfunction $3cae6d5803bad4b3$var$isObject(arg) {\n return typeof arg === \"object\" && arg !== null;\n}\nmodule.exports.isObject = $3cae6d5803bad4b3$var$isObject;\nfunction $3cae6d5803bad4b3$var$isDate(d) {\n return $3cae6d5803bad4b3$var$isObject(d) && $3cae6d5803bad4b3$var$objectToString(d) === \"[object Date]\";\n}\nmodule.exports.isDate = $3cae6d5803bad4b3$var$isDate;\nmodule.exports.types.isDate = $3cae6d5803bad4b3$var$isDate;\nfunction $3cae6d5803bad4b3$var$isError(e) {\n return $3cae6d5803bad4b3$var$isObject(e) && ($3cae6d5803bad4b3$var$objectToString(e) === \"[object Error]\" || e instanceof Error);\n}\nmodule.exports.isError = $3cae6d5803bad4b3$var$isError;\nmodule.exports.types.isNativeError = $3cae6d5803bad4b3$var$isError;\nfunction $3cae6d5803bad4b3$var$isFunction(arg) {\n return typeof arg === \"function\";\n}\nmodule.exports.isFunction = $3cae6d5803bad4b3$var$isFunction;\nfunction $3cae6d5803bad4b3$var$isPrimitive(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || // ES6 symbol\n typeof arg === \"undefined\";\n}\nmodule.exports.isPrimitive = $3cae6d5803bad4b3$var$isPrimitive;\n\nmodule.exports.isBuffer = (parcelRequire(\"3YNr2\"));\nfunction $3cae6d5803bad4b3$var$objectToString(o) {\n return Object.prototype.toString.call(o);\n}\nfunction $3cae6d5803bad4b3$var$pad(n) {\n return n < 10 ? \"0\" + n.toString(10) : n.toString(10);\n}\nvar $3cae6d5803bad4b3$var$months = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n];\n// 26 Feb 16:19:34\nfunction $3cae6d5803bad4b3$var$timestamp() {\n var d = new Date();\n var time = [\n $3cae6d5803bad4b3$var$pad(d.getHours()),\n $3cae6d5803bad4b3$var$pad(d.getMinutes()),\n $3cae6d5803bad4b3$var$pad(d.getSeconds())\n ].join(\":\");\n return [\n d.getDate(),\n $3cae6d5803bad4b3$var$months[d.getMonth()],\n time\n ].join(\" \");\n}\n// log is just a thin wrapper to console.log that prepends a timestamp\nmodule.exports.log = function() {\n console.log(\"%s - %s\", $3cae6d5803bad4b3$var$timestamp(), module.exports.format.apply(module.exports, arguments));\n};\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */ module.exports.inherits = (parcelRequire(\"fgp9u\"));\nmodule.exports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !$3cae6d5803bad4b3$var$isObject(add)) return origin;\n var keys = Object.keys(add);\n var i = keys.length;\n while(i--)origin[keys[i]] = add[keys[i]];\n return origin;\n};\nfunction $3cae6d5803bad4b3$var$hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\nvar $3cae6d5803bad4b3$var$kCustomPromisifiedSymbol = typeof Symbol !== \"undefined\" ? Symbol(\"util.promisify.custom\") : undefined;\nmodule.exports.promisify = function promisify(original) {\n if (typeof original !== \"function\") throw new TypeError('The \"original\" argument must be of type Function');\n if ($3cae6d5803bad4b3$var$kCustomPromisifiedSymbol && original[$3cae6d5803bad4b3$var$kCustomPromisifiedSymbol]) {\n var fn = original[$3cae6d5803bad4b3$var$kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\") throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n Object.defineProperty(fn, $3cae6d5803bad4b3$var$kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: false,\n writable: false,\n configurable: true\n });\n return fn;\n }\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function(resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n var args = [];\n for(var i = 0; i < arguments.length; i++)args.push(arguments[i]);\n args.push(function(err, value) {\n if (err) promiseReject(err);\n else promiseResolve(value);\n });\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n if ($3cae6d5803bad4b3$var$kCustomPromisifiedSymbol) Object.defineProperty(fn, $3cae6d5803bad4b3$var$kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: false,\n writable: false,\n configurable: true\n });\n return Object.defineProperties(fn, $3cae6d5803bad4b3$var$getOwnPropertyDescriptors(original));\n};\nmodule.exports.promisify.custom = $3cae6d5803bad4b3$var$kCustomPromisifiedSymbol;\nfunction $3cae6d5803bad4b3$var$callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\nfunction $3cae6d5803bad4b3$var$callbackify(original) {\n if (typeof original !== \"function\") throw new TypeError('The \"original\" argument must be of type Function');\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for(var i = 0; i < arguments.length; i++)args.push(arguments[i]);\n var maybeCb = args.pop();\n if (typeof maybeCb !== \"function\") throw new TypeError(\"The last argument must be of type Function\");\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args).then(function(ret) {\n $bYqme.nextTick(cb.bind(null, null, ret));\n }, function(rej) {\n $bYqme.nextTick($3cae6d5803bad4b3$var$callbackifyOnRejected.bind(null, rej, cb));\n });\n }\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified, $3cae6d5803bad4b3$var$getOwnPropertyDescriptors(original));\n return callbackified;\n}\nmodule.exports.callbackify = $3cae6d5803bad4b3$var$callbackify;\n\n});\nparcelRegister(\"i6CGe\", function(module, exports) {\n// Currently in sync with Node.js lib/internal/util/types.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\"use strict\";\n\nvar $hQsBH = parcelRequire(\"hQsBH\");\n\nvar $lCUJL = parcelRequire(\"lCUJL\");\n\nvar $iVfsl = parcelRequire(\"iVfsl\");\n\nvar $6n4Tb = parcelRequire(\"6n4Tb\");\nfunction $d2e6ca9e43aacb42$var$uncurryThis(f) {\n return f.call.bind(f);\n}\nvar $d2e6ca9e43aacb42$var$BigIntSupported = typeof BigInt !== \"undefined\";\nvar $d2e6ca9e43aacb42$var$SymbolSupported = typeof Symbol !== \"undefined\";\nvar $d2e6ca9e43aacb42$var$ObjectToString = $d2e6ca9e43aacb42$var$uncurryThis(Object.prototype.toString);\nvar $d2e6ca9e43aacb42$var$numberValue = $d2e6ca9e43aacb42$var$uncurryThis(Number.prototype.valueOf);\nvar $d2e6ca9e43aacb42$var$stringValue = $d2e6ca9e43aacb42$var$uncurryThis(String.prototype.valueOf);\nvar $d2e6ca9e43aacb42$var$booleanValue = $d2e6ca9e43aacb42$var$uncurryThis(Boolean.prototype.valueOf);\nif ($d2e6ca9e43aacb42$var$BigIntSupported) var $d2e6ca9e43aacb42$var$bigIntValue = $d2e6ca9e43aacb42$var$uncurryThis(BigInt.prototype.valueOf);\nif ($d2e6ca9e43aacb42$var$SymbolSupported) var $d2e6ca9e43aacb42$var$symbolValue = $d2e6ca9e43aacb42$var$uncurryThis(Symbol.prototype.valueOf);\nfunction $d2e6ca9e43aacb42$var$checkBoxedPrimitive(value, prototypeValueOf) {\n if (typeof value !== \"object\") return false;\n try {\n prototypeValueOf(value);\n return true;\n } catch (e) {\n return false;\n }\n}\nmodule.exports.isArgumentsObject = $hQsBH;\nmodule.exports.isGeneratorFunction = $lCUJL;\nmodule.exports.isTypedArray = $6n4Tb;\n// Taken from here and modified for better browser support\n// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js\nfunction $d2e6ca9e43aacb42$var$isPromise(input) {\n return typeof Promise !== \"undefined\" && input instanceof Promise || input !== null && typeof input === \"object\" && typeof input.then === \"function\" && typeof input.catch === \"function\";\n}\nmodule.exports.isPromise = $d2e6ca9e43aacb42$var$isPromise;\nfunction $d2e6ca9e43aacb42$var$isArrayBufferView(value) {\n if (typeof ArrayBuffer !== \"undefined\" && ArrayBuffer.isView) return ArrayBuffer.isView(value);\n return $6n4Tb(value) || $d2e6ca9e43aacb42$var$isDataView(value);\n}\nmodule.exports.isArrayBufferView = $d2e6ca9e43aacb42$var$isArrayBufferView;\nfunction $d2e6ca9e43aacb42$var$isUint8Array(value) {\n return $iVfsl(value) === \"Uint8Array\";\n}\nmodule.exports.isUint8Array = $d2e6ca9e43aacb42$var$isUint8Array;\nfunction $d2e6ca9e43aacb42$var$isUint8ClampedArray(value) {\n return $iVfsl(value) === \"Uint8ClampedArray\";\n}\nmodule.exports.isUint8ClampedArray = $d2e6ca9e43aacb42$var$isUint8ClampedArray;\nfunction $d2e6ca9e43aacb42$var$isUint16Array(value) {\n return $iVfsl(value) === \"Uint16Array\";\n}\nmodule.exports.isUint16Array = $d2e6ca9e43aacb42$var$isUint16Array;\nfunction $d2e6ca9e43aacb42$var$isUint32Array(value) {\n return $iVfsl(value) === \"Uint32Array\";\n}\nmodule.exports.isUint32Array = $d2e6ca9e43aacb42$var$isUint32Array;\nfunction $d2e6ca9e43aacb42$var$isInt8Array(value) {\n return $iVfsl(value) === \"Int8Array\";\n}\nmodule.exports.isInt8Array = $d2e6ca9e43aacb42$var$isInt8Array;\nfunction $d2e6ca9e43aacb42$var$isInt16Array(value) {\n return $iVfsl(value) === \"Int16Array\";\n}\nmodule.exports.isInt16Array = $d2e6ca9e43aacb42$var$isInt16Array;\nfunction $d2e6ca9e43aacb42$var$isInt32Array(value) {\n return $iVfsl(value) === \"Int32Array\";\n}\nmodule.exports.isInt32Array = $d2e6ca9e43aacb42$var$isInt32Array;\nfunction $d2e6ca9e43aacb42$var$isFloat32Array(value) {\n return $iVfsl(value) === \"Float32Array\";\n}\nmodule.exports.isFloat32Array = $d2e6ca9e43aacb42$var$isFloat32Array;\nfunction $d2e6ca9e43aacb42$var$isFloat64Array(value) {\n return $iVfsl(value) === \"Float64Array\";\n}\nmodule.exports.isFloat64Array = $d2e6ca9e43aacb42$var$isFloat64Array;\nfunction $d2e6ca9e43aacb42$var$isBigInt64Array(value) {\n return $iVfsl(value) === \"BigInt64Array\";\n}\nmodule.exports.isBigInt64Array = $d2e6ca9e43aacb42$var$isBigInt64Array;\nfunction $d2e6ca9e43aacb42$var$isBigUint64Array(value) {\n return $iVfsl(value) === \"BigUint64Array\";\n}\nmodule.exports.isBigUint64Array = $d2e6ca9e43aacb42$var$isBigUint64Array;\nfunction $d2e6ca9e43aacb42$var$isMapToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object Map]\";\n}\n$d2e6ca9e43aacb42$var$isMapToString.working = typeof Map !== \"undefined\" && $d2e6ca9e43aacb42$var$isMapToString(new Map());\nfunction $d2e6ca9e43aacb42$var$isMap(value) {\n if (typeof Map === \"undefined\") return false;\n return $d2e6ca9e43aacb42$var$isMapToString.working ? $d2e6ca9e43aacb42$var$isMapToString(value) : value instanceof Map;\n}\nmodule.exports.isMap = $d2e6ca9e43aacb42$var$isMap;\nfunction $d2e6ca9e43aacb42$var$isSetToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object Set]\";\n}\n$d2e6ca9e43aacb42$var$isSetToString.working = typeof Set !== \"undefined\" && $d2e6ca9e43aacb42$var$isSetToString(new Set());\nfunction $d2e6ca9e43aacb42$var$isSet(value) {\n if (typeof Set === \"undefined\") return false;\n return $d2e6ca9e43aacb42$var$isSetToString.working ? $d2e6ca9e43aacb42$var$isSetToString(value) : value instanceof Set;\n}\nmodule.exports.isSet = $d2e6ca9e43aacb42$var$isSet;\nfunction $d2e6ca9e43aacb42$var$isWeakMapToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object WeakMap]\";\n}\n$d2e6ca9e43aacb42$var$isWeakMapToString.working = typeof WeakMap !== \"undefined\" && $d2e6ca9e43aacb42$var$isWeakMapToString(new WeakMap());\nfunction $d2e6ca9e43aacb42$var$isWeakMap(value) {\n if (typeof WeakMap === \"undefined\") return false;\n return $d2e6ca9e43aacb42$var$isWeakMapToString.working ? $d2e6ca9e43aacb42$var$isWeakMapToString(value) : value instanceof WeakMap;\n}\nmodule.exports.isWeakMap = $d2e6ca9e43aacb42$var$isWeakMap;\nfunction $d2e6ca9e43aacb42$var$isWeakSetToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object WeakSet]\";\n}\n$d2e6ca9e43aacb42$var$isWeakSetToString.working = typeof WeakSet !== \"undefined\" && $d2e6ca9e43aacb42$var$isWeakSetToString(new WeakSet());\nfunction $d2e6ca9e43aacb42$var$isWeakSet(value) {\n return $d2e6ca9e43aacb42$var$isWeakSetToString(value);\n}\nmodule.exports.isWeakSet = $d2e6ca9e43aacb42$var$isWeakSet;\nfunction $d2e6ca9e43aacb42$var$isArrayBufferToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object ArrayBuffer]\";\n}\n$d2e6ca9e43aacb42$var$isArrayBufferToString.working = typeof ArrayBuffer !== \"undefined\" && $d2e6ca9e43aacb42$var$isArrayBufferToString(new ArrayBuffer());\nfunction $d2e6ca9e43aacb42$var$isArrayBuffer(value) {\n if (typeof ArrayBuffer === \"undefined\") return false;\n return $d2e6ca9e43aacb42$var$isArrayBufferToString.working ? $d2e6ca9e43aacb42$var$isArrayBufferToString(value) : value instanceof ArrayBuffer;\n}\nmodule.exports.isArrayBuffer = $d2e6ca9e43aacb42$var$isArrayBuffer;\nfunction $d2e6ca9e43aacb42$var$isDataViewToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object DataView]\";\n}\n$d2e6ca9e43aacb42$var$isDataViewToString.working = typeof ArrayBuffer !== \"undefined\" && typeof DataView !== \"undefined\" && $d2e6ca9e43aacb42$var$isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1));\nfunction $d2e6ca9e43aacb42$var$isDataView(value) {\n if (typeof DataView === \"undefined\") return false;\n return $d2e6ca9e43aacb42$var$isDataViewToString.working ? $d2e6ca9e43aacb42$var$isDataViewToString(value) : value instanceof DataView;\n}\nmodule.exports.isDataView = $d2e6ca9e43aacb42$var$isDataView;\n// Store a copy of SharedArrayBuffer in case it's deleted elsewhere\nvar $d2e6ca9e43aacb42$var$SharedArrayBufferCopy = typeof SharedArrayBuffer !== \"undefined\" ? SharedArrayBuffer : undefined;\nfunction $d2e6ca9e43aacb42$var$isSharedArrayBufferToString(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object SharedArrayBuffer]\";\n}\nfunction $d2e6ca9e43aacb42$var$isSharedArrayBuffer(value) {\n if (typeof $d2e6ca9e43aacb42$var$SharedArrayBufferCopy === \"undefined\") return false;\n if (typeof $d2e6ca9e43aacb42$var$isSharedArrayBufferToString.working === \"undefined\") $d2e6ca9e43aacb42$var$isSharedArrayBufferToString.working = $d2e6ca9e43aacb42$var$isSharedArrayBufferToString(new $d2e6ca9e43aacb42$var$SharedArrayBufferCopy());\n return $d2e6ca9e43aacb42$var$isSharedArrayBufferToString.working ? $d2e6ca9e43aacb42$var$isSharedArrayBufferToString(value) : value instanceof $d2e6ca9e43aacb42$var$SharedArrayBufferCopy;\n}\nmodule.exports.isSharedArrayBuffer = $d2e6ca9e43aacb42$var$isSharedArrayBuffer;\nfunction $d2e6ca9e43aacb42$var$isAsyncFunction(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object AsyncFunction]\";\n}\nmodule.exports.isAsyncFunction = $d2e6ca9e43aacb42$var$isAsyncFunction;\nfunction $d2e6ca9e43aacb42$var$isMapIterator(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object Map Iterator]\";\n}\nmodule.exports.isMapIterator = $d2e6ca9e43aacb42$var$isMapIterator;\nfunction $d2e6ca9e43aacb42$var$isSetIterator(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object Set Iterator]\";\n}\nmodule.exports.isSetIterator = $d2e6ca9e43aacb42$var$isSetIterator;\nfunction $d2e6ca9e43aacb42$var$isGeneratorObject(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object Generator]\";\n}\nmodule.exports.isGeneratorObject = $d2e6ca9e43aacb42$var$isGeneratorObject;\nfunction $d2e6ca9e43aacb42$var$isWebAssemblyCompiledModule(value) {\n return $d2e6ca9e43aacb42$var$ObjectToString(value) === \"[object WebAssembly.Module]\";\n}\nmodule.exports.isWebAssemblyCompiledModule = $d2e6ca9e43aacb42$var$isWebAssemblyCompiledModule;\nfunction $d2e6ca9e43aacb42$var$isNumberObject(value) {\n return $d2e6ca9e43aacb42$var$checkBoxedPrimitive(value, $d2e6ca9e43aacb42$var$numberValue);\n}\nmodule.exports.isNumberObject = $d2e6ca9e43aacb42$var$isNumberObject;\nfunction $d2e6ca9e43aacb42$var$isStringObject(value) {\n return $d2e6ca9e43aacb42$var$checkBoxedPrimitive(value, $d2e6ca9e43aacb42$var$stringValue);\n}\nmodule.exports.isStringObject = $d2e6ca9e43aacb42$var$isStringObject;\nfunction $d2e6ca9e43aacb42$var$isBooleanObject(value) {\n return $d2e6ca9e43aacb42$var$checkBoxedPrimitive(value, $d2e6ca9e43aacb42$var$booleanValue);\n}\nmodule.exports.isBooleanObject = $d2e6ca9e43aacb42$var$isBooleanObject;\nfunction $d2e6ca9e43aacb42$var$isBigIntObject(value) {\n return $d2e6ca9e43aacb42$var$BigIntSupported && $d2e6ca9e43aacb42$var$checkBoxedPrimitive(value, $d2e6ca9e43aacb42$var$bigIntValue);\n}\nmodule.exports.isBigIntObject = $d2e6ca9e43aacb42$var$isBigIntObject;\nfunction $d2e6ca9e43aacb42$var$isSymbolObject(value) {\n return $d2e6ca9e43aacb42$var$SymbolSupported && $d2e6ca9e43aacb42$var$checkBoxedPrimitive(value, $d2e6ca9e43aacb42$var$symbolValue);\n}\nmodule.exports.isSymbolObject = $d2e6ca9e43aacb42$var$isSymbolObject;\nfunction $d2e6ca9e43aacb42$var$isBoxedPrimitive(value) {\n return $d2e6ca9e43aacb42$var$isNumberObject(value) || $d2e6ca9e43aacb42$var$isStringObject(value) || $d2e6ca9e43aacb42$var$isBooleanObject(value) || $d2e6ca9e43aacb42$var$isBigIntObject(value) || $d2e6ca9e43aacb42$var$isSymbolObject(value);\n}\nmodule.exports.isBoxedPrimitive = $d2e6ca9e43aacb42$var$isBoxedPrimitive;\nfunction $d2e6ca9e43aacb42$var$isAnyArrayBuffer(value) {\n return typeof Uint8Array !== \"undefined\" && ($d2e6ca9e43aacb42$var$isArrayBuffer(value) || $d2e6ca9e43aacb42$var$isSharedArrayBuffer(value));\n}\nmodule.exports.isAnyArrayBuffer = $d2e6ca9e43aacb42$var$isAnyArrayBuffer;\n[\n \"isProxy\",\n \"isExternal\",\n \"isModuleNamespaceObject\"\n].forEach(function(method) {\n Object.defineProperty(module.exports, method, {\n enumerable: false,\n value: function() {\n throw new Error(method + \" is not supported in userland\");\n }\n });\n});\n\n});\nparcelRegister(\"hQsBH\", function(module, exports) {\n\"use strict\";\n\nvar $cfdd7bc16a6f0391$var$hasToStringTag = (parcelRequire(\"hlgT2\"))();\n\nvar $9rEHq = parcelRequire(\"9rEHq\");\nvar $cfdd7bc16a6f0391$var$$toString = $9rEHq(\"Object.prototype.toString\");\nvar $cfdd7bc16a6f0391$var$isStandardArguments = function isArguments(value) {\n if ($cfdd7bc16a6f0391$var$hasToStringTag && value && typeof value === \"object\" && Symbol.toStringTag in value) return false;\n return $cfdd7bc16a6f0391$var$$toString(value) === \"[object Arguments]\";\n};\nvar $cfdd7bc16a6f0391$var$isLegacyArguments = function isArguments(value) {\n if ($cfdd7bc16a6f0391$var$isStandardArguments(value)) return true;\n return value !== null && typeof value === \"object\" && typeof value.length === \"number\" && value.length >= 0 && $cfdd7bc16a6f0391$var$$toString(value) !== \"[object Array]\" && $cfdd7bc16a6f0391$var$$toString(value.callee) === \"[object Function]\";\n};\nvar $cfdd7bc16a6f0391$var$supportsStandardArguments = function() {\n return $cfdd7bc16a6f0391$var$isStandardArguments(arguments);\n}();\n$cfdd7bc16a6f0391$var$isStandardArguments.isLegacyArguments = $cfdd7bc16a6f0391$var$isLegacyArguments; // for tests\nmodule.exports = $cfdd7bc16a6f0391$var$supportsStandardArguments ? $cfdd7bc16a6f0391$var$isStandardArguments : $cfdd7bc16a6f0391$var$isLegacyArguments;\n\n});\nparcelRegister(\"hlgT2\", function(module, exports) {\n\"use strict\";\n\nvar $iswqS = parcelRequire(\"iswqS\");\nmodule.exports = function hasToStringTagShams() {\n return $iswqS() && !!Symbol.toStringTag;\n};\n\n});\nparcelRegister(\"iswqS\", function(module, exports) {\n\"use strict\";\n/* eslint complexity: [2, 18], max-statements: [2, 33] */ module.exports = function hasSymbols() {\n if (typeof Symbol !== \"function\" || typeof Object.getOwnPropertySymbols !== \"function\") return false;\n if (typeof Symbol.iterator === \"symbol\") return true;\n var obj = {};\n var sym = Symbol(\"test\");\n var symObj = Object(sym);\n if (typeof sym === \"string\") return false;\n if (Object.prototype.toString.call(sym) !== \"[object Symbol]\") return false;\n if (Object.prototype.toString.call(symObj) !== \"[object Symbol]\") return false;\n // temp disabled per https://github.com/ljharb/object.assign/issues/17\n // if (sym instanceof Symbol) { return false; }\n // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n // if (!(symObj instanceof Symbol)) { return false; }\n // if (typeof Symbol.prototype.toString !== 'function') { return false; }\n // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n var symVal = 42;\n obj[sym] = symVal;\n for(sym in obj)return false;\n // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n if (typeof Object.keys === \"function\" && Object.keys(obj).length !== 0) return false;\n if (typeof Object.getOwnPropertyNames === \"function\" && Object.getOwnPropertyNames(obj).length !== 0) return false;\n var syms = Object.getOwnPropertySymbols(obj);\n if (syms.length !== 1 || syms[0] !== sym) return false;\n if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) return false;\n if (typeof Object.getOwnPropertyDescriptor === \"function\") {\n var descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n if (descriptor.value !== symVal || descriptor.enumerable !== true) return false;\n }\n return true;\n};\n\n});\n\n\nparcelRegister(\"9rEHq\", function(module, exports) {\n\"use strict\";\n\nvar $cbV5a = parcelRequire(\"cbV5a\");\n\nvar $6gXjj = parcelRequire(\"6gXjj\");\nvar $6e0634b5d975b0a1$var$$indexOf = $6gXjj($cbV5a(\"String.prototype.indexOf\"));\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n var intrinsic = $cbV5a(name, !!allowMissing);\n if (typeof intrinsic === \"function\" && $6e0634b5d975b0a1$var$$indexOf(name, \".prototype.\") > -1) return $6gXjj(intrinsic);\n return intrinsic;\n};\n\n});\nparcelRegister(\"cbV5a\", function(module, exports) {\n\"use strict\";\nvar $8e02ca77d270b092$var$undefined1;\nvar $8e02ca77d270b092$var$$SyntaxError = SyntaxError;\nvar $8e02ca77d270b092$var$$Function = Function;\nvar $8e02ca77d270b092$var$$TypeError = TypeError;\n// eslint-disable-next-line consistent-return\nvar $8e02ca77d270b092$var$getEvalledConstructor = function(expressionSyntax) {\n try {\n return $8e02ca77d270b092$var$$Function('\"use strict\"; return (' + expressionSyntax + \").constructor;\")();\n } catch (e) {}\n};\nvar $8e02ca77d270b092$var$$gOPD = Object.getOwnPropertyDescriptor;\nif ($8e02ca77d270b092$var$$gOPD) try {\n $8e02ca77d270b092$var$$gOPD({}, \"\");\n} catch (e) {\n $8e02ca77d270b092$var$$gOPD = null; // this is IE 8, which has a broken gOPD\n}\nvar $8e02ca77d270b092$var$throwTypeError = function() {\n throw new $8e02ca77d270b092$var$$TypeError();\n};\nvar $8e02ca77d270b092$var$ThrowTypeError = $8e02ca77d270b092$var$$gOPD ? function() {\n try {\n // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n arguments.callee; // IE 8 does not throw here\n return $8e02ca77d270b092$var$throwTypeError;\n } catch (calleeThrows) {\n try {\n // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n return $8e02ca77d270b092$var$$gOPD(arguments, \"callee\").get;\n } catch (gOPDthrows) {\n return $8e02ca77d270b092$var$throwTypeError;\n }\n }\n}() : $8e02ca77d270b092$var$throwTypeError;\n\nvar $8e02ca77d270b092$var$hasSymbols = (parcelRequire(\"iAT3w\"))();\n\nvar $8e02ca77d270b092$var$hasProto = (parcelRequire(\"5I7PD\"))();\nvar $8e02ca77d270b092$var$getProto = Object.getPrototypeOf || ($8e02ca77d270b092$var$hasProto ? function(x) {\n return x.__proto__;\n} // eslint-disable-line no-proto\n : null);\nvar $8e02ca77d270b092$var$needsEval = {};\nvar $8e02ca77d270b092$var$TypedArray = typeof Uint8Array === \"undefined\" || !$8e02ca77d270b092$var$getProto ? undefined : $8e02ca77d270b092$var$getProto(Uint8Array);\nvar $8e02ca77d270b092$var$INTRINSICS = {\n \"%AggregateError%\": typeof AggregateError === \"undefined\" ? undefined : AggregateError,\n \"%Array%\": Array,\n \"%ArrayBuffer%\": typeof ArrayBuffer === \"undefined\" ? undefined : ArrayBuffer,\n \"%ArrayIteratorPrototype%\": $8e02ca77d270b092$var$hasSymbols && $8e02ca77d270b092$var$getProto ? $8e02ca77d270b092$var$getProto([][Symbol.iterator]()) : undefined,\n \"%AsyncFromSyncIteratorPrototype%\": undefined,\n \"%AsyncFunction%\": $8e02ca77d270b092$var$needsEval,\n \"%AsyncGenerator%\": $8e02ca77d270b092$var$needsEval,\n \"%AsyncGeneratorFunction%\": $8e02ca77d270b092$var$needsEval,\n \"%AsyncIteratorPrototype%\": $8e02ca77d270b092$var$needsEval,\n \"%Atomics%\": typeof Atomics === \"undefined\" ? undefined : Atomics,\n \"%BigInt%\": typeof BigInt === \"undefined\" ? undefined : BigInt,\n \"%BigInt64Array%\": typeof BigInt64Array === \"undefined\" ? undefined : BigInt64Array,\n \"%BigUint64Array%\": typeof BigUint64Array === \"undefined\" ? undefined : BigUint64Array,\n \"%Boolean%\": Boolean,\n \"%DataView%\": typeof DataView === \"undefined\" ? undefined : DataView,\n \"%Date%\": Date,\n \"%decodeURI%\": decodeURI,\n \"%decodeURIComponent%\": decodeURIComponent,\n \"%encodeURI%\": encodeURI,\n \"%encodeURIComponent%\": encodeURIComponent,\n \"%Error%\": Error,\n \"%eval%\": eval,\n \"%EvalError%\": EvalError,\n \"%Float32Array%\": typeof Float32Array === \"undefined\" ? undefined : Float32Array,\n \"%Float64Array%\": typeof Float64Array === \"undefined\" ? undefined : Float64Array,\n \"%FinalizationRegistry%\": typeof FinalizationRegistry === \"undefined\" ? undefined : FinalizationRegistry,\n \"%Function%\": $8e02ca77d270b092$var$$Function,\n \"%GeneratorFunction%\": $8e02ca77d270b092$var$needsEval,\n \"%Int8Array%\": typeof Int8Array === \"undefined\" ? undefined : Int8Array,\n \"%Int16Array%\": typeof Int16Array === \"undefined\" ? undefined : Int16Array,\n \"%Int32Array%\": typeof Int32Array === \"undefined\" ? undefined : Int32Array,\n \"%isFinite%\": isFinite,\n \"%isNaN%\": isNaN,\n \"%IteratorPrototype%\": $8e02ca77d270b092$var$hasSymbols && $8e02ca77d270b092$var$getProto ? $8e02ca77d270b092$var$getProto($8e02ca77d270b092$var$getProto([][Symbol.iterator]())) : undefined,\n \"%JSON%\": typeof JSON === \"object\" ? JSON : undefined,\n \"%Map%\": typeof Map === \"undefined\" ? undefined : Map,\n \"%MapIteratorPrototype%\": typeof Map === \"undefined\" || !$8e02ca77d270b092$var$hasSymbols || !$8e02ca77d270b092$var$getProto ? undefined : $8e02ca77d270b092$var$getProto(new Map()[Symbol.iterator]()),\n \"%Math%\": Math,\n \"%Number%\": Number,\n \"%Object%\": Object,\n \"%parseFloat%\": parseFloat,\n \"%parseInt%\": parseInt,\n \"%Promise%\": typeof Promise === \"undefined\" ? undefined : Promise,\n \"%Proxy%\": typeof Proxy === \"undefined\" ? undefined : Proxy,\n \"%RangeError%\": RangeError,\n \"%ReferenceError%\": ReferenceError,\n \"%Reflect%\": typeof Reflect === \"undefined\" ? undefined : Reflect,\n \"%RegExp%\": RegExp,\n \"%Set%\": typeof Set === \"undefined\" ? undefined : Set,\n \"%SetIteratorPrototype%\": typeof Set === \"undefined\" || !$8e02ca77d270b092$var$hasSymbols || !$8e02ca77d270b092$var$getProto ? undefined : $8e02ca77d270b092$var$getProto(new Set()[Symbol.iterator]()),\n \"%SharedArrayBuffer%\": typeof SharedArrayBuffer === \"undefined\" ? undefined : SharedArrayBuffer,\n \"%String%\": String,\n \"%StringIteratorPrototype%\": $8e02ca77d270b092$var$hasSymbols && $8e02ca77d270b092$var$getProto ? $8e02ca77d270b092$var$getProto(\"\"[Symbol.iterator]()) : undefined,\n \"%Symbol%\": $8e02ca77d270b092$var$hasSymbols ? Symbol : undefined,\n \"%SyntaxError%\": $8e02ca77d270b092$var$$SyntaxError,\n \"%ThrowTypeError%\": $8e02ca77d270b092$var$ThrowTypeError,\n \"%TypedArray%\": $8e02ca77d270b092$var$TypedArray,\n \"%TypeError%\": $8e02ca77d270b092$var$$TypeError,\n \"%Uint8Array%\": typeof Uint8Array === \"undefined\" ? undefined : Uint8Array,\n \"%Uint8ClampedArray%\": typeof Uint8ClampedArray === \"undefined\" ? undefined : Uint8ClampedArray,\n \"%Uint16Array%\": typeof Uint16Array === \"undefined\" ? undefined : Uint16Array,\n \"%Uint32Array%\": typeof Uint32Array === \"undefined\" ? undefined : Uint32Array,\n \"%URIError%\": URIError,\n \"%WeakMap%\": typeof WeakMap === \"undefined\" ? undefined : WeakMap,\n \"%WeakRef%\": typeof WeakRef === \"undefined\" ? undefined : WeakRef,\n \"%WeakSet%\": typeof WeakSet === \"undefined\" ? undefined : WeakSet\n};\nif ($8e02ca77d270b092$var$getProto) try {\n null.error; // eslint-disable-line no-unused-expressions\n} catch (e) {\n // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n var $8e02ca77d270b092$var$errorProto = $8e02ca77d270b092$var$getProto($8e02ca77d270b092$var$getProto(e));\n $8e02ca77d270b092$var$INTRINSICS[\"%Error.prototype%\"] = $8e02ca77d270b092$var$errorProto;\n}\nvar $8e02ca77d270b092$var$doEval = function doEval(name) {\n var value;\n if (name === \"%AsyncFunction%\") value = $8e02ca77d270b092$var$getEvalledConstructor(\"async function () {}\");\n else if (name === \"%GeneratorFunction%\") value = $8e02ca77d270b092$var$getEvalledConstructor(\"function* () {}\");\n else if (name === \"%AsyncGeneratorFunction%\") value = $8e02ca77d270b092$var$getEvalledConstructor(\"async function* () {}\");\n else if (name === \"%AsyncGenerator%\") {\n var fn = doEval(\"%AsyncGeneratorFunction%\");\n if (fn) value = fn.prototype;\n } else if (name === \"%AsyncIteratorPrototype%\") {\n var gen = doEval(\"%AsyncGenerator%\");\n if (gen && $8e02ca77d270b092$var$getProto) value = $8e02ca77d270b092$var$getProto(gen.prototype);\n }\n $8e02ca77d270b092$var$INTRINSICS[name] = value;\n return value;\n};\nvar $8e02ca77d270b092$var$LEGACY_ALIASES = {\n \"%ArrayBufferPrototype%\": [\n \"ArrayBuffer\",\n \"prototype\"\n ],\n \"%ArrayPrototype%\": [\n \"Array\",\n \"prototype\"\n ],\n \"%ArrayProto_entries%\": [\n \"Array\",\n \"prototype\",\n \"entries\"\n ],\n \"%ArrayProto_forEach%\": [\n \"Array\",\n \"prototype\",\n \"forEach\"\n ],\n \"%ArrayProto_keys%\": [\n \"Array\",\n \"prototype\",\n \"keys\"\n ],\n \"%ArrayProto_values%\": [\n \"Array\",\n \"prototype\",\n \"values\"\n ],\n \"%AsyncFunctionPrototype%\": [\n \"AsyncFunction\",\n \"prototype\"\n ],\n \"%AsyncGenerator%\": [\n \"AsyncGeneratorFunction\",\n \"prototype\"\n ],\n \"%AsyncGeneratorPrototype%\": [\n \"AsyncGeneratorFunction\",\n \"prototype\",\n \"prototype\"\n ],\n \"%BooleanPrototype%\": [\n \"Boolean\",\n \"prototype\"\n ],\n \"%DataViewPrototype%\": [\n \"DataView\",\n \"prototype\"\n ],\n \"%DatePrototype%\": [\n \"Date\",\n \"prototype\"\n ],\n \"%ErrorPrototype%\": [\n \"Error\",\n \"prototype\"\n ],\n \"%EvalErrorPrototype%\": [\n \"EvalError\",\n \"prototype\"\n ],\n \"%Float32ArrayPrototype%\": [\n \"Float32Array\",\n \"prototype\"\n ],\n \"%Float64ArrayPrototype%\": [\n \"Float64Array\",\n \"prototype\"\n ],\n \"%FunctionPrototype%\": [\n \"Function\",\n \"prototype\"\n ],\n \"%Generator%\": [\n \"GeneratorFunction\",\n \"prototype\"\n ],\n \"%GeneratorPrototype%\": [\n \"GeneratorFunction\",\n \"prototype\",\n \"prototype\"\n ],\n \"%Int8ArrayPrototype%\": [\n \"Int8Array\",\n \"prototype\"\n ],\n \"%Int16ArrayPrototype%\": [\n \"Int16Array\",\n \"prototype\"\n ],\n \"%Int32ArrayPrototype%\": [\n \"Int32Array\",\n \"prototype\"\n ],\n \"%JSONParse%\": [\n \"JSON\",\n \"parse\"\n ],\n \"%JSONStringify%\": [\n \"JSON\",\n \"stringify\"\n ],\n \"%MapPrototype%\": [\n \"Map\",\n \"prototype\"\n ],\n \"%NumberPrototype%\": [\n \"Number\",\n \"prototype\"\n ],\n \"%ObjectPrototype%\": [\n \"Object\",\n \"prototype\"\n ],\n \"%ObjProto_toString%\": [\n \"Object\",\n \"prototype\",\n \"toString\"\n ],\n \"%ObjProto_valueOf%\": [\n \"Object\",\n \"prototype\",\n \"valueOf\"\n ],\n \"%PromisePrototype%\": [\n \"Promise\",\n \"prototype\"\n ],\n \"%PromiseProto_then%\": [\n \"Promise\",\n \"prototype\",\n \"then\"\n ],\n \"%Promise_all%\": [\n \"Promise\",\n \"all\"\n ],\n \"%Promise_reject%\": [\n \"Promise\",\n \"reject\"\n ],\n \"%Promise_resolve%\": [\n \"Promise\",\n \"resolve\"\n ],\n \"%RangeErrorPrototype%\": [\n \"RangeError\",\n \"prototype\"\n ],\n \"%ReferenceErrorPrototype%\": [\n \"ReferenceError\",\n \"prototype\"\n ],\n \"%RegExpPrototype%\": [\n \"RegExp\",\n \"prototype\"\n ],\n \"%SetPrototype%\": [\n \"Set\",\n \"prototype\"\n ],\n \"%SharedArrayBufferPrototype%\": [\n \"SharedArrayBuffer\",\n \"prototype\"\n ],\n \"%StringPrototype%\": [\n \"String\",\n \"prototype\"\n ],\n \"%SymbolPrototype%\": [\n \"Symbol\",\n \"prototype\"\n ],\n \"%SyntaxErrorPrototype%\": [\n \"SyntaxError\",\n \"prototype\"\n ],\n \"%TypedArrayPrototype%\": [\n \"TypedArray\",\n \"prototype\"\n ],\n \"%TypeErrorPrototype%\": [\n \"TypeError\",\n \"prototype\"\n ],\n \"%Uint8ArrayPrototype%\": [\n \"Uint8Array\",\n \"prototype\"\n ],\n \"%Uint8ClampedArrayPrototype%\": [\n \"Uint8ClampedArray\",\n \"prototype\"\n ],\n \"%Uint16ArrayPrototype%\": [\n \"Uint16Array\",\n \"prototype\"\n ],\n \"%Uint32ArrayPrototype%\": [\n \"Uint32Array\",\n \"prototype\"\n ],\n \"%URIErrorPrototype%\": [\n \"URIError\",\n \"prototype\"\n ],\n \"%WeakMapPrototype%\": [\n \"WeakMap\",\n \"prototype\"\n ],\n \"%WeakSetPrototype%\": [\n \"WeakSet\",\n \"prototype\"\n ]\n};\n\nvar $eSJCt = parcelRequire(\"eSJCt\");\n\nvar $hhJZr = parcelRequire(\"hhJZr\");\nvar $8e02ca77d270b092$var$$concat = $eSJCt.call(Function.call, Array.prototype.concat);\nvar $8e02ca77d270b092$var$$spliceApply = $eSJCt.call(Function.apply, Array.prototype.splice);\nvar $8e02ca77d270b092$var$$replace = $eSJCt.call(Function.call, String.prototype.replace);\nvar $8e02ca77d270b092$var$$strSlice = $eSJCt.call(Function.call, String.prototype.slice);\nvar $8e02ca77d270b092$var$$exec = $eSJCt.call(Function.call, RegExp.prototype.exec);\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var $8e02ca77d270b092$var$rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar $8e02ca77d270b092$var$reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */ \nvar $8e02ca77d270b092$var$stringToPath = function stringToPath(string) {\n var first = $8e02ca77d270b092$var$$strSlice(string, 0, 1);\n var last = $8e02ca77d270b092$var$$strSlice(string, -1);\n if (first === \"%\" && last !== \"%\") throw new $8e02ca77d270b092$var$$SyntaxError(\"invalid intrinsic syntax, expected closing `%`\");\n else if (last === \"%\" && first !== \"%\") throw new $8e02ca77d270b092$var$$SyntaxError(\"invalid intrinsic syntax, expected opening `%`\");\n var result = [];\n $8e02ca77d270b092$var$$replace(string, $8e02ca77d270b092$var$rePropName, function(match, number, quote, subString) {\n result[result.length] = quote ? $8e02ca77d270b092$var$$replace(subString, $8e02ca77d270b092$var$reEscapeChar, \"$1\") : number || match;\n });\n return result;\n};\n/* end adaptation */ var $8e02ca77d270b092$var$getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n var intrinsicName = name;\n var alias;\n if ($hhJZr($8e02ca77d270b092$var$LEGACY_ALIASES, intrinsicName)) {\n alias = $8e02ca77d270b092$var$LEGACY_ALIASES[intrinsicName];\n intrinsicName = \"%\" + alias[0] + \"%\";\n }\n if ($hhJZr($8e02ca77d270b092$var$INTRINSICS, intrinsicName)) {\n var value = $8e02ca77d270b092$var$INTRINSICS[intrinsicName];\n if (value === $8e02ca77d270b092$var$needsEval) value = $8e02ca77d270b092$var$doEval(intrinsicName);\n if (typeof value === \"undefined\" && !allowMissing) throw new $8e02ca77d270b092$var$$TypeError(\"intrinsic \" + name + \" exists, but is not available. Please file an issue!\");\n return {\n alias: alias,\n name: intrinsicName,\n value: value\n };\n }\n throw new $8e02ca77d270b092$var$$SyntaxError(\"intrinsic \" + name + \" does not exist!\");\n};\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n if (typeof name !== \"string\" || name.length === 0) throw new $8e02ca77d270b092$var$$TypeError(\"intrinsic name must be a non-empty string\");\n if (arguments.length > 1 && typeof allowMissing !== \"boolean\") throw new $8e02ca77d270b092$var$$TypeError('\"allowMissing\" argument must be a boolean');\n if ($8e02ca77d270b092$var$$exec(/^%?[^%]*%?$/, name) === null) throw new $8e02ca77d270b092$var$$SyntaxError(\"`%` may not be present anywhere but at the beginning and end of the intrinsic name\");\n var parts = $8e02ca77d270b092$var$stringToPath(name);\n var intrinsicBaseName = parts.length > 0 ? parts[0] : \"\";\n var intrinsic = $8e02ca77d270b092$var$getBaseIntrinsic(\"%\" + intrinsicBaseName + \"%\", allowMissing);\n var intrinsicRealName = intrinsic.name;\n var value = intrinsic.value;\n var skipFurtherCaching = false;\n var alias = intrinsic.alias;\n if (alias) {\n intrinsicBaseName = alias[0];\n $8e02ca77d270b092$var$$spliceApply(parts, $8e02ca77d270b092$var$$concat([\n 0,\n 1\n ], alias));\n }\n for(var i = 1, isOwn = true; i < parts.length; i += 1){\n var part = parts[i];\n var first = $8e02ca77d270b092$var$$strSlice(part, 0, 1);\n var last = $8e02ca77d270b092$var$$strSlice(part, -1);\n if ((first === '\"' || first === \"'\" || first === \"`\" || last === '\"' || last === \"'\" || last === \"`\") && first !== last) throw new $8e02ca77d270b092$var$$SyntaxError(\"property names with quotes must have matching quotes\");\n if (part === \"constructor\" || !isOwn) skipFurtherCaching = true;\n intrinsicBaseName += \".\" + part;\n intrinsicRealName = \"%\" + intrinsicBaseName + \"%\";\n if ($hhJZr($8e02ca77d270b092$var$INTRINSICS, intrinsicRealName)) value = $8e02ca77d270b092$var$INTRINSICS[intrinsicRealName];\n else if (value != null) {\n if (!(part in value)) {\n if (!allowMissing) throw new $8e02ca77d270b092$var$$TypeError(\"base intrinsic for \" + name + \" exists, but the property is not available.\");\n return void 0;\n }\n if ($8e02ca77d270b092$var$$gOPD && i + 1 >= parts.length) {\n var desc = $8e02ca77d270b092$var$$gOPD(value, part);\n isOwn = !!desc;\n // By convention, when a data property is converted to an accessor\n // property to emulate a data property that does not suffer from\n // the override mistake, that accessor's getter is marked with\n // an `originalValue` property. Here, when we detect this, we\n // uphold the illusion by pretending to see that original data\n // property, i.e., returning the value rather than the getter\n // itself.\n if (isOwn && \"get\" in desc && !(\"originalValue\" in desc.get)) value = desc.get;\n else value = value[part];\n } else {\n isOwn = $hhJZr(value, part);\n value = value[part];\n }\n if (isOwn && !skipFurtherCaching) $8e02ca77d270b092$var$INTRINSICS[intrinsicRealName] = value;\n }\n }\n return value;\n};\n\n});\nparcelRegister(\"iAT3w\", function(module, exports) {\n\"use strict\";\nvar $d8964bbb1743abbb$var$origSymbol = typeof Symbol !== \"undefined\" && Symbol;\n\nvar $iswqS = parcelRequire(\"iswqS\");\nmodule.exports = function hasNativeSymbols() {\n if (typeof $d8964bbb1743abbb$var$origSymbol !== \"function\") return false;\n if (typeof Symbol !== \"function\") return false;\n if (typeof $d8964bbb1743abbb$var$origSymbol(\"foo\") !== \"symbol\") return false;\n if (typeof Symbol(\"bar\") !== \"symbol\") return false;\n return $iswqS();\n};\n\n});\n\nparcelRegister(\"5I7PD\", function(module, exports) {\n\"use strict\";\nvar $4287230ea792b293$var$test = {\n foo: {}\n};\nvar $4287230ea792b293$var$$Object = Object;\nmodule.exports = function hasProto() {\n return ({\n __proto__: $4287230ea792b293$var$test\n }).foo === $4287230ea792b293$var$test.foo && !(({\n __proto__: null\n }) instanceof $4287230ea792b293$var$$Object);\n};\n\n});\n\nparcelRegister(\"eSJCt\", function(module, exports) {\n\"use strict\";\n\nvar $7uTAw = parcelRequire(\"7uTAw\");\nmodule.exports = Function.prototype.bind || $7uTAw;\n\n});\nparcelRegister(\"7uTAw\", function(module, exports) {\n\"use strict\";\n/* eslint no-invalid-this: 1 */ var $5756745b39df06db$var$ERROR_MESSAGE = \"Function.prototype.bind called on incompatible \";\nvar $5756745b39df06db$var$toStr = Object.prototype.toString;\nvar $5756745b39df06db$var$max = Math.max;\nvar $5756745b39df06db$var$funcType = \"[object Function]\";\nvar $5756745b39df06db$var$concatty = function concatty(a, b) {\n var arr = [];\n for(var i = 0; i < a.length; i += 1)arr[i] = a[i];\n for(var j = 0; j < b.length; j += 1)arr[j + a.length] = b[j];\n return arr;\n};\nvar $5756745b39df06db$var$slicy = function slicy(arrLike, offset) {\n var arr = [];\n for(var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1)arr[j] = arrLike[i];\n return arr;\n};\nvar $5756745b39df06db$var$joiny = function(arr, joiner) {\n var str = \"\";\n for(var i = 0; i < arr.length; i += 1){\n str += arr[i];\n if (i + 1 < arr.length) str += joiner;\n }\n return str;\n};\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== \"function\" || $5756745b39df06db$var$toStr.apply(target) !== $5756745b39df06db$var$funcType) throw new TypeError($5756745b39df06db$var$ERROR_MESSAGE + target);\n var args = $5756745b39df06db$var$slicy(arguments, 1);\n var bound;\n var binder = function() {\n if (this instanceof bound) {\n var result = target.apply(this, $5756745b39df06db$var$concatty(args, arguments));\n if (Object(result) === result) return result;\n return this;\n }\n return target.apply(that, $5756745b39df06db$var$concatty(args, arguments));\n };\n var boundLength = $5756745b39df06db$var$max(0, target.length - args.length);\n var boundArgs = [];\n for(var i = 0; i < boundLength; i++)boundArgs[i] = \"$\" + i;\n bound = Function(\"binder\", \"return function (\" + $5756745b39df06db$var$joiny(boundArgs, \",\") + \"){ return binder.apply(this,arguments); }\")(binder);\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n return bound;\n};\n\n});\n\n\nparcelRegister(\"hhJZr\", function(module, exports) {\n\"use strict\";\nvar $c957b2d89cf0941a$var$call = Function.prototype.call;\nvar $c957b2d89cf0941a$var$$hasOwn = Object.prototype.hasOwnProperty;\n\nvar $eSJCt = parcelRequire(\"eSJCt\");\n/** @type {(o: {}, p: PropertyKey) => p is keyof o} */ module.exports = $eSJCt.call($c957b2d89cf0941a$var$call, $c957b2d89cf0941a$var$$hasOwn);\n\n});\n\n\nparcelRegister(\"6gXjj\", function(module, exports) {\n\"use strict\";\n\nvar $eSJCt = parcelRequire(\"eSJCt\");\n\nvar $cbV5a = parcelRequire(\"cbV5a\");\n\nvar $8wQgk = parcelRequire(\"8wQgk\");\nvar $49123e876306bb42$var$$TypeError = $cbV5a(\"%TypeError%\");\nvar $49123e876306bb42$var$$apply = $cbV5a(\"%Function.prototype.apply%\");\nvar $49123e876306bb42$var$$call = $cbV5a(\"%Function.prototype.call%\");\nvar $49123e876306bb42$var$$reflectApply = $cbV5a(\"%Reflect.apply%\", true) || $eSJCt.call($49123e876306bb42$var$$call, $49123e876306bb42$var$$apply);\nvar $49123e876306bb42$var$$defineProperty = $cbV5a(\"%Object.defineProperty%\", true);\nvar $49123e876306bb42$var$$max = $cbV5a(\"%Math.max%\");\nif ($49123e876306bb42$var$$defineProperty) try {\n $49123e876306bb42$var$$defineProperty({}, \"a\", {\n value: 1\n });\n} catch (e) {\n // IE 8 has a broken defineProperty\n $49123e876306bb42$var$$defineProperty = null;\n}\nmodule.exports = function callBind(originalFunction) {\n if (typeof originalFunction !== \"function\") throw new $49123e876306bb42$var$$TypeError(\"a function is required\");\n var func = $49123e876306bb42$var$$reflectApply($eSJCt, $49123e876306bb42$var$$call, arguments);\n return $8wQgk(func, 1 + $49123e876306bb42$var$$max(0, originalFunction.length - (arguments.length - 1)), true);\n};\nvar $49123e876306bb42$var$applyBind = function applyBind() {\n return $49123e876306bb42$var$$reflectApply($eSJCt, $49123e876306bb42$var$$apply, arguments);\n};\nif ($49123e876306bb42$var$$defineProperty) $49123e876306bb42$var$$defineProperty(module.exports, \"apply\", {\n value: $49123e876306bb42$var$applyBind\n});\nelse module.exports.apply = $49123e876306bb42$var$applyBind;\n\n});\nparcelRegister(\"8wQgk\", function(module, exports) {\n\"use strict\";\n\nvar $cbV5a = parcelRequire(\"cbV5a\");\n\nvar $dEYu7 = parcelRequire(\"dEYu7\");\n\nvar $6359da1a4da0c32b$var$hasDescriptors = (parcelRequire(\"gaPDk\"))();\n\nvar $lpldP = parcelRequire(\"lpldP\");\nvar $6359da1a4da0c32b$var$$TypeError = $cbV5a(\"%TypeError%\");\nvar $6359da1a4da0c32b$var$$floor = $cbV5a(\"%Math.floor%\");\nmodule.exports = function setFunctionLength(fn, length) {\n if (typeof fn !== \"function\") throw new $6359da1a4da0c32b$var$$TypeError(\"`fn` is not a function\");\n if (typeof length !== \"number\" || length < 0 || length > 0xFFFFFFFF || $6359da1a4da0c32b$var$$floor(length) !== length) throw new $6359da1a4da0c32b$var$$TypeError(\"`length` must be a positive 32-bit integer\");\n var loose = arguments.length > 2 && !!arguments[2];\n var functionLengthIsConfigurable = true;\n var functionLengthIsWritable = true;\n if (\"length\" in fn && $lpldP) {\n var desc = $lpldP(fn, \"length\");\n if (desc && !desc.configurable) functionLengthIsConfigurable = false;\n if (desc && !desc.writable) functionLengthIsWritable = false;\n }\n if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n if ($6359da1a4da0c32b$var$hasDescriptors) $dEYu7(fn, \"length\", length, true, true);\n else $dEYu7(fn, \"length\", length);\n }\n return fn;\n};\n\n});\nparcelRegister(\"dEYu7\", function(module, exports) {\n\"use strict\";\n\nvar $9f1dedcd246e3ad0$var$hasPropertyDescriptors = (parcelRequire(\"gaPDk\"))();\n\nvar $cbV5a = parcelRequire(\"cbV5a\");\nvar $9f1dedcd246e3ad0$var$$defineProperty = $9f1dedcd246e3ad0$var$hasPropertyDescriptors && $cbV5a(\"%Object.defineProperty%\", true);\nif ($9f1dedcd246e3ad0$var$$defineProperty) try {\n $9f1dedcd246e3ad0$var$$defineProperty({}, \"a\", {\n value: 1\n });\n} catch (e) {\n // IE 8 has a broken defineProperty\n $9f1dedcd246e3ad0$var$$defineProperty = false;\n}\nvar $9f1dedcd246e3ad0$var$$SyntaxError = $cbV5a(\"%SyntaxError%\");\nvar $9f1dedcd246e3ad0$var$$TypeError = $cbV5a(\"%TypeError%\");\n\nvar $lpldP = parcelRequire(\"lpldP\");\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */ module.exports = function defineDataProperty(obj, property, value) {\n if (!obj || typeof obj !== \"object\" && typeof obj !== \"function\") throw new $9f1dedcd246e3ad0$var$$TypeError(\"`obj` must be an object or a function`\");\n if (typeof property !== \"string\" && typeof property !== \"symbol\") throw new $9f1dedcd246e3ad0$var$$TypeError(\"`property` must be a string or a symbol`\");\n if (arguments.length > 3 && typeof arguments[3] !== \"boolean\" && arguments[3] !== null) throw new $9f1dedcd246e3ad0$var$$TypeError(\"`nonEnumerable`, if provided, must be a boolean or null\");\n if (arguments.length > 4 && typeof arguments[4] !== \"boolean\" && arguments[4] !== null) throw new $9f1dedcd246e3ad0$var$$TypeError(\"`nonWritable`, if provided, must be a boolean or null\");\n if (arguments.length > 5 && typeof arguments[5] !== \"boolean\" && arguments[5] !== null) throw new $9f1dedcd246e3ad0$var$$TypeError(\"`nonConfigurable`, if provided, must be a boolean or null\");\n if (arguments.length > 6 && typeof arguments[6] !== \"boolean\") throw new $9f1dedcd246e3ad0$var$$TypeError(\"`loose`, if provided, must be a boolean\");\n var nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n var nonWritable = arguments.length > 4 ? arguments[4] : null;\n var nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n var loose = arguments.length > 6 ? arguments[6] : false;\n /* @type {false | TypedPropertyDescriptor} */ var desc = !!$lpldP && $lpldP(obj, property);\n if ($9f1dedcd246e3ad0$var$$defineProperty) $9f1dedcd246e3ad0$var$$defineProperty(obj, property, {\n configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n value: value,\n writable: nonWritable === null && desc ? desc.writable : !nonWritable\n });\n else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n obj[property] = value; // eslint-disable-line no-param-reassign\n else throw new $9f1dedcd246e3ad0$var$$SyntaxError(\"This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.\");\n};\n\n});\nparcelRegister(\"gaPDk\", function(module, exports) {\n\"use strict\";\n\nvar $cbV5a = parcelRequire(\"cbV5a\");\nvar $bc65a1d1be87ac6b$var$$defineProperty = $cbV5a(\"%Object.defineProperty%\", true);\nvar $bc65a1d1be87ac6b$var$hasPropertyDescriptors = function hasPropertyDescriptors() {\n if ($bc65a1d1be87ac6b$var$$defineProperty) try {\n $bc65a1d1be87ac6b$var$$defineProperty({}, \"a\", {\n value: 1\n });\n return true;\n } catch (e) {\n // IE 8 has a broken defineProperty\n return false;\n }\n return false;\n};\n$bc65a1d1be87ac6b$var$hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n // node v0.6 has a bug where array lengths can be Set but not Defined\n if (!$bc65a1d1be87ac6b$var$hasPropertyDescriptors()) return null;\n try {\n return $bc65a1d1be87ac6b$var$$defineProperty([], \"length\", {\n value: 1\n }).length !== 1;\n } catch (e) {\n // In Firefox 4-22, defining length on an array throws an exception.\n return true;\n }\n};\nmodule.exports = $bc65a1d1be87ac6b$var$hasPropertyDescriptors;\n\n});\n\nparcelRegister(\"lpldP\", function(module, exports) {\n\"use strict\";\n\nvar $cbV5a = parcelRequire(\"cbV5a\");\nvar $f95c650c3c50a0b9$var$$gOPD = $cbV5a(\"%Object.getOwnPropertyDescriptor%\", true);\nif ($f95c650c3c50a0b9$var$$gOPD) try {\n $f95c650c3c50a0b9$var$$gOPD([], \"length\");\n} catch (e) {\n // IE 8 has a broken gOPD\n $f95c650c3c50a0b9$var$$gOPD = null;\n}\nmodule.exports = $f95c650c3c50a0b9$var$$gOPD;\n\n});\n\n\n\n\n\n\nparcelRegister(\"lCUJL\", function(module, exports) {\n\"use strict\";\nvar $fbe9286b8c5d6014$var$toStr = Object.prototype.toString;\nvar $fbe9286b8c5d6014$var$fnToStr = Function.prototype.toString;\nvar $fbe9286b8c5d6014$var$isFnRegex = /^\\s*(?:function)?\\*/;\n\nvar $fbe9286b8c5d6014$var$hasToStringTag = (parcelRequire(\"hlgT2\"))();\nvar $fbe9286b8c5d6014$var$getProto = Object.getPrototypeOf;\nvar $fbe9286b8c5d6014$var$getGeneratorFunc = function() {\n if (!$fbe9286b8c5d6014$var$hasToStringTag) return false;\n try {\n return Function(\"return function*() {}\")();\n } catch (e) {}\n};\nvar $fbe9286b8c5d6014$var$GeneratorFunction;\nmodule.exports = function isGeneratorFunction(fn) {\n if (typeof fn !== \"function\") return false;\n if ($fbe9286b8c5d6014$var$isFnRegex.test($fbe9286b8c5d6014$var$fnToStr.call(fn))) return true;\n if (!$fbe9286b8c5d6014$var$hasToStringTag) {\n var str = $fbe9286b8c5d6014$var$toStr.call(fn);\n return str === \"[object GeneratorFunction]\";\n }\n if (!$fbe9286b8c5d6014$var$getProto) return false;\n if (typeof $fbe9286b8c5d6014$var$GeneratorFunction === \"undefined\") {\n var generatorFunc = $fbe9286b8c5d6014$var$getGeneratorFunc();\n $fbe9286b8c5d6014$var$GeneratorFunction = generatorFunc ? $fbe9286b8c5d6014$var$getProto(generatorFunc) : false;\n }\n return $fbe9286b8c5d6014$var$getProto(fn) === $fbe9286b8c5d6014$var$GeneratorFunction;\n};\n\n});\n\nparcelRegister(\"iVfsl\", function(module, exports) {\n\"use strict\";\n\nvar $e6WPe = parcelRequire(\"e6WPe\");\n\nvar $i6TQG = parcelRequire(\"i6TQG\");\n\nvar $6gXjj = parcelRequire(\"6gXjj\");\n\nvar $9rEHq = parcelRequire(\"9rEHq\");\n\nvar $lpldP = parcelRequire(\"lpldP\");\nvar $dc698a21108030ad$var$$toString = $9rEHq(\"Object.prototype.toString\");\n\nvar $dc698a21108030ad$var$hasToStringTag = (parcelRequire(\"hlgT2\"))();\nvar $dc698a21108030ad$var$g = typeof globalThis === \"undefined\" ? $parcel$global : globalThis;\nvar $dc698a21108030ad$var$typedArrays = $i6TQG();\nvar $dc698a21108030ad$var$$slice = $9rEHq(\"String.prototype.slice\");\nvar $dc698a21108030ad$var$getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\nvar $dc698a21108030ad$var$$indexOf = $9rEHq(\"Array.prototype.indexOf\", true) || function indexOf(array, value) {\n for(var i = 0; i < array.length; i += 1){\n if (array[i] === value) return i;\n }\n return -1;\n};\nvar $dc698a21108030ad$var$cache = {\n __proto__: null\n};\nif ($dc698a21108030ad$var$hasToStringTag && $lpldP && $dc698a21108030ad$var$getPrototypeOf) $e6WPe($dc698a21108030ad$var$typedArrays, function(typedArray) {\n var arr = new $dc698a21108030ad$var$g[typedArray]();\n if (Symbol.toStringTag in arr) {\n var proto = $dc698a21108030ad$var$getPrototypeOf(arr);\n var descriptor = $lpldP(proto, Symbol.toStringTag);\n if (!descriptor) {\n var superProto = $dc698a21108030ad$var$getPrototypeOf(proto);\n descriptor = $lpldP(superProto, Symbol.toStringTag);\n }\n $dc698a21108030ad$var$cache[\"$\" + typedArray] = $6gXjj(descriptor.get);\n }\n});\nelse $e6WPe($dc698a21108030ad$var$typedArrays, function(typedArray) {\n var arr = new $dc698a21108030ad$var$g[typedArray]();\n var fn = arr.slice || arr.set;\n if (fn) $dc698a21108030ad$var$cache[\"$\" + typedArray] = $6gXjj(fn);\n});\nvar $dc698a21108030ad$var$tryTypedArrays = function tryAllTypedArrays(value) {\n var found = false;\n $e6WPe($dc698a21108030ad$var$cache, function(getter, typedArray) {\n if (!found) try {\n if (\"$\" + getter(value) === typedArray) found = $dc698a21108030ad$var$$slice(typedArray, 1);\n } catch (e) {}\n });\n return found;\n};\nvar $dc698a21108030ad$var$trySlices = function tryAllSlices(value) {\n var found = false;\n $e6WPe($dc698a21108030ad$var$cache, function(getter, name) {\n if (!found) try {\n getter(value);\n found = $dc698a21108030ad$var$$slice(name, 1);\n } catch (e) {}\n });\n return found;\n};\nmodule.exports = function whichTypedArray(value) {\n if (!value || typeof value !== \"object\") return false;\n if (!$dc698a21108030ad$var$hasToStringTag) {\n var tag = $dc698a21108030ad$var$$slice($dc698a21108030ad$var$$toString(value), 8, -1);\n if ($dc698a21108030ad$var$$indexOf($dc698a21108030ad$var$typedArrays, tag) > -1) return tag;\n if (tag !== \"Object\") return false;\n // node < 0.6 hits here on real Typed Arrays\n return $dc698a21108030ad$var$trySlices(value);\n }\n if (!$lpldP) return null;\n // unknown engine\n return $dc698a21108030ad$var$tryTypedArrays(value);\n};\n\n});\nparcelRegister(\"e6WPe\", function(module, exports) {\n\"use strict\";\n\nvar $liz7M = parcelRequire(\"liz7M\");\nvar $a45f41b45e745637$var$toStr = Object.prototype.toString;\nvar $a45f41b45e745637$var$hasOwnProperty = Object.prototype.hasOwnProperty;\nvar $a45f41b45e745637$var$forEachArray = function forEachArray(array, iterator, receiver) {\n for(var i = 0, len = array.length; i < len; i++)if ($a45f41b45e745637$var$hasOwnProperty.call(array, i)) {\n if (receiver == null) iterator(array[i], i, array);\n else iterator.call(receiver, array[i], i, array);\n }\n};\nvar $a45f41b45e745637$var$forEachString = function forEachString(string, iterator, receiver) {\n for(var i = 0, len = string.length; i < len; i++)// no such thing as a sparse string.\n if (receiver == null) iterator(string.charAt(i), i, string);\n else iterator.call(receiver, string.charAt(i), i, string);\n};\nvar $a45f41b45e745637$var$forEachObject = function forEachObject(object, iterator, receiver) {\n for(var k in object)if ($a45f41b45e745637$var$hasOwnProperty.call(object, k)) {\n if (receiver == null) iterator(object[k], k, object);\n else iterator.call(receiver, object[k], k, object);\n }\n};\nvar $a45f41b45e745637$var$forEach = function forEach(list, iterator, thisArg) {\n if (!$liz7M(iterator)) throw new TypeError(\"iterator must be a function\");\n var receiver;\n if (arguments.length >= 3) receiver = thisArg;\n if ($a45f41b45e745637$var$toStr.call(list) === \"[object Array]\") $a45f41b45e745637$var$forEachArray(list, iterator, receiver);\n else if (typeof list === \"string\") $a45f41b45e745637$var$forEachString(list, iterator, receiver);\n else $a45f41b45e745637$var$forEachObject(list, iterator, receiver);\n};\nmodule.exports = $a45f41b45e745637$var$forEach;\n\n});\nparcelRegister(\"liz7M\", function(module, exports) {\n\"use strict\";\nvar $f8168662f23765f9$var$fnToStr = Function.prototype.toString;\nvar $f8168662f23765f9$var$reflectApply = typeof Reflect === \"object\" && Reflect !== null && Reflect.apply;\nvar $f8168662f23765f9$var$badArrayLike;\nvar $f8168662f23765f9$var$isCallableMarker;\nif (typeof $f8168662f23765f9$var$reflectApply === \"function\" && typeof Object.defineProperty === \"function\") try {\n $f8168662f23765f9$var$badArrayLike = Object.defineProperty({}, \"length\", {\n get: function() {\n throw $f8168662f23765f9$var$isCallableMarker;\n }\n });\n $f8168662f23765f9$var$isCallableMarker = {};\n // eslint-disable-next-line no-throw-literal\n $f8168662f23765f9$var$reflectApply(function() {\n throw 42;\n }, null, $f8168662f23765f9$var$badArrayLike);\n} catch (_) {\n if (_ !== $f8168662f23765f9$var$isCallableMarker) $f8168662f23765f9$var$reflectApply = null;\n}\nelse $f8168662f23765f9$var$reflectApply = null;\nvar $f8168662f23765f9$var$constructorRegex = /^\\s*class\\b/;\nvar $f8168662f23765f9$var$isES6ClassFn = function isES6ClassFunction(value) {\n try {\n var fnStr = $f8168662f23765f9$var$fnToStr.call(value);\n return $f8168662f23765f9$var$constructorRegex.test(fnStr);\n } catch (e) {\n return false; // not a function\n }\n};\nvar $f8168662f23765f9$var$tryFunctionObject = function tryFunctionToStr(value) {\n try {\n if ($f8168662f23765f9$var$isES6ClassFn(value)) return false;\n $f8168662f23765f9$var$fnToStr.call(value);\n return true;\n } catch (e) {\n return false;\n }\n};\nvar $f8168662f23765f9$var$toStr = Object.prototype.toString;\nvar $f8168662f23765f9$var$objectClass = \"[object Object]\";\nvar $f8168662f23765f9$var$fnClass = \"[object Function]\";\nvar $f8168662f23765f9$var$genClass = \"[object GeneratorFunction]\";\nvar $f8168662f23765f9$var$ddaClass = \"[object HTMLAllCollection]\"; // IE 11\nvar $f8168662f23765f9$var$ddaClass2 = \"[object HTML document.all class]\";\nvar $f8168662f23765f9$var$ddaClass3 = \"[object HTMLCollection]\"; // IE 9-10\nvar $f8168662f23765f9$var$hasToStringTag = typeof Symbol === \"function\" && !!Symbol.toStringTag; // better: use `has-tostringtag`\nvar $f8168662f23765f9$var$isIE68 = !(0 in [\n , \n]); // eslint-disable-line no-sparse-arrays, comma-spacing\nvar $f8168662f23765f9$var$isDDA = function isDocumentDotAll() {\n return false;\n};\nif (typeof document === \"object\") {\n // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n var $f8168662f23765f9$var$all = document.all;\n if ($f8168662f23765f9$var$toStr.call($f8168662f23765f9$var$all) === $f8168662f23765f9$var$toStr.call(document.all)) $f8168662f23765f9$var$isDDA = function isDocumentDotAll(value) {\n /* globals document: false */ // in IE 6-8, typeof document.all is \"object\" and it's truthy\n if (($f8168662f23765f9$var$isIE68 || !value) && (typeof value === \"undefined\" || typeof value === \"object\")) try {\n var str = $f8168662f23765f9$var$toStr.call(value);\n return (str === $f8168662f23765f9$var$ddaClass || str === $f8168662f23765f9$var$ddaClass2 || str === $f8168662f23765f9$var$ddaClass3 // opera 12.16\n || str === $f8168662f23765f9$var$objectClass // IE 6-8\n ) && value(\"\") == null; // eslint-disable-line eqeqeq\n } catch (e) {}\n return false;\n };\n}\nmodule.exports = $f8168662f23765f9$var$reflectApply ? function isCallable(value) {\n if ($f8168662f23765f9$var$isDDA(value)) return true;\n if (!value) return false;\n if (typeof value !== \"function\" && typeof value !== \"object\") return false;\n try {\n $f8168662f23765f9$var$reflectApply(value, null, $f8168662f23765f9$var$badArrayLike);\n } catch (e) {\n if (e !== $f8168662f23765f9$var$isCallableMarker) return false;\n }\n return !$f8168662f23765f9$var$isES6ClassFn(value) && $f8168662f23765f9$var$tryFunctionObject(value);\n} : function isCallable(value) {\n if ($f8168662f23765f9$var$isDDA(value)) return true;\n if (!value) return false;\n if (typeof value !== \"function\" && typeof value !== \"object\") return false;\n if ($f8168662f23765f9$var$hasToStringTag) return $f8168662f23765f9$var$tryFunctionObject(value);\n if ($f8168662f23765f9$var$isES6ClassFn(value)) return false;\n var strClass = $f8168662f23765f9$var$toStr.call(value);\n if (strClass !== $f8168662f23765f9$var$fnClass && strClass !== $f8168662f23765f9$var$genClass && !/^\\[object HTML/.test(strClass)) return false;\n return $f8168662f23765f9$var$tryFunctionObject(value);\n};\n\n});\n\n\nparcelRegister(\"i6TQG\", function(module, exports) {\n\"use strict\";\nvar $d2f41beb2623cba4$var$possibleNames = [\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Float32Array\",\n \"Float64Array\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\"\n];\nvar $d2f41beb2623cba4$var$g = typeof globalThis === \"undefined\" ? $parcel$global : globalThis;\nmodule.exports = function availableTypedArrays() {\n var out = [];\n for(var i = 0; i < $d2f41beb2623cba4$var$possibleNames.length; i++)if (typeof $d2f41beb2623cba4$var$g[$d2f41beb2623cba4$var$possibleNames[i]] === \"function\") out[out.length] = $d2f41beb2623cba4$var$possibleNames[i];\n return out;\n};\n\n});\n\n\nparcelRegister(\"6n4Tb\", function(module, exports) {\n\"use strict\";\n\nvar $iVfsl = parcelRequire(\"iVfsl\");\nmodule.exports = function isTypedArray(value) {\n return !!$iVfsl(value);\n};\n\n});\n\n\nparcelRegister(\"3YNr2\", function(module, exports) {\nmodule.exports = function isBuffer(arg) {\n return arg && typeof arg === \"object\" && typeof arg.copy === \"function\" && typeof arg.fill === \"function\" && typeof arg.readUInt8 === \"function\";\n};\n\n});\n\nparcelRegister(\"fgp9u\", function(module, exports) {\nif (typeof Object.create === \"function\") // implementation from standard node.js 'util' module\nmodule.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n};\nelse // old school shim for old browsers\nmodule.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function() {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n};\n\n});\n\n\n\nparcelRegister(\"dfdGN\", function(module, exports) {\n// Currently in sync with Node.js lib/internal/assert/assertion_error.js\n// https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c\n\nvar $bYqme = parcelRequire(\"bYqme\");\n\"use strict\";\nfunction $9a474b7dcd09c5ab$var$ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function(r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction $9a474b7dcd09c5ab$var$_objectSpread(e) {\n for(var r = 1; r < arguments.length; r++){\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? $9a474b7dcd09c5ab$var$ownKeys(Object(t), !0).forEach(function(r) {\n $9a474b7dcd09c5ab$var$_defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : $9a474b7dcd09c5ab$var$ownKeys(Object(t)).forEach(function(r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nfunction $9a474b7dcd09c5ab$var$_defineProperty(obj, key, value) {\n key = $9a474b7dcd09c5ab$var$_toPropertyKey(key);\n if (key in obj) Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n else obj[key] = value;\n return obj;\n}\nfunction $9a474b7dcd09c5ab$var$_classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction $9a474b7dcd09c5ab$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, $9a474b7dcd09c5ab$var$_toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction $9a474b7dcd09c5ab$var$_createClass(Constructor, protoProps, staticProps) {\n if (protoProps) $9a474b7dcd09c5ab$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $9a474b7dcd09c5ab$var$_defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction $9a474b7dcd09c5ab$var$_toPropertyKey(arg) {\n var key = $9a474b7dcd09c5ab$var$_toPrimitive(arg, \"string\");\n return $9a474b7dcd09c5ab$var$_typeof(key) === \"symbol\" ? key : String(key);\n}\nfunction $9a474b7dcd09c5ab$var$_toPrimitive(input, hint) {\n if ($9a474b7dcd09c5ab$var$_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if ($9a474b7dcd09c5ab$var$_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction $9a474b7dcd09c5ab$var$_inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) throw new TypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) $9a474b7dcd09c5ab$var$_setPrototypeOf(subClass, superClass);\n}\nfunction $9a474b7dcd09c5ab$var$_createSuper(Derived) {\n var hasNativeReflectConstruct = $9a474b7dcd09c5ab$var$_isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = $9a474b7dcd09c5ab$var$_getPrototypeOf(Derived), result;\n if (hasNativeReflectConstruct) {\n var NewTarget = $9a474b7dcd09c5ab$var$_getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else result = Super.apply(this, arguments);\n return $9a474b7dcd09c5ab$var$_possibleConstructorReturn(this, result);\n };\n}\nfunction $9a474b7dcd09c5ab$var$_possibleConstructorReturn(self, call) {\n if (call && ($9a474b7dcd09c5ab$var$_typeof(call) === \"object\" || typeof call === \"function\")) return call;\n else if (call !== void 0) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return $9a474b7dcd09c5ab$var$_assertThisInitialized(self);\n}\nfunction $9a474b7dcd09c5ab$var$_assertThisInitialized(self) {\n if (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n}\nfunction $9a474b7dcd09c5ab$var$_wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n $9a474b7dcd09c5ab$var$_wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !$9a474b7dcd09c5ab$var$_isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") throw new TypeError(\"Super expression must either be null or a function\");\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return $9a474b7dcd09c5ab$var$_construct(Class, arguments, $9a474b7dcd09c5ab$var$_getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return $9a474b7dcd09c5ab$var$_setPrototypeOf(Wrapper, Class);\n };\n return $9a474b7dcd09c5ab$var$_wrapNativeSuper(Class);\n}\nfunction $9a474b7dcd09c5ab$var$_construct(Parent, args, Class) {\n if ($9a474b7dcd09c5ab$var$_isNativeReflectConstruct()) $9a474b7dcd09c5ab$var$_construct = Reflect.construct.bind();\n else $9a474b7dcd09c5ab$var$_construct = function _construct(Parent, args, Class) {\n var a = [\n null\n ];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) $9a474b7dcd09c5ab$var$_setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n return $9a474b7dcd09c5ab$var$_construct.apply(null, arguments);\n}\nfunction $9a474b7dcd09c5ab$var$_isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n}\nfunction $9a474b7dcd09c5ab$var$_isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\nfunction $9a474b7dcd09c5ab$var$_setPrototypeOf(o, p) {\n $9a474b7dcd09c5ab$var$_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return $9a474b7dcd09c5ab$var$_setPrototypeOf(o, p);\n}\nfunction $9a474b7dcd09c5ab$var$_getPrototypeOf(o) {\n $9a474b7dcd09c5ab$var$_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return $9a474b7dcd09c5ab$var$_getPrototypeOf(o);\n}\nfunction $9a474b7dcd09c5ab$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $9a474b7dcd09c5ab$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $9a474b7dcd09c5ab$var$_typeof(o);\n}\n\nvar $5d0kT = parcelRequire(\"5d0kT\");\nvar $9a474b7dcd09c5ab$var$inspect = $5d0kT.inspect;\n\nvar $idZmf = parcelRequire(\"idZmf\");\nvar $9a474b7dcd09c5ab$var$ERR_INVALID_ARG_TYPE = $idZmf.codes.ERR_INVALID_ARG_TYPE;\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction $9a474b7dcd09c5ab$var$endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) this_len = str.length;\n return str.substring(this_len - search.length, this_len) === search;\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\nfunction $9a474b7dcd09c5ab$var$repeat(str, count) {\n count = Math.floor(count);\n if (str.length == 0 || count == 0) return \"\";\n var maxCount = str.length * count;\n count = Math.floor(Math.log(count) / Math.log(2));\n while(count){\n str += str;\n count--;\n }\n str += str.substring(0, maxCount - str.length);\n return str;\n}\nvar $9a474b7dcd09c5ab$var$blue = \"\";\nvar $9a474b7dcd09c5ab$var$green = \"\";\nvar $9a474b7dcd09c5ab$var$red = \"\";\nvar $9a474b7dcd09c5ab$var$white = \"\";\nvar $9a474b7dcd09c5ab$var$kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n};\n// Comparing short primitives should just show === / !== instead of using the\n// diff.\nvar $9a474b7dcd09c5ab$var$kMaxShortLength = 10;\nfunction $9a474b7dcd09c5ab$var$copyError(source) {\n var keys = Object.keys(source);\n var target = Object.create(Object.getPrototypeOf(source));\n keys.forEach(function(key) {\n target[key] = source[key];\n });\n Object.defineProperty(target, \"message\", {\n value: source.message\n });\n return target;\n}\nfunction $9a474b7dcd09c5ab$var$inspectValue(val) {\n // The util.inspect default values could be changed. This makes sure the\n // error messages contain the necessary information nevertheless.\n return $9a474b7dcd09c5ab$var$inspect(val, {\n compact: false,\n customInspect: false,\n depth: 1000,\n maxArrayLength: Infinity,\n // Assert compares only enumerable properties (with a few exceptions).\n showHidden: false,\n // Having a long line as error is better than wrapping the line for\n // comparison for now.\n // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we\n // have meta information about the inspected properties (i.e., know where\n // in what line the property starts and ends).\n breakLength: Infinity,\n // Assert does not detect proxies currently.\n showProxy: false,\n sorted: true,\n // Inspect getters as we also check them when comparing entries.\n getters: true\n });\n}\nfunction $9a474b7dcd09c5ab$var$createErrDiff(actual, expected, operator) {\n var other = \"\";\n var res = \"\";\n var lastPos = 0;\n var end = \"\";\n var skipped = false;\n var actualInspected = $9a474b7dcd09c5ab$var$inspectValue(actual);\n var actualLines = actualInspected.split(\"\\n\");\n var expectedLines = $9a474b7dcd09c5ab$var$inspectValue(expected).split(\"\\n\");\n var i = 0;\n var indicator = \"\";\n // In case both values are objects explicitly mark them as not reference equal\n // for the `strictEqual` operator.\n if (operator === \"strictEqual\" && $9a474b7dcd09c5ab$var$_typeof(actual) === \"object\" && $9a474b7dcd09c5ab$var$_typeof(expected) === \"object\" && actual !== null && expected !== null) operator = \"strictEqualObject\";\n // If \"actual\" and \"expected\" fit on a single line and they are not strictly\n // equal, check further special handling.\n if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n // If the character length of \"actual\" and \"expected\" together is less than\n // kMaxShortLength and if neither is an object and at least one of them is\n // not `zero`, use the strict equal comparison to visualize the output.\n if (inputLength <= $9a474b7dcd09c5ab$var$kMaxShortLength) {\n if (($9a474b7dcd09c5ab$var$_typeof(actual) !== \"object\" || actual === null) && ($9a474b7dcd09c5ab$var$_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0)) // -0 === +0\n return \"\".concat($9a474b7dcd09c5ab$var$kReadableOperator[operator], \"\\n\\n\") + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], \"\\n\");\n } else if (operator !== \"strictEqualObject\") {\n // If the stderr is a tty and the input length is lower than the current\n // columns per line, add a mismatch indicator below the output. If it is\n // not a tty, use a default value of 80 characters.\n var maxLength = $bYqme.stderr && $bYqme.stderr.isTTY ? $bYqme.stderr.columns : 80;\n if (inputLength < maxLength) {\n while(actualLines[0][i] === expectedLines[0][i])i++;\n // Ignore the first characters.\n if (i > 2) {\n // Add position indicator for the first mismatch in case it is a\n // single line and the input length is less than the column length.\n indicator = \"\\n \".concat($9a474b7dcd09c5ab$var$repeat(\" \", i), \"^\");\n i = 0;\n }\n }\n }\n }\n // Remove all ending lines that match (this optimizes the output for\n // readability by reducing the number of total changed lines).\n var a = actualLines[actualLines.length - 1];\n var b = expectedLines[expectedLines.length - 1];\n while(a === b){\n if (i++ < 2) end = \"\\n \".concat(a).concat(end);\n else other = a;\n actualLines.pop();\n expectedLines.pop();\n if (actualLines.length === 0 || expectedLines.length === 0) break;\n a = actualLines[actualLines.length - 1];\n b = expectedLines[expectedLines.length - 1];\n }\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n // Strict equal with identical objects that are not identical by reference.\n // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() })\n if (maxLines === 0) {\n // We have to get the result again. The lines were all removed before.\n var _actualLines = actualInspected.split(\"\\n\");\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (_actualLines.length > 30) {\n _actualLines[26] = \"\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white);\n while(_actualLines.length > 27)_actualLines.pop();\n }\n return \"\".concat($9a474b7dcd09c5ab$var$kReadableOperator.notIdentical, \"\\n\\n\").concat(_actualLines.join(\"\\n\"), \"\\n\");\n }\n if (i > 3) {\n end = \"\\n\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white).concat(end);\n skipped = true;\n }\n if (other !== \"\") {\n end = \"\\n \".concat(other).concat(end);\n other = \"\";\n }\n var printedLines = 0;\n var msg = $9a474b7dcd09c5ab$var$kReadableOperator[operator] + \"\\n\".concat($9a474b7dcd09c5ab$var$green, \"+ actual\").concat($9a474b7dcd09c5ab$var$white, \" \").concat($9a474b7dcd09c5ab$var$red, \"- expected\").concat($9a474b7dcd09c5ab$var$white);\n var skippedMsg = \" \".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white, \" Lines skipped\");\n for(i = 0; i < maxLines; i++){\n // Only extra expected lines exist\n var cur = i - lastPos;\n if (actualLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(expectedLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(expectedLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the expected line to the cache.\n other += \"\\n\".concat($9a474b7dcd09c5ab$var$red, \"-\").concat($9a474b7dcd09c5ab$var$white, \" \").concat(expectedLines[i]);\n printedLines++;\n // Only extra actual lines exist\n } else if (expectedLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result.\n res += \"\\n\".concat($9a474b7dcd09c5ab$var$green, \"+\").concat($9a474b7dcd09c5ab$var$white, \" \").concat(actualLines[i]);\n printedLines++;\n // Lines diverge\n } else {\n var expectedLine = expectedLines[i];\n var actualLine = actualLines[i];\n // If the lines diverge, specifically check for lines that only diverge by\n // a trailing comma. In that case it is actually identical and we should\n // mark it as such.\n var divergingLines = actualLine !== expectedLine && (!$9a474b7dcd09c5ab$var$endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n // If the expected line has a trailing comma but is otherwise identical,\n // add a comma at the end of the actual line. Otherwise the output could\n // look weird as in:\n //\n // [\n // 1 // No comma at the end!\n // + 2\n // ]\n //\n if (divergingLines && $9a474b7dcd09c5ab$var$endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine) {\n divergingLines = false;\n actualLine += \",\";\n }\n if (divergingLines) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result and cache the expected diverging\n // line so consecutive diverging lines show up as +++--- and not +-+-+-.\n res += \"\\n\".concat($9a474b7dcd09c5ab$var$green, \"+\").concat($9a474b7dcd09c5ab$var$white, \" \").concat(actualLine);\n other += \"\\n\".concat($9a474b7dcd09c5ab$var$red, \"-\").concat($9a474b7dcd09c5ab$var$white, \" \").concat(expectedLine);\n printedLines += 2;\n // Lines are identical\n } else {\n // Add all cached information to the result before adding other things\n // and reset the cache.\n res += other;\n other = \"\";\n // If the last diverging line is exactly one line above or if it is the\n // very first line, add the line to the result.\n if (cur === 1 || i === 0) {\n res += \"\\n \".concat(actualLine);\n printedLines++;\n }\n }\n }\n // Inspected object to big (Show ~20 rows max)\n if (printedLines > 20 && i < maxLines - 2) return \"\".concat(msg).concat(skippedMsg, \"\\n\").concat(res, \"\\n\").concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white).concat(other, \"\\n\") + \"\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white);\n }\n return \"\".concat(msg).concat(skipped ? skippedMsg : \"\", \"\\n\").concat(res).concat(other).concat(end).concat(indicator);\n}\nvar $9a474b7dcd09c5ab$var$AssertionError = /*#__PURE__*/ function(_Error, _inspect$custom) {\n $9a474b7dcd09c5ab$var$_inherits(AssertionError, _Error);\n var _super = $9a474b7dcd09c5ab$var$_createSuper(AssertionError);\n function AssertionError(options) {\n var _this;\n $9a474b7dcd09c5ab$var$_classCallCheck(this, AssertionError);\n if ($9a474b7dcd09c5ab$var$_typeof(options) !== \"object\" || options === null) throw new $9a474b7dcd09c5ab$var$ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var message = options.message, operator = options.operator, stackStartFn = options.stackStartFn;\n var actual = options.actual, expected = options.expected;\n var limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n if (message != null) _this = _super.call(this, String(message));\n else {\n if ($bYqme.stderr && $bYqme.stderr.isTTY) {\n // Reset on each call to make sure we handle dynamically set environment\n // variables correct.\n if ($bYqme.stderr && $bYqme.stderr.getColorDepth && $bYqme.stderr.getColorDepth() !== 1) {\n $9a474b7dcd09c5ab$var$blue = \"\\x1b[34m\";\n $9a474b7dcd09c5ab$var$green = \"\\x1b[32m\";\n $9a474b7dcd09c5ab$var$white = \"\\x1b[39m\";\n $9a474b7dcd09c5ab$var$red = \"\\x1b[31m\";\n } else {\n $9a474b7dcd09c5ab$var$blue = \"\";\n $9a474b7dcd09c5ab$var$green = \"\";\n $9a474b7dcd09c5ab$var$white = \"\";\n $9a474b7dcd09c5ab$var$red = \"\";\n }\n }\n // Prevent the error stack from being visible by duplicating the error\n // in a very close way to the original in case both sides are actually\n // instances of Error.\n if ($9a474b7dcd09c5ab$var$_typeof(actual) === \"object\" && actual !== null && $9a474b7dcd09c5ab$var$_typeof(expected) === \"object\" && expected !== null && \"stack\" in actual && actual instanceof Error && \"stack\" in expected && expected instanceof Error) {\n actual = $9a474b7dcd09c5ab$var$copyError(actual);\n expected = $9a474b7dcd09c5ab$var$copyError(expected);\n }\n if (operator === \"deepStrictEqual\" || operator === \"strictEqual\") _this = _super.call(this, $9a474b7dcd09c5ab$var$createErrDiff(actual, expected, operator));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n // In case the objects are equal but the operator requires unequal, show\n // the first object and say A equals B\n var base = $9a474b7dcd09c5ab$var$kReadableOperator[operator];\n var res = $9a474b7dcd09c5ab$var$inspectValue(actual).split(\"\\n\");\n // In case \"actual\" is an object, it should not be reference equal.\n if (operator === \"notStrictEqual\" && $9a474b7dcd09c5ab$var$_typeof(actual) === \"object\" && actual !== null) base = $9a474b7dcd09c5ab$var$kReadableOperator.notStrictEqualObject;\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (res.length > 30) {\n res[26] = \"\".concat($9a474b7dcd09c5ab$var$blue, \"...\").concat($9a474b7dcd09c5ab$var$white);\n while(res.length > 27)res.pop();\n }\n // Only print a single input.\n if (res.length === 1) _this = _super.call(this, \"\".concat(base, \" \").concat(res[0]));\n else _this = _super.call(this, \"\".concat(base, \"\\n\\n\").concat(res.join(\"\\n\"), \"\\n\"));\n } else {\n var _res = $9a474b7dcd09c5ab$var$inspectValue(actual);\n var other = \"\";\n var knownOperators = $9a474b7dcd09c5ab$var$kReadableOperator[operator];\n if (operator === \"notDeepEqual\" || operator === \"notEqual\") {\n _res = \"\".concat($9a474b7dcd09c5ab$var$kReadableOperator[operator], \"\\n\\n\").concat(_res);\n if (_res.length > 1024) _res = \"\".concat(_res.slice(0, 1021), \"...\");\n } else {\n other = \"\".concat($9a474b7dcd09c5ab$var$inspectValue(expected));\n if (_res.length > 512) _res = \"\".concat(_res.slice(0, 509), \"...\");\n if (other.length > 512) other = \"\".concat(other.slice(0, 509), \"...\");\n if (operator === \"deepEqual\" || operator === \"equal\") _res = \"\".concat(knownOperators, \"\\n\\n\").concat(_res, \"\\n\\nshould equal\\n\\n\");\n else other = \" \".concat(operator, \" \").concat(other);\n }\n _this = _super.call(this, \"\".concat(_res).concat(other));\n }\n }\n Error.stackTraceLimit = limit;\n _this.generatedMessage = !message;\n Object.defineProperty($9a474b7dcd09c5ab$var$_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: false,\n writable: true,\n configurable: true\n });\n _this.code = \"ERR_ASSERTION\";\n _this.actual = actual;\n _this.expected = expected;\n _this.operator = operator;\n if (Error.captureStackTrace) // eslint-disable-next-line no-restricted-syntax\n Error.captureStackTrace($9a474b7dcd09c5ab$var$_assertThisInitialized(_this), stackStartFn);\n // Create error message including the error code in the name.\n _this.stack;\n // Reset the name.\n _this.name = \"AssertionError\";\n return $9a474b7dcd09c5ab$var$_possibleConstructorReturn(_this);\n }\n $9a474b7dcd09c5ab$var$_createClass(AssertionError, [\n {\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: _inspect$custom,\n value: function value(recurseTimes, ctx) {\n // This limits the `actual` and `expected` property default inspection to\n // the minimum depth. Otherwise those values would be too verbose compared\n // to the actual error message which contains a combined view of these two\n // input values.\n return $9a474b7dcd09c5ab$var$inspect(this, $9a474b7dcd09c5ab$var$_objectSpread($9a474b7dcd09c5ab$var$_objectSpread({}, ctx), {}, {\n customInspect: false,\n depth: 0\n }));\n }\n }\n ]);\n return AssertionError;\n}(/*#__PURE__*/ $9a474b7dcd09c5ab$var$_wrapNativeSuper(Error), $9a474b7dcd09c5ab$var$inspect.custom);\nmodule.exports = $9a474b7dcd09c5ab$var$AssertionError;\n\n});\n\nparcelRegister(\"5AA81\", function(module, exports) {\n\"use strict\";\n\nvar $4pa7q = parcelRequire(\"4pa7q\");\nvar $411c56e62e13ea6c$var$lacksProperEnumerationOrder = function() {\n if (!Object.assign) return false;\n /*\n\t * v8, specifically in node 4.x, has a bug with incorrect property enumeration order\n\t * note: this does not detect the bug unless there's 20 characters\n\t */ var str = \"abcdefghijklmnopqrst\";\n var letters = str.split(\"\");\n var map = {};\n for(var i = 0; i < letters.length; ++i)map[letters[i]] = letters[i];\n var obj = Object.assign({}, map);\n var actual = \"\";\n for(var k in obj)actual += k;\n return str !== actual;\n};\nvar $411c56e62e13ea6c$var$assignHasPendingExceptions = function() {\n if (!Object.assign || !Object.preventExtensions) return false;\n /*\n\t * Firefox 37 still has \"pending exception\" logic in its Object.assign implementation,\n\t * which is 72% slower than our shim, and Firefox 40's native implementation.\n\t */ var thrower = Object.preventExtensions({\n 1: 2\n });\n try {\n Object.assign(thrower, \"xy\");\n } catch (e) {\n return thrower[1] === \"y\";\n }\n return false;\n};\nmodule.exports = function getPolyfill() {\n if (!Object.assign) return $4pa7q;\n if ($411c56e62e13ea6c$var$lacksProperEnumerationOrder()) return $4pa7q;\n if ($411c56e62e13ea6c$var$assignHasPendingExceptions()) return $4pa7q;\n return Object.assign;\n};\n\n});\nparcelRegister(\"4pa7q\", function(module, exports) {\n\"use strict\";\n\nvar $dOa0R = parcelRequire(\"dOa0R\");\n\nvar $3351589ec22f2476$var$hasSymbols = (parcelRequire(\"iswqS\"))();\n\nvar $9rEHq = parcelRequire(\"9rEHq\");\nvar $3351589ec22f2476$var$toObject = Object;\nvar $3351589ec22f2476$var$$push = $9rEHq(\"Array.prototype.push\");\nvar $3351589ec22f2476$var$$propIsEnumerable = $9rEHq(\"Object.prototype.propertyIsEnumerable\");\nvar $3351589ec22f2476$var$originalGetSymbols = $3351589ec22f2476$var$hasSymbols ? Object.getOwnPropertySymbols : null;\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function assign(target, source1) {\n if (target == null) throw new TypeError(\"target must be an object\");\n var to = $3351589ec22f2476$var$toObject(target); // step 1\n if (arguments.length === 1) return to; // step 2\n for(var s = 1; s < arguments.length; ++s){\n var from = $3351589ec22f2476$var$toObject(arguments[s]); // step 3.a.i\n // step 3.a.ii:\n var keys = $dOa0R(from);\n var getSymbols = $3351589ec22f2476$var$hasSymbols && (Object.getOwnPropertySymbols || $3351589ec22f2476$var$originalGetSymbols);\n if (getSymbols) {\n var syms = getSymbols(from);\n for(var j = 0; j < syms.length; ++j){\n var key = syms[j];\n if ($3351589ec22f2476$var$$propIsEnumerable(from, key)) $3351589ec22f2476$var$$push(keys, key);\n }\n }\n // step 3.a.iii:\n for(var i = 0; i < keys.length; ++i){\n var nextKey = keys[i];\n if ($3351589ec22f2476$var$$propIsEnumerable(from, nextKey)) {\n var propValue = from[nextKey]; // step 3.a.iii.2.a\n to[nextKey] = propValue; // step 3.a.iii.2.b\n }\n }\n }\n return to; // step 4\n};\n\n});\nparcelRegister(\"dOa0R\", function(module, exports) {\n\"use strict\";\nvar $a0d7b63dfc6f5323$var$slice = Array.prototype.slice;\n\nvar $1ie2q = parcelRequire(\"1ie2q\");\nvar $a0d7b63dfc6f5323$var$origKeys = Object.keys;\n\nvar $a0d7b63dfc6f5323$var$keysShim = $a0d7b63dfc6f5323$var$origKeys ? function keys(o) {\n return $a0d7b63dfc6f5323$var$origKeys(o);\n} : (parcelRequire(\"1utM5\"));\nvar $a0d7b63dfc6f5323$var$originalKeys = Object.keys;\n$a0d7b63dfc6f5323$var$keysShim.shim = function shimObjectKeys() {\n if (Object.keys) {\n var keysWorksWithArguments = function() {\n // Safari 5.0 bug\n var args = Object.keys(arguments);\n return args && args.length === arguments.length;\n }(1, 2);\n if (!keysWorksWithArguments) Object.keys = function keys(object) {\n if ($1ie2q(object)) return $a0d7b63dfc6f5323$var$originalKeys($a0d7b63dfc6f5323$var$slice.call(object));\n return $a0d7b63dfc6f5323$var$originalKeys(object);\n };\n } else Object.keys = $a0d7b63dfc6f5323$var$keysShim;\n return Object.keys || $a0d7b63dfc6f5323$var$keysShim;\n};\nmodule.exports = $a0d7b63dfc6f5323$var$keysShim;\n\n});\nparcelRegister(\"1ie2q\", function(module, exports) {\n\"use strict\";\nvar $0f125c9239cfced8$var$toStr = Object.prototype.toString;\nmodule.exports = function isArguments(value) {\n var str = $0f125c9239cfced8$var$toStr.call(value);\n var isArgs = str === \"[object Arguments]\";\n if (!isArgs) isArgs = str !== \"[object Array]\" && value !== null && typeof value === \"object\" && typeof value.length === \"number\" && value.length >= 0 && $0f125c9239cfced8$var$toStr.call(value.callee) === \"[object Function]\";\n return isArgs;\n};\n\n});\n\nparcelRegister(\"1utM5\", function(module, exports) {\n\"use strict\";\nvar $115fb06b4e6cce1c$var$keysShim;\n\nif (!Object.keys) {\n // modified from https://github.com/es-shims/es5-shim\n var $115fb06b4e6cce1c$var$has = Object.prototype.hasOwnProperty;\n var $115fb06b4e6cce1c$var$toStr = Object.prototype.toString;\n var $115fb06b4e6cce1c$var$isArgs = (parcelRequire(\"1ie2q\")); // eslint-disable-line global-require\n var $115fb06b4e6cce1c$var$isEnumerable = Object.prototype.propertyIsEnumerable;\n var $115fb06b4e6cce1c$var$hasDontEnumBug = !$115fb06b4e6cce1c$var$isEnumerable.call({\n toString: null\n }, \"toString\");\n var $115fb06b4e6cce1c$var$hasProtoEnumBug = $115fb06b4e6cce1c$var$isEnumerable.call(function() {}, \"prototype\");\n var $115fb06b4e6cce1c$var$dontEnums = [\n \"toString\",\n \"toLocaleString\",\n \"valueOf\",\n \"hasOwnProperty\",\n \"isPrototypeOf\",\n \"propertyIsEnumerable\",\n \"constructor\"\n ];\n var $115fb06b4e6cce1c$var$equalsConstructorPrototype = function(o) {\n var ctor = o.constructor;\n return ctor && ctor.prototype === o;\n };\n var $115fb06b4e6cce1c$var$excludedKeys = {\n $applicationCache: true,\n $console: true,\n $external: true,\n $frame: true,\n $frameElement: true,\n $frames: true,\n $innerHeight: true,\n $innerWidth: true,\n $onmozfullscreenchange: true,\n $onmozfullscreenerror: true,\n $outerHeight: true,\n $outerWidth: true,\n $pageXOffset: true,\n $pageYOffset: true,\n $parent: true,\n $scrollLeft: true,\n $scrollTop: true,\n $scrollX: true,\n $scrollY: true,\n $self: true,\n $webkitIndexedDB: true,\n $webkitStorageInfo: true,\n $window: true\n };\n var $115fb06b4e6cce1c$var$hasAutomationEqualityBug = function() {\n /* global window */ if (typeof window === \"undefined\") return false;\n for(var k in window)try {\n if (!$115fb06b4e6cce1c$var$excludedKeys[\"$\" + k] && $115fb06b4e6cce1c$var$has.call(window, k) && window[k] !== null && typeof window[k] === \"object\") try {\n $115fb06b4e6cce1c$var$equalsConstructorPrototype(window[k]);\n } catch (e) {\n return true;\n }\n } catch (e) {\n return true;\n }\n return false;\n }();\n var $115fb06b4e6cce1c$var$equalsConstructorPrototypeIfNotBuggy = function(o) {\n /* global window */ if (typeof window === \"undefined\" || !$115fb06b4e6cce1c$var$hasAutomationEqualityBug) return $115fb06b4e6cce1c$var$equalsConstructorPrototype(o);\n try {\n return $115fb06b4e6cce1c$var$equalsConstructorPrototype(o);\n } catch (e) {\n return false;\n }\n };\n $115fb06b4e6cce1c$var$keysShim = function keys(object) {\n var isObject = object !== null && typeof object === \"object\";\n var isFunction = $115fb06b4e6cce1c$var$toStr.call(object) === \"[object Function]\";\n var isArguments = $115fb06b4e6cce1c$var$isArgs(object);\n var isString = isObject && $115fb06b4e6cce1c$var$toStr.call(object) === \"[object String]\";\n var theKeys = [];\n if (!isObject && !isFunction && !isArguments) throw new TypeError(\"Object.keys called on a non-object\");\n var skipProto = $115fb06b4e6cce1c$var$hasProtoEnumBug && isFunction;\n if (isString && object.length > 0 && !$115fb06b4e6cce1c$var$has.call(object, 0)) for(var i = 0; i < object.length; ++i)theKeys.push(String(i));\n if (isArguments && object.length > 0) for(var j = 0; j < object.length; ++j)theKeys.push(String(j));\n else {\n for(var name in object)if (!(skipProto && name === \"prototype\") && $115fb06b4e6cce1c$var$has.call(object, name)) theKeys.push(String(name));\n }\n if ($115fb06b4e6cce1c$var$hasDontEnumBug) {\n var skipConstructor = $115fb06b4e6cce1c$var$equalsConstructorPrototypeIfNotBuggy(object);\n for(var k = 0; k < $115fb06b4e6cce1c$var$dontEnums.length; ++k)if (!(skipConstructor && $115fb06b4e6cce1c$var$dontEnums[k] === \"constructor\") && $115fb06b4e6cce1c$var$has.call(object, $115fb06b4e6cce1c$var$dontEnums[k])) theKeys.push($115fb06b4e6cce1c$var$dontEnums[k]);\n }\n return theKeys;\n };\n}\nmodule.exports = $115fb06b4e6cce1c$var$keysShim;\n\n});\n\n\n\n\nparcelRegister(\"2bLwM\", function(module, exports) {\n\"use strict\";\n\nvar $hcnrk = parcelRequire(\"hcnrk\");\nmodule.exports = function getPolyfill() {\n return typeof Object.is === \"function\" ? Object.is : $hcnrk;\n};\n\n});\nparcelRegister(\"hcnrk\", function(module, exports) {\n\"use strict\";\nvar $c855bd4e3973b6ef$var$numberIsNaN = function(value) {\n return value !== value;\n};\nmodule.exports = function is(a, b) {\n if (a === 0 && b === 0) return 1 / a === 1 / b;\n if (a === b) return true;\n if ($c855bd4e3973b6ef$var$numberIsNaN(a) && $c855bd4e3973b6ef$var$numberIsNaN(b)) return true;\n return false;\n};\n\n});\n\n\nparcelRegister(\"gz1S4\", function(module, exports) {\n// Currently in sync with Node.js lib/internal/util/comparisons.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\"use strict\";\nfunction $c0f15dcd943db777$var$_slicedToArray(arr, i) {\n return $c0f15dcd943db777$var$_arrayWithHoles(arr) || $c0f15dcd943db777$var$_iterableToArrayLimit(arr, i) || $c0f15dcd943db777$var$_unsupportedIterableToArray(arr, i) || $c0f15dcd943db777$var$_nonIterableRest();\n}\nfunction $c0f15dcd943db777$var$_nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction $c0f15dcd943db777$var$_unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return $c0f15dcd943db777$var$_arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $c0f15dcd943db777$var$_arrayLikeToArray(o, minLen);\n}\nfunction $c0f15dcd943db777$var$_arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction $c0f15dcd943db777$var$_iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e, n, i, u, a = [], f = !0, o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for(; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally{\n try {\n if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n } finally{\n if (o) throw n;\n }\n }\n return a;\n }\n}\nfunction $c0f15dcd943db777$var$_arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction $c0f15dcd943db777$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $c0f15dcd943db777$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $c0f15dcd943db777$var$_typeof(o);\n}\nvar $c0f15dcd943db777$var$regexFlagsSupported = /a/g.flags !== undefined;\nvar $c0f15dcd943db777$var$arrayFromSet = function arrayFromSet(set) {\n var array = [];\n set.forEach(function(value) {\n return array.push(value);\n });\n return array;\n};\nvar $c0f15dcd943db777$var$arrayFromMap = function arrayFromMap(map) {\n var array = [];\n map.forEach(function(value, key) {\n return array.push([\n key,\n value\n ]);\n });\n return array;\n};\n\nvar $c0f15dcd943db777$var$objectIs = Object.is ? Object.is : (parcelRequire(\"dDNGE\"));\nvar $c0f15dcd943db777$var$objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function() {\n return [];\n};\n\nvar $c0f15dcd943db777$var$numberIsNaN = Number.isNaN ? Number.isNaN : (parcelRequire(\"3rh8v\"));\nfunction $c0f15dcd943db777$var$uncurryThis(f) {\n return f.call.bind(f);\n}\nvar $c0f15dcd943db777$var$hasOwnProperty = $c0f15dcd943db777$var$uncurryThis(Object.prototype.hasOwnProperty);\nvar $c0f15dcd943db777$var$propertyIsEnumerable = $c0f15dcd943db777$var$uncurryThis(Object.prototype.propertyIsEnumerable);\nvar $c0f15dcd943db777$var$objectToString = $c0f15dcd943db777$var$uncurryThis(Object.prototype.toString);\n\nvar $5d0kT = parcelRequire(\"5d0kT\");\nvar $c0f15dcd943db777$require$_require$types = $5d0kT.types;\nvar $c0f15dcd943db777$var$isAnyArrayBuffer = $c0f15dcd943db777$require$_require$types.isAnyArrayBuffer, $c0f15dcd943db777$var$isArrayBufferView = $c0f15dcd943db777$require$_require$types.isArrayBufferView, $c0f15dcd943db777$var$isDate = $c0f15dcd943db777$require$_require$types.isDate, $c0f15dcd943db777$var$isMap = $c0f15dcd943db777$require$_require$types.isMap, $c0f15dcd943db777$var$isRegExp = $c0f15dcd943db777$require$_require$types.isRegExp, $c0f15dcd943db777$var$isSet = $c0f15dcd943db777$require$_require$types.isSet, $c0f15dcd943db777$var$isNativeError = $c0f15dcd943db777$require$_require$types.isNativeError, $c0f15dcd943db777$var$isBoxedPrimitive = $c0f15dcd943db777$require$_require$types.isBoxedPrimitive, $c0f15dcd943db777$var$isNumberObject = $c0f15dcd943db777$require$_require$types.isNumberObject, $c0f15dcd943db777$var$isStringObject = $c0f15dcd943db777$require$_require$types.isStringObject, $c0f15dcd943db777$var$isBooleanObject = $c0f15dcd943db777$require$_require$types.isBooleanObject, $c0f15dcd943db777$var$isBigIntObject = $c0f15dcd943db777$require$_require$types.isBigIntObject, $c0f15dcd943db777$var$isSymbolObject = $c0f15dcd943db777$require$_require$types.isSymbolObject, $c0f15dcd943db777$var$isFloat32Array = $c0f15dcd943db777$require$_require$types.isFloat32Array, $c0f15dcd943db777$var$isFloat64Array = $c0f15dcd943db777$require$_require$types.isFloat64Array;\nfunction $c0f15dcd943db777$var$isNonIndex(key) {\n if (key.length === 0 || key.length > 10) return true;\n for(var i = 0; i < key.length; i++){\n var code = key.charCodeAt(i);\n if (code < 48 || code > 57) return true;\n }\n // The maximum size for an array is 2 ** 32 -1.\n return key.length === 10 && key >= Math.pow(2, 32);\n}\nfunction $c0f15dcd943db777$var$getOwnNonIndexProperties(value) {\n return Object.keys(value).filter($c0f15dcd943db777$var$isNonIndex).concat($c0f15dcd943db777$var$objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));\n}\n// Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */ function $c0f15dcd943db777$var$compare(a, b) {\n if (a === b) return 0;\n var x = a.length;\n var y = b.length;\n for(var i = 0, len = Math.min(x, y); i < len; ++i)if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n}\nvar $c0f15dcd943db777$var$ONLY_ENUMERABLE = undefined;\nvar $c0f15dcd943db777$var$kStrict = true;\nvar $c0f15dcd943db777$var$kLoose = false;\nvar $c0f15dcd943db777$var$kNoIterator = 0;\nvar $c0f15dcd943db777$var$kIsArray = 1;\nvar $c0f15dcd943db777$var$kIsSet = 2;\nvar $c0f15dcd943db777$var$kIsMap = 3;\n// Check if they have the same source and flags\nfunction $c0f15dcd943db777$var$areSimilarRegExps(a, b) {\n return $c0f15dcd943db777$var$regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);\n}\nfunction $c0f15dcd943db777$var$areSimilarFloatArrays(a, b) {\n if (a.byteLength !== b.byteLength) return false;\n for(var offset = 0; offset < a.byteLength; offset++){\n if (a[offset] !== b[offset]) return false;\n }\n return true;\n}\nfunction $c0f15dcd943db777$var$areSimilarTypedArrays(a, b) {\n if (a.byteLength !== b.byteLength) return false;\n return $c0f15dcd943db777$var$compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;\n}\nfunction $c0f15dcd943db777$var$areEqualArrayBuffers(buf1, buf2) {\n return buf1.byteLength === buf2.byteLength && $c0f15dcd943db777$var$compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;\n}\nfunction $c0f15dcd943db777$var$isEqualBoxedPrimitive(val1, val2) {\n if ($c0f15dcd943db777$var$isNumberObject(val1)) return $c0f15dcd943db777$var$isNumberObject(val2) && $c0f15dcd943db777$var$objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));\n if ($c0f15dcd943db777$var$isStringObject(val1)) return $c0f15dcd943db777$var$isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);\n if ($c0f15dcd943db777$var$isBooleanObject(val1)) return $c0f15dcd943db777$var$isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);\n if ($c0f15dcd943db777$var$isBigIntObject(val1)) return $c0f15dcd943db777$var$isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);\n return $c0f15dcd943db777$var$isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);\n}\n// Notes: Type tags are historical [[Class]] properties that can be set by\n// FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS\n// and retrieved using Object.prototype.toString.call(obj) in JS\n// See https://tc39.github.io/ecma262/#sec-object.prototype.tostring\n// for a list of tags pre-defined in the spec.\n// There are some unspecified tags in the wild too (e.g. typed array tags).\n// Since tags can be altered, they only serve fast failures\n//\n// Typed arrays and buffers are checked by comparing the content in their\n// underlying ArrayBuffer. This optimization requires that it's\n// reasonable to interpret their underlying memory in the same way,\n// which is checked by comparing their type tags.\n// (e.g. a Uint8Array and a Uint16Array with the same memory content\n// could still be different because they will be interpreted differently).\n//\n// For strict comparison, objects should have\n// a) The same built-in type tags\n// b) The same prototypes.\nfunction $c0f15dcd943db777$var$innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? $c0f15dcd943db777$var$objectIs(val1, val2) : true;\n }\n // Check more closely if val1 and val2 are equal.\n if (strict) {\n if ($c0f15dcd943db777$var$_typeof(val1) !== \"object\") return typeof val1 === \"number\" && $c0f15dcd943db777$var$numberIsNaN(val1) && $c0f15dcd943db777$var$numberIsNaN(val2);\n if ($c0f15dcd943db777$var$_typeof(val2) !== \"object\" || val1 === null || val2 === null) return false;\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) return false;\n } else {\n if (val1 === null || $c0f15dcd943db777$var$_typeof(val1) !== \"object\") {\n if (val2 === null || $c0f15dcd943db777$var$_typeof(val2) !== \"object\") // eslint-disable-next-line eqeqeq\n return val1 == val2;\n return false;\n }\n if (val2 === null || $c0f15dcd943db777$var$_typeof(val2) !== \"object\") return false;\n }\n var val1Tag = $c0f15dcd943db777$var$objectToString(val1);\n var val2Tag = $c0f15dcd943db777$var$objectToString(val2);\n if (val1Tag !== val2Tag) return false;\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) return false;\n var keys1 = $c0f15dcd943db777$var$getOwnNonIndexProperties(val1, $c0f15dcd943db777$var$ONLY_ENUMERABLE);\n var keys2 = $c0f15dcd943db777$var$getOwnNonIndexProperties(val2, $c0f15dcd943db777$var$ONLY_ENUMERABLE);\n if (keys1.length !== keys2.length) return false;\n return $c0f15dcd943db777$var$keyCheck(val1, val2, strict, memos, $c0f15dcd943db777$var$kIsArray, keys1);\n }\n // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n if (val1Tag === \"[object Object]\") {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!$c0f15dcd943db777$var$isMap(val1) && $c0f15dcd943db777$var$isMap(val2) || !$c0f15dcd943db777$var$isSet(val1) && $c0f15dcd943db777$var$isSet(val2)) return false;\n }\n if ($c0f15dcd943db777$var$isDate(val1)) {\n if (!$c0f15dcd943db777$var$isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) return false;\n } else if ($c0f15dcd943db777$var$isRegExp(val1)) {\n if (!$c0f15dcd943db777$var$isRegExp(val2) || !$c0f15dcd943db777$var$areSimilarRegExps(val1, val2)) return false;\n } else if ($c0f15dcd943db777$var$isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) return false;\n } else if ($c0f15dcd943db777$var$isArrayBufferView(val1)) {\n if (!strict && ($c0f15dcd943db777$var$isFloat32Array(val1) || $c0f15dcd943db777$var$isFloat64Array(val1))) {\n if (!$c0f15dcd943db777$var$areSimilarFloatArrays(val1, val2)) return false;\n } else if (!$c0f15dcd943db777$var$areSimilarTypedArrays(val1, val2)) return false;\n // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n var _keys = $c0f15dcd943db777$var$getOwnNonIndexProperties(val1, $c0f15dcd943db777$var$ONLY_ENUMERABLE);\n var _keys2 = $c0f15dcd943db777$var$getOwnNonIndexProperties(val2, $c0f15dcd943db777$var$ONLY_ENUMERABLE);\n if (_keys.length !== _keys2.length) return false;\n return $c0f15dcd943db777$var$keyCheck(val1, val2, strict, memos, $c0f15dcd943db777$var$kNoIterator, _keys);\n } else if ($c0f15dcd943db777$var$isSet(val1)) {\n if (!$c0f15dcd943db777$var$isSet(val2) || val1.size !== val2.size) return false;\n return $c0f15dcd943db777$var$keyCheck(val1, val2, strict, memos, $c0f15dcd943db777$var$kIsSet);\n } else if ($c0f15dcd943db777$var$isMap(val1)) {\n if (!$c0f15dcd943db777$var$isMap(val2) || val1.size !== val2.size) return false;\n return $c0f15dcd943db777$var$keyCheck(val1, val2, strict, memos, $c0f15dcd943db777$var$kIsMap);\n } else if ($c0f15dcd943db777$var$isAnyArrayBuffer(val1)) {\n if (!$c0f15dcd943db777$var$areEqualArrayBuffers(val1, val2)) return false;\n } else if ($c0f15dcd943db777$var$isBoxedPrimitive(val1) && !$c0f15dcd943db777$var$isEqualBoxedPrimitive(val1, val2)) return false;\n return $c0f15dcd943db777$var$keyCheck(val1, val2, strict, memos, $c0f15dcd943db777$var$kNoIterator);\n}\nfunction $c0f15dcd943db777$var$getEnumerables(val, keys) {\n return keys.filter(function(k) {\n return $c0f15dcd943db777$var$propertyIsEnumerable(val, k);\n });\n}\nfunction $c0f15dcd943db777$var$keyCheck(val1, val2, strict, memos, iterationType, aKeys) {\n // For all remaining Object pairs, including Array, objects and Maps,\n // equivalence is determined by having:\n // a) The same number of owned enumerable properties\n // b) The same set of keys/indexes (although not necessarily the same order)\n // c) Equivalent values for every corresponding key/index\n // d) For Sets and Maps, equal contents\n // Note: this accounts for both named and indexed properties on Arrays.\n if (arguments.length === 5) {\n aKeys = Object.keys(val1);\n var bKeys = Object.keys(val2);\n // The pair must have the same number of owned properties.\n if (aKeys.length !== bKeys.length) return false;\n }\n // Cheap key test\n var i = 0;\n for(; i < aKeys.length; i++){\n if (!$c0f15dcd943db777$var$hasOwnProperty(val2, aKeys[i])) return false;\n }\n if (strict && arguments.length === 5) {\n var symbolKeysA = $c0f15dcd943db777$var$objectGetOwnPropertySymbols(val1);\n if (symbolKeysA.length !== 0) {\n var count = 0;\n for(i = 0; i < symbolKeysA.length; i++){\n var key = symbolKeysA[i];\n if ($c0f15dcd943db777$var$propertyIsEnumerable(val1, key)) {\n if (!$c0f15dcd943db777$var$propertyIsEnumerable(val2, key)) return false;\n aKeys.push(key);\n count++;\n } else if ($c0f15dcd943db777$var$propertyIsEnumerable(val2, key)) return false;\n }\n var symbolKeysB = $c0f15dcd943db777$var$objectGetOwnPropertySymbols(val2);\n if (symbolKeysA.length !== symbolKeysB.length && $c0f15dcd943db777$var$getEnumerables(val2, symbolKeysB).length !== count) return false;\n } else {\n var _symbolKeysB = $c0f15dcd943db777$var$objectGetOwnPropertySymbols(val2);\n if (_symbolKeysB.length !== 0 && $c0f15dcd943db777$var$getEnumerables(val2, _symbolKeysB).length !== 0) return false;\n }\n }\n if (aKeys.length === 0 && (iterationType === $c0f15dcd943db777$var$kNoIterator || iterationType === $c0f15dcd943db777$var$kIsArray && val1.length === 0 || val1.size === 0)) return true;\n // Use memos to handle cycles.\n if (memos === undefined) memos = {\n val1: new Map(),\n val2: new Map(),\n position: 0\n };\n else {\n // We prevent up to two map.has(x) calls by directly retrieving the value\n // and checking for undefined. The map can only contain numbers, so it is\n // safe to check for undefined only.\n var val2MemoA = memos.val1.get(val1);\n if (val2MemoA !== undefined) {\n var val2MemoB = memos.val2.get(val2);\n if (val2MemoB !== undefined) return val2MemoA === val2MemoB;\n }\n memos.position++;\n }\n memos.val1.set(val1, memos.position);\n memos.val2.set(val2, memos.position);\n var areEq = $c0f15dcd943db777$var$objEquiv(val1, val2, strict, aKeys, memos, iterationType);\n memos.val1.delete(val1);\n memos.val2.delete(val2);\n return areEq;\n}\nfunction $c0f15dcd943db777$var$setHasEqualElement(set, val1, strict, memo) {\n // Go looking.\n var setValues = $c0f15dcd943db777$var$arrayFromSet(set);\n for(var i = 0; i < setValues.length; i++){\n var val2 = setValues[i];\n if ($c0f15dcd943db777$var$innerDeepEqual(val1, val2, strict, memo)) {\n // Remove the matching element to make sure we do not check that again.\n set.delete(val2);\n return true;\n }\n }\n return false;\n}\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using\n// Sadly it is not possible to detect corresponding values properly in case the\n// type is a string, number, bigint or boolean. The reason is that those values\n// can match lots of different string values (e.g., 1n == '+00001').\nfunction $c0f15dcd943db777$var$findLooseMatchingPrimitives(prim) {\n switch($c0f15dcd943db777$var$_typeof(prim)){\n case \"undefined\":\n return null;\n case \"object\":\n // Only pass in null as object!\n return undefined;\n case \"symbol\":\n return false;\n case \"string\":\n prim = +prim;\n // Loose equal entries exist only if the string is possible to convert to\n // a regular number and not NaN.\n // Fall through\n case \"number\":\n if ($c0f15dcd943db777$var$numberIsNaN(prim)) return false;\n }\n return true;\n}\nfunction $c0f15dcd943db777$var$setMightHaveLoosePrim(a, b, prim) {\n var altValue = $c0f15dcd943db777$var$findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n return b.has(altValue) && !a.has(altValue);\n}\nfunction $c0f15dcd943db777$var$mapMightHaveLoosePrim(a, b, prim, item, memo) {\n var altValue = $c0f15dcd943db777$var$findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n var curB = b.get(altValue);\n if (curB === undefined && !b.has(altValue) || !$c0f15dcd943db777$var$innerDeepEqual(item, curB, false, memo)) return false;\n return !a.has(altValue) && $c0f15dcd943db777$var$innerDeepEqual(item, curB, false, memo);\n}\nfunction $c0f15dcd943db777$var$setEquiv(a, b, strict, memo) {\n // This is a lazily initiated Set of entries which have to be compared\n // pairwise.\n var set = null;\n var aValues = $c0f15dcd943db777$var$arrayFromSet(a);\n for(var i = 0; i < aValues.length; i++){\n var val = aValues[i];\n // Note: Checking for the objects first improves the performance for object\n // heavy sets but it is a minor slow down for primitives. As they are fast\n // to check this improves the worst case scenario instead.\n if ($c0f15dcd943db777$var$_typeof(val) === \"object\" && val !== null) {\n if (set === null) set = new Set();\n // If the specified value doesn't exist in the second set its an not null\n // object (or non strict only: a not matching primitive) we'll need to go\n // hunting for something thats deep-(strict-)equal to it. To make this\n // O(n log n) complexity we have to copy these values in a new set first.\n set.add(val);\n } else if (!b.has(val)) {\n if (strict) return false;\n // Fast path to detect missing string, symbol, undefined and null values.\n if (!$c0f15dcd943db777$var$setMightHaveLoosePrim(a, b, val)) return false;\n if (set === null) set = new Set();\n set.add(val);\n }\n }\n if (set !== null) {\n var bValues = $c0f15dcd943db777$var$arrayFromSet(b);\n for(var _i = 0; _i < bValues.length; _i++){\n var _val = bValues[_i];\n // We have to check if a primitive value is already\n // matching and only if it's not, go hunting for it.\n if ($c0f15dcd943db777$var$_typeof(_val) === \"object\" && _val !== null) {\n if (!$c0f15dcd943db777$var$setHasEqualElement(set, _val, strict, memo)) return false;\n } else if (!strict && !a.has(_val) && !$c0f15dcd943db777$var$setHasEqualElement(set, _val, strict, memo)) return false;\n }\n return set.size === 0;\n }\n return true;\n}\nfunction $c0f15dcd943db777$var$mapHasEqualEntry(set, map, key1, item1, strict, memo) {\n // To be able to handle cases like:\n // Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']])\n // ... we need to consider *all* matching keys, not just the first we find.\n var setValues = $c0f15dcd943db777$var$arrayFromSet(set);\n for(var i = 0; i < setValues.length; i++){\n var key2 = setValues[i];\n if ($c0f15dcd943db777$var$innerDeepEqual(key1, key2, strict, memo) && $c0f15dcd943db777$var$innerDeepEqual(item1, map.get(key2), strict, memo)) {\n set.delete(key2);\n return true;\n }\n }\n return false;\n}\nfunction $c0f15dcd943db777$var$mapEquiv(a, b, strict, memo) {\n var set = null;\n var aEntries = $c0f15dcd943db777$var$arrayFromMap(a);\n for(var i = 0; i < aEntries.length; i++){\n var _aEntries$i = $c0f15dcd943db777$var$_slicedToArray(aEntries[i], 2), key = _aEntries$i[0], item1 = _aEntries$i[1];\n if ($c0f15dcd943db777$var$_typeof(key) === \"object\" && key !== null) {\n if (set === null) set = new Set();\n set.add(key);\n } else {\n // By directly retrieving the value we prevent another b.has(key) check in\n // almost all possible cases.\n var item2 = b.get(key);\n if (item2 === undefined && !b.has(key) || !$c0f15dcd943db777$var$innerDeepEqual(item1, item2, strict, memo)) {\n if (strict) return false;\n // Fast path to detect missing string, symbol, undefined and null\n // keys.\n if (!$c0f15dcd943db777$var$mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;\n if (set === null) set = new Set();\n set.add(key);\n }\n }\n }\n if (set !== null) {\n var bEntries = $c0f15dcd943db777$var$arrayFromMap(b);\n for(var _i2 = 0; _i2 < bEntries.length; _i2++){\n var _bEntries$_i = $c0f15dcd943db777$var$_slicedToArray(bEntries[_i2], 2), _key = _bEntries$_i[0], item = _bEntries$_i[1];\n if ($c0f15dcd943db777$var$_typeof(_key) === \"object\" && _key !== null) {\n if (!$c0f15dcd943db777$var$mapHasEqualEntry(set, a, _key, item, strict, memo)) return false;\n } else if (!strict && (!a.has(_key) || !$c0f15dcd943db777$var$innerDeepEqual(a.get(_key), item, false, memo)) && !$c0f15dcd943db777$var$mapHasEqualEntry(set, a, _key, item, false, memo)) return false;\n }\n return set.size === 0;\n }\n return true;\n}\nfunction $c0f15dcd943db777$var$objEquiv(a, b, strict, keys, memos, iterationType) {\n // Sets and maps don't have their entries accessible via normal object\n // properties.\n var i = 0;\n if (iterationType === $c0f15dcd943db777$var$kIsSet) {\n if (!$c0f15dcd943db777$var$setEquiv(a, b, strict, memos)) return false;\n } else if (iterationType === $c0f15dcd943db777$var$kIsMap) {\n if (!$c0f15dcd943db777$var$mapEquiv(a, b, strict, memos)) return false;\n } else if (iterationType === $c0f15dcd943db777$var$kIsArray) for(; i < a.length; i++){\n if ($c0f15dcd943db777$var$hasOwnProperty(a, i)) {\n if (!$c0f15dcd943db777$var$hasOwnProperty(b, i) || !$c0f15dcd943db777$var$innerDeepEqual(a[i], b[i], strict, memos)) return false;\n } else if ($c0f15dcd943db777$var$hasOwnProperty(b, i)) return false;\n else {\n // Array is sparse.\n var keysA = Object.keys(a);\n for(; i < keysA.length; i++){\n var key = keysA[i];\n if (!$c0f15dcd943db777$var$hasOwnProperty(b, key) || !$c0f15dcd943db777$var$innerDeepEqual(a[key], b[key], strict, memos)) return false;\n }\n if (keysA.length !== Object.keys(b).length) return false;\n return true;\n }\n }\n // The pair must have equivalent values for every corresponding key.\n // Possibly expensive deep test:\n for(i = 0; i < keys.length; i++){\n var _key2 = keys[i];\n if (!$c0f15dcd943db777$var$innerDeepEqual(a[_key2], b[_key2], strict, memos)) return false;\n }\n return true;\n}\nfunction $c0f15dcd943db777$var$isDeepEqual(val1, val2) {\n return $c0f15dcd943db777$var$innerDeepEqual(val1, val2, $c0f15dcd943db777$var$kLoose);\n}\nfunction $c0f15dcd943db777$var$isDeepStrictEqual(val1, val2) {\n return $c0f15dcd943db777$var$innerDeepEqual(val1, val2, $c0f15dcd943db777$var$kStrict);\n}\nmodule.exports = {\n isDeepEqual: $c0f15dcd943db777$var$isDeepEqual,\n isDeepStrictEqual: $c0f15dcd943db777$var$isDeepStrictEqual\n};\n\n});\nparcelRegister(\"dDNGE\", function(module, exports) {\n\"use strict\";\n\nvar $eh8QP = parcelRequire(\"eh8QP\");\n\nvar $6gXjj = parcelRequire(\"6gXjj\");\n\nvar $hcnrk = parcelRequire(\"hcnrk\");\n\nvar $2bLwM = parcelRequire(\"2bLwM\");\n\nvar $3QoWE = parcelRequire(\"3QoWE\");\nvar $9ee575a850970206$var$polyfill = $6gXjj($2bLwM(), Object);\n$eh8QP($9ee575a850970206$var$polyfill, {\n getPolyfill: $2bLwM,\n implementation: $hcnrk,\n shim: $3QoWE\n});\nmodule.exports = $9ee575a850970206$var$polyfill;\n\n});\nparcelRegister(\"eh8QP\", function(module, exports) {\n\"use strict\";\n\nvar $dOa0R = parcelRequire(\"dOa0R\");\nvar $a64984d95ac93f0f$var$hasSymbols = typeof Symbol === \"function\" && typeof Symbol(\"foo\") === \"symbol\";\nvar $a64984d95ac93f0f$var$toStr = Object.prototype.toString;\nvar $a64984d95ac93f0f$var$concat = Array.prototype.concat;\n\nvar $dEYu7 = parcelRequire(\"dEYu7\");\nvar $a64984d95ac93f0f$var$isFunction = function(fn) {\n return typeof fn === \"function\" && $a64984d95ac93f0f$var$toStr.call(fn) === \"[object Function]\";\n};\n\nvar $a64984d95ac93f0f$var$supportsDescriptors = (parcelRequire(\"gaPDk\"))();\nvar $a64984d95ac93f0f$var$defineProperty = function(object, name, value, predicate) {\n if (name in object) {\n if (predicate === true) {\n if (object[name] === value) return;\n } else if (!$a64984d95ac93f0f$var$isFunction(predicate) || !predicate()) return;\n }\n if ($a64984d95ac93f0f$var$supportsDescriptors) $dEYu7(object, name, value, true);\n else $dEYu7(object, name, value);\n};\nvar $a64984d95ac93f0f$var$defineProperties = function(object, map) {\n var predicates = arguments.length > 2 ? arguments[2] : {};\n var props = $dOa0R(map);\n if ($a64984d95ac93f0f$var$hasSymbols) props = $a64984d95ac93f0f$var$concat.call(props, Object.getOwnPropertySymbols(map));\n for(var i = 0; i < props.length; i += 1)$a64984d95ac93f0f$var$defineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n};\n$a64984d95ac93f0f$var$defineProperties.supportsDescriptors = !!$a64984d95ac93f0f$var$supportsDescriptors;\nmodule.exports = $a64984d95ac93f0f$var$defineProperties;\n\n});\n\nparcelRegister(\"3QoWE\", function(module, exports) {\n\"use strict\";\n\nvar $2bLwM = parcelRequire(\"2bLwM\");\n\nvar $eh8QP = parcelRequire(\"eh8QP\");\nmodule.exports = function shimObjectIs() {\n var polyfill = $2bLwM();\n $eh8QP(Object, {\n is: polyfill\n }, {\n is: function testObjectIs() {\n return Object.is !== polyfill;\n }\n });\n return polyfill;\n};\n\n});\n\n\nparcelRegister(\"3rh8v\", function(module, exports) {\n\"use strict\";\n\nvar $6gXjj = parcelRequire(\"6gXjj\");\n\nvar $eh8QP = parcelRequire(\"eh8QP\");\n\nvar $k6E7V = parcelRequire(\"k6E7V\");\n\nvar $8ZPJ8 = parcelRequire(\"8ZPJ8\");\n\nvar $gKbkx = parcelRequire(\"gKbkx\");\nvar $28112f95a033d6f5$var$polyfill = $6gXjj($8ZPJ8(), Number);\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ $eh8QP($28112f95a033d6f5$var$polyfill, {\n getPolyfill: $8ZPJ8,\n implementation: $k6E7V,\n shim: $gKbkx\n});\nmodule.exports = $28112f95a033d6f5$var$polyfill;\n\n});\nparcelRegister(\"k6E7V\", function(module, exports) {\n\"use strict\";\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function isNaN(value) {\n return value !== value;\n};\n\n});\n\nparcelRegister(\"8ZPJ8\", function(module, exports) {\n\"use strict\";\n\nvar $k6E7V = parcelRequire(\"k6E7V\");\nmodule.exports = function getPolyfill() {\n if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN(\"a\")) return Number.isNaN;\n return $k6E7V;\n};\n\n});\n\nparcelRegister(\"gKbkx\", function(module, exports) {\n\"use strict\";\n\nvar $eh8QP = parcelRequire(\"eh8QP\");\n\nvar $8ZPJ8 = parcelRequire(\"8ZPJ8\");\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function shimNumberIsNaN() {\n var polyfill = $8ZPJ8();\n $eh8QP(Number, {\n isNaN: polyfill\n }, {\n isNaN: function testIsNaN() {\n return Number.isNaN !== polyfill;\n }\n });\n return polyfill;\n};\n\n});\n\n\n\n\n\nvar $GE7rZ = parcelRequire(\"GE7rZ\");\n/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */ function $00f31ca755459a2b$export$1e71eb4bef00f6b0(obj, key, value) {\n if (key in obj) Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n else obj[key] = value;\n return obj;\n}\n\n\n/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */ /*!\n * @kurkle/color v0.3.2\n * https://github.com/kurkle/color#readme\n * (c) 2023 Jukka Kurkela\n * Released under the MIT License\n */ function $d892378a320191c0$export$2077e0241d6afd3c(v) {\n return v + 0.5 | 0;\n}\nconst $d892378a320191c0$export$837ba5c449269406 = (v, l, h)=>Math.max(Math.min(v, h), l);\nfunction $d892378a320191c0$export$bcc6e673dfa14d36(v) {\n return $d892378a320191c0$export$837ba5c449269406($d892378a320191c0$export$2077e0241d6afd3c(v * 2.55), 0, 255);\n}\nfunction $d892378a320191c0$export$869b26d4e1bbdb63(v) {\n return $d892378a320191c0$export$837ba5c449269406($d892378a320191c0$export$2077e0241d6afd3c(v / 2.55), 0, 100);\n}\nfunction $d892378a320191c0$export$ed9bd8dcaeba14f6(v) {\n return $d892378a320191c0$export$837ba5c449269406($d892378a320191c0$export$2077e0241d6afd3c(v * 255), 0, 255);\n}\nfunction $d892378a320191c0$export$dbf961a8d278dbef(v) {\n return $d892378a320191c0$export$837ba5c449269406($d892378a320191c0$export$2077e0241d6afd3c(v / 2.55) / 100, 0, 1);\n}\nfunction $d892378a320191c0$export$aa35ef1f24408ab9(v) {\n return $d892378a320191c0$export$837ba5c449269406($d892378a320191c0$export$2077e0241d6afd3c(v * 100), 0, 100);\n}\nconst $d892378a320191c0$var$map$1 = {\n 0: 0,\n 1: 1,\n 2: 2,\n 3: 3,\n 4: 4,\n 5: 5,\n 6: 6,\n 7: 7,\n 8: 8,\n 9: 9,\n A: 10,\n B: 11,\n C: 12,\n D: 13,\n E: 14,\n F: 15,\n a: 10,\n b: 11,\n c: 12,\n d: 13,\n e: 14,\n f: 15\n};\nconst $d892378a320191c0$var$hex = [\n ...\"0123456789ABCDEF\"\n];\nconst $d892378a320191c0$var$h1 = (b)=>$d892378a320191c0$var$hex[b & 0xF];\nconst $d892378a320191c0$var$h2 = (b)=>$d892378a320191c0$var$hex[(b & 0xF0) >> 4] + $d892378a320191c0$var$hex[b & 0xF];\nconst $d892378a320191c0$var$eq = (b)=>(b & 0xF0) >> 4 === (b & 0xF);\nconst $d892378a320191c0$var$isShort = (v)=>$d892378a320191c0$var$eq(v.r) && $d892378a320191c0$var$eq(v.g) && $d892378a320191c0$var$eq(v.b) && $d892378a320191c0$var$eq(v.a);\nfunction $d892378a320191c0$export$625a38b961e8b5e9(str) {\n var len = str.length;\n var ret;\n if (str[0] === \"#\") {\n if (len === 4 || len === 5) ret = {\n r: 255 & $d892378a320191c0$var$map$1[str[1]] * 17,\n g: 255 & $d892378a320191c0$var$map$1[str[2]] * 17,\n b: 255 & $d892378a320191c0$var$map$1[str[3]] * 17,\n a: len === 5 ? $d892378a320191c0$var$map$1[str[4]] * 17 : 255\n };\n else if (len === 7 || len === 9) ret = {\n r: $d892378a320191c0$var$map$1[str[1]] << 4 | $d892378a320191c0$var$map$1[str[2]],\n g: $d892378a320191c0$var$map$1[str[3]] << 4 | $d892378a320191c0$var$map$1[str[4]],\n b: $d892378a320191c0$var$map$1[str[5]] << 4 | $d892378a320191c0$var$map$1[str[6]],\n a: len === 9 ? $d892378a320191c0$var$map$1[str[7]] << 4 | $d892378a320191c0$var$map$1[str[8]] : 255\n };\n }\n return ret;\n}\nconst $d892378a320191c0$var$alpha = (a, f)=>a < 255 ? f(a) : \"\";\nfunction $d892378a320191c0$export$1b06654353ef9f67(v) {\n var f = $d892378a320191c0$var$isShort(v) ? $d892378a320191c0$var$h1 : $d892378a320191c0$var$h2;\n return v ? \"#\" + f(v.r) + f(v.g) + f(v.b) + $d892378a320191c0$var$alpha(v.a, f) : undefined;\n}\nconst $d892378a320191c0$var$HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction $d892378a320191c0$var$hsl2rgbn(h, s, l) {\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12)=>l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [\n f(0),\n f(8),\n f(4)\n ];\n}\nfunction $d892378a320191c0$var$hsv2rgbn(h, s, v) {\n const f = (n, k = (n + h / 60) % 6)=>v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n return [\n f(5),\n f(3),\n f(1)\n ];\n}\nfunction $d892378a320191c0$var$hwb2rgbn(h, w, b) {\n const rgb = $d892378a320191c0$var$hsl2rgbn(h, 1, 0.5);\n let i;\n if (w + b > 1) {\n i = 1 / (w + b);\n w *= i;\n b *= i;\n }\n for(i = 0; i < 3; i++){\n rgb[i] *= 1 - w - b;\n rgb[i] += w;\n }\n return rgb;\n}\nfunction $d892378a320191c0$var$hueValue(r, g, b, d, max) {\n if (r === max) return (g - b) / d + (g < b ? 6 : 0);\n if (g === max) return (b - r) / d + 2;\n return (r - g) / d + 4;\n}\nfunction $d892378a320191c0$export$b5ba70b240f8f7f(v) {\n const range = 255;\n const r = v.r / range;\n const g = v.g / range;\n const b = v.b / range;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s, d;\n if (max !== min) {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = $d892378a320191c0$var$hueValue(r, g, b, d, max);\n h = h * 60 + 0.5;\n }\n return [\n h | 0,\n s || 0,\n l\n ];\n}\nfunction $d892378a320191c0$var$calln(f, a, b, c) {\n return (Array.isArray(a) ? f(a[0], a[1], a[2]) : f(a, b, c)).map($d892378a320191c0$export$ed9bd8dcaeba14f6);\n}\nfunction $d892378a320191c0$export$4c15bd42559b811d(h, s, l) {\n return $d892378a320191c0$var$calln($d892378a320191c0$var$hsl2rgbn, h, s, l);\n}\nfunction $d892378a320191c0$export$e2710022c70fc9ee(h, w, b) {\n return $d892378a320191c0$var$calln($d892378a320191c0$var$hwb2rgbn, h, w, b);\n}\nfunction $d892378a320191c0$export$b785a357c84e4a04(h, s, v) {\n return $d892378a320191c0$var$calln($d892378a320191c0$var$hsv2rgbn, h, s, v);\n}\nfunction $d892378a320191c0$var$hue(h) {\n return (h % 360 + 360) % 360;\n}\nfunction $d892378a320191c0$export$5e91288c399be4f9(str) {\n const m = $d892378a320191c0$var$HUE_RE.exec(str);\n let a = 255;\n let v;\n if (!m) return;\n if (m[5] !== v) a = m[6] ? $d892378a320191c0$export$bcc6e673dfa14d36(+m[5]) : $d892378a320191c0$export$ed9bd8dcaeba14f6(+m[5]);\n const h = $d892378a320191c0$var$hue(+m[2]);\n const p1 = +m[3] / 100;\n const p2 = +m[4] / 100;\n if (m[1] === \"hwb\") v = $d892378a320191c0$export$e2710022c70fc9ee(h, p1, p2);\n else if (m[1] === \"hsv\") v = $d892378a320191c0$export$b785a357c84e4a04(h, p1, p2);\n else v = $d892378a320191c0$export$4c15bd42559b811d(h, p1, p2);\n return {\n r: v[0],\n g: v[1],\n b: v[2],\n a: a\n };\n}\nfunction $d892378a320191c0$export$bb628a54ab399bc9(v, deg) {\n var h = $d892378a320191c0$export$b5ba70b240f8f7f(v);\n h[0] = $d892378a320191c0$var$hue(h[0] + deg);\n h = $d892378a320191c0$export$4c15bd42559b811d(h);\n v.r = h[0];\n v.g = h[1];\n v.b = h[2];\n}\nfunction $d892378a320191c0$export$a197af1c58e6260c(v) {\n if (!v) return;\n const a = $d892378a320191c0$export$b5ba70b240f8f7f(v);\n const h = a[0];\n const s = $d892378a320191c0$export$aa35ef1f24408ab9(a[1]);\n const l = $d892378a320191c0$export$aa35ef1f24408ab9(a[2]);\n return v.a < 255 ? `hsla(${h}, ${s}%, ${l}%, ${$d892378a320191c0$export$dbf961a8d278dbef(v.a)})` : `hsl(${h}, ${s}%, ${l}%)`;\n}\nconst $d892378a320191c0$var$map = {\n x: \"dark\",\n Z: \"light\",\n Y: \"re\",\n X: \"blu\",\n W: \"gr\",\n V: \"medium\",\n U: \"slate\",\n A: \"ee\",\n T: \"ol\",\n S: \"or\",\n B: \"ra\",\n C: \"lateg\",\n D: \"ights\",\n R: \"in\",\n Q: \"turquois\",\n E: \"hi\",\n P: \"ro\",\n O: \"al\",\n N: \"le\",\n M: \"de\",\n L: \"yello\",\n F: \"en\",\n K: \"ch\",\n G: \"arks\",\n H: \"ea\",\n I: \"ightg\",\n J: \"wh\"\n};\nconst $d892378a320191c0$var$names$1 = {\n OiceXe: \"f0f8ff\",\n antiquewEte: \"faebd7\",\n aqua: \"ffff\",\n aquamarRe: \"7fffd4\",\n azuY: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"0\",\n blanKedOmond: \"ffebcd\",\n Xe: \"ff\",\n XeviTet: \"8a2be2\",\n bPwn: \"a52a2a\",\n burlywood: \"deb887\",\n caMtXe: \"5f9ea0\",\n KartYuse: \"7fff00\",\n KocTate: \"d2691e\",\n cSO: \"ff7f50\",\n cSnflowerXe: \"6495ed\",\n cSnsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"ffff\",\n xXe: \"8b\",\n xcyan: \"8b8b\",\n xgTMnPd: \"b8860b\",\n xWay: \"a9a9a9\",\n xgYF: \"6400\",\n xgYy: \"a9a9a9\",\n xkhaki: \"bdb76b\",\n xmagFta: \"8b008b\",\n xTivegYF: \"556b2f\",\n xSange: \"ff8c00\",\n xScEd: \"9932cc\",\n xYd: \"8b0000\",\n xsOmon: \"e9967a\",\n xsHgYF: \"8fbc8f\",\n xUXe: \"483d8b\",\n xUWay: \"2f4f4f\",\n xUgYy: \"2f4f4f\",\n xQe: \"ced1\",\n xviTet: \"9400d3\",\n dAppRk: \"ff1493\",\n dApskyXe: \"bfff\",\n dimWay: \"696969\",\n dimgYy: \"696969\",\n dodgerXe: \"1e90ff\",\n fiYbrick: \"b22222\",\n flSOwEte: \"fffaf0\",\n foYstWAn: \"228b22\",\n fuKsia: \"ff00ff\",\n gaRsbSo: \"dcdcdc\",\n ghostwEte: \"f8f8ff\",\n gTd: \"ffd700\",\n gTMnPd: \"daa520\",\n Way: \"808080\",\n gYF: \"8000\",\n gYFLw: \"adff2f\",\n gYy: \"808080\",\n honeyMw: \"f0fff0\",\n hotpRk: \"ff69b4\",\n RdianYd: \"cd5c5c\",\n Rdigo: \"4b0082\",\n ivSy: \"fffff0\",\n khaki: \"f0e68c\",\n lavFMr: \"e6e6fa\",\n lavFMrXsh: \"fff0f5\",\n lawngYF: \"7cfc00\",\n NmoncEffon: \"fffacd\",\n ZXe: \"add8e6\",\n ZcSO: \"f08080\",\n Zcyan: \"e0ffff\",\n ZgTMnPdLw: \"fafad2\",\n ZWay: \"d3d3d3\",\n ZgYF: \"90ee90\",\n ZgYy: \"d3d3d3\",\n ZpRk: \"ffb6c1\",\n ZsOmon: \"ffa07a\",\n ZsHgYF: \"20b2aa\",\n ZskyXe: \"87cefa\",\n ZUWay: \"778899\",\n ZUgYy: \"778899\",\n ZstAlXe: \"b0c4de\",\n ZLw: \"ffffe0\",\n lime: \"ff00\",\n limegYF: \"32cd32\",\n lRF: \"faf0e6\",\n magFta: \"ff00ff\",\n maPon: \"800000\",\n VaquamarRe: \"66cdaa\",\n VXe: \"cd\",\n VScEd: \"ba55d3\",\n VpurpN: \"9370db\",\n VsHgYF: \"3cb371\",\n VUXe: \"7b68ee\",\n VsprRggYF: \"fa9a\",\n VQe: \"48d1cc\",\n VviTetYd: \"c71585\",\n midnightXe: \"191970\",\n mRtcYam: \"f5fffa\",\n mistyPse: \"ffe4e1\",\n moccasR: \"ffe4b5\",\n navajowEte: \"ffdead\",\n navy: \"80\",\n Tdlace: \"fdf5e6\",\n Tive: \"808000\",\n TivedBb: \"6b8e23\",\n Sange: \"ffa500\",\n SangeYd: \"ff4500\",\n ScEd: \"da70d6\",\n pOegTMnPd: \"eee8aa\",\n pOegYF: \"98fb98\",\n pOeQe: \"afeeee\",\n pOeviTetYd: \"db7093\",\n papayawEp: \"ffefd5\",\n pHKpuff: \"ffdab9\",\n peru: \"cd853f\",\n pRk: \"ffc0cb\",\n plum: \"dda0dd\",\n powMrXe: \"b0e0e6\",\n purpN: \"800080\",\n YbeccapurpN: \"663399\",\n Yd: \"ff0000\",\n Psybrown: \"bc8f8f\",\n PyOXe: \"4169e1\",\n saddNbPwn: \"8b4513\",\n sOmon: \"fa8072\",\n sandybPwn: \"f4a460\",\n sHgYF: \"2e8b57\",\n sHshell: \"fff5ee\",\n siFna: \"a0522d\",\n silver: \"c0c0c0\",\n skyXe: \"87ceeb\",\n UXe: \"6a5acd\",\n UWay: \"708090\",\n UgYy: \"708090\",\n snow: \"fffafa\",\n sprRggYF: \"ff7f\",\n stAlXe: \"4682b4\",\n tan: \"d2b48c\",\n teO: \"8080\",\n tEstN: \"d8bfd8\",\n tomato: \"ff6347\",\n Qe: \"40e0d0\",\n viTet: \"ee82ee\",\n JHt: \"f5deb3\",\n wEte: \"ffffff\",\n wEtesmoke: \"f5f5f5\",\n Lw: \"ffff00\",\n LwgYF: \"9acd32\"\n};\nfunction $d892378a320191c0$var$unpack() {\n const unpacked = {};\n const keys = Object.keys($d892378a320191c0$var$names$1);\n const tkeys = Object.keys($d892378a320191c0$var$map);\n let i, j, k, ok, nk;\n for(i = 0; i < keys.length; i++){\n ok = nk = keys[i];\n for(j = 0; j < tkeys.length; j++){\n k = tkeys[j];\n nk = nk.replace(k, $d892378a320191c0$var$map[k]);\n }\n k = parseInt($d892378a320191c0$var$names$1[ok], 16);\n unpacked[nk] = [\n k >> 16 & 0xFF,\n k >> 8 & 0xFF,\n k & 0xFF\n ];\n }\n return unpacked;\n}\nlet $d892378a320191c0$var$names;\nfunction $d892378a320191c0$export$b2f06b640faad956(str) {\n if (!$d892378a320191c0$var$names) {\n $d892378a320191c0$var$names = $d892378a320191c0$var$unpack();\n $d892378a320191c0$var$names.transparent = [\n 0,\n 0,\n 0,\n 0\n ];\n }\n const a = $d892378a320191c0$var$names[str.toLowerCase()];\n return a && {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length === 4 ? a[3] : 255\n };\n}\nconst $d892378a320191c0$var$RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction $d892378a320191c0$export$91aedb20f296e541(str) {\n const m = $d892378a320191c0$var$RGB_RE.exec(str);\n let a = 255;\n let r, g, b;\n if (!m) return;\n if (m[7] !== r) {\n const v = +m[7];\n a = m[8] ? $d892378a320191c0$export$bcc6e673dfa14d36(v) : $d892378a320191c0$export$837ba5c449269406(v * 255, 0, 255);\n }\n r = +m[1];\n g = +m[3];\n b = +m[5];\n r = 255 & (m[2] ? $d892378a320191c0$export$bcc6e673dfa14d36(r) : $d892378a320191c0$export$837ba5c449269406(r, 0, 255));\n g = 255 & (m[4] ? $d892378a320191c0$export$bcc6e673dfa14d36(g) : $d892378a320191c0$export$837ba5c449269406(g, 0, 255));\n b = 255 & (m[6] ? $d892378a320191c0$export$bcc6e673dfa14d36(b) : $d892378a320191c0$export$837ba5c449269406(b, 0, 255));\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\nfunction $d892378a320191c0$export$9595423f22cf925a(v) {\n return v && (v.a < 255 ? `rgba(${v.r}, ${v.g}, ${v.b}, ${$d892378a320191c0$export$dbf961a8d278dbef(v.a)})` : `rgb(${v.r}, ${v.g}, ${v.b})`);\n}\nconst $d892378a320191c0$var$to = (v)=>v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst $d892378a320191c0$var$from = (v)=>v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction $d892378a320191c0$var$interpolate(rgb1, rgb2, t) {\n const r = $d892378a320191c0$var$from($d892378a320191c0$export$dbf961a8d278dbef(rgb1.r));\n const g = $d892378a320191c0$var$from($d892378a320191c0$export$dbf961a8d278dbef(rgb1.g));\n const b = $d892378a320191c0$var$from($d892378a320191c0$export$dbf961a8d278dbef(rgb1.b));\n return {\n r: $d892378a320191c0$export$ed9bd8dcaeba14f6($d892378a320191c0$var$to(r + t * ($d892378a320191c0$var$from($d892378a320191c0$export$dbf961a8d278dbef(rgb2.r)) - r))),\n g: $d892378a320191c0$export$ed9bd8dcaeba14f6($d892378a320191c0$var$to(g + t * ($d892378a320191c0$var$from($d892378a320191c0$export$dbf961a8d278dbef(rgb2.g)) - g))),\n b: $d892378a320191c0$export$ed9bd8dcaeba14f6($d892378a320191c0$var$to(b + t * ($d892378a320191c0$var$from($d892378a320191c0$export$dbf961a8d278dbef(rgb2.b)) - b))),\n a: rgb1.a + t * (rgb2.a - rgb1.a)\n };\n}\nfunction $d892378a320191c0$var$modHSL(v, i, ratio) {\n if (v) {\n let tmp = $d892378a320191c0$export$b5ba70b240f8f7f(v);\n tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n tmp = $d892378a320191c0$export$4c15bd42559b811d(tmp);\n v.r = tmp[0];\n v.g = tmp[1];\n v.b = tmp[2];\n }\n}\nfunction $d892378a320191c0$var$clone(v, proto) {\n return v ? Object.assign(proto || {}, v) : v;\n}\nfunction $d892378a320191c0$var$fromObject(input) {\n var v = {\n r: 0,\n g: 0,\n b: 0,\n a: 255\n };\n if (Array.isArray(input)) {\n if (input.length >= 3) {\n v = {\n r: input[0],\n g: input[1],\n b: input[2],\n a: 255\n };\n if (input.length > 3) v.a = $d892378a320191c0$export$ed9bd8dcaeba14f6(input[3]);\n }\n } else {\n v = $d892378a320191c0$var$clone(input, {\n r: 0,\n g: 0,\n b: 0,\n a: 1\n });\n v.a = $d892378a320191c0$export$ed9bd8dcaeba14f6(v.a);\n }\n return v;\n}\nfunction $d892378a320191c0$var$functionParse(str) {\n if (str.charAt(0) === \"r\") return $d892378a320191c0$export$91aedb20f296e541(str);\n return $d892378a320191c0$export$5e91288c399be4f9(str);\n}\nclass $d892378a320191c0$export$892596cec99bc70e {\n get valid() {\n return this._valid;\n }\n get rgb() {\n var v = $d892378a320191c0$var$clone(this._rgb);\n if (v) v.a = $d892378a320191c0$export$dbf961a8d278dbef(v.a);\n return v;\n }\n set rgb(obj) {\n this._rgb = $d892378a320191c0$var$fromObject(obj);\n }\n rgbString() {\n return this._valid ? $d892378a320191c0$export$9595423f22cf925a(this._rgb) : undefined;\n }\n hexString() {\n return this._valid ? $d892378a320191c0$export$1b06654353ef9f67(this._rgb) : undefined;\n }\n hslString() {\n return this._valid ? $d892378a320191c0$export$a197af1c58e6260c(this._rgb) : undefined;\n }\n mix(color, weight) {\n if (color) {\n const c1 = this.rgb;\n const c2 = color.rgb;\n let w2;\n const p = weight === w2 ? 0.5 : weight;\n const w = 2 * p - 1;\n const a = c1.a - c2.a;\n const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n w2 = 1 - w1;\n c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n c1.a = p * c1.a + (1 - p) * c2.a;\n this.rgb = c1;\n }\n return this;\n }\n interpolate(color, t) {\n if (color) this._rgb = $d892378a320191c0$var$interpolate(this._rgb, color._rgb, t);\n return this;\n }\n clone() {\n return new $d892378a320191c0$export$892596cec99bc70e(this.rgb);\n }\n alpha(a) {\n this._rgb.a = $d892378a320191c0$export$ed9bd8dcaeba14f6(a);\n return this;\n }\n clearer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 - ratio;\n return this;\n }\n greyscale() {\n const rgb = this._rgb;\n const val = $d892378a320191c0$export$2077e0241d6afd3c(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n rgb.r = rgb.g = rgb.b = val;\n return this;\n }\n opaquer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 + ratio;\n return this;\n }\n negate() {\n const v = this._rgb;\n v.r = 255 - v.r;\n v.g = 255 - v.g;\n v.b = 255 - v.b;\n return this;\n }\n lighten(ratio) {\n $d892378a320191c0$var$modHSL(this._rgb, 2, ratio);\n return this;\n }\n darken(ratio) {\n $d892378a320191c0$var$modHSL(this._rgb, 2, -ratio);\n return this;\n }\n saturate(ratio) {\n $d892378a320191c0$var$modHSL(this._rgb, 1, ratio);\n return this;\n }\n desaturate(ratio) {\n $d892378a320191c0$var$modHSL(this._rgb, 1, -ratio);\n return this;\n }\n rotate(deg) {\n $d892378a320191c0$export$bb628a54ab399bc9(this._rgb, deg);\n return this;\n }\n constructor(input){\n if (input instanceof $d892378a320191c0$export$892596cec99bc70e) return input;\n const type = typeof input;\n let v;\n if (type === \"object\") v = $d892378a320191c0$var$fromObject(input);\n else if (type === \"string\") v = $d892378a320191c0$export$625a38b961e8b5e9(input) || $d892378a320191c0$export$b2f06b640faad956(input) || $d892378a320191c0$var$functionParse(input);\n this._rgb = v;\n this._valid = !!v;\n }\n}\nfunction $d892378a320191c0$export$2e2bcd8739ae039(input) {\n return new $d892378a320191c0$export$892596cec99bc70e(input);\n}\n\n\n/**\n * @namespace Chart.helpers\n */ /**\n * An empty function that can be used, for example, for optional callback.\n */ function $c4d1694fa24f1a71$export$cf2f7c5792f80b46() {\n/* noop */ }\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */ const $c4d1694fa24f1a71$export$2219238a014317b0 = (()=>{\n let id = 0;\n return ()=>id++;\n})();\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function $c4d1694fa24f1a71$export$342063e11d6c3cad(value) {\n return value === null || typeof value === \"undefined\";\n}\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */ function $c4d1694fa24f1a71$export$8b22cf2602fb60ce(value) {\n if (Array.isArray && Array.isArray(value)) return true;\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === \"[object\" && type.slice(-6) === \"Array]\") return true;\n return false;\n}\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function $c4d1694fa24f1a71$export$23f2a1d2818174ef(value) {\n return value !== null && Object.prototype.toString.call(value) === \"[object Object]\";\n}\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */ function $c4d1694fa24f1a71$export$39b482c5e57630a8(value) {\n return (typeof value === \"number\" || value instanceof Number) && isFinite(+value);\n}\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */ function $c4d1694fa24f1a71$export$c4ce752e73470fba(value, defaultValue) {\n return $c4d1694fa24f1a71$export$39b482c5e57630a8(value) ? value : defaultValue;\n}\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */ function $c4d1694fa24f1a71$export$90a7f3efeed30595(value, defaultValue) {\n return typeof value === \"undefined\" ? defaultValue : value;\n}\nconst $c4d1694fa24f1a71$export$953cecd6e717a553 = (value, dimension)=>typeof value === \"string\" && value.endsWith(\"%\") ? parseFloat(value) / 100 : +value / dimension;\nconst $c4d1694fa24f1a71$export$7ccc53e8f1e7dfc5 = (value, dimension)=>typeof value === \"string\" && value.endsWith(\"%\") ? parseFloat(value) / 100 * dimension : +value;\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */ function $c4d1694fa24f1a71$export$3722cfe417b6ed86(fn, args, thisArg) {\n if (fn && typeof fn.call === \"function\") return fn.apply(thisArg, args);\n}\nfunction $c4d1694fa24f1a71$export$d66501df72047452(loopable, fn, thisArg, reverse) {\n let i, len, keys;\n if ($c4d1694fa24f1a71$export$8b22cf2602fb60ce(loopable)) {\n len = loopable.length;\n if (reverse) for(i = len - 1; i >= 0; i--)fn.call(thisArg, loopable[i], i);\n else for(i = 0; i < len; i++)fn.call(thisArg, loopable[i], i);\n } else if ($c4d1694fa24f1a71$export$23f2a1d2818174ef(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for(i = 0; i < len; i++)fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n}\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */ function $c4d1694fa24f1a71$export$995eb9fca571757(a0, a1) {\n let i, ilen, v0, v1;\n if (!a0 || !a1 || a0.length !== a1.length) return false;\n for(i = 0, ilen = a0.length; i < ilen; ++i){\n v0 = a0[i];\n v1 = a1[i];\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) return false;\n }\n return true;\n}\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */ function $c4d1694fa24f1a71$export$d377dcb2b61d6c4e(source) {\n if ($c4d1694fa24f1a71$export$8b22cf2602fb60ce(source)) return source.map($c4d1694fa24f1a71$export$d377dcb2b61d6c4e);\n if ($c4d1694fa24f1a71$export$23f2a1d2818174ef(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n for(; k < klen; ++k)target[keys[k]] = $c4d1694fa24f1a71$export$d377dcb2b61d6c4e(source[keys[k]]);\n return target;\n }\n return source;\n}\nfunction $c4d1694fa24f1a71$var$isValidKey(key) {\n return [\n \"__proto__\",\n \"prototype\",\n \"constructor\"\n ].indexOf(key) === -1;\n}\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */ function $c4d1694fa24f1a71$export$667d3bf0c5f83305(key, target, source, options) {\n if (!$c4d1694fa24f1a71$var$isValidKey(key)) return;\n const tval = target[key];\n const sval = source[key];\n if ($c4d1694fa24f1a71$export$23f2a1d2818174ef(tval) && $c4d1694fa24f1a71$export$23f2a1d2818174ef(sval)) // eslint-disable-next-line @typescript-eslint/no-use-before-define\n $c4d1694fa24f1a71$export$efca4cbe5dd06740(tval, sval, options);\n else target[key] = $c4d1694fa24f1a71$export$d377dcb2b61d6c4e(sval);\n}\nfunction $c4d1694fa24f1a71$export$efca4cbe5dd06740(target, source, options) {\n const sources = $c4d1694fa24f1a71$export$8b22cf2602fb60ce(source) ? source : [\n source\n ];\n const ilen = sources.length;\n if (!$c4d1694fa24f1a71$export$23f2a1d2818174ef(target)) return target;\n options = options || {};\n const merger = options.merger || $c4d1694fa24f1a71$export$667d3bf0c5f83305;\n let current;\n for(let i = 0; i < ilen; ++i){\n current = sources[i];\n if (!$c4d1694fa24f1a71$export$23f2a1d2818174ef(current)) continue;\n const keys = Object.keys(current);\n for(let k = 0, klen = keys.length; k < klen; ++k)merger(keys[k], target, current, options);\n }\n return target;\n}\nfunction $c4d1694fa24f1a71$export$555508cbc6add439(target, source) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return $c4d1694fa24f1a71$export$efca4cbe5dd06740(target, source, {\n merger: $c4d1694fa24f1a71$export$317a3d46287192d8\n });\n}\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */ function $c4d1694fa24f1a71$export$317a3d46287192d8(key, target, source) {\n if (!$c4d1694fa24f1a71$var$isValidKey(key)) return;\n const tval = target[key];\n const sval = source[key];\n if ($c4d1694fa24f1a71$export$23f2a1d2818174ef(tval) && $c4d1694fa24f1a71$export$23f2a1d2818174ef(sval)) $c4d1694fa24f1a71$export$555508cbc6add439(tval, sval);\n else if (!Object.prototype.hasOwnProperty.call(target, key)) target[key] = $c4d1694fa24f1a71$export$d377dcb2b61d6c4e(sval);\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$1ee57be6f6687d2c(scope, value, previous, current) {\n if (value !== undefined) console.warn(scope + ': \"' + previous + '\" is deprecated. Please use \"' + current + '\" instead');\n}\n// resolveObjectKey resolver cache\nconst $c4d1694fa24f1a71$var$keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n \"\": (v)=>v,\n // default resolvers\n x: (o)=>o.x,\n y: (o)=>o.y\n};\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$9d0e2d13d04f7070(key) {\n const parts = key.split(\".\");\n const keys = [];\n let tmp = \"\";\n for (const part of parts){\n tmp += part;\n if (tmp.endsWith(\"\\\\\")) tmp = tmp.slice(0, -1) + \".\";\n else {\n keys.push(tmp);\n tmp = \"\";\n }\n }\n return keys;\n}\nfunction $c4d1694fa24f1a71$var$_getKeyResolver(key) {\n const keys = $c4d1694fa24f1a71$export$9d0e2d13d04f7070(key);\n return (obj)=>{\n for (const k of keys){\n if (k === \"\") break;\n obj = obj && obj[k];\n }\n return obj;\n };\n}\nfunction $c4d1694fa24f1a71$export$2d1720544b23b823(obj, key) {\n const resolver = $c4d1694fa24f1a71$var$keyResolvers[key] || ($c4d1694fa24f1a71$var$keyResolvers[key] = $c4d1694fa24f1a71$var$_getKeyResolver(key));\n return resolver(obj);\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$a8550f7dbe79f93a(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst $c4d1694fa24f1a71$export$dda1d9f60106f0e9 = (value)=>typeof value !== \"undefined\";\nconst $c4d1694fa24f1a71$export$a93c5207d687da10 = (value)=>typeof value === \"function\";\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nconst $c4d1694fa24f1a71$export$ee7c8ad385a60b7b = (a, b)=>{\n if (a.size !== b.size) return false;\n for (const item of a){\n if (!b.has(item)) return false;\n }\n return true;\n};\n/**\n * @param e - The event\n * @private\n */ function $c4d1694fa24f1a71$export$f38c853ae54ed474(e) {\n return e.type === \"mouseup\" || e.type === \"click\" || e.type === \"contextmenu\";\n}\n/**\n * @alias Chart.helpers.math\n * @namespace\n */ const $c4d1694fa24f1a71$export$56c0d5a1e737357d = Math.PI;\nconst $c4d1694fa24f1a71$export$971d5caa766a69d7 = 2 * $c4d1694fa24f1a71$export$56c0d5a1e737357d;\nconst $c4d1694fa24f1a71$export$d29e374196577086 = $c4d1694fa24f1a71$export$971d5caa766a69d7 + $c4d1694fa24f1a71$export$56c0d5a1e737357d;\nconst $c4d1694fa24f1a71$export$2ec5befb9e6c97d4 = Number.POSITIVE_INFINITY;\nconst $c4d1694fa24f1a71$export$53c86fa97d611818 = $c4d1694fa24f1a71$export$56c0d5a1e737357d / 180;\nconst $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd = $c4d1694fa24f1a71$export$56c0d5a1e737357d / 2;\nconst $c4d1694fa24f1a71$export$39c1cc7c062529d4 = $c4d1694fa24f1a71$export$56c0d5a1e737357d / 4;\nconst $c4d1694fa24f1a71$export$7a0bdf7d4a91ea88 = $c4d1694fa24f1a71$export$56c0d5a1e737357d * 2 / 3;\nconst $c4d1694fa24f1a71$export$9f4f30ee63539e24 = Math.log10;\nconst $c4d1694fa24f1a71$export$2408f22a0fab9ae5 = Math.sign;\nfunction $c4d1694fa24f1a71$export$a05254e7c3aeba6e(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n}\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */ function $c4d1694fa24f1a71$export$a33b77bbdbb8366c(range) {\n const roundedRange = Math.round(range);\n range = $c4d1694fa24f1a71$export$a05254e7c3aeba6e(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor($c4d1694fa24f1a71$export$9f4f30ee63539e24(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */ function $c4d1694fa24f1a71$export$a07804094c3ecf2d(value) {\n const result = [];\n const sqrt = Math.sqrt(value);\n let i;\n for(i = 1; i < sqrt; i++)if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n if (sqrt === (sqrt | 0)) result.push(sqrt);\n result.sort((a, b)=>a - b).pop();\n return result;\n}\nfunction $c4d1694fa24f1a71$export$d141bba7fdc215a3(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction $c4d1694fa24f1a71$export$b9a6b53f9be3734(x, epsilon) {\n const rounded = Math.round(x);\n return rounded - epsilon <= x && rounded + epsilon >= x;\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$53a70dd1ebbae346(array, target, property) {\n let i, ilen, value;\n for(i = 0, ilen = array.length; i < ilen; i++){\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\nfunction $c4d1694fa24f1a71$export$625550452a3fa3ec(degrees) {\n return degrees * ($c4d1694fa24f1a71$export$56c0d5a1e737357d / 180);\n}\nfunction $c4d1694fa24f1a71$export$3a6d5c9ae78a2c08(radians) {\n return radians * (180 / $c4d1694fa24f1a71$export$56c0d5a1e737357d);\n}\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */ function $c4d1694fa24f1a71$export$23ebac1979863676(x) {\n if (!$c4d1694fa24f1a71$export$39b482c5e57630a8(x)) return;\n let e = 1;\n let p = 0;\n while(Math.round(x * e) / e !== x){\n e *= 10;\n p++;\n }\n return p;\n}\n// Gets the angle from vertical upright to the point about a centre.\nfunction $c4d1694fa24f1a71$export$96f57966bedc81b4(centrePoint, anglePoint) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n if (angle < -0.5 * $c4d1694fa24f1a71$export$56c0d5a1e737357d) angle += $c4d1694fa24f1a71$export$971d5caa766a69d7; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n return {\n angle: angle,\n distance: radialDistanceFromCenter\n };\n}\nfunction $c4d1694fa24f1a71$export$158acd800e1ef08b(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */ function $c4d1694fa24f1a71$export$c18d01048907ea92(a, b) {\n return (a - b + $c4d1694fa24f1a71$export$d29e374196577086) % $c4d1694fa24f1a71$export$971d5caa766a69d7 - $c4d1694fa24f1a71$export$56c0d5a1e737357d;\n}\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */ function $c4d1694fa24f1a71$export$28f7fcd39efa255(a) {\n return (a % $c4d1694fa24f1a71$export$971d5caa766a69d7 + $c4d1694fa24f1a71$export$971d5caa766a69d7) % $c4d1694fa24f1a71$export$971d5caa766a69d7;\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$ffb5f4729a158638(angle, start, end, sameAngleIsFullCircle) {\n const a = $c4d1694fa24f1a71$export$28f7fcd39efa255(angle);\n const s = $c4d1694fa24f1a71$export$28f7fcd39efa255(start);\n const e = $c4d1694fa24f1a71$export$28f7fcd39efa255(end);\n const angleToStart = $c4d1694fa24f1a71$export$28f7fcd39efa255(s - a);\n const angleToEnd = $c4d1694fa24f1a71$export$28f7fcd39efa255(e - a);\n const startToAngle = $c4d1694fa24f1a71$export$28f7fcd39efa255(a - s);\n const endToAngle = $c4d1694fa24f1a71$export$28f7fcd39efa255(a - e);\n return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle;\n}\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */ function $c4d1694fa24f1a71$export$25ce5a424b770e84(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n/**\n * @param {number} value\n * @private\n */ function $c4d1694fa24f1a71$export$71cec2538cb2c617(value) {\n return $c4d1694fa24f1a71$export$25ce5a424b770e84(value, -32768, 32767);\n}\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */ function $c4d1694fa24f1a71$export$3b513254972cfc9c(value, start, end, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\nfunction $c4d1694fa24f1a71$export$2ed0fc6709e59212(table, value, cmp) {\n cmp = cmp || ((index)=>table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid;\n while(hi - lo > 1){\n mid = lo + hi >> 1;\n if (cmp(mid)) lo = mid;\n else hi = mid;\n }\n return {\n lo: lo,\n hi: hi\n };\n}\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */ const $c4d1694fa24f1a71$export$ef35774e6d314e91 = (table, key, value, last)=>$c4d1694fa24f1a71$export$2ed0fc6709e59212(table, value, last ? (index)=>{\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n } : (index)=>table[index][key] < value);\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */ const $c4d1694fa24f1a71$export$ebd11618f299a286 = (table, key, value)=>$c4d1694fa24f1a71$export$2ed0fc6709e59212(table, value, (index)=>table[index][key] >= value);\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */ function $c4d1694fa24f1a71$export$c03999cb2f36933f(values, min, max) {\n let start = 0;\n let end = values.length;\n while(start < end && values[start] < min)start++;\n while(end > start && values[end - 1] > max)end--;\n return start > 0 || end < values.length ? values.slice(start, end) : values;\n}\nconst $c4d1694fa24f1a71$var$arrayEvents = [\n \"push\",\n \"pop\",\n \"shift\",\n \"splice\",\n \"unshift\"\n];\nfunction $c4d1694fa24f1a71$export$882b5998b3b9117c(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n Object.defineProperty(array, \"_chartjs\", {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [\n listener\n ]\n }\n });\n $c4d1694fa24f1a71$var$arrayEvents.forEach((key)=>{\n const method = \"_onData\" + $c4d1694fa24f1a71$export$a8550f7dbe79f93a(key);\n const base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value (...args) {\n const res = base.apply(this, args);\n array._chartjs.listeners.forEach((object)=>{\n if (typeof object[method] === \"function\") object[method](...args);\n });\n return res;\n }\n });\n });\n}\nfunction $c4d1694fa24f1a71$export$3b14a55fb2447963(array, listener) {\n const stub = array._chartjs;\n if (!stub) return;\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) listeners.splice(index, 1);\n if (listeners.length > 0) return;\n $c4d1694fa24f1a71$var$arrayEvents.forEach((key)=>{\n delete array[key];\n });\n delete array._chartjs;\n}\n/**\n * @param items\n */ function $c4d1694fa24f1a71$export$71511d61b312f219(items) {\n const set = new Set(items);\n if (set.size === items.length) return items;\n return Array.from(set);\n}\nfunction $c4d1694fa24f1a71$export$fef3dfd9bad05307(pixelSize, fontStyle, fontFamily) {\n return fontStyle + \" \" + pixelSize + \"px \" + fontFamily;\n}\n/**\n* Request animation polyfill\n*/ const $c4d1694fa24f1a71$export$43caf9889c228507 = function() {\n if (typeof window === \"undefined\") return function(callback) {\n return callback();\n };\n return window.requestAnimationFrame;\n}();\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */ function $c4d1694fa24f1a71$export$61196ced6d74a310(fn, thisArg) {\n let argsToUse = [];\n let ticking = false;\n return function(...args) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n $c4d1694fa24f1a71$export$43caf9889c228507.call(window, ()=>{\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n/**\n * Debounces calling `fn` for `delay` ms\n */ function $c4d1694fa24f1a71$export$4c3d22f3d993c33f(fn, delay) {\n let timeout;\n return function(...args) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else fn.apply(this, args);\n return delay;\n };\n}\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */ const $c4d1694fa24f1a71$export$3c2fa207a37baaea = (align)=>align === \"start\" ? \"left\" : align === \"end\" ? \"right\" : \"center\";\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */ const $c4d1694fa24f1a71$export$ce26c07117d59d6a = (align, start, end)=>align === \"start\" ? start : align === \"end\" ? end : (start + end) / 2;\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */ const $c4d1694fa24f1a71$export$9d398bebfec1c039 = (align, left, right, rtl)=>{\n const check = rtl ? \"left\" : \"right\";\n return align === check ? right : align === \"center\" ? (left + right) / 2 : left;\n};\n/**\n * Return start and count of visible points.\n * @private\n */ function $c4d1694fa24f1a71$export$9e5f44173e64f162(meta, points, animationsDisabled) {\n const pointCount = points.length;\n let start = 0;\n let count = pointCount;\n if (meta._sorted) {\n const { iScale: iScale, _parsed: _parsed } = meta;\n const axis = iScale.axis;\n const { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = iScale.getUserBounds();\n if (minDefined) start = $c4d1694fa24f1a71$export$25ce5a424b770e84(Math.min($c4d1694fa24f1a71$export$ef35774e6d314e91(_parsed, axis, min).lo, animationsDisabled ? pointCount : $c4d1694fa24f1a71$export$ef35774e6d314e91(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1);\n if (maxDefined) count = $c4d1694fa24f1a71$export$25ce5a424b770e84(Math.max($c4d1694fa24f1a71$export$ef35774e6d314e91(_parsed, iScale.axis, max, true).hi + 1, animationsDisabled ? 0 : $c4d1694fa24f1a71$export$ef35774e6d314e91(points, axis, iScale.getPixelForValue(max), true).hi + 1), start, pointCount) - start;\n else count = pointCount - start;\n }\n return {\n start: start,\n count: count\n };\n}\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */ function $c4d1694fa24f1a71$export$efccba1c4a2ef57b(meta) {\n const { xScale: xScale, yScale: yScale, _scaleRanges: _scaleRanges } = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\nconst $c4d1694fa24f1a71$var$atEdge = (t)=>t === 0 || t === 1;\nconst $c4d1694fa24f1a71$var$elasticIn = (t, s, p)=>-(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * $c4d1694fa24f1a71$export$971d5caa766a69d7 / p));\nconst $c4d1694fa24f1a71$var$elasticOut = (t, s, p)=>Math.pow(2, -10 * t) * Math.sin((t - s) * $c4d1694fa24f1a71$export$971d5caa766a69d7 / p) + 1;\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */ const $c4d1694fa24f1a71$export$f1e1789686576879 = {\n linear: (t)=>t,\n easeInQuad: (t)=>t * t,\n easeOutQuad: (t)=>-t * (t - 2),\n easeInOutQuad: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1),\n easeInCubic: (t)=>t * t * t,\n easeOutCubic: (t)=>(t -= 1) * t * t + 1,\n easeInOutCubic: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2),\n easeInQuart: (t)=>t * t * t * t,\n easeOutQuart: (t)=>-((t -= 1) * t * t * t - 1),\n easeInOutQuart: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2),\n easeInQuint: (t)=>t * t * t * t * t,\n easeOutQuint: (t)=>(t -= 1) * t * t * t * t + 1,\n easeInOutQuint: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2),\n easeInSine: (t)=>-Math.cos(t * $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd) + 1,\n easeOutSine: (t)=>Math.sin(t * $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd),\n easeInOutSine: (t)=>-0.5 * (Math.cos($c4d1694fa24f1a71$export$56c0d5a1e737357d * t) - 1),\n easeInExpo: (t)=>t === 0 ? 0 : Math.pow(2, 10 * (t - 1)),\n easeOutExpo: (t)=>t === 1 ? 1 : -Math.pow(2, -10 * t) + 1,\n easeInOutExpo: (t)=>$c4d1694fa24f1a71$var$atEdge(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n easeInCirc: (t)=>t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1),\n easeOutCirc: (t)=>Math.sqrt(1 - (t -= 1) * t),\n easeInOutCirc: (t)=>(t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n easeInElastic: (t)=>$c4d1694fa24f1a71$var$atEdge(t) ? t : $c4d1694fa24f1a71$var$elasticIn(t, 0.075, 0.3),\n easeOutElastic: (t)=>$c4d1694fa24f1a71$var$atEdge(t) ? t : $c4d1694fa24f1a71$var$elasticOut(t, 0.075, 0.3),\n easeInOutElastic (t) {\n const s = 0.1125;\n const p = 0.45;\n return $c4d1694fa24f1a71$var$atEdge(t) ? t : t < 0.5 ? 0.5 * $c4d1694fa24f1a71$var$elasticIn(t * 2, s, p) : 0.5 + 0.5 * $c4d1694fa24f1a71$var$elasticOut(t * 2 - 1, s, p);\n },\n easeInBack (t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n easeOutBack (t) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n easeInOutBack (t) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s));\n return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);\n },\n easeInBounce: (t)=>1 - $c4d1694fa24f1a71$export$f1e1789686576879.easeOutBounce(1 - t),\n easeOutBounce (t) {\n const m = 7.5625;\n const d = 2.75;\n if (t < 1 / d) return m * t * t;\n if (t < 2 / d) return m * (t -= 1.5 / d) * t + 0.75;\n if (t < 2.5 / d) return m * (t -= 2.25 / d) * t + 0.9375;\n return m * (t -= 2.625 / d) * t + 0.984375;\n },\n easeInOutBounce: (t)=>t < 0.5 ? $c4d1694fa24f1a71$export$f1e1789686576879.easeInBounce(t * 2) * 0.5 : $c4d1694fa24f1a71$export$f1e1789686576879.easeOutBounce(t * 2 - 1) * 0.5 + 0.5\n};\nfunction $c4d1694fa24f1a71$export$f96d196f7728bb5(value) {\n if (value && typeof value === \"object\") {\n const type = value.toString();\n return type === \"[object CanvasPattern]\" || type === \"[object CanvasGradient]\";\n }\n return false;\n}\nfunction $c4d1694fa24f1a71$export$db3b6bfb95261072(value) {\n return $c4d1694fa24f1a71$export$f96d196f7728bb5(value) ? value : new (0, $d892378a320191c0$export$892596cec99bc70e)(value);\n}\nfunction $c4d1694fa24f1a71$export$738ab4df8bf92ae9(value) {\n return $c4d1694fa24f1a71$export$f96d196f7728bb5(value) ? value : new (0, $d892378a320191c0$export$892596cec99bc70e)(value).saturate(0.5).darken(0.1).hexString();\n}\nconst $c4d1694fa24f1a71$var$numbers = [\n \"x\",\n \"y\",\n \"borderWidth\",\n \"radius\",\n \"tension\"\n];\nconst $c4d1694fa24f1a71$var$colors = [\n \"color\",\n \"borderColor\",\n \"backgroundColor\"\n];\nfunction $c4d1694fa24f1a71$var$applyAnimationsDefaults(defaults) {\n defaults.set(\"animation\", {\n delay: undefined,\n duration: 1000,\n easing: \"easeOutQuart\",\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined\n });\n defaults.describe(\"animation\", {\n _fallback: false,\n _indexable: false,\n _scriptable: (name)=>name !== \"onProgress\" && name !== \"onComplete\" && name !== \"fn\"\n });\n defaults.set(\"animations\", {\n colors: {\n type: \"color\",\n properties: $c4d1694fa24f1a71$var$colors\n },\n numbers: {\n type: \"number\",\n properties: $c4d1694fa24f1a71$var$numbers\n }\n });\n defaults.describe(\"animations\", {\n _fallback: \"animation\"\n });\n defaults.set(\"transitions\", {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: \"transparent\"\n },\n visible: {\n type: \"boolean\",\n duration: 0\n }\n }\n },\n hide: {\n animations: {\n colors: {\n to: \"transparent\"\n },\n visible: {\n type: \"boolean\",\n easing: \"linear\",\n fn: (v)=>v | 0\n }\n }\n }\n });\n}\nfunction $c4d1694fa24f1a71$var$applyLayoutsDefaults(defaults) {\n defaults.set(\"layout\", {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\nconst $c4d1694fa24f1a71$var$intlCache = new Map();\nfunction $c4d1694fa24f1a71$var$getNumberFormat(locale, options) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = $c4d1694fa24f1a71$var$intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n $c4d1694fa24f1a71$var$intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\nfunction $c4d1694fa24f1a71$export$ae1af26003f05816(num, locale, options) {\n return $c4d1694fa24f1a71$var$getNumberFormat(locale, options).format(num);\n}\nconst $c4d1694fa24f1a71$var$formatters = {\n values (value) {\n return $c4d1694fa24f1a71$export$8b22cf2602fb60ce(value) ? value : \"\" + value;\n },\n numeric (tickValue, index, ticks) {\n if (tickValue === 0) return \"0\";\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue;\n if (ticks.length > 1) {\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) notation = \"scientific\";\n delta = $c4d1694fa24f1a71$var$calculateDelta(tickValue, ticks);\n }\n const logDelta = $c4d1694fa24f1a71$export$9f4f30ee63539e24(Math.abs(delta));\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n const options = {\n notation: notation,\n minimumFractionDigits: numDecimal,\n maximumFractionDigits: numDecimal\n };\n Object.assign(options, this.options.ticks.format);\n return $c4d1694fa24f1a71$export$ae1af26003f05816(tickValue, locale, options);\n },\n logarithmic (tickValue, index, ticks) {\n if (tickValue === 0) return \"0\";\n const remain = ticks[index].significand || tickValue / Math.pow(10, Math.floor($c4d1694fa24f1a71$export$9f4f30ee63539e24(tickValue)));\n if ([\n 1,\n 2,\n 3,\n 5,\n 10,\n 15\n ].includes(remain) || index > 0.8 * ticks.length) return $c4d1694fa24f1a71$var$formatters.numeric.call(this, tickValue, index, ticks);\n return \"\";\n }\n};\nfunction $c4d1694fa24f1a71$var$calculateDelta(tickValue, ticks) {\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) delta = tickValue - Math.floor(tickValue);\n return delta;\n}\nvar $c4d1694fa24f1a71$export$91477dc880baac21 = {\n formatters: $c4d1694fa24f1a71$var$formatters\n};\nfunction $c4d1694fa24f1a71$var$applyScaleDefaults(defaults) {\n defaults.set(\"scale\", {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n bounds: \"ticks\",\n clip: true,\n grace: 0,\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options)=>options.lineWidth,\n tickColor: (_ctx, options)=>options.color,\n offset: false\n },\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n title: {\n display: false,\n text: \"\",\n padding: {\n top: 4,\n bottom: 4\n }\n },\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: \"\",\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n callback: $c4d1694fa24f1a71$export$91477dc880baac21.formatters.values,\n minor: {},\n major: {},\n align: \"center\",\n crossAlign: \"near\",\n showLabelBackdrop: false,\n backdropColor: \"rgba(255, 255, 255, 0.75)\",\n backdropPadding: 2\n }\n });\n defaults.route(\"scale.ticks\", \"color\", \"\", \"color\");\n defaults.route(\"scale.grid\", \"color\", \"\", \"borderColor\");\n defaults.route(\"scale.border\", \"color\", \"\", \"borderColor\");\n defaults.route(\"scale.title\", \"color\", \"\", \"color\");\n defaults.describe(\"scale\", {\n _fallback: false,\n _scriptable: (name)=>!name.startsWith(\"before\") && !name.startsWith(\"after\") && name !== \"callback\" && name !== \"parser\",\n _indexable: (name)=>name !== \"borderDash\" && name !== \"tickBorderDash\" && name !== \"dash\"\n });\n defaults.describe(\"scales\", {\n _fallback: \"scale\"\n });\n defaults.describe(\"scale.ticks\", {\n _scriptable: (name)=>name !== \"backdropPadding\" && name !== \"callback\",\n _indexable: (name)=>name !== \"backdropPadding\"\n });\n}\nconst $c4d1694fa24f1a71$export$6559d589eb85fbb6 = Object.create(null);\nconst $c4d1694fa24f1a71$export$2e2af4578d910ddf = Object.create(null);\nfunction $c4d1694fa24f1a71$var$getScope$1(node, key) {\n if (!key) return node;\n const keys = key.split(\".\");\n for(let i = 0, n = keys.length; i < n; ++i){\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\nfunction $c4d1694fa24f1a71$var$set(root, scope, values) {\n if (typeof scope === \"string\") return $c4d1694fa24f1a71$export$efca4cbe5dd06740($c4d1694fa24f1a71$var$getScope$1(root, scope), values);\n return $c4d1694fa24f1a71$export$efca4cbe5dd06740($c4d1694fa24f1a71$var$getScope$1(root, \"\"), scope);\n}\nclass $c4d1694fa24f1a71$var$Defaults {\n set(scope, values) {\n return $c4d1694fa24f1a71$var$set(this, scope, values);\n }\n get(scope) {\n return $c4d1694fa24f1a71$var$getScope$1(this, scope);\n }\n describe(scope, values) {\n return $c4d1694fa24f1a71$var$set($c4d1694fa24f1a71$export$2e2af4578d910ddf, scope, values);\n }\n override(scope, values) {\n return $c4d1694fa24f1a71$var$set($c4d1694fa24f1a71$export$6559d589eb85fbb6, scope, values);\n }\n route(scope, name, targetScope, targetName) {\n const scopeObject = $c4d1694fa24f1a71$var$getScope$1(this, scope);\n const targetScopeObject = $c4d1694fa24f1a71$var$getScope$1(this, targetScope);\n const privateName = \"_\" + name;\n Object.defineProperties(scopeObject, {\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n [name]: {\n enumerable: true,\n get () {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if ($c4d1694fa24f1a71$export$23f2a1d2818174ef(local)) return Object.assign({}, target, local);\n return $c4d1694fa24f1a71$export$90a7f3efeed30595(local, target);\n },\n set (value) {\n this[privateName] = value;\n }\n }\n });\n }\n apply(appliers) {\n appliers.forEach((apply)=>apply(this));\n }\n constructor(_descriptors, _appliers){\n this.animation = undefined;\n this.backgroundColor = \"rgba(0,0,0,0.1)\";\n this.borderColor = \"rgba(0,0,0,0.1)\";\n this.color = \"#666\";\n this.datasets = {};\n this.devicePixelRatio = (context)=>context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n \"mousemove\",\n \"mouseout\",\n \"click\",\n \"touchstart\",\n \"touchmove\"\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: \"normal\",\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options)=>$c4d1694fa24f1a71$export$738ab4df8bf92ae9(options.backgroundColor);\n this.hoverBorderColor = (ctx, options)=>$c4d1694fa24f1a71$export$738ab4df8bf92ae9(options.borderColor);\n this.hoverColor = (ctx, options)=>$c4d1694fa24f1a71$export$738ab4df8bf92ae9(options.color);\n this.indexAxis = \"x\";\n this.interaction = {\n mode: \"nearest\",\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n}\nvar $c4d1694fa24f1a71$export$4368d992c4eafac0 = /* #__PURE__ */ new $c4d1694fa24f1a71$var$Defaults({\n _scriptable: (name)=>!name.startsWith(\"on\"),\n _indexable: (name)=>name !== \"events\",\n hover: {\n _fallback: \"interaction\"\n },\n interaction: {\n _scriptable: false,\n _indexable: false\n }\n}, [\n $c4d1694fa24f1a71$var$applyAnimationsDefaults,\n $c4d1694fa24f1a71$var$applyLayoutsDefaults,\n $c4d1694fa24f1a71$var$applyScaleDefaults\n]);\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */ function $c4d1694fa24f1a71$export$1a8f5705751d8277(font) {\n if (!font || $c4d1694fa24f1a71$export$342063e11d6c3cad(font.size) || $c4d1694fa24f1a71$export$342063e11d6c3cad(font.family)) return null;\n return (font.style ? font.style + \" \" : \"\") + (font.weight ? font.weight + \" \" : \"\") + font.size + \"px \" + font.family;\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$e7c866399fa523f5(ctx, data, gc, longest, string) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) longest = textWidth;\n return longest;\n}\n/**\n * @private\n */ // eslint-disable-next-line complexity\nfunction $c4d1694fa24f1a71$export$faec65b429be379(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n ctx.save();\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i, j, jlen, thing, nestedThing;\n for(i = 0; i < ilen; i++){\n thing = arrayOfThings[i];\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !$c4d1694fa24f1a71$export$8b22cf2602fb60ce(thing)) longest = $c4d1694fa24f1a71$export$e7c866399fa523f5(ctx, data, gc, longest, thing);\n else if ($c4d1694fa24f1a71$export$8b22cf2602fb60ce(thing)) // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for(j = 0, jlen = thing.length; j < jlen; j++){\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !$c4d1694fa24f1a71$export$8b22cf2602fb60ce(nestedThing)) longest = $c4d1694fa24f1a71$export$e7c866399fa523f5(ctx, data, gc, longest, nestedThing);\n }\n }\n ctx.restore();\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for(i = 0; i < gcLen; i++)delete data[gc[i]];\n gc.splice(0, gcLen);\n }\n return longest;\n}\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */ function $c4d1694fa24f1a71$export$78acf4525d8a74c4(chart, pixel, width) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n/**\n * Clears the entire canvas.\n */ function $c4d1694fa24f1a71$export$c9170ad7d4cd7e57(canvas, ctx) {\n ctx = ctx || canvas.getContext(\"2d\");\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\nfunction $c4d1694fa24f1a71$export$493d36ec626b6698(ctx, options, x, y) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n $c4d1694fa24f1a71$export$24baa2b76016ce0e(ctx, options, x, y, null);\n}\n// eslint-disable-next-line complexity\nfunction $c4d1694fa24f1a71$export$24baa2b76016ce0e(ctx, options, x, y, w) {\n let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * $c4d1694fa24f1a71$export$53c86fa97d611818;\n if (style && typeof style === \"object\") {\n type = style.toString();\n if (type === \"[object HTMLImageElement]\" || type === \"[object HTMLCanvasElement]\") {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n if (isNaN(radius) || radius <= 0) return;\n ctx.beginPath();\n switch(style){\n // Default includes circle\n default:\n if (w) ctx.ellipse(x, y, w / 2, radius, 0, 0, $c4d1694fa24f1a71$export$971d5caa766a69d7);\n else ctx.arc(x, y, radius, 0, $c4d1694fa24f1a71$export$971d5caa766a69d7);\n ctx.closePath();\n break;\n case \"triangle\":\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += $c4d1694fa24f1a71$export$7a0bdf7d4a91ea88;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += $c4d1694fa24f1a71$export$7a0bdf7d4a91ea88;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case \"rectRounded\":\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + $c4d1694fa24f1a71$export$39c1cc7c062529d4) * size;\n xOffsetW = Math.cos(rad + $c4d1694fa24f1a71$export$39c1cc7c062529d4) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + $c4d1694fa24f1a71$export$39c1cc7c062529d4) * size;\n yOffsetW = Math.sin(rad + $c4d1694fa24f1a71$export$39c1cc7c062529d4) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - $c4d1694fa24f1a71$export$56c0d5a1e737357d, rad - $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd, rad + $c4d1694fa24f1a71$export$56c0d5a1e737357d);\n ctx.closePath();\n break;\n case \"rect\":\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += $c4d1694fa24f1a71$export$39c1cc7c062529d4;\n /* falls through */ case \"rectRot\":\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case \"crossRot\":\n rad += $c4d1694fa24f1a71$export$39c1cc7c062529d4;\n /* falls through */ case \"cross\":\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case \"star\":\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += $c4d1694fa24f1a71$export$39c1cc7c062529d4;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case \"line\":\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case \"dash\":\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n ctx.fill();\n if (options.borderWidth > 0) ctx.stroke();\n}\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */ function $c4d1694fa24f1a71$export$e7094788287c5e9b(point, area, margin) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;\n}\nfunction $c4d1694fa24f1a71$export$8743009a87fcb00f(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\nfunction $c4d1694fa24f1a71$export$3d8c2f653ac9d0b9(ctx) {\n ctx.restore();\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$d24c54395ce0c509(ctx, previous, target, flip, mode) {\n if (!previous) return ctx.lineTo(target.x, target.y);\n if (mode === \"middle\") {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === \"after\" !== !!flip) ctx.lineTo(previous.x, target.y);\n else ctx.lineTo(target.x, previous.y);\n ctx.lineTo(target.x, target.y);\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$6554612db691658e(ctx, previous, target, flip) {\n if (!previous) return ctx.lineTo(target.x, target.y);\n ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y);\n}\nfunction $c4d1694fa24f1a71$var$setRenderOpts(ctx, opts) {\n if (opts.translation) ctx.translate(opts.translation[0], opts.translation[1]);\n if (!$c4d1694fa24f1a71$export$342063e11d6c3cad(opts.rotation)) ctx.rotate(opts.rotation);\n if (opts.color) ctx.fillStyle = opts.color;\n if (opts.textAlign) ctx.textAlign = opts.textAlign;\n if (opts.textBaseline) ctx.textBaseline = opts.textBaseline;\n}\nfunction $c4d1694fa24f1a71$var$decorateText(ctx, x, y, line, opts) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */ const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\nfunction $c4d1694fa24f1a71$var$drawBackdrop(ctx, opts) {\n const oldColor = ctx.fillStyle;\n ctx.fillStyle = opts.color;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n/**\n * Render text onto the canvas\n */ function $c4d1694fa24f1a71$export$dc98b0b04f4c7758(ctx, text, x, y, font, opts = {}) {\n const lines = $c4d1694fa24f1a71$export$8b22cf2602fb60ce(text) ? text : [\n text\n ];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== \"\";\n let i, line;\n ctx.save();\n ctx.font = font.string;\n $c4d1694fa24f1a71$var$setRenderOpts(ctx, opts);\n for(i = 0; i < lines.length; ++i){\n line = lines[i];\n if (opts.backdrop) $c4d1694fa24f1a71$var$drawBackdrop(ctx, opts.backdrop);\n if (stroke) {\n if (opts.strokeColor) ctx.strokeStyle = opts.strokeColor;\n if (!$c4d1694fa24f1a71$export$342063e11d6c3cad(opts.strokeWidth)) ctx.lineWidth = opts.strokeWidth;\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n ctx.fillText(line, x, y, opts.maxWidth);\n $c4d1694fa24f1a71$var$decorateText(ctx, x, y, line, opts);\n y += Number(font.lineHeight);\n }\n ctx.restore();\n}\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */ function $c4d1694fa24f1a71$export$1fbe638ecf81657e(ctx, rect) {\n const { x: x, y: y, w: w, h: h, radius: radius } = rect;\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * $c4d1694fa24f1a71$export$56c0d5a1e737357d, $c4d1694fa24f1a71$export$56c0d5a1e737357d, true);\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, $c4d1694fa24f1a71$export$56c0d5a1e737357d, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd, true);\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd, 0, true);\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -$c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd, true);\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\nconst $c4d1694fa24f1a71$var$LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst $c4d1694fa24f1a71$var$FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n/**\n * @alias Chart.helpers.options\n * @namespace\n */ /**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */ function $c4d1694fa24f1a71$export$8c78c7c36408ea29(value, size) {\n const matches = (\"\" + value).match($c4d1694fa24f1a71$var$LINE_HEIGHT);\n if (!matches || matches[1] === \"normal\") return size * 1.2;\n value = +matches[2];\n switch(matches[3]){\n case \"px\":\n return value;\n case \"%\":\n value /= 100;\n break;\n }\n return size * value;\n}\nconst $c4d1694fa24f1a71$var$numberOrZero = (v)=>+v || 0;\nfunction $c4d1694fa24f1a71$export$21579262ef46735b(value, props) {\n const ret = {};\n const objProps = $c4d1694fa24f1a71$export$23f2a1d2818174ef(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = $c4d1694fa24f1a71$export$23f2a1d2818174ef(value) ? objProps ? (prop)=>$c4d1694fa24f1a71$export$90a7f3efeed30595(value[prop], value[props[prop]]) : (prop)=>value[prop] : ()=>value;\n for (const prop of keys)ret[prop] = $c4d1694fa24f1a71$var$numberOrZero(read(prop));\n return ret;\n}\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */ function $c4d1694fa24f1a71$export$d66dc83d8cfc8dd(value) {\n return $c4d1694fa24f1a71$export$21579262ef46735b(value, {\n top: \"y\",\n right: \"x\",\n bottom: \"y\",\n left: \"x\"\n });\n}\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */ function $c4d1694fa24f1a71$export$92108d983e8ee699(value) {\n return $c4d1694fa24f1a71$export$21579262ef46735b(value, [\n \"topLeft\",\n \"topRight\",\n \"bottomLeft\",\n \"bottomRight\"\n ]);\n}\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */ function $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca(value) {\n const obj = $c4d1694fa24f1a71$export$d66dc83d8cfc8dd(value);\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n return obj;\n}\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */ function $c4d1694fa24f1a71$export$34aec0b863436764(options, fallback) {\n options = options || {};\n fallback = fallback || $c4d1694fa24f1a71$export$4368d992c4eafac0.font;\n let size = $c4d1694fa24f1a71$export$90a7f3efeed30595(options.size, fallback.size);\n if (typeof size === \"string\") size = parseInt(size, 10);\n let style = $c4d1694fa24f1a71$export$90a7f3efeed30595(options.style, fallback.style);\n if (style && !(\"\" + style).match($c4d1694fa24f1a71$var$FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n const font = {\n family: $c4d1694fa24f1a71$export$90a7f3efeed30595(options.family, fallback.family),\n lineHeight: $c4d1694fa24f1a71$export$8c78c7c36408ea29($c4d1694fa24f1a71$export$90a7f3efeed30595(options.lineHeight, fallback.lineHeight), size),\n size: size,\n style: style,\n weight: $c4d1694fa24f1a71$export$90a7f3efeed30595(options.weight, fallback.weight),\n string: \"\"\n };\n font.string = $c4d1694fa24f1a71$export$1a8f5705751d8277(font);\n return font;\n}\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */ function $c4d1694fa24f1a71$export$407448d2b89b1813(inputs, context, index, info) {\n let cacheable = true;\n let i, ilen, value;\n for(i = 0, ilen = inputs.length; i < ilen; ++i){\n value = inputs[i];\n if (value === undefined) continue;\n if (context !== undefined && typeof value === \"function\") {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && $c4d1694fa24f1a71$export$8b22cf2602fb60ce(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) info.cacheable = false;\n return value;\n }\n }\n}\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */ function $c4d1694fa24f1a71$export$db202ddc8be9136(minmax, grace, beginAtZero) {\n const { min: min, max: max } = minmax;\n const change = $c4d1694fa24f1a71$export$7ccc53e8f1e7dfc5(grace, (max - min) / 2);\n const keepZero = (value, add)=>beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\nfunction $c4d1694fa24f1a71$export$35e795649ee09318(parentContext, context) {\n return Object.assign(Object.create(parentContext), context);\n}\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */ function $c4d1694fa24f1a71$export$a9c996f45e5784d0(scopes, prefixes = [\n \"\"\n], rootScopes, fallback, getTarget = ()=>scopes[0]) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === \"undefined\") fallback = $c4d1694fa24f1a71$var$_resolve(\"_fallback\", scopes);\n const cache = {\n [Symbol.toStringTag]: \"Object\",\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope)=>$c4d1694fa24f1a71$export$a9c996f45e5784d0([\n scope,\n ...scopes\n ], prefixes, finalRootScopes, fallback)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop) {\n return $c4d1694fa24f1a71$var$_cached(target, prop, ()=>$c4d1694fa24f1a71$var$_resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return $c4d1694fa24f1a71$var$getKeysFromAllScopes(target).includes(prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys (target) {\n return $c4d1694fa24f1a71$var$getKeysFromAllScopes(target);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n });\n}\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */ function $c4d1694fa24f1a71$export$c3950d9923825c02(proxy, context, subProxy, descriptorDefaults) {\n const cache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: $c4d1694fa24f1a71$export$7910e0436ed8d1de(proxy, descriptorDefaults),\n setContext: (ctx)=>$c4d1694fa24f1a71$export$c3950d9923825c02(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope)=>$c4d1694fa24f1a71$export$c3950d9923825c02(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop, receiver) {\n return $c4d1694fa24f1a71$var$_cached(target, prop, ()=>$c4d1694fa24f1a71$var$_resolveWithContext(target, prop, receiver));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? {\n enumerable: true,\n configurable: true\n } : undefined : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(proxy);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return Reflect.has(proxy, prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys () {\n return Reflect.ownKeys(proxy);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n });\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$7910e0436ed8d1de(proxy, defaults = {\n scriptable: true,\n indexable: true\n}) {\n const { _scriptable: _scriptable = defaults.scriptable, _indexable: _indexable = defaults.indexable, _allKeys: _allKeys = defaults.allKeys } = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: $c4d1694fa24f1a71$export$a93c5207d687da10(_scriptable) ? _scriptable : ()=>_scriptable,\n isIndexable: $c4d1694fa24f1a71$export$a93c5207d687da10(_indexable) ? _indexable : ()=>_indexable\n };\n}\nconst $c4d1694fa24f1a71$var$readKey = (prefix, name)=>prefix ? prefix + $c4d1694fa24f1a71$export$a8550f7dbe79f93a(name) : name;\nconst $c4d1694fa24f1a71$var$needsSubResolver = (prop, value)=>$c4d1694fa24f1a71$export$23f2a1d2818174ef(value) && prop !== \"adapters\" && (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction $c4d1694fa24f1a71$var$_cached(target, prop, resolve) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) return target[prop];\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\nfunction $c4d1694fa24f1a71$var$_resolveWithContext(target, prop, receiver) {\n const { _proxy: _proxy, _context: _context, _subProxy: _subProxy, _descriptors: descriptors } = target;\n let value = _proxy[prop]; // resolve from proxy\n // resolve with context\n if ($c4d1694fa24f1a71$export$a93c5207d687da10(value) && descriptors.isScriptable(prop)) value = $c4d1694fa24f1a71$var$_resolveScriptable(prop, value, target, receiver);\n if ($c4d1694fa24f1a71$export$8b22cf2602fb60ce(value) && value.length) value = $c4d1694fa24f1a71$var$_resolveArray(prop, value, target, descriptors.isIndexable);\n if ($c4d1694fa24f1a71$var$needsSubResolver(prop, value)) // if the resolved value is an object, create a sub resolver for it\n value = $c4d1694fa24f1a71$export$c3950d9923825c02(value, _context, _subProxy && _subProxy[prop], descriptors);\n return value;\n}\nfunction $c4d1694fa24f1a71$var$_resolveScriptable(prop, getValue, target, receiver) {\n const { _proxy: _proxy, _context: _context, _subProxy: _subProxy, _stack: _stack } = target;\n if (_stack.has(prop)) throw new Error(\"Recursion detected: \" + Array.from(_stack).join(\"->\") + \"->\" + prop);\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if ($c4d1694fa24f1a71$var$needsSubResolver(prop, value)) // When scriptable option returns an object, create a resolver on that.\n value = $c4d1694fa24f1a71$var$createSubResolver(_proxy._scopes, _proxy, prop, value);\n return value;\n}\nfunction $c4d1694fa24f1a71$var$_resolveArray(prop, value, target, isIndexable) {\n const { _proxy: _proxy, _context: _context, _subProxy: _subProxy, _descriptors: descriptors } = target;\n if (typeof _context.index !== \"undefined\" && isIndexable(prop)) return value[_context.index % value.length];\n else if ($c4d1694fa24f1a71$export$23f2a1d2818174ef(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter((s)=>s !== arr);\n value = [];\n for (const item of arr){\n const resolver = $c4d1694fa24f1a71$var$createSubResolver(scopes, _proxy, prop, item);\n value.push($c4d1694fa24f1a71$export$c3950d9923825c02(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\nfunction $c4d1694fa24f1a71$var$resolveFallback(fallback, prop, value) {\n return $c4d1694fa24f1a71$export$a93c5207d687da10(fallback) ? fallback(prop, value) : fallback;\n}\nconst $c4d1694fa24f1a71$var$getScope = (key, parent)=>key === true ? parent : typeof key === \"string\" ? $c4d1694fa24f1a71$export$2d1720544b23b823(parent, key) : undefined;\nfunction $c4d1694fa24f1a71$var$addScopes(set, parentScopes, key, parentFallback, value) {\n for (const parent of parentScopes){\n const scope = $c4d1694fa24f1a71$var$getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = $c4d1694fa24f1a71$var$resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== \"undefined\" && fallback !== key && fallback !== parentFallback) // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n } else if (scope === false && typeof parentFallback !== \"undefined\" && key !== parentFallback) // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n return false;\n}\nfunction $c4d1694fa24f1a71$var$createSubResolver(parentScopes, resolver, prop, value) {\n const rootScopes = resolver._rootScopes;\n const fallback = $c4d1694fa24f1a71$var$resolveFallback(resolver._fallback, prop, value);\n const allScopes = [\n ...parentScopes,\n ...rootScopes\n ];\n const set = new Set();\n set.add(value);\n let key = $c4d1694fa24f1a71$var$addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) return false;\n if (typeof fallback !== \"undefined\" && fallback !== prop) {\n key = $c4d1694fa24f1a71$var$addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) return false;\n }\n return $c4d1694fa24f1a71$export$a9c996f45e5784d0(Array.from(set), [\n \"\"\n ], rootScopes, fallback, ()=>$c4d1694fa24f1a71$var$subGetTarget(resolver, prop, value));\n}\nfunction $c4d1694fa24f1a71$var$addScopesFromKey(set, allScopes, key, fallback, item) {\n while(key)key = $c4d1694fa24f1a71$var$addScopes(set, allScopes, key, fallback, item);\n return key;\n}\nfunction $c4d1694fa24f1a71$var$subGetTarget(resolver, prop, value) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) parent[prop] = {};\n const target = parent[prop];\n if ($c4d1694fa24f1a71$export$8b22cf2602fb60ce(target) && $c4d1694fa24f1a71$export$23f2a1d2818174ef(value)) // For array of objects, the object is used to store updated values\n return value;\n return target || {};\n}\nfunction $c4d1694fa24f1a71$var$_resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n let value;\n for (const prefix of prefixes){\n value = $c4d1694fa24f1a71$var$_resolve($c4d1694fa24f1a71$var$readKey(prefix, prop), scopes);\n if (typeof value !== \"undefined\") return $c4d1694fa24f1a71$var$needsSubResolver(prop, value) ? $c4d1694fa24f1a71$var$createSubResolver(scopes, proxy, prop, value) : value;\n }\n}\nfunction $c4d1694fa24f1a71$var$_resolve(key, scopes) {\n for (const scope of scopes){\n if (!scope) continue;\n const value = scope[key];\n if (typeof value !== \"undefined\") return value;\n }\n}\nfunction $c4d1694fa24f1a71$var$getKeysFromAllScopes(target) {\n let keys = target._keys;\n if (!keys) keys = target._keys = $c4d1694fa24f1a71$var$resolveKeysFromAllScopes(target._scopes);\n return keys;\n}\nfunction $c4d1694fa24f1a71$var$resolveKeysFromAllScopes(scopes) {\n const set = new Set();\n for (const scope of scopes)for (const key of Object.keys(scope).filter((k)=>!k.startsWith(\"_\")))set.add(key);\n return Array.from(set);\n}\nfunction $c4d1694fa24f1a71$export$4a5767248b18ef41(meta, data, start, count) {\n const { iScale: iScale } = meta;\n const { key: key = \"r\" } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse($c4d1694fa24f1a71$export$2d1720544b23b823(item, key), index)\n };\n }\n return parsed;\n}\nconst $c4d1694fa24f1a71$var$EPSILON = Number.EPSILON || 1e-14;\nconst $c4d1694fa24f1a71$var$getPoint = (points, i)=>i < points.length && !points[i].skip && points[i];\nconst $c4d1694fa24f1a71$var$getValueAxis = (indexAxis)=>indexAxis === \"x\" ? \"y\" : \"x\";\nfunction $c4d1694fa24f1a71$export$e171bab687b50e0(firstPoint, middlePoint, afterPoint, t) {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n // This function must also respect \"skipped\" points\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = $c4d1694fa24f1a71$export$158acd800e1ef08b(current, previous);\n const d12 = $c4d1694fa24f1a71$export$158acd800e1ef08b(next, current);\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n/**\n * Adjust tangents to ensure monotonic properties\n */ function $c4d1694fa24f1a71$var$monotoneAdjust(points, deltaK, mK) {\n const pointsLen = points.length;\n let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n let pointAfter = $c4d1694fa24f1a71$var$getPoint(points, 0);\n for(let i = 0; i < pointsLen - 1; ++i){\n pointCurrent = pointAfter;\n pointAfter = $c4d1694fa24f1a71$var$getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) continue;\n if ($c4d1694fa24f1a71$export$a05254e7c3aeba6e(deltaK[i], 0, $c4d1694fa24f1a71$var$EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) continue;\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\nfunction $c4d1694fa24f1a71$var$monotoneCompute(points, mK, indexAxis = \"x\") {\n const valueAxis = $c4d1694fa24f1a71$var$getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta, pointBefore, pointCurrent;\n let pointAfter = $c4d1694fa24f1a71$var$getPoint(points, 0);\n for(let i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = $c4d1694fa24f1a71$var$getPoint(points, i + 1);\n if (!pointCurrent) continue;\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */ function $c4d1694fa24f1a71$export$527e9aa3390079e9(points, indexAxis = \"x\") {\n const valueAxis = $c4d1694fa24f1a71$var$getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK = Array(pointsLen).fill(0);\n const mK = Array(pointsLen);\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore, pointCurrent;\n let pointAfter = $c4d1694fa24f1a71$var$getPoint(points, 0);\n for(i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = $c4d1694fa24f1a71$var$getPoint(points, i + 1);\n if (!pointCurrent) continue;\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : $c4d1694fa24f1a71$export$2408f22a0fab9ae5(deltaK[i - 1]) !== $c4d1694fa24f1a71$export$2408f22a0fab9ae5(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n $c4d1694fa24f1a71$var$monotoneAdjust(points, deltaK, mK);\n $c4d1694fa24f1a71$var$monotoneCompute(points, mK, indexAxis);\n}\nfunction $c4d1694fa24f1a71$var$capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n}\nfunction $c4d1694fa24f1a71$var$capBezierPoints(points, area) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = $c4d1694fa24f1a71$export$e7094788287c5e9b(points[0], area);\n for(i = 0, ilen = points.length; i < ilen; ++i){\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && $c4d1694fa24f1a71$export$e7094788287c5e9b(points[i + 1], area);\n if (!inArea) continue;\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = $c4d1694fa24f1a71$var$capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = $c4d1694fa24f1a71$var$capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = $c4d1694fa24f1a71$var$capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = $c4d1694fa24f1a71$var$capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$ab83b03e4111b1d0(points, options, area, loop, indexAxis) {\n let i, ilen, point, controlPoints;\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) points = points.filter((pt)=>!pt.skip);\n if (options.cubicInterpolationMode === \"monotone\") $c4d1694fa24f1a71$export$527e9aa3390079e9(points, indexAxis);\n else {\n let prev = loop ? points[points.length - 1] : points[0];\n for(i = 0, ilen = points.length; i < ilen; ++i){\n point = points[i];\n controlPoints = $c4d1694fa24f1a71$export$e171bab687b50e0(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension);\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n if (options.capBezierPoints) $c4d1694fa24f1a71$var$capBezierPoints(points, area);\n}\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */ /**\n * @private\n */ function $c4d1694fa24f1a71$export$3a1a48c8f6ef640e() {\n return typeof window !== \"undefined\" && typeof document !== \"undefined\";\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$9bb611d729802a56(domNode) {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === \"[object ShadowRoot]\") parent = parent.host;\n return parent;\n}\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */ function $c4d1694fa24f1a71$var$parseMaxStyle(styleValue, node, parentProperty) {\n let valueInPixels;\n if (typeof styleValue === \"string\") {\n valueInPixels = parseInt(styleValue, 10);\n if (styleValue.indexOf(\"%\") !== -1) // percentage * size in dimension\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n } else valueInPixels = styleValue;\n return valueInPixels;\n}\nconst $c4d1694fa24f1a71$var$getComputedStyle = (element)=>element.ownerDocument.defaultView.getComputedStyle(element, null);\nfunction $c4d1694fa24f1a71$export$a17c37559e1db147(el, property) {\n return $c4d1694fa24f1a71$var$getComputedStyle(el).getPropertyValue(property);\n}\nconst $c4d1694fa24f1a71$var$positions = [\n \"top\",\n \"right\",\n \"bottom\",\n \"left\"\n];\nfunction $c4d1694fa24f1a71$var$getPositionedStyle(styles, style, suffix) {\n const result = {};\n suffix = suffix ? \"-\" + suffix : \"\";\n for(let i = 0; i < 4; i++){\n const pos = $c4d1694fa24f1a71$var$positions[i];\n result[pos] = parseFloat(styles[style + \"-\" + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\nconst $c4d1694fa24f1a71$var$useOffsetPos = (x, y, target)=>(x > 0 || y > 0) && (!target || !target.shadowRoot);\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */ function $c4d1694fa24f1a71$var$getCanvasPosition(e, canvas) {\n const touches = e.touches;\n const source = touches && touches.length ? touches[0] : e;\n const { offsetX: offsetX, offsetY: offsetY } = source;\n let box = false;\n let x, y;\n if ($c4d1694fa24f1a71$var$useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {\n x: x,\n y: y,\n box: box\n };\n}\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */ function $c4d1694fa24f1a71$export$df995fae86a55f06(event, chart) {\n if (\"native\" in event) return event;\n const { canvas: canvas, currentDevicePixelRatio: currentDevicePixelRatio } = chart;\n const style = $c4d1694fa24f1a71$var$getComputedStyle(canvas);\n const borderBox = style.boxSizing === \"border-box\";\n const paddings = $c4d1694fa24f1a71$var$getPositionedStyle(style, \"padding\");\n const borders = $c4d1694fa24f1a71$var$getPositionedStyle(style, \"border\", \"width\");\n const { x: x, y: y, box: box } = $c4d1694fa24f1a71$var$getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n let { width: width, height: height } = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\nfunction $c4d1694fa24f1a71$var$getContainerSize(canvas, width, height) {\n let maxWidth, maxHeight;\n if (width === undefined || height === undefined) {\n const container = $c4d1694fa24f1a71$export$9bb611d729802a56(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = $c4d1694fa24f1a71$var$getComputedStyle(container);\n const containerBorder = $c4d1694fa24f1a71$var$getPositionedStyle(containerStyle, \"border\", \"width\");\n const containerPadding = $c4d1694fa24f1a71$var$getPositionedStyle(containerStyle, \"padding\");\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = $c4d1694fa24f1a71$var$parseMaxStyle(containerStyle.maxWidth, container, \"clientWidth\");\n maxHeight = $c4d1694fa24f1a71$var$parseMaxStyle(containerStyle.maxHeight, container, \"clientHeight\");\n }\n }\n return {\n width: width,\n height: height,\n maxWidth: maxWidth || $c4d1694fa24f1a71$export$2ec5befb9e6c97d4,\n maxHeight: maxHeight || $c4d1694fa24f1a71$export$2ec5befb9e6c97d4\n };\n}\nconst $c4d1694fa24f1a71$var$round1 = (v)=>Math.round(v * 10) / 10;\n// eslint-disable-next-line complexity\nfunction $c4d1694fa24f1a71$export$2329c99376c9d0a4(canvas, bbWidth, bbHeight, aspectRatio) {\n const style = $c4d1694fa24f1a71$var$getComputedStyle(canvas);\n const margins = $c4d1694fa24f1a71$var$getPositionedStyle(style, \"margin\");\n const maxWidth = $c4d1694fa24f1a71$var$parseMaxStyle(style.maxWidth, canvas, \"clientWidth\") || $c4d1694fa24f1a71$export$2ec5befb9e6c97d4;\n const maxHeight = $c4d1694fa24f1a71$var$parseMaxStyle(style.maxHeight, canvas, \"clientHeight\") || $c4d1694fa24f1a71$export$2ec5befb9e6c97d4;\n const containerSize = $c4d1694fa24f1a71$var$getContainerSize(canvas, bbWidth, bbHeight);\n let { width: width, height: height } = containerSize;\n if (style.boxSizing === \"content-box\") {\n const borders = $c4d1694fa24f1a71$var$getPositionedStyle(style, \"border\", \"width\");\n const paddings = $c4d1694fa24f1a71$var$getPositionedStyle(style, \"padding\");\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = $c4d1694fa24f1a71$var$round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = $c4d1694fa24f1a71$var$round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = $c4d1694fa24f1a71$var$round1(width / 2);\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = $c4d1694fa24f1a71$var$round1(Math.floor(height * aspectRatio));\n }\n return {\n width: width,\n height: height\n };\n}\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */ function $c4d1694fa24f1a71$export$f787f51d84a910ad(chart, forceRatio, forceStyle) {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n const canvas = chart.canvas;\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */ const $c4d1694fa24f1a71$export$3466f893ebf79586 = function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive () {\n passiveSupported = true;\n return false;\n }\n };\n window.addEventListener(\"test\", null, options);\n window.removeEventListener(\"test\", null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}();\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */ function $c4d1694fa24f1a71$export$b4171a6734a65d42(element, property) {\n const value = $c4d1694fa24f1a71$export$a17c37559e1db147(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$8a5498727ef6be21(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$7a38258bbe170828(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === \"middle\" ? t < 0.5 ? p1.y : p2.y : mode === \"after\" ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y\n };\n}\n/**\n * @private\n */ function $c4d1694fa24f1a71$export$2f6ca3d3b1f80bf5(p1, p2, t, mode) {\n const cp1 = {\n x: p1.cp2x,\n y: p1.cp2y\n };\n const cp2 = {\n x: p2.cp1x,\n y: p2.cp1y\n };\n const a = $c4d1694fa24f1a71$export$8a5498727ef6be21(p1, cp1, t);\n const b = $c4d1694fa24f1a71$export$8a5498727ef6be21(cp1, cp2, t);\n const c = $c4d1694fa24f1a71$export$8a5498727ef6be21(cp2, p2, t);\n const d = $c4d1694fa24f1a71$export$8a5498727ef6be21(a, b, t);\n const e = $c4d1694fa24f1a71$export$8a5498727ef6be21(b, c, t);\n return $c4d1694fa24f1a71$export$8a5498727ef6be21(d, e, t);\n}\nconst $c4d1694fa24f1a71$var$getRightToLeftAdapter = function(rectX, width) {\n return {\n x (x) {\n return rectX + rectX + width - x;\n },\n setWidth (w) {\n width = w;\n },\n textAlign (align) {\n if (align === \"center\") return align;\n return align === \"right\" ? \"left\" : \"right\";\n },\n xPlus (x, value) {\n return x - value;\n },\n leftForLtr (x, itemWidth) {\n return x - itemWidth;\n }\n };\n};\nconst $c4d1694fa24f1a71$var$getLeftToRightAdapter = function() {\n return {\n x (x) {\n return x;\n },\n setWidth (w) {},\n textAlign (align) {\n return align;\n },\n xPlus (x, value) {\n return x + value;\n },\n leftForLtr (x, _itemWidth) {\n return x;\n }\n };\n};\nfunction $c4d1694fa24f1a71$export$3d12bd131bb975d1(rtl, rectX, width) {\n return rtl ? $c4d1694fa24f1a71$var$getRightToLeftAdapter(rectX, width) : $c4d1694fa24f1a71$var$getLeftToRightAdapter();\n}\nfunction $c4d1694fa24f1a71$export$91c6e00c14e7e6fd(ctx, direction) {\n let style, original;\n if (direction === \"ltr\" || direction === \"rtl\") {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue(\"direction\"),\n style.getPropertyPriority(\"direction\")\n ];\n style.setProperty(\"direction\", direction, \"important\");\n ctx.prevTextDirection = original;\n }\n}\nfunction $c4d1694fa24f1a71$export$890c4ad488842ce7(ctx, original) {\n if (original !== undefined) {\n delete ctx.prevTextDirection;\n ctx.canvas.style.setProperty(\"direction\", original[0], original[1]);\n }\n}\nfunction $c4d1694fa24f1a71$var$propertyFn(property) {\n if (property === \"angle\") return {\n between: $c4d1694fa24f1a71$export$ffb5f4729a158638,\n compare: $c4d1694fa24f1a71$export$c18d01048907ea92,\n normalize: $c4d1694fa24f1a71$export$28f7fcd39efa255\n };\n return {\n between: $c4d1694fa24f1a71$export$3b513254972cfc9c,\n compare: (a, b)=>a - b,\n normalize: (x)=>x\n };\n}\nfunction $c4d1694fa24f1a71$var$normalizeSegment({ start: start, end: end, count: count, loop: loop, style: style }) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style: style\n };\n}\nfunction $c4d1694fa24f1a71$var$getSegment(segment, points, bounds) {\n const { property: property, start: startBound, end: endBound } = bounds;\n const { between: between, normalize: normalize } = $c4d1694fa24f1a71$var$propertyFn(property);\n const count = points.length;\n let { start: start, end: end, loop: loop } = segment;\n let i, ilen;\n if (loop) {\n start += count;\n end += count;\n for(i = 0, ilen = count; i < ilen; ++i){\n if (!between(normalize(points[start % count][property]), startBound, endBound)) break;\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n if (end < start) end += count;\n return {\n start: start,\n end: end,\n loop: loop,\n style: segment.style\n };\n}\nfunction $c4d1694fa24f1a71$export$9fa96a7d116ea3ce(segment, points, bounds) {\n if (!bounds) return [\n segment\n ];\n const { property: property, start: startBound, end: endBound } = bounds;\n const count = points.length;\n const { compare: compare, between: between, normalize: normalize } = $c4d1694fa24f1a71$var$propertyFn(property);\n const { start: start, end: end, loop: loop, style: style } = $c4d1694fa24f1a71$var$getSegment(segment, points, bounds);\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n const startIsBefore = ()=>between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = ()=>compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = ()=>inside || startIsBefore();\n const shouldStop = ()=>!inside || endIsBefore();\n for(let i = start, prev = start; i <= end; ++i){\n point = points[i % count];\n if (point.skip) continue;\n value = normalize(point[property]);\n if (value === prevValue) continue;\n inside = between(value, startBound, endBound);\n if (subStart === null && shouldStart()) subStart = compare(value, startBound) === 0 ? i : prev;\n if (subStart !== null && shouldStop()) {\n result.push($c4d1694fa24f1a71$var$normalizeSegment({\n start: subStart,\n end: i,\n loop: loop,\n count: count,\n style: style\n }));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n if (subStart !== null) result.push($c4d1694fa24f1a71$var$normalizeSegment({\n start: subStart,\n end: end,\n loop: loop,\n count: count,\n style: style\n }));\n return result;\n}\nfunction $c4d1694fa24f1a71$export$306ddfe3a8403e2(line, bounds) {\n const result = [];\n const segments = line.segments;\n for(let i = 0; i < segments.length; i++){\n const sub = $c4d1694fa24f1a71$export$9fa96a7d116ea3ce(segments[i], line.points, bounds);\n if (sub.length) result.push(...sub);\n }\n return result;\n}\nfunction $c4d1694fa24f1a71$var$findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n if (loop && !spanGaps) while(start < count && !points[start].skip)start++;\n while(start < count && points[start].skip)start++;\n start %= count;\n if (loop) end += start;\n while(end > start && points[end % count].skip)end--;\n end %= count;\n return {\n start: start,\n end: end\n };\n}\nfunction $c4d1694fa24f1a71$var$solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n for(end = start + 1; end <= max; ++end){\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({\n start: start % count,\n end: (end - 1) % count,\n loop: loop\n });\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) start = end;\n }\n prev = cur;\n }\n if (last !== null) result.push({\n start: start % count,\n end: last % count,\n loop: loop\n });\n return result;\n}\nfunction $c4d1694fa24f1a71$export$1a82df3d29112e01(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n if (!count) return [];\n const loop = !!line._loop;\n const { start: start, end: end } = $c4d1694fa24f1a71$var$findStartAndEnd(points, count, loop, spanGaps);\n if (spanGaps === true) return $c4d1694fa24f1a71$var$splitByStyles(line, [\n {\n start: start,\n end: end,\n loop: loop\n }\n ], points, segmentOptions);\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return $c4d1694fa24f1a71$var$splitByStyles(line, $c4d1694fa24f1a71$var$solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\nfunction $c4d1694fa24f1a71$var$splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) return segments;\n return $c4d1694fa24f1a71$var$doSplitByStyles(line, segments, points, segmentOptions);\n}\nfunction $c4d1694fa24f1a71$var$doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = $c4d1694fa24f1a71$var$readStyle(line.options);\n const { _datasetIndex: datasetIndex, options: { spanGaps: spanGaps } } = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) return;\n s += count;\n while(points[s % count].skip)s -= dir;\n while(points[e % count].skip)e += dir;\n if (s % count !== e % count) {\n result.push({\n start: s % count,\n end: e % count,\n loop: l,\n style: st\n });\n prevStyle = st;\n start = e % count;\n }\n }\n for (const segment of segments){\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for(i = start + 1; i <= segment.end; i++){\n const pt = points[i % count];\n style = $c4d1694fa24f1a71$var$readStyle(segmentOptions.setContext($c4d1694fa24f1a71$export$35e795649ee09318(chartContext, {\n type: \"segment\",\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex: datasetIndex\n })));\n if ($c4d1694fa24f1a71$var$styleChanged(style, prevStyle)) addStyle(start, i - 1, segment.loop, prevStyle);\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) addStyle(start, i - 1, segment.loop, prevStyle);\n }\n return result;\n}\nfunction $c4d1694fa24f1a71$var$readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\nfunction $c4d1694fa24f1a71$var$styleChanged(style, prevStyle) {\n if (!prevStyle) return false;\n const cache = [];\n const replacer = function(key, value) {\n if (!$c4d1694fa24f1a71$export$f96d196f7728bb5(value)) return value;\n if (!cache.includes(value)) cache.push(value);\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n\n\n\nclass $dfc006ada1995968$var$Animator {\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n callbacks.forEach((fn)=>fn({\n chart: chart,\n initial: anims.initial,\n numSteps: numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n _refresh() {\n if (this._request) return;\n this._running = true;\n this._request = (0, $c4d1694fa24f1a71$export$43caf9889c228507).call(window, ()=>{\n this._update();\n this._request = null;\n if (this._running) this._refresh();\n });\n }\n _update(date = Date.now()) {\n let remaining = 0;\n this._charts.forEach((anims, chart)=>{\n if (!anims.running || !anims.items.length) return;\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n for(; i >= 0; --i){\n item = items[i];\n if (item._active) {\n if (item._total > anims.duration) anims.duration = item._total;\n item.tick(date);\n draw = true;\n } else {\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, \"progress\");\n }\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, \"complete\");\n anims.initial = false;\n }\n remaining += items.length;\n });\n this._lastDate = date;\n if (remaining === 0) this._running = false;\n }\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n add(chart, items) {\n if (!items || !items.length) return;\n this._getAnims(chart).items.push(...items);\n }\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) return;\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur)=>Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n running(chart) {\n if (!this._running) return false;\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) return false;\n return true;\n }\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) return;\n const items = anims.items;\n let i = items.length - 1;\n for(; i >= 0; --i)items[i].cancel();\n anims.items = [];\n this._notify(chart, anims, Date.now(), \"complete\");\n }\n remove(chart) {\n return this._charts.delete(chart);\n }\n constructor(){\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n}\nvar $dfc006ada1995968$export$a424a0aa8f687495 = /* #__PURE__ */ new $dfc006ada1995968$var$Animator();\nconst $dfc006ada1995968$var$transparent = \"transparent\";\nconst $dfc006ada1995968$var$interpolators = {\n boolean (from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n color (from, to, factor) {\n const c0 = (0, $c4d1694fa24f1a71$export$db3b6bfb95261072)(from || $dfc006ada1995968$var$transparent);\n const c1 = c0.valid && (0, $c4d1694fa24f1a71$export$db3b6bfb95261072)(to || $dfc006ada1995968$var$transparent);\n return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to;\n },\n number (from, to, factor) {\n return from + (to - from) * factor;\n }\n};\nclass $dfc006ada1995968$export$c35d437ae5945fcd {\n active() {\n return this._active;\n }\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = (0, $c4d1694fa24f1a71$export$407448d2b89b1813)([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n this._from = (0, $c4d1694fa24f1a71$export$407448d2b89b1813)([\n cfg.from,\n currentValue,\n to\n ]);\n }\n }\n cancel() {\n if (this._active) {\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n this._active = from !== to && (loop || elapsed < duration);\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n factor = elapsed / duration % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n this._target[prop] = this._fn(from, to, factor);\n }\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej)=>{\n promises.push({\n res: res,\n rej: rej\n });\n });\n }\n _notify(resolved) {\n const method = resolved ? \"res\" : \"rej\";\n const promises = this._promises || [];\n for(let i = 0; i < promises.length; i++)promises[i][method]();\n }\n constructor(cfg, target, prop, to){\n const currentValue = target[prop];\n to = (0, $c4d1694fa24f1a71$export$407448d2b89b1813)([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n const from = (0, $c4d1694fa24f1a71$export$407448d2b89b1813)([\n cfg.from,\n currentValue,\n to\n ]);\n this._active = true;\n this._fn = cfg.fn || $dfc006ada1995968$var$interpolators[cfg.type || typeof from];\n this._easing = (0, $c4d1694fa24f1a71$export$f1e1789686576879)[cfg.easing] || (0, $c4d1694fa24f1a71$export$f1e1789686576879).linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n}\nclass $dfc006ada1995968$export$8ab227dac26677d {\n configure(config) {\n if (!(0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(config)) return;\n const animationOptions = Object.keys((0, $c4d1694fa24f1a71$export$4368d992c4eafac0).animation);\n const animatedProps = this._properties;\n Object.getOwnPropertyNames(config).forEach((key)=>{\n const cfg = config[key];\n if (!(0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(cfg)) return;\n const resolved = {};\n for (const option of animationOptions)resolved[option] = cfg[option];\n ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(cfg.properties) && cfg.properties || [\n key\n ]).forEach((prop)=>{\n if (prop === key || !animatedProps.has(prop)) animatedProps.set(prop, resolved);\n });\n });\n }\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = $dfc006ada1995968$var$resolveTargetOptions(target, newOptions);\n if (!options) return [];\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) $dfc006ada1995968$var$awaitAll(target.options.$animations, newOptions).then(()=>{\n target.options = newOptions;\n }, ()=>{});\n return animations;\n }\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n for(i = props.length - 1; i >= 0; --i){\n const prop = props[i];\n if (prop.charAt(0) === \"$\") continue;\n if (prop === \"options\") {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n if (animation) {\n if (cfg && animation.active()) {\n animation.update(cfg, value, date);\n continue;\n } else animation.cancel();\n }\n if (!cfg || !cfg.duration) {\n target[prop] = value;\n continue;\n }\n running[prop] = animation = new $dfc006ada1995968$export$c35d437ae5945fcd(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n update(target, values) {\n if (this._properties.size === 0) {\n Object.assign(target, values);\n return;\n }\n const animations = this._createAnimations(target, values);\n if (animations.length) {\n $dfc006ada1995968$export$a424a0aa8f687495.add(this._chart, animations);\n return true;\n }\n }\n constructor(chart, config){\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n}\nfunction $dfc006ada1995968$var$awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for(let i = 0; i < keys.length; i++){\n const anim = animations[keys[i]];\n if (anim && anim.active()) running.push(anim.wait());\n }\n return Promise.all(running);\n}\nfunction $dfc006ada1995968$var$resolveTargetOptions(target, newOptions) {\n if (!newOptions) return;\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) target.options = options = Object.assign({}, options, {\n $shared: false,\n $animations: {}\n });\n return options;\n}\nfunction $dfc006ada1995968$var$scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\nfunction $dfc006ada1995968$var$defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) return false;\n const x = $dfc006ada1995968$var$scaleClip(xScale, allowedOverflow);\n const y = $dfc006ada1995968$var$scaleClip(yScale, allowedOverflow);\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\nfunction $dfc006ada1995968$var$toClip(value) {\n let t, r, b, l;\n if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else t = r = b = l = value;\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\nfunction $dfc006ada1995968$var$getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i)keys.push(metasets[i].index);\n return keys;\n}\nfunction $dfc006ada1995968$var$applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === \"single\";\n let i, ilen, datasetIndex, otherValue;\n if (value === null) return;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) continue;\n break;\n }\n otherValue = stack.values[datasetIndex];\n if ((0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(otherValue) && (singleMode || value === 0 || (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(value) === (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(otherValue))) value += otherValue;\n }\n return value;\n}\nfunction $dfc006ada1995968$var$convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\nfunction $dfc006ada1995968$var$isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || stacked === undefined && meta.stack !== undefined;\n}\nfunction $dfc006ada1995968$var$getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction $dfc006ada1995968$var$getUserBounds(scale) {\n const { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\nfunction $dfc006ada1995968$var$getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction $dfc006ada1995968$var$getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()){\n const value = stack[meta.index];\n if (positive && value > 0 || !positive && value < 0) return meta.index;\n }\n return null;\n}\nfunction $dfc006ada1995968$var$updateStacks(controller, parsed) {\n const { chart: chart, _cachedMeta: meta } = controller;\n const stacks = chart._stacks || (chart._stacks = {});\n const { iScale: iScale, vScale: vScale, index: datasetIndex } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = $dfc006ada1995968$var$getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n for(let i = 0; i < ilen; ++i){\n const item = parsed[i];\n const { [iAxis]: index, [vAxis]: value } = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = $dfc006ada1995968$var$getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n stack._top = $dfc006ada1995968$var$getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = $dfc006ada1995968$var$getLastIndexInStack(stack, vScale, false, meta.type);\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\nfunction $dfc006ada1995968$var$getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter((key)=>scales[key].axis === axis).shift();\n}\nfunction $dfc006ada1995968$var$createDatasetContext(parent, index) {\n return (0, $c4d1694fa24f1a71$export$35e795649ee09318)(parent, {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index: index,\n mode: \"default\",\n type: \"dataset\"\n });\n}\nfunction $dfc006ada1995968$var$createDataContext(parent, index, element) {\n return (0, $c4d1694fa24f1a71$export$35e795649ee09318)(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element: element,\n index: index,\n mode: \"default\",\n type: \"data\"\n });\n}\nfunction $dfc006ada1995968$var$clearStacks(meta, items) {\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) return;\n items = items || meta._parsed;\n for (const parsed of items){\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) return;\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) delete stacks[axis]._visualValues[datasetIndex];\n }\n}\nconst $dfc006ada1995968$var$isDirectUpdateMode = (mode)=>mode === \"reset\" || mode === \"none\";\nconst $dfc006ada1995968$var$cloneIfNotShared = (cached, shared)=>shared ? cached : Object.assign({}, cached);\nconst $dfc006ada1995968$var$createStack = (canStack, meta, chart)=>canStack && !meta.hidden && meta._stacked && {\n keys: $dfc006ada1995968$var$getSortedDatasetIndices(chart, true),\n values: null\n };\nclass $dfc006ada1995968$export$75572ec5c55b4048 {\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = $dfc006ada1995968$var$isStacked(meta.vScale, meta);\n this.addElements();\n if (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\");\n }\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) $dfc006ada1995968$var$clearStacks(this._cachedMeta);\n this.index = datasetIndex;\n }\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n const chooseId = (axis, x, y, r)=>axis === \"x\" ? x : axis === \"r\" ? r : y;\n const xid = meta.xAxisID = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(dataset.xAxisID, $dfc006ada1995968$var$getFirstScaleId(chart, \"x\"));\n const yid = meta.yAxisID = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(dataset.yAxisID, $dfc006ada1995968$var$getFirstScaleId(chart, \"y\"));\n const rid = meta.rAxisID = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(dataset.rAxisID, $dfc006ada1995968$var$getFirstScaleId(chart, \"r\"));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale ? meta.vScale : meta.iScale;\n }\n reset() {\n this._update(\"reset\");\n }\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) (0, $c4d1694fa24f1a71$export$3b14a55fb2447963)(this._data, this);\n if (meta._stacked) $dfc006ada1995968$var$clearStacks(meta);\n }\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(data)) this._data = $dfc006ada1995968$var$convertObjectDataToArray(data);\n else if (_data !== data) {\n if (_data) {\n (0, $c4d1694fa24f1a71$export$3b14a55fb2447963)(_data, this);\n const meta = this._cachedMeta;\n $dfc006ada1995968$var$clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) (0, $c4d1694fa24f1a71$export$882b5998b3b9117c)(data, this);\n this._syncList = [];\n this._data = data;\n }\n }\n addElements() {\n const meta = this._cachedMeta;\n this._dataCheck();\n if (this.datasetElementType) meta.dataset = new this.datasetElementType();\n }\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n this._dataCheck();\n const oldStacked = meta._stacked;\n meta._stacked = $dfc006ada1995968$var$isStacked(meta.vScale, meta);\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n $dfc006ada1995968$var$clearStacks(meta);\n meta.stack = dataset.stack;\n }\n this._resyncElements(resetNewElements);\n if (stackChanged || oldStacked !== meta._stacked) $dfc006ada1995968$var$updateStacks(this, meta._parsed);\n }\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n parse(start, count) {\n const { _cachedMeta: meta, _data: data } = this;\n const { iScale: iScale, _stacked: _stacked } = meta;\n const iAxis = iScale.axis;\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(data[start])) parsed = this.parseArrayData(meta, data, start, count);\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(data[start])) parsed = this.parseObjectData(meta, data, start, count);\n else parsed = this.parsePrimitiveData(meta, data, start, count);\n const isNotInOrderComparedToPrev = ()=>cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];\n for(i = 0; i < count; ++i){\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) sorted = false;\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n if (_stacked) $dfc006ada1995968$var$updateStacks(this, parsed);\n }\n parsePrimitiveData(meta, data, start, count) {\n const { iScale: iScale, vScale: vScale } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const { xScale: xScale, yScale: yScale } = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const { xScale: xScale, yScale: yScale } = meta;\n const { xAxisKey: xAxisKey = \"x\", yAxisKey: yAxisKey = \"y\" } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse((0, $c4d1694fa24f1a71$export$2d1720544b23b823)(item, xAxisKey), index),\n y: yScale.parse((0, $c4d1694fa24f1a71$export$2d1720544b23b823)(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: $dfc006ada1995968$var$getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return $dfc006ada1995968$var$applyStack(stack, value, meta.index, {\n mode: mode\n });\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = $dfc006ada1995968$var$applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = $dfc006ada1995968$var$createStack(canStack, meta, this.chart);\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n const { min: otherMin, max: otherMax } = $dfc006ada1995968$var$getUserBounds(otherScale);\n let i, parsed;\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !(0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n for(i = 0; i < ilen; ++i){\n if (_skip()) continue;\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) break;\n }\n if (sorted) for(i = ilen - 1; i >= 0; --i){\n if (_skip()) continue;\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n return range;\n }\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n for(i = 0, ilen = parsed.length; i < ilen; ++i){\n value = parsed[i][scale.axis];\n if ((0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(value)) values.push(value);\n }\n return values;\n }\n getMaxOverflow() {\n return false;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? \"\" + iScale.getLabelForValue(parsed[iScale.axis]) : \"\",\n value: vScale ? \"\" + vScale.getLabelForValue(parsed[vScale.axis]) : \"\"\n };\n }\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || \"default\");\n meta._clip = $dfc006ada1995968$var$toClip((0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(this.options.clip, $dfc006ada1995968$var$defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n update(mode) {}\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || elements.length - start;\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n if (meta.dataset) meta.dataset.draw(ctx, area, start, count);\n for(i = start; i < start + count; ++i){\n const element = elements[i];\n if (element.hidden) continue;\n if (element.active && drawActiveElementsOnTop) active.push(element);\n else element.draw(ctx, area);\n }\n for(i = 0; i < active.length; ++i)active[i].draw(ctx, area);\n }\n getStyle(index, active) {\n const mode = active ? \"active\" : \"default\";\n return index === undefined && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index || 0, mode);\n }\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context || (element.$context = $dfc006ada1995968$var$createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context || (this.$context = $dfc006ada1995968$var$createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n _resolveElementOptions(elementType, mode = \"default\", index) {\n const active = mode === \"active\";\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + \"-\" + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && (0, $c4d1694fa24f1a71$export$dda1d9f60106f0e9)(index);\n if (cached) return $dfc006ada1995968$var$cloneIfNotShared(cached, sharing);\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [\n `${elementType}Hover`,\n \"hover\",\n elementType,\n \"\"\n ] : [\n elementType,\n \"\"\n ];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys((0, $c4d1694fa24f1a71$export$4368d992c4eafac0).elements[elementType]);\n const context = ()=>this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n if (values.$shared) {\n values.$shared = sharing;\n cache[cacheKey] = Object.freeze($dfc006ada1995968$var$cloneIfNotShared(values, sharing));\n }\n return values;\n }\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) return cached;\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new $dfc006ada1995968$export$8ab227dac26677d(chart, options && options.animations);\n if (options && options._cacheable) cache[cacheKey] = Object.freeze(animations);\n return animations;\n }\n getSharedOptions(options) {\n if (!options.$shared) return;\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || $dfc006ada1995968$var$isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions;\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {\n sharedOptions: sharedOptions,\n includeOptions: includeOptions\n };\n }\n updateElement(element, index, properties, mode) {\n if ($dfc006ada1995968$var$isDirectUpdateMode(mode)) Object.assign(element, properties);\n else this._resolveAnimations(index, mode).update(element, properties);\n }\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !$dfc006ada1995968$var$isDirectUpdateMode(mode)) this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n options: !active && this.getSharedOptions(options) || options\n });\n }\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, \"active\", false);\n }\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, \"active\", true);\n }\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) this._setStyle(element, undefined, \"active\", false);\n }\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) this._setStyle(element, undefined, \"active\", true);\n }\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n for (const [method, arg1, arg2] of this._syncList)this[method](arg1, arg2);\n this._syncList = [];\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n if (count) this.parse(0, count);\n if (numData > numMeta) this._insertElements(numMeta, numData - numMeta, resetNewElements);\n else if (numData < numMeta) this._removeElements(numData, numMeta - numData);\n }\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n const move = (arr)=>{\n arr.length += count;\n for(i = arr.length - 1; i >= end; i--)arr[i] = arr[i - count];\n };\n move(data);\n for(i = start; i < end; ++i)data[i] = new this.dataElementType();\n if (this._parsing) move(meta._parsed);\n this.parse(start, count);\n if (resetNewElements) this.updateElements(data, start, count, \"reset\");\n }\n updateElements(element, start, count, mode) {}\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) $dfc006ada1995968$var$clearStacks(meta, removed);\n }\n meta.data.splice(start, count);\n }\n _sync(args) {\n if (this._parsing) this._syncList.push(args);\n else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([\n this.index,\n ...args\n ]);\n }\n _onDataPush() {\n const count = arguments.length;\n this._sync([\n \"_insertElements\",\n this.getDataset().data.length - count,\n count\n ]);\n }\n _onDataPop() {\n this._sync([\n \"_removeElements\",\n this._cachedMeta.data.length - 1,\n 1\n ]);\n }\n _onDataShift() {\n this._sync([\n \"_removeElements\",\n 0,\n 1\n ]);\n }\n _onDataSplice(start, count) {\n if (count) this._sync([\n \"_removeElements\",\n start,\n count\n ]);\n const newCount = arguments.length - 2;\n if (newCount) this._sync([\n \"_insertElements\",\n start,\n newCount\n ]);\n }\n _onDataUnshift() {\n this._sync([\n \"_insertElements\",\n 0,\n arguments.length\n ]);\n }\n constructor(chart, datasetIndex){\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n this.initialize();\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$75572ec5c55b4048, \"defaults\", {});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$75572ec5c55b4048, \"datasetElementType\", null);\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$75572ec5c55b4048, \"dataElementType\", null);\nfunction $dfc006ada1995968$var$getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n for(let i = 0, ilen = visibleMetas.length; i < ilen; i++)values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n scale._cache.$bar = (0, $c4d1694fa24f1a71$export$71511d61b312f219)(values.sort((a, b)=>a - b));\n }\n return scale._cache.$bar;\n}\nfunction $dfc006ada1995968$var$computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = $dfc006ada1995968$var$getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = ()=>{\n if (curr === 32767 || curr === -32768) return;\n if ((0, $c4d1694fa24f1a71$export$dda1d9f60106f0e9)(prev)) min = Math.min(min, Math.abs(curr - prev) || min);\n prev = curr;\n };\n for(i = 0, ilen = values.length; i < ilen; ++i){\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n prev = undefined;\n for(i = 0, ilen = scale.ticks.length; i < ilen; ++i){\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n return min;\n}\nfunction $dfc006ada1995968$var$computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n size = thickness * stackCount;\n ratio = 1;\n }\n return {\n chunk: size / stackCount,\n ratio: ratio,\n start: ruler.pixels[index] - size / 2\n };\n}\nfunction $dfc006ada1995968$var$computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n if (prev === null) prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n if (next === null) next = curr + curr - prev;\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start: start\n };\n}\nfunction $dfc006ada1995968$var$parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n item[vScale.axis] = barEnd;\n item._custom = {\n barStart: barStart,\n barEnd: barEnd,\n start: startValue,\n end: endValue,\n min: min,\n max: max\n };\n}\nfunction $dfc006ada1995968$var$parseValue(entry, item, vScale, i) {\n if ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(entry)) $dfc006ada1995968$var$parseFloatBar(entry, item, vScale, i);\n else item[vScale.axis] = vScale.parse(entry, i);\n return item;\n}\nfunction $dfc006ada1995968$var$parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n for(i = start, ilen = start + count; i < ilen; ++i){\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push($dfc006ada1995968$var$parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\nfunction $dfc006ada1995968$var$isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction $dfc006ada1995968$var$barSign(size, vScale, actualBase) {\n if (size !== 0) return (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(size);\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction $dfc006ada1995968$var$borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = \"left\";\n end = \"right\";\n } else {\n reverse = properties.base < properties.y;\n start = \"bottom\";\n end = \"top\";\n }\n if (reverse) {\n top = \"end\";\n bottom = \"start\";\n } else {\n top = \"start\";\n bottom = \"end\";\n }\n return {\n start: start,\n end: end,\n reverse: reverse,\n top: top,\n bottom: bottom\n };\n}\nfunction $dfc006ada1995968$var$setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n if (edge === true) {\n properties.borderSkipped = {\n top: true,\n right: true,\n bottom: true,\n left: true\n };\n return;\n }\n const { start: start, end: end, reverse: reverse, top: top, bottom: bottom } = $dfc006ada1995968$var$borderProps(properties);\n if (edge === \"middle\" && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) edge = top;\n else if ((stack._bottom || 0) === index) edge = bottom;\n else {\n res[$dfc006ada1995968$var$parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n res[$dfc006ada1995968$var$parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\nfunction $dfc006ada1995968$var$parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = $dfc006ada1995968$var$swap(edge, a, b);\n edge = $dfc006ada1995968$var$startEnd(edge, b, a);\n } else edge = $dfc006ada1995968$var$startEnd(edge, a, b);\n return edge;\n}\nfunction $dfc006ada1995968$var$swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction $dfc006ada1995968$var$startEnd(v, start, end) {\n return v === \"start\" ? start : v === \"end\" ? end : v;\n}\nfunction $dfc006ada1995968$var$setInflateAmount(properties, { inflateAmount: inflateAmount }, ratio) {\n properties.inflateAmount = inflateAmount === \"auto\" ? ratio === 1 ? 0.33 : 0 : inflateAmount;\n}\nclass $dfc006ada1995968$export$e97d5dc64e999004 extends $dfc006ada1995968$export$75572ec5c55b4048 {\n parsePrimitiveData(meta, data, start, count) {\n return $dfc006ada1995968$var$parseArrayOrPrimitive(meta, data, start, count);\n }\n parseArrayData(meta, data, start, count) {\n return $dfc006ada1995968$var$parseArrayOrPrimitive(meta, data, start, count);\n }\n parseObjectData(meta, data, start, count) {\n const { iScale: iScale, vScale: vScale } = meta;\n const { xAxisKey: xAxisKey = \"x\", yAxisKey: yAxisKey = \"y\" } = this._parsing;\n const iAxisKey = iScale.axis === \"x\" ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === \"x\" ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for(i = start, ilen = start + count; i < ilen; ++i){\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse((0, $c4d1694fa24f1a71$export$2d1720544b23b823)(obj, iAxisKey), i);\n parsed.push($dfc006ada1995968$var$parseValue((0, $c4d1694fa24f1a71$export$2d1720544b23b823)(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n getMaxOverflow() {\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const { iScale: iScale, vScale: vScale } = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = $dfc006ada1995968$var$isFloatBar(custom) ? \"[\" + custom.start + \", \" + custom.end + \"]\" : \"\" + vScale.getLabelForValue(parsed[vScale.axis]);\n return {\n label: \"\" + iScale.getLabelForValue(parsed[iScale.axis]),\n value: value\n };\n }\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n updateElements(bars, start, count, mode) {\n const reset = mode === \"reset\";\n const { index: index, _cachedMeta: { vScale: vScale } } = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n for(let i = start; i < start + count; i++){\n const parsed = this.getParsed(i);\n const vpixels = reset || (0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(parsed[vScale.axis]) ? {\n base: base,\n head: base\n } : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n const properties = {\n horizontal: horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || $dfc006ada1995968$var$isFloatBar(parsed._custom) || index === stack._top || index === stack._bottom,\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? \"active\" : mode);\n const options = properties.options || bars[i].options;\n $dfc006ada1995968$var$setBorderSkipped(properties, options, stack, index);\n $dfc006ada1995968$var$setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n _getStacks(last, dataIndex) {\n const { iScale: iScale } = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const skipNull = (meta)=>{\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(val) || isNaN(val)) return true;\n };\n for (const meta of metasets){\n if (dataIndex !== undefined && skipNull(meta)) continue;\n if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === undefined && meta.stack === undefined) stacks.push(meta.stack);\n if (meta.index === last) break;\n }\n if (!stacks.length) stacks.push(undefined);\n return stacks;\n }\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = name !== undefined ? stacks.indexOf(name) : -1;\n return index === -1 ? stacks.length - 1 : index;\n }\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n for(i = 0, ilen = meta.data.length; i < ilen; ++i)pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n const barThickness = opts.barThickness;\n const min = barThickness || $dfc006ada1995968$var$computeMinSampleSize(meta);\n return {\n min: min,\n pixels: pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n _calculateBarValuePixels(index) {\n const { _cachedMeta: { vScale: vScale, _stacked: _stacked, index: datasetIndex }, options: { base: baseValue, minBarLength: minBarLength } } = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = $dfc006ada1995968$var$isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n if (length !== value) {\n start = length - value;\n length = value;\n }\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n if (value !== 0 && (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(value) !== (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(custom.barEnd)) start = 0;\n start += value;\n }\n const startValue = !(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n if (this.chart.getDataVisibility(index)) head = vScale.getPixelForValue(start + length);\n else head = base;\n size = head - base;\n if (Math.abs(size) < minBarLength) {\n size = $dfc006ada1995968$var$barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) base -= size / 2;\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n if (_stacked && !floating) parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n return {\n size: size,\n base: base,\n head: head,\n center: head + size / 2\n };\n }\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === \"flex\" ? $dfc006ada1995968$var$computeFlexCategoryTraits(index, ruler, options, stackCount) : $dfc006ada1995968$var$computeFitCategoryTraits(index, ruler, options, stackCount);\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + range.chunk * stackIndex + range.chunk / 2;\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n return {\n base: center - size / 2,\n head: center + size / 2,\n center: center,\n size: size\n };\n }\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n for(; i < ilen; ++i)if (this.getParsed(i)[vScale.axis] !== null) rects[i].draw(this._ctx);\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e97d5dc64e999004, \"id\", \"bar\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e97d5dc64e999004, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"bar\",\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"base\",\n \"width\",\n \"height\"\n ]\n }\n }\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e97d5dc64e999004, \"overrides\", {\n scales: {\n _index_: {\n type: \"category\",\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: \"linear\",\n beginAtZero: true\n }\n }\n});\nclass $dfc006ada1995968$export$19b5c4773f17abe extends $dfc006ada1995968$export$75572ec5c55b4048 {\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++)parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i)max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n return max > 0 && max;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale: xScale, yScale: yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n return {\n label: labels[index] || \"\",\n value: \"(\" + x + \", \" + y + (r ? \", \" + r : \"\") + \")\"\n };\n }\n update(mode) {\n const points = this._cachedMeta.data;\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === \"reset\";\n const { iScale: iScale, vScale: vScale } = this._cachedMeta;\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n if (reset) properties.options.radius = 0;\n }\n this.updateElement(point, i, properties, mode);\n }\n }\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n if (values.$shared) values = Object.assign({}, values, {\n $shared: false\n });\n const radius = values.radius;\n if (mode !== \"active\") values.radius = 0;\n values.radius += (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(parsed && parsed._custom, radius);\n return values;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$19b5c4773f17abe, \"id\", \"bubble\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$19b5c4773f17abe, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"point\",\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"borderWidth\",\n \"radius\"\n ]\n }\n }\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$19b5c4773f17abe, \"overrides\", {\n scales: {\n x: {\n type: \"linear\"\n },\n y: {\n type: \"linear\"\n }\n }\n});\nfunction $dfc006ada1995968$var$getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n if (circumference < (0, $c4d1694fa24f1a71$export$971d5caa766a69d7)) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b)=>(0, $c4d1694fa24f1a71$export$ffb5f4729a158638)(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b)=>(0, $c4d1694fa24f1a71$export$ffb5f4729a158638)(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax((0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd), startY, endY);\n const minX = calcMin((0, $c4d1694fa24f1a71$export$56c0d5a1e737357d), startX, endX);\n const minY = calcMin((0, $c4d1694fa24f1a71$export$56c0d5a1e737357d) + (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd), startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {\n ratioX: ratioX,\n ratioY: ratioY,\n offsetX: offsetX,\n offsetY: offsetY\n };\n}\nclass $dfc006ada1995968$export$e04603e7d8b77172 extends $dfc006ada1995968$export$75572ec5c55b4048 {\n linkScales() {}\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n if (this._parsing === false) meta._parsed = data;\n else {\n let getter = (i)=>+data[i];\n if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(data[start])) {\n const { key: key = \"value\" } = this._parsing;\n getter = (i)=>+(0, $c4d1694fa24f1a71$export$2d1720544b23b823)(data[i], key);\n }\n let i, ilen;\n for(i = start, ilen = start + count; i < ilen; ++i)meta._parsed[i] = getter(i);\n }\n }\n _getRotation() {\n return (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.options.rotation - 90);\n }\n _getCircumference() {\n return (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.options.circumference);\n }\n _getRotationExtents() {\n let min = (0, $c4d1694fa24f1a71$export$971d5caa766a69d7);\n let max = -(0, $c4d1694fa24f1a71$export$971d5caa766a69d7);\n for(let i = 0; i < this.chart.data.datasets.length; ++i)if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n return {\n rotation: min,\n circumference: max - min\n };\n }\n update(mode) {\n const chart = this.chart;\n const { chartArea: chartArea } = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min((0, $c4d1694fa24f1a71$export$953cecd6e717a553)(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n const { circumference: circumference, rotation: rotation } = this._getRotationExtents();\n const { ratioX: ratioX, ratioY: ratioY, offsetX: offsetX, offsetY: offsetY } = $dfc006ada1995968$var$getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = (0, $c4d1694fa24f1a71$export$7ccc53e8f1e7dfc5)(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n meta.total = this.calculateTotal();\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) return 0;\n return this.calculateCircumference(meta._parsed[i] * circumference / (0, $c4d1694fa24f1a71$export$971d5caa766a69d7));\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === \"reset\";\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n for(i = 0; i < start; ++i)startAngle += this._circumference(i, reset);\n for(i = start; i < start + count; ++i){\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle: startAngle,\n endAngle: startAngle + circumference,\n circumference: circumference,\n outerRadius: outerRadius,\n innerRadius: innerRadius\n };\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? \"active\" : mode);\n startAngle += circumference;\n this.updateElement(arc, i, properties, mode);\n }\n }\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n for(i = 0; i < metaData.length; i++){\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) total += Math.abs(value);\n }\n return total;\n }\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) return (0, $c4d1694fa24f1a71$export$971d5caa766a69d7) * (Math.abs(value) / total);\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = (0, $c4d1694fa24f1a71$export$ae1af26003f05816)(meta._parsed[index], chart.options.locale);\n return {\n label: labels[index] || \"\",\n value: value\n };\n }\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n if (!arcs) {\n for(i = 0, ilen = chart.data.datasets.length; i < ilen; ++i)if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n if (!arcs) return 0;\n for(i = 0, ilen = arcs.length; i < ilen; ++i){\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== \"inner\") max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n return max;\n }\n getMaxOffset(arcs) {\n let max = 0;\n for(let i = 0, ilen = arcs.length; i < ilen; ++i){\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n for(let i = 0; i < datasetIndex; ++i)if (this.chart.isDatasetVisible(i)) ringWeightOffset += this._getRingWeight(i);\n return ringWeightOffset;\n }\n _getRingWeight(datasetIndex) {\n return Math.max((0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e04603e7d8b77172, \"id\", \"doughnut\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e04603e7d8b77172, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"arc\",\n animation: {\n animateRotate: true,\n animateScale: false\n },\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"circumference\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\",\n \"startAngle\",\n \"x\",\n \"y\",\n \"offset\",\n \"borderWidth\",\n \"spacing\"\n ]\n }\n },\n cutout: \"50%\",\n rotation: 0,\n circumference: 360,\n radius: \"100%\",\n spacing: 0,\n indexAxis: \"r\"\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e04603e7d8b77172, \"descriptors\", {\n _scriptable: (name)=>name !== \"spacing\",\n _indexable: (name)=>name !== \"spacing\" && !name.startsWith(\"borderDash\") && !name.startsWith(\"hoverBorderDash\")\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e04603e7d8b77172, \"overrides\", {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle: pointStyle, color: color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n});\nclass $dfc006ada1995968$export$3c9b5d28c11cbfd0 extends $dfc006ada1995968$export$75572ec5c55b4048 {\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { dataset: line, data: points = [], _dataset: _dataset } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start: start, count: count } = (0, $c4d1694fa24f1a71$export$9e5f44173e64f162)(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if ((0, $c4d1694fa24f1a71$export$efccba1c4a2ef57b)(meta)) {\n start = 0;\n count = points.length;\n }\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) options.borderWidth = 0;\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options: options\n }, mode);\n this.updateElements(points, start, count, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === \"reset\";\n const { iScale: iScale, vScale: vScale, _stacked: _stacked, _dataset: _dataset } = this._cachedMeta;\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps: spanGaps, segment: segment } = this.options;\n const maxGapLength = (0, $c4d1694fa24f1a71$export$d141bba7fdc215a3)(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === \"none\";\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = 0; i < pointsCount; ++i){\n const point = points[i];\n const properties = directUpdate ? point : {};\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n const parsed = this.getParsed(i);\n const nullData = (0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n if (!directUpdate) this.updateElement(point, i, properties, mode);\n prevParsed = parsed;\n }\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) return border;\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$3c9b5d28c11cbfd0, \"id\", \"line\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$3c9b5d28c11cbfd0, \"defaults\", {\n datasetElementType: \"line\",\n dataElementType: \"point\",\n showLine: true,\n spanGaps: false\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$3c9b5d28c11cbfd0, \"overrides\", {\n scales: {\n _index_: {\n type: \"category\"\n },\n _value_: {\n type: \"linear\"\n }\n }\n});\nclass $dfc006ada1995968$export$2a270b3a0d973c85 extends $dfc006ada1995968$export$75572ec5c55b4048 {\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = (0, $c4d1694fa24f1a71$export$ae1af26003f05816)(meta._parsed[index].r, chart.options.locale);\n return {\n label: labels[index] || \"\",\n value: value\n };\n }\n parseObjectData(meta, data, start, count) {\n return (0, $c4d1694fa24f1a71$export$4a5767248b18ef41).bind(this)(meta, data, start, count);\n }\n update(mode) {\n const arcs = this._cachedMeta.data;\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n meta.data.forEach((element, index)=>{\n const parsed = this.getParsed(index).r;\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) range.min = parsed;\n if (parsed > range.max) range.max = parsed;\n }\n });\n return range;\n }\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n this.outerRadius = outerRadius - radiusLength * this.index;\n this.innerRadius = this.outerRadius - radiusLength;\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === \"reset\";\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * (0, $c4d1694fa24f1a71$export$56c0d5a1e737357d);\n let angle = datasetStartAngle;\n let i;\n const defaultAngle = 360 / this.countVisibleElements();\n for(i = 0; i < start; ++i)angle += this._computeAngle(i, mode, defaultAngle);\n for(i = start; i < start + count; i++){\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n if (reset) {\n if (animationOpts.animateScale) outerRadius = 0;\n if (animationOpts.animateRotate) startAngle = endAngle = datasetStartAngle;\n }\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius: outerRadius,\n startAngle: startAngle,\n endAngle: endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? \"active\" : mode)\n };\n this.updateElement(arc, i, properties, mode);\n }\n }\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n meta.data.forEach((element, index)=>{\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) count++;\n });\n return count;\n }\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index) ? (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.resolveDataElementOptions(index, mode).angle || defaultAngle) : 0;\n }\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$2a270b3a0d973c85, \"id\", \"polarArea\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$2a270b3a0d973c85, \"defaults\", {\n dataElementType: \"arc\",\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\"\n ]\n }\n },\n indexAxis: \"r\",\n startAngle: 0\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$2a270b3a0d973c85, \"overrides\", {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle: pointStyle, color: color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n scales: {\n r: {\n type: \"radialLinear\",\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n});\nclass $dfc006ada1995968$export$b21a3f1286706191 extends $dfc006ada1995968$export$e04603e7d8b77172 {\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$b21a3f1286706191, \"id\", \"pie\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$b21a3f1286706191, \"defaults\", {\n cutout: 0,\n rotation: 0,\n circumference: 360,\n radius: \"100%\"\n});\nclass $dfc006ada1995968$export$48dbc6ac651bf8be extends $dfc006ada1995968$export$75572ec5c55b4048 {\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: vScale.getLabels()[index],\n value: \"\" + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n parseObjectData(meta, data, start, count) {\n return (0, $c4d1694fa24f1a71$export$4a5767248b18ef41).bind(this)(meta, data, start, count);\n }\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n line.points = points;\n if (mode !== \"resize\") {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) options.borderWidth = 0;\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options: options\n };\n this.updateElement(line, undefined, properties, mode);\n }\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === \"reset\";\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n const properties = {\n x: x,\n y: y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options: options\n };\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$48dbc6ac651bf8be, \"id\", \"radar\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$48dbc6ac651bf8be, \"defaults\", {\n datasetElementType: \"line\",\n dataElementType: \"point\",\n indexAxis: \"r\",\n showLine: true,\n elements: {\n line: {\n fill: \"start\"\n }\n }\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$48dbc6ac651bf8be, \"overrides\", {\n aspectRatio: 1,\n scales: {\n r: {\n type: \"radialLinear\"\n }\n }\n});\nclass $dfc006ada1995968$export$b2f2bae6713db87 extends $dfc006ada1995968$export$75572ec5c55b4048 {\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale: xScale, yScale: yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n return {\n label: labels[index] || \"\",\n value: \"(\" + x + \", \" + y + \")\"\n };\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { data: points = [] } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start: start, count: count } = (0, $c4d1694fa24f1a71$export$9e5f44173e64f162)(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if ((0, $c4d1694fa24f1a71$export$efccba1c4a2ef57b)(meta)) {\n start = 0;\n count = points.length;\n }\n if (this.options.showLine) {\n if (!this.datasetElementType) this.addElements();\n const { dataset: line, _dataset: _dataset } = meta;\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options: options\n }, mode);\n } else if (this.datasetElementType) {\n delete meta.dataset;\n this.datasetElementType = false;\n }\n this.updateElements(points, start, count, mode);\n }\n addElements() {\n const { showLine: showLine } = this.options;\n if (!this.datasetElementType && showLine) this.datasetElementType = this.chart.registry.getElement(\"line\");\n super.addElements();\n }\n updateElements(points, start, count, mode) {\n const reset = mode === \"reset\";\n const { iScale: iScale, vScale: vScale, _stacked: _stacked, _dataset: _dataset } = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps: spanGaps, segment: segment } = this.options;\n const maxGapLength = (0, $c4d1694fa24f1a71$export$d141bba7fdc215a3)(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === \"none\";\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = start; i < start + count; ++i){\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = (0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n if (!directUpdate) this.updateElement(point, i, properties, mode);\n prevParsed = parsed;\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n if (!this.options.showLine) {\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i)max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n return max > 0 && max;\n }\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n if (!data.length) return border;\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$b2f2bae6713db87, \"id\", \"scatter\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$b2f2bae6713db87, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"point\",\n showLine: false,\n fill: false\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$b2f2bae6713db87, \"overrides\", {\n interaction: {\n mode: \"point\"\n },\n scales: {\n x: {\n type: \"linear\"\n },\n y: {\n type: \"linear\"\n }\n }\n});\nvar $dfc006ada1995968$export$a6506504f799c5d5 = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n BarController: $dfc006ada1995968$export$e97d5dc64e999004,\n BubbleController: $dfc006ada1995968$export$19b5c4773f17abe,\n DoughnutController: $dfc006ada1995968$export$e04603e7d8b77172,\n LineController: $dfc006ada1995968$export$3c9b5d28c11cbfd0,\n PieController: $dfc006ada1995968$export$b21a3f1286706191,\n PolarAreaController: $dfc006ada1995968$export$2a270b3a0d973c85,\n RadarController: $dfc006ada1995968$export$48dbc6ac651bf8be,\n ScatterController: $dfc006ada1995968$export$b2f2bae6713db87\n});\n/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */ function $dfc006ada1995968$var$abstract() {\n throw new Error(\"This method is not implemented: Check that a complete date adapter is provided.\");\n}\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */ class $dfc006ada1995968$var$DateAdapterBase {\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */ static override(members) {\n Object.assign($dfc006ada1995968$var$DateAdapterBase.prototype, members);\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n formats() {\n return $dfc006ada1995968$var$abstract();\n }\n parse() {\n return $dfc006ada1995968$var$abstract();\n }\n format() {\n return $dfc006ada1995968$var$abstract();\n }\n add() {\n return $dfc006ada1995968$var$abstract();\n }\n diff() {\n return $dfc006ada1995968$var$abstract();\n }\n startOf() {\n return $dfc006ada1995968$var$abstract();\n }\n endOf() {\n return $dfc006ada1995968$var$abstract();\n }\n constructor(options){\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"options\", void 0);\n this.options = options || {};\n }\n}\nvar $dfc006ada1995968$export$f32766ea09ec8bc4 = {\n _date: $dfc006ada1995968$var$DateAdapterBase\n};\nfunction $dfc006ada1995968$var$binarySearch(metaset, axis, value, intersect) {\n const { controller: controller, data: data, _sorted: _sorted } = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== \"r\" && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? (0, $c4d1694fa24f1a71$export$ebd11618f299a286) : (0, $c4d1694fa24f1a71$export$ef35774e6d314e91);\n if (!intersect) return lookupMethod(data, axis, value);\n else if (controller._sharedOptions) {\n const el = data[0];\n const range = typeof el.getRange === \"function\" && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {\n lo: start.lo,\n hi: end.hi\n };\n }\n }\n }\n return {\n lo: 0,\n hi: data.length - 1\n };\n}\nfunction $dfc006ada1995968$var$evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for(let i = 0, ilen = metasets.length; i < ilen; ++i){\n const { index: index, data: data } = metasets[i];\n const { lo: lo, hi: hi } = $dfc006ada1995968$var$binarySearch(metasets[i], axis, value, intersect);\n for(let j = lo; j <= hi; ++j){\n const element = data[j];\n if (!element.skip) handler(element, index, j);\n }\n }\n}\nfunction $dfc006ada1995968$var$getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf(\"x\") !== -1;\n const useY = axis.indexOf(\"y\") !== -1;\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\nfunction $dfc006ada1995968$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n if (!includeInvisible && !chart.isPointInArea(position)) return items;\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !(0, $c4d1694fa24f1a71$export$e7094788287c5e9b)(element, chart.chartArea, 0)) return;\n if (element.inRange(position.x, position.y, useFinalPosition)) items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n };\n $dfc006ada1995968$var$evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\nfunction $dfc006ada1995968$var$getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n function evaluationFunc(element, datasetIndex, index) {\n const { startAngle: startAngle, endAngle: endAngle } = element.getProps([\n \"startAngle\",\n \"endAngle\"\n ], useFinalPosition);\n const { angle: angle } = (0, $c4d1694fa24f1a71$export$96f57966bedc81b4)(element, {\n x: position.x,\n y: position.y\n });\n if ((0, $c4d1694fa24f1a71$export$ffb5f4729a158638)(angle, startAngle, endAngle)) items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n }\n $dfc006ada1995968$var$evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\nfunction $dfc006ada1995968$var$getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = $dfc006ada1995968$var$getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) return;\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) return;\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [\n {\n element: element,\n datasetIndex: datasetIndex,\n index: index\n }\n ];\n minDistance = distance;\n } else if (distance === minDistance) items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n }\n $dfc006ada1995968$var$evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\nfunction $dfc006ada1995968$var$getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) return [];\n return axis === \"r\" && !intersect ? $dfc006ada1995968$var$getNearestRadialItems(chart, position, axis, useFinalPosition) : $dfc006ada1995968$var$getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\nfunction $dfc006ada1995968$var$getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === \"x\" ? \"inXRange\" : \"inYRange\";\n let intersectsItem = false;\n $dfc006ada1995968$var$evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index)=>{\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n if (intersect && !intersectsItem) return [];\n return items;\n}\nvar $dfc006ada1995968$export$a13296960cae0384 = {\n evaluateInteractionItems: $dfc006ada1995968$var$evaluateInteractionItems,\n modes: {\n index (chart, e, options, useFinalPosition) {\n const position = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"x\";\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect ? $dfc006ada1995968$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : $dfc006ada1995968$var$getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n if (!items.length) return [];\n chart.getSortedVisibleDatasetMetas().forEach((meta)=>{\n const index = items[0].index;\n const element = meta.data[index];\n if (element && !element.skip) elements.push({\n element: element,\n datasetIndex: meta.index,\n index: index\n });\n });\n return elements;\n },\n dataset (chart, e, options, useFinalPosition) {\n const position = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"xy\";\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect ? $dfc006ada1995968$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : $dfc006ada1995968$var$getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for(let i = 0; i < data.length; ++i)items.push({\n element: data[i],\n datasetIndex: datasetIndex,\n index: i\n });\n }\n return items;\n },\n point (chart, e, options, useFinalPosition) {\n const position = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"xy\";\n const includeInvisible = options.includeInvisible || false;\n return $dfc006ada1995968$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n nearest (chart, e, options, useFinalPosition) {\n const position = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"xy\";\n const includeInvisible = options.includeInvisible || false;\n return $dfc006ada1995968$var$getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n x (chart, e, options, useFinalPosition) {\n const position = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(e, chart);\n return $dfc006ada1995968$var$getAxisItems(chart, position, \"x\", options.intersect, useFinalPosition);\n },\n y (chart, e, options, useFinalPosition) {\n const position = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(e, chart);\n return $dfc006ada1995968$var$getAxisItems(chart, position, \"y\", options.intersect, useFinalPosition);\n }\n }\n};\nconst $dfc006ada1995968$var$STATIC_POSITIONS = [\n \"left\",\n \"top\",\n \"right\",\n \"bottom\"\n];\nfunction $dfc006ada1995968$var$filterByPosition(array, position) {\n return array.filter((v)=>v.pos === position);\n}\nfunction $dfc006ada1995968$var$filterDynamicPositionByAxis(array, axis) {\n return array.filter((v)=>$dfc006ada1995968$var$STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction $dfc006ada1995968$var$sortByWeight(array, reverse) {\n return array.sort((a, b)=>{\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;\n });\n}\nfunction $dfc006ada1995968$var$wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n for(i = 0, ilen = (boxes || []).length; i < ilen; ++i){\n box = boxes[i];\n ({ position: pos, options: { stack: stack, stackWeight: stackWeight = 1 } } = box);\n layoutBoxes.push({\n index: i,\n box: box,\n pos: pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && pos + stack,\n stackWeight: stackWeight\n });\n }\n return layoutBoxes;\n}\nfunction $dfc006ada1995968$var$buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts){\n const { stack: stack, pos: pos, stackWeight: stackWeight } = wrap;\n if (!stack || !$dfc006ada1995968$var$STATIC_POSITIONS.includes(pos)) continue;\n const _stack = stacks[stack] || (stacks[stack] = {\n count: 0,\n placed: 0,\n weight: 0,\n size: 0\n });\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\nfunction $dfc006ada1995968$var$setLayoutDims(layouts, params) {\n const stacks = $dfc006ada1995968$var$buildStacks(layouts);\n const { vBoxMaxWidth: vBoxMaxWidth, hBoxMaxHeight: hBoxMaxHeight } = params;\n let i, ilen, layout;\n for(i = 0, ilen = layouts.length; i < ilen; ++i){\n layout = layouts[i];\n const { fullSize: fullSize } = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\nfunction $dfc006ada1995968$var$buildLayoutBoxes(boxes) {\n const layoutBoxes = $dfc006ada1995968$var$wrapBoxes(boxes);\n const fullSize = $dfc006ada1995968$var$sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize), true);\n const left = $dfc006ada1995968$var$sortByWeight($dfc006ada1995968$var$filterByPosition(layoutBoxes, \"left\"), true);\n const right = $dfc006ada1995968$var$sortByWeight($dfc006ada1995968$var$filterByPosition(layoutBoxes, \"right\"));\n const top = $dfc006ada1995968$var$sortByWeight($dfc006ada1995968$var$filterByPosition(layoutBoxes, \"top\"), true);\n const bottom = $dfc006ada1995968$var$sortByWeight($dfc006ada1995968$var$filterByPosition(layoutBoxes, \"bottom\"));\n const centerHorizontal = $dfc006ada1995968$var$filterDynamicPositionByAxis(layoutBoxes, \"x\");\n const centerVertical = $dfc006ada1995968$var$filterDynamicPositionByAxis(layoutBoxes, \"y\");\n return {\n fullSize: fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: $dfc006ada1995968$var$filterByPosition(layoutBoxes, \"chartArea\"),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\nfunction $dfc006ada1995968$var$getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction $dfc006ada1995968$var$updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction $dfc006ada1995968$var$updateDims(chartArea, params, layout, stacks) {\n const { pos: pos, box: box } = layout;\n const maxPadding = chartArea.maxPadding;\n if (!(0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(pos)) {\n if (layout.size) chartArea[pos] -= layout.size;\n const stack = stacks[layout.stack] || {\n size: 0,\n count: 1\n };\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n if (box.getPadding) $dfc006ada1995968$var$updateMaxPadding(maxPadding, box.getPadding());\n const newWidth = Math.max(0, params.outerWidth - $dfc006ada1995968$var$getCombinedMax(maxPadding, chartArea, \"left\", \"right\"));\n const newHeight = Math.max(0, params.outerHeight - $dfc006ada1995968$var$getCombinedMax(maxPadding, chartArea, \"top\", \"bottom\"));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n return layout.horizontal ? {\n same: widthChanged,\n other: heightChanged\n } : {\n same: heightChanged,\n other: widthChanged\n };\n}\nfunction $dfc006ada1995968$var$handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos(\"top\");\n chartArea.x += updatePos(\"left\");\n updatePos(\"right\");\n updatePos(\"bottom\");\n}\nfunction $dfc006ada1995968$var$getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n function marginForPositions(positions) {\n const margin = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n positions.forEach((pos)=>{\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n return horizontal ? marginForPositions([\n \"left\",\n \"right\"\n ]) : marginForPositions([\n \"top\",\n \"bottom\"\n ]);\n}\nfunction $dfc006ada1995968$var$fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n for(i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i){\n layout = boxes[i];\n box = layout.box;\n box.update(layout.width || chartArea.w, layout.height || chartArea.h, $dfc006ada1995968$var$getMargins(layout.horizontal, chartArea));\n const { same: same, other: other } = $dfc006ada1995968$var$updateDims(chartArea, params, layout, stacks);\n refit |= same && refitBoxes.length;\n changed = changed || other;\n if (!box.fullSize) refitBoxes.push(layout);\n }\n return refit && $dfc006ada1995968$var$fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction $dfc006ada1995968$var$setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\nfunction $dfc006ada1995968$var$placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let { x: x, y: y } = chartArea;\n for (const layout of boxes){\n const box = layout.box;\n const stack = stacks[layout.stack] || {\n count: 1,\n placed: 0,\n weight: 1\n };\n const weight = layout.stackWeight / stack.weight || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if ((0, $c4d1694fa24f1a71$export$dda1d9f60106f0e9)(stack.start)) y = stack.start;\n if (box.fullSize) $dfc006ada1995968$var$setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n else $dfc006ada1995968$var$setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if ((0, $c4d1694fa24f1a71$export$dda1d9f60106f0e9)(stack.start)) x = stack.start;\n if (box.fullSize) $dfc006ada1995968$var$setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n else $dfc006ada1995968$var$setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n chartArea.x = x;\n chartArea.y = y;\n}\nvar $dfc006ada1995968$export$1ecca0613f5e56d2 = {\n addBox (chart, item) {\n if (!chart.boxes) chart.boxes = [];\n item.fullSize = item.fullSize || false;\n item.position = item.position || \"top\";\n item.weight = item.weight || 0;\n item._layers = item._layers || function() {\n return [\n {\n z: 0,\n draw (chartArea) {\n item.draw(chartArea);\n }\n }\n ];\n };\n chart.boxes.push(item);\n },\n removeBox (chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) chart.boxes.splice(index, 1);\n },\n configure (chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n update (chart, width, height, minPadding) {\n if (!chart) return;\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = $dfc006ada1995968$var$buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(chart.boxes, (box)=>{\n if (typeof box.beforeLayout === \"function\") box.beforeLayout();\n });\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap)=>wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding: padding,\n availableWidth: availableWidth,\n availableHeight: availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n $dfc006ada1995968$var$updateMaxPadding(maxPadding, (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(minPadding));\n const chartArea = Object.assign({\n maxPadding: maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n const stacks = $dfc006ada1995968$var$setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n $dfc006ada1995968$var$fitBoxes(boxes.fullSize, chartArea, params, stacks);\n $dfc006ada1995968$var$fitBoxes(verticalBoxes, chartArea, params, stacks);\n if ($dfc006ada1995968$var$fitBoxes(horizontalBoxes, chartArea, params, stacks)) $dfc006ada1995968$var$fitBoxes(verticalBoxes, chartArea, params, stacks);\n $dfc006ada1995968$var$handleMaxPadding(chartArea);\n $dfc006ada1995968$var$placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n $dfc006ada1995968$var$placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w\n };\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(boxes.chartArea, (layout)=>{\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n });\n });\n }\n};\nclass $dfc006ada1995968$export$7b1aeb87f31f7da8 {\n acquireContext(canvas, aspectRatio) {}\n releaseContext(context) {\n return false;\n }\n addEventListener(chart, type, listener) {}\n removeEventListener(chart, type, listener) {}\n getDevicePixelRatio() {\n return 1;\n }\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width: width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n isAttached(canvas) {\n return true;\n }\n updateConfig(config) {}\n}\nclass $dfc006ada1995968$export$a40a96b24b46cf35 extends $dfc006ada1995968$export$7b1aeb87f31f7da8 {\n acquireContext(item) {\n return item && item.getContext && item.getContext(\"2d\") || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\nconst $dfc006ada1995968$var$EXPANDO_KEY = \"$chartjs\";\nconst $dfc006ada1995968$var$EVENT_TYPES = {\n touchstart: \"mousedown\",\n touchmove: \"mousemove\",\n touchend: \"mouseup\",\n pointerenter: \"mouseenter\",\n pointerdown: \"mousedown\",\n pointermove: \"mousemove\",\n pointerup: \"mouseup\",\n pointerleave: \"mouseout\",\n pointerout: \"mouseout\"\n};\nconst $dfc006ada1995968$var$isNullOrEmpty = (value)=>value === null || value === \"\";\nfunction $dfc006ada1995968$var$initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n const renderHeight = canvas.getAttribute(\"height\");\n const renderWidth = canvas.getAttribute(\"width\");\n canvas[$dfc006ada1995968$var$EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n style.display = style.display || \"block\";\n style.boxSizing = style.boxSizing || \"border-box\";\n if ($dfc006ada1995968$var$isNullOrEmpty(renderWidth)) {\n const displayWidth = (0, $c4d1694fa24f1a71$export$b4171a6734a65d42)(canvas, \"width\");\n if (displayWidth !== undefined) canvas.width = displayWidth;\n }\n if ($dfc006ada1995968$var$isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === \"\") canvas.height = canvas.width / (aspectRatio || 2);\n else {\n const displayHeight = (0, $c4d1694fa24f1a71$export$b4171a6734a65d42)(canvas, \"height\");\n if (displayHeight !== undefined) canvas.height = displayHeight;\n }\n }\n return canvas;\n}\nconst $dfc006ada1995968$var$eventListenerOptions = (0, $c4d1694fa24f1a71$export$3466f893ebf79586) ? {\n passive: true\n} : false;\nfunction $dfc006ada1995968$var$addListener(node, type, listener) {\n node.addEventListener(type, listener, $dfc006ada1995968$var$eventListenerOptions);\n}\nfunction $dfc006ada1995968$var$removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, $dfc006ada1995968$var$eventListenerOptions);\n}\nfunction $dfc006ada1995968$var$fromNativeEvent(event, chart) {\n const type = $dfc006ada1995968$var$EVENT_TYPES[event.type] || event.type;\n const { x: x, y: y } = (0, $c4d1694fa24f1a71$export$df995fae86a55f06)(event, chart);\n return {\n type: type,\n chart: chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null\n };\n}\nfunction $dfc006ada1995968$var$nodeListContains(nodeList, canvas) {\n for (const node of nodeList){\n if (node === canvas || node.contains(canvas)) return true;\n }\n}\nfunction $dfc006ada1995968$var$createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || $dfc006ada1995968$var$nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !$dfc006ada1995968$var$nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) listener();\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nfunction $dfc006ada1995968$var$createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || $dfc006ada1995968$var$nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !$dfc006ada1995968$var$nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) listener();\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nconst $dfc006ada1995968$var$drpListeningCharts = new Map();\nlet $dfc006ada1995968$var$oldDevicePixelRatio = 0;\nfunction $dfc006ada1995968$var$onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === $dfc006ada1995968$var$oldDevicePixelRatio) return;\n $dfc006ada1995968$var$oldDevicePixelRatio = dpr;\n $dfc006ada1995968$var$drpListeningCharts.forEach((resize, chart)=>{\n if (chart.currentDevicePixelRatio !== dpr) resize();\n });\n}\nfunction $dfc006ada1995968$var$listenDevicePixelRatioChanges(chart, resize) {\n if (!$dfc006ada1995968$var$drpListeningCharts.size) window.addEventListener(\"resize\", $dfc006ada1995968$var$onWindowResize);\n $dfc006ada1995968$var$drpListeningCharts.set(chart, resize);\n}\nfunction $dfc006ada1995968$var$unlistenDevicePixelRatioChanges(chart) {\n $dfc006ada1995968$var$drpListeningCharts.delete(chart);\n if (!$dfc006ada1995968$var$drpListeningCharts.size) window.removeEventListener(\"resize\", $dfc006ada1995968$var$onWindowResize);\n}\nfunction $dfc006ada1995968$var$createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && (0, $c4d1694fa24f1a71$export$9bb611d729802a56)(canvas);\n if (!container) return;\n const resize = (0, $c4d1694fa24f1a71$export$61196ced6d74a310)((width, height)=>{\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) listener();\n }, window);\n const observer = new ResizeObserver((entries)=>{\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n if (width === 0 && height === 0) return;\n resize(width, height);\n });\n observer.observe(container);\n $dfc006ada1995968$var$listenDevicePixelRatioChanges(chart, resize);\n return observer;\n}\nfunction $dfc006ada1995968$var$releaseObserver(chart, type, observer) {\n if (observer) observer.disconnect();\n if (type === \"resize\") $dfc006ada1995968$var$unlistenDevicePixelRatioChanges(chart);\n}\nfunction $dfc006ada1995968$var$createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = (0, $c4d1694fa24f1a71$export$61196ced6d74a310)((event)=>{\n if (chart.ctx !== null) listener($dfc006ada1995968$var$fromNativeEvent(event, chart));\n }, chart);\n $dfc006ada1995968$var$addListener(canvas, type, proxy);\n return proxy;\n}\nclass $dfc006ada1995968$export$f02da7f882cf6b2e extends $dfc006ada1995968$export$7b1aeb87f31f7da8 {\n acquireContext(canvas, aspectRatio) {\n const context = canvas && canvas.getContext && canvas.getContext(\"2d\");\n if (context && context.canvas === canvas) {\n $dfc006ada1995968$var$initCanvas(canvas, aspectRatio);\n return context;\n }\n return null;\n }\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[$dfc006ada1995968$var$EXPANDO_KEY]) return false;\n const initial = canvas[$dfc006ada1995968$var$EXPANDO_KEY].initial;\n [\n \"height\",\n \"width\"\n ].forEach((prop)=>{\n const value = initial[prop];\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(value)) canvas.removeAttribute(prop);\n else canvas.setAttribute(prop, value);\n });\n const style = initial.style || {};\n Object.keys(style).forEach((key)=>{\n canvas.style[key] = style[key];\n });\n canvas.width = canvas.width;\n delete canvas[$dfc006ada1995968$var$EXPANDO_KEY];\n return true;\n }\n addEventListener(chart, type, listener) {\n this.removeEventListener(chart, type);\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: $dfc006ada1995968$var$createAttachObserver,\n detach: $dfc006ada1995968$var$createDetachObserver,\n resize: $dfc006ada1995968$var$createResizeObserver\n };\n const handler = handlers[type] || $dfc006ada1995968$var$createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n if (!proxy) return;\n const handlers = {\n attach: $dfc006ada1995968$var$releaseObserver,\n detach: $dfc006ada1995968$var$releaseObserver,\n resize: $dfc006ada1995968$var$releaseObserver\n };\n const handler = handlers[type] || $dfc006ada1995968$var$removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n getMaximumSize(canvas, width, height, aspectRatio) {\n return (0, $c4d1694fa24f1a71$export$2329c99376c9d0a4)(canvas, width, height, aspectRatio);\n }\n isAttached(canvas) {\n const container = (0, $c4d1694fa24f1a71$export$9bb611d729802a56)(canvas);\n return !!(container && container.isConnected);\n }\n}\nfunction $dfc006ada1995968$export$72cd9e67b1b784f9(canvas) {\n if (!(0, $c4d1694fa24f1a71$export$3a1a48c8f6ef640e)() || typeof OffscreenCanvas !== \"undefined\" && canvas instanceof OffscreenCanvas) return $dfc006ada1995968$export$a40a96b24b46cf35;\n return $dfc006ada1995968$export$f02da7f882cf6b2e;\n}\nclass $dfc006ada1995968$export$db77ccec0bb4ccac {\n tooltipPosition(useFinalPosition) {\n const { x: x, y: y } = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n return {\n x: x,\n y: y\n };\n }\n hasValue() {\n return (0, $c4d1694fa24f1a71$export$d141bba7fdc215a3)(this.x) && (0, $c4d1694fa24f1a71$export$d141bba7fdc215a3)(this.y);\n }\n getProps(props, final) {\n const anims = this.$animations;\n if (!final || !anims) // let's not create an object, if not needed\n return this;\n const ret = {};\n props.forEach((prop)=>{\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n });\n return ret;\n }\n constructor(){\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"x\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"y\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"active\", false);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"options\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"$animations\", void 0);\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$db77ccec0bb4ccac, \"defaults\", {});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$db77ccec0bb4ccac, \"defaultRoutes\", undefined);\nfunction $dfc006ada1995968$var$autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = $dfc006ada1995968$var$determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? $dfc006ada1995968$var$getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n if (numMajorIndices > ticksLimit) {\n $dfc006ada1995968$var$skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n const spacing = $dfc006ada1995968$var$calculateSpacing(majorIndices, ticks, ticksLimit);\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n $dfc006ada1995968$var$skip(ticks, newTicks, spacing, (0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for(i = 0, ilen = numMajorIndices - 1; i < ilen; i++)$dfc006ada1995968$var$skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n $dfc006ada1995968$var$skip(ticks, newTicks, spacing, last, (0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n $dfc006ada1995968$var$skip(ticks, newTicks, spacing);\n return newTicks;\n}\nfunction $dfc006ada1995968$var$determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\nfunction $dfc006ada1995968$var$calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = $dfc006ada1995968$var$getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n if (!evenMajorSpacing) return Math.max(spacing, 1);\n const factors = (0, $c4d1694fa24f1a71$export$a07804094c3ecf2d)(evenMajorSpacing);\n for(let i = 0, ilen = factors.length - 1; i < ilen; i++){\n const factor = factors[i];\n if (factor > spacing) return factor;\n }\n return Math.max(spacing, 1);\n}\nfunction $dfc006ada1995968$var$getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++)if (ticks[i].major) result.push(i);\n return result;\n}\nfunction $dfc006ada1995968$var$skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n spacing = Math.ceil(spacing);\n for(i = 0; i < ticks.length; i++)if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n}\nfunction $dfc006ada1995968$var$skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(majorStart, 0);\n const end = Math.min((0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n next = start;\n while(next < 0){\n count++;\n next = Math.round(start + count * spacing);\n }\n for(i = Math.max(start, 0); i < end; i++)if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n}\nfunction $dfc006ada1995968$var$getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n if (len < 2) return false;\n for(diff = arr[0], i = 1; i < len; ++i){\n if (arr[i] - arr[i - 1] !== diff) return false;\n }\n return diff;\n}\nconst $dfc006ada1995968$var$reverseAlign = (align)=>align === \"left\" ? \"right\" : align === \"right\" ? \"left\" : align;\nconst $dfc006ada1995968$var$offsetFromEdge = (scale, edge, offset)=>edge === \"top\" || edge === \"left\" ? scale[edge] + offset : scale[edge] - offset;\nconst $dfc006ada1995968$var$getTicksLimit = (ticksLength, maxTicksLimit)=>Math.min(maxTicksLimit || ticksLength, ticksLength);\nfunction $dfc006ada1995968$var$sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n for(; i < len; i += increment)result.push(arr[Math.floor(i)]);\n return result;\n}\nfunction $dfc006ada1995968$var$getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6;\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n if (offsetGridLines) {\n if (length === 1) offset = Math.max(lineValue - start, end - lineValue);\n else if (index === 0) offset = (scale.getPixelForTick(1) - lineValue) / 2;\n else offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n lineValue += validIndex < index ? offset : -offset;\n if (lineValue < start - epsilon || lineValue > end + epsilon) return;\n }\n return lineValue;\n}\nfunction $dfc006ada1995968$var$garbageCollect(caches, length) {\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(caches, (cache)=>{\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for(i = 0; i < gcLen; ++i)delete cache.data[gc[i]];\n gc.splice(0, gcLen);\n }\n });\n}\nfunction $dfc006ada1995968$var$getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\nfunction $dfc006ada1995968$var$getTitleHeight(options, fallback) {\n if (!options.display) return 0;\n const font = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.font, fallback);\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(options.padding);\n const lines = (0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(options.text) ? options.text.length : 1;\n return lines * font.lineHeight + padding.height;\n}\nfunction $dfc006ada1995968$var$createScaleContext(parent, scale) {\n return (0, $c4d1694fa24f1a71$export$35e795649ee09318)(parent, {\n scale: scale,\n type: \"scale\"\n });\n}\nfunction $dfc006ada1995968$var$createTickContext(parent, index, tick) {\n return (0, $c4d1694fa24f1a71$export$35e795649ee09318)(parent, {\n tick: tick,\n index: index,\n type: \"tick\"\n });\n}\nfunction $dfc006ada1995968$var$titleAlign(align, position, reverse) {\n let ret = (0, $c4d1694fa24f1a71$export$3c2fa207a37baaea)(align);\n if (reverse && position !== \"right\" || !reverse && position === \"right\") ret = $dfc006ada1995968$var$reverseAlign(ret);\n return ret;\n}\nfunction $dfc006ada1995968$var$titleArgs(scale, offset, position, align) {\n const { top: top, left: left, bottom: bottom, right: right, chart: chart } = scale;\n const { chartArea: chartArea, scales: scales } = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n if (scale.isHorizontal()) {\n titleX = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, left, right);\n if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === \"center\") titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n else titleY = $dfc006ada1995968$var$offsetFromEdge(scale, position, offset);\n maxWidth = right - left;\n } else {\n if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === \"center\") titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n else titleX = $dfc006ada1995968$var$offsetFromEdge(scale, position, offset);\n titleY = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, bottom, top);\n rotation = position === \"left\" ? -(0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd) : (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd);\n }\n return {\n titleX: titleX,\n titleY: titleY,\n maxWidth: maxWidth,\n rotation: rotation\n };\n}\nclass $dfc006ada1995968$export$d60cfc58d3c358b6 extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n init(options) {\n this.options = options.setContext(this.getContext());\n this.axis = options.axis;\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n parse(raw, index) {\n return raw;\n }\n getUserBounds() {\n let { _userMin: _userMin, _userMax: _userMax, _suggestedMin: _suggestedMin, _suggestedMax: _suggestedMax } = this;\n _userMin = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(_userMin, Number.POSITIVE_INFINITY);\n _userMax = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(_userMin, _suggestedMin),\n max: (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(_userMax, _suggestedMax),\n minDefined: (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(_userMin),\n maxDefined: (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(_userMax)\n };\n }\n getMinMax(canStack) {\n let { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let range;\n if (minDefined && maxDefined) return {\n min: min,\n max: max\n };\n const metas = this.getMatchingVisibleMetas();\n for(let i = 0, ilen = metas.length; i < ilen; ++i){\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) min = Math.min(min, range.min);\n if (!maxDefined) max = Math.max(max, range.max);\n }\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n return {\n min: (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(min, (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(max, min)),\n max: (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(max, (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(min, max))\n };\n }\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n getTicks() {\n return this.ticks;\n }\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n beforeUpdate() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.beforeUpdate, [\n this\n ]);\n }\n update(maxWidth, maxHeight, margins) {\n const { beginAtZero: beginAtZero, grace: grace, ticks: tickOpts } = this.options;\n const sampleSize = tickOpts.sampleSize;\n this.beforeUpdate();\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = (0, $c4d1694fa24f1a71$export$db202ddc8be9136)(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n this.beforeBuildTicks();\n this.ticks = this.buildTicks() || [];\n this.afterBuildTicks();\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? $dfc006ada1995968$var$sample(this.ticks, sampleSize) : this.ticks);\n this.configure();\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation();\n this.afterCalculateLabelRotation();\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === \"auto\")) {\n this.ticks = $dfc006ada1995968$var$autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n if (samplingEnabled) this._convertTicksToLabels(this.ticks);\n this.beforeFit();\n this.fit();\n this.afterFit();\n this.afterUpdate();\n }\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n afterUpdate() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.afterUpdate, [\n this\n ]);\n }\n beforeSetDimensions() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.beforeSetDimensions, [\n this\n ]);\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = 0;\n this.bottom = this.height;\n }\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.afterSetDimensions, [\n this\n ]);\n }\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options[name], [\n this\n ]);\n }\n beforeDataLimits() {\n this._callHooks(\"beforeDataLimits\");\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks(\"afterDataLimits\");\n }\n beforeBuildTicks() {\n this._callHooks(\"beforeBuildTicks\");\n }\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks(\"afterBuildTicks\");\n }\n beforeTickToLabelConversion() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.beforeTickToLabelConversion, [\n this\n ]);\n }\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n tick = ticks[i];\n tick.label = (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(tickOpts.callback, [\n tick.value,\n i,\n ticks\n ], this);\n }\n }\n afterTickToLabelConversion() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.afterTickToLabelConversion, [\n this\n ]);\n }\n beforeCalculateLabelRotation() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.beforeCalculateLabelRotation, [\n this\n ]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = $dfc006ada1995968$var$getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n const maxWidth = (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - $dfc006ada1995968$var$getTickMarkLength(options.grid) - tickOpts.padding - $dfc006ada1995968$var$getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = (0, $c4d1694fa24f1a71$export$3a6d5c9ae78a2c08)(Math.min(Math.asin((0, $c4d1694fa24f1a71$export$25ce5a424b770e84)((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin((0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin((0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(maxLabelHeight / maxLabelDiagonal, -1, 1))));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.afterCalculateLabelRotation, [\n this\n ]);\n }\n afterAutoSkip() {}\n beforeFit() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.beforeFit, [\n this\n ]);\n }\n fit() {\n const minSize = {\n width: 0,\n height: 0\n };\n const { chart: chart, options: { ticks: tickOpts, title: titleOpts, grid: gridOpts } } = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n if (display) {\n const titleHeight = $dfc006ada1995968$var$getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = $dfc006ada1995968$var$getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight;\n minSize.width = $dfc006ada1995968$var$getTickMarkLength(gridOpts) + titleHeight;\n }\n if (tickOpts.display && this.ticks.length) {\n const { first: first, last: last, widest: widest, highest: highest } = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n if (isHorizontal) {\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n this._handleMargins();\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n _calculatePadding(first, last, sin, cos) {\n const { ticks: { align: align, padding: padding }, position: position } = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== \"top\" && this.axis === \"x\";\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === \"start\") paddingRight = last.width;\n else if (align === \"end\") paddingLeft = first.width;\n else if (align !== \"inner\") {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n if (align === \"start\") {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === \"end\") {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n afterFit() {\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.afterFit, [\n this\n ]);\n }\n isHorizontal() {\n const { axis: axis, position: position } = this.options;\n return position === \"top\" || position === \"bottom\" || axis === \"x\";\n }\n isFullSize() {\n return this.options.fullSize;\n }\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n this.generateTickLabels(ticks);\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++)if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n this.afterTickToLabelConversion();\n }\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) ticks = $dfc006ada1995968$var$sample(ticks, sampleSize);\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n return labelSizes;\n }\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const { ctx: ctx, _longestTextCache: caches } = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / $dfc006ada1995968$var$getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n for(i = 0; i < length; i += increment){\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {\n data: {},\n gc: []\n };\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(label) && !(0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(label)) {\n width = (0, $c4d1694fa24f1a71$export$e7c866399fa523f5)(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(label)) for(j = 0, jlen = label.length; j < jlen; ++j){\n nestedLabel = label[j];\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(nestedLabel) && !(0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(nestedLabel)) {\n width = (0, $c4d1694fa24f1a71$export$e7c866399fa523f5)(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n $dfc006ada1995968$var$garbageCollect(caches, length);\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n const valueAt = (idx)=>({\n width: widths[idx] || 0,\n height: heights[idx] || 0\n });\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths: widths,\n heights: heights\n };\n }\n getLabelForValue(value) {\n return value;\n }\n getPixelForValue(value, index) {\n return NaN;\n }\n getValueForPixel(pixel) {}\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) return null;\n return this.getPixelForValue(ticks[index].value);\n }\n getPixelForDecimal(decimal) {\n if (this._reversePixels) decimal = 1 - decimal;\n const pixel = this._startPixel + decimal * this._length;\n return (0, $c4d1694fa24f1a71$export$71cec2538cb2c617)(this._alignToPixels ? (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(this.chart, pixel, 0) : pixel);\n }\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n getBaseValue() {\n const { min: min, max: max } = this;\n return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0;\n }\n getContext(index) {\n const ticks = this.ticks || [];\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context || (tick.$context = $dfc006ada1995968$var$createTickContext(this.getContext(), index, tick));\n }\n return this.$context || (this.$context = $dfc006ada1995968$var$createScaleContext(this.chart.getContext(), this));\n }\n _tickSize() {\n const optionTicks = this.options.ticks;\n const rot = (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin;\n }\n _isVisible() {\n const display = this.options.display;\n if (display !== \"auto\") return !!display;\n return this.getMatchingVisibleMetas().length > 0;\n }\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const { grid: grid, position: position, border: border } = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = $dfc006ada1995968$var$getTickMarkLength(grid);\n const items = [];\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n if (position === \"top\") {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === \"bottom\") {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === \"left\") {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === \"right\") {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === \"x\") {\n if (position === \"center\") borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === \"y\") {\n if (position === \"center\") borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n const limit = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for(i = 0; i < ticksLength; i += step){\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n lineValue = $dfc006ada1995968$var$getPixelForGridLine(this, i, offset);\n if (lineValue === undefined) continue;\n alignedLineValue = (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(chart, lineValue, lineWidth);\n if (isHorizontal) tx1 = tx2 = x1 = x2 = alignedLineValue;\n else ty1 = ty2 = y1 = y2 = alignedLineValue;\n items.push({\n tx1: tx1,\n ty1: ty1,\n tx2: tx2,\n ty2: ty2,\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n width: lineWidth,\n color: lineColor,\n borderDash: borderDash,\n borderDashOffset: borderDashOffset,\n tickWidth: tickWidth,\n tickColor: tickColor,\n tickBorderDash: tickBorderDash,\n tickBorderDashOffset: tickBorderDashOffset\n });\n }\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n return items;\n }\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const { position: position, ticks: optionTicks } = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const { align: align, crossAlign: crossAlign, padding: padding, mirror: mirror } = optionTicks;\n const tl = $dfc006ada1995968$var$getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -(0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = \"middle\";\n if (position === \"top\") {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === \"bottom\") {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === \"left\") {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === \"right\") {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === \"x\") {\n if (position === \"center\") y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === \"y\") {\n if (position === \"center\") x = (chartArea.left + chartArea.right) / 2 - tickAndPadding;\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n if (axis === \"y\") {\n if (align === \"start\") textBaseline = \"top\";\n else if (align === \"end\") textBaseline = \"bottom\";\n }\n const labelSizes = this._getLabelSizes();\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n label = tick.label;\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = (0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n if (isHorizontal) {\n x = pixel;\n if (textAlign === \"inner\") {\n if (i === ilen - 1) tickTextAlign = !this.options.reverse ? \"right\" : \"left\";\n else if (i === 0) tickTextAlign = !this.options.reverse ? \"left\" : \"right\";\n else tickTextAlign = \"center\";\n }\n if (position === \"top\") {\n if (crossAlign === \"near\" || rotation !== 0) textOffset = -lineCount * lineHeight + lineHeight / 2;\n else if (crossAlign === \"center\") textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n else textOffset = -labelSizes.highest.height + lineHeight / 2;\n } else {\n if (crossAlign === \"near\" || rotation !== 0) textOffset = lineHeight / 2;\n else if (crossAlign === \"center\") textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n else textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n if (mirror) textOffset *= -1;\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) x += lineHeight / 2 * Math.sin(rotation);\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n let backdrop;\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n switch(textBaseline){\n case \"middle\":\n top -= height / 2;\n break;\n case \"bottom\":\n top -= height;\n break;\n }\n switch(textAlign){\n case \"center\":\n left -= width / 2;\n break;\n case \"right\":\n left -= width;\n break;\n }\n backdrop = {\n left: left,\n top: top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n color: optsAtIndex.backdropColor\n };\n }\n items.push({\n label: label,\n font: font,\n textOffset: textOffset,\n options: {\n rotation: rotation,\n color: color,\n strokeColor: strokeColor,\n strokeWidth: strokeWidth,\n textAlign: tickTextAlign,\n textBaseline: textBaseline,\n translation: [\n x,\n y\n ],\n backdrop: backdrop\n }\n });\n }\n return items;\n }\n _getXAxisLabelAlignment() {\n const { position: position, ticks: ticks } = this.options;\n const rotation = -(0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.labelRotation);\n if (rotation) return position === \"top\" ? \"left\" : \"right\";\n let align = \"center\";\n if (ticks.align === \"start\") align = \"left\";\n else if (ticks.align === \"end\") align = \"right\";\n else if (ticks.align === \"inner\") align = \"inner\";\n return align;\n }\n _getYAxisLabelAlignment(tl) {\n const { position: position, ticks: { crossAlign: crossAlign, mirror: mirror, padding: padding } } = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n let textAlign;\n let x;\n if (position === \"left\") {\n if (mirror) {\n x = this.right + padding;\n if (crossAlign === \"near\") textAlign = \"left\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x += widest / 2;\n } else {\n textAlign = \"right\";\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n if (crossAlign === \"near\") textAlign = \"right\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x -= widest / 2;\n } else {\n textAlign = \"left\";\n x = this.left;\n }\n }\n } else if (position === \"right\") {\n if (mirror) {\n x = this.left + padding;\n if (crossAlign === \"near\") textAlign = \"right\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x -= widest / 2;\n } else {\n textAlign = \"left\";\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n if (crossAlign === \"near\") textAlign = \"left\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x += widest / 2;\n } else {\n textAlign = \"right\";\n x = this.right;\n }\n }\n } else textAlign = \"right\";\n return {\n textAlign: textAlign,\n x: x\n };\n }\n _computeLabelArea() {\n if (this.options.ticks.mirror) return;\n const chart = this.chart;\n const position = this.options.position;\n if (position === \"left\" || position === \"right\") return {\n top: 0,\n left: this.left,\n bottom: chart.height,\n right: this.right\n };\n if (position === \"top\" || position === \"bottom\") return {\n top: this.top,\n left: 0,\n bottom: this.bottom,\n right: chart.width\n };\n }\n drawBackground() {\n const { ctx: ctx, options: { backgroundColor: backgroundColor }, left: left, top: top, width: width, height: height } = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) return 0;\n const ticks = this.ticks;\n const index = ticks.findIndex((t)=>t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n const drawLine = (p1, p2, style)=>{\n if (!style.width || !style.color) return;\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n if (grid.display) for(i = 0, ilen = items.length; i < ilen; ++i){\n const item = items[i];\n if (grid.drawOnChartArea) drawLine({\n x: item.x1,\n y: item.y1\n }, {\n x: item.x2,\n y: item.y2\n }, item);\n if (grid.drawTicks) drawLine({\n x: item.tx1,\n y: item.ty1\n }, {\n x: item.tx2,\n y: item.ty2\n }, {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n });\n }\n }\n drawBorder() {\n const { chart: chart, ctx: ctx, options: { border: border, grid: grid } } = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) return;\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n if (this.isHorizontal()) {\n x1 = (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = (0, $c4d1694fa24f1a71$export$78acf4525d8a74c4)(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.restore();\n }\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n if (!optionTicks.display) return;\n const ctx = this.ctx;\n const area = this._computeLabelArea();\n if (area) (0, $c4d1694fa24f1a71$export$8743009a87fcb00f)(ctx, area);\n const items = this.getLabelItems(chartArea);\n for (const item of items){\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n if (area) (0, $c4d1694fa24f1a71$export$3d8c2f653ac9d0b9)(ctx);\n }\n drawTitle() {\n const { ctx: ctx, options: { position: position, title: title, reverse: reverse } } = this;\n if (!title.display) return;\n const font = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(title.font);\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n if (position === \"bottom\" || position === \"center\" || (0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(position)) {\n offset += padding.bottom;\n if ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(title.text)) offset += font.lineHeight * (title.text.length - 1);\n } else offset += padding.top;\n const { titleX: titleX, titleY: titleY, maxWidth: maxWidth, rotation: rotation } = $dfc006ada1995968$var$titleArgs(this, offset, position, align);\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth: maxWidth,\n rotation: rotation,\n textAlign: $dfc006ada1995968$var$titleAlign(align, position, reverse),\n textBaseline: \"middle\",\n translation: [\n titleX,\n titleY\n ]\n });\n }\n draw(chartArea) {\n if (!this._isVisible()) return;\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(opts.grid && opts.grid.z, -1);\n const bz = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(opts.border && opts.border.z, 0);\n if (!this._isVisible() || this.draw !== $dfc006ada1995968$export$d60cfc58d3c358b6.prototype.draw) return [\n {\n z: tz,\n draw: (chartArea)=>{\n this.draw(chartArea);\n }\n }\n ];\n return [\n {\n z: gz,\n draw: (chartArea)=>{\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n },\n {\n z: bz,\n draw: ()=>{\n this.drawBorder();\n }\n },\n {\n z: tz,\n draw: (chartArea)=>{\n this.drawLabels(chartArea);\n }\n }\n ];\n }\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + \"AxisID\";\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) result.push(meta);\n }\n return result;\n }\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return (0, $c4d1694fa24f1a71$export$34aec0b863436764)(opts.font);\n }\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n constructor(cfg){\n super();\n this.id = cfg.id;\n this.type = cfg.type;\n this.options = undefined;\n this.ctx = cfg.ctx;\n this.chart = cfg.chart;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.paddingTop = undefined;\n this.paddingBottom = undefined;\n this.paddingLeft = undefined;\n this.paddingRight = undefined;\n this.axis = undefined;\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n this.ticks = [];\n this._gridLineItems = null;\n this._labelItems = null;\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n this._startPixel = undefined;\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n}\nclass $dfc006ada1995968$var$TypedRegistry {\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n if ($dfc006ada1995968$var$isIChartComponent(proto)) parentScope = this.register(proto);\n const items = this.items;\n const id = item.id;\n const scope = this.scope + \".\" + id;\n if (!id) throw new Error(\"class does not have id: \" + item);\n if (id in items) return scope;\n items[id] = item;\n $dfc006ada1995968$var$registerDefaults(item, scope, parentScope);\n if (this.override) (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).override(item.id, item.overrides);\n return scope;\n }\n get(id) {\n return this.items[id];\n }\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n if (id in items) delete items[id];\n if (scope && id in (0, $c4d1694fa24f1a71$export$4368d992c4eafac0)[scope]) {\n delete (0, $c4d1694fa24f1a71$export$4368d992c4eafac0)[scope][id];\n if (this.override) delete (0, $c4d1694fa24f1a71$export$6559d589eb85fbb6)[id];\n }\n }\n constructor(type, scope, override){\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n}\nfunction $dfc006ada1995968$var$registerDefaults(item, scope, parentScope) {\n const itemDefaults = (0, $c4d1694fa24f1a71$export$efca4cbe5dd06740)(Object.create(null), [\n parentScope ? (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).get(parentScope) : {},\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).get(scope),\n item.defaults\n ]);\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).set(scope, itemDefaults);\n if (item.defaultRoutes) $dfc006ada1995968$var$routeDefaults(scope, item.defaultRoutes);\n if (item.descriptors) (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).describe(scope, item.descriptors);\n}\nfunction $dfc006ada1995968$var$routeDefaults(scope, routes) {\n Object.keys(routes).forEach((property)=>{\n const propertyParts = property.split(\".\");\n const sourceName = propertyParts.pop();\n const sourceScope = [\n scope\n ].concat(propertyParts).join(\".\");\n const parts = routes[property].split(\".\");\n const targetName = parts.pop();\n const targetScope = parts.join(\".\");\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).route(sourceScope, sourceName, targetScope, targetName);\n });\n}\nfunction $dfc006ada1995968$var$isIChartComponent(proto) {\n return \"id\" in proto && \"defaults\" in proto;\n}\nclass $dfc006ada1995968$var$Registry {\n add(...args) {\n this._each(\"register\", args);\n }\n remove(...args) {\n this._each(\"unregister\", args);\n }\n addControllers(...args) {\n this._each(\"register\", args, this.controllers);\n }\n addElements(...args) {\n this._each(\"register\", args, this.elements);\n }\n addPlugins(...args) {\n this._each(\"register\", args, this.plugins);\n }\n addScales(...args) {\n this._each(\"register\", args, this.scales);\n }\n getController(id) {\n return this._get(id, this.controllers, \"controller\");\n }\n getElement(id) {\n return this._get(id, this.elements, \"element\");\n }\n getPlugin(id) {\n return this._get(id, this.plugins, \"plugin\");\n }\n getScale(id) {\n return this._get(id, this.scales, \"scale\");\n }\n removeControllers(...args) {\n this._each(\"unregister\", args, this.controllers);\n }\n removeElements(...args) {\n this._each(\"unregister\", args, this.elements);\n }\n removePlugins(...args) {\n this._each(\"unregister\", args, this.plugins);\n }\n removeScales(...args) {\n this._each(\"unregister\", args, this.scales);\n }\n _each(method, args, typedRegistry) {\n [\n ...args\n ].forEach((arg)=>{\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) this._exec(method, reg, arg);\n else (0, $c4d1694fa24f1a71$export$d66501df72047452)(arg, (item)=>{\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n });\n }\n _exec(method, registry, component) {\n const camelMethod = (0, $c4d1694fa24f1a71$export$a8550f7dbe79f93a)(method);\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(component[\"before\" + camelMethod], [], component);\n registry[method](component);\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(component[\"after\" + camelMethod], [], component);\n }\n _getRegistryForType(type) {\n for(let i = 0; i < this._typedRegistries.length; i++){\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) return reg;\n }\n return this.plugins;\n }\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) throw new Error('\"' + id + '\" is not a registered ' + type + \".\");\n return item;\n }\n constructor(){\n this.controllers = new $dfc006ada1995968$var$TypedRegistry($dfc006ada1995968$export$75572ec5c55b4048, \"datasets\", true);\n this.elements = new $dfc006ada1995968$var$TypedRegistry($dfc006ada1995968$export$db77ccec0bb4ccac, \"elements\");\n this.plugins = new $dfc006ada1995968$var$TypedRegistry(Object, \"plugins\");\n this.scales = new $dfc006ada1995968$var$TypedRegistry($dfc006ada1995968$export$d60cfc58d3c358b6, \"scales\");\n this._typedRegistries = [\n this.controllers,\n this.scales,\n this.elements\n ];\n }\n}\nvar $dfc006ada1995968$export$4bb7493d241fd8a5 = /* #__PURE__ */ new $dfc006ada1995968$var$Registry();\nclass $dfc006ada1995968$var$PluginService {\n notify(chart, hook, args, filter) {\n if (hook === \"beforeInit\") {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, \"install\");\n }\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n if (hook === \"afterDestroy\") {\n this._notify(descriptors, chart, \"stop\");\n this._notify(this._init, chart, \"uninstall\");\n }\n return result;\n }\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors){\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [\n chart,\n args,\n descriptor.options\n ];\n if ((0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(method, params, plugin) === false && args.cancelable) return false;\n }\n return true;\n }\n invalidate() {\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n _descriptors(chart) {\n if (this._cache) return this._cache;\n const descriptors = this._cache = this._createDescriptors(chart);\n this._notifyStateChanges(chart);\n return descriptors;\n }\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(config.options && config.options.plugins, {});\n const plugins = $dfc006ada1995968$var$allPlugins(config);\n return options === false && !all ? [] : $dfc006ada1995968$var$createDescriptors(chart, plugins, options, all);\n }\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, \"stop\");\n this._notify(diff(descriptors, previousDescriptors), chart, \"start\");\n }\n constructor(){\n this._init = [];\n }\n}\nfunction $dfc006ada1995968$var$allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys($dfc006ada1995968$export$4bb7493d241fd8a5.plugins.items);\n for(let i = 0; i < keys.length; i++)plugins.push($dfc006ada1995968$export$4bb7493d241fd8a5.getPlugin(keys[i]));\n const local = config.plugins || [];\n for(let i = 0; i < local.length; i++){\n const plugin = local[i];\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n return {\n plugins: plugins,\n localIds: localIds\n };\n}\nfunction $dfc006ada1995968$var$getOpts(options, all) {\n if (!all && options === false) return null;\n if (options === true) return {};\n return options;\n}\nfunction $dfc006ada1995968$var$createDescriptors(chart, { plugins: plugins, localIds: localIds }, options, all) {\n const result = [];\n const context = chart.getContext();\n for (const plugin of plugins){\n const id = plugin.id;\n const opts = $dfc006ada1995968$var$getOpts(options[id], all);\n if (opts === null) continue;\n result.push({\n plugin: plugin,\n options: $dfc006ada1995968$var$pluginOpts(chart.config, {\n plugin: plugin,\n local: localIds[id]\n }, opts, context)\n });\n }\n return result;\n}\nfunction $dfc006ada1995968$var$pluginOpts(config, { plugin: plugin, local: local }, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) scopes.push(plugin.defaults);\n return config.createResolver(scopes, context, [\n \"\"\n ], {\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\nfunction $dfc006ada1995968$var$getIndexAxis(type, options) {\n const datasetDefaults = (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || \"x\";\n}\nfunction $dfc006ada1995968$var$getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === \"_index_\") axis = indexAxis;\n else if (id === \"_value_\") axis = indexAxis === \"x\" ? \"y\" : \"x\";\n return axis;\n}\nfunction $dfc006ada1995968$var$getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? \"_index_\" : \"_value_\";\n}\nfunction $dfc006ada1995968$var$idMatchesAxis(id) {\n if (id === \"x\" || id === \"y\" || id === \"r\") return id;\n}\nfunction $dfc006ada1995968$var$axisFromPosition(position) {\n if (position === \"top\" || position === \"bottom\") return \"x\";\n if (position === \"left\" || position === \"right\") return \"y\";\n}\nfunction $dfc006ada1995968$var$determineAxis(id, ...scaleOptions) {\n if ($dfc006ada1995968$var$idMatchesAxis(id)) return id;\n for (const opts of scaleOptions){\n const axis = opts.axis || $dfc006ada1995968$var$axisFromPosition(opts.position) || id.length > 1 && $dfc006ada1995968$var$idMatchesAxis(id[0].toLowerCase());\n if (axis) return axis;\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\nfunction $dfc006ada1995968$var$getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + \"AxisID\"] === id) return {\n axis: axis\n };\n}\nfunction $dfc006ada1995968$var$retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d)=>d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) return $dfc006ada1995968$var$getAxisFromDataset(id, \"x\", boundDs[0]) || $dfc006ada1995968$var$getAxisFromDataset(id, \"y\", boundDs[0]);\n }\n return {};\n}\nfunction $dfc006ada1995968$var$mergeScaleConfig(config, options) {\n const chartDefaults = (0, $c4d1694fa24f1a71$export$6559d589eb85fbb6)[config.type] || {\n scales: {}\n };\n const configScales = options.scales || {};\n const chartIndexAxis = $dfc006ada1995968$var$getIndexAxis(config.type, options);\n const scales = Object.create(null);\n Object.keys(configScales).forEach((id)=>{\n const scaleConf = configScales[id];\n if (!(0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(scaleConf)) return console.error(`Invalid scale configuration for scale: ${id}`);\n if (scaleConf._proxy) return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n const axis = $dfc006ada1995968$var$determineAxis(id, scaleConf, $dfc006ada1995968$var$retrieveAxisFromDatasets(id, config), (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).scales[scaleConf.type]);\n const defaultId = $dfc006ada1995968$var$getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = (0, $c4d1694fa24f1a71$export$555508cbc6add439)(Object.create(null), [\n {\n axis: axis\n },\n scaleConf,\n defaultScaleOptions[axis],\n defaultScaleOptions[defaultId]\n ]);\n });\n config.data.datasets.forEach((dataset)=>{\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || $dfc006ada1995968$var$getIndexAxis(type, options);\n const datasetDefaults = (0, $c4d1694fa24f1a71$export$6559d589eb85fbb6)[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach((defaultID)=>{\n const axis = $dfc006ada1995968$var$getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + \"AxisID\"] || axis;\n scales[id] = scales[id] || Object.create(null);\n (0, $c4d1694fa24f1a71$export$555508cbc6add439)(scales[id], [\n {\n axis: axis\n },\n configScales[id],\n defaultScaleOptions[defaultID]\n ]);\n });\n });\n Object.keys(scales).forEach((key)=>{\n const scale = scales[key];\n (0, $c4d1694fa24f1a71$export$555508cbc6add439)(scale, [\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).scales[scale.type],\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).scale\n ]);\n });\n return scales;\n}\nfunction $dfc006ada1995968$var$initOptions(config) {\n const options = config.options || (config.options = {});\n options.plugins = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(options.plugins, {});\n options.scales = $dfc006ada1995968$var$mergeScaleConfig(config, options);\n}\nfunction $dfc006ada1995968$var$initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\nfunction $dfc006ada1995968$var$initConfig(config) {\n config = config || {};\n config.data = $dfc006ada1995968$var$initData(config.data);\n $dfc006ada1995968$var$initOptions(config);\n return config;\n}\nconst $dfc006ada1995968$var$keyCache = new Map();\nconst $dfc006ada1995968$var$keysCached = new Set();\nfunction $dfc006ada1995968$var$cachedKeys(cacheKey, generate) {\n let keys = $dfc006ada1995968$var$keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n $dfc006ada1995968$var$keyCache.set(cacheKey, keys);\n $dfc006ada1995968$var$keysCached.add(keys);\n }\n return keys;\n}\nconst $dfc006ada1995968$var$addIfFound = (set, obj, key)=>{\n const opts = (0, $c4d1694fa24f1a71$export$2d1720544b23b823)(obj, key);\n if (opts !== undefined) set.add(opts);\n};\nclass $dfc006ada1995968$var$Config {\n get platform() {\n return this._config.platform;\n }\n get type() {\n return this._config.type;\n }\n set type(type) {\n this._config.type = type;\n }\n get data() {\n return this._config.data;\n }\n set data(data) {\n this._config.data = $dfc006ada1995968$var$initData(data);\n }\n get options() {\n return this._config.options;\n }\n set options(options) {\n this._config.options = options;\n }\n get plugins() {\n return this._config.plugins;\n }\n update() {\n const config = this._config;\n this.clearCache();\n $dfc006ada1995968$var$initOptions(config);\n }\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n datasetScopeKeys(datasetType) {\n return $dfc006ada1995968$var$cachedKeys(datasetType, ()=>[\n [\n `datasets.${datasetType}`,\n \"\"\n ]\n ]);\n }\n datasetAnimationScopeKeys(datasetType, transition) {\n return $dfc006ada1995968$var$cachedKeys(`${datasetType}.transition.${transition}`, ()=>[\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`\n ],\n [\n `datasets.${datasetType}`,\n \"\"\n ]\n ]);\n }\n datasetElementScopeKeys(datasetType, elementType) {\n return $dfc006ada1995968$var$cachedKeys(`${datasetType}-${elementType}`, ()=>[\n [\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n \"\"\n ]\n ]);\n }\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return $dfc006ada1995968$var$cachedKeys(`${type}-plugin-${id}`, ()=>[\n [\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || []\n ]\n ]);\n }\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n getOptionScopes(mainScope, keyLists, resetCache) {\n const { options: options, type: type } = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) return cached;\n const scopes = new Set();\n keyLists.forEach((keys)=>{\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach((key)=>$dfc006ada1995968$var$addIfFound(scopes, mainScope, key));\n }\n keys.forEach((key)=>$dfc006ada1995968$var$addIfFound(scopes, options, key));\n keys.forEach((key)=>$dfc006ada1995968$var$addIfFound(scopes, (0, $c4d1694fa24f1a71$export$6559d589eb85fbb6)[type] || {}, key));\n keys.forEach((key)=>$dfc006ada1995968$var$addIfFound(scopes, (0, $c4d1694fa24f1a71$export$4368d992c4eafac0), key));\n keys.forEach((key)=>$dfc006ada1995968$var$addIfFound(scopes, (0, $c4d1694fa24f1a71$export$2e2af4578d910ddf), key));\n });\n const array = Array.from(scopes);\n if (array.length === 0) array.push(Object.create(null));\n if ($dfc006ada1995968$var$keysCached.has(keyLists)) cache.set(keyLists, array);\n return array;\n }\n chartOptionScopes() {\n const { options: options, type: type } = this;\n return [\n options,\n (0, $c4d1694fa24f1a71$export$6559d589eb85fbb6)[type] || {},\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).datasets[type] || {},\n {\n type: type\n },\n (0, $c4d1694fa24f1a71$export$4368d992c4eafac0),\n (0, $c4d1694fa24f1a71$export$2e2af4578d910ddf)\n ];\n }\n resolveNamedOptions(scopes, names, context, prefixes = [\n \"\"\n ]) {\n const result = {\n $shared: true\n };\n const { resolver: resolver, subPrefixes: subPrefixes } = $dfc006ada1995968$var$getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if ($dfc006ada1995968$var$needContext(resolver, names)) {\n result.$shared = false;\n context = (0, $c4d1694fa24f1a71$export$a93c5207d687da10)(context) ? context() : context;\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = (0, $c4d1694fa24f1a71$export$c3950d9923825c02)(resolver, context, subResolver);\n }\n for (const prop of names)result[prop] = options[prop];\n return result;\n }\n createResolver(scopes, context, prefixes = [\n \"\"\n ], descriptorDefaults) {\n const { resolver: resolver } = $dfc006ada1995968$var$getResolver(this._resolverCache, scopes, prefixes);\n return (0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(context) ? (0, $c4d1694fa24f1a71$export$c3950d9923825c02)(resolver, context, undefined, descriptorDefaults) : resolver;\n }\n constructor(config){\n this._config = $dfc006ada1995968$var$initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n}\nfunction $dfc006ada1995968$var$getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = (0, $c4d1694fa24f1a71$export$a9c996f45e5784d0)(scopes, prefixes);\n cached = {\n resolver: resolver,\n subPrefixes: prefixes.filter((p)=>!p.toLowerCase().includes(\"hover\"))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\nconst $dfc006ada1995968$var$hasFunction = (value)=>(0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(value) && Object.getOwnPropertyNames(value).reduce((acc, key)=>acc || (0, $c4d1694fa24f1a71$export$a93c5207d687da10)(value[key]), false);\nfunction $dfc006ada1995968$var$needContext(proxy, names) {\n const { isScriptable: isScriptable, isIndexable: isIndexable } = (0, $c4d1694fa24f1a71$export$7910e0436ed8d1de)(proxy);\n for (const prop of names){\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if (scriptable && ((0, $c4d1694fa24f1a71$export$a93c5207d687da10)(value) || $dfc006ada1995968$var$hasFunction(value)) || indexable && (0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(value)) return true;\n }\n return false;\n}\nvar $dfc006ada1995968$var$version = \"4.4.0\";\nconst $dfc006ada1995968$var$KNOWN_POSITIONS = [\n \"top\",\n \"bottom\",\n \"left\",\n \"right\",\n \"chartArea\"\n];\nfunction $dfc006ada1995968$var$positionIsHorizontal(position, axis) {\n return position === \"top\" || position === \"bottom\" || $dfc006ada1995968$var$KNOWN_POSITIONS.indexOf(position) === -1 && axis === \"x\";\n}\nfunction $dfc006ada1995968$var$compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1];\n };\n}\nfunction $dfc006ada1995968$var$onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n chart.notifyPlugins(\"afterRender\");\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(animationOptions && animationOptions.onComplete, [\n context\n ], chart);\n}\nfunction $dfc006ada1995968$var$onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(animationOptions && animationOptions.onProgress, [\n context\n ], chart);\n}\nfunction $dfc006ada1995968$var$getCanvas(item) {\n if ((0, $c4d1694fa24f1a71$export$3a1a48c8f6ef640e)() && typeof item === \"string\") item = document.getElementById(item);\n else if (item && item.length) item = item[0];\n if (item && item.canvas) item = item.canvas;\n return item;\n}\nconst $dfc006ada1995968$var$instances = {};\nconst $dfc006ada1995968$var$getChart = (key)=>{\n const canvas = $dfc006ada1995968$var$getCanvas(key);\n return Object.values($dfc006ada1995968$var$instances).filter((c)=>c.canvas === canvas).pop();\n};\nfunction $dfc006ada1995968$var$moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys){\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) obj[intKey + move] = value;\n }\n }\n}\nfunction $dfc006ada1995968$var$determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === \"mouseout\") return null;\n if (isClick) return lastEvent;\n return e;\n}\nfunction $dfc006ada1995968$var$getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\nfunction $dfc006ada1995968$var$getDatasetArea(meta, chartArea) {\n const { xScale: xScale, yScale: yScale } = meta;\n if (xScale && yScale) return {\n left: $dfc006ada1995968$var$getSizeForArea(xScale, chartArea, \"left\"),\n right: $dfc006ada1995968$var$getSizeForArea(xScale, chartArea, \"right\"),\n top: $dfc006ada1995968$var$getSizeForArea(yScale, chartArea, \"top\"),\n bottom: $dfc006ada1995968$var$getSizeForArea(yScale, chartArea, \"bottom\")\n };\n return chartArea;\n}\nclass $dfc006ada1995968$export$acaa6426d77a227e {\n static register(...items) {\n $dfc006ada1995968$export$4bb7493d241fd8a5.add(...items);\n $dfc006ada1995968$var$invalidatePlugins();\n }\n static unregister(...items) {\n $dfc006ada1995968$export$4bb7493d241fd8a5.remove(...items);\n $dfc006ada1995968$var$invalidatePlugins();\n }\n get aspectRatio() {\n const { options: { aspectRatio: aspectRatio, maintainAspectRatio: maintainAspectRatio }, width: width, height: height, _aspectRatio: _aspectRatio } = this;\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(aspectRatio)) return aspectRatio;\n if (maintainAspectRatio && _aspectRatio) return _aspectRatio;\n return height ? width / height : null;\n }\n get data() {\n return this.config.data;\n }\n set data(data) {\n this.config.data = data;\n }\n get options() {\n return this._options;\n }\n set options(options) {\n this.config.options = options;\n }\n get registry() {\n return $dfc006ada1995968$export$4bb7493d241fd8a5;\n }\n _initialize() {\n this.notifyPlugins(\"beforeInit\");\n if (this.options.responsive) this.resize();\n else (0, $c4d1694fa24f1a71$export$f787f51d84a910ad)(this, this.options.devicePixelRatio);\n this.bindEvents();\n this.notifyPlugins(\"afterInit\");\n return this;\n }\n clear() {\n (0, $c4d1694fa24f1a71$export$c9170ad7d4cd7e57)(this.canvas, this.ctx);\n return this;\n }\n stop() {\n $dfc006ada1995968$export$a424a0aa8f687495.stop(this);\n return this;\n }\n resize(width, height) {\n if (!$dfc006ada1995968$export$a424a0aa8f687495.running(this)) this._resize(width, height);\n else this._resizeBeforeDraw = {\n width: width,\n height: height\n };\n }\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? \"resize\" : \"attach\";\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!(0, $c4d1694fa24f1a71$export$f787f51d84a910ad)(this, newRatio, true)) return;\n this.notifyPlugins(\"resize\", {\n size: newSize\n });\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(options.onResize, [\n this,\n newSize\n ], this);\n if (this.attached) {\n if (this._doResize(mode)) this.render();\n }\n }\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(scalesOptions, (axisOptions, axisID)=>{\n axisOptions.id = axisID;\n });\n }\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id)=>{\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n if (scaleOpts) items = items.concat(Object.keys(scaleOpts).map((id)=>{\n const scaleOptions = scaleOpts[id];\n const axis = $dfc006ada1995968$var$determineAxis(id, scaleOptions);\n const isRadial = axis === \"r\";\n const isHorizontal = axis === \"x\";\n return {\n options: scaleOptions,\n dposition: isRadial ? \"chartArea\" : isHorizontal ? \"bottom\" : \"left\",\n dtype: isRadial ? \"radialLinear\" : isHorizontal ? \"category\" : \"linear\"\n };\n }));\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(items, (item)=>{\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = $dfc006ada1995968$var$determineAxis(id, scaleOptions);\n const scaleType = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(scaleOptions.type, item.dtype);\n if (scaleOptions.position === undefined || $dfc006ada1995968$var$positionIsHorizontal(scaleOptions.position, axis) !== $dfc006ada1995968$var$positionIsHorizontal(item.dposition)) scaleOptions.position = item.dposition;\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) scale = scales[id];\n else {\n const scaleClass = $dfc006ada1995968$export$4bb7493d241fd8a5.getScale(scaleType);\n scale = new scaleClass({\n id: id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n scale.init(scaleOptions, options);\n });\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(updated, (hasUpdated, id)=>{\n if (!hasUpdated) delete scales[id];\n });\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(scales, (scale)=>{\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(this, scale, scale.options);\n $dfc006ada1995968$export$1ecca0613f5e56d2.addBox(this, scale);\n });\n }\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n metasets.sort((a, b)=>a.index - b.index);\n if (numMeta > numData) {\n for(let i = numData; i < numMeta; ++i)this._destroyDatasetMeta(i);\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort($dfc006ada1995968$var$compare2Level(\"order\", \"index\"));\n }\n _removeUnreferencedMetasets() {\n const { _metasets: metasets, data: { datasets: datasets } } = this;\n if (metasets.length > datasets.length) delete this._stacks;\n metasets.forEach((meta, index)=>{\n if (datasets.filter((x)=>x === meta._dataset).length === 0) this._destroyDatasetMeta(index);\n });\n }\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n this._removeUnreferencedMetasets();\n for(i = 0, ilen = datasets.length; i < ilen; i++){\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || $dfc006ada1995968$var$getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = \"\" + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = $dfc006ada1995968$export$4bb7493d241fd8a5.getController(type);\n const { datasetElementType: datasetElementType, dataElementType: dataElementType } = (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: $dfc006ada1995968$export$4bb7493d241fd8a5.getElement(dataElementType),\n datasetElementType: datasetElementType && $dfc006ada1995968$export$4bb7493d241fd8a5.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n this._updateMetasets();\n return newControllers;\n }\n _resetElements() {\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this.data.datasets, (dataset, datasetIndex)=>{\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n reset() {\n this._resetElements();\n this.notifyPlugins(\"reset\");\n }\n update(mode) {\n const config = this.config;\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n this._plugins.invalidate();\n if (this.notifyPlugins(\"beforeUpdate\", {\n mode: mode,\n cancelable: true\n }) === false) return;\n const newControllers = this.buildOrUpdateControllers();\n this.notifyPlugins(\"beforeElementsUpdate\");\n let minPadding = 0;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; i++){\n const { controller: controller } = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n if (!animsDisabled) (0, $c4d1694fa24f1a71$export$d66501df72047452)(newControllers, (controller)=>{\n controller.reset();\n });\n this._updateDatasets(mode);\n this.notifyPlugins(\"afterUpdate\", {\n mode: mode\n });\n this._layers.sort($dfc006ada1995968$var$compare2Level(\"z\", \"_idx\"));\n const { _active: _active, _lastEvent: _lastEvent } = this;\n if (_lastEvent) this._eventHandler(_lastEvent, true);\n else if (_active.length) this._updateHoverStyles(_active, _active, true);\n this.render();\n }\n _updateScales() {\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this.scales, (scale)=>{\n $dfc006ada1995968$export$1ecca0613f5e56d2.removeBox(this, scale);\n });\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n if (!(0, $c4d1694fa24f1a71$export$ee7c8ad385a60b7b)(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n this.unbindEvents();\n this.bindEvents();\n }\n }\n _updateHiddenIndices() {\n const { _hiddenIndices: _hiddenIndices } = this;\n const changes = this._getUniformDataChanges() || [];\n for (const { method: method, start: start, count: count } of changes){\n const move = method === \"_removeElements\" ? -count : count;\n $dfc006ada1995968$var$moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) return;\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx)=>new Set(_dataChanges.filter((c)=>c[0] === idx).map((c, i)=>i + \",\" + c.splice(1).join(\",\")));\n const changeSet = makeSet(0);\n for(let i = 1; i < datasetCount; i++){\n if (!(0, $c4d1694fa24f1a71$export$ee7c8ad385a60b7b)(changeSet, makeSet(i))) return;\n }\n return Array.from(changeSet).map((c)=>c.split(\",\")).map((a)=>({\n method: a[1],\n start: +a[2],\n count: +a[3]\n }));\n }\n _updateLayout(minPadding) {\n if (this.notifyPlugins(\"beforeLayout\", {\n cancelable: true\n }) === false) return;\n $dfc006ada1995968$export$1ecca0613f5e56d2.update(this, this.width, this.height, minPadding);\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n this._layers = [];\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this.boxes, (box)=>{\n if (noArea && box.position === \"chartArea\") return;\n if (box.configure) box.configure();\n this._layers.push(...box._layers());\n }, this);\n this._layers.forEach((item, index)=>{\n item._idx = index;\n });\n this.notifyPlugins(\"afterLayout\");\n }\n _updateDatasets(mode) {\n if (this.notifyPlugins(\"beforeDatasetsUpdate\", {\n mode: mode,\n cancelable: true\n }) === false) return;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i)this.getDatasetMeta(i).controller.configure();\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i)this._updateDataset(i, (0, $c4d1694fa24f1a71$export$a93c5207d687da10)(mode) ? mode({\n datasetIndex: i\n }) : mode);\n this.notifyPlugins(\"afterDatasetsUpdate\", {\n mode: mode\n });\n }\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {\n meta: meta,\n index: index,\n mode: mode,\n cancelable: true\n };\n if (this.notifyPlugins(\"beforeDatasetUpdate\", args) === false) return;\n meta.controller._update(mode);\n args.cancelable = false;\n this.notifyPlugins(\"afterDatasetUpdate\", args);\n }\n render() {\n if (this.notifyPlugins(\"beforeRender\", {\n cancelable: true\n }) === false) return;\n if ($dfc006ada1995968$export$a424a0aa8f687495.has(this)) {\n if (this.attached && !$dfc006ada1995968$export$a424a0aa8f687495.running(this)) $dfc006ada1995968$export$a424a0aa8f687495.start(this);\n } else {\n this.draw();\n $dfc006ada1995968$var$onAnimationsComplete({\n chart: this\n });\n }\n }\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const { width: width, height: height } = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n if (this.width <= 0 || this.height <= 0) return;\n if (this.notifyPlugins(\"beforeDraw\", {\n cancelable: true\n }) === false) return;\n const layers = this._layers;\n for(i = 0; i < layers.length && layers[i].z <= 0; ++i)layers[i].draw(this.chartArea);\n this._drawDatasets();\n for(; i < layers.length; ++i)layers[i].draw(this.chartArea);\n this.notifyPlugins(\"afterDraw\");\n }\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n const meta = metasets[i];\n if (!filterVisible || meta.visible) result.push(meta);\n }\n return result;\n }\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n _drawDatasets() {\n if (this.notifyPlugins(\"beforeDatasetsDraw\", {\n cancelable: true\n }) === false) return;\n const metasets = this.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i)this._drawDataset(metasets[i]);\n this.notifyPlugins(\"afterDatasetsDraw\");\n }\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = $dfc006ada1995968$var$getDatasetArea(meta, this.chartArea);\n const args = {\n meta: meta,\n index: meta.index,\n cancelable: true\n };\n if (this.notifyPlugins(\"beforeDatasetDraw\", args) === false) return;\n if (useClip) (0, $c4d1694fa24f1a71$export$8743009a87fcb00f)(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n meta.controller.draw();\n if (useClip) (0, $c4d1694fa24f1a71$export$3d8c2f653ac9d0b9)(ctx);\n args.cancelable = false;\n this.notifyPlugins(\"afterDatasetDraw\", args);\n }\n isPointInArea(point) {\n return (0, $c4d1694fa24f1a71$export$e7094788287c5e9b)(point, this.chartArea, this._minPadding);\n }\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = $dfc006ada1995968$export$a13296960cae0384.modes[mode];\n if (typeof method === \"function\") return method(this, e, options, useFinalPosition);\n return [];\n }\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter((x)=>x && x._dataset === dataset).pop();\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n return meta;\n }\n getContext() {\n return this.$context || (this.$context = (0, $c4d1694fa24f1a71$export$35e795649ee09318)(null, {\n chart: this,\n type: \"chart\"\n }));\n }\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) return false;\n const meta = this.getDatasetMeta(datasetIndex);\n return typeof meta.hidden === \"boolean\" ? !meta.hidden : !dataset.hidden;\n }\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? \"show\" : \"hide\";\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n if ((0, $c4d1694fa24f1a71$export$dda1d9f60106f0e9)(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n anims.update(meta, {\n visible: visible\n });\n this.update((ctx)=>ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) meta.controller._destroy();\n delete this._metasets[datasetIndex];\n }\n _stop() {\n let i, ilen;\n this.stop();\n $dfc006ada1995968$export$a424a0aa8f687495.remove(this);\n for(i = 0, ilen = this.data.datasets.length; i < ilen; ++i)this._destroyDatasetMeta(i);\n }\n destroy() {\n this.notifyPlugins(\"beforeDestroy\");\n const { canvas: canvas, ctx: ctx } = this;\n this._stop();\n this.config.clearCache();\n if (canvas) {\n this.unbindEvents();\n (0, $c4d1694fa24f1a71$export$c9170ad7d4cd7e57)(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n delete $dfc006ada1995968$var$instances[this.id];\n this.notifyPlugins(\"afterDestroy\");\n }\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) this.bindResponsiveEvents();\n else this.attached = true;\n }\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const listener = (e, x, y)=>{\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this.options.events, (type)=>_add(type, listener));\n }\n bindResponsiveEvents() {\n if (!this._responsiveListeners) this._responsiveListeners = {};\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener)=>{\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n const listener = (width, height)=>{\n if (this.canvas) this.resize(width, height);\n };\n let detached;\n const attached = ()=>{\n _remove(\"attach\", attached);\n this.attached = true;\n this.resize();\n _add(\"resize\", listener);\n _add(\"detach\", detached);\n };\n detached = ()=>{\n this.attached = false;\n _remove(\"resize\", listener);\n this._stop();\n this._resize(0, 0);\n _add(\"attach\", attached);\n };\n if (platform.isAttached(this.canvas)) attached();\n else detached();\n }\n unbindEvents() {\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this._listeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this._responsiveListeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? \"set\" : \"remove\";\n let meta, item, i, ilen;\n if (mode === \"dataset\") {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller[\"_\" + prefix + \"DatasetHoverStyle\"]();\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) controller[prefix + \"HoverStyle\"](item.element, item.datasetIndex, item.index);\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({ datasetIndex: datasetIndex, index: index })=>{\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) throw new Error(\"No dataset found at index \" + datasetIndex);\n return {\n datasetIndex: datasetIndex,\n element: meta.data[index],\n index: index\n };\n });\n const changed = !(0, $c4d1694fa24f1a71$export$995eb9fca571757)(active, lastActive);\n if (changed) {\n this._active = active;\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter((p)=>p.plugin.id === pluginId).length === 1;\n }\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n if (deactivated.length) this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n if (activated.length && hoverOptions.mode) this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay: replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin)=>(plugin.options.events || this.options.events).includes(e.native.type);\n if (this.notifyPlugins(\"beforeEvent\", args, eventFilter) === false) return;\n const changed = this._handleEvent(e, replay, args.inChartArea);\n args.cancelable = false;\n this.notifyPlugins(\"afterEvent\", args, eventFilter);\n if (changed || args.changed) this.render();\n return this;\n }\n _handleEvent(e, replay, inChartArea) {\n const { _active: lastActive = [], options: options } = this;\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = (0, $c4d1694fa24f1a71$export$f38c853ae54ed474)(e);\n const lastEvent = $dfc006ada1995968$var$determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n if (inChartArea) {\n this._lastEvent = null;\n (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(options.onHover, [\n e,\n active,\n this\n ], this);\n if (isClick) (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(options.onClick, [\n e,\n active,\n this\n ], this);\n }\n const changed = !(0, $c4d1694fa24f1a71$export$995eb9fca571757)(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n this._lastEvent = lastEvent;\n return changed;\n }\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === \"mouseout\") return [];\n if (!inChartArea) return lastActive;\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n constructor(item, userConfig){\n const config = this.config = new $dfc006ada1995968$var$Config(userConfig);\n const initialCanvas = $dfc006ada1995968$var$getCanvas(item);\n const existingChart = $dfc006ada1995968$var$getChart(initialCanvas);\n if (existingChart) throw new Error(\"Canvas is already in use. Chart with ID '\" + existingChart.id + \"'\" + \" must be destroyed before the canvas with ID '\" + existingChart.canvas.id + \"' can be reused.\");\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n this.platform = new (config.platform || $dfc006ada1995968$export$72cd9e67b1b784f9(initialCanvas))();\n this.platform.updateConfig(config);\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n this.id = (0, $c4d1694fa24f1a71$export$2219238a014317b0)();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new $dfc006ada1995968$var$PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = (0, $c4d1694fa24f1a71$export$4c3d22f3d993c33f)((mode)=>this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n $dfc006ada1995968$var$instances[this.id] = this;\n if (!context || !canvas) {\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n $dfc006ada1995968$export$a424a0aa8f687495.listen(this, \"complete\", $dfc006ada1995968$var$onAnimationsComplete);\n $dfc006ada1995968$export$a424a0aa8f687495.listen(this, \"progress\", $dfc006ada1995968$var$onAnimationProgress);\n this._initialize();\n if (this.attached) this.update();\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$acaa6426d77a227e, \"defaults\", (0, $c4d1694fa24f1a71$export$4368d992c4eafac0));\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$acaa6426d77a227e, \"instances\", $dfc006ada1995968$var$instances);\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$acaa6426d77a227e, \"overrides\", (0, $c4d1694fa24f1a71$export$6559d589eb85fbb6));\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$acaa6426d77a227e, \"registry\", $dfc006ada1995968$export$4bb7493d241fd8a5);\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$acaa6426d77a227e, \"version\", $dfc006ada1995968$var$version);\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$acaa6426d77a227e, \"getChart\", $dfc006ada1995968$var$getChart);\nfunction $dfc006ada1995968$var$invalidatePlugins() {\n return (0, $c4d1694fa24f1a71$export$d66501df72047452)($dfc006ada1995968$export$acaa6426d77a227e.instances, (chart)=>chart._plugins.invalidate());\n}\nfunction $dfc006ada1995968$var$clipArc(ctx, element, endAngle) {\n const { startAngle: startAngle, pixelMargin: pixelMargin, x: x, y: y, outerRadius: outerRadius, innerRadius: innerRadius } = element;\n let angleMargin = pixelMargin / outerRadius;\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else ctx.arc(x, y, pixelMargin, endAngle + (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd), startAngle - (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd));\n ctx.closePath();\n ctx.clip();\n}\nfunction $dfc006ada1995968$var$toRadiusCorners(value) {\n return (0, $c4d1694fa24f1a71$export$21579262ef46735b)(value, [\n \"outerStart\",\n \"outerEnd\",\n \"innerStart\",\n \"innerEnd\"\n ]);\n}\n/**\n * Parse border radius from the provided options\n */ function $dfc006ada1995968$var$parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n const o = $dfc006ada1995968$var$toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val)=>{\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(o.innerStart, 0, innerLimit),\n innerEnd: (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(o.innerEnd, 0, innerLimit)\n };\n}\n/**\n * Convert (r, 𝜃) to (x, y)\n */ function $dfc006ada1995968$var$rThetaToXY(r, theta, x, y) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta)\n };\n}\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */ function $dfc006ada1995968$var$pathArc(ctx, element, offset, spacing, end, circular) {\n const { x: x, y: y, startAngle: start, pixelMargin: pixelMargin, innerRadius: innerR } = element;\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n let spacingOffset = 0;\n const alpha = end - start;\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n const beta = Math.max(0.001, alpha * outerRadius - offset / (0, $c4d1694fa24f1a71$export$56c0d5a1e737357d)) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const { outerStart: outerStart, outerEnd: outerEnd, innerStart: innerStart, innerEnd: innerEnd } = $dfc006ada1995968$var$parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n ctx.beginPath();\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = $dfc006ada1995968$var$rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd));\n }\n // The line from point 3 to point 4\n const p4 = $dfc006ada1995968$var$rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = $dfc006ada1995968$var$rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd), innerEndAdjustedAngle + Math.PI);\n }\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2;\n ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true);\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = $dfc006ada1995968$var$rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd));\n }\n // The line from point 7 to point 8\n const p8 = $dfc006ada1995968$var$rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = $dfc006ada1995968$var$rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd), outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n ctx.closePath();\n}\nfunction $dfc006ada1995968$var$drawArc(ctx, element, offset, spacing, circular) {\n const { fullCircles: fullCircles, startAngle: startAngle, circumference: circumference } = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n $dfc006ada1995968$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i)ctx.fill();\n if (!isNaN(circumference)) endAngle = startAngle + (circumference % (0, $c4d1694fa24f1a71$export$971d5caa766a69d7) || (0, $c4d1694fa24f1a71$export$971d5caa766a69d7));\n }\n $dfc006ada1995968$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\nfunction $dfc006ada1995968$var$drawBorder(ctx, element, offset, spacing, circular) {\n const { fullCircles: fullCircles, startAngle: startAngle, circumference: circumference, options: options } = element;\n const { borderWidth: borderWidth, borderJoinStyle: borderJoinStyle, borderDash: borderDash, borderDashOffset: borderDashOffset } = options;\n const inner = options.borderAlign === \"inner\";\n if (!borderWidth) return;\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || \"round\";\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || \"bevel\";\n }\n let endAngle = element.endAngle;\n if (fullCircles) {\n $dfc006ada1995968$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i)ctx.stroke();\n if (!isNaN(circumference)) endAngle = startAngle + (circumference % (0, $c4d1694fa24f1a71$export$971d5caa766a69d7) || (0, $c4d1694fa24f1a71$export$971d5caa766a69d7));\n }\n if (inner) $dfc006ada1995968$var$clipArc(ctx, element, endAngle);\n if (!fullCircles) {\n $dfc006ada1995968$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\nclass $dfc006ada1995968$export$d48203c759d6a1fc extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n inRange(chartX, chartY, useFinalPosition) {\n const point = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n const { angle: angle, distance: distance } = (0, $c4d1694fa24f1a71$export$96f57966bedc81b4)(point, {\n x: chartX,\n y: chartY\n });\n const { startAngle: startAngle, endAngle: endAngle, innerRadius: innerRadius, outerRadius: outerRadius, circumference: circumference } = this.getProps([\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\",\n \"circumference\"\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= (0, $c4d1694fa24f1a71$export$971d5caa766a69d7) || (0, $c4d1694fa24f1a71$export$ffb5f4729a158638)(angle, startAngle, endAngle);\n const withinRadius = (0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n return betweenAngles && withinRadius;\n }\n getCenterPoint(useFinalPosition) {\n const { x: x, y: y, startAngle: startAngle, endAngle: endAngle, innerRadius: innerRadius, outerRadius: outerRadius } = this.getProps([\n \"x\",\n \"y\",\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\"\n ], useFinalPosition);\n const { offset: offset, spacing: spacing } = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n tooltipPosition(useFinalPosition) {\n return this.getCenterPoint(useFinalPosition);\n }\n draw(ctx) {\n const { options: options, circumference: circumference } = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = options.borderAlign === \"inner\" ? 0.33 : 0;\n this.fullCircles = circumference > (0, $c4d1694fa24f1a71$export$971d5caa766a69d7) ? Math.floor(circumference / (0, $c4d1694fa24f1a71$export$971d5caa766a69d7)) : 0;\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) return;\n ctx.save();\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min((0, $c4d1694fa24f1a71$export$56c0d5a1e737357d), circumference || 0));\n const radiusOffset = offset * fix;\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n $dfc006ada1995968$var$drawArc(ctx, this, radiusOffset, spacing, circular);\n $dfc006ada1995968$var$drawBorder(ctx, this, radiusOffset, spacing, circular);\n ctx.restore();\n }\n constructor(cfg){\n super();\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"circumference\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"endAngle\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"fullCircles\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"innerRadius\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"outerRadius\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"pixelMargin\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"startAngle\", void 0);\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$d48203c759d6a1fc, \"id\", \"arc\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$d48203c759d6a1fc, \"defaults\", {\n borderAlign: \"center\",\n borderColor: \"#fff\",\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$d48203c759d6a1fc, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\"\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$d48203c759d6a1fc, \"descriptors\", {\n _scriptable: true,\n _indexable: (name)=>name !== \"borderDash\"\n});\nfunction $dfc006ada1995968$var$setStyle(ctx, options, style = options) {\n ctx.lineCap = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash((0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(style.borderDash, options.borderDash));\n ctx.lineDashOffset = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(style.borderColor, options.borderColor);\n}\nfunction $dfc006ada1995968$var$lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\nfunction $dfc006ada1995968$var$getLineMethod(options) {\n if (options.stepped) return 0, $c4d1694fa24f1a71$export$d24c54395ce0c509;\n if (options.tension || options.cubicInterpolationMode === \"monotone\") return 0, $c4d1694fa24f1a71$export$6554612db691658e;\n return $dfc006ada1995968$var$lineTo;\n}\nfunction $dfc006ada1995968$var$pathVars(points, segment, params = {}) {\n const count = points.length;\n const { start: paramsStart = 0, end: paramsEnd = count - 1 } = params;\n const { start: segmentStart, end: segmentEnd } = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n return {\n count: count,\n start: start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\nfunction $dfc006ada1995968$var$pathSegment(ctx, line, segment, params) {\n const { points: points, options: options } = line;\n const { count: count, start: start, loop: loop, ilen: ilen } = $dfc006ada1995968$var$pathVars(points, segment, params);\n const lineMethod = $dfc006ada1995968$var$getLineMethod(options);\n let { move: move = true, reverse: reverse } = params || {};\n let i, point, prev;\n for(i = 0; i <= ilen; ++i){\n point = points[(start + (reverse ? ilen - i : i)) % count];\n if (point.skip) continue;\n else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else lineMethod(ctx, prev, point, reverse, options.stepped);\n prev = point;\n }\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n return !!loop;\n}\nfunction $dfc006ada1995968$var$fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const { count: count, start: start, ilen: ilen } = $dfc006ada1995968$var$pathVars(points, segment, params);\n const { move: move = true, reverse: reverse } = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n const pointIndex = (index)=>(start + (reverse ? ilen - index : index)) % count;\n const drawX = ()=>{\n if (minY !== maxY) {\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n ctx.lineTo(avgX, lastY);\n }\n };\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n for(i = 0; i <= ilen; ++i){\n point = points[pointIndex(i)];\n if (point.skip) continue;\n const x = point.x;\n const y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) minY = y;\n else if (y > maxY) maxY = y;\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n ctx.lineTo(x, y);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n lastY = y;\n }\n drawX();\n}\nfunction $dfc006ada1995968$var$_getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== \"monotone\" && !opts.stepped && !borderDash;\n return useFastPath ? $dfc006ada1995968$var$fastPathSegment : $dfc006ada1995968$var$pathSegment;\n}\nfunction $dfc006ada1995968$var$_getInterpolationMethod(options) {\n if (options.stepped) return 0, $c4d1694fa24f1a71$export$7a38258bbe170828;\n if (options.tension || options.cubicInterpolationMode === \"monotone\") return 0, $c4d1694fa24f1a71$export$2f6ca3d3b1f80bf5;\n return 0, $c4d1694fa24f1a71$export$8a5498727ef6be21;\n}\nfunction $dfc006ada1995968$var$strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) path.closePath();\n }\n $dfc006ada1995968$var$setStyle(ctx, line.options);\n ctx.stroke(path);\n}\nfunction $dfc006ada1995968$var$strokePathDirect(ctx, line, start, count) {\n const { segments: segments, options: options } = line;\n const segmentMethod = $dfc006ada1995968$var$_getSegmentMethod(line);\n for (const segment of segments){\n $dfc006ada1995968$var$setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {\n start: start,\n end: start + count - 1\n })) ctx.closePath();\n ctx.stroke();\n }\n}\nconst $dfc006ada1995968$var$usePath2D = typeof Path2D === \"function\";\nfunction $dfc006ada1995968$var$draw(ctx, line, start, count) {\n if ($dfc006ada1995968$var$usePath2D && !line.options.segment) $dfc006ada1995968$var$strokePathWithCache(ctx, line, start, count);\n else $dfc006ada1995968$var$strokePathDirect(ctx, line, start, count);\n}\nclass $dfc006ada1995968$export$55e463fa7bcd3469 extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === \"monotone\") && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n (0, $c4d1694fa24f1a71$export$ab83b03e4111b1d0)(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n get points() {\n return this._points;\n }\n get segments() {\n return this._segments || (this._segments = (0, $c4d1694fa24f1a71$export$1a82df3d29112e01)(this, this.options.segment));\n }\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = (0, $c4d1694fa24f1a71$export$306ddfe3a8403e2)(this, {\n property: property,\n start: value,\n end: value\n });\n if (!segments.length) return;\n const result = [];\n const _interpolate = $dfc006ada1995968$var$_getInterpolationMethod(options);\n let i, ilen;\n for(i = 0, ilen = segments.length; i < ilen; ++i){\n const { start: start, end: end } = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n pathSegment(ctx, segment, params) {\n const segmentMethod = $dfc006ada1995968$var$_getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = $dfc006ada1995968$var$_getSegmentMethod(this);\n let loop = this._loop;\n start = start || 0;\n count = count || this.points.length - start;\n for (const segment of segments)loop &= segmentMethod(ctx, this, segment, {\n start: start,\n end: start + count - 1\n });\n return !!loop;\n }\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n if (points.length && options.borderWidth) {\n ctx.save();\n $dfc006ada1995968$var$draw(ctx, this, start, count);\n ctx.restore();\n }\n if (this.animated) {\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n constructor(cfg){\n super();\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$55e463fa7bcd3469, \"id\", \"line\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$55e463fa7bcd3469, \"defaults\", {\n borderCapStyle: \"butt\",\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: \"miter\",\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: \"default\",\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$55e463fa7bcd3469, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\",\n borderColor: \"borderColor\"\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$55e463fa7bcd3469, \"descriptors\", {\n _scriptable: true,\n _indexable: (name)=>name !== \"borderDash\" && name !== \"fill\"\n});\nfunction $dfc006ada1995968$var$inRange$1(el, pos, axis, useFinalPosition) {\n const options = el.options;\n const { [axis]: value } = el.getProps([\n axis\n ], useFinalPosition);\n return Math.abs(pos - value) < options.radius + options.hitRadius;\n}\nclass $dfc006ada1995968$export$bd159b522b230b7a extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n inRange(mouseX, mouseY, useFinalPosition) {\n const options = this.options;\n const { x: x, y: y } = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2);\n }\n inXRange(mouseX, useFinalPosition) {\n return $dfc006ada1995968$var$inRange$1(this, mouseX, \"x\", useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return $dfc006ada1995968$var$inRange$1(this, mouseY, \"y\", useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x: x, y: y } = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n return {\n x: x,\n y: y\n };\n }\n size(options) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n draw(ctx, area) {\n const options = this.options;\n if (this.skip || options.radius < 0.1 || !(0, $c4d1694fa24f1a71$export$e7094788287c5e9b)(this, area, this.size(options) / 2)) return;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n (0, $c4d1694fa24f1a71$export$493d36ec626b6698)(ctx, options, this.x, this.y);\n }\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n constructor(cfg){\n super();\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"parsed\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"skip\", void 0);\n (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)(this, \"stop\", void 0);\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$bd159b522b230b7a, \"id\", \"point\");\n/**\n * @type {any}\n */ (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$bd159b522b230b7a, \"defaults\", {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: \"circle\",\n radius: 3,\n rotation: 0\n});\n/**\n * @type {any}\n */ (0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$bd159b522b230b7a, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\",\n borderColor: \"borderColor\"\n});\nfunction $dfc006ada1995968$var$getBarBounds(bar, useFinalPosition) {\n const { x: x, y: y, base: base, width: width, height: height } = bar.getProps([\n \"x\",\n \"y\",\n \"base\",\n \"width\",\n \"height\"\n ], useFinalPosition);\n let left, right, top, bottom, half;\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n return {\n left: left,\n top: top,\n right: right,\n bottom: bottom\n };\n}\nfunction $dfc006ada1995968$var$skipOrLimit(skip, value, min, max) {\n return skip ? 0 : (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(value, min, max);\n}\nfunction $dfc006ada1995968$var$parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = (0, $c4d1694fa24f1a71$export$d66dc83d8cfc8dd)(value);\n return {\n t: $dfc006ada1995968$var$skipOrLimit(skip.top, o.top, 0, maxH),\n r: $dfc006ada1995968$var$skipOrLimit(skip.right, o.right, 0, maxW),\n b: $dfc006ada1995968$var$skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: $dfc006ada1995968$var$skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\nfunction $dfc006ada1995968$var$parseBorderRadius(bar, maxW, maxH) {\n const { enableBorderRadius: enableBorderRadius } = bar.getProps([\n \"enableBorderRadius\"\n ]);\n const value = bar.options.borderRadius;\n const o = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n const enableBorder = enableBorderRadius || (0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(value);\n return {\n topLeft: $dfc006ada1995968$var$skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: $dfc006ada1995968$var$skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: $dfc006ada1995968$var$skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: $dfc006ada1995968$var$skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\nfunction $dfc006ada1995968$var$boundingRects(bar) {\n const bounds = $dfc006ada1995968$var$getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = $dfc006ada1995968$var$parseBorderWidth(bar, width / 2, height / 2);\n const radius = $dfc006ada1995968$var$parseBorderRadius(bar, width / 2, height / 2);\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius: radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))\n }\n }\n };\n}\nfunction $dfc006ada1995968$var$inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && $dfc006ada1995968$var$getBarBounds(bar, useFinalPosition);\n return bounds && (skipX || (0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(x, bounds.left, bounds.right)) && (skipY || (0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(y, bounds.top, bounds.bottom));\n}\nfunction $dfc006ada1995968$var$hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\nfunction $dfc006ada1995968$var$addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction $dfc006ada1995968$var$inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\nclass $dfc006ada1995968$export$a16ed71bf4b07672 extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n draw(ctx) {\n const { inflateAmount: inflateAmount, options: { borderColor: borderColor, backgroundColor: backgroundColor } } = this;\n const { inner: inner, outer: outer } = $dfc006ada1995968$var$boundingRects(this);\n const addRectPath = $dfc006ada1995968$var$hasRadius(outer.radius) ? (0, $c4d1694fa24f1a71$export$1fbe638ecf81657e) : $dfc006ada1995968$var$addNormalRectPath;\n ctx.save();\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, $dfc006ada1995968$var$inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, $dfc006ada1995968$var$inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill(\"evenodd\");\n }\n ctx.beginPath();\n addRectPath(ctx, $dfc006ada1995968$var$inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n return $dfc006ada1995968$var$inRange(this, mouseX, mouseY, useFinalPosition);\n }\n inXRange(mouseX, useFinalPosition) {\n return $dfc006ada1995968$var$inRange(this, mouseX, null, useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return $dfc006ada1995968$var$inRange(this, null, mouseY, useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x: x, y: y, base: base, horizontal: horizontal } = this.getProps([\n \"x\",\n \"y\",\n \"base\",\n \"horizontal\"\n ], useFinalPosition);\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n getRange(axis) {\n return axis === \"x\" ? this.width / 2 : this.height / 2;\n }\n constructor(cfg){\n super();\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$a16ed71bf4b07672, \"id\", \"bar\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$a16ed71bf4b07672, \"defaults\", {\n borderSkipped: \"start\",\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: \"auto\",\n pointStyle: undefined\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$a16ed71bf4b07672, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\",\n borderColor: \"borderColor\"\n});\nvar $dfc006ada1995968$export$7a5d735b2ab6389d = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n ArcElement: $dfc006ada1995968$export$d48203c759d6a1fc,\n BarElement: $dfc006ada1995968$export$a16ed71bf4b07672,\n LineElement: $dfc006ada1995968$export$55e463fa7bcd3469,\n PointElement: $dfc006ada1995968$export$bd159b522b230b7a\n});\nconst $dfc006ada1995968$var$BORDER_COLORS = [\n \"rgb(54, 162, 235)\",\n \"rgb(255, 99, 132)\",\n \"rgb(255, 159, 64)\",\n \"rgb(255, 205, 86)\",\n \"rgb(75, 192, 192)\",\n \"rgb(153, 102, 255)\",\n \"rgb(201, 203, 207)\" // grey\n];\n// Border colors with 50% transparency\nconst $dfc006ada1995968$var$BACKGROUND_COLORS = /* #__PURE__ */ $dfc006ada1995968$var$BORDER_COLORS.map((color)=>color.replace(\"rgb(\", \"rgba(\").replace(\")\", \", 0.5)\"));\nfunction $dfc006ada1995968$var$getBorderColor(i) {\n return $dfc006ada1995968$var$BORDER_COLORS[i % $dfc006ada1995968$var$BORDER_COLORS.length];\n}\nfunction $dfc006ada1995968$var$getBackgroundColor(i) {\n return $dfc006ada1995968$var$BACKGROUND_COLORS[i % $dfc006ada1995968$var$BACKGROUND_COLORS.length];\n}\nfunction $dfc006ada1995968$var$colorizeDefaultDataset(dataset, i) {\n dataset.borderColor = $dfc006ada1995968$var$getBorderColor(i);\n dataset.backgroundColor = $dfc006ada1995968$var$getBackgroundColor(i);\n return ++i;\n}\nfunction $dfc006ada1995968$var$colorizeDoughnutDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>$dfc006ada1995968$var$getBorderColor(i++));\n return i;\n}\nfunction $dfc006ada1995968$var$colorizePolarAreaDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>$dfc006ada1995968$var$getBackgroundColor(i++));\n return i;\n}\nfunction $dfc006ada1995968$var$getColorizer(chart) {\n let i = 0;\n return (dataset, datasetIndex)=>{\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n if (controller instanceof $dfc006ada1995968$export$e04603e7d8b77172) i = $dfc006ada1995968$var$colorizeDoughnutDataset(dataset, i);\n else if (controller instanceof $dfc006ada1995968$export$2a270b3a0d973c85) i = $dfc006ada1995968$var$colorizePolarAreaDataset(dataset, i);\n else if (controller) i = $dfc006ada1995968$var$colorizeDefaultDataset(dataset, i);\n };\n}\nfunction $dfc006ada1995968$var$containsColorsDefinitions(descriptors) {\n let k;\n for(k in descriptors){\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) return true;\n }\n return false;\n}\nfunction $dfc006ada1995968$var$containsColorsDefinition(descriptor) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\nvar $dfc006ada1995968$export$c537fa0d021d010b = {\n id: \"colors\",\n defaults: {\n enabled: true,\n forceOverride: false\n },\n beforeLayout (chart, _args, options) {\n if (!options.enabled) return;\n const { data: { datasets: datasets }, options: chartOptions } = chart.config;\n const { elements: elements } = chartOptions;\n if (!options.forceOverride && ($dfc006ada1995968$var$containsColorsDefinitions(datasets) || $dfc006ada1995968$var$containsColorsDefinition(chartOptions) || elements && $dfc006ada1995968$var$containsColorsDefinitions(elements))) return;\n const colorizer = $dfc006ada1995968$var$getColorizer(chart);\n datasets.forEach(colorizer);\n }\n};\nfunction $dfc006ada1995968$var$lttbDecimation(data, start, count, availableWidth, options) {\n const samples = options.samples || availableWidth;\n if (samples >= count) return data.slice(start, start + count);\n const decimated = [];\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n decimated[sampledIndex++] = data[a];\n for(i = 0; i < samples - 2; i++){\n let avgX = 0;\n let avgY = 0;\n let j;\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n for(j = avgRangeStart; j < avgRangeEnd; j++){\n avgX += data[j].x;\n avgY += data[j].y;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const { x: pointAx, y: pointAy } = data[a];\n maxArea = area = -1;\n for(j = rangeOffs; j < rangeTo; j++){\n area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy));\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n decimated[sampledIndex++] = data[endIndex];\n return decimated;\n}\nfunction $dfc006ada1995968$var$minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n for(i = start; i < start + count; ++i){\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n const lastIndex = i - 1;\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(minIndex) && !(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(maxIndex)) {\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) decimated.push({\n ...data[intermediateIndex1],\n x: avgX\n });\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n if (i > 0 && lastIndex !== startIndex) decimated.push(data[lastIndex]);\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n return decimated;\n}\nfunction $dfc006ada1995968$var$cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, \"data\", {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data\n });\n }\n}\nfunction $dfc006ada1995968$var$cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset)=>{\n $dfc006ada1995968$var$cleanDecimatedDataset(dataset);\n });\n}\nfunction $dfc006ada1995968$var$getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n let start = 0;\n let count;\n const { iScale: iScale } = meta;\n const { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = iScale.getUserBounds();\n if (minDefined) start = (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)((0, $c4d1694fa24f1a71$export$ef35774e6d314e91)(points, iScale.axis, min).lo, 0, pointCount - 1);\n if (maxDefined) count = (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)((0, $c4d1694fa24f1a71$export$ef35774e6d314e91)(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n else count = pointCount - start;\n return {\n start: start,\n count: count\n };\n}\nvar $dfc006ada1995968$export$be17f937e9aa7533 = {\n id: \"decimation\",\n defaults: {\n algorithm: \"min-max\",\n enabled: false\n },\n beforeElementsUpdate: (chart, args, options)=>{\n if (!options.enabled) {\n $dfc006ada1995968$var$cleanDecimatedData(chart);\n return;\n }\n const availableWidth = chart.width;\n chart.data.datasets.forEach((dataset, datasetIndex)=>{\n const { _data: _data, indexAxis: indexAxis } = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n if ((0, $c4d1694fa24f1a71$export$407448d2b89b1813)([\n indexAxis,\n chart.options.indexAxis\n ]) === \"y\") return;\n if (!meta.controller.supportsDecimation) return;\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== \"linear\" && xAxis.type !== \"time\") return;\n if (chart.options.parsing) return;\n let { start: start, count: count } = $dfc006ada1995968$var$getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n $dfc006ada1995968$var$cleanDecimatedDataset(dataset);\n return;\n }\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(_data)) {\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, \"data\", {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n let decimated;\n switch(options.algorithm){\n case \"lttb\":\n decimated = $dfc006ada1995968$var$lttbDecimation(data, start, count, availableWidth, options);\n break;\n case \"min-max\":\n decimated = $dfc006ada1995968$var$minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n dataset._decimated = decimated;\n });\n },\n destroy (chart) {\n $dfc006ada1995968$var$cleanDecimatedData(chart);\n }\n};\nfunction $dfc006ada1995968$var$_segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n for (const segment of segments){\n let { start: start, end: end } = segment;\n end = $dfc006ada1995968$var$_findSegmentEnd(start, end, points);\n const bounds = $dfc006ada1995968$var$_getBounds(property, points[start], points[end], segment.loop);\n if (!target.segments) {\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n const targetSegments = (0, $c4d1694fa24f1a71$export$306ddfe3a8403e2)(target, bounds);\n for (const tgt of targetSegments){\n const subBounds = $dfc006ada1995968$var$_getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = (0, $c4d1694fa24f1a71$export$9fa96a7d116ea3ce)(segment, points, subBounds);\n for (const fillSource of fillSources)parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: $dfc006ada1995968$var$_getEdge(bounds, subBounds, \"start\", Math.max)\n },\n end: {\n [property]: $dfc006ada1995968$var$_getEdge(bounds, subBounds, \"end\", Math.min)\n }\n });\n }\n }\n return parts;\n}\nfunction $dfc006ada1995968$var$_getBounds(property, first, last, loop) {\n if (loop) return;\n let start = first[property];\n let end = last[property];\n if (property === \"angle\") {\n start = (0, $c4d1694fa24f1a71$export$28f7fcd39efa255)(start);\n end = (0, $c4d1694fa24f1a71$export$28f7fcd39efa255)(end);\n }\n return {\n property: property,\n start: start,\n end: end\n };\n}\nfunction $dfc006ada1995968$var$_pointsFromSegments(boundary, line) {\n const { x: x = null, y: y = null } = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({ start: start, end: end })=>{\n end = $dfc006ada1995968$var$_findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({\n x: first.x,\n y: y\n });\n points.push({\n x: last.x,\n y: y\n });\n } else if (x !== null) {\n points.push({\n x: x,\n y: first.y\n });\n points.push({\n x: x,\n y: last.y\n });\n }\n });\n return points;\n}\nfunction $dfc006ada1995968$var$_findSegmentEnd(start, end, points) {\n for(; end > start; end--){\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) break;\n }\n return end;\n}\nfunction $dfc006ada1995968$var$_getEdge(a, b, prop, fn) {\n if (a && b) return fn(a[prop], b[prop]);\n return a ? a[prop] : b ? b[prop] : 0;\n}\nfunction $dfc006ada1995968$var$_createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n if ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(boundary)) {\n _loop = true;\n points = boundary;\n } else points = $dfc006ada1995968$var$_pointsFromSegments(boundary, line);\n return points.length ? new $dfc006ada1995968$export$55e463fa7bcd3469({\n points: points,\n options: {\n tension: 0\n },\n _loop: _loop,\n _fullLoop: _loop\n }) : null;\n}\nfunction $dfc006ada1995968$var$_shouldApplyFill(source) {\n return source && source.fill !== false;\n}\nfunction $dfc006ada1995968$var$_resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [\n index\n ];\n let target;\n if (!propagate) return fill;\n while(fill !== false && visited.indexOf(fill) === -1){\n if (!(0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(fill)) return fill;\n target = sources[fill];\n if (!target) return false;\n if (target.visible) return fill;\n visited.push(fill);\n fill = target.fill;\n }\n return false;\n}\nfunction $dfc006ada1995968$var$_decodeFill(line, index, count) {\n const fill = $dfc006ada1995968$var$parseFillOption(line);\n if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(fill)) return isNaN(fill.value) ? false : fill;\n let target = parseFloat(fill);\n if ((0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(target) && Math.floor(target) === target) return $dfc006ada1995968$var$decodeTargetIndex(fill[0], index, target, count);\n return [\n \"origin\",\n \"start\",\n \"end\",\n \"stack\",\n \"shape\"\n ].indexOf(fill) >= 0 && fill;\n}\nfunction $dfc006ada1995968$var$decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === \"-\" || firstCh === \"+\") target = index + target;\n if (target === index || target < 0 || target >= count) return false;\n return target;\n}\nfunction $dfc006ada1995968$var$_getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === \"start\") pixel = scale.bottom;\n else if (fill === \"end\") pixel = scale.top;\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(fill)) pixel = scale.getPixelForValue(fill.value);\n else if (scale.getBasePixel) pixel = scale.getBasePixel();\n return pixel;\n}\nfunction $dfc006ada1995968$var$_getTargetValue(fill, scale, startValue) {\n let value;\n if (fill === \"start\") value = startValue;\n else if (fill === \"end\") value = scale.options.reverse ? scale.min : scale.max;\n else if ((0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(fill)) value = fill.value;\n else value = scale.getBaseValue();\n return value;\n}\nfunction $dfc006ada1995968$var$parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(fillOption && fillOption.target, fillOption);\n if (fill === undefined) fill = !!options.backgroundColor;\n if (fill === false || fill === null) return false;\n if (fill === true) return \"origin\";\n return fill;\n}\nfunction $dfc006ada1995968$var$_buildStackLine(source) {\n const { scale: scale, index: index, line: line } = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = $dfc006ada1995968$var$getLinesBelow(scale, index);\n linesBelow.push($dfc006ada1995968$var$_createBoundaryLine({\n x: null,\n y: scale.bottom\n }, line));\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n for(let j = segment.start; j <= segment.end; j++)$dfc006ada1995968$var$addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n return new $dfc006ada1995968$export$55e463fa7bcd3469({\n points: points,\n options: {}\n });\n}\nfunction $dfc006ada1995968$var$getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas(\"line\");\n for(let i = 0; i < metas.length; i++){\n const meta = metas[i];\n if (meta.index === index) break;\n if (!meta.hidden) below.unshift(meta.dataset);\n }\n return below;\n}\nfunction $dfc006ada1995968$var$addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for(let j = 0; j < linesBelow.length; j++){\n const line = linesBelow[j];\n const { first: first, last: last, point: point } = $dfc006ada1995968$var$findPoint(line, sourcePoint, \"x\");\n if (!point || first && last) continue;\n if (first) postponed.unshift(point);\n else {\n points.push(point);\n if (!last) break;\n }\n }\n points.push(...postponed);\n}\nfunction $dfc006ada1995968$var$findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) return {};\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if ((0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {\n first: first,\n last: last,\n point: point\n };\n}\nclass $dfc006ada1995968$var$simpleArc {\n pathSegment(ctx, bounds, opts) {\n const { x: x, y: y, radius: radius } = this;\n bounds = bounds || {\n start: 0,\n end: (0, $c4d1694fa24f1a71$export$971d5caa766a69d7)\n };\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n interpolate(point) {\n const { x: x, y: y, radius: radius } = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle: angle\n };\n }\n constructor(opts){\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n}\nfunction $dfc006ada1995968$var$_getTarget(source) {\n const { chart: chart, fill: fill, line: line } = source;\n if ((0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(fill)) return $dfc006ada1995968$var$getLineByIndex(chart, fill);\n if (fill === \"stack\") return $dfc006ada1995968$var$_buildStackLine(source);\n if (fill === \"shape\") return true;\n const boundary = $dfc006ada1995968$var$computeBoundary(source);\n if (boundary instanceof $dfc006ada1995968$var$simpleArc) return boundary;\n return $dfc006ada1995968$var$_createBoundaryLine(boundary, line);\n}\nfunction $dfc006ada1995968$var$getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\nfunction $dfc006ada1995968$var$computeBoundary(source) {\n const scale = source.scale || {};\n if (scale.getPointPositionForValue) return $dfc006ada1995968$var$computeCircularBoundary(source);\n return $dfc006ada1995968$var$computeLinearBoundary(source);\n}\nfunction $dfc006ada1995968$var$computeLinearBoundary(source) {\n const { scale: scale = {}, fill: fill } = source;\n const pixel = $dfc006ada1995968$var$_getTargetPixel(fill, scale);\n if ((0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(pixel)) {\n const horizontal = scale.isHorizontal();\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n return null;\n}\nfunction $dfc006ada1995968$var$computeCircularBoundary(source) {\n const { scale: scale, fill: fill } = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = $dfc006ada1995968$var$_getTargetValue(fill, scale, start);\n const target = [];\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new $dfc006ada1995968$var$simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n for(let i = 0; i < length; ++i)target.push(scale.getPointPositionForValue(i, value));\n return target;\n}\nfunction $dfc006ada1995968$var$_drawfill(ctx, source, area) {\n const target = $dfc006ada1995968$var$_getTarget(source);\n const { line: line, scale: scale, axis: axis } = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const { above: above = color, below: below = color } = fillOption || {};\n if (target && line.points.length) {\n (0, $c4d1694fa24f1a71$export$8743009a87fcb00f)(ctx, area);\n $dfc006ada1995968$var$doFill(ctx, {\n line: line,\n target: target,\n above: above,\n below: below,\n area: area,\n scale: scale,\n axis: axis\n });\n (0, $c4d1694fa24f1a71$export$3d8c2f653ac9d0b9)(ctx);\n }\n}\nfunction $dfc006ada1995968$var$doFill(ctx, cfg) {\n const { line: line, target: target, above: above, below: below, area: area, scale: scale } = cfg;\n const property = line._loop ? \"angle\" : cfg.axis;\n ctx.save();\n if (property === \"x\" && below !== above) {\n $dfc006ada1995968$var$clipVertical(ctx, target, area.top);\n $dfc006ada1995968$var$fill(ctx, {\n line: line,\n target: target,\n color: above,\n scale: scale,\n property: property\n });\n ctx.restore();\n ctx.save();\n $dfc006ada1995968$var$clipVertical(ctx, target, area.bottom);\n }\n $dfc006ada1995968$var$fill(ctx, {\n line: line,\n target: target,\n color: below,\n scale: scale,\n property: property\n });\n ctx.restore();\n}\nfunction $dfc006ada1995968$var$clipVertical(ctx, target, clipY) {\n const { segments: segments, points: points } = target;\n let first = true;\n let lineLoop = false;\n ctx.beginPath();\n for (const segment of segments){\n const { start: start, end: end } = segment;\n const firstPoint = points[start];\n const lastPoint = points[$dfc006ada1995968$var$_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {\n move: lineLoop\n });\n if (lineLoop) ctx.closePath();\n else ctx.lineTo(lastPoint.x, clipY);\n }\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\nfunction $dfc006ada1995968$var$fill(ctx, cfg) {\n const { line: line, target: target, property: property, color: color, scale: scale } = cfg;\n const segments = $dfc006ada1995968$var$_segments(line, target, property);\n for (const { source: src, target: tgt, start: start, end: end } of segments){\n const { style: { backgroundColor: backgroundColor = color } = {} } = src;\n const notShape = target !== true;\n ctx.save();\n ctx.fillStyle = backgroundColor;\n $dfc006ada1995968$var$clipBounds(ctx, scale, notShape && $dfc006ada1995968$var$_getBounds(property, start, end));\n ctx.beginPath();\n const lineLoop = !!line.pathSegment(ctx, src);\n let loop;\n if (notShape) {\n if (lineLoop) ctx.closePath();\n else $dfc006ada1995968$var$interpolatedLineTo(ctx, target, end, property);\n const targetLoop = !!target.pathSegment(ctx, tgt, {\n move: lineLoop,\n reverse: true\n });\n loop = lineLoop && targetLoop;\n if (!loop) $dfc006ada1995968$var$interpolatedLineTo(ctx, target, start, property);\n }\n ctx.closePath();\n ctx.fill(loop ? \"evenodd\" : \"nonzero\");\n ctx.restore();\n }\n}\nfunction $dfc006ada1995968$var$clipBounds(ctx, scale, bounds) {\n const { top: top, bottom: bottom } = scale.chart.chartArea;\n const { property: property, start: start, end: end } = bounds || {};\n if (property === \"x\") {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\nfunction $dfc006ada1995968$var$interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n}\nvar $dfc006ada1995968$export$d19ba4d812bed757 = {\n id: \"filler\",\n afterDatasetsUpdate (chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n for(i = 0; i < count; ++i){\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n if (line && line.options && line instanceof $dfc006ada1995968$export$55e463fa7bcd3469) source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: $dfc006ada1995968$var$_decodeFill(line, i, count),\n chart: chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line: line\n };\n meta.$filler = source;\n sources.push(source);\n }\n for(i = 0; i < count; ++i){\n source = sources[i];\n if (!source || source.fill === false) continue;\n source.fill = $dfc006ada1995968$var$_resolveTarget(sources, i, options.propagate);\n }\n },\n beforeDraw (chart, _args, options) {\n const draw = options.drawTime === \"beforeDraw\";\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (!source) continue;\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) $dfc006ada1995968$var$_drawfill(chart.ctx, source, area);\n }\n },\n beforeDatasetsDraw (chart, _args, options) {\n if (options.drawTime !== \"beforeDatasetsDraw\") return;\n const metasets = chart.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if ($dfc006ada1995968$var$_shouldApplyFill(source)) $dfc006ada1995968$var$_drawfill(chart.ctx, source, chart.chartArea);\n }\n },\n beforeDatasetDraw (chart, args, options) {\n const source = args.meta.$filler;\n if (!$dfc006ada1995968$var$_shouldApplyFill(source) || options.drawTime !== \"beforeDatasetDraw\") return;\n $dfc006ada1995968$var$_drawfill(chart.ctx, source, chart.chartArea);\n },\n defaults: {\n propagate: true,\n drawTime: \"beforeDatasetDraw\"\n }\n};\nconst $dfc006ada1995968$var$getBoxSize = (labelOpts, fontSize)=>{\n let { boxHeight: boxHeight = fontSize, boxWidth: boxWidth = fontSize } = labelOpts;\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n return {\n boxWidth: boxWidth,\n boxHeight: boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\nconst $dfc006ada1995968$var$itemsEqual = (a, b)=>a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass $dfc006ada1995968$var$Legend extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(labelOpts.generateLabels, [\n this.chart\n ], this) || [];\n if (labelOpts.filter) legendItems = legendItems.filter((item)=>labelOpts.filter(item, this.chart.data));\n if (labelOpts.sort) legendItems = legendItems.sort((a, b)=>labelOpts.sort(a, b, this.chart.data));\n if (this.options.reverse) legendItems.reverse();\n this.legendItems = legendItems;\n }\n fit() {\n const { options: options, ctx: ctx } = this;\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n const labelOpts = options.labels;\n const labelFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const { boxWidth: boxWidth, itemHeight: itemHeight } = $dfc006ada1995968$var$getBoxSize(labelOpts, fontSize);\n let width, height;\n ctx.font = labelFont.string;\n if (this.isHorizontal()) {\n width = this.maxWidth;\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight;\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const { ctx: ctx, maxWidth: maxWidth, options: { labels: { padding: padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const lineWidths = this.lineWidths = [\n 0\n ];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i)=>{\n const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n hitboxes[i] = {\n left: 0,\n top: top,\n row: row,\n width: itemWidth,\n height: itemHeight\n };\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n return totalHeight;\n }\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const { ctx: ctx, maxHeight: maxHeight, options: { labels: { padding: padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n let left = 0;\n let col = 0;\n this.legendItems.forEach((legendItem, i)=>{\n const { itemWidth: itemWidth, itemHeight: itemHeight } = $dfc006ada1995968$var$calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n hitboxes[i] = {\n left: left,\n top: currentColHeight,\n col: col,\n width: itemWidth,\n height: itemHeight\n };\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n totalWidth += currentColWidth;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n return totalWidth;\n }\n adjustHitBoxes() {\n if (!this.options.display) return;\n const titleHeight = this._computeTitleHeight();\n const { legendHitBoxes: hitboxes, options: { align: align, labels: { padding: padding }, rtl: rtl } } = this;\n const rtlHelper = (0, $c4d1694fa24f1a71$export$3d12bd131bb975d1)(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes){\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes){\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n isHorizontal() {\n return this.options.position === \"top\" || this.options.position === \"bottom\";\n }\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n (0, $c4d1694fa24f1a71$export$8743009a87fcb00f)(ctx, this);\n this._draw();\n (0, $c4d1694fa24f1a71$export$3d8c2f653ac9d0b9)(ctx);\n }\n }\n _draw() {\n const { options: opts, columnSizes: columnSizes, lineWidths: lineWidths, ctx: ctx } = this;\n const { align: align, labels: labelOpts } = opts;\n const defaultColor = (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).color;\n const rtlHelper = (0, $c4d1694fa24f1a71$export$3d12bd131bb975d1)(opts.rtl, this.left, this.width);\n const labelFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(labelOpts.font);\n const { padding: padding } = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n this.drawTitle();\n ctx.textAlign = rtlHelper.textAlign(\"left\");\n ctx.textBaseline = \"middle\";\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n const { boxWidth: boxWidth, boxHeight: boxHeight, itemHeight: itemHeight } = $dfc006ada1995968$var$getBoxSize(labelOpts, fontSize);\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) return;\n ctx.save();\n const lineWidth = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.lineWidth, 1);\n ctx.fillStyle = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.fillStyle, defaultColor);\n ctx.lineCap = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.lineCap, \"butt\");\n ctx.lineDashOffset = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.lineDashOffset, 0);\n ctx.lineJoin = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.lineJoin, \"miter\");\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.strokeStyle, defaultColor);\n ctx.setLineDash((0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(legendItem.lineDash, []));\n if (labelOpts.usePointStyle) {\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n (0, $c4d1694fa24f1a71$export$24baa2b76016ce0e)(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(legendItem.borderRadius);\n ctx.beginPath();\n if (Object.values(borderRadius).some((v)=>v !== 0)) (0, $c4d1694fa24f1a71$export$1fbe638ecf81657e)(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n else ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n ctx.fill();\n if (lineWidth !== 0) ctx.stroke();\n }\n ctx.restore();\n };\n const fillText = function(x, y, legendItem) {\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) cursor = {\n x: (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n else cursor = {\n x: this.left + padding,\n y: (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n (0, $c4d1694fa24f1a71$export$91c6e00c14e7e6fd)(this.ctx, opts.textDirection);\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i)=>{\n ctx.strokeStyle = legendItem.fontColor;\n ctx.fillStyle = legendItem.fontColor;\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n rtlHelper.setWidth(this.width);\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n const realX = rtlHelper.x(x);\n drawLegendBox(realX, y, legendItem);\n x = (0, $c4d1694fa24f1a71$export$9d398bebfec1c039)(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n fillText(rtlHelper.x(x), y, legendItem);\n if (isHorizontal) cursor.x += width + padding;\n else if (typeof legendItem.text !== \"string\") {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += $dfc006ada1995968$var$calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else cursor.y += lineHeight;\n });\n (0, $c4d1694fa24f1a71$export$890c4ad488842ce7)(this.ctx, opts.textDirection);\n }\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(titleOpts.font);\n const titlePadding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(titleOpts.padding);\n if (!titleOpts.display) return;\n const rtlHelper = (0, $c4d1694fa24f1a71$export$3d12bd131bb975d1)(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n let left = this.left;\n let maxWidth = this.width;\n if (this.isHorizontal()) {\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(opts.align, left, this.right - maxWidth);\n } else {\n const maxHeight = this.columnSizes.reduce((acc, size)=>Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n const x = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(position, left, left + maxWidth);\n ctx.textAlign = rtlHelper.textAlign((0, $c4d1694fa24f1a71$export$3c2fa207a37baaea)(position));\n ctx.textBaseline = \"middle\";\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, titleOpts.text, x, y, titleFont);\n }\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(titleOpts.font);\n const titlePadding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n if ((0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(x, this.left, this.right) && (0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(y, this.top, this.bottom)) {\n lh = this.legendHitBoxes;\n for(i = 0; i < lh.length; ++i){\n hitBox = lh[i];\n if ((0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(x, hitBox.left, hitBox.left + hitBox.width) && (0, $c4d1694fa24f1a71$export$3b513254972cfc9c)(y, hitBox.top, hitBox.top + hitBox.height)) return this.legendItems[i];\n }\n }\n return null;\n }\n handleEvent(e) {\n const opts = this.options;\n if (!$dfc006ada1995968$var$isListened(e.type, opts)) return;\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n if (e.type === \"mousemove\" || e.type === \"mouseout\") {\n const previous = this._hoveredItem;\n const sameItem = $dfc006ada1995968$var$itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(opts.onLeave, [\n e,\n previous,\n this\n ], this);\n this._hoveredItem = hoveredItem;\n if (hoveredItem && !sameItem) (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(opts.onHover, [\n e,\n hoveredItem,\n this\n ], this);\n } else if (hoveredItem) (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(opts.onClick, [\n e,\n hoveredItem,\n this\n ], this);\n }\n constructor(config){\n super();\n this._added = false;\n this.legendHitBoxes = [];\n this._hoveredItem = null;\n this.doughnutMode = false;\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n}\nfunction $dfc006ada1995968$var$calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = $dfc006ada1995968$var$calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = $dfc006ada1995968$var$calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {\n itemWidth: itemWidth,\n itemHeight: itemHeight\n };\n}\nfunction $dfc006ada1995968$var$calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== \"string\") legendItemText = legendItemText.reduce((a, b)=>a.length > b.length ? a : b);\n return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width;\n}\nfunction $dfc006ada1995968$var$calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== \"string\") itemHeight = $dfc006ada1995968$var$calculateLegendItemHeight(legendItem, fontLineHeight);\n return itemHeight;\n}\nfunction $dfc006ada1995968$var$calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\nfunction $dfc006ada1995968$var$isListened(type, opts) {\n if ((type === \"mousemove\" || type === \"mouseout\") && (opts.onHover || opts.onLeave)) return true;\n if (opts.onClick && (type === \"click\" || type === \"mouseup\")) return true;\n return false;\n}\nvar $dfc006ada1995968$export$ed247974535929c7 = {\n id: \"legend\",\n _element: $dfc006ada1995968$var$Legend,\n start (chart, _args, options) {\n const legend = chart.legend = new $dfc006ada1995968$var$Legend({\n ctx: chart.ctx,\n options: options,\n chart: chart\n });\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(chart, legend, options);\n $dfc006ada1995968$export$1ecca0613f5e56d2.addBox(chart, legend);\n },\n stop (chart) {\n $dfc006ada1995968$export$1ecca0613f5e56d2.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n beforeUpdate (chart, _args, options) {\n const legend = chart.legend;\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(chart, legend, options);\n legend.options = options;\n },\n afterUpdate (chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n afterEvent (chart, args) {\n if (!args.replay) chart.legend.handleEvent(args.event);\n },\n defaults: {\n display: true,\n position: \"top\",\n align: \"center\",\n fullSize: true,\n reverse: false,\n weight: 1000,\n onClick (e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n onHover: null,\n onLeave: null,\n labels: {\n color: (ctx)=>ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n generateLabels (chart) {\n const datasets = chart.data.datasets;\n const { labels: { usePointStyle: usePointStyle, pointStyle: pointStyle, textAlign: textAlign, color: color, useBorderRadius: useBorderRadius, borderRadius: borderRadius } } = chart.legend.options;\n return chart._getSortedDatasetMetas().map((meta)=>{\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(style.borderWidth);\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n title: {\n color: (ctx)=>ctx.chart.options.color,\n display: false,\n position: \"center\",\n text: \"\"\n }\n },\n descriptors: {\n _scriptable: (name)=>!name.startsWith(\"on\"),\n labels: {\n _scriptable: (name)=>![\n \"generateLabels\",\n \"filter\",\n \"sort\"\n ].includes(name)\n }\n }\n};\nclass $dfc006ada1995968$var$Title extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n update(maxWidth, maxHeight) {\n const opts = this.options;\n this.left = 0;\n this.top = 0;\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n const lineCount = (0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(opts.text) ? opts.text.length : 1;\n this._padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(opts.padding);\n const textSize = lineCount * (0, $c4d1694fa24f1a71$export$34aec0b863436764)(opts.font).lineHeight + this._padding.height;\n if (this.isHorizontal()) this.height = textSize;\n else this.width = textSize;\n }\n isHorizontal() {\n const pos = this.options.position;\n return pos === \"top\" || pos === \"bottom\";\n }\n _drawArgs(offset) {\n const { top: top, left: left, bottom: bottom, right: right, options: options } = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n if (this.isHorizontal()) {\n titleX = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === \"left\") {\n titleX = left + offset;\n titleY = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, bottom, top);\n rotation = (0, $c4d1694fa24f1a71$export$56c0d5a1e737357d) * -0.5;\n } else {\n titleX = right - offset;\n titleY = (0, $c4d1694fa24f1a71$export$ce26c07117d59d6a)(align, top, bottom);\n rotation = (0, $c4d1694fa24f1a71$export$56c0d5a1e737357d) * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {\n titleX: titleX,\n titleY: titleY,\n maxWidth: maxWidth,\n rotation: rotation\n };\n }\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n if (!opts.display) return;\n const fontOpts = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const { titleX: titleX, titleY: titleY, maxWidth: maxWidth, rotation: rotation } = this._drawArgs(offset);\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth: maxWidth,\n rotation: rotation,\n textAlign: (0, $c4d1694fa24f1a71$export$3c2fa207a37baaea)(opts.align),\n textBaseline: \"middle\",\n translation: [\n titleX,\n titleY\n ]\n });\n }\n constructor(config){\n super();\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n}\nfunction $dfc006ada1995968$var$createTitle(chart, titleOpts) {\n const title = new $dfc006ada1995968$var$Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart: chart\n });\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(chart, title, titleOpts);\n $dfc006ada1995968$export$1ecca0613f5e56d2.addBox(chart, title);\n chart.titleBlock = title;\n}\nvar $dfc006ada1995968$export$f99233281efd08a0 = {\n id: \"title\",\n _element: $dfc006ada1995968$var$Title,\n start (chart, _args, options) {\n $dfc006ada1995968$var$createTitle(chart, options);\n },\n stop (chart) {\n const titleBlock = chart.titleBlock;\n $dfc006ada1995968$export$1ecca0613f5e56d2.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n beforeUpdate (chart, _args, options) {\n const title = chart.titleBlock;\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: \"center\",\n display: false,\n font: {\n weight: \"bold\"\n },\n fullSize: true,\n padding: 10,\n position: \"top\",\n text: \"\",\n weight: 2000\n },\n defaultRoutes: {\n color: \"color\"\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\nconst $dfc006ada1995968$var$map = new WeakMap();\nvar $dfc006ada1995968$export$d5c56664638992a4 = {\n id: \"subtitle\",\n start (chart, _args, options) {\n const title = new $dfc006ada1995968$var$Title({\n ctx: chart.ctx,\n options: options,\n chart: chart\n });\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(chart, title, options);\n $dfc006ada1995968$export$1ecca0613f5e56d2.addBox(chart, title);\n $dfc006ada1995968$var$map.set(chart, title);\n },\n stop (chart) {\n $dfc006ada1995968$export$1ecca0613f5e56d2.removeBox(chart, $dfc006ada1995968$var$map.get(chart));\n $dfc006ada1995968$var$map.delete(chart);\n },\n beforeUpdate (chart, _args, options) {\n const title = $dfc006ada1995968$var$map.get(chart);\n $dfc006ada1995968$export$1ecca0613f5e56d2.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: \"center\",\n display: false,\n font: {\n weight: \"normal\"\n },\n fullSize: true,\n padding: 0,\n position: \"top\",\n text: \"\",\n weight: 1500\n },\n defaultRoutes: {\n color: \"color\"\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\nconst $dfc006ada1995968$var$positioners = {\n average (items) {\n if (!items.length) return false;\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n return {\n x: x / count,\n y: y / count\n };\n },\n nearest (items, eventPosition) {\n if (!items.length) return false;\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = (0, $c4d1694fa24f1a71$export$158acd800e1ef08b)(eventPosition, center);\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n return {\n x: x,\n y: y\n };\n }\n};\nfunction $dfc006ada1995968$var$pushOrConcat(base, toPush) {\n if (toPush) {\n if ((0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(toPush)) Array.prototype.push.apply(base, toPush);\n else base.push(toPush);\n }\n return base;\n}\nfunction $dfc006ada1995968$var$splitNewlines(str) {\n if ((typeof str === \"string\" || str instanceof String) && str.indexOf(\"\\n\") > -1) return str.split(\"\\n\");\n return str;\n}\nfunction $dfc006ada1995968$var$createTooltipItem(chart, item) {\n const { element: element, datasetIndex: datasetIndex, index: index } = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const { label: label, value: value } = controller.getLabelAndValue(index);\n return {\n chart: chart,\n label: label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex: datasetIndex,\n element: element\n };\n}\nfunction $dfc006ada1995968$var$getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const { body: body, footer: footer, title: title } = tooltip;\n const { boxWidth: boxWidth, boxHeight: boxHeight } = options;\n const bodyFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.bodyFont);\n const titleFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.titleFont);\n const footerFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(options.padding);\n let height = padding.height;\n let width = 0;\n let combinedBodyLength = body.reduce((count, bodyItem)=>count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n if (titleLineCount) height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;\n if (combinedBodyLength) {\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n ctx.save();\n ctx.font = titleFont.string;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(tooltip.title, maxLineWidth);\n ctx.font = bodyFont.string;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(body, (bodyItem)=>{\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(bodyItem.before, maxLineWidth);\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(bodyItem.lines, maxLineWidth);\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(bodyItem.after, maxLineWidth);\n });\n widthPadding = 0;\n ctx.font = footerFont.string;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(tooltip.footer, maxLineWidth);\n ctx.restore();\n width += padding.width;\n return {\n width: width,\n height: height\n };\n}\nfunction $dfc006ada1995968$var$determineYAlign(chart, size) {\n const { y: y, height: height } = size;\n if (y < height / 2) return \"top\";\n else if (y > chart.height - height / 2) return \"bottom\";\n return \"center\";\n}\nfunction $dfc006ada1995968$var$doesNotFitWithAlign(xAlign, chart, options, size) {\n const { x: x, width: width } = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === \"left\" && x + width + caret > chart.width) return true;\n if (xAlign === \"right\" && x - width - caret < 0) return true;\n}\nfunction $dfc006ada1995968$var$determineXAlign(chart, options, size, yAlign) {\n const { x: x, width: width } = size;\n const { width: chartWidth, chartArea: { left: left, right: right } } = chart;\n let xAlign = \"center\";\n if (yAlign === \"center\") xAlign = x <= (left + right) / 2 ? \"left\" : \"right\";\n else if (x <= width / 2) xAlign = \"left\";\n else if (x >= chartWidth - width / 2) xAlign = \"right\";\n if ($dfc006ada1995968$var$doesNotFitWithAlign(xAlign, chart, options, size)) xAlign = \"center\";\n return xAlign;\n}\nfunction $dfc006ada1995968$var$determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || $dfc006ada1995968$var$determineYAlign(chart, size);\n return {\n xAlign: size.xAlign || options.xAlign || $dfc006ada1995968$var$determineXAlign(chart, options, size, yAlign),\n yAlign: yAlign\n };\n}\nfunction $dfc006ada1995968$var$alignX(size, xAlign) {\n let { x: x, width: width } = size;\n if (xAlign === \"right\") x -= width;\n else if (xAlign === \"center\") x -= width / 2;\n return x;\n}\nfunction $dfc006ada1995968$var$alignY(size, yAlign, paddingAndSize) {\n let { y: y, height: height } = size;\n if (yAlign === \"top\") y += paddingAndSize;\n else if (yAlign === \"bottom\") y -= height + paddingAndSize;\n else y -= height / 2;\n return y;\n}\nfunction $dfc006ada1995968$var$getBackgroundPoint(options, size, alignment, chart) {\n const { caretSize: caretSize, caretPadding: caretPadding, cornerRadius: cornerRadius } = options;\n const { xAlign: xAlign, yAlign: yAlign } = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const { topLeft: topLeft, topRight: topRight, bottomLeft: bottomLeft, bottomRight: bottomRight } = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(cornerRadius);\n let x = $dfc006ada1995968$var$alignX(size, xAlign);\n const y = $dfc006ada1995968$var$alignY(size, yAlign, paddingAndSize);\n if (yAlign === \"center\") {\n if (xAlign === \"left\") x += paddingAndSize;\n else if (xAlign === \"right\") x -= paddingAndSize;\n } else if (xAlign === \"left\") x -= Math.max(topLeft, bottomLeft) + caretSize;\n else if (xAlign === \"right\") x += Math.max(topRight, bottomRight) + caretSize;\n return {\n x: (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(x, 0, chart.width - size.width),\n y: (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(y, 0, chart.height - size.height)\n };\n}\nfunction $dfc006ada1995968$var$getAlignedX(tooltip, align, options) {\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(options.padding);\n return align === \"center\" ? tooltip.x + tooltip.width / 2 : align === \"right\" ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;\n}\nfunction $dfc006ada1995968$var$getBeforeAfterBodyLines(callback) {\n return $dfc006ada1995968$var$pushOrConcat([], $dfc006ada1995968$var$splitNewlines(callback));\n}\nfunction $dfc006ada1995968$var$createTooltipContext(parent, tooltip, tooltipItems) {\n return (0, $c4d1694fa24f1a71$export$35e795649ee09318)(parent, {\n tooltip: tooltip,\n tooltipItems: tooltipItems,\n type: \"tooltip\"\n });\n}\nfunction $dfc006ada1995968$var$overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\nconst $dfc006ada1995968$var$defaultCallbacks = {\n beforeTitle: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n title (tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n if (this && this.options && this.options.mode === \"dataset\") return item.dataset.label || \"\";\n else if (item.label) return item.label;\n else if (labelCount > 0 && item.dataIndex < labelCount) return labels[item.dataIndex];\n }\n return \"\";\n },\n afterTitle: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n beforeBody: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n beforeLabel: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n label (tooltipItem) {\n if (this && this.options && this.options.mode === \"dataset\") return tooltipItem.label + \": \" + tooltipItem.formattedValue || tooltipItem.formattedValue;\n let label = tooltipItem.dataset.label || \"\";\n if (label) label += \": \";\n const value = tooltipItem.formattedValue;\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(value)) label += value;\n return label;\n },\n labelColor (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0\n };\n },\n labelTextColor () {\n return this.options.bodyColor;\n },\n labelPointStyle (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation\n };\n },\n afterLabel: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n afterBody: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n beforeFooter: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n footer: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46),\n afterFooter: (0, $c4d1694fa24f1a71$export$cf2f7c5792f80b46)\n};\nfunction $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n if (typeof result === \"undefined\") return $dfc006ada1995968$var$defaultCallbacks[name].call(ctx, arg);\n return result;\n}\nclass $dfc006ada1995968$var$Tooltip extends $dfc006ada1995968$export$db77ccec0bb4ccac {\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n if (cached) return cached;\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new $dfc006ada1995968$export$8ab227dac26677d(this.chart, opts);\n if (opts._cacheable) this._cachedAnimations = Object.freeze(animations);\n return animations;\n }\n getContext() {\n return this.$context || (this.$context = $dfc006ada1995968$var$createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n getTitle(context, options) {\n const { callbacks: callbacks } = options;\n const beforeTitle = $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, \"beforeTitle\", this, context);\n const title = $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, \"title\", this, context);\n const afterTitle = $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, \"afterTitle\", this, context);\n let lines = [];\n lines = $dfc006ada1995968$var$pushOrConcat(lines, $dfc006ada1995968$var$splitNewlines(beforeTitle));\n lines = $dfc006ada1995968$var$pushOrConcat(lines, $dfc006ada1995968$var$splitNewlines(title));\n lines = $dfc006ada1995968$var$pushOrConcat(lines, $dfc006ada1995968$var$splitNewlines(afterTitle));\n return lines;\n }\n getBeforeBody(tooltipItems, options) {\n return $dfc006ada1995968$var$getBeforeAfterBodyLines($dfc006ada1995968$var$invokeCallbackWithFallback(options.callbacks, \"beforeBody\", this, tooltipItems));\n }\n getBody(tooltipItems, options) {\n const { callbacks: callbacks } = options;\n const bodyItems = [];\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(tooltipItems, (context)=>{\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = $dfc006ada1995968$var$overrideCallbacks(callbacks, context);\n $dfc006ada1995968$var$pushOrConcat(bodyItem.before, $dfc006ada1995968$var$splitNewlines($dfc006ada1995968$var$invokeCallbackWithFallback(scoped, \"beforeLabel\", this, context)));\n $dfc006ada1995968$var$pushOrConcat(bodyItem.lines, $dfc006ada1995968$var$invokeCallbackWithFallback(scoped, \"label\", this, context));\n $dfc006ada1995968$var$pushOrConcat(bodyItem.after, $dfc006ada1995968$var$splitNewlines($dfc006ada1995968$var$invokeCallbackWithFallback(scoped, \"afterLabel\", this, context)));\n bodyItems.push(bodyItem);\n });\n return bodyItems;\n }\n getAfterBody(tooltipItems, options) {\n return $dfc006ada1995968$var$getBeforeAfterBodyLines($dfc006ada1995968$var$invokeCallbackWithFallback(options.callbacks, \"afterBody\", this, tooltipItems));\n }\n getFooter(tooltipItems, options) {\n const { callbacks: callbacks } = options;\n const beforeFooter = $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, \"beforeFooter\", this, tooltipItems);\n const footer = $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, \"footer\", this, tooltipItems);\n const afterFooter = $dfc006ada1995968$var$invokeCallbackWithFallback(callbacks, \"afterFooter\", this, tooltipItems);\n let lines = [];\n lines = $dfc006ada1995968$var$pushOrConcat(lines, $dfc006ada1995968$var$splitNewlines(beforeFooter));\n lines = $dfc006ada1995968$var$pushOrConcat(lines, $dfc006ada1995968$var$splitNewlines(footer));\n lines = $dfc006ada1995968$var$pushOrConcat(lines, $dfc006ada1995968$var$splitNewlines(afterFooter));\n return lines;\n }\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n for(i = 0, len = active.length; i < len; ++i)tooltipItems.push($dfc006ada1995968$var$createTooltipItem(this.chart, active[i]));\n if (options.filter) tooltipItems = tooltipItems.filter((element, index, array)=>options.filter(element, index, array, data));\n if (options.itemSort) tooltipItems = tooltipItems.sort((a, b)=>options.itemSort(a, b, data));\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(tooltipItems, (context)=>{\n const scoped = $dfc006ada1995968$var$overrideCallbacks(options.callbacks, context);\n labelColors.push($dfc006ada1995968$var$invokeCallbackWithFallback(scoped, \"labelColor\", this, context));\n labelPointStyles.push($dfc006ada1995968$var$invokeCallbackWithFallback(scoped, \"labelPointStyle\", this, context));\n labelTextColors.push($dfc006ada1995968$var$invokeCallbackWithFallback(scoped, \"labelTextColor\", this, context));\n });\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n if (!active.length) {\n if (this.opacity !== 0) properties = {\n opacity: 0\n };\n } else {\n const position = $dfc006ada1995968$var$positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n const size = this._size = $dfc006ada1995968$var$getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = $dfc006ada1995968$var$determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = $dfc006ada1995968$var$getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n if (properties) this._resolveAnimations().update(this, properties);\n if (changed && options.external) options.external.call(this, {\n chart: this.chart,\n tooltip: this,\n replay: replay\n });\n }\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n getCaretPosition(tooltipPoint, size, options) {\n const { xAlign: xAlign, yAlign: yAlign } = this;\n const { caretSize: caretSize, cornerRadius: cornerRadius } = options;\n const { topLeft: topLeft, topRight: topRight, bottomLeft: bottomLeft, bottomRight: bottomRight } = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(cornerRadius);\n const { x: ptX, y: ptY } = tooltipPoint;\n const { width: width, height: height } = size;\n let x1, x2, x3, y1, y2, y3;\n if (yAlign === \"center\") {\n y2 = ptY + height / 2;\n if (xAlign === \"left\") {\n x1 = ptX;\n x2 = x1 - caretSize;\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n x3 = x1;\n } else {\n if (xAlign === \"left\") x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize;\n else if (xAlign === \"right\") x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n else x2 = this.caretX;\n if (yAlign === \"top\") {\n y1 = ptY;\n y2 = y1 - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {\n x1: x1,\n x2: x2,\n x3: x3,\n y1: y1,\n y2: y2,\n y3: y3\n };\n }\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n if (length) {\n const rtlHelper = (0, $c4d1694fa24f1a71$export$3d12bd131bb975d1)(options.rtl, this.x, this.width);\n pt.x = $dfc006ada1995968$var$getAlignedX(this, options.titleAlign, options);\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = \"middle\";\n titleFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.titleFont);\n titleSpacing = options.titleSpacing;\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing;\n if (i + 1 === length) pt.y += options.titleMarginBottom - titleSpacing;\n }\n }\n }\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const { boxHeight: boxHeight, boxWidth: boxWidth } = options;\n const bodyFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.bodyFont);\n const colorX = $dfc006ada1995968$var$getAlignedX(this, \"left\", options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2,\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n (0, $c4d1694fa24f1a71$export$493d36ec626b6698)(ctx, drawOptions, centerX, centerY);\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n (0, $c4d1694fa24f1a71$export$493d36ec626b6698)(ctx, drawOptions, centerX, centerY);\n } else {\n ctx.lineWidth = (0, $c4d1694fa24f1a71$export$23f2a1d2818174ef)(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1;\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(labelColor.borderRadius);\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n (0, $c4d1694fa24f1a71$export$1fbe638ecf81657e)(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n (0, $c4d1694fa24f1a71$export$1fbe638ecf81657e)(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n ctx.fillStyle = this.labelTextColors[i];\n }\n drawBody(pt, ctx, options) {\n const { body: body } = this;\n const { bodySpacing: bodySpacing, bodyAlign: bodyAlign, displayColors: displayColors, boxHeight: boxHeight, boxWidth: boxWidth, boxPadding: boxPadding } = options;\n const bodyFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n const rtlHelper = (0, $c4d1694fa24f1a71$export$3d12bd131bb975d1)(options.rtl, this.x, this.width);\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = \"middle\";\n ctx.font = bodyFont.string;\n pt.x = $dfc006ada1995968$var$getAlignedX(this, bodyAlignForCalculation, options);\n ctx.fillStyle = options.bodyColor;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this.beforeBody, fillLineOfText);\n xLinePadding = displayColors && bodyAlignForCalculation !== \"right\" ? bodyAlign === \"center\" ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;\n for(i = 0, ilen = body.length; i < ilen; ++i){\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n ctx.fillStyle = textColor;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(bodyItem.before, fillLineOfText);\n lines = bodyItem.lines;\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n for(j = 0, jlen = lines.length; j < jlen; ++j){\n fillLineOfText(lines[j]);\n bodyLineHeight = bodyFont.lineHeight;\n }\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(bodyItem.after, fillLineOfText);\n }\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n (0, $c4d1694fa24f1a71$export$d66501df72047452)(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing;\n }\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n if (length) {\n const rtlHelper = (0, $c4d1694fa24f1a71$export$3d12bd131bb975d1)(options.rtl, this.x, this.width);\n pt.x = $dfc006ada1995968$var$getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = \"middle\";\n footerFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(options.footerFont);\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n drawBackground(pt, ctx, tooltipSize, options) {\n const { xAlign: xAlign, yAlign: yAlign } = this;\n const { x: x, y: y } = pt;\n const { width: width, height: height } = tooltipSize;\n const { topLeft: topLeft, topRight: topRight, bottomLeft: bottomLeft, bottomRight: bottomRight } = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(options.cornerRadius);\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === \"top\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === \"center\" && xAlign === \"right\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === \"bottom\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === \"center\" && xAlign === \"left\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n ctx.fill();\n if (options.borderWidth > 0) ctx.stroke();\n }\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = $dfc006ada1995968$var$positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) return;\n const size = this._size = $dfc006ada1995968$var$getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = $dfc006ada1995968$var$determineAlignment(chart, options, positionAndSize);\n const point = $dfc006ada1995968$var$getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n _willRender() {\n return !!this.opacity;\n }\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n if (!opacity) return;\n this._updateAnimationTarget(options);\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(options.padding);\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n this.drawBackground(pt, ctx, tooltipSize, options);\n (0, $c4d1694fa24f1a71$export$91c6e00c14e7e6fd)(ctx, options.textDirection);\n pt.y += padding.top;\n this.drawTitle(pt, ctx, options);\n this.drawBody(pt, ctx, options);\n this.drawFooter(pt, ctx, options);\n (0, $c4d1694fa24f1a71$export$890c4ad488842ce7)(ctx, options.textDirection);\n ctx.restore();\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({ datasetIndex: datasetIndex, index: index })=>{\n const meta = this.chart.getDatasetMeta(datasetIndex);\n if (!meta) throw new Error(\"Cannot find a dataset at index \" + datasetIndex);\n return {\n datasetIndex: datasetIndex,\n element: meta.data[index],\n index: index\n };\n });\n const changed = !(0, $c4d1694fa24f1a71$export$995eb9fca571757)(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) return false;\n this._ignoreReplayEvents = false;\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n const positionChanged = this._positionChanged(active, e);\n const changed = replay || !(0, $c4d1694fa24f1a71$export$995eb9fca571757)(active, lastActive) || positionChanged;\n if (changed) {\n this._active = active;\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n this.update(true, replay);\n }\n }\n return changed;\n }\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n if (e.type === \"mouseout\") return [];\n if (!inChartArea) return lastActive;\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n if (options.reverse) active.reverse();\n return active;\n }\n _positionChanged(active, e) {\n const { caretX: caretX, caretY: caretY, options: options } = this;\n const position = $dfc006ada1995968$var$positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n constructor(config){\n super();\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$var$Tooltip, \"positioners\", $dfc006ada1995968$var$positioners);\nvar $dfc006ada1995968$export$28c660c63b792dea = {\n id: \"tooltip\",\n _element: $dfc006ada1995968$var$Tooltip,\n positioners: $dfc006ada1995968$var$positioners,\n afterInit (chart, _args, options) {\n if (options) chart.tooltip = new $dfc006ada1995968$var$Tooltip({\n chart: chart,\n options: options\n });\n },\n beforeUpdate (chart, _args, options) {\n if (chart.tooltip) chart.tooltip.initialize(options);\n },\n reset (chart, _args, options) {\n if (chart.tooltip) chart.tooltip.initialize(options);\n },\n afterDraw (chart) {\n const tooltip = chart.tooltip;\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip: tooltip\n };\n if (chart.notifyPlugins(\"beforeTooltipDraw\", {\n ...args,\n cancelable: true\n }) === false) return;\n tooltip.draw(chart.ctx);\n chart.notifyPlugins(\"afterTooltipDraw\", args);\n }\n },\n afterEvent (chart, args) {\n if (chart.tooltip) {\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) args.changed = true;\n }\n },\n defaults: {\n enabled: true,\n external: null,\n position: \"average\",\n backgroundColor: \"rgba(0,0,0,0.8)\",\n titleColor: \"#fff\",\n titleFont: {\n weight: \"bold\"\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: \"left\",\n bodyColor: \"#fff\",\n bodySpacing: 2,\n bodyFont: {},\n bodyAlign: \"left\",\n footerColor: \"#fff\",\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: \"bold\"\n },\n footerAlign: \"left\",\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts)=>opts.bodyFont.size,\n boxWidth: (ctx, opts)=>opts.bodyFont.size,\n multiKeyBackground: \"#fff\",\n displayColors: true,\n boxPadding: 0,\n borderColor: \"rgba(0,0,0,0)\",\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: \"easeOutQuart\"\n },\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"width\",\n \"height\",\n \"caretX\",\n \"caretY\"\n ]\n },\n opacity: {\n easing: \"linear\",\n duration: 200\n }\n },\n callbacks: $dfc006ada1995968$var$defaultCallbacks\n },\n defaultRoutes: {\n bodyFont: \"font\",\n footerFont: \"font\",\n titleFont: \"font\"\n },\n descriptors: {\n _scriptable: (name)=>name !== \"filter\" && name !== \"itemSort\" && name !== \"external\",\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: \"animation\"\n }\n },\n additionalOptionScopes: [\n \"interaction\"\n ]\n};\nvar $dfc006ada1995968$export$8b3ca321c77fdea6 = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n Colors: $dfc006ada1995968$export$c537fa0d021d010b,\n Decimation: $dfc006ada1995968$export$be17f937e9aa7533,\n Filler: $dfc006ada1995968$export$d19ba4d812bed757,\n Legend: $dfc006ada1995968$export$ed247974535929c7,\n SubTitle: $dfc006ada1995968$export$d5c56664638992a4,\n Title: $dfc006ada1995968$export$f99233281efd08a0,\n Tooltip: $dfc006ada1995968$export$28c660c63b792dea\n});\nconst $dfc006ada1995968$var$addIfString = (labels, raw, index, addedLabels)=>{\n if (typeof raw === \"string\") {\n index = labels.push(raw) - 1;\n addedLabels.unshift({\n index: index,\n label: raw\n });\n } else if (isNaN(raw)) index = null;\n return index;\n};\nfunction $dfc006ada1995968$var$findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) return $dfc006ada1995968$var$addIfString(labels, raw, index, addedLabels);\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\nconst $dfc006ada1995968$var$validIndex = (index, max)=>index === null ? null : (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(Math.round(index), 0, max);\nfunction $dfc006ada1995968$var$_getLabelForValue(value) {\n const labels = this.getLabels();\n if (value >= 0 && value < labels.length) return labels[value];\n return value;\n}\nclass $dfc006ada1995968$export$29e663ba4d09fe7 extends $dfc006ada1995968$export$d60cfc58d3c358b6 {\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const { index: index, label: label } of added)if (labels[index] === label) labels.splice(index, 1);\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n parse(raw, index) {\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(raw)) return null;\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index : $dfc006ada1995968$var$findOrAddLabel(labels, raw, (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(index, raw), this._addedLabels);\n return $dfc006ada1995968$var$validIndex(index, labels.length - 1);\n }\n determineDataLimits() {\n const { minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let { min: min, max: max } = this.getMinMax(true);\n if (this.options.bounds === \"ticks\") {\n if (!minDefined) min = 0;\n if (!maxDefined) max = this.getLabels().length - 1;\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1);\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n for(let value = min; value <= max; value++)ticks.push({\n value: value\n });\n return ticks;\n }\n getLabelForValue(value) {\n return $dfc006ada1995968$var$_getLabelForValue.call(this, value);\n }\n configure() {\n super.configure();\n if (!this.isHorizontal()) this._reversePixels = !this._reversePixels;\n }\n getPixelForValue(value) {\n if (typeof value !== \"number\") value = this.parse(value);\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) return null;\n return this.getPixelForValue(ticks[index].value);\n }\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n getBasePixel() {\n return this.bottom;\n }\n constructor(cfg){\n super(cfg);\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$29e663ba4d09fe7, \"id\", \"category\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$29e663ba4d09fe7, \"defaults\", {\n ticks: {\n callback: $dfc006ada1995968$var$_getLabelForValue\n }\n});\nfunction $dfc006ada1995968$var$generateTicks$1(generationOptions, dataRange) {\n const ticks = [];\n const MIN_SPACING = 1e-14;\n const { bounds: bounds, step: step, min: min, max: max, precision: precision, count: count, maxTicks: maxTicks, maxDigits: maxDigits, includeBounds: includeBounds } = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const { min: rmin, max: rmax } = dataRange;\n const minDefined = !(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(min);\n const maxDefined = !(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(max);\n const countDefined = !(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = (0, $c4d1694fa24f1a71$export$a33b77bbdbb8366c)((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) return [\n {\n value: rmin\n },\n {\n value: rmax\n }\n ];\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) spacing = (0, $c4d1694fa24f1a71$export$a33b77bbdbb8366c)(numSpaces * spacing / maxSpaces / unit) * unit;\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(precision)) {\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n if (bounds === \"ticks\") {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n if (minDefined && maxDefined && step && (0, $c4d1694fa24f1a71$export$b9a6b53f9be3734)((max - min) / step, spacing / 1000)) {\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n numSpaces = (niceMax - niceMin) / spacing;\n if ((0, $c4d1694fa24f1a71$export$a05254e7c3aeba6e)(numSpaces, Math.round(numSpaces), spacing / 1000)) numSpaces = Math.round(numSpaces);\n else numSpaces = Math.ceil(numSpaces);\n }\n const decimalPlaces = Math.max((0, $c4d1694fa24f1a71$export$23ebac1979863676)(spacing), (0, $c4d1694fa24f1a71$export$23ebac1979863676)(niceMin));\n factor = Math.pow(10, (0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({\n value: min\n });\n if (niceMin < min) j++;\n if ((0, $c4d1694fa24f1a71$export$a05254e7c3aeba6e)(Math.round((niceMin + j * spacing) * factor) / factor, min, $dfc006ada1995968$var$relativeLabelSize(min, minSpacing, generationOptions))) j++;\n } else if (niceMin < min) j++;\n }\n for(; j < numSpaces; ++j){\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) break;\n ticks.push({\n value: tickValue\n });\n }\n if (maxDefined && includeBounds && niceMax !== max) {\n if (ticks.length && (0, $c4d1694fa24f1a71$export$a05254e7c3aeba6e)(ticks[ticks.length - 1].value, max, $dfc006ada1995968$var$relativeLabelSize(max, minSpacing, generationOptions))) ticks[ticks.length - 1].value = max;\n else ticks.push({\n value: max\n });\n } else if (!maxDefined || niceMax === max) ticks.push({\n value: niceMax\n });\n return ticks;\n}\nfunction $dfc006ada1995968$var$relativeLabelSize(value, minSpacing, { horizontal: horizontal, minRotation: minRotation }) {\n const rad = (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * (\"\" + value).length;\n return Math.min(minSpacing / ratio, length);\n}\nclass $dfc006ada1995968$var$LinearScaleBase extends $dfc006ada1995968$export$d60cfc58d3c358b6 {\n parse(raw, index) {\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(raw)) return null;\n if ((typeof raw === \"number\" || raw instanceof Number) && !isFinite(+raw)) return null;\n return +raw;\n }\n handleTickRangeOptions() {\n const { beginAtZero: beginAtZero } = this.options;\n const { minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let { min: min, max: max } = this;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (beginAtZero) {\n const minSign = (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(min);\n const maxSign = (0, $c4d1694fa24f1a71$export$2408f22a0fab9ae5)(max);\n if (minSign < 0 && maxSign < 0) setMax(0);\n else if (minSign > 0 && maxSign > 0) setMin(0);\n }\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n setMax(max + offset);\n if (!beginAtZero) setMin(min - offset);\n }\n this.min = min;\n this.max = max;\n }\n getTickLimit() {\n const tickOpts = this.options.ticks;\n let { maxTicksLimit: maxTicksLimit, stepSize: stepSize } = tickOpts;\n let maxTicks;\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n if (maxTicksLimit) maxTicks = Math.min(maxTicksLimit, maxTicks);\n return maxTicks;\n }\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n const numericGeneratorOptions = {\n maxTicks: maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = $dfc006ada1995968$var$generateTicks$1(numericGeneratorOptions, dataRange);\n if (opts.bounds === \"ticks\") (0, $c4d1694fa24f1a71$export$53a70dd1ebbae346)(ticks, this, \"value\");\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n super.configure();\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n getLabelForValue(value) {\n return (0, $c4d1694fa24f1a71$export$ae1af26003f05816)(value, this.chart.options.locale, this.options.ticks.format);\n }\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._endValue = undefined;\n this._valueRange = 0;\n }\n}\nclass $dfc006ada1995968$export$e7f4e5e8656f0b93 extends $dfc006ada1995968$var$LinearScaleBase {\n determineDataLimits() {\n const { min: min, max: max } = this.getMinMax(true);\n this.min = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(min) ? min : 0;\n this.max = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(max) ? max : 1;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e7f4e5e8656f0b93, \"id\", \"linear\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$e7f4e5e8656f0b93, \"defaults\", {\n ticks: {\n callback: (0, $c4d1694fa24f1a71$export$91477dc880baac21).formatters.numeric\n }\n});\nconst $dfc006ada1995968$var$log10Floor = (v)=>Math.floor((0, $c4d1694fa24f1a71$export$9f4f30ee63539e24)(v));\nconst $dfc006ada1995968$var$changeExponent = (v, m)=>Math.pow(10, $dfc006ada1995968$var$log10Floor(v) + m);\nfunction $dfc006ada1995968$var$isMajor(tickVal) {\n const remain = tickVal / Math.pow(10, $dfc006ada1995968$var$log10Floor(tickVal));\n return remain === 1;\n}\nfunction $dfc006ada1995968$var$steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\nfunction $dfc006ada1995968$var$startExp(min, max) {\n const range = max - min;\n let rangeExp = $dfc006ada1995968$var$log10Floor(range);\n while($dfc006ada1995968$var$steps(min, max, rangeExp) > 10)rangeExp++;\n while($dfc006ada1995968$var$steps(min, max, rangeExp) < 10)rangeExp--;\n return Math.min(rangeExp, $dfc006ada1995968$var$log10Floor(min));\n}\nfunction $dfc006ada1995968$var$generateTicks(generationOptions, { min: min, max: max }) {\n min = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(generationOptions.min, min);\n const ticks = [];\n const minExp = $dfc006ada1995968$var$log10Floor(min);\n let exp = $dfc006ada1995968$var$startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while(value < max){\n ticks.push({\n value: value,\n major: $dfc006ada1995968$var$isMajor(value),\n significand: significand\n });\n if (significand >= 10) significand = significand < 15 ? 15 : 20;\n else significand++;\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = (0, $c4d1694fa24f1a71$export$c4ce752e73470fba)(generationOptions.max, value);\n ticks.push({\n value: lastTick,\n major: $dfc006ada1995968$var$isMajor(lastTick),\n significand: significand\n });\n return ticks;\n}\nclass $dfc006ada1995968$export$85295eaf7cb3ac3e extends $dfc006ada1995968$export$d60cfc58d3c358b6 {\n parse(raw, index) {\n const value = $dfc006ada1995968$var$LinearScaleBase.prototype.parse.apply(this, [\n raw,\n index\n ]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(value) && value > 0 ? value : null;\n }\n determineDataLimits() {\n const { min: min, max: max } = this.getMinMax(true);\n this.min = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(min) ? Math.max(0, min) : null;\n this.max = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(max) ? Math.max(0, max) : null;\n if (this.options.beginAtZero) this._zero = true;\n if (this._zero && this.min !== this._suggestedMin && !(0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(this._userMin)) this.min = min === $dfc006ada1995968$var$changeExponent(this.min, 0) ? $dfc006ada1995968$var$changeExponent(this.min, -1) : $dfc006ada1995968$var$changeExponent(this.min, 0);\n this.handleTickRangeOptions();\n }\n handleTickRangeOptions() {\n const { minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (min === max) {\n if (min <= 0) {\n setMin(1);\n setMax(10);\n } else {\n setMin($dfc006ada1995968$var$changeExponent(min, -1));\n setMax($dfc006ada1995968$var$changeExponent(max, 1));\n }\n }\n if (min <= 0) setMin($dfc006ada1995968$var$changeExponent(max, -1));\n if (max <= 0) setMax($dfc006ada1995968$var$changeExponent(min, 1));\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const opts = this.options;\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = $dfc006ada1995968$var$generateTicks(generationOptions, this);\n if (opts.bounds === \"ticks\") (0, $c4d1694fa24f1a71$export$53a70dd1ebbae346)(ticks, this, \"value\");\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n getLabelForValue(value) {\n return value === undefined ? \"0\" : (0, $c4d1694fa24f1a71$export$ae1af26003f05816)(value, this.chart.options.locale, this.options.ticks.format);\n }\n configure() {\n const start = this.min;\n super.configure();\n this._startValue = (0, $c4d1694fa24f1a71$export$9f4f30ee63539e24)(start);\n this._valueRange = (0, $c4d1694fa24f1a71$export$9f4f30ee63539e24)(this.max) - (0, $c4d1694fa24f1a71$export$9f4f30ee63539e24)(start);\n }\n getPixelForValue(value) {\n if (value === undefined || value === 0) value = this.min;\n if (value === null || isNaN(value)) return NaN;\n return this.getPixelForDecimal(value === this.min ? 0 : ((0, $c4d1694fa24f1a71$export$9f4f30ee63539e24)(value) - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._valueRange = 0;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$85295eaf7cb3ac3e, \"id\", \"logarithmic\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$85295eaf7cb3ac3e, \"defaults\", {\n ticks: {\n callback: (0, $c4d1694fa24f1a71$export$91477dc880baac21).formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n});\nfunction $dfc006ada1995968$var$getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n if (tickOpts.display && opts.display) {\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(tickOpts.backdropPadding);\n return (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(tickOpts.font && tickOpts.font.size, (0, $c4d1694fa24f1a71$export$4368d992c4eafac0).font.size) + padding.height;\n }\n return 0;\n}\nfunction $dfc006ada1995968$var$measureLabelSize(ctx, font, label) {\n label = (0, $c4d1694fa24f1a71$export$8b22cf2602fb60ce)(label) ? label : [\n label\n ];\n return {\n w: (0, $c4d1694fa24f1a71$export$faec65b429be379)(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\nfunction $dfc006ada1995968$var$determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) return {\n start: pos - size / 2,\n end: pos + size / 2\n };\n else if (angle < min || angle > max) return {\n start: pos - size,\n end: pos\n };\n return {\n start: pos,\n end: pos + size\n };\n}\nfunction $dfc006ada1995968$var$fitWithPointLabels(scale) {\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? (0, $c4d1694fa24f1a71$export$56c0d5a1e737357d) / valueCount : 0;\n for(let i = 0; i < valueCount; i++){\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(opts.font);\n const textSize = $dfc006ada1995968$var$measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n const angleRadians = (0, $c4d1694fa24f1a71$export$28f7fcd39efa255)(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round((0, $c4d1694fa24f1a71$export$3a6d5c9ae78a2c08)(angleRadians));\n const hLimits = $dfc006ada1995968$var$determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = $dfc006ada1995968$var$determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n $dfc006ada1995968$var$updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b);\n scale._pointLabelItems = $dfc006ada1995968$var$buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction $dfc006ada1995968$var$updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\nfunction $dfc006ada1995968$var$createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const { extra: extra, additionalAngle: additionalAngle, padding: padding, size: size } = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round((0, $c4d1694fa24f1a71$export$3a6d5c9ae78a2c08)((0, $c4d1694fa24f1a71$export$28f7fcd39efa255)(pointLabelPosition.angle + (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd))));\n const y = $dfc006ada1995968$var$yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = $dfc006ada1995968$var$getTextAlignForAngle(angle);\n const left = $dfc006ada1995968$var$leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n visible: true,\n x: pointLabelPosition.x,\n y: y,\n textAlign: textAlign,\n left: left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\nfunction $dfc006ada1995968$var$isNotOverlapped(item, area) {\n if (!area) return true;\n const { left: left, top: top, right: right, bottom: bottom } = item;\n const apexesInArea = (0, $c4d1694fa24f1a71$export$e7094788287c5e9b)({\n x: left,\n y: top\n }, area) || (0, $c4d1694fa24f1a71$export$e7094788287c5e9b)({\n x: left,\n y: bottom\n }, area) || (0, $c4d1694fa24f1a71$export$e7094788287c5e9b)({\n x: right,\n y: top\n }, area) || (0, $c4d1694fa24f1a71$export$e7094788287c5e9b)({\n x: right,\n y: bottom\n }, area);\n return !apexesInArea;\n}\nfunction $dfc006ada1995968$var$buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const { centerPointLabels: centerPointLabels, display: display } = opts.pointLabels;\n const itemOpts = {\n extra: $dfc006ada1995968$var$getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? (0, $c4d1694fa24f1a71$export$56c0d5a1e737357d) / valueCount : 0\n };\n let area;\n for(let i = 0; i < valueCount; i++){\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n const item = $dfc006ada1995968$var$createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === \"auto\") {\n item.visible = $dfc006ada1995968$var$isNotOverlapped(item, area);\n if (item.visible) area = item;\n }\n }\n return items;\n}\nfunction $dfc006ada1995968$var$getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) return \"center\";\n else if (angle < 180) return \"left\";\n return \"right\";\n}\nfunction $dfc006ada1995968$var$leftForTextAlign(x, w, align) {\n if (align === \"right\") x -= w;\n else if (align === \"center\") x -= w / 2;\n return x;\n}\nfunction $dfc006ada1995968$var$yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) y -= h / 2;\n else if (angle > 270 || angle < 90) y -= h;\n return y;\n}\nfunction $dfc006ada1995968$var$drawPointLabelBox(ctx, opts, item) {\n const { left: left, top: top, right: right, bottom: bottom } = item;\n const { backdropColor: backdropColor } = opts;\n if (!(0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(backdropColor)) {\n const borderRadius = (0, $c4d1694fa24f1a71$export$92108d983e8ee699)(opts.borderRadius);\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n (0, $c4d1694fa24f1a71$export$1fbe638ecf81657e)(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius\n });\n ctx.fill();\n } else ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n}\nfunction $dfc006ada1995968$var$drawPointLabels(scale, labelCount) {\n const { ctx: ctx, options: { pointLabels: pointLabels } } = scale;\n for(let i = labelCount - 1; i >= 0; i--){\n const item = scale._pointLabelItems[i];\n if (!item.visible) continue;\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n $dfc006ada1995968$var$drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(optsAtIndex.font);\n const { x: x, y: y, textAlign: textAlign } = item;\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: \"middle\"\n });\n }\n}\nfunction $dfc006ada1995968$var$pathRadiusLine(scale, radius, circular, labelCount) {\n const { ctx: ctx } = scale;\n if (circular) ctx.arc(scale.xCenter, scale.yCenter, radius, 0, (0, $c4d1694fa24f1a71$export$971d5caa766a69d7));\n else {\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n for(let i = 1; i < labelCount; i++){\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\nfunction $dfc006ada1995968$var$drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n const { color: color, lineWidth: lineWidth } = gridLineOpts;\n if (!circular && !labelCount || !color || !lineWidth || radius < 0) return;\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n ctx.beginPath();\n $dfc006ada1995968$var$pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\nfunction $dfc006ada1995968$var$createPointLabelContext(parent, index, label) {\n return (0, $c4d1694fa24f1a71$export$35e795649ee09318)(parent, {\n label: label,\n index: index,\n type: \"pointLabel\"\n });\n}\nclass $dfc006ada1995968$export$cfafc36d95386d38 extends $dfc006ada1995968$var$LinearScaleBase {\n setDimensions() {\n const padding = this._padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)($dfc006ada1995968$var$getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n determineDataLimits() {\n const { min: min, max: max } = this.getMinMax(false);\n this.min = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(min) && !isNaN(min) ? min : 0;\n this.max = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(max) && !isNaN(max) ? max : 0;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n return Math.ceil(this.drawingArea / $dfc006ada1995968$var$getTickBackdropHeight(this.options));\n }\n generateTickLabels(ticks) {\n $dfc006ada1995968$var$LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n this._pointLabels = this.getLabels().map((value, index)=>{\n const label = (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(this.options.pointLabels.callback, [\n value,\n index\n ], this);\n return label || label === 0 ? label : \"\";\n }).filter((v, i)=>this.chart.getDataVisibility(i));\n }\n fit() {\n const opts = this.options;\n if (opts.display && opts.pointLabels.display) $dfc006ada1995968$var$fitWithPointLabels(this);\n else this.setCenterPoint(0, 0, 0, 0);\n }\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n getIndexAngle(index) {\n const angleMultiplier = (0, $c4d1694fa24f1a71$export$971d5caa766a69d7) / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n return (0, $c4d1694fa24f1a71$export$28f7fcd39efa255)(index * angleMultiplier + (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(startAngle));\n }\n getDistanceFromCenterForValue(value) {\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(value)) return NaN;\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) return (this.max - value) * scalingFactor;\n return (value - this.min) * scalingFactor;\n }\n getValueForDistanceFromCenter(distance) {\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(distance)) return NaN;\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return $dfc006ada1995968$var$createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - (0, $c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd) + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle: angle\n };\n }\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n getPointLabelPosition(index) {\n const { left: left, top: top, right: right, bottom: bottom } = this._pointLabelItems[index];\n return {\n left: left,\n top: top,\n right: right,\n bottom: bottom\n };\n }\n drawBackground() {\n const { backgroundColor: backgroundColor, grid: { circular: circular } } = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n $dfc006ada1995968$var$pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const { angleLines: angleLines, grid: grid, border: border } = opts;\n const labelCount = this._pointLabels.length;\n let i, offset, position;\n if (opts.pointLabels.display) $dfc006ada1995968$var$drawPointLabels(this, labelCount);\n if (grid.display) this.ticks.forEach((tick, index)=>{\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n $dfc006ada1995968$var$drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n if (angleLines.display) {\n ctx.save();\n for(i = labelCount - 1; i >= 0; i--){\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const { color: color, lineWidth: lineWidth } = optsAtIndex;\n if (!lineWidth || !color) continue;\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n ctx.restore();\n }\n }\n drawBorder() {}\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n if (!tickOpts.display) return;\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n this.ticks.forEach((tick, index)=>{\n if (index === 0 && !opts.reverse) return;\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = (0, $c4d1694fa24f1a71$export$34aec0b863436764)(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n const padding = (0, $c4d1694fa24f1a71$export$a9c23c6ac3fc3eca)(optsAtIndex.backdropPadding);\n ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height);\n }\n (0, $c4d1694fa24f1a71$export$dc98b0b04f4c7758)(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth\n });\n });\n ctx.restore();\n }\n drawTitle() {}\n constructor(cfg){\n super(cfg);\n this.xCenter = undefined;\n this.yCenter = undefined;\n this.drawingArea = undefined;\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$cfafc36d95386d38, \"id\", \"radialLinear\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$cfafc36d95386d38, \"defaults\", {\n display: true,\n animate: true,\n position: \"chartArea\",\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n grid: {\n circular: false\n },\n startAngle: 0,\n ticks: {\n showLabelBackdrop: true,\n callback: (0, $c4d1694fa24f1a71$export$91477dc880baac21).formatters.numeric\n },\n pointLabels: {\n backdropColor: undefined,\n backdropPadding: 2,\n display: true,\n font: {\n size: 10\n },\n callback (label) {\n return label;\n },\n padding: 5,\n centerPointLabels: false\n }\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$cfafc36d95386d38, \"defaultRoutes\", {\n \"angleLines.color\": \"borderColor\",\n \"pointLabels.color\": \"color\",\n \"ticks.color\": \"color\"\n});\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$cfafc36d95386d38, \"descriptors\", {\n angleLines: {\n _fallback: \"grid\"\n }\n});\nconst $dfc006ada1995968$var$INTERVALS = {\n millisecond: {\n common: true,\n size: 1,\n steps: 1000\n },\n second: {\n common: true,\n size: 1000,\n steps: 60\n },\n minute: {\n common: true,\n size: 60000,\n steps: 60\n },\n hour: {\n common: true,\n size: 3600000,\n steps: 24\n },\n day: {\n common: true,\n size: 86400000,\n steps: 30\n },\n week: {\n common: false,\n size: 604800000,\n steps: 4\n },\n month: {\n common: true,\n size: 2.628e9,\n steps: 12\n },\n quarter: {\n common: false,\n size: 7.884e9,\n steps: 4\n },\n year: {\n common: true,\n size: 3.154e10\n }\n};\nconst $dfc006ada1995968$var$UNITS = /* #__PURE__ */ Object.keys($dfc006ada1995968$var$INTERVALS);\nfunction $dfc006ada1995968$var$sorter(a, b) {\n return a - b;\n}\nfunction $dfc006ada1995968$var$parse(scale, input) {\n if ((0, $c4d1694fa24f1a71$export$342063e11d6c3cad)(input)) return null;\n const adapter = scale._adapter;\n const { parser: parser, round: round, isoWeekday: isoWeekday } = scale._parseOpts;\n let value = input;\n if (typeof parser === \"function\") value = parser(value);\n if (!(0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(value)) value = typeof parser === \"string\" ? adapter.parse(value, parser) : adapter.parse(value);\n if (value === null) return null;\n if (round) value = round === \"week\" && ((0, $c4d1694fa24f1a71$export$d141bba7fdc215a3)(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, \"isoWeek\", isoWeekday) : adapter.startOf(value, round);\n return +value;\n}\nfunction $dfc006ada1995968$var$determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = $dfc006ada1995968$var$UNITS.length;\n for(let i = $dfc006ada1995968$var$UNITS.indexOf(minUnit); i < ilen - 1; ++i){\n const interval = $dfc006ada1995968$var$INTERVALS[$dfc006ada1995968$var$UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) return $dfc006ada1995968$var$UNITS[i];\n }\n return $dfc006ada1995968$var$UNITS[ilen - 1];\n}\nfunction $dfc006ada1995968$var$determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for(let i = $dfc006ada1995968$var$UNITS.length - 1; i >= $dfc006ada1995968$var$UNITS.indexOf(minUnit); i--){\n const unit = $dfc006ada1995968$var$UNITS[i];\n if ($dfc006ada1995968$var$INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) return unit;\n }\n return $dfc006ada1995968$var$UNITS[minUnit ? $dfc006ada1995968$var$UNITS.indexOf(minUnit) : 0];\n}\nfunction $dfc006ada1995968$var$determineMajorUnit(unit) {\n for(let i = $dfc006ada1995968$var$UNITS.indexOf(unit) + 1, ilen = $dfc006ada1995968$var$UNITS.length; i < ilen; ++i){\n if ($dfc006ada1995968$var$INTERVALS[$dfc006ada1995968$var$UNITS[i]].common) return $dfc006ada1995968$var$UNITS[i];\n }\n}\nfunction $dfc006ada1995968$var$addTick(ticks, time, timestamps) {\n if (!timestamps) ticks[time] = true;\n else if (timestamps.length) {\n const { lo: lo, hi: hi } = (0, $c4d1694fa24f1a71$export$2ed0fc6709e59212)(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\nfunction $dfc006ada1995968$var$setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n for(major = first; major <= last; major = +adapter.add(major, 1, majorUnit)){\n index = map[major];\n if (index >= 0) ticks[index].major = true;\n }\n return ticks;\n}\nfunction $dfc006ada1995968$var$ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n const map = {};\n const ilen = values.length;\n let i, value;\n for(i = 0; i < ilen; ++i){\n value = values[i];\n map[value] = i;\n ticks.push({\n value: value,\n major: false\n });\n }\n return ilen === 0 || !majorUnit ? ticks : $dfc006ada1995968$var$setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass $dfc006ada1995968$export$a894c72689ff3ec extends $dfc006ada1995968$export$d60cfc58d3c358b6 {\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n const adapter = this._adapter = new $dfc006ada1995968$export$f32766ea09ec8bc4._date(scaleOpts.adapters.date);\n adapter.init(opts);\n (0, $c4d1694fa24f1a71$export$555508cbc6add439)(time.displayFormats, adapter.formats());\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n super.init(scaleOpts);\n this._normalized = opts.normalized;\n }\n parse(raw, index) {\n if (raw === undefined) return null;\n return $dfc006ada1995968$var$parse(this, raw);\n }\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || \"day\";\n let { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) min = Math.min(min, bounds.min);\n if (!maxDefined && !isNaN(bounds.max)) max = Math.max(max, bounds.max);\n }\n if (!minDefined || !maxDefined) {\n _applyBounds(this._getLabelBounds());\n if (options.bounds !== \"ticks\" || options.ticks.source !== \"labels\") _applyBounds(this.getMinMax(false));\n }\n min = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = (0, $c4d1694fa24f1a71$export$39b482c5e57630a8)(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {\n min: min,\n max: max\n };\n }\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === \"labels\" ? this.getLabelTimestamps() : this._generate();\n if (options.bounds === \"ticks\" && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n const min = this.min;\n const max = this.max;\n const ticks = (0, $c4d1694fa24f1a71$export$c03999cb2f36933f)(timestamps, min, max);\n this._unit = timeOpts.unit || (tickOpts.autoSkip ? $dfc006ada1995968$var$determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : $dfc006ada1995968$var$determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === \"year\" ? undefined : $dfc006ada1995968$var$determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n if (options.reverse) ticks.reverse();\n return $dfc006ada1995968$var$ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n afterAutoSkip() {\n if (this.options.offsetAfterAutoskip) this.initOffsets(this.ticks.map((tick)=>+tick.value));\n }\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) start = 1 - first;\n else start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) end = last;\n else end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(start, 0, limit);\n end = (0, $c4d1694fa24f1a71$export$25ce5a424b770e84)(end, 0, limit);\n this._offsets = {\n start: start,\n end: end,\n factor: 1 / (start + 1 + end)\n };\n }\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n const minor = timeOpts.unit || $dfc006ada1995968$var$determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = (0, $c4d1694fa24f1a71$export$90a7f3efeed30595)(options.ticks.stepSize, 1);\n const weekday = minor === \"week\" ? timeOpts.isoWeekday : false;\n const hasWeekday = (0, $c4d1694fa24f1a71$export$d141bba7fdc215a3)(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n if (hasWeekday) first = +adapter.startOf(first, \"isoWeek\", weekday);\n first = +adapter.startOf(first, hasWeekday ? \"day\" : minor);\n if (adapter.diff(max, min, minor) > 100000 * stepSize) throw new Error(min + \" and \" + max + \" are too far apart with stepSize of \" + stepSize + \" \" + minor);\n const timestamps = options.ticks.source === \"data\" && this.getDataTimestamps();\n for(time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++)$dfc006ada1995968$var$addTick(ticks, time, timestamps);\n if (time === max || options.bounds === \"ticks\" || count === 1) $dfc006ada1995968$var$addTick(ticks, time, timestamps);\n return Object.keys(ticks).sort($dfc006ada1995968$var$sorter).map((x)=>+x);\n }\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n if (timeOpts.tooltipFormat) return adapter.format(value, timeOpts.tooltipFormat);\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n if (formatter) return (0, $c4d1694fa24f1a71$export$3722cfe417b6ed86)(formatter, [\n time,\n index,\n ticks\n ], this);\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n generateTickLabels(ticks) {\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = (0, $c4d1694fa24f1a71$export$625550452a3fa3ec)(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n return {\n w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,\n h: tickLabelWidth * sinRotation + tickFontSize * cosRotation\n };\n }\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, $dfc006ada1995968$var$ticksFromTimestamps(this, [\n exampleTime\n ], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n if (timestamps.length) return timestamps;\n const metas = this.getMatchingVisibleMetas();\n if (this._normalized && metas.length) return this._cache.data = metas[0].controller.getAllParsedValues(this);\n for(i = 0, ilen = metas.length; i < ilen; ++i)timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n return this._cache.data = this.normalize(timestamps);\n }\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n if (timestamps.length) return timestamps;\n const labels = this.getLabels();\n for(i = 0, ilen = labels.length; i < ilen; ++i)timestamps.push($dfc006ada1995968$var$parse(this, labels[i]));\n return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);\n }\n normalize(values) {\n return (0, $c4d1694fa24f1a71$export$71511d61b312f219)(values.sort($dfc006ada1995968$var$sorter));\n }\n constructor(props){\n super(props);\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n this._unit = \"day\";\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$a894c72689ff3ec, \"id\", \"time\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$a894c72689ff3ec, \"defaults\", {\n bounds: \"data\",\n adapters: {},\n time: {\n parser: false,\n unit: false,\n round: false,\n isoWeekday: false,\n minUnit: \"millisecond\",\n displayFormats: {}\n },\n ticks: {\n source: \"auto\",\n callback: false,\n major: {\n enabled: false\n }\n }\n});\nfunction $dfc006ada1995968$var$interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) ({ lo: lo, hi: hi } = (0, $c4d1694fa24f1a71$export$ef35774e6d314e91)(table, \"pos\", val));\n ({ pos: prevSource, time: prevTarget } = table[lo]);\n ({ pos: nextSource, time: nextTarget } = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) ({ lo: lo, hi: hi } = (0, $c4d1694fa24f1a71$export$ef35774e6d314e91)(table, \"time\", val));\n ({ time: prevSource, pos: prevTarget } = table[lo]);\n ({ time: nextSource, pos: nextTarget } = table[hi]);\n }\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass $dfc006ada1995968$export$85df64a8eb6dc986 extends $dfc006ada1995968$export$a894c72689ff3ec {\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = $dfc006ada1995968$var$interpolate(table, this.min);\n this._tableRange = $dfc006ada1995968$var$interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n buildLookupTable(timestamps) {\n const { min: min, max: max } = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n for(i = 0, ilen = timestamps.length; i < ilen; ++i){\n curr = timestamps[i];\n if (curr >= min && curr <= max) items.push(curr);\n }\n if (items.length < 2) return [\n {\n time: min,\n pos: 0\n },\n {\n time: max,\n pos: 1\n }\n ];\n for(i = 0, ilen = items.length; i < ilen; ++i){\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n if (Math.round((next + prev) / 2) !== curr) table.push({\n time: curr,\n pos: i / (ilen - 1)\n });\n }\n return table;\n }\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) timestamps.splice(0, 0, min);\n if (!timestamps.includes(max) || timestamps.length === 1) timestamps.push(max);\n return timestamps.sort((a, b)=>a - b);\n }\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n if (timestamps.length) return timestamps;\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) timestamps = this.normalize(data.concat(label));\n else timestamps = data.length ? data : label;\n timestamps = this._cache.all = timestamps;\n return timestamps;\n }\n getDecimalForValue(value) {\n return ($dfc006ada1995968$var$interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return $dfc006ada1995968$var$interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n constructor(props){\n super(props);\n this._table = [];\n this._minPos = undefined;\n this._tableRange = undefined;\n }\n}\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$85df64a8eb6dc986, \"id\", \"timeseries\");\n(0, $00f31ca755459a2b$export$1e71eb4bef00f6b0)($dfc006ada1995968$export$85df64a8eb6dc986, \"defaults\", $dfc006ada1995968$export$a894c72689ff3ec.defaults);\nvar $dfc006ada1995968$export$bcac1c16f1530ec2 = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n CategoryScale: $dfc006ada1995968$export$29e663ba4d09fe7,\n LinearScale: $dfc006ada1995968$export$e7f4e5e8656f0b93,\n LogarithmicScale: $dfc006ada1995968$export$85295eaf7cb3ac3e,\n RadialLinearScale: $dfc006ada1995968$export$cfafc36d95386d38,\n TimeScale: $dfc006ada1995968$export$a894c72689ff3ec,\n TimeSeriesScale: $dfc006ada1995968$export$85df64a8eb6dc986\n});\nconst $dfc006ada1995968$export$e8959e79e3af550f = [\n $dfc006ada1995968$export$a6506504f799c5d5,\n $dfc006ada1995968$export$7a5d735b2ab6389d,\n $dfc006ada1995968$export$8b3ca321c77fdea6,\n $dfc006ada1995968$export$bcac1c16f1530ec2\n];\n\n\n(0, $dfc006ada1995968$export$acaa6426d77a227e).register(...(0, $dfc006ada1995968$export$e8959e79e3af550f));\nvar $90463797e5db2d19$export$2e2bcd8739ae039 = (0, $dfc006ada1995968$export$acaa6426d77a227e);\n\n\n/**!\n * Sortable 1.15.1\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */ function $c8f95463ff5f043e$var$ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function(sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction $c8f95463ff5f043e$var$_objectSpread2(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) $c8f95463ff5f043e$var$ownKeys(Object(source), true).forEach(function(key) {\n $c8f95463ff5f043e$var$_defineProperty(target, key, source[key]);\n });\n else if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n else $c8f95463ff5f043e$var$ownKeys(Object(source)).forEach(function(key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\n}\nfunction $c8f95463ff5f043e$var$_typeof(obj) {\n \"@babel/helpers - typeof\";\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") $c8f95463ff5f043e$var$_typeof = function(obj) {\n return typeof obj;\n };\n else $c8f95463ff5f043e$var$_typeof = function(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n return $c8f95463ff5f043e$var$_typeof(obj);\n}\nfunction $c8f95463ff5f043e$var$_defineProperty(obj, key, value) {\n if (key in obj) Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n else obj[key] = value;\n return obj;\n}\nfunction $c8f95463ff5f043e$var$_extends() {\n $c8f95463ff5f043e$var$_extends = Object.assign || function(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i];\n for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];\n }\n return target;\n };\n return $c8f95463ff5f043e$var$_extends.apply(this, arguments);\n}\nfunction $c8f95463ff5f043e$var$_objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for(i = 0; i < sourceKeys.length; i++){\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction $c8f95463ff5f043e$var$_objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = $c8f95463ff5f043e$var$_objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for(i = 0; i < sourceSymbolKeys.length; i++){\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction $c8f95463ff5f043e$var$_toConsumableArray(arr) {\n return $c8f95463ff5f043e$var$_arrayWithoutHoles(arr) || $c8f95463ff5f043e$var$_iterableToArray(arr) || $c8f95463ff5f043e$var$_unsupportedIterableToArray(arr) || $c8f95463ff5f043e$var$_nonIterableSpread();\n}\nfunction $c8f95463ff5f043e$var$_arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return $c8f95463ff5f043e$var$_arrayLikeToArray(arr);\n}\nfunction $c8f95463ff5f043e$var$_iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction $c8f95463ff5f043e$var$_unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return $c8f95463ff5f043e$var$_arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $c8f95463ff5f043e$var$_arrayLikeToArray(o, minLen);\n}\nfunction $c8f95463ff5f043e$var$_arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction $c8f95463ff5f043e$var$_nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nvar $c8f95463ff5f043e$var$version = \"1.15.1\";\nfunction $c8f95463ff5f043e$var$userAgent(pattern) {\n if (typeof window !== \"undefined\" && window.navigator) return !!/*@__PURE__*/ navigator.userAgent.match(pattern);\n}\nvar $c8f95463ff5f043e$var$IE11OrLess = $c8f95463ff5f043e$var$userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar $c8f95463ff5f043e$var$Edge = $c8f95463ff5f043e$var$userAgent(/Edge/i);\nvar $c8f95463ff5f043e$var$FireFox = $c8f95463ff5f043e$var$userAgent(/firefox/i);\nvar $c8f95463ff5f043e$var$Safari = $c8f95463ff5f043e$var$userAgent(/safari/i) && !$c8f95463ff5f043e$var$userAgent(/chrome/i) && !$c8f95463ff5f043e$var$userAgent(/android/i);\nvar $c8f95463ff5f043e$var$IOS = $c8f95463ff5f043e$var$userAgent(/iP(ad|od|hone)/i);\nvar $c8f95463ff5f043e$var$ChromeForAndroid = $c8f95463ff5f043e$var$userAgent(/chrome/i) && $c8f95463ff5f043e$var$userAgent(/android/i);\nvar $c8f95463ff5f043e$var$captureMode = {\n capture: false,\n passive: false\n};\nfunction $c8f95463ff5f043e$var$on(el, event, fn) {\n el.addEventListener(event, fn, !$c8f95463ff5f043e$var$IE11OrLess && $c8f95463ff5f043e$var$captureMode);\n}\nfunction $c8f95463ff5f043e$var$off(el, event, fn) {\n el.removeEventListener(event, fn, !$c8f95463ff5f043e$var$IE11OrLess && $c8f95463ff5f043e$var$captureMode);\n}\nfunction $c8f95463ff5f043e$var$matches(/**HTMLElement*/ el, /**String*/ selector) {\n if (!selector) return;\n selector[0] === \">\" && (selector = selector.substring(1));\n if (el) try {\n if (el.matches) return el.matches(selector);\n else if (el.msMatchesSelector) return el.msMatchesSelector(selector);\n else if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);\n } catch (_) {\n return false;\n }\n return false;\n}\nfunction $c8f95463ff5f043e$var$getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction $c8f95463ff5f043e$var$closest(/**HTMLElement*/ el, /**String*/ selector, /**HTMLElement*/ ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === \">\" ? el.parentNode === ctx && $c8f95463ff5f043e$var$matches(el, selector) : $c8f95463ff5f043e$var$matches(el, selector)) || includeCTX && el === ctx) return el;\n if (el === ctx) break;\n /* jshint boss:true */ }while (el = $c8f95463ff5f043e$var$getParentOrHost(el));\n }\n return null;\n}\nvar $c8f95463ff5f043e$var$R_SPACE = /\\s+/g;\nfunction $c8f95463ff5f043e$var$toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) el.classList[state ? \"add\" : \"remove\"](name);\n else {\n var className = (\" \" + el.className + \" \").replace($c8f95463ff5f043e$var$R_SPACE, \" \").replace(\" \" + name + \" \", \" \");\n el.className = (className + (state ? \" \" + name : \"\")).replace($c8f95463ff5f043e$var$R_SPACE, \" \");\n }\n }\n}\nfunction $c8f95463ff5f043e$var$css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) val = document.defaultView.getComputedStyle(el, \"\");\n else if (el.currentStyle) val = el.currentStyle;\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf(\"webkit\") === -1) prop = \"-webkit-\" + prop;\n style[prop] = val + (typeof val === \"string\" ? \"\" : \"px\");\n }\n }\n}\nfunction $c8f95463ff5f043e$var$matrix(el, selfOnly) {\n var appliedTransforms = \"\";\n if (typeof el === \"string\") appliedTransforms = el;\n else do {\n var transform = $c8f95463ff5f043e$var$css(el, \"transform\");\n if (transform && transform !== \"none\") appliedTransforms = transform + \" \" + appliedTransforms;\n /* jshint boss:true */ }while (!selfOnly && (el = el.parentNode));\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */ return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction $c8f95463ff5f043e$var$find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length;\n if (iterator) for(; i < n; i++)iterator(list[i], i);\n return list;\n }\n return [];\n}\nfunction $c8f95463ff5f043e$var$getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) return scrollingElement;\n else return document.documentElement;\n}\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */ function $c8f95463ff5f043e$var$getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== $c8f95463ff5f043e$var$getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!$c8f95463ff5f043e$var$IE11OrLess) {\n do if (container && container.getBoundingClientRect && ($c8f95463ff5f043e$var$css(container, \"transform\") !== \"none\" || relativeToNonStaticParent && $c8f95463ff5f043e$var$css(container, \"position\") !== \"static\")) {\n var containerRect = container.getBoundingClientRect();\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt($c8f95463ff5f043e$var$css(container, \"border-top-width\"));\n left -= containerRect.left + parseInt($c8f95463ff5f043e$var$css(container, \"border-left-width\"));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = $c8f95463ff5f043e$var$matrix(container || el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\r\n * Returns the content rect of the element (bounding rect minus border and padding)\r\n * @param {HTMLElement} el \r\n */ function $c8f95463ff5f043e$var$getContentRect(el) {\n var rect = $c8f95463ff5f043e$var$getRect(el);\n var paddingLeft = parseInt($c8f95463ff5f043e$var$css(el, \"padding-left\")), paddingTop = parseInt($c8f95463ff5f043e$var$css(el, \"padding-top\")), paddingRight = parseInt($c8f95463ff5f043e$var$css(el, \"padding-right\")), paddingBottom = parseInt($c8f95463ff5f043e$var$css(el, \"padding-bottom\"));\n rect.top += paddingTop + parseInt($c8f95463ff5f043e$var$css(el, \"border-top-width\"));\n rect.left += paddingLeft + parseInt($c8f95463ff5f043e$var$css(el, \"border-left-width\"));\n // Client Width/Height includes padding only\n rect.width = el.clientWidth - paddingLeft - paddingRight;\n rect.height = el.clientHeight - paddingTop - paddingBottom;\n rect.bottom = rect.top + rect.height;\n rect.right = rect.left + rect.width;\n return rect;\n}\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */ function $c8f95463ff5f043e$var$isScrolledPast(el, elSide, parentSide) {\n var parent = $c8f95463ff5f043e$var$getParentAutoScrollElement(el, true), elSideVal = $c8f95463ff5f043e$var$getRect(el)[elSide];\n /* jshint boss:true */ while(parent){\n var parentSideVal = $c8f95463ff5f043e$var$getRect(parent)[parentSide], visible = void 0;\n if (parentSide === \"top\" || parentSide === \"left\") visible = elSideVal >= parentSideVal;\n else visible = elSideVal <= parentSideVal;\n if (!visible) return parent;\n if (parent === $c8f95463ff5f043e$var$getWindowScrollingElement()) break;\n parent = $c8f95463ff5f043e$var$getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */ function $c8f95463ff5f043e$var$getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0, i = 0, children = el.children;\n while(i < children.length){\n if (children[i].style.display !== \"none\" && children[i] !== $c8f95463ff5f043e$export$31b3ca70d8f57423.ghost && (includeDragEl || children[i] !== $c8f95463ff5f043e$export$31b3ca70d8f57423.dragged) && $c8f95463ff5f043e$var$closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) return children[i];\n currentChild++;\n }\n i++;\n }\n return null;\n}\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */ function $c8f95463ff5f043e$var$lastChild(el, selector) {\n var last = el.lastElementChild;\n while(last && (last === $c8f95463ff5f043e$export$31b3ca70d8f57423.ghost || $c8f95463ff5f043e$var$css(last, \"display\") === \"none\" || selector && !$c8f95463ff5f043e$var$matches(last, selector)))last = last.previousElementSibling;\n return last || null;\n}\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */ function $c8f95463ff5f043e$var$index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) return -1;\n /* jshint boss:true */ while(el = el.previousElementSibling)if (el.nodeName.toUpperCase() !== \"TEMPLATE\" && el !== $c8f95463ff5f043e$export$31b3ca70d8f57423.clone && (!selector || $c8f95463ff5f043e$var$matches(el, selector))) index++;\n return index;\n}\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */ function $c8f95463ff5f043e$var$getRelativeScrollOffset(el) {\n var offsetLeft = 0, offsetTop = 0, winScroller = $c8f95463ff5f043e$var$getWindowScrollingElement();\n if (el) do {\n var elMatrix = $c8f95463ff5f043e$var$matrix(el), scaleX = elMatrix.a, scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n }while (el !== winScroller && (el = el.parentNode));\n return [\n offsetLeft,\n offsetTop\n ];\n}\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */ function $c8f95463ff5f043e$var$indexOfObject(arr, obj) {\n for(var i in arr){\n if (!arr.hasOwnProperty(i)) continue;\n for(var key in obj){\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction $c8f95463ff5f043e$var$getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return $c8f95463ff5f043e$var$getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = $c8f95463ff5f043e$var$css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == \"auto\" || elemCSS.overflowX == \"scroll\") || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == \"auto\" || elemCSS.overflowY == \"scroll\")) {\n if (!elem.getBoundingClientRect || elem === document.body) return $c8f95463ff5f043e$var$getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n while (elem = elem.parentNode);\n return $c8f95463ff5f043e$var$getWindowScrollingElement();\n}\nfunction $c8f95463ff5f043e$var$extend(dst, src) {\n if (dst && src) {\n for(var key in src)if (src.hasOwnProperty(key)) dst[key] = src[key];\n }\n return dst;\n}\nfunction $c8f95463ff5f043e$var$isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar $c8f95463ff5f043e$var$_throttleTimeout;\nfunction $c8f95463ff5f043e$var$throttle(callback, ms) {\n return function() {\n if (!$c8f95463ff5f043e$var$_throttleTimeout) {\n var args = arguments, _this = this;\n if (args.length === 1) callback.call(_this, args[0]);\n else callback.apply(_this, args);\n $c8f95463ff5f043e$var$_throttleTimeout = setTimeout(function() {\n $c8f95463ff5f043e$var$_throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction $c8f95463ff5f043e$var$cancelThrottle() {\n clearTimeout($c8f95463ff5f043e$var$_throttleTimeout);\n $c8f95463ff5f043e$var$_throttleTimeout = void 0;\n}\nfunction $c8f95463ff5f043e$var$scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction $c8f95463ff5f043e$var$clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) return Polymer.dom(el).cloneNode(true);\n else if ($) return $(el).clone(true)[0];\n else return el.cloneNode(true);\n}\nfunction $c8f95463ff5f043e$var$setRect(el, rect) {\n $c8f95463ff5f043e$var$css(el, \"position\", \"absolute\");\n $c8f95463ff5f043e$var$css(el, \"top\", rect.top);\n $c8f95463ff5f043e$var$css(el, \"left\", rect.left);\n $c8f95463ff5f043e$var$css(el, \"width\", rect.width);\n $c8f95463ff5f043e$var$css(el, \"height\", rect.height);\n}\nfunction $c8f95463ff5f043e$var$unsetRect(el) {\n $c8f95463ff5f043e$var$css(el, \"position\", \"\");\n $c8f95463ff5f043e$var$css(el, \"top\", \"\");\n $c8f95463ff5f043e$var$css(el, \"left\", \"\");\n $c8f95463ff5f043e$var$css(el, \"width\", \"\");\n $c8f95463ff5f043e$var$css(el, \"height\", \"\");\n}\nvar $c8f95463ff5f043e$var$expando = \"Sortable\" + new Date().getTime();\nfunction $c8f95463ff5f043e$var$AnimationStateManager() {\n var animationStates = [], animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function(child) {\n if ($c8f95463ff5f043e$var$css(child, \"display\") === \"none\" || child === $c8f95463ff5f043e$export$31b3ca70d8f57423.ghost) return;\n animationStates.push({\n target: child,\n rect: $c8f95463ff5f043e$var$getRect(child)\n });\n var fromRect = $c8f95463ff5f043e$var$_objectSpread2({}, animationStates[animationStates.length - 1].rect);\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = $c8f95463ff5f043e$var$matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice($c8f95463ff5f043e$var$indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === \"function\") callback();\n return;\n }\n var animating = false, animationTime = 0;\n animationStates.forEach(function(state) {\n var time = 0, target = state.target, fromRect = target.fromRect, toRect = $c8f95463ff5f043e$var$getRect(target), prevFromRect = target.prevFromRect, prevToRect = target.prevToRect, animatingRect = state.rect, targetMatrix = $c8f95463ff5f043e$var$matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) // Could also check if animatingRect is between fromRect and toRect\n {\n if ($c8f95463ff5f043e$var$isRectEqual(prevFromRect, toRect) && !$c8f95463ff5f043e$var$isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) // If returning to same place as started from animation and on same axis\n time = $c8f95463ff5f043e$var$calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n // if fromRect != toRect: animate\n if (!$c8f95463ff5f043e$var$isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) time = _this.options.animation;\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function() {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === \"function\") callback();\n } else animationCallbackId = setTimeout(function() {\n if (typeof callback === \"function\") callback();\n }, animationTime);\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n $c8f95463ff5f043e$var$css(target, \"transition\", \"\");\n $c8f95463ff5f043e$var$css(target, \"transform\", \"\");\n var elMatrix = $c8f95463ff5f043e$var$matrix(this.el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d, translateX = (currentRect.left - toRect.left) / (scaleX || 1), translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n $c8f95463ff5f043e$var$css(target, \"transform\", \"translate3d(\" + translateX + \"px,\" + translateY + \"px,0)\");\n this.forRepaintDummy = $c8f95463ff5f043e$var$repaint(target); // repaint\n $c8f95463ff5f043e$var$css(target, \"transition\", \"transform \" + duration + \"ms\" + (this.options.easing ? \" \" + this.options.easing : \"\"));\n $c8f95463ff5f043e$var$css(target, \"transform\", \"translate3d(0,0,0)\");\n typeof target.animated === \"number\" && clearTimeout(target.animated);\n target.animated = setTimeout(function() {\n $c8f95463ff5f043e$var$css(target, \"transition\", \"\");\n $c8f95463ff5f043e$var$css(target, \"transform\", \"\");\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction $c8f95463ff5f043e$var$repaint(target) {\n return target.offsetWidth;\n}\nfunction $c8f95463ff5f043e$var$calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\nvar $c8f95463ff5f043e$var$plugins = [];\nvar $c8f95463ff5f043e$var$defaults = {\n initializeByDefault: true\n};\nvar $c8f95463ff5f043e$var$PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for(var option in $c8f95463ff5f043e$var$defaults)if ($c8f95463ff5f043e$var$defaults.hasOwnProperty(option) && !(option in plugin)) plugin[option] = $c8f95463ff5f043e$var$defaults[option];\n $c8f95463ff5f043e$var$plugins.forEach(function(p) {\n if (p.pluginName === plugin.pluginName) throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n });\n $c8f95463ff5f043e$var$plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function() {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + \"Global\";\n $c8f95463ff5f043e$var$plugins.forEach(function(plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) sortable[plugin.pluginName][eventNameGlobal]($c8f95463ff5f043e$var$_objectSpread2({\n sortable: sortable\n }, evt));\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) sortable[plugin.pluginName][eventName]($c8f95463ff5f043e$var$_objectSpread2({\n sortable: sortable\n }, evt));\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n $c8f95463ff5f043e$var$plugins.forEach(function(plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n // Add default options from plugin\n $c8f95463ff5f043e$var$_extends(defaults, initialized.defaults);\n });\n for(var option in sortable.options){\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== \"undefined\") sortable.options[option] = modified;\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n $c8f95463ff5f043e$var$plugins.forEach(function(plugin) {\n if (typeof plugin.eventProperties !== \"function\") return;\n $c8f95463ff5f043e$var$_extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n $c8f95463ff5f043e$var$plugins.forEach(function(plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === \"function\") modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n });\n return modifiedValue;\n }\n};\nfunction $c8f95463ff5f043e$var$dispatchEvent(_ref) {\n var sortable = _ref.sortable, rootEl = _ref.rootEl, name = _ref.name, targetEl = _ref.targetEl, cloneEl = _ref.cloneEl, toEl = _ref.toEl, fromEl = _ref.fromEl, oldIndex = _ref.oldIndex, newIndex = _ref.newIndex, oldDraggableIndex = _ref.oldDraggableIndex, newDraggableIndex = _ref.newDraggableIndex, originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[$c8f95463ff5f043e$var$expando];\n if (!sortable) return;\n var evt, options = sortable.options, onName = \"on\" + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !$c8f95463ff5f043e$var$IE11OrLess && !$c8f95463ff5f043e$var$Edge) evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n else {\n evt = document.createEvent(\"Event\");\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = $c8f95463ff5f043e$var$_objectSpread2($c8f95463ff5f043e$var$_objectSpread2({}, extraEventProperties), $c8f95463ff5f043e$var$PluginManager.getEventProperties(name, sortable));\n for(var option in allEventProperties)evt[option] = allEventProperties[option];\n if (rootEl) rootEl.dispatchEvent(evt);\n if (options[onName]) options[onName].call(sortable, evt);\n}\nvar $c8f95463ff5f043e$var$_excluded = [\n \"evt\"\n];\nvar $c8f95463ff5f043e$var$pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, originalEvent = _ref.evt, data = $c8f95463ff5f043e$var$_objectWithoutProperties(_ref, $c8f95463ff5f043e$var$_excluded);\n $c8f95463ff5f043e$var$PluginManager.pluginEvent.bind($c8f95463ff5f043e$export$31b3ca70d8f57423)(eventName, sortable, $c8f95463ff5f043e$var$_objectSpread2({\n dragEl: $c8f95463ff5f043e$var$dragEl,\n parentEl: $c8f95463ff5f043e$var$parentEl,\n ghostEl: $c8f95463ff5f043e$var$ghostEl,\n rootEl: $c8f95463ff5f043e$var$rootEl,\n nextEl: $c8f95463ff5f043e$var$nextEl,\n lastDownEl: $c8f95463ff5f043e$var$lastDownEl,\n cloneEl: $c8f95463ff5f043e$var$cloneEl,\n cloneHidden: $c8f95463ff5f043e$var$cloneHidden,\n dragStarted: $c8f95463ff5f043e$var$moved,\n putSortable: $c8f95463ff5f043e$var$putSortable,\n activeSortable: $c8f95463ff5f043e$export$31b3ca70d8f57423.active,\n originalEvent: originalEvent,\n oldIndex: $c8f95463ff5f043e$var$oldIndex,\n oldDraggableIndex: $c8f95463ff5f043e$var$oldDraggableIndex,\n newIndex: $c8f95463ff5f043e$var$newIndex,\n newDraggableIndex: $c8f95463ff5f043e$var$newDraggableIndex,\n hideGhostForTarget: $c8f95463ff5f043e$var$_hideGhostForTarget,\n unhideGhostForTarget: $c8f95463ff5f043e$var$_unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n $c8f95463ff5f043e$var$cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n $c8f95463ff5f043e$var$cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction $c8f95463ff5f043e$var$_dispatchEvent(info) {\n $c8f95463ff5f043e$var$dispatchEvent($c8f95463ff5f043e$var$_objectSpread2({\n putSortable: $c8f95463ff5f043e$var$putSortable,\n cloneEl: $c8f95463ff5f043e$var$cloneEl,\n targetEl: $c8f95463ff5f043e$var$dragEl,\n rootEl: $c8f95463ff5f043e$var$rootEl,\n oldIndex: $c8f95463ff5f043e$var$oldIndex,\n oldDraggableIndex: $c8f95463ff5f043e$var$oldDraggableIndex,\n newIndex: $c8f95463ff5f043e$var$newIndex,\n newDraggableIndex: $c8f95463ff5f043e$var$newDraggableIndex\n }, info));\n}\nvar $c8f95463ff5f043e$var$dragEl, $c8f95463ff5f043e$var$parentEl, $c8f95463ff5f043e$var$ghostEl, $c8f95463ff5f043e$var$rootEl, $c8f95463ff5f043e$var$nextEl, $c8f95463ff5f043e$var$lastDownEl, $c8f95463ff5f043e$var$cloneEl, $c8f95463ff5f043e$var$cloneHidden, $c8f95463ff5f043e$var$oldIndex, $c8f95463ff5f043e$var$newIndex, $c8f95463ff5f043e$var$oldDraggableIndex, $c8f95463ff5f043e$var$newDraggableIndex, $c8f95463ff5f043e$var$activeGroup, $c8f95463ff5f043e$var$putSortable, $c8f95463ff5f043e$var$awaitingDragStarted = false, $c8f95463ff5f043e$var$ignoreNextClick = false, $c8f95463ff5f043e$var$sortables = [], $c8f95463ff5f043e$var$tapEvt, $c8f95463ff5f043e$var$touchEvt, $c8f95463ff5f043e$var$lastDx, $c8f95463ff5f043e$var$lastDy, $c8f95463ff5f043e$var$tapDistanceLeft, $c8f95463ff5f043e$var$tapDistanceTop, $c8f95463ff5f043e$var$moved, $c8f95463ff5f043e$var$lastTarget, $c8f95463ff5f043e$var$lastDirection, $c8f95463ff5f043e$var$pastFirstInvertThresh = false, $c8f95463ff5f043e$var$isCircumstantialInvert = false, $c8f95463ff5f043e$var$targetMoveDistance, // For positioning ghost absolutely\n$c8f95463ff5f043e$var$ghostRelativeParent, $c8f95463ff5f043e$var$ghostRelativeParentInitialScroll = [], // (left, top)\n$c8f95463ff5f043e$var$_silent = false, $c8f95463ff5f043e$var$savedInputChecked = [];\n/** @const */ var $c8f95463ff5f043e$var$documentExists = typeof document !== \"undefined\", $c8f95463ff5f043e$var$PositionGhostAbsolutely = $c8f95463ff5f043e$var$IOS, $c8f95463ff5f043e$var$CSSFloatProperty = $c8f95463ff5f043e$var$Edge || $c8f95463ff5f043e$var$IE11OrLess ? \"cssFloat\" : \"float\", // This will not pass for IE9, because IE9 DnD only works on anchors\n$c8f95463ff5f043e$var$supportDraggable = $c8f95463ff5f043e$var$documentExists && !$c8f95463ff5f043e$var$ChromeForAndroid && !$c8f95463ff5f043e$var$IOS && \"draggable\" in document.createElement(\"div\"), $c8f95463ff5f043e$var$supportCssPointerEvents = function() {\n if (!$c8f95463ff5f043e$var$documentExists) return;\n // false when <= IE11\n if ($c8f95463ff5f043e$var$IE11OrLess) return false;\n var el = document.createElement(\"x\");\n el.style.cssText = \"pointer-events:auto\";\n return el.style.pointerEvents === \"auto\";\n}(), $c8f95463ff5f043e$var$_detectDirection = function _detectDirection(el, options) {\n var elCSS = $c8f95463ff5f043e$var$css(el), elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth), child1 = $c8f95463ff5f043e$var$getChild(el, 0, options), child2 = $c8f95463ff5f043e$var$getChild(el, 1, options), firstChildCSS = child1 && $c8f95463ff5f043e$var$css(child1), secondChildCSS = child2 && $c8f95463ff5f043e$var$css(child2), firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + $c8f95463ff5f043e$var$getRect(child1).width, secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + $c8f95463ff5f043e$var$getRect(child2).width;\n if (elCSS.display === \"flex\") return elCSS.flexDirection === \"column\" || elCSS.flexDirection === \"column-reverse\" ? \"vertical\" : \"horizontal\";\n if (elCSS.display === \"grid\") return elCSS.gridTemplateColumns.split(\" \").length <= 1 ? \"vertical\" : \"horizontal\";\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== \"none\") {\n var touchingSideChild2 = firstChildCSS[\"float\"] === \"left\" ? \"left\" : \"right\";\n return child2 && (secondChildCSS.clear === \"both\" || secondChildCSS.clear === touchingSideChild2) ? \"vertical\" : \"horizontal\";\n }\n return child1 && (firstChildCSS.display === \"block\" || firstChildCSS.display === \"flex\" || firstChildCSS.display === \"table\" || firstChildCSS.display === \"grid\" || firstChildWidth >= elWidth && elCSS[$c8f95463ff5f043e$var$CSSFloatProperty] === \"none\" || child2 && elCSS[$c8f95463ff5f043e$var$CSSFloatProperty] === \"none\" && firstChildWidth + secondChildWidth > elWidth) ? \"vertical\" : \"horizontal\";\n}, $c8f95463ff5f043e$var$_dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top, dragElS2Opp = vertical ? dragRect.right : dragRect.bottom, dragElOppLength = vertical ? dragRect.width : dragRect.height, targetS1Opp = vertical ? targetRect.left : targetRect.top, targetS2Opp = vertical ? targetRect.right : targetRect.bottom, targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n}, /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */ $c8f95463ff5f043e$var$_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n $c8f95463ff5f043e$var$sortables.some(function(sortable) {\n var threshold = sortable[$c8f95463ff5f043e$var$expando].options.emptyInsertThreshold;\n if (!threshold || $c8f95463ff5f043e$var$lastChild(sortable)) return;\n var rect = $c8f95463ff5f043e$var$getRect(sortable), insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) return ret = sortable;\n });\n return ret;\n}, $c8f95463ff5f043e$var$_prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function(to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) // Default pull value\n // Default pull and put value if same group\n return true;\n else if (value == null || value === false) return false;\n else if (pull && value === \"clone\") return value;\n else if (typeof value === \"function\") return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === \"string\" && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || $c8f95463ff5f043e$var$_typeof(originalGroup) != \"object\") originalGroup = {\n name: originalGroup\n };\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n}, $c8f95463ff5f043e$var$_hideGhostForTarget = function _hideGhostForTarget() {\n if (!$c8f95463ff5f043e$var$supportCssPointerEvents && $c8f95463ff5f043e$var$ghostEl) $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"display\", \"none\");\n}, $c8f95463ff5f043e$var$_unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!$c8f95463ff5f043e$var$supportCssPointerEvents && $c8f95463ff5f043e$var$ghostEl) $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"display\", \"\");\n};\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif ($c8f95463ff5f043e$var$documentExists && !$c8f95463ff5f043e$var$ChromeForAndroid) document.addEventListener(\"click\", function(evt) {\n if ($c8f95463ff5f043e$var$ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n $c8f95463ff5f043e$var$ignoreNextClick = false;\n return false;\n }\n}, true);\nvar $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if ($c8f95463ff5f043e$var$dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = $c8f95463ff5f043e$var$_detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for(var i in evt)if (evt.hasOwnProperty(i)) event[i] = evt[i];\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[$c8f95463ff5f043e$var$expando]._onDragOver(event);\n }\n }\n};\nvar $c8f95463ff5f043e$var$_checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if ($c8f95463ff5f043e$var$dragEl) $c8f95463ff5f043e$var$dragEl.parentNode[$c8f95463ff5f043e$var$expando]._isOutsideThisEl(evt.target);\n};\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */ function $c8f95463ff5f043e$export$31b3ca70d8f57423(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) throw \"Sortable: `el` must be an HTMLElement, not \".concat(({}).toString.call(el));\n this.el = el; // root element\n this.options = options = $c8f95463ff5f043e$var$_extends({}, options);\n // Export instance\n el[$c8f95463ff5f043e$var$expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? \">li\" : \">*\",\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return $c8f95463ff5f043e$var$_detectDirection(el, this.options);\n },\n ghostClass: \"sortable-ghost\",\n chosenClass: \"sortable-chosen\",\n dragClass: \"sortable-drag\",\n ignore: \"a, img\",\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData(\"Text\", dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: \"data-id\",\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: \"sortable-fallback\",\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: $c8f95463ff5f043e$export$31b3ca70d8f57423.supportPointer !== false && \"PointerEvent\" in window && !$c8f95463ff5f043e$var$Safari,\n emptyInsertThreshold: 5\n };\n $c8f95463ff5f043e$var$PluginManager.initializePlugins(this, el, defaults);\n // Set default options\n for(var name in defaults)!(name in options) && (options[name] = defaults[name]);\n $c8f95463ff5f043e$var$_prepareGroup(options);\n // Bind all private methods\n for(var fn in this)if (fn.charAt(0) === \"_\" && typeof this[fn] === \"function\") this[fn] = this[fn].bind(this);\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : $c8f95463ff5f043e$var$supportDraggable;\n if (this.nativeDraggable) // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n // Bind events\n if (options.supportPointer) $c8f95463ff5f043e$var$on(el, \"pointerdown\", this._onTapStart);\n else {\n $c8f95463ff5f043e$var$on(el, \"mousedown\", this._onTapStart);\n $c8f95463ff5f043e$var$on(el, \"touchstart\", this._onTapStart);\n }\n if (this.nativeDraggable) {\n $c8f95463ff5f043e$var$on(el, \"dragover\", this);\n $c8f95463ff5f043e$var$on(el, \"dragenter\", this);\n }\n $c8f95463ff5f043e$var$sortables.push(this.el);\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n // Add animation state manager\n $c8f95463ff5f043e$var$_extends(this, $c8f95463ff5f043e$var$AnimationStateManager());\n}\n$c8f95463ff5f043e$export$31b3ca70d8f57423.prototype = /** @lends Sortable.prototype */ {\n constructor: $c8f95463ff5f043e$export$31b3ca70d8f57423,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) $c8f95463ff5f043e$var$lastTarget = null;\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === \"function\" ? this.options.direction.call(this, evt, target, $c8f95463ff5f043e$var$dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(/** Event|TouchEvent */ evt) {\n if (!evt.cancelable) return;\n var _this = this, el = this.el, options = this.options, preventOnFilter = options.preventOnFilter, type = evt.type, touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === \"touch\" && evt, target = (touch || evt).target, originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, filter = options.filter;\n $c8f95463ff5f043e$var$_saveInputCheckedState(el);\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if ($c8f95463ff5f043e$var$dragEl) return;\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) return; // only left button and enabled\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) return;\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && $c8f95463ff5f043e$var$Safari && target && target.tagName.toUpperCase() === \"SELECT\") return;\n target = $c8f95463ff5f043e$var$closest(target, options.draggable, el, false);\n if (target && target.animated) return;\n if ($c8f95463ff5f043e$var$lastDownEl === target) // Ignoring duplicate `down`\n return;\n // Get the index of the dragged element within its parent\n $c8f95463ff5f043e$var$oldIndex = $c8f95463ff5f043e$var$index(target);\n $c8f95463ff5f043e$var$oldDraggableIndex = $c8f95463ff5f043e$var$index(target, options.draggable);\n // Check filter\n if (typeof filter === \"function\") {\n if (filter.call(this, evt, target, this)) {\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: \"filter\",\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n $c8f95463ff5f043e$var$pluginEvent(\"filter\", _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(\",\").some(function(criteria) {\n criteria = $c8f95463ff5f043e$var$closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: \"filter\",\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n $c8f95463ff5f043e$var$pluginEvent(\"filter\", _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !$c8f95463ff5f043e$var$closest(originalTarget, options.handle, el, false)) return;\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(/** Event */ evt, /** Touch */ touch, /** HTMLElement */ target) {\n var _this = this, el = _this.el, options = _this.options, ownerDocument = el.ownerDocument, dragStartFn;\n if (target && !$c8f95463ff5f043e$var$dragEl && target.parentNode === el) {\n var dragRect = $c8f95463ff5f043e$var$getRect(target);\n $c8f95463ff5f043e$var$rootEl = el;\n $c8f95463ff5f043e$var$dragEl = target;\n $c8f95463ff5f043e$var$parentEl = $c8f95463ff5f043e$var$dragEl.parentNode;\n $c8f95463ff5f043e$var$nextEl = $c8f95463ff5f043e$var$dragEl.nextSibling;\n $c8f95463ff5f043e$var$lastDownEl = target;\n $c8f95463ff5f043e$var$activeGroup = options.group;\n $c8f95463ff5f043e$export$31b3ca70d8f57423.dragged = $c8f95463ff5f043e$var$dragEl;\n $c8f95463ff5f043e$var$tapEvt = {\n target: $c8f95463ff5f043e$var$dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n $c8f95463ff5f043e$var$tapDistanceLeft = $c8f95463ff5f043e$var$tapEvt.clientX - dragRect.left;\n $c8f95463ff5f043e$var$tapDistanceTop = $c8f95463ff5f043e$var$tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n $c8f95463ff5f043e$var$dragEl.style[\"will-change\"] = \"all\";\n dragStartFn = function dragStartFn() {\n $c8f95463ff5f043e$var$pluginEvent(\"delayEnded\", _this, {\n evt: evt\n });\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!$c8f95463ff5f043e$var$FireFox && _this.nativeDraggable) $c8f95463ff5f043e$var$dragEl.draggable = true;\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n // Drag start event\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: _this,\n name: \"choose\",\n originalEvent: evt\n });\n // Chosen item\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, options.chosenClass, true);\n };\n // Disable \"draggable\"\n options.ignore.split(\",\").forEach(function(criteria) {\n $c8f95463ff5f043e$var$find($c8f95463ff5f043e$var$dragEl, criteria.trim(), $c8f95463ff5f043e$var$_disableDraggable);\n });\n $c8f95463ff5f043e$var$on(ownerDocument, \"dragover\", $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent);\n $c8f95463ff5f043e$var$on(ownerDocument, \"mousemove\", $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent);\n $c8f95463ff5f043e$var$on(ownerDocument, \"touchmove\", $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent);\n $c8f95463ff5f043e$var$on(ownerDocument, \"mouseup\", _this._onDrop);\n $c8f95463ff5f043e$var$on(ownerDocument, \"touchend\", _this._onDrop);\n $c8f95463ff5f043e$var$on(ownerDocument, \"touchcancel\", _this._onDrop);\n // Make dragEl draggable (must be before delay for FireFox)\n if ($c8f95463ff5f043e$var$FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n $c8f95463ff5f043e$var$dragEl.draggable = true;\n }\n $c8f95463ff5f043e$var$pluginEvent(\"delayStart\", this, {\n evt: evt\n });\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !($c8f95463ff5f043e$var$Edge || $c8f95463ff5f043e$var$IE11OrLess))) {\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n $c8f95463ff5f043e$var$on(ownerDocument, \"mouseup\", _this._disableDelayedDrag);\n $c8f95463ff5f043e$var$on(ownerDocument, \"touchend\", _this._disableDelayedDrag);\n $c8f95463ff5f043e$var$on(ownerDocument, \"touchcancel\", _this._disableDelayedDrag);\n $c8f95463ff5f043e$var$on(ownerDocument, \"mousemove\", _this._delayedDragTouchMoveHandler);\n $c8f95463ff5f043e$var$on(ownerDocument, \"touchmove\", _this._delayedDragTouchMoveHandler);\n options.supportPointer && $c8f95463ff5f043e$var$on(ownerDocument, \"pointermove\", _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else dragStartFn();\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(/** TouchEvent|PointerEvent **/ e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) this._disableDelayedDrag();\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n $c8f95463ff5f043e$var$dragEl && $c8f95463ff5f043e$var$_disableDraggable($c8f95463ff5f043e$var$dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n $c8f95463ff5f043e$var$off(ownerDocument, \"mouseup\", this._disableDelayedDrag);\n $c8f95463ff5f043e$var$off(ownerDocument, \"touchend\", this._disableDelayedDrag);\n $c8f95463ff5f043e$var$off(ownerDocument, \"touchcancel\", this._disableDelayedDrag);\n $c8f95463ff5f043e$var$off(ownerDocument, \"mousemove\", this._delayedDragTouchMoveHandler);\n $c8f95463ff5f043e$var$off(ownerDocument, \"touchmove\", this._delayedDragTouchMoveHandler);\n $c8f95463ff5f043e$var$off(ownerDocument, \"pointermove\", this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(/** Event */ evt, /** Touch */ touch) {\n touch = touch || evt.pointerType == \"touch\" && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) $c8f95463ff5f043e$var$on(document, \"pointermove\", this._onTouchMove);\n else if (touch) $c8f95463ff5f043e$var$on(document, \"touchmove\", this._onTouchMove);\n else $c8f95463ff5f043e$var$on(document, \"mousemove\", this._onTouchMove);\n } else {\n $c8f95463ff5f043e$var$on($c8f95463ff5f043e$var$dragEl, \"dragend\", this);\n $c8f95463ff5f043e$var$on($c8f95463ff5f043e$var$rootEl, \"dragstart\", this._onDragStart);\n }\n try {\n if (document.selection) // Timeout neccessary for IE9\n $c8f95463ff5f043e$var$_nextTick(function() {\n document.selection.empty();\n });\n else window.getSelection().removeAllRanges();\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n $c8f95463ff5f043e$var$awaitingDragStarted = false;\n if ($c8f95463ff5f043e$var$rootEl && $c8f95463ff5f043e$var$dragEl) {\n $c8f95463ff5f043e$var$pluginEvent(\"dragStarted\", this, {\n evt: evt\n });\n if (this.nativeDraggable) $c8f95463ff5f043e$var$on(document, \"dragover\", $c8f95463ff5f043e$var$_checkOutsideTargetEl);\n var options = this.options;\n // Apply effect\n !fallback && $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, options.dragClass, false);\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, options.ghostClass, true);\n $c8f95463ff5f043e$export$31b3ca70d8f57423.active = this;\n fallback && this._appendGhost();\n // Drag start event\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"start\",\n originalEvent: evt\n });\n } else this._nulling();\n },\n _emulateDragOver: function _emulateDragOver() {\n if ($c8f95463ff5f043e$var$touchEvt) {\n this._lastX = $c8f95463ff5f043e$var$touchEvt.clientX;\n this._lastY = $c8f95463ff5f043e$var$touchEvt.clientY;\n $c8f95463ff5f043e$var$_hideGhostForTarget();\n var target = document.elementFromPoint($c8f95463ff5f043e$var$touchEvt.clientX, $c8f95463ff5f043e$var$touchEvt.clientY);\n var parent = target;\n while(target && target.shadowRoot){\n target = target.shadowRoot.elementFromPoint($c8f95463ff5f043e$var$touchEvt.clientX, $c8f95463ff5f043e$var$touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n $c8f95463ff5f043e$var$dragEl.parentNode[$c8f95463ff5f043e$var$expando]._isOutsideThisEl(target);\n if (parent) do {\n if (parent[$c8f95463ff5f043e$var$expando]) {\n var inserted = void 0;\n inserted = parent[$c8f95463ff5f043e$var$expando]._onDragOver({\n clientX: $c8f95463ff5f043e$var$touchEvt.clientX,\n clientY: $c8f95463ff5f043e$var$touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) break;\n }\n target = parent; // store last element\n }while (parent = parent.parentNode);\n $c8f95463ff5f043e$var$_unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(/**TouchEvent*/ evt) {\n if ($c8f95463ff5f043e$var$tapEvt) {\n var options = this.options, fallbackTolerance = options.fallbackTolerance, fallbackOffset = options.fallbackOffset, touch = evt.touches ? evt.touches[0] : evt, ghostMatrix = $c8f95463ff5f043e$var$ghostEl && $c8f95463ff5f043e$var$matrix($c8f95463ff5f043e$var$ghostEl, true), scaleX = $c8f95463ff5f043e$var$ghostEl && ghostMatrix && ghostMatrix.a, scaleY = $c8f95463ff5f043e$var$ghostEl && ghostMatrix && ghostMatrix.d, relativeScrollOffset = $c8f95463ff5f043e$var$PositionGhostAbsolutely && $c8f95463ff5f043e$var$ghostRelativeParent && $c8f95463ff5f043e$var$getRelativeScrollOffset($c8f95463ff5f043e$var$ghostRelativeParent), dx = (touch.clientX - $c8f95463ff5f043e$var$tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - $c8f95463ff5f043e$var$ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1), dy = (touch.clientY - $c8f95463ff5f043e$var$tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - $c8f95463ff5f043e$var$ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n // only set the status to dragging, when we are actually dragging\n if (!$c8f95463ff5f043e$export$31b3ca70d8f57423.active && !$c8f95463ff5f043e$var$awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) return;\n this._onDragStart(evt, true);\n }\n if ($c8f95463ff5f043e$var$ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - ($c8f95463ff5f043e$var$lastDx || 0);\n ghostMatrix.f += dy - ($c8f95463ff5f043e$var$lastDy || 0);\n } else ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"webkitTransform\", cssMatrix);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"mozTransform\", cssMatrix);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"msTransform\", cssMatrix);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"transform\", cssMatrix);\n $c8f95463ff5f043e$var$lastDx = dx;\n $c8f95463ff5f043e$var$lastDy = dy;\n $c8f95463ff5f043e$var$touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!$c8f95463ff5f043e$var$ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : $c8f95463ff5f043e$var$rootEl, rect = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$dragEl, true, $c8f95463ff5f043e$var$PositionGhostAbsolutely, true, container), options = this.options;\n // Position absolutely\n if ($c8f95463ff5f043e$var$PositionGhostAbsolutely) {\n // Get relatively positioned parent\n $c8f95463ff5f043e$var$ghostRelativeParent = container;\n while($c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostRelativeParent, \"position\") === \"static\" && $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostRelativeParent, \"transform\") === \"none\" && $c8f95463ff5f043e$var$ghostRelativeParent !== document)$c8f95463ff5f043e$var$ghostRelativeParent = $c8f95463ff5f043e$var$ghostRelativeParent.parentNode;\n if ($c8f95463ff5f043e$var$ghostRelativeParent !== document.body && $c8f95463ff5f043e$var$ghostRelativeParent !== document.documentElement) {\n if ($c8f95463ff5f043e$var$ghostRelativeParent === document) $c8f95463ff5f043e$var$ghostRelativeParent = $c8f95463ff5f043e$var$getWindowScrollingElement();\n rect.top += $c8f95463ff5f043e$var$ghostRelativeParent.scrollTop;\n rect.left += $c8f95463ff5f043e$var$ghostRelativeParent.scrollLeft;\n } else $c8f95463ff5f043e$var$ghostRelativeParent = $c8f95463ff5f043e$var$getWindowScrollingElement();\n $c8f95463ff5f043e$var$ghostRelativeParentInitialScroll = $c8f95463ff5f043e$var$getRelativeScrollOffset($c8f95463ff5f043e$var$ghostRelativeParent);\n }\n $c8f95463ff5f043e$var$ghostEl = $c8f95463ff5f043e$var$dragEl.cloneNode(true);\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$ghostEl, options.ghostClass, false);\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$ghostEl, options.fallbackClass, true);\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$ghostEl, options.dragClass, true);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"transition\", \"\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"transform\", \"\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"box-sizing\", \"border-box\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"margin\", 0);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"top\", rect.top);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"left\", rect.left);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"width\", rect.width);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"height\", rect.height);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"opacity\", \"0.8\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"position\", $c8f95463ff5f043e$var$PositionGhostAbsolutely ? \"absolute\" : \"fixed\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"zIndex\", \"100000\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"pointerEvents\", \"none\");\n $c8f95463ff5f043e$export$31b3ca70d8f57423.ghost = $c8f95463ff5f043e$var$ghostEl;\n container.appendChild($c8f95463ff5f043e$var$ghostEl);\n // Set transform-origin\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$ghostEl, \"transform-origin\", $c8f95463ff5f043e$var$tapDistanceLeft / parseInt($c8f95463ff5f043e$var$ghostEl.style.width) * 100 + \"% \" + $c8f95463ff5f043e$var$tapDistanceTop / parseInt($c8f95463ff5f043e$var$ghostEl.style.height) * 100 + \"%\");\n }\n },\n _onDragStart: function _onDragStart(/**Event*/ evt, /**boolean*/ fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n $c8f95463ff5f043e$var$pluginEvent(\"dragStart\", this, {\n evt: evt\n });\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) {\n this._onDrop();\n return;\n }\n $c8f95463ff5f043e$var$pluginEvent(\"setupClone\", this);\n if (!$c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) {\n $c8f95463ff5f043e$var$cloneEl = $c8f95463ff5f043e$var$clone($c8f95463ff5f043e$var$dragEl);\n $c8f95463ff5f043e$var$cloneEl.removeAttribute(\"id\");\n $c8f95463ff5f043e$var$cloneEl.draggable = false;\n $c8f95463ff5f043e$var$cloneEl.style[\"will-change\"] = \"\";\n this._hideClone();\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$cloneEl, this.options.chosenClass, false);\n $c8f95463ff5f043e$export$31b3ca70d8f57423.clone = $c8f95463ff5f043e$var$cloneEl;\n }\n // #1143: IFrame support workaround\n _this.cloneId = $c8f95463ff5f043e$var$_nextTick(function() {\n $c8f95463ff5f043e$var$pluginEvent(\"clone\", _this);\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) $c8f95463ff5f043e$var$rootEl.insertBefore($c8f95463ff5f043e$var$cloneEl, $c8f95463ff5f043e$var$dragEl);\n _this._hideClone();\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: _this,\n name: \"clone\"\n });\n });\n !fallback && $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, options.dragClass, true);\n // Set proper drop events\n if (fallback) {\n $c8f95463ff5f043e$var$ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n $c8f95463ff5f043e$var$off(document, \"mouseup\", _this._onDrop);\n $c8f95463ff5f043e$var$off(document, \"touchend\", _this._onDrop);\n $c8f95463ff5f043e$var$off(document, \"touchcancel\", _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = \"move\";\n options.setData && options.setData.call(_this, dataTransfer, $c8f95463ff5f043e$var$dragEl);\n }\n $c8f95463ff5f043e$var$on(document, \"drop\", _this);\n // #1276 fix:\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$dragEl, \"transform\", \"translateZ(0)\");\n }\n $c8f95463ff5f043e$var$awaitingDragStarted = true;\n _this._dragStartId = $c8f95463ff5f043e$var$_nextTick(_this._dragStarted.bind(_this, fallback, evt));\n $c8f95463ff5f043e$var$on(document, \"selectstart\", _this);\n $c8f95463ff5f043e$var$moved = true;\n if ($c8f95463ff5f043e$var$Safari) $c8f95463ff5f043e$var$css(document.body, \"user-select\", \"none\");\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(/**Event*/ evt) {\n var el = this.el, target = evt.target, dragRect, targetRect, revert, options = this.options, group = options.group, activeSortable = $c8f95463ff5f043e$export$31b3ca70d8f57423.active, isOwner = $c8f95463ff5f043e$var$activeGroup === group, canSort = options.sort, fromSortable = $c8f95463ff5f043e$var$putSortable || activeSortable, vertical, _this = this, completedFired = false;\n if ($c8f95463ff5f043e$var$_silent) return;\n function dragOverEvent(name, extra) {\n $c8f95463ff5f043e$var$pluginEvent(name, _this, $c8f95463ff5f043e$var$_objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? \"vertical\" : \"horizontal\",\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return $c8f95463ff5f043e$var$_onMove($c8f95463ff5f043e$var$rootEl, el, $c8f95463ff5f043e$var$dragEl, dragRect, target, $c8f95463ff5f043e$var$getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n // Capture animation state\n function capture() {\n dragOverEvent(\"dragOverAnimationCapture\");\n _this.captureAnimationState();\n if (_this !== fromSortable) fromSortable.captureAnimationState();\n }\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent(\"dragOverCompleted\", {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) activeSortable._hideClone();\n else activeSortable._showClone(_this);\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, $c8f95463ff5f043e$var$putSortable ? $c8f95463ff5f043e$var$putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, options.ghostClass, true);\n }\n if ($c8f95463ff5f043e$var$putSortable !== _this && _this !== $c8f95463ff5f043e$export$31b3ca70d8f57423.active) $c8f95463ff5f043e$var$putSortable = _this;\n else if (_this === $c8f95463ff5f043e$export$31b3ca70d8f57423.active && $c8f95463ff5f043e$var$putSortable) $c8f95463ff5f043e$var$putSortable = null;\n // Animation\n if (fromSortable === _this) _this._ignoreWhileAnimating = target;\n _this.animateAll(function() {\n dragOverEvent(\"dragOverAnimationComplete\");\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n // Null lastTarget if it is not inside a previously swapped element\n if (target === $c8f95463ff5f043e$var$dragEl && !$c8f95463ff5f043e$var$dragEl.animated || target === el && !target.animated) $c8f95463ff5f043e$var$lastTarget = null;\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n $c8f95463ff5f043e$var$dragEl.parentNode[$c8f95463ff5f043e$var$expando]._isOutsideThisEl(evt.target);\n // Do not detect for empty insert if already inserted\n !insertion && $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n // Call when dragEl has been inserted\n function changed() {\n $c8f95463ff5f043e$var$newIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl);\n $c8f95463ff5f043e$var$newDraggableIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl, options.draggable);\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: _this,\n name: \"change\",\n toEl: el,\n newIndex: $c8f95463ff5f043e$var$newIndex,\n newDraggableIndex: $c8f95463ff5f043e$var$newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) evt.cancelable && evt.preventDefault();\n target = $c8f95463ff5f043e$var$closest(target, options.draggable, el, true);\n dragOverEvent(\"dragOver\");\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) return completedFired;\n if ($c8f95463ff5f043e$var$dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) return completed(false);\n $c8f95463ff5f043e$var$ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = $c8f95463ff5f043e$var$parentEl !== $c8f95463ff5f043e$var$rootEl // Reverting item into the original list\n ) : $c8f95463ff5f043e$var$putSortable === this || (this.lastPutMode = $c8f95463ff5f043e$var$activeGroup.checkPull(this, activeSortable, $c8f95463ff5f043e$var$dragEl, evt)) && group.checkPut(this, activeSortable, $c8f95463ff5f043e$var$dragEl, evt))) {\n vertical = this._getDirection(evt, target) === \"vertical\";\n dragRect = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$dragEl);\n dragOverEvent(\"dragOverValid\");\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) return completedFired;\n if (revert) {\n $c8f95463ff5f043e$var$parentEl = $c8f95463ff5f043e$var$rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent(\"revert\");\n if (!$c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) {\n if ($c8f95463ff5f043e$var$nextEl) $c8f95463ff5f043e$var$rootEl.insertBefore($c8f95463ff5f043e$var$dragEl, $c8f95463ff5f043e$var$nextEl);\n else $c8f95463ff5f043e$var$rootEl.appendChild($c8f95463ff5f043e$var$dragEl);\n }\n return completed(true);\n }\n var elLastChild = $c8f95463ff5f043e$var$lastChild(el, options.draggable);\n if (!elLastChild || $c8f95463ff5f043e$var$_ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n // If already at end of list: Do not insert\n if (elLastChild === $c8f95463ff5f043e$var$dragEl) return completed(false);\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) target = elLastChild;\n if (target) targetRect = $c8f95463ff5f043e$var$getRect(target);\n if ($c8f95463ff5f043e$var$_onMove($c8f95463ff5f043e$var$rootEl, el, $c8f95463ff5f043e$var$dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) // the last draggable element is not the last node\n el.insertBefore($c8f95463ff5f043e$var$dragEl, elLastChild.nextSibling);\n else el.appendChild($c8f95463ff5f043e$var$dragEl);\n $c8f95463ff5f043e$var$parentEl = el; // actualization\n changed();\n return completed(true);\n }\n } else if (elLastChild && $c8f95463ff5f043e$var$_ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = $c8f95463ff5f043e$var$getChild(el, 0, options, true);\n if (firstChild === $c8f95463ff5f043e$var$dragEl) return completed(false);\n target = firstChild;\n targetRect = $c8f95463ff5f043e$var$getRect(target);\n if ($c8f95463ff5f043e$var$_onMove($c8f95463ff5f043e$var$rootEl, el, $c8f95463ff5f043e$var$dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore($c8f95463ff5f043e$var$dragEl, firstChild);\n $c8f95463ff5f043e$var$parentEl = el; // actualization\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = $c8f95463ff5f043e$var$getRect(target);\n var direction = 0, targetBeforeFirstSwap, differentLevel = $c8f95463ff5f043e$var$dragEl.parentNode !== el, differentRowCol = !$c8f95463ff5f043e$var$_dragElInRowColumn($c8f95463ff5f043e$var$dragEl.animated && $c8f95463ff5f043e$var$dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical), side1 = vertical ? \"top\" : \"left\", scrolledPastTop = $c8f95463ff5f043e$var$isScrolledPast(target, \"top\", \"top\") || $c8f95463ff5f043e$var$isScrolledPast($c8f95463ff5f043e$var$dragEl, \"top\", \"top\"), scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if ($c8f95463ff5f043e$var$lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n $c8f95463ff5f043e$var$pastFirstInvertThresh = false;\n $c8f95463ff5f043e$var$isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = $c8f95463ff5f043e$var$_getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, $c8f95463ff5f043e$var$isCircumstantialInvert, $c8f95463ff5f043e$var$lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl);\n do {\n dragIndex -= direction;\n sibling = $c8f95463ff5f043e$var$parentEl.children[dragIndex];\n }while (sibling && ($c8f95463ff5f043e$var$css(sibling, \"display\") === \"none\" || sibling === $c8f95463ff5f043e$var$ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) return completed(false);\n $c8f95463ff5f043e$var$lastTarget = target;\n $c8f95463ff5f043e$var$lastDirection = direction;\n var nextSibling = target.nextElementSibling, after = false;\n after = direction === 1;\n var moveVector = $c8f95463ff5f043e$var$_onMove($c8f95463ff5f043e$var$rootEl, el, $c8f95463ff5f043e$var$dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) after = moveVector === 1;\n $c8f95463ff5f043e$var$_silent = true;\n setTimeout($c8f95463ff5f043e$var$_unsilent, 30);\n capture();\n if (after && !nextSibling) el.appendChild($c8f95463ff5f043e$var$dragEl);\n else target.parentNode.insertBefore($c8f95463ff5f043e$var$dragEl, after ? nextSibling : target);\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) $c8f95463ff5f043e$var$scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n $c8f95463ff5f043e$var$parentEl = $c8f95463ff5f043e$var$dragEl.parentNode; // actualization\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !$c8f95463ff5f043e$var$isCircumstantialInvert) $c8f95463ff5f043e$var$targetMoveDistance = Math.abs(targetBeforeFirstSwap - $c8f95463ff5f043e$var$getRect(target)[side1]);\n changed();\n return completed(true);\n }\n }\n if (el.contains($c8f95463ff5f043e$var$dragEl)) return completed(false);\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n $c8f95463ff5f043e$var$off(document, \"mousemove\", this._onTouchMove);\n $c8f95463ff5f043e$var$off(document, \"touchmove\", this._onTouchMove);\n $c8f95463ff5f043e$var$off(document, \"pointermove\", this._onTouchMove);\n $c8f95463ff5f043e$var$off(document, \"dragover\", $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent);\n $c8f95463ff5f043e$var$off(document, \"mousemove\", $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent);\n $c8f95463ff5f043e$var$off(document, \"touchmove\", $c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n $c8f95463ff5f043e$var$off(ownerDocument, \"mouseup\", this._onDrop);\n $c8f95463ff5f043e$var$off(ownerDocument, \"touchend\", this._onDrop);\n $c8f95463ff5f043e$var$off(ownerDocument, \"pointerup\", this._onDrop);\n $c8f95463ff5f043e$var$off(ownerDocument, \"touchcancel\", this._onDrop);\n $c8f95463ff5f043e$var$off(document, \"selectstart\", this);\n },\n _onDrop: function _onDrop(/**Event*/ evt) {\n var el = this.el, options = this.options;\n // Get the index of the dragged element within its parent\n $c8f95463ff5f043e$var$newIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl);\n $c8f95463ff5f043e$var$newDraggableIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl, options.draggable);\n $c8f95463ff5f043e$var$pluginEvent(\"drop\", this, {\n evt: evt\n });\n $c8f95463ff5f043e$var$parentEl = $c8f95463ff5f043e$var$dragEl && $c8f95463ff5f043e$var$dragEl.parentNode;\n // Get again after plugin event\n $c8f95463ff5f043e$var$newIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl);\n $c8f95463ff5f043e$var$newDraggableIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl, options.draggable);\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) {\n this._nulling();\n return;\n }\n $c8f95463ff5f043e$var$awaitingDragStarted = false;\n $c8f95463ff5f043e$var$isCircumstantialInvert = false;\n $c8f95463ff5f043e$var$pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n $c8f95463ff5f043e$var$_cancelNextTick(this.cloneId);\n $c8f95463ff5f043e$var$_cancelNextTick(this._dragStartId);\n // Unbind events\n if (this.nativeDraggable) {\n $c8f95463ff5f043e$var$off(document, \"drop\", this);\n $c8f95463ff5f043e$var$off(el, \"dragstart\", this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if ($c8f95463ff5f043e$var$Safari) $c8f95463ff5f043e$var$css(document.body, \"user-select\", \"\");\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$dragEl, \"transform\", \"\");\n if (evt) {\n if ($c8f95463ff5f043e$var$moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n $c8f95463ff5f043e$var$ghostEl && $c8f95463ff5f043e$var$ghostEl.parentNode && $c8f95463ff5f043e$var$ghostEl.parentNode.removeChild($c8f95463ff5f043e$var$ghostEl);\n if ($c8f95463ff5f043e$var$rootEl === $c8f95463ff5f043e$var$parentEl || $c8f95463ff5f043e$var$putSortable && $c8f95463ff5f043e$var$putSortable.lastPutMode !== \"clone\") // Remove clone(s)\n $c8f95463ff5f043e$var$cloneEl && $c8f95463ff5f043e$var$cloneEl.parentNode && $c8f95463ff5f043e$var$cloneEl.parentNode.removeChild($c8f95463ff5f043e$var$cloneEl);\n if ($c8f95463ff5f043e$var$dragEl) {\n if (this.nativeDraggable) $c8f95463ff5f043e$var$off($c8f95463ff5f043e$var$dragEl, \"dragend\", this);\n $c8f95463ff5f043e$var$_disableDraggable($c8f95463ff5f043e$var$dragEl);\n $c8f95463ff5f043e$var$dragEl.style[\"will-change\"] = \"\";\n // Remove classes\n // ghostClass is added in dragStarted\n if ($c8f95463ff5f043e$var$moved && !$c8f95463ff5f043e$var$awaitingDragStarted) $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, $c8f95463ff5f043e$var$putSortable ? $c8f95463ff5f043e$var$putSortable.options.ghostClass : this.options.ghostClass, false);\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl, this.options.chosenClass, false);\n // Drag stop event\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"unchoose\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if ($c8f95463ff5f043e$var$rootEl !== $c8f95463ff5f043e$var$parentEl) {\n if ($c8f95463ff5f043e$var$newIndex >= 0) {\n // Add event\n $c8f95463ff5f043e$var$_dispatchEvent({\n rootEl: $c8f95463ff5f043e$var$parentEl,\n name: \"add\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n fromEl: $c8f95463ff5f043e$var$rootEl,\n originalEvent: evt\n });\n // Remove event\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"remove\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n originalEvent: evt\n });\n // drag from one list and drop into another\n $c8f95463ff5f043e$var$_dispatchEvent({\n rootEl: $c8f95463ff5f043e$var$parentEl,\n name: \"sort\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n fromEl: $c8f95463ff5f043e$var$rootEl,\n originalEvent: evt\n });\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"sort\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n originalEvent: evt\n });\n }\n $c8f95463ff5f043e$var$putSortable && $c8f95463ff5f043e$var$putSortable.save();\n } else {\n if ($c8f95463ff5f043e$var$newIndex !== $c8f95463ff5f043e$var$oldIndex) {\n if ($c8f95463ff5f043e$var$newIndex >= 0) {\n // drag & drop within the same list\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"update\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n originalEvent: evt\n });\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"sort\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.active) {\n /* jshint eqnull:true */ if ($c8f95463ff5f043e$var$newIndex == null || $c8f95463ff5f043e$var$newIndex === -1) {\n $c8f95463ff5f043e$var$newIndex = $c8f95463ff5f043e$var$oldIndex;\n $c8f95463ff5f043e$var$newDraggableIndex = $c8f95463ff5f043e$var$oldDraggableIndex;\n }\n $c8f95463ff5f043e$var$_dispatchEvent({\n sortable: this,\n name: \"end\",\n toEl: $c8f95463ff5f043e$var$parentEl,\n originalEvent: evt\n });\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n $c8f95463ff5f043e$var$pluginEvent(\"nulling\", this);\n $c8f95463ff5f043e$var$rootEl = $c8f95463ff5f043e$var$dragEl = $c8f95463ff5f043e$var$parentEl = $c8f95463ff5f043e$var$ghostEl = $c8f95463ff5f043e$var$nextEl = $c8f95463ff5f043e$var$cloneEl = $c8f95463ff5f043e$var$lastDownEl = $c8f95463ff5f043e$var$cloneHidden = $c8f95463ff5f043e$var$tapEvt = $c8f95463ff5f043e$var$touchEvt = $c8f95463ff5f043e$var$moved = $c8f95463ff5f043e$var$newIndex = $c8f95463ff5f043e$var$newDraggableIndex = $c8f95463ff5f043e$var$oldIndex = $c8f95463ff5f043e$var$oldDraggableIndex = $c8f95463ff5f043e$var$lastTarget = $c8f95463ff5f043e$var$lastDirection = $c8f95463ff5f043e$var$putSortable = $c8f95463ff5f043e$var$activeGroup = $c8f95463ff5f043e$export$31b3ca70d8f57423.dragged = $c8f95463ff5f043e$export$31b3ca70d8f57423.ghost = $c8f95463ff5f043e$export$31b3ca70d8f57423.clone = $c8f95463ff5f043e$export$31b3ca70d8f57423.active = null;\n $c8f95463ff5f043e$var$savedInputChecked.forEach(function(el) {\n el.checked = true;\n });\n $c8f95463ff5f043e$var$savedInputChecked.length = $c8f95463ff5f043e$var$lastDx = $c8f95463ff5f043e$var$lastDy = 0;\n },\n handleEvent: function handleEvent(/**Event*/ evt) {\n switch(evt.type){\n case \"drop\":\n case \"dragend\":\n this._onDrop(evt);\n break;\n case \"dragenter\":\n case \"dragover\":\n if ($c8f95463ff5f043e$var$dragEl) {\n this._onDragOver(evt);\n $c8f95463ff5f043e$var$_globalDragOver(evt);\n }\n break;\n case \"selectstart\":\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */ toArray: function toArray() {\n var order = [], el, children = this.el.children, i = 0, n = children.length, options = this.options;\n for(; i < n; i++){\n el = children[i];\n if ($c8f95463ff5f043e$var$closest(el, options.draggable, this.el, false)) order.push(el.getAttribute(options.dataIdAttr) || $c8f95463ff5f043e$var$_generateId(el));\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */ sort: function sort(order, useAnimation) {\n var items = {}, rootEl = this.el;\n this.toArray().forEach(function(id, i) {\n var el = rootEl.children[i];\n if ($c8f95463ff5f043e$var$closest(el, this.options.draggable, rootEl, false)) items[id] = el;\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function(id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */ save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */ closest: function closest$1(el, selector) {\n return $c8f95463ff5f043e$var$closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */ option: function option(name, value) {\n var options = this.options;\n if (value === void 0) return options[name];\n else {\n var modifiedValue = $c8f95463ff5f043e$var$PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== \"undefined\") options[name] = modifiedValue;\n else options[name] = value;\n if (name === \"group\") $c8f95463ff5f043e$var$_prepareGroup(options);\n }\n },\n /**\r\n * Destroy\r\n */ destroy: function destroy() {\n $c8f95463ff5f043e$var$pluginEvent(\"destroy\", this);\n var el = this.el;\n el[$c8f95463ff5f043e$var$expando] = null;\n $c8f95463ff5f043e$var$off(el, \"mousedown\", this._onTapStart);\n $c8f95463ff5f043e$var$off(el, \"touchstart\", this._onTapStart);\n $c8f95463ff5f043e$var$off(el, \"pointerdown\", this._onTapStart);\n if (this.nativeDraggable) {\n $c8f95463ff5f043e$var$off(el, \"dragover\", this);\n $c8f95463ff5f043e$var$off(el, \"dragenter\", this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll(\"[draggable]\"), function(el) {\n el.removeAttribute(\"draggable\");\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n $c8f95463ff5f043e$var$sortables.splice($c8f95463ff5f043e$var$sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!$c8f95463ff5f043e$var$cloneHidden) {\n $c8f95463ff5f043e$var$pluginEvent(\"hideClone\", this);\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) return;\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$cloneEl, \"display\", \"none\");\n if (this.options.removeCloneOnHide && $c8f95463ff5f043e$var$cloneEl.parentNode) $c8f95463ff5f043e$var$cloneEl.parentNode.removeChild($c8f95463ff5f043e$var$cloneEl);\n $c8f95463ff5f043e$var$cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== \"clone\") {\n this._hideClone();\n return;\n }\n if ($c8f95463ff5f043e$var$cloneHidden) {\n $c8f95463ff5f043e$var$pluginEvent(\"showClone\", this);\n if ($c8f95463ff5f043e$export$31b3ca70d8f57423.eventCanceled) return;\n // show clone at dragEl or original position\n if ($c8f95463ff5f043e$var$dragEl.parentNode == $c8f95463ff5f043e$var$rootEl && !this.options.group.revertClone) $c8f95463ff5f043e$var$rootEl.insertBefore($c8f95463ff5f043e$var$cloneEl, $c8f95463ff5f043e$var$dragEl);\n else if ($c8f95463ff5f043e$var$nextEl) $c8f95463ff5f043e$var$rootEl.insertBefore($c8f95463ff5f043e$var$cloneEl, $c8f95463ff5f043e$var$nextEl);\n else $c8f95463ff5f043e$var$rootEl.appendChild($c8f95463ff5f043e$var$cloneEl);\n if (this.options.group.revertClone) this.animate($c8f95463ff5f043e$var$dragEl, $c8f95463ff5f043e$var$cloneEl);\n $c8f95463ff5f043e$var$css($c8f95463ff5f043e$var$cloneEl, \"display\", \"\");\n $c8f95463ff5f043e$var$cloneHidden = false;\n }\n }\n};\nfunction $c8f95463ff5f043e$var$_globalDragOver(/**Event*/ evt) {\n if (evt.dataTransfer) evt.dataTransfer.dropEffect = \"move\";\n evt.cancelable && evt.preventDefault();\n}\nfunction $c8f95463ff5f043e$var$_onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt, sortable = fromEl[$c8f95463ff5f043e$var$expando], onMoveFn = sortable.options.onMove, retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !$c8f95463ff5f043e$var$IE11OrLess && !$c8f95463ff5f043e$var$Edge) evt = new CustomEvent(\"move\", {\n bubbles: true,\n cancelable: true\n });\n else {\n evt = document.createEvent(\"Event\");\n evt.initEvent(\"move\", true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || $c8f95463ff5f043e$var$getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) retVal = onMoveFn.call(sortable, evt, originalEvent);\n return retVal;\n}\nfunction $c8f95463ff5f043e$var$_disableDraggable(el) {\n el.draggable = false;\n}\nfunction $c8f95463ff5f043e$var$_unsilent() {\n $c8f95463ff5f043e$var$_silent = false;\n}\nfunction $c8f95463ff5f043e$var$_ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$getChild(sortable.el, 0, sortable.options, true));\n var sortableContentRect = $c8f95463ff5f043e$var$getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX < sortableContentRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < sortableContentRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction $c8f95463ff5f043e$var$_ghostIsLast(evt, vertical, sortable) {\n var lastElRect = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$lastChild(sortable.el, sortable.options.draggable));\n var sortableContentRect = $c8f95463ff5f043e$var$getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX > sortableContentRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > sortableContentRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction $c8f95463ff5f043e$var$_getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX, targetLength = vertical ? targetRect.height : targetRect.width, targetS1 = vertical ? targetRect.top : targetRect.left, targetS2 = vertical ? targetRect.bottom : targetRect.right, invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && $c8f95463ff5f043e$var$targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!$c8f95463ff5f043e$var$pastFirstInvertThresh && ($c8f95463ff5f043e$var$lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n $c8f95463ff5f043e$var$pastFirstInvertThresh = true;\n if (!$c8f95463ff5f043e$var$pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if ($c8f95463ff5f043e$var$lastDirection === 1 ? mouseOnAxis < targetS1 + $c8f95463ff5f043e$var$targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - $c8f95463ff5f043e$var$targetMoveDistance) return -$c8f95463ff5f043e$var$lastDirection;\n } else invert = true;\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) return $c8f95463ff5f043e$var$_getInsertDirection(target);\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n return 0;\n}\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */ function $c8f95463ff5f043e$var$_getInsertDirection(target) {\n if ($c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl) < $c8f95463ff5f043e$var$index(target)) return 1;\n else return -1;\n}\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */ function $c8f95463ff5f043e$var$_generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent, i = str.length, sum = 0;\n while(i--)sum += str.charCodeAt(i);\n return sum.toString(36);\n}\nfunction $c8f95463ff5f043e$var$_saveInputCheckedState(root) {\n $c8f95463ff5f043e$var$savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName(\"input\");\n var idx = inputs.length;\n while(idx--){\n var el = inputs[idx];\n el.checked && $c8f95463ff5f043e$var$savedInputChecked.push(el);\n }\n}\nfunction $c8f95463ff5f043e$var$_nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction $c8f95463ff5f043e$var$_cancelNextTick(id) {\n return clearTimeout(id);\n}\n// Fixed #973:\nif ($c8f95463ff5f043e$var$documentExists) $c8f95463ff5f043e$var$on(document, \"touchmove\", function(evt) {\n if (($c8f95463ff5f043e$export$31b3ca70d8f57423.active || $c8f95463ff5f043e$var$awaitingDragStarted) && evt.cancelable) evt.preventDefault();\n});\n// Export utils\n$c8f95463ff5f043e$export$31b3ca70d8f57423.utils = {\n on: $c8f95463ff5f043e$var$on,\n off: $c8f95463ff5f043e$var$off,\n css: $c8f95463ff5f043e$var$css,\n find: $c8f95463ff5f043e$var$find,\n is: function is(el, selector) {\n return !!$c8f95463ff5f043e$var$closest(el, selector, el, false);\n },\n extend: $c8f95463ff5f043e$var$extend,\n throttle: $c8f95463ff5f043e$var$throttle,\n closest: $c8f95463ff5f043e$var$closest,\n toggleClass: $c8f95463ff5f043e$var$toggleClass,\n clone: $c8f95463ff5f043e$var$clone,\n index: $c8f95463ff5f043e$var$index,\n nextTick: $c8f95463ff5f043e$var$_nextTick,\n cancelNextTick: $c8f95463ff5f043e$var$_cancelNextTick,\n detectDirection: $c8f95463ff5f043e$var$_detectDirection,\n getChild: $c8f95463ff5f043e$var$getChild\n};\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */ $c8f95463ff5f043e$export$31b3ca70d8f57423.get = function(element) {\n return element[$c8f95463ff5f043e$var$expando];\n};\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */ $c8f95463ff5f043e$export$31b3ca70d8f57423.mount = function() {\n for(var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++)plugins[_key] = arguments[_key];\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function(plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) throw \"Sortable: Mounted plugin must be a constructor function, not \".concat(({}).toString.call(plugin));\n if (plugin.utils) $c8f95463ff5f043e$export$31b3ca70d8f57423.utils = $c8f95463ff5f043e$var$_objectSpread2($c8f95463ff5f043e$var$_objectSpread2({}, $c8f95463ff5f043e$export$31b3ca70d8f57423.utils), plugin.utils);\n $c8f95463ff5f043e$var$PluginManager.mount(plugin);\n });\n};\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */ $c8f95463ff5f043e$export$31b3ca70d8f57423.create = function(el, options) {\n return new $c8f95463ff5f043e$export$31b3ca70d8f57423(el, options);\n};\n// Export\n$c8f95463ff5f043e$export$31b3ca70d8f57423.version = $c8f95463ff5f043e$var$version;\nvar $c8f95463ff5f043e$var$autoScrolls = [], $c8f95463ff5f043e$var$scrollEl, $c8f95463ff5f043e$var$scrollRootEl, $c8f95463ff5f043e$var$scrolling = false, $c8f95463ff5f043e$var$lastAutoScrollX, $c8f95463ff5f043e$var$lastAutoScrollY, $c8f95463ff5f043e$var$touchEvt$1, $c8f95463ff5f043e$var$pointerElemChangedInterval;\nfunction $c8f95463ff5f043e$var$AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n // Bind all private methods\n for(var fn in this)if (fn.charAt(0) === \"_\" && typeof this[fn] === \"function\") this[fn] = this[fn].bind(this);\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) $c8f95463ff5f043e$var$on(document, \"dragover\", this._handleAutoScroll);\n else {\n if (this.options.supportPointer) $c8f95463ff5f043e$var$on(document, \"pointermove\", this._handleFallbackAutoScroll);\n else if (originalEvent.touches) $c8f95463ff5f043e$var$on(document, \"touchmove\", this._handleFallbackAutoScroll);\n else $c8f95463ff5f043e$var$on(document, \"mousemove\", this._handleFallbackAutoScroll);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) this._handleAutoScroll(originalEvent);\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) $c8f95463ff5f043e$var$off(document, \"dragover\", this._handleAutoScroll);\n else {\n $c8f95463ff5f043e$var$off(document, \"pointermove\", this._handleFallbackAutoScroll);\n $c8f95463ff5f043e$var$off(document, \"touchmove\", this._handleFallbackAutoScroll);\n $c8f95463ff5f043e$var$off(document, \"mousemove\", this._handleFallbackAutoScroll);\n }\n $c8f95463ff5f043e$var$clearPointerElemChangedInterval();\n $c8f95463ff5f043e$var$clearAutoScrolls();\n $c8f95463ff5f043e$var$cancelThrottle();\n },\n nulling: function nulling() {\n $c8f95463ff5f043e$var$touchEvt$1 = $c8f95463ff5f043e$var$scrollRootEl = $c8f95463ff5f043e$var$scrollEl = $c8f95463ff5f043e$var$scrolling = $c8f95463ff5f043e$var$pointerElemChangedInterval = $c8f95463ff5f043e$var$lastAutoScrollX = $c8f95463ff5f043e$var$lastAutoScrollY = null;\n $c8f95463ff5f043e$var$autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, elem = document.elementFromPoint(x, y);\n $c8f95463ff5f043e$var$touchEvt$1 = evt;\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || $c8f95463ff5f043e$var$Edge || $c8f95463ff5f043e$var$IE11OrLess || $c8f95463ff5f043e$var$Safari) {\n $c8f95463ff5f043e$var$autoScroll(evt, this.options, elem, fallback);\n // Listener for pointer element change\n var ogElemScroller = $c8f95463ff5f043e$var$getParentAutoScrollElement(elem, true);\n if ($c8f95463ff5f043e$var$scrolling && (!$c8f95463ff5f043e$var$pointerElemChangedInterval || x !== $c8f95463ff5f043e$var$lastAutoScrollX || y !== $c8f95463ff5f043e$var$lastAutoScrollY)) {\n $c8f95463ff5f043e$var$pointerElemChangedInterval && $c8f95463ff5f043e$var$clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n $c8f95463ff5f043e$var$pointerElemChangedInterval = setInterval(function() {\n var newElem = $c8f95463ff5f043e$var$getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n $c8f95463ff5f043e$var$clearAutoScrolls();\n }\n $c8f95463ff5f043e$var$autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n $c8f95463ff5f043e$var$lastAutoScrollX = x;\n $c8f95463ff5f043e$var$lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || $c8f95463ff5f043e$var$getParentAutoScrollElement(elem, true) === $c8f95463ff5f043e$var$getWindowScrollingElement()) {\n $c8f95463ff5f043e$var$clearAutoScrolls();\n return;\n }\n $c8f95463ff5f043e$var$autoScroll(evt, this.options, $c8f95463ff5f043e$var$getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return $c8f95463ff5f043e$var$_extends(AutoScroll, {\n pluginName: \"scroll\",\n initializeByDefault: true\n });\n}\nfunction $c8f95463ff5f043e$var$clearAutoScrolls() {\n $c8f95463ff5f043e$var$autoScrolls.forEach(function(autoScroll) {\n clearInterval(autoScroll.pid);\n });\n $c8f95463ff5f043e$var$autoScrolls = [];\n}\nfunction $c8f95463ff5f043e$var$clearPointerElemChangedInterval() {\n clearInterval($c8f95463ff5f043e$var$pointerElemChangedInterval);\n}\nvar $c8f95463ff5f043e$var$autoScroll = $c8f95463ff5f043e$var$throttle(function(evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, sens = options.scrollSensitivity, speed = options.scrollSpeed, winScroller = $c8f95463ff5f043e$var$getWindowScrollingElement();\n var scrollThisInstance = false, scrollCustomFn;\n // New scroll root, set scrollEl\n if ($c8f95463ff5f043e$var$scrollRootEl !== rootEl) {\n $c8f95463ff5f043e$var$scrollRootEl = rootEl;\n $c8f95463ff5f043e$var$clearAutoScrolls();\n $c8f95463ff5f043e$var$scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if ($c8f95463ff5f043e$var$scrollEl === true) $c8f95463ff5f043e$var$scrollEl = $c8f95463ff5f043e$var$getParentAutoScrollElement(rootEl, true);\n }\n var layersOut = 0;\n var currentParent = $c8f95463ff5f043e$var$scrollEl;\n do {\n var el = currentParent, rect = $c8f95463ff5f043e$var$getRect(el), top = rect.top, bottom = rect.bottom, left = rect.left, right = rect.right, width = rect.width, height = rect.height, canScrollX = void 0, canScrollY = void 0, scrollWidth = el.scrollWidth, scrollHeight = el.scrollHeight, elCSS = $c8f95463ff5f043e$var$css(el), scrollPosX = el.scrollLeft, scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === \"auto\" || elCSS.overflowX === \"scroll\" || elCSS.overflowX === \"visible\");\n canScrollY = height < scrollHeight && (elCSS.overflowY === \"auto\" || elCSS.overflowY === \"scroll\" || elCSS.overflowY === \"visible\");\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === \"auto\" || elCSS.overflowX === \"scroll\");\n canScrollY = height < scrollHeight && (elCSS.overflowY === \"auto\" || elCSS.overflowY === \"scroll\");\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!$c8f95463ff5f043e$var$autoScrolls[layersOut]) {\n for(var i = 0; i <= layersOut; i++)if (!$c8f95463ff5f043e$var$autoScrolls[i]) $c8f95463ff5f043e$var$autoScrolls[i] = {};\n }\n if ($c8f95463ff5f043e$var$autoScrolls[layersOut].vx != vx || $c8f95463ff5f043e$var$autoScrolls[layersOut].vy != vy || $c8f95463ff5f043e$var$autoScrolls[layersOut].el !== el) {\n $c8f95463ff5f043e$var$autoScrolls[layersOut].el = el;\n $c8f95463ff5f043e$var$autoScrolls[layersOut].vx = vx;\n $c8f95463ff5f043e$var$autoScrolls[layersOut].vy = vy;\n clearInterval($c8f95463ff5f043e$var$autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */ $c8f95463ff5f043e$var$autoScrolls[layersOut].pid = setInterval((function() {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) $c8f95463ff5f043e$export$31b3ca70d8f57423.active._onTouchMove($c8f95463ff5f043e$var$touchEvt$1); // To move ghost if it is positioned absolutely\n var scrollOffsetY = $c8f95463ff5f043e$var$autoScrolls[this.layer].vy ? $c8f95463ff5f043e$var$autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = $c8f95463ff5f043e$var$autoScrolls[this.layer].vx ? $c8f95463ff5f043e$var$autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === \"function\") {\n if (scrollCustomFn.call($c8f95463ff5f043e$export$31b3ca70d8f57423.dragged.parentNode[$c8f95463ff5f043e$var$expando], scrollOffsetX, scrollOffsetY, evt, $c8f95463ff5f043e$var$touchEvt$1, $c8f95463ff5f043e$var$autoScrolls[this.layer].el) !== \"continue\") return;\n }\n $c8f95463ff5f043e$var$scrollBy($c8f95463ff5f043e$var$autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }).bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n }while (options.bubbleScroll && currentParent !== winScroller && (currentParent = $c8f95463ff5f043e$var$getParentAutoScrollElement(currentParent, false)));\n $c8f95463ff5f043e$var$scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\nvar $c8f95463ff5f043e$var$drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, dragEl = _ref.dragEl, activeSortable = _ref.activeSortable, dispatchSortableEvent = _ref.dispatchSortableEvent, hideGhostForTarget = _ref.hideGhostForTarget, unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent(\"spill\");\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction $c8f95463ff5f043e$var$Revert() {}\n$c8f95463ff5f043e$var$Revert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl, putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) putSortable.captureAnimationState();\n var nextSibling = $c8f95463ff5f043e$var$getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) this.sortable.el.insertBefore(dragEl, nextSibling);\n else this.sortable.el.appendChild(dragEl);\n this.sortable.animateAll();\n if (putSortable) putSortable.animateAll();\n },\n drop: $c8f95463ff5f043e$var$drop\n};\n$c8f95463ff5f043e$var$_extends($c8f95463ff5f043e$var$Revert, {\n pluginName: \"revertOnSpill\"\n});\nfunction $c8f95463ff5f043e$var$Remove() {}\n$c8f95463ff5f043e$var$Remove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl, putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: $c8f95463ff5f043e$var$drop\n};\n$c8f95463ff5f043e$var$_extends($c8f95463ff5f043e$var$Remove, {\n pluginName: \"removeOnSpill\"\n});\nvar $c8f95463ff5f043e$var$lastSwapEl;\nfunction $c8f95463ff5f043e$export$bdb5f0a1b77546f4() {\n function Swap() {\n this.defaults = {\n swapClass: \"sortable-swap-highlight\"\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n $c8f95463ff5f043e$var$lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed, target = _ref2.target, onMove = _ref2.onMove, activeSortable = _ref2.activeSortable, changed = _ref2.changed, cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el, options = this.options;\n if (target && target !== el) {\n var prevSwapEl = $c8f95463ff5f043e$var$lastSwapEl;\n if (onMove(target) !== false) {\n $c8f95463ff5f043e$var$toggleClass(target, options.swapClass, true);\n $c8f95463ff5f043e$var$lastSwapEl = target;\n } else $c8f95463ff5f043e$var$lastSwapEl = null;\n if (prevSwapEl && prevSwapEl !== $c8f95463ff5f043e$var$lastSwapEl) $c8f95463ff5f043e$var$toggleClass(prevSwapEl, options.swapClass, false);\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable, putSortable = _ref3.putSortable, dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n $c8f95463ff5f043e$var$lastSwapEl && $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$lastSwapEl, options.swapClass, false);\n if ($c8f95463ff5f043e$var$lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== $c8f95463ff5f043e$var$lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n $c8f95463ff5f043e$var$swapNodes(dragEl, $c8f95463ff5f043e$var$lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n $c8f95463ff5f043e$var$lastSwapEl = null;\n }\n };\n return $c8f95463ff5f043e$var$_extends(Swap, {\n pluginName: \"swap\",\n eventProperties: function eventProperties() {\n return {\n swapItem: $c8f95463ff5f043e$var$lastSwapEl\n };\n }\n });\n}\nfunction $c8f95463ff5f043e$var$swapNodes(n1, n2) {\n var p1 = n1.parentNode, p2 = n2.parentNode, i1, i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = $c8f95463ff5f043e$var$index(n1);\n i2 = $c8f95463ff5f043e$var$index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) i2++;\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\nvar $c8f95463ff5f043e$var$multiDragElements = [], $c8f95463ff5f043e$var$multiDragClones = [], $c8f95463ff5f043e$var$lastMultiDragSelect, // for selection with modifier key down (SHIFT)\n$c8f95463ff5f043e$var$multiDragSortable, $c8f95463ff5f043e$var$initialFolding = false, // Initial multi-drag fold when drag started\n$c8f95463ff5f043e$var$folding = false, // Folding any other time\n$c8f95463ff5f043e$var$dragStarted = false, $c8f95463ff5f043e$var$dragEl$1, $c8f95463ff5f043e$var$clonesFromRect, $c8f95463ff5f043e$var$clonesHidden;\nfunction $c8f95463ff5f043e$export$18e5d2a5d1df842d() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for(var fn in this)if (fn.charAt(0) === \"_\" && typeof this[fn] === \"function\") this[fn] = this[fn].bind(this);\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) $c8f95463ff5f043e$var$on(document, \"pointerup\", this._deselectMultiDrag);\n else {\n $c8f95463ff5f043e$var$on(document, \"mouseup\", this._deselectMultiDrag);\n $c8f95463ff5f043e$var$on(document, \"touchend\", this._deselectMultiDrag);\n }\n }\n $c8f95463ff5f043e$var$on(document, \"keydown\", this._checkKeyDown);\n $c8f95463ff5f043e$var$on(document, \"keyup\", this._checkKeyUp);\n this.defaults = {\n selectedClass: \"sortable-selected\",\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = \"\";\n if ($c8f95463ff5f043e$var$multiDragElements.length && $c8f95463ff5f043e$var$multiDragSortable === sortable) $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement, i) {\n data += (!i ? \"\" : \", \") + multiDragElement.textContent;\n });\n else data = dragEl.textContent;\n dataTransfer.setData(\"Text\", data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n $c8f95463ff5f043e$var$dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~$c8f95463ff5f043e$var$multiDragElements.indexOf($c8f95463ff5f043e$var$dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable, cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for(var i = 0; i < $c8f95463ff5f043e$var$multiDragElements.length; i++){\n $c8f95463ff5f043e$var$multiDragClones.push($c8f95463ff5f043e$var$clone($c8f95463ff5f043e$var$multiDragElements[i]));\n $c8f95463ff5f043e$var$multiDragClones[i].sortableIndex = $c8f95463ff5f043e$var$multiDragElements[i].sortableIndex;\n $c8f95463ff5f043e$var$multiDragClones[i].draggable = false;\n $c8f95463ff5f043e$var$multiDragClones[i].style[\"will-change\"] = \"\";\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$multiDragClones[i], this.options.selectedClass, false);\n $c8f95463ff5f043e$var$multiDragElements[i] === $c8f95463ff5f043e$var$dragEl$1 && $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable, rootEl = _ref3.rootEl, dispatchSortableEvent = _ref3.dispatchSortableEvent, cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if ($c8f95463ff5f043e$var$multiDragElements.length && $c8f95463ff5f043e$var$multiDragSortable === sortable) {\n $c8f95463ff5f043e$var$insertMultiDragClones(true, rootEl);\n dispatchSortableEvent(\"clone\");\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown, rootEl = _ref4.rootEl, cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n $c8f95463ff5f043e$var$insertMultiDragClones(false, rootEl);\n $c8f95463ff5f043e$var$multiDragClones.forEach(function(clone) {\n $c8f95463ff5f043e$var$css(clone, \"display\", \"\");\n });\n cloneNowShown();\n $c8f95463ff5f043e$var$clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable, cloneNowHidden = _ref5.cloneNowHidden, cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n $c8f95463ff5f043e$var$multiDragClones.forEach(function(clone) {\n $c8f95463ff5f043e$var$css(clone, \"display\", \"none\");\n if (_this.options.removeCloneOnHide && clone.parentNode) clone.parentNode.removeChild(clone);\n });\n cloneNowHidden();\n $c8f95463ff5f043e$var$clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && $c8f95463ff5f043e$var$multiDragSortable) $c8f95463ff5f043e$var$multiDragSortable.multiDrag._deselectMultiDrag();\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n multiDragElement.sortableIndex = $c8f95463ff5f043e$var$index(multiDragElement);\n });\n // Sort multi-drag elements\n $c8f95463ff5f043e$var$multiDragElements = $c8f95463ff5f043e$var$multiDragElements.sort(function(a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n $c8f95463ff5f043e$var$dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n sortable.captureAnimationState();\n if (this.options.animation) {\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $c8f95463ff5f043e$var$dragEl$1) return;\n $c8f95463ff5f043e$var$css(multiDragElement, \"position\", \"absolute\");\n });\n var dragRect = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$dragEl$1, false, true, true);\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $c8f95463ff5f043e$var$dragEl$1) return;\n $c8f95463ff5f043e$var$setRect(multiDragElement, dragRect);\n });\n $c8f95463ff5f043e$var$folding = true;\n $c8f95463ff5f043e$var$initialFolding = true;\n }\n }\n sortable.animateAll(function() {\n $c8f95463ff5f043e$var$folding = false;\n $c8f95463ff5f043e$var$initialFolding = false;\n if (_this2.options.animation) $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n $c8f95463ff5f043e$var$unsetRect(multiDragElement);\n });\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) $c8f95463ff5f043e$var$removeMultiDragElements();\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target, completed = _ref8.completed, cancel = _ref8.cancel;\n if ($c8f95463ff5f043e$var$folding && ~$c8f95463ff5f043e$var$multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable, rootEl = _ref9.rootEl, sortable = _ref9.sortable, dragRect = _ref9.dragRect;\n if ($c8f95463ff5f043e$var$multiDragElements.length > 1) {\n // Setup unfold animation\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: $c8f95463ff5f043e$var$folding ? $c8f95463ff5f043e$var$getRect(multiDragElement) : dragRect\n });\n $c8f95463ff5f043e$var$unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n $c8f95463ff5f043e$var$folding = false;\n $c8f95463ff5f043e$var$insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable, isOwner = _ref10.isOwner, insertion = _ref10.insertion, activeSortable = _ref10.activeSortable, parentEl = _ref10.parentEl, putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) activeSortable._hideClone();\n $c8f95463ff5f043e$var$initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && $c8f95463ff5f043e$var$multiDragElements.length > 1 && ($c8f95463ff5f043e$var$folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$dragEl$1, false, true, true);\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $c8f95463ff5f043e$var$dragEl$1) return;\n $c8f95463ff5f043e$var$setRect(multiDragElement, dragRectAbsolute);\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n $c8f95463ff5f043e$var$folding = true;\n }\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!$c8f95463ff5f043e$var$folding) $c8f95463ff5f043e$var$removeMultiDragElements();\n if ($c8f95463ff5f043e$var$multiDragElements.length > 1) {\n var clonesHiddenBefore = $c8f95463ff5f043e$var$clonesHidden;\n activeSortable._showClone(sortable);\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !$c8f95463ff5f043e$var$clonesHidden && clonesHiddenBefore) $c8f95463ff5f043e$var$multiDragClones.forEach(function(clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: $c8f95463ff5f043e$var$clonesFromRect\n });\n clone.fromRect = $c8f95463ff5f043e$var$clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n } else activeSortable._showClone(sortable);\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect, isOwner = _ref11.isOwner, activeSortable = _ref11.activeSortable;\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n $c8f95463ff5f043e$var$clonesFromRect = $c8f95463ff5f043e$var$_extends({}, dragRect);\n var dragMatrix = $c8f95463ff5f043e$var$matrix($c8f95463ff5f043e$var$dragEl$1, true);\n $c8f95463ff5f043e$var$clonesFromRect.top -= dragMatrix.f;\n $c8f95463ff5f043e$var$clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if ($c8f95463ff5f043e$var$folding) {\n $c8f95463ff5f043e$var$folding = false;\n $c8f95463ff5f043e$var$removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent, rootEl = _ref12.rootEl, parentEl = _ref12.parentEl, sortable = _ref12.sortable, dispatchSortableEvent = _ref12.dispatchSortableEvent, oldIndex = _ref12.oldIndex, putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options, children = parentEl.children;\n // Multi-drag selection\n if (!$c8f95463ff5f043e$var$dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) this._deselectMultiDrag();\n $c8f95463ff5f043e$var$toggleClass($c8f95463ff5f043e$var$dragEl$1, options.selectedClass, !~$c8f95463ff5f043e$var$multiDragElements.indexOf($c8f95463ff5f043e$var$dragEl$1));\n if (!~$c8f95463ff5f043e$var$multiDragElements.indexOf($c8f95463ff5f043e$var$dragEl$1)) {\n $c8f95463ff5f043e$var$multiDragElements.push($c8f95463ff5f043e$var$dragEl$1);\n $c8f95463ff5f043e$var$dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: \"select\",\n targetEl: $c8f95463ff5f043e$var$dragEl$1,\n originalEvent: evt\n });\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && $c8f95463ff5f043e$var$lastMultiDragSelect && sortable.el.contains($c8f95463ff5f043e$var$lastMultiDragSelect)) {\n var lastIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$lastMultiDragSelect), currentIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n for(; i < n; i++){\n if (~$c8f95463ff5f043e$var$multiDragElements.indexOf(children[i])) continue;\n $c8f95463ff5f043e$var$toggleClass(children[i], options.selectedClass, true);\n $c8f95463ff5f043e$var$multiDragElements.push(children[i]);\n $c8f95463ff5f043e$var$dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: \"select\",\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else $c8f95463ff5f043e$var$lastMultiDragSelect = $c8f95463ff5f043e$var$dragEl$1;\n $c8f95463ff5f043e$var$multiDragSortable = toSortable;\n } else {\n $c8f95463ff5f043e$var$multiDragElements.splice($c8f95463ff5f043e$var$multiDragElements.indexOf($c8f95463ff5f043e$var$dragEl$1), 1);\n $c8f95463ff5f043e$var$lastMultiDragSelect = null;\n $c8f95463ff5f043e$var$dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: \"deselect\",\n targetEl: $c8f95463ff5f043e$var$dragEl$1,\n originalEvent: evt\n });\n }\n }\n // Multi-drag drop\n if ($c8f95463ff5f043e$var$dragStarted && this.isMultiDrag) {\n $c8f95463ff5f043e$var$folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[$c8f95463ff5f043e$var$expando].options.sort || parentEl !== rootEl) && $c8f95463ff5f043e$var$multiDragElements.length > 1) {\n var dragRect = $c8f95463ff5f043e$var$getRect($c8f95463ff5f043e$var$dragEl$1), multiDragIndex = $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl$1, \":not(.\" + this.options.selectedClass + \")\");\n if (!$c8f95463ff5f043e$var$initialFolding && options.animation) $c8f95463ff5f043e$var$dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!$c8f95463ff5f043e$var$initialFolding) {\n if (options.animation) {\n $c8f95463ff5f043e$var$dragEl$1.fromRect = dragRect;\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== $c8f95463ff5f043e$var$dragEl$1) {\n var rect = $c8f95463ff5f043e$var$folding ? $c8f95463ff5f043e$var$getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n $c8f95463ff5f043e$var$removeMultiDragElements();\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n if (children[multiDragIndex]) parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n else parentEl.appendChild(multiDragElement);\n multiDragIndex++;\n });\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === $c8f95463ff5f043e$var$index($c8f95463ff5f043e$var$dragEl$1)) {\n var update = false;\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement.sortableIndex !== $c8f95463ff5f043e$var$index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent(\"update\");\n dispatchSortableEvent(\"sort\");\n }\n }\n }\n // Must be done after capturing individual rects (scroll bar)\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n $c8f95463ff5f043e$var$unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n $c8f95463ff5f043e$var$multiDragSortable = toSortable;\n }\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== \"clone\") $c8f95463ff5f043e$var$multiDragClones.forEach(function(clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = $c8f95463ff5f043e$var$dragStarted = false;\n $c8f95463ff5f043e$var$multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n $c8f95463ff5f043e$var$off(document, \"pointerup\", this._deselectMultiDrag);\n $c8f95463ff5f043e$var$off(document, \"mouseup\", this._deselectMultiDrag);\n $c8f95463ff5f043e$var$off(document, \"touchend\", this._deselectMultiDrag);\n $c8f95463ff5f043e$var$off(document, \"keydown\", this._checkKeyDown);\n $c8f95463ff5f043e$var$off(document, \"keyup\", this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof $c8f95463ff5f043e$var$dragStarted !== \"undefined\" && $c8f95463ff5f043e$var$dragStarted) return;\n // Only deselect if selection is in this sortable\n if ($c8f95463ff5f043e$var$multiDragSortable !== this.sortable) return;\n // Only deselect if target is not item in this sortable\n if (evt && $c8f95463ff5f043e$var$closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while($c8f95463ff5f043e$var$multiDragElements.length){\n var el = $c8f95463ff5f043e$var$multiDragElements[0];\n $c8f95463ff5f043e$var$toggleClass(el, this.options.selectedClass, false);\n $c8f95463ff5f043e$var$multiDragElements.shift();\n $c8f95463ff5f043e$var$dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: \"deselect\",\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) this.multiDragKeyDown = true;\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) this.multiDragKeyDown = false;\n }\n };\n return $c8f95463ff5f043e$var$_extends(MultiDrag, {\n // Static methods & properties\n pluginName: \"multiDrag\",\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */ select: function select(el) {\n var sortable = el.parentNode[$c8f95463ff5f043e$var$expando];\n if (!sortable || !sortable.options.multiDrag || ~$c8f95463ff5f043e$var$multiDragElements.indexOf(el)) return;\n if ($c8f95463ff5f043e$var$multiDragSortable && $c8f95463ff5f043e$var$multiDragSortable !== sortable) {\n $c8f95463ff5f043e$var$multiDragSortable.multiDrag._deselectMultiDrag();\n $c8f95463ff5f043e$var$multiDragSortable = sortable;\n }\n $c8f95463ff5f043e$var$toggleClass(el, sortable.options.selectedClass, true);\n $c8f95463ff5f043e$var$multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */ deselect: function deselect(el) {\n var sortable = el.parentNode[$c8f95463ff5f043e$var$expando], index = $c8f95463ff5f043e$var$multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n $c8f95463ff5f043e$var$toggleClass(el, sortable.options.selectedClass, false);\n $c8f95463ff5f043e$var$multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [], newIndicies = [];\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n // multiDragElements will already be sorted if folding\n var newIndex;\n if ($c8f95463ff5f043e$var$folding && multiDragElement !== $c8f95463ff5f043e$var$dragEl$1) newIndex = -1;\n else if ($c8f95463ff5f043e$var$folding) newIndex = $c8f95463ff5f043e$var$index(multiDragElement, \":not(.\" + _this3.options.selectedClass + \")\");\n else newIndex = $c8f95463ff5f043e$var$index(multiDragElement);\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: $c8f95463ff5f043e$var$_toConsumableArray($c8f95463ff5f043e$var$multiDragElements),\n clones: [].concat($c8f95463ff5f043e$var$multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === \"ctrl\") key = \"Control\";\n else if (key.length > 1) key = key.charAt(0).toUpperCase() + key.substr(1);\n return key;\n }\n }\n });\n}\nfunction $c8f95463ff5f043e$var$insertMultiDragElements(clonesInserted, rootEl) {\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) rootEl.insertBefore(multiDragElement, target);\n else rootEl.appendChild(multiDragElement);\n });\n}\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */ function $c8f95463ff5f043e$var$insertMultiDragClones(elementsInserted, rootEl) {\n $c8f95463ff5f043e$var$multiDragClones.forEach(function(clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) rootEl.insertBefore(clone, target);\n else rootEl.appendChild(clone);\n });\n}\nfunction $c8f95463ff5f043e$var$removeMultiDragElements() {\n $c8f95463ff5f043e$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $c8f95463ff5f043e$var$dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n$c8f95463ff5f043e$export$31b3ca70d8f57423.mount(new $c8f95463ff5f043e$var$AutoScrollPlugin());\n$c8f95463ff5f043e$export$31b3ca70d8f57423.mount($c8f95463ff5f043e$var$Remove, $c8f95463ff5f043e$var$Revert);\nvar $c8f95463ff5f043e$export$2e2bcd8739ae039 = $c8f95463ff5f043e$export$31b3ca70d8f57423;\n\n\nasync function $918fc77ea978604c$export$1402cba6a733f33a() {\n return new Promise((resolve)=>{\n requestAnimationFrame(resolve);\n });\n}\n\n\nfunction $a5e7d2d106c3fea1$export$dc799133ea41435b(y, x, h, derivatives) {\n const n = y.length;\n const dydx = derivatives(y, x);\n const yTemp = dydx; // Reuse array for result to avoid allocation and GC\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h * dydx[i];\n return yTemp;\n}\nfunction $a5e7d2d106c3fea1$export$926181dbdeb3ce30(y, x, h, derivatives) {\n const n = y.length;\n const dydx = derivatives(y, x);\n const yTemp = new Array(n);\n const h2 = h / 2.0;\n const h6 = h / 6.0;\n const xhh = x + h2;\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h2 * dydx[i];\n let dydxTemp = derivatives(yTemp, xhh);\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h2 * dydxTemp[i];\n const dydxM = derivatives(yTemp, xhh);\n for(let i = 0; i < n; i += 1){\n yTemp[i] = y[i] + h * dydxM[i];\n dydxM[i] += dydxTemp[i];\n }\n dydxTemp = derivatives(yTemp, x + h);\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h6 * (dydx[i] + dydxTemp[i] + 2.0 * dydxM[i]);\n return yTemp;\n}\n\n\nfunction $12561087c4c3e6ef$export$35d34bc0ed591a92(stocksAtT, t, h, getFlows, integrator = (0, $a5e7d2d106c3fea1$export$926181dbdeb3ce30)) {\n return integrator(stocksAtT, t, h, getFlows);\n}\nfunction $12561087c4c3e6ef$export$342c33653c71264(stocksAtT, t, h, getFlows, criterion, integrator = (0, $a5e7d2d106c3fea1$export$926181dbdeb3ce30)) {\n let iterations = 0;\n let { userdata: userdata, done: done } = criterion(stocksAtT, t, undefined, iterations);\n if (!done) {\n let newT = t;\n let newStocks;\n do {\n newStocks = integrator(newStocks !== null && newStocks !== void 0 ? newStocks : stocksAtT, newT, h, getFlows);\n newT += h;\n iterations += 1;\n ({ userdata: userdata, done: done } = criterion(newStocks, newT, userdata, iterations));\n }while (!done);\n }\n return userdata;\n}\n\n\nfunction $77c357198c6cf64b$var$step5(stocksAtT, t, h, computeFlows, integrator) {\n return (0, $12561087c4c3e6ef$export$35d34bc0ed591a92)(stocksAtT, t, h, computeFlows, integrator);\n}\nfunction $77c357198c6cf64b$var$step6(stocksAtT, flowsAtT, t, h, computeFlows, integrator) {\n const mutableFlowsAtT = [\n ...flowsAtT\n ];\n const getFlows = (y, x)=>x === t ? mutableFlowsAtT : computeFlows(y, x);\n return (0, $12561087c4c3e6ef$export$35d34bc0ed591a92)(stocksAtT, t, h, getFlows, integrator);\n}\nfunction $77c357198c6cf64b$export$35d34bc0ed591a92(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrIntegrator, integrator) {\n if (typeof tOrFlowsAtT === \"number\") return $77c357198c6cf64b$var$step5(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrIntegrator);\n return $77c357198c6cf64b$var$step6(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrIntegrator, integrator);\n}\nfunction $77c357198c6cf64b$var$converge6(stocksAtT, t, h, computeFlows, criterion, integrator) {\n return (0, $12561087c4c3e6ef$export$342c33653c71264)(stocksAtT, t, h, computeFlows, criterion, integrator);\n}\nfunction $77c357198c6cf64b$var$converge7(stocksAtT, flowsAtT, t, h, computeFlows, criterion, integrator) {\n const mutableFlowsAtT = [\n ...flowsAtT\n ];\n const getFlows = (y, x)=>x === t ? mutableFlowsAtT : computeFlows(y, x);\n return (0, $12561087c4c3e6ef$export$342c33653c71264)(stocksAtT, t, h, getFlows, criterion, integrator);\n}\nfunction $77c357198c6cf64b$export$342c33653c71264(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrCriterion, criterionOrIntegrator, integrator) {\n if (typeof tOrFlowsAtT === \"number\") return $77c357198c6cf64b$var$converge6(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrCriterion, criterionOrIntegrator);\n return $77c357198c6cf64b$var$converge7(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrCriterion, criterionOrIntegrator, integrator);\n}\n\n\nclass $ca4792769be6b7d6$export$a1edc412be3e1841 {\n static elementObjectToArray(ids, object) {\n return ids.map((id)=>object[id]);\n }\n static arrayToElementObject(ids, array) {\n const result = {};\n for(let i = 0; i < ids.length; i += 1){\n const id = ids[i];\n result[id] = array[i];\n }\n return result;\n }\n stocksToStockArray(stocks) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.elementObjectToArray(this.stockIds, stocks);\n }\n stockArrayToStocks(stockArray) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.arrayToElementObject(this.stockIds, stockArray);\n }\n flowsToFlowArray(flows) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.elementObjectToArray(this.flowIds, flows);\n }\n flowArrayToFlows(flowArray) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.arrayToElementObject(this.flowIds, flowArray);\n }\n variablesToVariableArray(variables) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.elementObjectToArray(this.variableIds, variables);\n }\n variableArrayToVariables(variableArray) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.arrayToElementObject(this.variableIds, variableArray);\n }\n parametersToParameterArray(parameters) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.elementObjectToArray(this.parameterIds, parameters);\n }\n parameterArrayToParameters(parameterArray) {\n return $ca4792769be6b7d6$export$a1edc412be3e1841.arrayToElementObject(this.parameterIds, parameterArray);\n }\n evaluateFlowPerStock(stocks, parameters, t) {\n const { flows: flows } = this.evaluate(stocks, parameters, t);\n return this.accumulateFlowsPerStock(flows);\n }\n createFlowEvaluator(parameters) {\n const result = (stocksArray, t)=>{\n const stocks = this.stockArrayToStocks(stocksArray);\n const flowsPerStock = this.evaluateFlowPerStock(stocks, parameters, t);\n const flowPerStockArray = this.stocksToStockArray(flowsPerStock);\n return flowPerStockArray;\n };\n return result;\n }\n step(stocks, t, h, flowEvaluator) {\n const stocksArray = this.stocksToStockArray(stocks);\n const newStocksArray = (0, $77c357198c6cf64b$export$35d34bc0ed591a92)(stocksArray, t, h, flowEvaluator);\n return this.stockArrayToStocks(newStocksArray);\n }\n constructor(stocksIds, flowIds, variableIds, parameterIds){\n this.stockIds = stocksIds;\n this.flowIds = flowIds;\n this.variableIds = variableIds;\n this.parameterIds = parameterIds;\n }\n}\n$ca4792769be6b7d6$export$a1edc412be3e1841.elementIds = [\n \"stocks\",\n \"parameters\",\n \"variables\",\n \"flows\"\n];\n\n\nconst $995a1f169f5e286f$var$stockIds = [\n \"capacityOfNewlyProducedPhones\",\n \"capacityOfRecycledMaterials\",\n \"capacityOfRefurbishedPhones\",\n \"capacityOfRepairedPhones\",\n \"phonesInUse\",\n \"supplyOfBrokenPhones\",\n \"supplyOfDisposedPhones\",\n \"supplyOfHibernatingPhones\",\n \"supplyOfNewlyProducedPhones\",\n \"supplyOfRecycledMaterials\",\n \"supplyOfRefurbishedPhones\",\n \"supplyOfRepairedPhones\"\n];\nconst $995a1f169f5e286f$var$flowIds = [\n \"abandon\",\n \"acquireNewlyProduced\",\n \"acquireRefurbished\",\n \"acquireRepaired\",\n \"acquireUsed\",\n \"capacityOfNewlyProducedPhonesAdjustment\",\n \"capacityOfRecycledMaterialsAdjustment\",\n \"capacityOfRefurbishedPhonesAdjustment\",\n \"disposeBroken\",\n \"disposeHibernating\",\n \"goBroken\",\n \"landfill\",\n \"produceFromNaturalResources\",\n \"produceFromRecycledMaterials\",\n \"recycle\",\n \"refurbish\",\n \"repair\",\n \"repairShopCapcityAdjustment\"\n];\nconst $995a1f169f5e286f$var$variableIds = [\n \"demandForNaturalResources\",\n \"demandForNewlyProducedPhones\",\n \"demandForPhones\",\n \"demandForRecycledMaterials\",\n \"demandForRecycling\",\n \"demandForRefurbishedPhones\",\n \"demandForRefurbishment\",\n \"demandForRepair\",\n \"demandForRepairedPhones\",\n \"demandForResources\",\n \"demandForReusedPhones\",\n \"inflowIncentiveSumForPhonesInUse\",\n \"phoneGoal\",\n \"phonesInUseExcess\",\n \"supplyOfBrokenPhonesForDisposal\",\n \"supplyOfBrokenPhonesForRepair\",\n \"supplyOfDisposedPhonesForLandfilling\",\n \"supplyOfDisposedPhonesForRecycling\",\n \"supplyOfHibernatingPhonesForDisposal\",\n \"supplyOfHibernatingPhonesForRefurbishment\",\n \"supplyOfHibernatingPhonesForReuse\"\n];\nconst $995a1f169f5e286f$var$parameterIds = [\n \"abandonExcessRate\",\n \"abandonRate\",\n \"acquireRate\",\n \"breakRate\",\n \"capacityAdjustmentRate\",\n \"disposeIncentive\",\n \"disposeRate\",\n \"landfillIncentive\",\n \"landfillRate\",\n \"naturalResourcesIncentive\",\n \"newPhoneProductionRate\",\n \"newlyProducedPhoneIncentive\",\n \"numberOfUsers\",\n \"phonesPerUserGoal\",\n \"recycleRate\",\n \"recyclingIncentive\",\n \"refurbishmentIncentive\",\n \"refurbishmentRate\",\n \"repairIncentive\",\n \"repairRate\",\n \"reuseIncentive\"\n];\nclass $995a1f169f5e286f$var$CircularEconomyModel extends (0, $ca4792769be6b7d6$export$a1edc412be3e1841) {\n // eslint-disable-next-line class-methods-use-this\n evaluate(stocks, parameters, t) {\n const { capacityOfNewlyProducedPhones: capacityOfNewlyProducedPhones, capacityOfRecycledMaterials: capacityOfRecycledMaterials, capacityOfRefurbishedPhones: capacityOfRefurbishedPhones, capacityOfRepairedPhones: capacityOfRepairedPhones, phonesInUse: phonesInUse, supplyOfBrokenPhones: supplyOfBrokenPhones, supplyOfDisposedPhones: supplyOfDisposedPhones, supplyOfHibernatingPhones: supplyOfHibernatingPhones, supplyOfNewlyProducedPhones: supplyOfNewlyProducedPhones, supplyOfRecycledMaterials: supplyOfRecycledMaterials, supplyOfRefurbishedPhones: supplyOfRefurbishedPhones, supplyOfRepairedPhones: supplyOfRepairedPhones } = stocks;\n const { abandonExcessRate: abandonExcessRate, abandonRate: abandonRate, acquireRate: acquireRate, breakRate: breakRate, capacityAdjustmentRate: capacityAdjustmentRate, disposeIncentive: disposeIncentive, disposeRate: disposeRate, landfillIncentive: landfillIncentive, landfillRate: landfillRate, naturalResourcesIncentive: naturalResourcesIncentive, newPhoneProductionRate: newPhoneProductionRate, newlyProducedPhoneIncentive: newlyProducedPhoneIncentive, numberOfUsers: numberOfUsers, phonesPerUserGoal: phonesPerUserGoal, recycleRate: recycleRate, recyclingIncentive: recyclingIncentive, refurbishmentIncentive: refurbishmentIncentive, refurbishmentRate: refurbishmentRate, repairIncentive: repairIncentive, repairRate: repairRate, reuseIncentive: reuseIncentive } = parameters;\n const phoneGoal = numberOfUsers * phonesPerUserGoal;\n const phonesInUseExcess = Math.max(phonesInUse - phoneGoal, 0);\n const abandon = abandonRate * phonesInUse + abandonExcessRate * phonesInUseExcess;\n const inflowIncentiveSumForPhonesInUse = reuseIncentive + repairIncentive + refurbishmentIncentive + newlyProducedPhoneIncentive;\n const goBroken = breakRate * phonesInUse;\n const demandForPhones = Math.max(0, phoneGoal - phonesInUse + goBroken + abandon);\n const demandForNewlyProducedPhones = newlyProducedPhoneIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireNewlyProduced = acquireRate * Math.min(supplyOfNewlyProducedPhones, demandForNewlyProducedPhones);\n const demandForRefurbishedPhones = refurbishmentIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireRefurbished = acquireRate * Math.min(demandForRefurbishedPhones, supplyOfRefurbishedPhones);\n const demandForRepairedPhones = repairIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireRepaired = acquireRate * Math.min(demandForRepairedPhones, supplyOfRepairedPhones);\n const supplyOfHibernatingPhonesForReuse = reuseIncentive / (reuseIncentive + refurbishmentIncentive + disposeIncentive) * supplyOfHibernatingPhones;\n const demandForReusedPhones = reuseIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireUsed = acquireRate * Math.min(supplyOfHibernatingPhonesForReuse, demandForReusedPhones);\n const capacityOfNewlyProducedPhonesAdjustment = capacityAdjustmentRate * (demandForNewlyProducedPhones - capacityOfNewlyProducedPhones);\n const demandForResources = Math.max(capacityOfNewlyProducedPhones - supplyOfNewlyProducedPhones + acquireNewlyProduced, 0);\n const demandForRecycledMaterials = recyclingIncentive / (naturalResourcesIncentive + recyclingIncentive) * demandForResources;\n const capacityOfRecycledMaterialsAdjustment = capacityAdjustmentRate * (demandForRecycledMaterials - capacityOfRecycledMaterials);\n const capacityOfRefurbishedPhonesAdjustment = capacityAdjustmentRate * (demandForRefurbishedPhones - capacityOfRefurbishedPhones);\n const supplyOfBrokenPhonesForDisposal = disposeIncentive / (repairIncentive + disposeIncentive) * supplyOfBrokenPhones;\n const disposeBroken = disposeRate * supplyOfBrokenPhonesForDisposal;\n const supplyOfHibernatingPhonesForDisposal = disposeIncentive / (reuseIncentive + refurbishmentIncentive + disposeIncentive) * supplyOfHibernatingPhones;\n const disposeHibernating = disposeRate * supplyOfHibernatingPhonesForDisposal;\n const supplyOfDisposedPhonesForLandfilling = landfillIncentive / (recyclingIncentive + landfillIncentive) * supplyOfDisposedPhones;\n const landfill = landfillRate * supplyOfDisposedPhonesForLandfilling;\n const demandForNaturalResources = naturalResourcesIncentive / (naturalResourcesIncentive + recyclingIncentive) * demandForResources;\n const produceFromNaturalResources = newPhoneProductionRate * demandForNaturalResources;\n const produceFromRecycledMaterials = newPhoneProductionRate * Math.min(demandForRecycledMaterials, supplyOfRecycledMaterials);\n const supplyOfDisposedPhonesForRecycling = recyclingIncentive / (recyclingIncentive + landfillIncentive) * supplyOfDisposedPhones;\n const demandForRecycling = Math.max(capacityOfRecycledMaterials - supplyOfRecycledMaterials + produceFromRecycledMaterials, 0);\n const recycle = recycleRate * Math.min(supplyOfDisposedPhonesForRecycling, demandForRecycling);\n const supplyOfHibernatingPhonesForRefurbishment = refurbishmentIncentive / (reuseIncentive + refurbishmentIncentive + disposeIncentive) * supplyOfHibernatingPhones;\n const demandForRefurbishment = Math.max(capacityOfRefurbishedPhones - supplyOfRefurbishedPhones + acquireRefurbished, 0);\n const refurbish = refurbishmentRate * Math.min(supplyOfHibernatingPhonesForRefurbishment, demandForRefurbishment);\n const demandForRepair = Math.max(capacityOfRepairedPhones - supplyOfRepairedPhones + acquireRepaired, 0);\n const repair = repairRate * Math.min(supplyOfBrokenPhones, demandForRepair);\n const repairShopCapcityAdjustment = capacityAdjustmentRate * (demandForRepairedPhones - capacityOfRepairedPhones);\n const supplyOfBrokenPhonesForRepair = repairIncentive / (repairIncentive + disposeIncentive) * supplyOfBrokenPhones;\n const variables = {\n demandForNaturalResources: demandForNaturalResources,\n demandForNewlyProducedPhones: demandForNewlyProducedPhones,\n demandForPhones: demandForPhones,\n demandForRecycledMaterials: demandForRecycledMaterials,\n demandForRecycling: demandForRecycling,\n demandForRefurbishedPhones: demandForRefurbishedPhones,\n demandForRefurbishment: demandForRefurbishment,\n demandForRepair: demandForRepair,\n demandForRepairedPhones: demandForRepairedPhones,\n demandForResources: demandForResources,\n demandForReusedPhones: demandForReusedPhones,\n inflowIncentiveSumForPhonesInUse: inflowIncentiveSumForPhonesInUse,\n phoneGoal: phoneGoal,\n phonesInUseExcess: phonesInUseExcess,\n supplyOfBrokenPhonesForDisposal: supplyOfBrokenPhonesForDisposal,\n supplyOfBrokenPhonesForRepair: supplyOfBrokenPhonesForRepair,\n supplyOfDisposedPhonesForLandfilling: supplyOfDisposedPhonesForLandfilling,\n supplyOfDisposedPhonesForRecycling: supplyOfDisposedPhonesForRecycling,\n supplyOfHibernatingPhonesForDisposal: supplyOfHibernatingPhonesForDisposal,\n supplyOfHibernatingPhonesForRefurbishment: supplyOfHibernatingPhonesForRefurbishment,\n supplyOfHibernatingPhonesForReuse: supplyOfHibernatingPhonesForReuse\n };\n const flows = {\n abandon: abandon,\n acquireNewlyProduced: acquireNewlyProduced,\n acquireRefurbished: acquireRefurbished,\n acquireRepaired: acquireRepaired,\n acquireUsed: acquireUsed,\n capacityOfNewlyProducedPhonesAdjustment: capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterialsAdjustment: capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhonesAdjustment: capacityOfRefurbishedPhonesAdjustment,\n disposeBroken: disposeBroken,\n disposeHibernating: disposeHibernating,\n goBroken: goBroken,\n landfill: landfill,\n produceFromNaturalResources: produceFromNaturalResources,\n produceFromRecycledMaterials: produceFromRecycledMaterials,\n recycle: recycle,\n refurbish: refurbish,\n repair: repair,\n repairShopCapcityAdjustment: repairShopCapcityAdjustment\n };\n return {\n t: t,\n stocks: stocks,\n parameters: parameters,\n variables: variables,\n flows: flows\n };\n }\n // eslint-disable-next-line class-methods-use-this\n accumulateFlowsPerStock(flows) {\n const { abandon: abandon, acquireNewlyProduced: acquireNewlyProduced, acquireRefurbished: acquireRefurbished, acquireRepaired: acquireRepaired, acquireUsed: acquireUsed, capacityOfNewlyProducedPhonesAdjustment: capacityOfNewlyProducedPhonesAdjustment, capacityOfRecycledMaterialsAdjustment: capacityOfRecycledMaterialsAdjustment, capacityOfRefurbishedPhonesAdjustment: capacityOfRefurbishedPhonesAdjustment, disposeBroken: disposeBroken, disposeHibernating: disposeHibernating, goBroken: goBroken, landfill: landfill, produceFromNaturalResources: produceFromNaturalResources, produceFromRecycledMaterials: produceFromRecycledMaterials, recycle: recycle, refurbish: refurbish, repair: repair, repairShopCapcityAdjustment: repairShopCapcityAdjustment } = flows;\n const flowPerStock = {\n capacityOfNewlyProducedPhones: capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterials: capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhones: capacityOfRefurbishedPhonesAdjustment,\n capacityOfRepairedPhones: repairShopCapcityAdjustment,\n phonesInUse: acquireNewlyProduced + acquireRefurbished + acquireRepaired + acquireUsed - (abandon + goBroken),\n supplyOfBrokenPhones: goBroken - (disposeBroken + repair),\n supplyOfDisposedPhones: disposeBroken + disposeHibernating - (landfill + recycle),\n supplyOfHibernatingPhones: abandon - (acquireUsed + disposeHibernating + refurbish),\n supplyOfNewlyProducedPhones: produceFromNaturalResources + produceFromRecycledMaterials - acquireNewlyProduced,\n supplyOfRecycledMaterials: recycle - produceFromRecycledMaterials,\n supplyOfRefurbishedPhones: refurbish - acquireRefurbished,\n supplyOfRepairedPhones: repair - acquireRepaired\n };\n return flowPerStock;\n }\n constructor(){\n super($995a1f169f5e286f$var$stockIds, $995a1f169f5e286f$var$flowIds, $995a1f169f5e286f$var$variableIds, $995a1f169f5e286f$var$parameterIds);\n }\n}\n$995a1f169f5e286f$var$CircularEconomyModel.initialStocks = {\n capacityOfNewlyProducedPhones: 0,\n capacityOfRecycledMaterials: 0,\n capacityOfRefurbishedPhones: 0,\n capacityOfRepairedPhones: 0,\n phonesInUse: 0,\n supplyOfBrokenPhones: 0,\n supplyOfDisposedPhones: 0,\n supplyOfHibernatingPhones: 0,\n supplyOfNewlyProducedPhones: 0,\n supplyOfRecycledMaterials: 0,\n supplyOfRefurbishedPhones: 0,\n supplyOfRepairedPhones: 0\n};\n$995a1f169f5e286f$var$CircularEconomyModel.defaultParameters = {\n abandonExcessRate: 0.5,\n abandonRate: 0.1,\n acquireRate: 1,\n breakRate: 0.1,\n capacityAdjustmentRate: 0.1,\n disposeIncentive: 0.5,\n disposeRate: 0.5,\n landfillIncentive: 0.5,\n landfillRate: 1,\n naturalResourcesIncentive: 0.5,\n newPhoneProductionRate: 0.5,\n newlyProducedPhoneIncentive: 0.82,\n numberOfUsers: 1000000,\n phonesPerUserGoal: 1,\n recycleRate: 1,\n recyclingIncentive: 0.89,\n refurbishmentIncentive: 0.5,\n refurbishmentRate: 1,\n repairIncentive: 0.5,\n repairRate: 1,\n reuseIncentive: 0.86\n};\nvar $995a1f169f5e286f$export$2e2bcd8739ae039 = $995a1f169f5e286f$var$CircularEconomyModel;\n\n\nclass $2495d722a6806b18$var$ModelSimulator {\n evaluateFlowPerStockWithCache(stockArray, t) {\n if (this.flowPerStockCache !== null && this.flowPerStockCache.t === t) return [\n ...this.flowPerStockCache.value\n ];\n return this.flowEvaluator(stockArray, t);\n }\n step() {\n const { stocks: stocks, parameters: parameters, t: t } = this.record;\n const newStocks = this.model.step(stocks, t, this.h, this.flowEvaluatorWithCache);\n const newRecord = this.model.evaluate(newStocks, parameters, t + this.h);\n this.flowPerStockCache = {\n t: newRecord.t,\n value: this.model.stocksToStockArray(this.model.accumulateFlowsPerStock(newRecord.flows))\n };\n this.record = newRecord;\n return newRecord;\n }\n constructor(model, stocks, parameters, t, h){\n this.model = model;\n this.parameters = parameters;\n this.flowPerStockCache = null;\n this.record = this.model.evaluate(stocks, parameters, t);\n this.h = h;\n this.flowEvaluator = this.model.createFlowEvaluator(parameters);\n this.flowEvaluatorWithCache = this.evaluateFlowPerStockWithCache.bind(this);\n }\n}\nvar $2495d722a6806b18$export$2e2bcd8739ae039 = $2495d722a6806b18$var$ModelSimulator;\n\n\nvar $c87ac678829b8e5f$exports = {};\nvar $08c10a8642478998$exports = {};\nvar $1b7ff3cd61804da8$exports = {};\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */ function $1b7ff3cd61804da8$var$arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1, length = array == null ? 0 : array.length;\n if (initAccum && length) accumulator = array[++index];\n while(++index < length)accumulator = iteratee(accumulator, array[index], index, array);\n return accumulator;\n}\n$1b7ff3cd61804da8$exports = $1b7ff3cd61804da8$var$arrayReduce;\n\n\nvar $1f2a8327a9c6cd40$exports = {};\nvar $22d081411f8ece61$exports = {};\nvar $cbf1cd6f0a53572d$exports = {};\n/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */ function $cbf1cd6f0a53572d$var$basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n$cbf1cd6f0a53572d$exports = $cbf1cd6f0a53572d$var$basePropertyOf;\n\n\n/** Used to map Latin Unicode letters to basic Latin letters. */ var $22d081411f8ece61$var$deburredLetters = {\n // Latin-1 Supplement block.\n \"\\xc0\": \"A\",\n \"\\xc1\": \"A\",\n \"\\xc2\": \"A\",\n \"\\xc3\": \"A\",\n \"\\xc4\": \"A\",\n \"\\xc5\": \"A\",\n \"\\xe0\": \"a\",\n \"\\xe1\": \"a\",\n \"\\xe2\": \"a\",\n \"\\xe3\": \"a\",\n \"\\xe4\": \"a\",\n \"\\xe5\": \"a\",\n \"\\xc7\": \"C\",\n \"\\xe7\": \"c\",\n \"\\xd0\": \"D\",\n \"\\xf0\": \"d\",\n \"\\xc8\": \"E\",\n \"\\xc9\": \"E\",\n \"\\xca\": \"E\",\n \"\\xcb\": \"E\",\n \"\\xe8\": \"e\",\n \"\\xe9\": \"e\",\n \"\\xea\": \"e\",\n \"\\xeb\": \"e\",\n \"\\xcc\": \"I\",\n \"\\xcd\": \"I\",\n \"\\xce\": \"I\",\n \"\\xcf\": \"I\",\n \"\\xec\": \"i\",\n \"\\xed\": \"i\",\n \"\\xee\": \"i\",\n \"\\xef\": \"i\",\n \"\\xd1\": \"N\",\n \"\\xf1\": \"n\",\n \"\\xd2\": \"O\",\n \"\\xd3\": \"O\",\n \"\\xd4\": \"O\",\n \"\\xd5\": \"O\",\n \"\\xd6\": \"O\",\n \"\\xd8\": \"O\",\n \"\\xf2\": \"o\",\n \"\\xf3\": \"o\",\n \"\\xf4\": \"o\",\n \"\\xf5\": \"o\",\n \"\\xf6\": \"o\",\n \"\\xf8\": \"o\",\n \"\\xd9\": \"U\",\n \"\\xda\": \"U\",\n \"\\xdb\": \"U\",\n \"\\xdc\": \"U\",\n \"\\xf9\": \"u\",\n \"\\xfa\": \"u\",\n \"\\xfb\": \"u\",\n \"\\xfc\": \"u\",\n \"\\xdd\": \"Y\",\n \"\\xfd\": \"y\",\n \"\\xff\": \"y\",\n \"\\xc6\": \"Ae\",\n \"\\xe6\": \"ae\",\n \"\\xde\": \"Th\",\n \"\\xfe\": \"th\",\n \"\\xdf\": \"ss\",\n // Latin Extended-A block.\n \"\\u0100\": \"A\",\n \"\\u0102\": \"A\",\n \"\\u0104\": \"A\",\n \"\\u0101\": \"a\",\n \"\\u0103\": \"a\",\n \"\\u0105\": \"a\",\n \"\\u0106\": \"C\",\n \"\\u0108\": \"C\",\n \"\\u010A\": \"C\",\n \"\\u010C\": \"C\",\n \"\\u0107\": \"c\",\n \"\\u0109\": \"c\",\n \"\\u010B\": \"c\",\n \"\\u010D\": \"c\",\n \"\\u010E\": \"D\",\n \"\\u0110\": \"D\",\n \"\\u010F\": \"d\",\n \"\\u0111\": \"d\",\n \"\\u0112\": \"E\",\n \"\\u0114\": \"E\",\n \"\\u0116\": \"E\",\n \"\\u0118\": \"E\",\n \"\\u011A\": \"E\",\n \"\\u0113\": \"e\",\n \"\\u0115\": \"e\",\n \"\\u0117\": \"e\",\n \"\\u0119\": \"e\",\n \"\\u011B\": \"e\",\n \"\\u011C\": \"G\",\n \"\\u011E\": \"G\",\n \"\\u0120\": \"G\",\n \"\\u0122\": \"G\",\n \"\\u011D\": \"g\",\n \"\\u011F\": \"g\",\n \"\\u0121\": \"g\",\n \"\\u0123\": \"g\",\n \"\\u0124\": \"H\",\n \"\\u0126\": \"H\",\n \"\\u0125\": \"h\",\n \"\\u0127\": \"h\",\n \"\\u0128\": \"I\",\n \"\\u012A\": \"I\",\n \"\\u012C\": \"I\",\n \"\\u012E\": \"I\",\n \"\\u0130\": \"I\",\n \"\\u0129\": \"i\",\n \"\\u012B\": \"i\",\n \"\\u012D\": \"i\",\n \"\\u012F\": \"i\",\n \"\\u0131\": \"i\",\n \"\\u0134\": \"J\",\n \"\\u0135\": \"j\",\n \"\\u0136\": \"K\",\n \"\\u0137\": \"k\",\n \"\\u0138\": \"k\",\n \"\\u0139\": \"L\",\n \"\\u013B\": \"L\",\n \"\\u013D\": \"L\",\n \"\\u013F\": \"L\",\n \"\\u0141\": \"L\",\n \"\\u013A\": \"l\",\n \"\\u013C\": \"l\",\n \"\\u013E\": \"l\",\n \"\\u0140\": \"l\",\n \"\\u0142\": \"l\",\n \"\\u0143\": \"N\",\n \"\\u0145\": \"N\",\n \"\\u0147\": \"N\",\n \"\\u014A\": \"N\",\n \"\\u0144\": \"n\",\n \"\\u0146\": \"n\",\n \"\\u0148\": \"n\",\n \"\\u014B\": \"n\",\n \"\\u014C\": \"O\",\n \"\\u014E\": \"O\",\n \"\\u0150\": \"O\",\n \"\\u014D\": \"o\",\n \"\\u014F\": \"o\",\n \"\\u0151\": \"o\",\n \"\\u0154\": \"R\",\n \"\\u0156\": \"R\",\n \"\\u0158\": \"R\",\n \"\\u0155\": \"r\",\n \"\\u0157\": \"r\",\n \"\\u0159\": \"r\",\n \"\\u015A\": \"S\",\n \"\\u015C\": \"S\",\n \"\\u015E\": \"S\",\n \"\\u0160\": \"S\",\n \"\\u015B\": \"s\",\n \"\\u015D\": \"s\",\n \"\\u015F\": \"s\",\n \"\\u0161\": \"s\",\n \"\\u0162\": \"T\",\n \"\\u0164\": \"T\",\n \"\\u0166\": \"T\",\n \"\\u0163\": \"t\",\n \"\\u0165\": \"t\",\n \"\\u0167\": \"t\",\n \"\\u0168\": \"U\",\n \"\\u016A\": \"U\",\n \"\\u016C\": \"U\",\n \"\\u016E\": \"U\",\n \"\\u0170\": \"U\",\n \"\\u0172\": \"U\",\n \"\\u0169\": \"u\",\n \"\\u016B\": \"u\",\n \"\\u016D\": \"u\",\n \"\\u016F\": \"u\",\n \"\\u0171\": \"u\",\n \"\\u0173\": \"u\",\n \"\\u0174\": \"W\",\n \"\\u0175\": \"w\",\n \"\\u0176\": \"Y\",\n \"\\u0177\": \"y\",\n \"\\u0178\": \"Y\",\n \"\\u0179\": \"Z\",\n \"\\u017B\": \"Z\",\n \"\\u017D\": \"Z\",\n \"\\u017A\": \"z\",\n \"\\u017C\": \"z\",\n \"\\u017E\": \"z\",\n \"\\u0132\": \"IJ\",\n \"\\u0133\": \"ij\",\n \"\\u0152\": \"Oe\",\n \"\\u0153\": \"oe\",\n \"\\u0149\": \"'n\",\n \"\\u017F\": \"s\"\n};\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */ var $22d081411f8ece61$var$deburrLetter = $cbf1cd6f0a53572d$exports($22d081411f8ece61$var$deburredLetters);\n$22d081411f8ece61$exports = $22d081411f8ece61$var$deburrLetter;\n\n\nvar $ee44123cee6ab817$exports = {};\nvar $e5d1c83d06342727$exports = {};\nvar $8ae6ebea7b194487$exports = {};\nvar $d6b32571b971a536$exports = {};\nvar $5c41b9a5519f3a64$exports = {};\n/** Detect free variable `global` from Node.js. */ var $5c41b9a5519f3a64$var$freeGlobal = typeof $parcel$global == \"object\" && $parcel$global && $parcel$global.Object === Object && $parcel$global;\n$5c41b9a5519f3a64$exports = $5c41b9a5519f3a64$var$freeGlobal;\n\n\n/** Detect free variable `self`. */ var $d6b32571b971a536$var$freeSelf = typeof self == \"object\" && self && self.Object === Object && self;\n/** Used as a reference to the global object. */ var $d6b32571b971a536$var$root = $5c41b9a5519f3a64$exports || $d6b32571b971a536$var$freeSelf || Function(\"return this\")();\n$d6b32571b971a536$exports = $d6b32571b971a536$var$root;\n\n\n/** Built-in value references. */ var $8ae6ebea7b194487$var$Symbol = $d6b32571b971a536$exports.Symbol;\n$8ae6ebea7b194487$exports = $8ae6ebea7b194487$var$Symbol;\n\n\nvar $19ec4e0dcd973343$exports = {};\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */ function $19ec4e0dcd973343$var$arrayMap(array, iteratee) {\n var index = -1, length = array == null ? 0 : array.length, result = Array(length);\n while(++index < length)result[index] = iteratee(array[index], index, array);\n return result;\n}\n$19ec4e0dcd973343$exports = $19ec4e0dcd973343$var$arrayMap;\n\n\nvar $80ba2d19709662a3$exports = {};\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */ var $80ba2d19709662a3$var$isArray = Array.isArray;\n$80ba2d19709662a3$exports = $80ba2d19709662a3$var$isArray;\n\n\nvar $f2239ecfa31470ab$exports = {};\nvar $a72fb30b329d5697$exports = {};\n\nvar $cc11b91eeb6cba09$exports = {};\n\n/** Used for built-in method references. */ var $cc11b91eeb6cba09$var$objectProto = Object.prototype;\n/** Used to check objects for own properties. */ var $cc11b91eeb6cba09$var$hasOwnProperty = $cc11b91eeb6cba09$var$objectProto.hasOwnProperty;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */ var $cc11b91eeb6cba09$var$nativeObjectToString = $cc11b91eeb6cba09$var$objectProto.toString;\n/** Built-in value references. */ var $cc11b91eeb6cba09$var$symToStringTag = $8ae6ebea7b194487$exports ? $8ae6ebea7b194487$exports.toStringTag : undefined;\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */ function $cc11b91eeb6cba09$var$getRawTag(value) {\n var isOwn = $cc11b91eeb6cba09$var$hasOwnProperty.call(value, $cc11b91eeb6cba09$var$symToStringTag), tag = value[$cc11b91eeb6cba09$var$symToStringTag];\n try {\n value[$cc11b91eeb6cba09$var$symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n var result = $cc11b91eeb6cba09$var$nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) value[$cc11b91eeb6cba09$var$symToStringTag] = tag;\n else delete value[$cc11b91eeb6cba09$var$symToStringTag];\n }\n return result;\n}\n$cc11b91eeb6cba09$exports = $cc11b91eeb6cba09$var$getRawTag;\n\n\nvar $34878bff9c6a1b5d$exports = {};\n/** Used for built-in method references. */ var $34878bff9c6a1b5d$var$objectProto = Object.prototype;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */ var $34878bff9c6a1b5d$var$nativeObjectToString = $34878bff9c6a1b5d$var$objectProto.toString;\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */ function $34878bff9c6a1b5d$var$objectToString(value) {\n return $34878bff9c6a1b5d$var$nativeObjectToString.call(value);\n}\n$34878bff9c6a1b5d$exports = $34878bff9c6a1b5d$var$objectToString;\n\n\n/** `Object#toString` result references. */ var $a72fb30b329d5697$var$nullTag = \"[object Null]\", $a72fb30b329d5697$var$undefinedTag = \"[object Undefined]\";\n/** Built-in value references. */ var $a72fb30b329d5697$var$symToStringTag = $8ae6ebea7b194487$exports ? $8ae6ebea7b194487$exports.toStringTag : undefined;\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */ function $a72fb30b329d5697$var$baseGetTag(value) {\n if (value == null) return value === undefined ? $a72fb30b329d5697$var$undefinedTag : $a72fb30b329d5697$var$nullTag;\n return $a72fb30b329d5697$var$symToStringTag && $a72fb30b329d5697$var$symToStringTag in Object(value) ? $cc11b91eeb6cba09$exports(value) : $34878bff9c6a1b5d$exports(value);\n}\n$a72fb30b329d5697$exports = $a72fb30b329d5697$var$baseGetTag;\n\n\nvar $12765be2afa50e71$exports = {};\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */ function $12765be2afa50e71$var$isObjectLike(value) {\n return value != null && typeof value == \"object\";\n}\n$12765be2afa50e71$exports = $12765be2afa50e71$var$isObjectLike;\n\n\n/** `Object#toString` result references. */ var $f2239ecfa31470ab$var$symbolTag = \"[object Symbol]\";\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */ function $f2239ecfa31470ab$var$isSymbol(value) {\n return typeof value == \"symbol\" || $12765be2afa50e71$exports(value) && $a72fb30b329d5697$exports(value) == $f2239ecfa31470ab$var$symbolTag;\n}\n$f2239ecfa31470ab$exports = $f2239ecfa31470ab$var$isSymbol;\n\n\n/** Used as references for various `Number` constants. */ var $e5d1c83d06342727$var$INFINITY = 1 / 0;\n/** Used to convert symbols to primitives and strings. */ var $e5d1c83d06342727$var$symbolProto = $8ae6ebea7b194487$exports ? $8ae6ebea7b194487$exports.prototype : undefined, $e5d1c83d06342727$var$symbolToString = $e5d1c83d06342727$var$symbolProto ? $e5d1c83d06342727$var$symbolProto.toString : undefined;\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */ function $e5d1c83d06342727$var$baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == \"string\") return value;\n if ($80ba2d19709662a3$exports(value)) // Recursively convert values (susceptible to call stack limits).\n return $19ec4e0dcd973343$exports(value, $e5d1c83d06342727$var$baseToString) + \"\";\n if ($f2239ecfa31470ab$exports(value)) return $e5d1c83d06342727$var$symbolToString ? $e5d1c83d06342727$var$symbolToString.call(value) : \"\";\n var result = value + \"\";\n return result == \"0\" && 1 / value == -$e5d1c83d06342727$var$INFINITY ? \"-0\" : result;\n}\n$e5d1c83d06342727$exports = $e5d1c83d06342727$var$baseToString;\n\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */ function $ee44123cee6ab817$var$toString(value) {\n return value == null ? \"\" : $e5d1c83d06342727$exports(value);\n}\n$ee44123cee6ab817$exports = $ee44123cee6ab817$var$toString;\n\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */ var $1f2a8327a9c6cd40$var$reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n/** Used to compose unicode character classes. */ var $1f2a8327a9c6cd40$var$rsComboMarksRange = \"\\\\u0300-\\\\u036f\", $1f2a8327a9c6cd40$var$reComboHalfMarksRange = \"\\\\ufe20-\\\\ufe2f\", $1f2a8327a9c6cd40$var$rsComboSymbolsRange = \"\\\\u20d0-\\\\u20ff\", $1f2a8327a9c6cd40$var$rsComboRange = $1f2a8327a9c6cd40$var$rsComboMarksRange + $1f2a8327a9c6cd40$var$reComboHalfMarksRange + $1f2a8327a9c6cd40$var$rsComboSymbolsRange;\n/** Used to compose unicode capture groups. */ var $1f2a8327a9c6cd40$var$rsCombo = \"[\" + $1f2a8327a9c6cd40$var$rsComboRange + \"]\";\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */ var $1f2a8327a9c6cd40$var$reComboMark = RegExp($1f2a8327a9c6cd40$var$rsCombo, \"g\");\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */ function $1f2a8327a9c6cd40$var$deburr(string) {\n string = $ee44123cee6ab817$exports(string);\n return string && string.replace($1f2a8327a9c6cd40$var$reLatin, $22d081411f8ece61$exports).replace($1f2a8327a9c6cd40$var$reComboMark, \"\");\n}\n$1f2a8327a9c6cd40$exports = $1f2a8327a9c6cd40$var$deburr;\n\n\nvar $31925c2e0b1bffc8$exports = {};\nvar $9589882a1b02d2bd$exports = {};\n/** Used to match words composed of alphanumeric characters. */ var $9589882a1b02d2bd$var$reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */ function $9589882a1b02d2bd$var$asciiWords(string) {\n return string.match($9589882a1b02d2bd$var$reAsciiWord) || [];\n}\n$9589882a1b02d2bd$exports = $9589882a1b02d2bd$var$asciiWords;\n\n\nvar $5f3800a21019ebc5$exports = {};\n/** Used to detect strings that need a more robust regexp to match words. */ var $5f3800a21019ebc5$var$reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */ function $5f3800a21019ebc5$var$hasUnicodeWord(string) {\n return $5f3800a21019ebc5$var$reHasUnicodeWord.test(string);\n}\n$5f3800a21019ebc5$exports = $5f3800a21019ebc5$var$hasUnicodeWord;\n\n\n\nvar $59413fe1d37c7fe4$exports = {};\n/** Used to compose unicode character classes. */ var $59413fe1d37c7fe4$var$rsAstralRange = \"\\ud800-\\udfff\", $59413fe1d37c7fe4$var$rsComboMarksRange = \"\\\\u0300-\\\\u036f\", $59413fe1d37c7fe4$var$reComboHalfMarksRange = \"\\\\ufe20-\\\\ufe2f\", $59413fe1d37c7fe4$var$rsComboSymbolsRange = \"\\\\u20d0-\\\\u20ff\", $59413fe1d37c7fe4$var$rsComboRange = $59413fe1d37c7fe4$var$rsComboMarksRange + $59413fe1d37c7fe4$var$reComboHalfMarksRange + $59413fe1d37c7fe4$var$rsComboSymbolsRange, $59413fe1d37c7fe4$var$rsDingbatRange = \"\\\\u2700-\\\\u27bf\", $59413fe1d37c7fe4$var$rsLowerRange = \"a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff\", $59413fe1d37c7fe4$var$rsMathOpRange = \"\\\\xac\\\\xb1\\\\xd7\\\\xf7\", $59413fe1d37c7fe4$var$rsNonCharRange = \"\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\", $59413fe1d37c7fe4$var$rsPunctuationRange = \"\\\\u2000-\\\\u206f\", $59413fe1d37c7fe4$var$rsSpaceRange = \" \\\\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\", $59413fe1d37c7fe4$var$rsUpperRange = \"A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde\", $59413fe1d37c7fe4$var$rsVarRange = \"\\\\ufe0e\\\\ufe0f\", $59413fe1d37c7fe4$var$rsBreakRange = $59413fe1d37c7fe4$var$rsMathOpRange + $59413fe1d37c7fe4$var$rsNonCharRange + $59413fe1d37c7fe4$var$rsPunctuationRange + $59413fe1d37c7fe4$var$rsSpaceRange;\n/** Used to compose unicode capture groups. */ var $59413fe1d37c7fe4$var$rsApos = \"['\\u2019]\", $59413fe1d37c7fe4$var$rsBreak = \"[\" + $59413fe1d37c7fe4$var$rsBreakRange + \"]\", $59413fe1d37c7fe4$var$rsCombo = \"[\" + $59413fe1d37c7fe4$var$rsComboRange + \"]\", $59413fe1d37c7fe4$var$rsDigits = \"\\\\d+\", $59413fe1d37c7fe4$var$rsDingbat = \"[\" + $59413fe1d37c7fe4$var$rsDingbatRange + \"]\", $59413fe1d37c7fe4$var$rsLower = \"[\" + $59413fe1d37c7fe4$var$rsLowerRange + \"]\", $59413fe1d37c7fe4$var$rsMisc = \"[^\" + $59413fe1d37c7fe4$var$rsAstralRange + $59413fe1d37c7fe4$var$rsBreakRange + $59413fe1d37c7fe4$var$rsDigits + $59413fe1d37c7fe4$var$rsDingbatRange + $59413fe1d37c7fe4$var$rsLowerRange + $59413fe1d37c7fe4$var$rsUpperRange + \"]\", $59413fe1d37c7fe4$var$rsFitz = \"\\ud83c[\\udffb-\\udfff]\", $59413fe1d37c7fe4$var$rsModifier = \"(?:\" + $59413fe1d37c7fe4$var$rsCombo + \"|\" + $59413fe1d37c7fe4$var$rsFitz + \")\", $59413fe1d37c7fe4$var$rsNonAstral = \"[^\" + $59413fe1d37c7fe4$var$rsAstralRange + \"]\", $59413fe1d37c7fe4$var$rsRegional = \"(?:\\ud83c[\\udde6-\\uddff]){2}\", $59413fe1d37c7fe4$var$rsSurrPair = \"[\\ud800-\\udbff][\\udc00-\\udfff]\", $59413fe1d37c7fe4$var$rsUpper = \"[\" + $59413fe1d37c7fe4$var$rsUpperRange + \"]\", $59413fe1d37c7fe4$var$rsZWJ = \"\\\\u200d\";\n/** Used to compose unicode regexes. */ var $59413fe1d37c7fe4$var$rsMiscLower = \"(?:\" + $59413fe1d37c7fe4$var$rsLower + \"|\" + $59413fe1d37c7fe4$var$rsMisc + \")\", $59413fe1d37c7fe4$var$rsMiscUpper = \"(?:\" + $59413fe1d37c7fe4$var$rsUpper + \"|\" + $59413fe1d37c7fe4$var$rsMisc + \")\", $59413fe1d37c7fe4$var$rsOptContrLower = \"(?:\" + $59413fe1d37c7fe4$var$rsApos + \"(?:d|ll|m|re|s|t|ve))?\", $59413fe1d37c7fe4$var$rsOptContrUpper = \"(?:\" + $59413fe1d37c7fe4$var$rsApos + \"(?:D|LL|M|RE|S|T|VE))?\", $59413fe1d37c7fe4$var$reOptMod = $59413fe1d37c7fe4$var$rsModifier + \"?\", $59413fe1d37c7fe4$var$rsOptVar = \"[\" + $59413fe1d37c7fe4$var$rsVarRange + \"]?\", $59413fe1d37c7fe4$var$rsOptJoin = \"(?:\" + $59413fe1d37c7fe4$var$rsZWJ + \"(?:\" + [\n $59413fe1d37c7fe4$var$rsNonAstral,\n $59413fe1d37c7fe4$var$rsRegional,\n $59413fe1d37c7fe4$var$rsSurrPair\n].join(\"|\") + \")\" + $59413fe1d37c7fe4$var$rsOptVar + $59413fe1d37c7fe4$var$reOptMod + \")*\", $59413fe1d37c7fe4$var$rsOrdLower = \"\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])\", $59413fe1d37c7fe4$var$rsOrdUpper = \"\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])\", $59413fe1d37c7fe4$var$rsSeq = $59413fe1d37c7fe4$var$rsOptVar + $59413fe1d37c7fe4$var$reOptMod + $59413fe1d37c7fe4$var$rsOptJoin, $59413fe1d37c7fe4$var$rsEmoji = \"(?:\" + [\n $59413fe1d37c7fe4$var$rsDingbat,\n $59413fe1d37c7fe4$var$rsRegional,\n $59413fe1d37c7fe4$var$rsSurrPair\n].join(\"|\") + \")\" + $59413fe1d37c7fe4$var$rsSeq;\n/** Used to match complex or compound words. */ var $59413fe1d37c7fe4$var$reUnicodeWord = RegExp([\n $59413fe1d37c7fe4$var$rsUpper + \"?\" + $59413fe1d37c7fe4$var$rsLower + \"+\" + $59413fe1d37c7fe4$var$rsOptContrLower + \"(?=\" + [\n $59413fe1d37c7fe4$var$rsBreak,\n $59413fe1d37c7fe4$var$rsUpper,\n \"$\"\n ].join(\"|\") + \")\",\n $59413fe1d37c7fe4$var$rsMiscUpper + \"+\" + $59413fe1d37c7fe4$var$rsOptContrUpper + \"(?=\" + [\n $59413fe1d37c7fe4$var$rsBreak,\n $59413fe1d37c7fe4$var$rsUpper + $59413fe1d37c7fe4$var$rsMiscLower,\n \"$\"\n ].join(\"|\") + \")\",\n $59413fe1d37c7fe4$var$rsUpper + \"?\" + $59413fe1d37c7fe4$var$rsMiscLower + \"+\" + $59413fe1d37c7fe4$var$rsOptContrLower,\n $59413fe1d37c7fe4$var$rsUpper + \"+\" + $59413fe1d37c7fe4$var$rsOptContrUpper,\n $59413fe1d37c7fe4$var$rsOrdUpper,\n $59413fe1d37c7fe4$var$rsOrdLower,\n $59413fe1d37c7fe4$var$rsDigits,\n $59413fe1d37c7fe4$var$rsEmoji\n].join(\"|\"), \"g\");\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */ function $59413fe1d37c7fe4$var$unicodeWords(string) {\n return string.match($59413fe1d37c7fe4$var$reUnicodeWord) || [];\n}\n$59413fe1d37c7fe4$exports = $59413fe1d37c7fe4$var$unicodeWords;\n\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */ function $31925c2e0b1bffc8$var$words(string, pattern, guard) {\n string = $ee44123cee6ab817$exports(string);\n pattern = guard ? undefined : pattern;\n if (pattern === undefined) return $5f3800a21019ebc5$exports(string) ? $59413fe1d37c7fe4$exports(string) : $9589882a1b02d2bd$exports(string);\n return string.match(pattern) || [];\n}\n$31925c2e0b1bffc8$exports = $31925c2e0b1bffc8$var$words;\n\n\n/** Used to compose unicode capture groups. */ var $08c10a8642478998$var$rsApos = \"['\\u2019]\";\n/** Used to match apostrophes. */ var $08c10a8642478998$var$reApos = RegExp($08c10a8642478998$var$rsApos, \"g\");\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */ function $08c10a8642478998$var$createCompounder(callback) {\n return function(string) {\n return $1b7ff3cd61804da8$exports($31925c2e0b1bffc8$exports($1f2a8327a9c6cd40$exports(string).replace($08c10a8642478998$var$reApos, \"\")), callback, \"\");\n };\n}\n$08c10a8642478998$exports = $08c10a8642478998$var$createCompounder;\n\n\n/**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */ var $c87ac678829b8e5f$var$kebabCase = $08c10a8642478998$exports(function(result, word, index) {\n return result + (index ? \"-\" : \"\") + word.toLowerCase();\n});\n$c87ac678829b8e5f$exports = $c87ac678829b8e5f$var$kebabCase;\n\n\n/**\n * Loads an external SVG file and returns the DOM tree of its first element.\n *\n * @param {string|URL} uri\n * @param {boolean} clearStyles\n * If true removes the style elements from the file\n * @return {Promise}\n */ async function $22519adc90afc1c6$export$b6a2e78b63791dfa(uri, clearStyles = true) {\n var _svgDoc_querySelectorAll;\n const response = await fetch(uri);\n if (response.status < 200 || response.status >= 300) throw new Error(`Server returned status ${response.status} (${response.statusText}) loading ${new URL(uri).href}.`);\n const svgText = await response.text();\n const div = document.createElement(\"div\");\n div.innerHTML = svgText;\n const svgDoc = div.querySelector(\"svg\");\n if (svgDoc === null) throw new Error(`No SVG element found in ${new URL(uri).href}.`);\n if (clearStyles) (_svgDoc_querySelectorAll = svgDoc.querySelectorAll(\"style\")) === null || _svgDoc_querySelectorAll === void 0 ? void 0 : _svgDoc_querySelectorAll.forEach((s)=>s.remove());\n return svgDoc;\n}\n\n\nfunction $853946bed0db7ade$export$99496351b147462(elem, selector, type) {\n const result = elem.querySelector(selector);\n if (result === null) throw new Error(`No element found matching selector ${selector}.`);\n if (!(result instanceof type)) throw new Error(`Element matching selector ${selector} has the wrong type.`);\n return result;\n}\nfunction $853946bed0db7ade$export$65a5d093667c64b6(elem, selector, type) {\n const results = elem.querySelectorAll(selector);\n results.forEach((result)=>{\n if (!(result instanceof type)) throw new Error(`An element matching selector ${selector} has the wrong type.`);\n });\n return results;\n}\n\n\nvar $eaf19eafa3312639$exports = {};\n\n$eaf19eafa3312639$exports = (parcelRequire(\"9v928\")).getBundleURL(\"kdWl4\") + \"model.f8e270f6.svg\";\n\n\nconst $fee6658e550852f2$var$svgUrl = new URL($eaf19eafa3312639$exports);\nconst $fee6658e550852f2$var$mainFlowIds = [\n \"abandon\",\n \"acquireNewlyProduced\",\n \"acquireRefurbished\",\n \"acquireRepaired\",\n \"acquireUsed\",\n \"disposeBroken\",\n \"disposeHibernating\",\n \"goBroken\",\n \"landfill\",\n \"produceFromNaturalResources\",\n \"produceFromRecycledMaterials\",\n \"recycle\",\n \"refurbish\",\n \"repair\"\n];\nconst $fee6658e550852f2$var$flowVizSigns = {\n abandon: 1,\n acquireNewlyProduced: -1,\n acquireRefurbished: -1,\n acquireRepaired: -1,\n acquireUsed: -1,\n disposeBroken: -1,\n disposeHibernating: -1,\n goBroken: -1,\n landfill: -1,\n produceFromNaturalResources: -1,\n produceFromRecycledMaterials: -1,\n recycle: -1,\n refurbish: -1,\n repair: -1\n};\nconst $fee6658e550852f2$var$dashGap = 30; // FIXME: Calculate from CSS\nconst $fee6658e550852f2$var$lineWidth = 10; // FIXME: Calculate from CSS\nconst $fee6658e550852f2$var$dotRadius = 20; // FIXME: Calculate from CSS\nconst $fee6658e550852f2$var$lineSegmentArea = $fee6658e550852f2$var$lineWidth * $fee6658e550852f2$var$dashGap;\nconst $fee6658e550852f2$var$dotWithoutLineSegmentArea = Math.sqrt($fee6658e550852f2$var$dotRadius ** 2 - $fee6658e550852f2$var$lineWidth ** 2) * $fee6658e550852f2$var$lineWidth;\nconst $fee6658e550852f2$var$averageFlowVizWidth = $fee6658e550852f2$var$lineSegmentArea + $fee6658e550852f2$var$dotWithoutLineSegmentArea;\nconsole.log($fee6658e550852f2$var$lineSegmentArea, $fee6658e550852f2$var$dotWithoutLineSegmentArea, $fee6658e550852f2$var$averageFlowVizWidth);\nconst $fee6658e550852f2$var$quantityScaleFactor = 30000.0;\nclass $fee6658e550852f2$export$2e2bcd8739ae039 {\n updateSvgFlows(deltaMs, stepSize, record) {\n const { flows: flows } = record;\n const flowVizScale = stepSize * ($fee6658e550852f2$var$quantityScaleFactor / record.parameters.numberOfUsers) / $fee6658e550852f2$var$averageFlowVizWidth;\n $fee6658e550852f2$var$mainFlowIds.forEach((id)=>{\n const flow = flows[id];\n const flowVizSign = $fee6658e550852f2$var$flowVizSigns[id];\n const elementId = `${(0, (/*@__PURE__*/$parcel$interopDefault($c87ac678829b8e5f$exports)))(id)}-flow`;\n const element = (0, $853946bed0db7ade$export$99496351b147462)(this.svg, `#${elementId}`, SVGPathElement);\n var _element_getAttribute;\n const lastDashOffset = parseFloat((_element_getAttribute = element.getAttribute(\"stroke-dashoffset\")) !== null && _element_getAttribute !== void 0 ? _element_getAttribute : \"0\");\n // The dash offset step must not be small compared to the dash gap.\n // Otherwise, the flow animation may appear to move backwards.\n const dashOffsetStep = Math.max(-0.3 * $fee6658e550852f2$var$dashGap, Math.min(flowVizSign * (deltaMs * flow) * flowVizScale, 0.1 * $fee6658e550852f2$var$dashGap));\n const dashOffset = (Number.isNaN(lastDashOffset) ? 0 : lastDashOffset) + dashOffsetStep;\n element.setAttribute(\"stroke-dashoffset\", `${dashOffset}`);\n element.setAttribute(\"stroke-dasharray\", `0 ${$fee6658e550852f2$var$dashGap}`);\n });\n }\n updateSvgStocks(deltaMs, stepSize, record) {\n const { stocks: stocks } = record;\n const stockVizScale = $fee6658e550852f2$var$quantityScaleFactor / record.parameters.numberOfUsers;\n this.model.stockIds.forEach((id)=>{\n const elementId = (0, (/*@__PURE__*/$parcel$interopDefault($c87ac678829b8e5f$exports)))(id);\n const element = this.svg.getElementById(elementId);\n if (element === null) throw new Error(`SVG element with id ${elementId} for stock ${id} not found.`);\n if (!(element instanceof SVGCircleElement)) throw new Error(`Stock element for stock ${id} with id ${elementId} is not an SVG circle element.`);\n const stock = stocks[id];\n const radius = Math.sqrt(stock * stockVizScale / Math.PI);\n element.setAttribute(\"r\", `${radius}`);\n });\n }\n updateSvg(deltaMs, stepSize, record) {\n this.updateSvgFlows(deltaMs, stepSize, record);\n this.updateSvgStocks(deltaMs, stepSize, record);\n }\n update(deltaMs, stepSize, record) {\n this.updateSvg(deltaMs, stepSize, record);\n }\n static prepareSvg(model, svg) {\n const createSVGElement = (tagName)=>svg.ownerDocument.createElementNS(\"http://www.w3.org/2000/svg\", tagName);\n svg.classList.add(\"model-visualization\");\n svg.querySelectorAll(\"circle, rect, path, text\").forEach((element)=>{\n element.removeAttribute(\"style\");\n });\n const elementsToRemove = [\n ...svg.children\n ];\n const labelLayer = createSVGElement(\"g\");\n labelLayer.classList.add(\"labels\");\n const supplyLayer = createSVGElement(\"g\");\n supplyLayer.classList.add(\"supplies\");\n const capacityLayer = createSVGElement(\"g\");\n capacityLayer.classList.add(\"capacities\");\n const flowLayer = createSVGElement(\"g\");\n flowLayer.classList.add(\"flows\");\n svg.append(capacityLayer, flowLayer, supplyLayer, labelLayer);\n svg.querySelectorAll(\"text\").forEach((baseElement)=>{\n const clone = baseElement.cloneNode(true);\n clone.classList.add(\"label\");\n labelLayer.append(clone);\n });\n svg.querySelectorAll(\"rect\").forEach((baseElement)=>{\n const clone = baseElement.cloneNode(false);\n clone.classList.add(\"capacity\");\n capacityLayer.append(clone);\n });\n model.stockIds.filter((id)=>id.startsWith(\"supplyOf\")).forEach((id)=>{\n const baseElementId = (0, (/*@__PURE__*/$parcel$interopDefault($c87ac678829b8e5f$exports)))(id.replace(/^supplyOf/, \"\"));\n const baseElement = (0, $853946bed0db7ade$export$99496351b147462)(svg, `#${baseElementId}`, SVGGeometryElement);\n const clone = baseElement.cloneNode(false);\n clone.id = `supply-of-${baseElement.id}`;\n clone.classList.add(\"stock\", \"supply\");\n supplyLayer.append(clone);\n });\n const phonesInUse = (0, $853946bed0db7ade$export$99496351b147462)(svg, \"#phones-in-use\", SVGGeometryElement);\n const phonesInUseClone = phonesInUse.cloneNode(false);\n supplyLayer.append(phonesInUseClone);\n model.stockIds.filter((id)=>id.startsWith(\"capacityOf\")).forEach((id)=>{\n const baseElementId = (0, (/*@__PURE__*/$parcel$interopDefault($c87ac678829b8e5f$exports)))(id.replace(/^capacityOf/, \"\"));\n const baseElement = (0, $853946bed0db7ade$export$99496351b147462)(svg, `#${baseElementId}`, SVGGeometryElement);\n const clone = baseElement.cloneNode(false);\n clone.id = `capacity-of-${baseElementId}`;\n clone.classList.add(\"stock\", \"capacity\");\n capacityLayer.append(clone);\n });\n $fee6658e550852f2$var$mainFlowIds.forEach((id)=>{\n const baseElementId = (0, (/*@__PURE__*/$parcel$interopDefault($c87ac678829b8e5f$exports)))(id);\n const baseElement = (0, $853946bed0db7ade$export$99496351b147462)(svg, `#${baseElementId}`, SVGGeometryElement);\n const edge = baseElement.cloneNode(false);\n edge.id = `${baseElementId}-edge`;\n edge.removeAttribute(\"style\");\n edge.classList.add(\"flow\", \"edge\");\n flowLayer.append(edge);\n const flow = baseElement.cloneNode(false);\n flow.id = `${baseElementId}-flow`;\n flow.removeAttribute(\"style\");\n flow.classList.add(\"flow\", \"anim-edge\");\n flowLayer.append(flow);\n });\n elementsToRemove.forEach((element)=>element.remove());\n }\n static async create(model) {\n const svg = await (0, $22519adc90afc1c6$export$b6a2e78b63791dfa)($fee6658e550852f2$var$svgUrl);\n this.prepareSvg(model, svg);\n return new $fee6658e550852f2$export$2e2bcd8739ae039(model, svg);\n }\n constructor(model, svg){\n this.model = model;\n this.svg = svg;\n this.element = document.createElement(\"div\");\n this.element.append(this.svg);\n }\n}\n\n\nasync function $eeb33a528debb3be$export$3e2b244719956741() {\n return new Promise((resolve)=>{\n const state = document.readyState;\n if (state === \"complete\" || state === \"interactive\") setTimeout(resolve, 0);\n document.addEventListener(\"DOMContentLoaded\", ()=>resolve());\n });\n}\n\n\n\nfunction $0b5cf6504bbda2cd$export$2e2bcd8739ae039(str) {\n if (typeof str !== \"string\") return false;\n if (str.trim() !== str) return false;\n if (str.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/) === null) return false;\n return true;\n}\n\n\nclass $279b597edf84dcbf$export$2e2bcd8739ae039 {\n constructor(i18nKey){\n this.i18nKey = i18nKey;\n }\n}\n\n\nclass $0d00df7a0e9c1179$export$2e2bcd8739ae039 extends (0, $279b597edf84dcbf$export$2e2bcd8739ae039) {\n applyTo(parameters) {\n this.callable(parameters);\n return parameters;\n }\n constructor(i18nKey, callable){\n super(i18nKey);\n this.callable = callable;\n }\n}\n\n\nclass $c66a53d1ef21207e$export$2e2bcd8739ae039 extends (0, $0d00df7a0e9c1179$export$2e2bcd8739ae039) {\n static createFunction(parameterIds, script) {\n parameterIds.forEach((parameterId)=>{\n if (!(0, $0b5cf6504bbda2cd$export$2e2bcd8739ae039)(parameterId)) throw new Error(`Parameter name '${parameterId}' can not be used as a variable`);\n });\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const wrappedScript = new Function(script).toString();\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const func = new Function(`{ ${parameterIds.join(\", \")} }`, `(${wrappedScript})(); return { ${parameterIds.join(\", \")} }`);\n return (parameters)=>{\n const transformedParameters = func(parameters);\n Object.assign(parameters, transformedParameters);\n return parameters;\n };\n }\n constructor(i18nKey, parameterIds, script){\n super(i18nKey, $c66a53d1ef21207e$export$2e2bcd8739ae039.createFunction(parameterIds, script));\n this.script = script;\n }\n}\n\n\nconst $157dc5a8c12caacb$var$initialParameters = {\n abandonExcessRate: 0.5,\n abandonRate: 0.02,\n acquireRate: 1.0,\n breakRate: 0.01,\n capacityAdjustmentRate: 0.05,\n disposeIncentive: 1.5,\n disposeRate: 0.5,\n landfillIncentive: 1.0,\n landfillRate: 1.0,\n naturalResourcesIncentive: 1.5,\n newPhoneProductionRate: 1.0,\n newlyProducedPhoneIncentive: 2,\n numberOfUsers: 1000000,\n phonesPerUserGoal: 1.2,\n recycleRate: 1.0,\n recyclingIncentive: 0.25,\n refurbishmentIncentive: 0.25,\n refurbishmentRate: 1.0,\n repairIncentive: 0.5,\n repairRate: 1.0,\n reuseIncentive: 0.25\n};\nasync function $157dc5a8c12caacb$var$init() {\n const model = new (0, $995a1f169f5e286f$export$2e2bcd8739ae039)();\n const modelSimulator = new (0, $2495d722a6806b18$export$2e2bcd8739ae039)(model, // FIXME: It should be possible to pass CircularEconomyModel.initialStocks directly, but TypeScript does not complain.\n {\n ...(0, $995a1f169f5e286f$export$2e2bcd8739ae039).initialStocks\n }, {\n ...$157dc5a8c12caacb$var$initialParameters\n }, 0.0, 0.1);\n const availableParameterTransformsContainer = (0, $853946bed0db7ade$export$99496351b147462)(document, \"#parameter-transforms .available\", HTMLElement);\n const activeParameterTransformsContainer = (0, $853946bed0db7ade$export$99496351b147462)(document, \"#parameter-transforms .active\", HTMLElement);\n const availableParameterTransforms = new Map();\n function getDistinctParameters(p1, p2) {\n const result = {};\n model.parameterIds.forEach((id)=>{\n if (p1[id] !== p2[id]) result[id] = p2[id];\n });\n return result;\n }\n function updateParameters() {\n const parameters = {\n ...$157dc5a8c12caacb$var$initialParameters\n };\n [\n ...activeParameterTransformsContainer.children\n ].forEach((e)=>{\n (0, $GE7rZ.strict)(e instanceof HTMLElement);\n const id = e.getAttribute(\"data-id\");\n (0, $GE7rZ.strict)(id !== null);\n const parameterTransform = availableParameterTransforms.get(id);\n (0, $GE7rZ.strict)(parameterTransform !== undefined);\n const backupParameters = {\n ...parameters\n };\n parameterTransform.applyTo(parameters);\n const distinctParameters = getDistinctParameters(backupParameters, parameters);\n e.title = `${parameterTransform.script}\\n\\n${JSON.stringify(distinctParameters, null, 2)}\\n\\n${JSON.stringify(parameters, null, 2)}`;\n });\n Object.assign(modelSimulator.parameters, parameters);\n }\n (0, $c8f95463ff5f043e$export$2e2bcd8739ae039).create(availableParameterTransformsContainer, {\n group: {\n name: \"sharedParameterTransforms\",\n pull: \"clone\",\n put: false\n }\n });\n (0, $c8f95463ff5f043e$export$2e2bcd8739ae039).create(activeParameterTransformsContainer, {\n group: {\n name: \"sharedParameterTransforms\"\n },\n removeOnSpill: true,\n onSort: ()=>updateParameters(),\n onSpill: (event)=>{\n event.item.remove();\n updateParameters();\n }\n });\n const parameterTransforms = {\n create: (id, script)=>{\n if (availableParameterTransforms.has(id)) throw new Error(`Parameter transform with id '${id}' already exists`);\n availableParameterTransforms.set(id, new (0, $c66a53d1ef21207e$export$2e2bcd8739ae039)(\"none\", model.parameterIds, script));\n const dummyElement = document.createElement(\"div\");\n dummyElement.innerHTML = `
${id}
`;\n const parameterTransformElement = dummyElement.firstChild;\n (0, $GE7rZ.strict)(parameterTransformElement !== null);\n availableParameterTransformsContainer.append(parameterTransformElement);\n },\n destroy: (id)=>{\n availableParameterTransforms.delete(id);\n }\n };\n (0, $853946bed0db7ade$export$99496351b147462)(document, \"#add-parameter-transform\", HTMLElement).addEventListener(\"click\", ()=>{\n const idElement = (0, $853946bed0db7ade$export$99496351b147462)(document, \"#parameter-transform-id\", HTMLInputElement);\n const id = idElement.value;\n const scriptElement = (0, $853946bed0db7ade$export$99496351b147462)(document, \"#parameter-transform-script\", HTMLTextAreaElement);\n const script = scriptElement.value;\n parameterTransforms.create(id, script);\n });\n const sliderContainer = (0, $853946bed0db7ade$export$99496351b147462)(document, \"#sliders\", HTMLElement);\n model.parameterIds.filter((id)=>id !== \"numberOfUsers\").forEach((id)=>{\n const sliderElementLabel = document.createElement(\"div\");\n const sliderElement = document.createElement(\"input\");\n sliderElement.type = \"range\";\n sliderElement.min = \"0\";\n sliderElement.max = \"4\";\n sliderElement.step = \"0.001\";\n sliderElement.value = `${$157dc5a8c12caacb$var$initialParameters[id]}`;\n function updateSliderValue() {\n $157dc5a8c12caacb$var$initialParameters[id] = Number.parseFloat(sliderElement.value);\n sliderElementLabel.innerText = `${id} = ${$157dc5a8c12caacb$var$initialParameters[id]}`;\n updateParameters();\n }\n updateSliderValue();\n sliderElement.addEventListener(\"input\", updateSliderValue);\n const sliderWrapperElement = document.createElement(\"div\");\n sliderWrapperElement.append(sliderElementLabel, sliderElement);\n sliderContainer.append(sliderWrapperElement);\n });\n let circularityIndex = 0;\n const circularityIndexElement = (0, $853946bed0db7ade$export$99496351b147462)(document, \"#circularity-index\", HTMLElement);\n let userSatisfaction = 0;\n const userSatisfactionElement = (0, $853946bed0db7ade$export$99496351b147462)(document, \"#user-satisfaction\", HTMLElement);\n const visualization = await (0, $fee6658e550852f2$export$2e2bcd8739ae039).create(model);\n document.body.prepend(visualization.element);\n function toChartRecord(record) {\n return (0, $995a1f169f5e286f$export$2e2bcd8739ae039).elementIds.map((key)=>Object.entries(record[key]).map(([id, value])=>({\n id: id,\n value: value\n }))).reduce((cur, acc)=>[\n ...cur,\n ...acc\n ], []);\n }\n const initialChartRecord = toChartRecord(modelSimulator.record);\n const chartCanvas = document.getElementById(\"chart\");\n (0, $GE7rZ.strict)(chartCanvas !== null, \"chart element not found\");\n const chart = new (0, $90463797e5db2d19$export$2e2bcd8739ae039)(chartCanvas, {\n type: \"bar\",\n data: {\n labels: initialChartRecord.map((row)=>row.id),\n datasets: [\n {\n label: \"Values\",\n data: initialChartRecord.map((row)=>row.value)\n }\n ]\n },\n options: {\n animation: false\n }\n });\n function updateIndices(record) {\n const smoothingFactor = 0.5;\n const { phonesInUse: phonesInUse } = record.stocks;\n const { produceFromNaturalResources: produceFromNaturalResources, acquireNewlyProduced: acquireNewlyProduced, acquireUsed: acquireUsed, acquireRepaired: acquireRepaired, acquireRefurbished: acquireRefurbished, disposeHibernating: disposeHibernating, disposeBroken: disposeBroken, landfill: landfill } = record.flows;\n const { phoneGoal: phoneGoal } = record.variables;\n const naturalResourcesShare = Math.min(1.0, produceFromNaturalResources / (acquireNewlyProduced + acquireUsed + acquireRepaired + acquireRefurbished));\n const landfillShare = Math.min(1.0, landfill / (disposeHibernating + disposeBroken));\n const circularityIndexTarget = Math.min(1.0 - naturalResourcesShare, 1.0 - landfillShare);\n circularityIndex += (circularityIndexTarget - circularityIndex) * smoothingFactor;\n circularityIndexElement.innerText = `${(circularityIndex * 100).toFixed(1)}%`;\n const userSatisfactionTarget = phonesInUse < phoneGoal ? phonesInUse / phoneGoal : phoneGoal / phonesInUse;\n userSatisfaction += (userSatisfactionTarget - userSatisfaction) * smoothingFactor;\n userSatisfactionElement.innerText = `${(userSatisfaction * 100).toFixed(1)}%`;\n }\n function stepSimulation(deltaMs) {\n // TODO: pass deltaMs to modelSimulator.step()\n const record = modelSimulator.step();\n updateIndices(record);\n const chartRecord = toChartRecord(record);\n // console.log(chartRecord);\n chart.data.datasets[0].data = chartRecord.map((row)=>row.value);\n chart.update();\n visualization.update(deltaMs, modelSimulator.h, record);\n }\n let running = false;\n const runCheckBox = document.getElementById(\"run\");\n (0, $GE7rZ.strict)(runCheckBox !== null, \"run checkbox not found\");\n async function loopSimulation() {\n running = true;\n let lastTimeMs = null;\n while(runCheckBox.checked){\n // eslint-disable-next-line no-await-in-loop\n const currentTimeMs = await (0, $918fc77ea978604c$export$1402cba6a733f33a)();\n const deltaMs = lastTimeMs === null ? 0 : currentTimeMs - lastTimeMs;\n stepSimulation(deltaMs);\n lastTimeMs = currentTimeMs;\n }\n running = false;\n }\n runCheckBox.addEventListener(\"input\", ()=>{\n if (!running) loopSimulation().catch((err)=>{\n throw err;\n });\n });\n stepSimulation(0);\n const circularEconomyApi = {\n model: model,\n modelSimulator: modelSimulator,\n parameterTransforms: parameterTransforms\n };\n return circularEconomyApi;\n}\nwindow.circularEconomy = (0, $eeb33a528debb3be$export$3e2b244719956741)().then($157dc5a8c12caacb$var$init);\n\n\n//# sourceMappingURL=index.97bcdae1.js.map\n","// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b\n\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nvar _require = require('./internal/errors'),\n _require$codes = _require.codes,\n ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE,\n ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;\nvar AssertionError = require('./internal/assert/assertion_error');\nvar _require2 = require('util/'),\n inspect = _require2.inspect;\nvar _require$types = require('util/').types,\n isPromise = _require$types.isPromise,\n isRegExp = _require$types.isRegExp;\nvar objectAssign = require('object.assign/polyfill')();\nvar objectIs = require('object-is/polyfill')();\nvar RegExpPrototypeTest = require('call-bind/callBound')('RegExp.prototype.test');\nvar errorCache = new Map();\nvar isDeepEqual;\nvar isDeepStrictEqual;\nvar parseExpressionAt;\nvar findNodeAround;\nvar decoder;\nfunction lazyLoadComparison() {\n var comparison = require('./internal/util/comparisons');\n isDeepEqual = comparison.isDeepEqual;\n isDeepStrictEqual = comparison.isDeepStrictEqual;\n}\n\n// Escape control characters but not \\n and \\t to keep the line breaks and\n// indentation intact.\n// eslint-disable-next-line no-control-regex\nvar escapeSequencesRegExp = /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/g;\nvar meta = [\"\\\\u0000\", \"\\\\u0001\", \"\\\\u0002\", \"\\\\u0003\", \"\\\\u0004\", \"\\\\u0005\", \"\\\\u0006\", \"\\\\u0007\", '\\\\b', '', '', \"\\\\u000b\", '\\\\f', '', \"\\\\u000e\", \"\\\\u000f\", \"\\\\u0010\", \"\\\\u0011\", \"\\\\u0012\", \"\\\\u0013\", \"\\\\u0014\", \"\\\\u0015\", \"\\\\u0016\", \"\\\\u0017\", \"\\\\u0018\", \"\\\\u0019\", \"\\\\u001a\", \"\\\\u001b\", \"\\\\u001c\", \"\\\\u001d\", \"\\\\u001e\", \"\\\\u001f\"];\nvar escapeFn = function escapeFn(str) {\n return meta[str.charCodeAt(0)];\n};\nvar warned = false;\n\n// The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\nvar NO_EXCEPTION_SENTINEL = {};\n\n// All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction innerFail(obj) {\n if (obj.message instanceof Error) throw obj.message;\n throw new AssertionError(obj);\n}\nfunction fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length;\n var internalMessage;\n if (argsLen === 0) {\n internalMessage = 'Failed';\n } else if (argsLen === 1) {\n message = actual;\n actual = undefined;\n } else {\n if (warned === false) {\n warned = true;\n var warn = process.emitWarning ? process.emitWarning : console.warn.bind(console);\n warn('assert.fail() with more than one argument is deprecated. ' + 'Please use assert.strictEqual() instead or only pass a message.', 'DeprecationWarning', 'DEP0094');\n }\n if (argsLen === 2) operator = '!=';\n }\n if (message instanceof Error) throw message;\n var errArgs = {\n actual: actual,\n expected: expected,\n operator: operator === undefined ? 'fail' : operator,\n stackStartFn: stackStartFn || fail\n };\n if (message !== undefined) {\n errArgs.message = message;\n }\n var err = new AssertionError(errArgs);\n if (internalMessage) {\n err.message = internalMessage;\n err.generatedMessage = true;\n }\n throw err;\n}\nassert.fail = fail;\n\n// The AssertionError is defined in internal/error.\nassert.AssertionError = AssertionError;\nfunction innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = false;\n if (argLen === 0) {\n generatedMessage = true;\n message = 'No value argument passed to `assert.ok()`';\n } else if (message instanceof Error) {\n throw message;\n }\n var err = new AssertionError({\n actual: value,\n expected: true,\n message: message,\n operator: '==',\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\n\n// Pure assertion tests whether a value is truthy, as determined\n// by !!value.\nfunction ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n innerOk.apply(void 0, [ok, args.length].concat(args));\n}\nassert.ok = ok;\n\n// The equality assertion tests shallow, coercive equality with ==.\n/* eslint-disable no-restricted-properties */\nassert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n // eslint-disable-next-line eqeqeq\n if (actual != expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '==',\n stackStartFn: equal\n });\n }\n};\n\n// The non-equality assertion tests for whether two objects are not\n// equal with !=.\nassert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n // eslint-disable-next-line eqeqeq\n if (actual == expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '!=',\n stackStartFn: notEqual\n });\n }\n};\n\n// The equivalence assertion tests a deep equality relation.\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (!isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepEqual',\n stackStartFn: deepEqual\n });\n }\n};\n\n// The non-equivalence assertion tests for any deep inequality.\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepEqual',\n stackStartFn: notDeepEqual\n });\n }\n};\n/* eslint-enable */\n\nassert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (!isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepStrictEqual',\n stackStartFn: deepStrictEqual\n });\n }\n};\nassert.notDeepStrictEqual = notDeepStrictEqual;\nfunction notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepStrictEqual',\n stackStartFn: notDeepStrictEqual\n });\n }\n}\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (!objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'strictEqual',\n stackStartFn: strictEqual\n });\n }\n};\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notStrictEqual',\n stackStartFn: notStrictEqual\n });\n }\n};\nvar Comparison = /*#__PURE__*/_createClass(function Comparison(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison);\n keys.forEach(function (key) {\n if (key in obj) {\n if (actual !== undefined && typeof actual[key] === 'string' && isRegExp(obj[key]) && RegExpPrototypeTest(obj[key], actual[key])) {\n _this[key] = actual[key];\n } else {\n _this[key] = obj[key];\n }\n }\n });\n});\nfunction compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) {\n if (!message) {\n // Create placeholder objects to create a nice output.\n var a = new Comparison(actual, keys);\n var b = new Comparison(expected, keys, actual);\n var err = new AssertionError({\n actual: a,\n expected: b,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.actual = actual;\n err.expected = expected;\n err.operator = fn.name;\n throw err;\n }\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n}\nfunction expectedException(actual, expected, msg, fn) {\n if (typeof expected !== 'function') {\n if (isRegExp(expected)) return RegExpPrototypeTest(expected, actual);\n // assert.doesNotThrow does not accept objects.\n if (arguments.length === 2) {\n throw new ERR_INVALID_ARG_TYPE('expected', ['Function', 'RegExp'], expected);\n }\n\n // Handle primitives properly.\n if (_typeof(actual) !== 'object' || actual === null) {\n var err = new AssertionError({\n actual: actual,\n expected: expected,\n message: msg,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.operator = fn.name;\n throw err;\n }\n var keys = Object.keys(expected);\n // Special handle errors to make sure the name and the message are compared\n // as well.\n if (expected instanceof Error) {\n keys.push('name', 'message');\n } else if (keys.length === 0) {\n throw new ERR_INVALID_ARG_VALUE('error', expected, 'may not be an empty object');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n keys.forEach(function (key) {\n if (typeof actual[key] === 'string' && isRegExp(expected[key]) && RegExpPrototypeTest(expected[key], actual[key])) {\n return;\n }\n compareExceptionKey(actual, expected, key, msg, keys, fn);\n });\n return true;\n }\n // Guard instanceof against arrow functions as they don't have a prototype.\n if (expected.prototype !== undefined && actual instanceof expected) {\n return true;\n }\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n return expected.call({}, actual) === true;\n}\nfunction getActual(fn) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', 'Function', fn);\n }\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n}\nfunction checkIsPromise(obj) {\n // Accept native ES6 promises and promises that are implemented in a similar\n // way. Do not accept thenables that use a function as `obj` and that have no\n // `catch` handler.\n\n // TODO: thenables are checked up until they have the correct methods,\n // but according to documentation, the `then` method should receive\n // the `fulfill` and `reject` arguments as well or it may be never resolved.\n\n return isPromise(obj) || obj !== null && _typeof(obj) === 'object' && typeof obj.then === 'function' && typeof obj.catch === 'function';\n}\nfunction waitForActual(promiseFn) {\n return Promise.resolve().then(function () {\n var resultPromise;\n if (typeof promiseFn === 'function') {\n // Return a rejected promise if `promiseFn` throws synchronously.\n resultPromise = promiseFn();\n // Fail in case no promise is returned.\n if (!checkIsPromise(resultPromise)) {\n throw new ERR_INVALID_RETURN_VALUE('instance of Promise', 'promiseFn', resultPromise);\n }\n } else if (checkIsPromise(promiseFn)) {\n resultPromise = promiseFn;\n } else {\n throw new ERR_INVALID_ARG_TYPE('promiseFn', ['Function', 'Promise'], promiseFn);\n }\n return Promise.resolve().then(function () {\n return resultPromise;\n }).then(function () {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function (e) {\n return e;\n });\n });\n}\nfunction expectsError(stackStartFn, actual, error, message) {\n if (typeof error === 'string') {\n if (arguments.length === 4) {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n if (_typeof(actual) === 'object' && actual !== null) {\n if (actual.message === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error message \\\"\".concat(actual.message, \"\\\" is identical to the message.\"));\n }\n } else if (actual === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error \\\"\".concat(actual, \"\\\" is identical to the message.\"));\n }\n message = error;\n error = undefined;\n } else if (error != null && _typeof(error) !== 'object' && typeof error !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = '';\n if (error && error.name) {\n details += \" (\".concat(error.name, \")\");\n }\n details += message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'rejects' ? 'rejection' : 'exception';\n innerFail({\n actual: undefined,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn: stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn)) {\n throw actual;\n }\n}\nfunction expectsNoError(stackStartFn, actual, error, message) {\n if (actual === NO_EXCEPTION_SENTINEL) return;\n if (typeof error === 'string') {\n message = error;\n error = undefined;\n }\n if (!error || expectedException(actual, error)) {\n var details = message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'doesNotReject' ? 'rejection' : 'exception';\n innerFail({\n actual: actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, \"\\n\") + \"Actual message: \\\"\".concat(actual && actual.message, \"\\\"\"),\n stackStartFn: stackStartFn\n });\n }\n throw actual;\n}\nassert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n};\nassert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n return waitForActual(promiseFn).then(function (result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n};\nassert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n};\nassert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {\n args[_key5 - 1] = arguments[_key5];\n }\n return waitForActual(fn).then(function (result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n};\nassert.ifError = function ifError(err) {\n if (err !== null && err !== undefined) {\n var message = 'ifError got unwanted exception: ';\n if (_typeof(err) === 'object' && typeof err.message === 'string') {\n if (err.message.length === 0 && err.constructor) {\n message += err.constructor.name;\n } else {\n message += err.message;\n }\n } else {\n message += inspect(err);\n }\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: 'ifError',\n message: message,\n stackStartFn: ifError\n });\n\n // Make sure we actually have a stack trace!\n var origStack = err.stack;\n if (typeof origStack === 'string') {\n // This will remove any duplicated frames from the error frames taken\n // from within `ifError` and add the original error frames to the newly\n // created ones.\n var tmp2 = origStack.split('\\n');\n tmp2.shift();\n // Filter all frames existing in err.stack.\n var tmp1 = newErr.stack.split('\\n');\n for (var i = 0; i < tmp2.length; i++) {\n // Find the first occurrence of the frame.\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n // Only keep new frames.\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join('\\n'), \"\\n\").concat(tmp2.join('\\n'));\n }\n throw newErr;\n }\n};\n\n// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a871df3dfb8ea663ef5e1f8f62701ec51384ecb\nfunction internalMatch(string, regexp, message, fn, fnName) {\n if (!isRegExp(regexp)) {\n throw new ERR_INVALID_ARG_TYPE('regexp', 'RegExp', regexp);\n }\n var match = fnName === 'match';\n if (typeof string !== 'string' || RegExpPrototypeTest(regexp, string) !== match) {\n if (message instanceof Error) {\n throw message;\n }\n var generatedMessage = !message;\n\n // 'The input was expected to not match the regular expression ' +\n message = message || (typeof string !== 'string' ? 'The \"string\" argument must be of type string. Received type ' + \"\".concat(_typeof(string), \" (\").concat(inspect(string), \")\") : (match ? 'The input did not match the regular expression ' : 'The input was expected to not match the regular expression ') + \"\".concat(inspect(regexp), \". Input:\\n\\n\").concat(inspect(string), \"\\n\"));\n var err = new AssertionError({\n actual: string,\n expected: regexp,\n message: message,\n operator: fnName,\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\nassert.match = function match(string, regexp, message) {\n internalMatch(string, regexp, message, match, 'match');\n};\nassert.doesNotMatch = function doesNotMatch(string, regexp, message) {\n internalMatch(string, regexp, message, doesNotMatch, 'doesNotMatch');\n};\n\n// Expose a strict only variant of assert\nfunction strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n innerOk.apply(void 0, [strict, args.length].concat(args));\n}\nassert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n});\nassert.strict.strict = assert.strict;","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","// Currently in sync with Node.js lib/internal/errors.js\n// https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f\n\n/* eslint node-core/documented-errors: \"error\" */\n/* eslint node-core/alphabetize-errors: \"error\" */\n/* eslint node-core/prefer-util-format-errors: \"error\" */\n\n'use strict';\n\n// The whole point behind this internal module is to allow Node.js to no\n// longer be forced to treat every error message change as a semver-major\n// change. The NodeError classes here all expose a `code` property whose\n// value statically and permanently identifies the error. While the error\n// message may change, the code should not.\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar codes = {};\n\n// Lazy loaded\nvar assert;\nvar util;\nfunction createErrorType(code, message, Base) {\n if (!Base) {\n Base = Error;\n }\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === 'string') {\n return message;\n } else {\n return message(arg1, arg2, arg3);\n }\n }\n var NodeError = /*#__PURE__*/function (_Base) {\n _inherits(NodeError, _Base);\n var _super = _createSuper(NodeError);\n function NodeError(arg1, arg2, arg3) {\n var _this;\n _classCallCheck(this, NodeError);\n _this = _super.call(this, getMessage(arg1, arg2, arg3));\n _this.code = code;\n return _this;\n }\n return _createClass(NodeError);\n }(Base);\n codes[code] = NodeError;\n}\n\n// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\nfunction oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function (i) {\n return String(i);\n });\n if (len > 2) {\n return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(', '), \", or \") + expected[len - 1];\n } else if (len === 2) {\n return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n } else {\n return \"of \".concat(thing, \" \").concat(expected[0]);\n }\n } else {\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\nfunction startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n return str.substring(this_len - search.length, this_len) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\nfunction includes(str, search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n if (start + search.length > str.length) {\n return false;\n } else {\n return str.indexOf(search, start) !== -1;\n }\n}\ncreateErrorType('ERR_AMBIGUOUS_ARGUMENT', 'The \"%s\" argument is ambiguous. %s', TypeError);\ncreateErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {\n if (assert === undefined) assert = require('../assert');\n assert(typeof name === 'string', \"'name' must be a string\");\n\n // determiner: 'must be' or 'must not be'\n var determiner;\n if (typeof expected === 'string' && startsWith(expected, 'not ')) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n } else {\n determiner = 'must be';\n }\n var msg;\n if (endsWith(name, ' argument')) {\n // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } else {\n var type = includes(name, '.') ? 'property' : 'argument';\n msg = \"The \\\"\".concat(name, \"\\\" \").concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n }\n\n // TODO(BridgeAR): Improve the output by showing `null` and similar.\n msg += \". Received type \".concat(_typeof(actual));\n return msg;\n}, TypeError);\ncreateErrorType('ERR_INVALID_ARG_VALUE', function (name, value) {\n var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'is invalid';\n if (util === undefined) util = require('util/');\n var inspected = util.inspect(value);\n if (inspected.length > 128) {\n inspected = \"\".concat(inspected.slice(0, 128), \"...\");\n }\n return \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n}, TypeError, RangeError);\ncreateErrorType('ERR_INVALID_RETURN_VALUE', function (input, name, value) {\n var type;\n if (value && value.constructor && value.constructor.name) {\n type = \"instance of \".concat(value.constructor.name);\n } else {\n type = \"type \".concat(_typeof(value));\n }\n return \"Expected \".concat(input, \" to be returned from the \\\"\").concat(name, \"\\\"\") + \" function but got \".concat(type, \".\");\n}, TypeError);\ncreateErrorType('ERR_MISSING_ARGS', function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (assert === undefined) assert = require('../assert');\n assert(args.length > 0, 'At least one arg needs to be specified');\n var msg = 'The ';\n var len = args.length;\n args = args.map(function (a) {\n return \"\\\"\".concat(a, \"\\\"\");\n });\n switch (len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(', ');\n msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n}, TypeError);\nmodule.exports.codes = codes;","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||\n function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for (var i = 0; i < keys.length; i++) {\n descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n }\n return descriptors;\n };\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n if (typeof process !== 'undefined' && process.noDeprecation === true) {\n return fn;\n }\n\n // Allow for deprecating things in the process of starting up.\n if (typeof process === 'undefined') {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnvRegex = /^$/;\n\nif (process.env.NODE_DEBUG) {\n var debugEnv = process.env.NODE_DEBUG;\n debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+?.]/g, '\\\\$&')\n .replace(/\\*/g, '.*')\n .replace(/,/g, '$|^')\n .toUpperCase();\n debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i');\n}\nexports.debuglog = function(set) {\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').slice(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.slice(1, -1);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexports.types = require('./support/types');\n\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\nexports.types.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\nexports.types.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\nexports.types.isNativeError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nvar kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;\n\nexports.promisify = function promisify(original) {\n if (typeof original !== 'function')\n throw new TypeError('The \"original\" argument must be of type Function');\n\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== 'function') {\n throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n }\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return fn;\n }\n\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function (resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n args.push(function (err, value) {\n if (err) {\n promiseReject(err);\n } else {\n promiseResolve(value);\n }\n });\n\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n\n return promise;\n }\n\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n\n if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return Object.defineProperties(\n fn,\n getOwnPropertyDescriptors(original)\n );\n}\n\nexports.promisify.custom = kCustomPromisifiedSymbol\n\nfunction callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error('Promise was rejected with a falsy value');\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\n\nfunction callbackify(original) {\n if (typeof original !== 'function') {\n throw new TypeError('The \"original\" argument must be of type Function');\n }\n\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args)\n .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) },\n function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) });\n }\n\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified,\n getOwnPropertyDescriptors(original));\n return callbackified;\n}\nexports.callbackify = callbackify;\n","// Currently in sync with Node.js lib/internal/util/types.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\n'use strict';\n\nvar isArgumentsObject = require('is-arguments');\nvar isGeneratorFunction = require('is-generator-function');\nvar whichTypedArray = require('which-typed-array');\nvar isTypedArray = require('is-typed-array');\n\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\n\nvar BigIntSupported = typeof BigInt !== 'undefined';\nvar SymbolSupported = typeof Symbol !== 'undefined';\n\nvar ObjectToString = uncurryThis(Object.prototype.toString);\n\nvar numberValue = uncurryThis(Number.prototype.valueOf);\nvar stringValue = uncurryThis(String.prototype.valueOf);\nvar booleanValue = uncurryThis(Boolean.prototype.valueOf);\n\nif (BigIntSupported) {\n var bigIntValue = uncurryThis(BigInt.prototype.valueOf);\n}\n\nif (SymbolSupported) {\n var symbolValue = uncurryThis(Symbol.prototype.valueOf);\n}\n\nfunction checkBoxedPrimitive(value, prototypeValueOf) {\n if (typeof value !== 'object') {\n return false;\n }\n try {\n prototypeValueOf(value);\n return true;\n } catch(e) {\n return false;\n }\n}\n\nexports.isArgumentsObject = isArgumentsObject;\nexports.isGeneratorFunction = isGeneratorFunction;\nexports.isTypedArray = isTypedArray;\n\n// Taken from here and modified for better browser support\n// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js\nfunction isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}\nexports.isPromise = isPromise;\n\nfunction isArrayBufferView(value) {\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n return ArrayBuffer.isView(value);\n }\n\n return (\n isTypedArray(value) ||\n isDataView(value)\n );\n}\nexports.isArrayBufferView = isArrayBufferView;\n\n\nfunction isUint8Array(value) {\n return whichTypedArray(value) === 'Uint8Array';\n}\nexports.isUint8Array = isUint8Array;\n\nfunction isUint8ClampedArray(value) {\n return whichTypedArray(value) === 'Uint8ClampedArray';\n}\nexports.isUint8ClampedArray = isUint8ClampedArray;\n\nfunction isUint16Array(value) {\n return whichTypedArray(value) === 'Uint16Array';\n}\nexports.isUint16Array = isUint16Array;\n\nfunction isUint32Array(value) {\n return whichTypedArray(value) === 'Uint32Array';\n}\nexports.isUint32Array = isUint32Array;\n\nfunction isInt8Array(value) {\n return whichTypedArray(value) === 'Int8Array';\n}\nexports.isInt8Array = isInt8Array;\n\nfunction isInt16Array(value) {\n return whichTypedArray(value) === 'Int16Array';\n}\nexports.isInt16Array = isInt16Array;\n\nfunction isInt32Array(value) {\n return whichTypedArray(value) === 'Int32Array';\n}\nexports.isInt32Array = isInt32Array;\n\nfunction isFloat32Array(value) {\n return whichTypedArray(value) === 'Float32Array';\n}\nexports.isFloat32Array = isFloat32Array;\n\nfunction isFloat64Array(value) {\n return whichTypedArray(value) === 'Float64Array';\n}\nexports.isFloat64Array = isFloat64Array;\n\nfunction isBigInt64Array(value) {\n return whichTypedArray(value) === 'BigInt64Array';\n}\nexports.isBigInt64Array = isBigInt64Array;\n\nfunction isBigUint64Array(value) {\n return whichTypedArray(value) === 'BigUint64Array';\n}\nexports.isBigUint64Array = isBigUint64Array;\n\nfunction isMapToString(value) {\n return ObjectToString(value) === '[object Map]';\n}\nisMapToString.working = (\n typeof Map !== 'undefined' &&\n isMapToString(new Map())\n);\n\nfunction isMap(value) {\n if (typeof Map === 'undefined') {\n return false;\n }\n\n return isMapToString.working\n ? isMapToString(value)\n : value instanceof Map;\n}\nexports.isMap = isMap;\n\nfunction isSetToString(value) {\n return ObjectToString(value) === '[object Set]';\n}\nisSetToString.working = (\n typeof Set !== 'undefined' &&\n isSetToString(new Set())\n);\nfunction isSet(value) {\n if (typeof Set === 'undefined') {\n return false;\n }\n\n return isSetToString.working\n ? isSetToString(value)\n : value instanceof Set;\n}\nexports.isSet = isSet;\n\nfunction isWeakMapToString(value) {\n return ObjectToString(value) === '[object WeakMap]';\n}\nisWeakMapToString.working = (\n typeof WeakMap !== 'undefined' &&\n isWeakMapToString(new WeakMap())\n);\nfunction isWeakMap(value) {\n if (typeof WeakMap === 'undefined') {\n return false;\n }\n\n return isWeakMapToString.working\n ? isWeakMapToString(value)\n : value instanceof WeakMap;\n}\nexports.isWeakMap = isWeakMap;\n\nfunction isWeakSetToString(value) {\n return ObjectToString(value) === '[object WeakSet]';\n}\nisWeakSetToString.working = (\n typeof WeakSet !== 'undefined' &&\n isWeakSetToString(new WeakSet())\n);\nfunction isWeakSet(value) {\n return isWeakSetToString(value);\n}\nexports.isWeakSet = isWeakSet;\n\nfunction isArrayBufferToString(value) {\n return ObjectToString(value) === '[object ArrayBuffer]';\n}\nisArrayBufferToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n isArrayBufferToString(new ArrayBuffer())\n);\nfunction isArrayBuffer(value) {\n if (typeof ArrayBuffer === 'undefined') {\n return false;\n }\n\n return isArrayBufferToString.working\n ? isArrayBufferToString(value)\n : value instanceof ArrayBuffer;\n}\nexports.isArrayBuffer = isArrayBuffer;\n\nfunction isDataViewToString(value) {\n return ObjectToString(value) === '[object DataView]';\n}\nisDataViewToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n typeof DataView !== 'undefined' &&\n isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1))\n);\nfunction isDataView(value) {\n if (typeof DataView === 'undefined') {\n return false;\n }\n\n return isDataViewToString.working\n ? isDataViewToString(value)\n : value instanceof DataView;\n}\nexports.isDataView = isDataView;\n\n// Store a copy of SharedArrayBuffer in case it's deleted elsewhere\nvar SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined;\nfunction isSharedArrayBufferToString(value) {\n return ObjectToString(value) === '[object SharedArrayBuffer]';\n}\nfunction isSharedArrayBuffer(value) {\n if (typeof SharedArrayBufferCopy === 'undefined') {\n return false;\n }\n\n if (typeof isSharedArrayBufferToString.working === 'undefined') {\n isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());\n }\n\n return isSharedArrayBufferToString.working\n ? isSharedArrayBufferToString(value)\n : value instanceof SharedArrayBufferCopy;\n}\nexports.isSharedArrayBuffer = isSharedArrayBuffer;\n\nfunction isAsyncFunction(value) {\n return ObjectToString(value) === '[object AsyncFunction]';\n}\nexports.isAsyncFunction = isAsyncFunction;\n\nfunction isMapIterator(value) {\n return ObjectToString(value) === '[object Map Iterator]';\n}\nexports.isMapIterator = isMapIterator;\n\nfunction isSetIterator(value) {\n return ObjectToString(value) === '[object Set Iterator]';\n}\nexports.isSetIterator = isSetIterator;\n\nfunction isGeneratorObject(value) {\n return ObjectToString(value) === '[object Generator]';\n}\nexports.isGeneratorObject = isGeneratorObject;\n\nfunction isWebAssemblyCompiledModule(value) {\n return ObjectToString(value) === '[object WebAssembly.Module]';\n}\nexports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;\n\nfunction isNumberObject(value) {\n return checkBoxedPrimitive(value, numberValue);\n}\nexports.isNumberObject = isNumberObject;\n\nfunction isStringObject(value) {\n return checkBoxedPrimitive(value, stringValue);\n}\nexports.isStringObject = isStringObject;\n\nfunction isBooleanObject(value) {\n return checkBoxedPrimitive(value, booleanValue);\n}\nexports.isBooleanObject = isBooleanObject;\n\nfunction isBigIntObject(value) {\n return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);\n}\nexports.isBigIntObject = isBigIntObject;\n\nfunction isSymbolObject(value) {\n return SymbolSupported && checkBoxedPrimitive(value, symbolValue);\n}\nexports.isSymbolObject = isSymbolObject;\n\nfunction isBoxedPrimitive(value) {\n return (\n isNumberObject(value) ||\n isStringObject(value) ||\n isBooleanObject(value) ||\n isBigIntObject(value) ||\n isSymbolObject(value)\n );\n}\nexports.isBoxedPrimitive = isBoxedPrimitive;\n\nfunction isAnyArrayBuffer(value) {\n return typeof Uint8Array !== 'undefined' && (\n isArrayBuffer(value) ||\n isSharedArrayBuffer(value)\n );\n}\nexports.isAnyArrayBuffer = isAnyArrayBuffer;\n\n['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) {\n Object.defineProperty(exports, method, {\n enumerable: false,\n value: function() {\n throw new Error(method + ' is not supported in userland');\n }\n });\n});\n","'use strict';\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\n\nvar isStandardArguments = function isArguments(value) {\n\tif (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {\n\t\treturn false;\n\t}\n\treturn $toString(value) === '[object Arguments]';\n};\n\nvar isLegacyArguments = function isArguments(value) {\n\tif (isStandardArguments(value)) {\n\t\treturn true;\n\t}\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.length === 'number' &&\n\t\tvalue.length >= 0 &&\n\t\t$toString(value) !== '[object Array]' &&\n\t\t$toString(value.callee) === '[object Function]';\n};\n\nvar supportsStandardArguments = (function () {\n\treturn isStandardArguments(arguments);\n}());\n\nisStandardArguments.isLegacyArguments = isLegacyArguments; // for tests\n\nmodule.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('hasown');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = require('function-bind');\n\n/** @type {(o: {}, p: PropertyKey) => p is keyof o} */\nmodule.exports = bind.call(call, $hasOwn);\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\nvar setFunctionLength = require('set-function-length');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tif (typeof originalFunction !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\tvar func = $reflectApply(bind, $call, arguments);\n\treturn setFunctionLength(\n\t\tfunc,\n\t\t1 + $max(0, originalFunction.length - (arguments.length - 1)),\n\t\ttrue\n\t);\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar gOPD = require('gopd');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $floor = GetIntrinsic('%Math.floor%');\n\nmodule.exports = function setFunctionLength(fn, length) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tif (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {\n\t\tthrow new $TypeError('`length` must be a positive 32-bit integer');\n\t}\n\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\n\tvar functionLengthIsConfigurable = true;\n\tvar functionLengthIsWritable = true;\n\tif ('length' in fn && gOPD) {\n\t\tvar desc = gOPD(fn, 'length');\n\t\tif (desc && !desc.configurable) {\n\t\t\tfunctionLengthIsConfigurable = false;\n\t\t}\n\t\tif (desc && !desc.writable) {\n\t\t\tfunctionLengthIsWritable = false;\n\t\t}\n\t}\n\n\tif (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(fn, 'length', length, true, true);\n\t\t} else {\n\t\t\tdefine(fn, 'length', length);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors')();\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar gopd = require('gopd');\n\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\tif ($defineProperty) {\n\t\ttry {\n\t\t\t$defineProperty({}, 'a', { value: 1 });\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\t// IE 8 has a broken defineProperty\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!hasPropertyDescriptors()) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar fnToStr = Function.prototype.toString;\nvar isFnRegex = /^\\s*(?:function)?\\*/;\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar getProto = Object.getPrototypeOf;\nvar getGeneratorFunc = function () { // eslint-disable-line consistent-return\n\tif (!hasToStringTag) {\n\t\treturn false;\n\t}\n\ttry {\n\t\treturn Function('return function*() {}')();\n\t} catch (e) {\n\t}\n};\nvar GeneratorFunction;\n\nmodule.exports = function isGeneratorFunction(fn) {\n\tif (typeof fn !== 'function') {\n\t\treturn false;\n\t}\n\tif (isFnRegex.test(fnToStr.call(fn))) {\n\t\treturn true;\n\t}\n\tif (!hasToStringTag) {\n\t\tvar str = toStr.call(fn);\n\t\treturn str === '[object GeneratorFunction]';\n\t}\n\tif (!getProto) {\n\t\treturn false;\n\t}\n\tif (typeof GeneratorFunction === 'undefined') {\n\t\tvar generatorFunc = getGeneratorFunc();\n\t\tGeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;\n\t}\n\treturn getProto(fn) === GeneratorFunction;\n};\n","'use strict';\n\nvar forEach = require('for-each');\nvar availableTypedArrays = require('available-typed-arrays');\nvar callBind = require('call-bind');\nvar callBound = require('call-bind/callBound');\nvar gOPD = require('gopd');\n\nvar $toString = callBound('Object.prototype.toString');\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\nvar typedArrays = availableTypedArrays();\n\nvar $slice = callBound('String.prototype.slice');\nvar getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\n\nvar $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tif (array[i] === value) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n};\nvar cache = { __proto__: null };\nif (hasToStringTag && gOPD && getPrototypeOf) {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new g[typedArray]();\n\t\tif (Symbol.toStringTag in arr) {\n\t\t\tvar proto = getPrototypeOf(arr);\n\t\t\tvar descriptor = gOPD(proto, Symbol.toStringTag);\n\t\t\tif (!descriptor) {\n\t\t\t\tvar superProto = getPrototypeOf(proto);\n\t\t\t\tdescriptor = gOPD(superProto, Symbol.toStringTag);\n\t\t\t}\n\t\t\tcache['$' + typedArray] = callBind(descriptor.get);\n\t\t}\n\t});\n} else {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new g[typedArray]();\n\t\tvar fn = arr.slice || arr.set;\n\t\tif (fn) {\n\t\t\tcache['$' + typedArray] = callBind(fn);\n\t\t}\n\t});\n}\n\nvar tryTypedArrays = function tryAllTypedArrays(value) {\n\tvar found = false;\n\tforEach(cache, function (getter, typedArray) {\n\t\tif (!found) {\n\t\t\ttry {\n\t\t\t\tif ('$' + getter(value) === typedArray) {\n\t\t\t\t\tfound = $slice(typedArray, 1);\n\t\t\t\t}\n\t\t\t} catch (e) { /**/ }\n\t\t}\n\t});\n\treturn found;\n};\n\nvar trySlices = function tryAllSlices(value) {\n\tvar found = false;\n\tforEach(cache, function (getter, name) {\n\t\tif (!found) {\n\t\t\ttry {\n\t\t\t\tgetter(value);\n\t\t\t\tfound = $slice(name, 1);\n\t\t\t} catch (e) { /**/ }\n\t\t}\n\t});\n\treturn found;\n};\n\nmodule.exports = function whichTypedArray(value) {\n\tif (!value || typeof value !== 'object') { return false; }\n\tif (!hasToStringTag) {\n\t\tvar tag = $slice($toString(value), 8, -1);\n\t\tif ($indexOf(typedArrays, tag) > -1) {\n\t\t\treturn tag;\n\t\t}\n\t\tif (tag !== 'Object') {\n\t\t\treturn false;\n\t\t}\n\t\t// node < 0.6 hits here on real Typed Arrays\n\t\treturn trySlices(value);\n\t}\n\tif (!gOPD) { return null; } // unknown engine\n\treturn tryTypedArrays(value);\n};\n","'use strict';\n\nvar isCallable = require('is-callable');\n\nvar toStr = Object.prototype.toString;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar forEachArray = function forEachArray(array, iterator, receiver) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (hasOwnProperty.call(array, i)) {\n if (receiver == null) {\n iterator(array[i], i, array);\n } else {\n iterator.call(receiver, array[i], i, array);\n }\n }\n }\n};\n\nvar forEachString = function forEachString(string, iterator, receiver) {\n for (var i = 0, len = string.length; i < len; i++) {\n // no such thing as a sparse string.\n if (receiver == null) {\n iterator(string.charAt(i), i, string);\n } else {\n iterator.call(receiver, string.charAt(i), i, string);\n }\n }\n};\n\nvar forEachObject = function forEachObject(object, iterator, receiver) {\n for (var k in object) {\n if (hasOwnProperty.call(object, k)) {\n if (receiver == null) {\n iterator(object[k], k, object);\n } else {\n iterator.call(receiver, object[k], k, object);\n }\n }\n }\n};\n\nvar forEach = function forEach(list, iterator, thisArg) {\n if (!isCallable(iterator)) {\n throw new TypeError('iterator must be a function');\n }\n\n var receiver;\n if (arguments.length >= 3) {\n receiver = thisArg;\n }\n\n if (toStr.call(list) === '[object Array]') {\n forEachArray(list, iterator, receiver);\n } else if (typeof list === 'string') {\n forEachString(list, iterator, receiver);\n } else {\n forEachObject(list, iterator, receiver);\n }\n};\n\nmodule.exports = forEach;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar possibleNames = [\n\t'BigInt64Array',\n\t'BigUint64Array',\n\t'Float32Array',\n\t'Float64Array',\n\t'Int16Array',\n\t'Int32Array',\n\t'Int8Array',\n\t'Uint16Array',\n\t'Uint32Array',\n\t'Uint8Array',\n\t'Uint8ClampedArray'\n];\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\n\nmodule.exports = function availableTypedArrays() {\n\tvar out = [];\n\tfor (var i = 0; i < possibleNames.length; i++) {\n\t\tif (typeof g[possibleNames[i]] === 'function') {\n\t\t\tout[out.length] = possibleNames[i];\n\t\t}\n\t}\n\treturn out;\n};\n","'use strict';\n\nvar whichTypedArray = require('which-typed-array');\n\nmodule.exports = function isTypedArray(value) {\n\treturn !!whichTypedArray(value);\n};\n","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","// Currently in sync with Node.js lib/internal/assert/assertion_error.js\n// https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c\n\n'use strict';\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _require = require('util/'),\n inspect = _require.inspect;\nvar _require2 = require('../errors'),\n ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n return str.substring(this_len - search.length, this_len) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\nfunction repeat(str, count) {\n count = Math.floor(count);\n if (str.length == 0 || count == 0) return '';\n var maxCount = str.length * count;\n count = Math.floor(Math.log(count) / Math.log(2));\n while (count) {\n str += str;\n count--;\n }\n str += str.substring(0, maxCount - str.length);\n return str;\n}\nvar blue = '';\nvar green = '';\nvar red = '';\nvar white = '';\nvar kReadableOperator = {\n deepStrictEqual: 'Expected values to be strictly deep-equal:',\n strictEqual: 'Expected values to be strictly equal:',\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: 'Expected values to be loosely deep-equal:',\n equal: 'Expected values to be loosely equal:',\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: 'Values identical but not reference-equal:'\n};\n\n// Comparing short primitives should just show === / !== instead of using the\n// diff.\nvar kMaxShortLength = 10;\nfunction copyError(source) {\n var keys = Object.keys(source);\n var target = Object.create(Object.getPrototypeOf(source));\n keys.forEach(function (key) {\n target[key] = source[key];\n });\n Object.defineProperty(target, 'message', {\n value: source.message\n });\n return target;\n}\nfunction inspectValue(val) {\n // The util.inspect default values could be changed. This makes sure the\n // error messages contain the necessary information nevertheless.\n return inspect(val, {\n compact: false,\n customInspect: false,\n depth: 1000,\n maxArrayLength: Infinity,\n // Assert compares only enumerable properties (with a few exceptions).\n showHidden: false,\n // Having a long line as error is better than wrapping the line for\n // comparison for now.\n // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we\n // have meta information about the inspected properties (i.e., know where\n // in what line the property starts and ends).\n breakLength: Infinity,\n // Assert does not detect proxies currently.\n showProxy: false,\n sorted: true,\n // Inspect getters as we also check them when comparing entries.\n getters: true\n });\n}\nfunction createErrDiff(actual, expected, operator) {\n var other = '';\n var res = '';\n var lastPos = 0;\n var end = '';\n var skipped = false;\n var actualInspected = inspectValue(actual);\n var actualLines = actualInspected.split('\\n');\n var expectedLines = inspectValue(expected).split('\\n');\n var i = 0;\n var indicator = '';\n\n // In case both values are objects explicitly mark them as not reference equal\n // for the `strictEqual` operator.\n if (operator === 'strictEqual' && _typeof(actual) === 'object' && _typeof(expected) === 'object' && actual !== null && expected !== null) {\n operator = 'strictEqualObject';\n }\n\n // If \"actual\" and \"expected\" fit on a single line and they are not strictly\n // equal, check further special handling.\n if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n // If the character length of \"actual\" and \"expected\" together is less than\n // kMaxShortLength and if neither is an object and at least one of them is\n // not `zero`, use the strict equal comparison to visualize the output.\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== 'object' || actual === null) && (_typeof(expected) !== 'object' || expected === null) && (actual !== 0 || expected !== 0)) {\n // -0 === +0\n return \"\".concat(kReadableOperator[operator], \"\\n\\n\") + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], \"\\n\");\n }\n } else if (operator !== 'strictEqualObject') {\n // If the stderr is a tty and the input length is lower than the current\n // columns per line, add a mismatch indicator below the output. If it is\n // not a tty, use a default value of 80 characters.\n var maxLength = process.stderr && process.stderr.isTTY ? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n while (actualLines[0][i] === expectedLines[0][i]) {\n i++;\n }\n // Ignore the first characters.\n if (i > 2) {\n // Add position indicator for the first mismatch in case it is a\n // single line and the input length is less than the column length.\n indicator = \"\\n \".concat(repeat(' ', i), \"^\");\n i = 0;\n }\n }\n }\n }\n\n // Remove all ending lines that match (this optimizes the output for\n // readability by reducing the number of total changed lines).\n var a = actualLines[actualLines.length - 1];\n var b = expectedLines[expectedLines.length - 1];\n while (a === b) {\n if (i++ < 2) {\n end = \"\\n \".concat(a).concat(end);\n } else {\n other = a;\n }\n actualLines.pop();\n expectedLines.pop();\n if (actualLines.length === 0 || expectedLines.length === 0) break;\n a = actualLines[actualLines.length - 1];\n b = expectedLines[expectedLines.length - 1];\n }\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n // Strict equal with identical objects that are not identical by reference.\n // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() })\n if (maxLines === 0) {\n // We have to get the result again. The lines were all removed before.\n var _actualLines = actualInspected.split('\\n');\n\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (_actualLines.length > 30) {\n _actualLines[26] = \"\".concat(blue, \"...\").concat(white);\n while (_actualLines.length > 27) {\n _actualLines.pop();\n }\n }\n return \"\".concat(kReadableOperator.notIdentical, \"\\n\\n\").concat(_actualLines.join('\\n'), \"\\n\");\n }\n if (i > 3) {\n end = \"\\n\".concat(blue, \"...\").concat(white).concat(end);\n skipped = true;\n }\n if (other !== '') {\n end = \"\\n \".concat(other).concat(end);\n other = '';\n }\n var printedLines = 0;\n var msg = kReadableOperator[operator] + \"\\n\".concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white);\n var skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0; i < maxLines; i++) {\n // Only extra expected lines exist\n var cur = i - lastPos;\n if (actualLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(expectedLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(expectedLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the expected line to the cache.\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]);\n printedLines++;\n // Only extra actual lines exist\n } else if (expectedLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result.\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLines[i]);\n printedLines++;\n // Lines diverge\n } else {\n var expectedLine = expectedLines[i];\n var actualLine = actualLines[i];\n // If the lines diverge, specifically check for lines that only diverge by\n // a trailing comma. In that case it is actually identical and we should\n // mark it as such.\n var divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, ',') || actualLine.slice(0, -1) !== expectedLine);\n // If the expected line has a trailing comma but is otherwise identical,\n // add a comma at the end of the actual line. Otherwise the output could\n // look weird as in:\n //\n // [\n // 1 // No comma at the end!\n // + 2\n // ]\n //\n if (divergingLines && endsWith(expectedLine, ',') && expectedLine.slice(0, -1) === actualLine) {\n divergingLines = false;\n actualLine += ',';\n }\n if (divergingLines) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result and cache the expected diverging\n // line so consecutive diverging lines show up as +++--- and not +-+-+-.\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLine);\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLine);\n printedLines += 2;\n // Lines are identical\n } else {\n // Add all cached information to the result before adding other things\n // and reset the cache.\n res += other;\n other = '';\n // If the last diverging line is exactly one line above or if it is the\n // very first line, add the line to the result.\n if (cur === 1 || i === 0) {\n res += \"\\n \".concat(actualLine);\n printedLines++;\n }\n }\n }\n // Inspected object to big (Show ~20 rows max)\n if (printedLines > 20 && i < maxLines - 2) {\n return \"\".concat(msg).concat(skippedMsg, \"\\n\").concat(res, \"\\n\").concat(blue, \"...\").concat(white).concat(other, \"\\n\") + \"\".concat(blue, \"...\").concat(white);\n }\n }\n return \"\".concat(msg).concat(skipped ? skippedMsg : '', \"\\n\").concat(res).concat(other).concat(end).concat(indicator);\n}\nvar AssertionError = /*#__PURE__*/function (_Error, _inspect$custom) {\n _inherits(AssertionError, _Error);\n var _super = _createSuper(AssertionError);\n function AssertionError(options) {\n var _this;\n _classCallCheck(this, AssertionError);\n if (_typeof(options) !== 'object' || options === null) {\n throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);\n }\n var message = options.message,\n operator = options.operator,\n stackStartFn = options.stackStartFn;\n var actual = options.actual,\n expected = options.expected;\n var limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n if (message != null) {\n _this = _super.call(this, String(message));\n } else {\n if (process.stderr && process.stderr.isTTY) {\n // Reset on each call to make sure we handle dynamically set environment\n // variables correct.\n if (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1) {\n blue = \"\\x1B[34m\";\n green = \"\\x1B[32m\";\n white = \"\\x1B[39m\";\n red = \"\\x1B[31m\";\n } else {\n blue = '';\n green = '';\n white = '';\n red = '';\n }\n }\n // Prevent the error stack from being visible by duplicating the error\n // in a very close way to the original in case both sides are actually\n // instances of Error.\n if (_typeof(actual) === 'object' && actual !== null && _typeof(expected) === 'object' && expected !== null && 'stack' in actual && actual instanceof Error && 'stack' in expected && expected instanceof Error) {\n actual = copyError(actual);\n expected = copyError(expected);\n }\n if (operator === 'deepStrictEqual' || operator === 'strictEqual') {\n _this = _super.call(this, createErrDiff(actual, expected, operator));\n } else if (operator === 'notDeepStrictEqual' || operator === 'notStrictEqual') {\n // In case the objects are equal but the operator requires unequal, show\n // the first object and say A equals B\n var base = kReadableOperator[operator];\n var res = inspectValue(actual).split('\\n');\n\n // In case \"actual\" is an object, it should not be reference equal.\n if (operator === 'notStrictEqual' && _typeof(actual) === 'object' && actual !== null) {\n base = kReadableOperator.notStrictEqualObject;\n }\n\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (res.length > 30) {\n res[26] = \"\".concat(blue, \"...\").concat(white);\n while (res.length > 27) {\n res.pop();\n }\n }\n\n // Only print a single input.\n if (res.length === 1) {\n _this = _super.call(this, \"\".concat(base, \" \").concat(res[0]));\n } else {\n _this = _super.call(this, \"\".concat(base, \"\\n\\n\").concat(res.join('\\n'), \"\\n\"));\n }\n } else {\n var _res = inspectValue(actual);\n var other = '';\n var knownOperators = kReadableOperator[operator];\n if (operator === 'notDeepEqual' || operator === 'notEqual') {\n _res = \"\".concat(kReadableOperator[operator], \"\\n\\n\").concat(_res);\n if (_res.length > 1024) {\n _res = \"\".concat(_res.slice(0, 1021), \"...\");\n }\n } else {\n other = \"\".concat(inspectValue(expected));\n if (_res.length > 512) {\n _res = \"\".concat(_res.slice(0, 509), \"...\");\n }\n if (other.length > 512) {\n other = \"\".concat(other.slice(0, 509), \"...\");\n }\n if (operator === 'deepEqual' || operator === 'equal') {\n _res = \"\".concat(knownOperators, \"\\n\\n\").concat(_res, \"\\n\\nshould equal\\n\\n\");\n } else {\n other = \" \".concat(operator, \" \").concat(other);\n }\n }\n _this = _super.call(this, \"\".concat(_res).concat(other));\n }\n }\n Error.stackTraceLimit = limit;\n _this.generatedMessage = !message;\n Object.defineProperty(_assertThisInitialized(_this), 'name', {\n value: 'AssertionError [ERR_ASSERTION]',\n enumerable: false,\n writable: true,\n configurable: true\n });\n _this.code = 'ERR_ASSERTION';\n _this.actual = actual;\n _this.expected = expected;\n _this.operator = operator;\n if (Error.captureStackTrace) {\n // eslint-disable-next-line no-restricted-syntax\n Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn);\n }\n // Create error message including the error code in the name.\n _this.stack;\n // Reset the name.\n _this.name = 'AssertionError';\n return _possibleConstructorReturn(_this);\n }\n _createClass(AssertionError, [{\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n }, {\n key: _inspect$custom,\n value: function value(recurseTimes, ctx) {\n // This limits the `actual` and `expected` property default inspection to\n // the minimum depth. Otherwise those values would be too verbose compared\n // to the actual error message which contains a combined view of these two\n // input values.\n return inspect(this, _objectSpread(_objectSpread({}, ctx), {}, {\n customInspect: false,\n depth: 0\n }));\n }\n }]);\n return AssertionError;\n}( /*#__PURE__*/_wrapNativeSuper(Error), inspect.custom);\nmodule.exports = AssertionError;","'use strict';\n\nvar implementation = require('./implementation');\n\nvar lacksProperEnumerationOrder = function () {\n\tif (!Object.assign) {\n\t\treturn false;\n\t}\n\t/*\n\t * v8, specifically in node 4.x, has a bug with incorrect property enumeration order\n\t * note: this does not detect the bug unless there's 20 characters\n\t */\n\tvar str = 'abcdefghijklmnopqrst';\n\tvar letters = str.split('');\n\tvar map = {};\n\tfor (var i = 0; i < letters.length; ++i) {\n\t\tmap[letters[i]] = letters[i];\n\t}\n\tvar obj = Object.assign({}, map);\n\tvar actual = '';\n\tfor (var k in obj) {\n\t\tactual += k;\n\t}\n\treturn str !== actual;\n};\n\nvar assignHasPendingExceptions = function () {\n\tif (!Object.assign || !Object.preventExtensions) {\n\t\treturn false;\n\t}\n\t/*\n\t * Firefox 37 still has \"pending exception\" logic in its Object.assign implementation,\n\t * which is 72% slower than our shim, and Firefox 40's native implementation.\n\t */\n\tvar thrower = Object.preventExtensions({ 1: 2 });\n\ttry {\n\t\tObject.assign(thrower, 'xy');\n\t} catch (e) {\n\t\treturn thrower[1] === 'y';\n\t}\n\treturn false;\n};\n\nmodule.exports = function getPolyfill() {\n\tif (!Object.assign) {\n\t\treturn implementation;\n\t}\n\tif (lacksProperEnumerationOrder()) {\n\t\treturn implementation;\n\t}\n\tif (assignHasPendingExceptions()) {\n\t\treturn implementation;\n\t}\n\treturn Object.assign;\n};\n","'use strict';\n\n// modified from https://github.com/es-shims/es6-shim\nvar objectKeys = require('object-keys');\nvar hasSymbols = require('has-symbols/shams')();\nvar callBound = require('call-bind/callBound');\nvar toObject = Object;\nvar $push = callBound('Array.prototype.push');\nvar $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');\nvar originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;\n\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function assign(target, source1) {\n\tif (target == null) { throw new TypeError('target must be an object'); }\n\tvar to = toObject(target); // step 1\n\tif (arguments.length === 1) {\n\t\treturn to; // step 2\n\t}\n\tfor (var s = 1; s < arguments.length; ++s) {\n\t\tvar from = toObject(arguments[s]); // step 3.a.i\n\n\t\t// step 3.a.ii:\n\t\tvar keys = objectKeys(from);\n\t\tvar getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);\n\t\tif (getSymbols) {\n\t\t\tvar syms = getSymbols(from);\n\t\t\tfor (var j = 0; j < syms.length; ++j) {\n\t\t\t\tvar key = syms[j];\n\t\t\t\tif ($propIsEnumerable(from, key)) {\n\t\t\t\t\t$push(keys, key);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// step 3.a.iii:\n\t\tfor (var i = 0; i < keys.length; ++i) {\n\t\t\tvar nextKey = keys[i];\n\t\t\tif ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2\n\t\t\t\tvar propValue = from[nextKey]; // step 3.a.iii.2.a\n\t\t\t\tto[nextKey] = propValue; // step 3.a.iii.2.b\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to; // step 4\n};\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\treturn typeof Object.is === 'function' ? Object.is : implementation;\n};\n","'use strict';\n\nvar numberIsNaN = function (value) {\n\treturn value !== value;\n};\n\nmodule.exports = function is(a, b) {\n\tif (a === 0 && b === 0) {\n\t\treturn 1 / a === 1 / b;\n\t}\n\tif (a === b) {\n\t\treturn true;\n\t}\n\tif (numberIsNaN(a) && numberIsNaN(b)) {\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n","// Currently in sync with Node.js lib/internal/util/comparisons.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\n'use strict';\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar regexFlagsSupported = /a/g.flags !== undefined;\nvar arrayFromSet = function arrayFromSet(set) {\n var array = [];\n set.forEach(function (value) {\n return array.push(value);\n });\n return array;\n};\nvar arrayFromMap = function arrayFromMap(map) {\n var array = [];\n map.forEach(function (value, key) {\n return array.push([key, value]);\n });\n return array;\n};\nvar objectIs = Object.is ? Object.is : require('object-is');\nvar objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function () {\n return [];\n};\nvar numberIsNaN = Number.isNaN ? Number.isNaN : require('is-nan');\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\nvar hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);\nvar propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable);\nvar objectToString = uncurryThis(Object.prototype.toString);\nvar _require$types = require('util/').types,\n isAnyArrayBuffer = _require$types.isAnyArrayBuffer,\n isArrayBufferView = _require$types.isArrayBufferView,\n isDate = _require$types.isDate,\n isMap = _require$types.isMap,\n isRegExp = _require$types.isRegExp,\n isSet = _require$types.isSet,\n isNativeError = _require$types.isNativeError,\n isBoxedPrimitive = _require$types.isBoxedPrimitive,\n isNumberObject = _require$types.isNumberObject,\n isStringObject = _require$types.isStringObject,\n isBooleanObject = _require$types.isBooleanObject,\n isBigIntObject = _require$types.isBigIntObject,\n isSymbolObject = _require$types.isSymbolObject,\n isFloat32Array = _require$types.isFloat32Array,\n isFloat64Array = _require$types.isFloat64Array;\nfunction isNonIndex(key) {\n if (key.length === 0 || key.length > 10) return true;\n for (var i = 0; i < key.length; i++) {\n var code = key.charCodeAt(i);\n if (code < 48 || code > 57) return true;\n }\n // The maximum size for an array is 2 ** 32 -1.\n return key.length === 10 && key >= Math.pow(2, 32);\n}\nfunction getOwnNonIndexProperties(value) {\n return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));\n}\n\n// Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n var x = a.length;\n var y = b.length;\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}\nvar ONLY_ENUMERABLE = undefined;\nvar kStrict = true;\nvar kLoose = false;\nvar kNoIterator = 0;\nvar kIsArray = 1;\nvar kIsSet = 2;\nvar kIsMap = 3;\n\n// Check if they have the same source and flags\nfunction areSimilarRegExps(a, b) {\n return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);\n}\nfunction areSimilarFloatArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n for (var offset = 0; offset < a.byteLength; offset++) {\n if (a[offset] !== b[offset]) {\n return false;\n }\n }\n return true;\n}\nfunction areSimilarTypedArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n return compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;\n}\nfunction areEqualArrayBuffers(buf1, buf2) {\n return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;\n}\nfunction isEqualBoxedPrimitive(val1, val2) {\n if (isNumberObject(val1)) {\n return isNumberObject(val2) && objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));\n }\n if (isStringObject(val1)) {\n return isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);\n }\n if (isBooleanObject(val1)) {\n return isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);\n }\n if (isBigIntObject(val1)) {\n return isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);\n }\n return isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);\n}\n\n// Notes: Type tags are historical [[Class]] properties that can be set by\n// FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS\n// and retrieved using Object.prototype.toString.call(obj) in JS\n// See https://tc39.github.io/ecma262/#sec-object.prototype.tostring\n// for a list of tags pre-defined in the spec.\n// There are some unspecified tags in the wild too (e.g. typed array tags).\n// Since tags can be altered, they only serve fast failures\n//\n// Typed arrays and buffers are checked by comparing the content in their\n// underlying ArrayBuffer. This optimization requires that it's\n// reasonable to interpret their underlying memory in the same way,\n// which is checked by comparing their type tags.\n// (e.g. a Uint8Array and a Uint16Array with the same memory content\n// could still be different because they will be interpreted differently).\n//\n// For strict comparison, objects should have\n// a) The same built-in type tags\n// b) The same prototypes.\n\nfunction innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? objectIs(val1, val2) : true;\n }\n\n // Check more closely if val1 and val2 are equal.\n if (strict) {\n if (_typeof(val1) !== 'object') {\n return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2);\n }\n if (_typeof(val2) !== 'object' || val1 === null || val2 === null) {\n return false;\n }\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) {\n return false;\n }\n } else {\n if (val1 === null || _typeof(val1) !== 'object') {\n if (val2 === null || _typeof(val2) !== 'object') {\n // eslint-disable-next-line eqeqeq\n return val1 == val2;\n }\n return false;\n }\n if (val2 === null || _typeof(val2) !== 'object') {\n return false;\n }\n }\n var val1Tag = objectToString(val1);\n var val2Tag = objectToString(val2);\n if (val1Tag !== val2Tag) {\n return false;\n }\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) {\n return false;\n }\n var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n if (keys1.length !== keys2.length) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kIsArray, keys1);\n }\n // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n if (val1Tag === '[object Object]') {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) {\n return false;\n }\n }\n if (isDate(val1)) {\n if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) {\n return false;\n }\n } else if (isRegExp(val1)) {\n if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) {\n return false;\n }\n } else if (isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) {\n return false;\n }\n } else if (isArrayBufferView(val1)) {\n if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {\n if (!areSimilarFloatArrays(val1, val2)) {\n return false;\n }\n } else if (!areSimilarTypedArrays(val1, val2)) {\n return false;\n }\n // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n if (_keys.length !== _keys2.length) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);\n } else if (isSet(val1)) {\n if (!isSet(val2) || val1.size !== val2.size) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kIsSet);\n } else if (isMap(val1)) {\n if (!isMap(val2) || val1.size !== val2.size) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kIsMap);\n } else if (isAnyArrayBuffer(val1)) {\n if (!areEqualArrayBuffers(val1, val2)) {\n return false;\n }\n } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kNoIterator);\n}\nfunction getEnumerables(val, keys) {\n return keys.filter(function (k) {\n return propertyIsEnumerable(val, k);\n });\n}\nfunction keyCheck(val1, val2, strict, memos, iterationType, aKeys) {\n // For all remaining Object pairs, including Array, objects and Maps,\n // equivalence is determined by having:\n // a) The same number of owned enumerable properties\n // b) The same set of keys/indexes (although not necessarily the same order)\n // c) Equivalent values for every corresponding key/index\n // d) For Sets and Maps, equal contents\n // Note: this accounts for both named and indexed properties on Arrays.\n if (arguments.length === 5) {\n aKeys = Object.keys(val1);\n var bKeys = Object.keys(val2);\n\n // The pair must have the same number of owned properties.\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n }\n\n // Cheap key test\n var i = 0;\n for (; i < aKeys.length; i++) {\n if (!hasOwnProperty(val2, aKeys[i])) {\n return false;\n }\n }\n if (strict && arguments.length === 5) {\n var symbolKeysA = objectGetOwnPropertySymbols(val1);\n if (symbolKeysA.length !== 0) {\n var count = 0;\n for (i = 0; i < symbolKeysA.length; i++) {\n var key = symbolKeysA[i];\n if (propertyIsEnumerable(val1, key)) {\n if (!propertyIsEnumerable(val2, key)) {\n return false;\n }\n aKeys.push(key);\n count++;\n } else if (propertyIsEnumerable(val2, key)) {\n return false;\n }\n }\n var symbolKeysB = objectGetOwnPropertySymbols(val2);\n if (symbolKeysA.length !== symbolKeysB.length && getEnumerables(val2, symbolKeysB).length !== count) {\n return false;\n }\n } else {\n var _symbolKeysB = objectGetOwnPropertySymbols(val2);\n if (_symbolKeysB.length !== 0 && getEnumerables(val2, _symbolKeysB).length !== 0) {\n return false;\n }\n }\n }\n if (aKeys.length === 0 && (iterationType === kNoIterator || iterationType === kIsArray && val1.length === 0 || val1.size === 0)) {\n return true;\n }\n\n // Use memos to handle cycles.\n if (memos === undefined) {\n memos = {\n val1: new Map(),\n val2: new Map(),\n position: 0\n };\n } else {\n // We prevent up to two map.has(x) calls by directly retrieving the value\n // and checking for undefined. The map can only contain numbers, so it is\n // safe to check for undefined only.\n var val2MemoA = memos.val1.get(val1);\n if (val2MemoA !== undefined) {\n var val2MemoB = memos.val2.get(val2);\n if (val2MemoB !== undefined) {\n return val2MemoA === val2MemoB;\n }\n }\n memos.position++;\n }\n memos.val1.set(val1, memos.position);\n memos.val2.set(val2, memos.position);\n var areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType);\n memos.val1.delete(val1);\n memos.val2.delete(val2);\n return areEq;\n}\nfunction setHasEqualElement(set, val1, strict, memo) {\n // Go looking.\n var setValues = arrayFromSet(set);\n for (var i = 0; i < setValues.length; i++) {\n var val2 = setValues[i];\n if (innerDeepEqual(val1, val2, strict, memo)) {\n // Remove the matching element to make sure we do not check that again.\n set.delete(val2);\n return true;\n }\n }\n return false;\n}\n\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using\n// Sadly it is not possible to detect corresponding values properly in case the\n// type is a string, number, bigint or boolean. The reason is that those values\n// can match lots of different string values (e.g., 1n == '+00001').\nfunction findLooseMatchingPrimitives(prim) {\n switch (_typeof(prim)) {\n case 'undefined':\n return null;\n case 'object':\n // Only pass in null as object!\n return undefined;\n case 'symbol':\n return false;\n case 'string':\n prim = +prim;\n // Loose equal entries exist only if the string is possible to convert to\n // a regular number and not NaN.\n // Fall through\n case 'number':\n if (numberIsNaN(prim)) {\n return false;\n }\n }\n return true;\n}\nfunction setMightHaveLoosePrim(a, b, prim) {\n var altValue = findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n return b.has(altValue) && !a.has(altValue);\n}\nfunction mapMightHaveLoosePrim(a, b, prim, item, memo) {\n var altValue = findLooseMatchingPrimitives(prim);\n if (altValue != null) {\n return altValue;\n }\n var curB = b.get(altValue);\n if (curB === undefined && !b.has(altValue) || !innerDeepEqual(item, curB, false, memo)) {\n return false;\n }\n return !a.has(altValue) && innerDeepEqual(item, curB, false, memo);\n}\nfunction setEquiv(a, b, strict, memo) {\n // This is a lazily initiated Set of entries which have to be compared\n // pairwise.\n var set = null;\n var aValues = arrayFromSet(a);\n for (var i = 0; i < aValues.length; i++) {\n var val = aValues[i];\n // Note: Checking for the objects first improves the performance for object\n // heavy sets but it is a minor slow down for primitives. As they are fast\n // to check this improves the worst case scenario instead.\n if (_typeof(val) === 'object' && val !== null) {\n if (set === null) {\n set = new Set();\n }\n // If the specified value doesn't exist in the second set its an not null\n // object (or non strict only: a not matching primitive) we'll need to go\n // hunting for something thats deep-(strict-)equal to it. To make this\n // O(n log n) complexity we have to copy these values in a new set first.\n set.add(val);\n } else if (!b.has(val)) {\n if (strict) return false;\n\n // Fast path to detect missing string, symbol, undefined and null values.\n if (!setMightHaveLoosePrim(a, b, val)) {\n return false;\n }\n if (set === null) {\n set = new Set();\n }\n set.add(val);\n }\n }\n if (set !== null) {\n var bValues = arrayFromSet(b);\n for (var _i = 0; _i < bValues.length; _i++) {\n var _val = bValues[_i];\n // We have to check if a primitive value is already\n // matching and only if it's not, go hunting for it.\n if (_typeof(_val) === 'object' && _val !== null) {\n if (!setHasEqualElement(set, _val, strict, memo)) return false;\n } else if (!strict && !a.has(_val) && !setHasEqualElement(set, _val, strict, memo)) {\n return false;\n }\n }\n return set.size === 0;\n }\n return true;\n}\nfunction mapHasEqualEntry(set, map, key1, item1, strict, memo) {\n // To be able to handle cases like:\n // Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']])\n // ... we need to consider *all* matching keys, not just the first we find.\n var setValues = arrayFromSet(set);\n for (var i = 0; i < setValues.length; i++) {\n var key2 = setValues[i];\n if (innerDeepEqual(key1, key2, strict, memo) && innerDeepEqual(item1, map.get(key2), strict, memo)) {\n set.delete(key2);\n return true;\n }\n }\n return false;\n}\nfunction mapEquiv(a, b, strict, memo) {\n var set = null;\n var aEntries = arrayFromMap(a);\n for (var i = 0; i < aEntries.length; i++) {\n var _aEntries$i = _slicedToArray(aEntries[i], 2),\n key = _aEntries$i[0],\n item1 = _aEntries$i[1];\n if (_typeof(key) === 'object' && key !== null) {\n if (set === null) {\n set = new Set();\n }\n set.add(key);\n } else {\n // By directly retrieving the value we prevent another b.has(key) check in\n // almost all possible cases.\n var item2 = b.get(key);\n if (item2 === undefined && !b.has(key) || !innerDeepEqual(item1, item2, strict, memo)) {\n if (strict) return false;\n // Fast path to detect missing string, symbol, undefined and null\n // keys.\n if (!mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;\n if (set === null) {\n set = new Set();\n }\n set.add(key);\n }\n }\n }\n if (set !== null) {\n var bEntries = arrayFromMap(b);\n for (var _i2 = 0; _i2 < bEntries.length; _i2++) {\n var _bEntries$_i = _slicedToArray(bEntries[_i2], 2),\n _key = _bEntries$_i[0],\n item = _bEntries$_i[1];\n if (_typeof(_key) === 'object' && _key !== null) {\n if (!mapHasEqualEntry(set, a, _key, item, strict, memo)) return false;\n } else if (!strict && (!a.has(_key) || !innerDeepEqual(a.get(_key), item, false, memo)) && !mapHasEqualEntry(set, a, _key, item, false, memo)) {\n return false;\n }\n }\n return set.size === 0;\n }\n return true;\n}\nfunction objEquiv(a, b, strict, keys, memos, iterationType) {\n // Sets and maps don't have their entries accessible via normal object\n // properties.\n var i = 0;\n if (iterationType === kIsSet) {\n if (!setEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsMap) {\n if (!mapEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsArray) {\n for (; i < a.length; i++) {\n if (hasOwnProperty(a, i)) {\n if (!hasOwnProperty(b, i) || !innerDeepEqual(a[i], b[i], strict, memos)) {\n return false;\n }\n } else if (hasOwnProperty(b, i)) {\n return false;\n } else {\n // Array is sparse.\n var keysA = Object.keys(a);\n for (; i < keysA.length; i++) {\n var key = keysA[i];\n if (!hasOwnProperty(b, key) || !innerDeepEqual(a[key], b[key], strict, memos)) {\n return false;\n }\n }\n if (keysA.length !== Object.keys(b).length) {\n return false;\n }\n return true;\n }\n }\n }\n\n // The pair must have equivalent values for every corresponding key.\n // Possibly expensive deep test:\n for (i = 0; i < keys.length; i++) {\n var _key2 = keys[i];\n if (!innerDeepEqual(a[_key2], b[_key2], strict, memos)) {\n return false;\n }\n }\n return true;\n}\nfunction isDeepEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kLoose);\n}\nfunction isDeepStrictEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kStrict);\n}\nmodule.exports = {\n isDeepEqual: isDeepEqual,\n isDeepStrictEqual: isDeepStrictEqual\n};","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Object);\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar defineDataProperty = require('define-data-property');\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar supportsDescriptors = require('has-property-descriptors')();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object) {\n\t\tif (predicate === true) {\n\t\t\tif (object[name] === value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (!isFunction(predicate) || !predicate()) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (supportsDescriptors) {\n\t\tdefineDataProperty(object, name, value, true);\n\t} else {\n\t\tdefineDataProperty(object, name, value);\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","'use strict';\n\nvar getPolyfill = require('./polyfill');\nvar define = require('define-properties');\n\nmodule.exports = function shimObjectIs() {\n\tvar polyfill = getPolyfill();\n\tdefine(Object, { is: polyfill }, {\n\t\tis: function testObjectIs() {\n\t\t\treturn Object.is !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Number);\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\nmodule.exports = function isNaN(value) {\n\treturn value !== value;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) {\n\t\treturn Number.isNaN;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\nmodule.exports = function shimNumberIsNaN() {\n\tvar polyfill = getPolyfill();\n\tdefine(Number, { isNaN: polyfill }, {\n\t\tisNaN: function testIsNaN() {\n\t\t\treturn Number.isNaN !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","import { strict as assert } from 'assert';\nimport Chart from 'chart.js/auto';\nimport Sortable from 'sortablejs';\n\nimport { animationFrame } from './util/animation-frame';\nimport type {\n StockIds,\n FlowIds,\n VariableIds,\n ParameterIds,\n} from './circular-economy-model';\nimport CircularEconomyModel, {\n Parameters,\n Record,\n} from './circular-economy-model';\nimport ModelSimulator from './model-simulator';\nimport Visualization from './visualization';\nimport { documentReady } from './util/document-ready';\nimport { guardedQuerySelector } from './util/guarded-query-selectors';\nimport ScriptedParameterTransform from './parameter-transform/scripted-parameter-transform';\n\ntype CircularEconomyModelSimulator = ModelSimulator<\n StockIds,\n FlowIds,\n VariableIds,\n ParameterIds\n>;\n\ntype ScriptCircularEconomyParameterTransform =\n ScriptedParameterTransform;\n\ntype CircularEconomyApi = {\n model: CircularEconomyModel;\n modelSimulator: CircularEconomyModelSimulator;\n parameterTransforms: {\n create: (id: string, script: string) => void;\n destroy: (id: string) => void;\n };\n};\n\nconst initialParameters = {\n abandonExcessRate: 0.5,\n abandonRate: 0.02,\n acquireRate: 1.0,\n breakRate: 0.01,\n capacityAdjustmentRate: 0.05,\n disposeIncentive: 1.5,\n disposeRate: 0.5,\n landfillIncentive: 1.0,\n landfillRate: 1.0,\n naturalResourcesIncentive: 1.5,\n newPhoneProductionRate: 1.0,\n newlyProducedPhoneIncentive: 2,\n numberOfUsers: 1000000,\n phonesPerUserGoal: 1.2,\n recycleRate: 1.0,\n recyclingIncentive: 0.25,\n refurbishmentIncentive: 0.25,\n refurbishmentRate: 1.0,\n repairIncentive: 0.5,\n repairRate: 1.0,\n reuseIncentive: 0.25,\n};\n\nasync function init(): Promise {\n const model = new CircularEconomyModel();\n const modelSimulator = new ModelSimulator(\n model,\n // FIXME: It should be possible to pass CircularEconomyModel.initialStocks directly, but TypeScript does not complain.\n { ...CircularEconomyModel.initialStocks },\n { ...initialParameters },\n 0.0,\n 0.1,\n );\n\n const availableParameterTransformsContainer = guardedQuerySelector(\n document,\n '#parameter-transforms .available',\n HTMLElement,\n );\n const activeParameterTransformsContainer = guardedQuerySelector(\n document,\n '#parameter-transforms .active',\n HTMLElement,\n );\n\n const availableParameterTransforms = new Map<\n string,\n ScriptCircularEconomyParameterTransform\n >();\n\n function getDistinctParameters(\n p1: Parameters,\n p2: Parameters,\n ): Partial {\n const result: Partial = {};\n model.parameterIds.forEach((id) => {\n if (p1[id] !== p2[id]) {\n result[id] = p2[id];\n }\n });\n return result;\n }\n\n function updateParameters() {\n const parameters = { ...initialParameters };\n [...activeParameterTransformsContainer.children].forEach((e) => {\n assert(e instanceof HTMLElement);\n const id = e.getAttribute('data-id');\n assert(id !== null);\n const parameterTransform = availableParameterTransforms.get(id);\n assert(parameterTransform !== undefined);\n const backupParameters = { ...parameters };\n parameterTransform.applyTo(parameters);\n const distinctParameters = getDistinctParameters(\n backupParameters,\n parameters,\n );\n e.title = `${parameterTransform.script}\\n\\n${JSON.stringify(\n distinctParameters,\n null,\n 2,\n )}\\n\\n${JSON.stringify(parameters, null, 2)}`;\n });\n Object.assign(modelSimulator.parameters, parameters);\n }\n\n Sortable.create(availableParameterTransformsContainer, {\n group: {\n name: 'sharedParameterTransforms',\n pull: 'clone',\n put: false, // Do not allow items to be put into this list\n },\n });\n Sortable.create(activeParameterTransformsContainer, {\n group: { name: 'sharedParameterTransforms' },\n removeOnSpill: true,\n onSort: () => updateParameters(),\n onSpill: (event) => {\n event.item.remove();\n updateParameters();\n },\n });\n const parameterTransforms = {\n create: (id: string, script: string) => {\n if (availableParameterTransforms.has(id))\n throw new Error(`Parameter transform with id '${id}' already exists`);\n availableParameterTransforms.set(\n id,\n new ScriptedParameterTransform(\n 'none',\n model.parameterIds,\n script,\n ),\n );\n const dummyElement = document.createElement('div');\n dummyElement.innerHTML = `
${id}
`;\n const parameterTransformElement = dummyElement.firstChild;\n assert(parameterTransformElement !== null);\n availableParameterTransformsContainer.append(parameterTransformElement);\n },\n destroy: (id: string) => {\n availableParameterTransforms.delete(id);\n },\n };\n\n guardedQuerySelector(\n document,\n '#add-parameter-transform',\n HTMLElement,\n ).addEventListener('click', () => {\n const idElement = guardedQuerySelector(\n document,\n '#parameter-transform-id',\n HTMLInputElement,\n );\n const id = idElement.value;\n const scriptElement = guardedQuerySelector(\n document,\n '#parameter-transform-script',\n HTMLTextAreaElement,\n );\n const script = scriptElement.value;\n parameterTransforms.create(id, script);\n });\n\n const sliderContainer = guardedQuerySelector(\n document,\n '#sliders',\n HTMLElement,\n );\n\n model.parameterIds\n .filter((id) => id !== 'numberOfUsers')\n .forEach((id) => {\n const sliderElementLabel = document.createElement('div');\n const sliderElement = document.createElement('input');\n sliderElement.type = 'range';\n sliderElement.min = '0';\n sliderElement.max = '4';\n sliderElement.step = '0.001';\n sliderElement.value = `${initialParameters[id]}`;\n\n function updateSliderValue() {\n initialParameters[id] = Number.parseFloat(sliderElement.value);\n sliderElementLabel.innerText = `${id} = ${initialParameters[id]}`;\n updateParameters();\n }\n updateSliderValue();\n\n sliderElement.addEventListener('input', updateSliderValue);\n\n const sliderWrapperElement = document.createElement('div');\n sliderWrapperElement.append(sliderElementLabel, sliderElement);\n\n sliderContainer.append(sliderWrapperElement);\n });\n\n let circularityIndex = 0;\n const circularityIndexElement = guardedQuerySelector(\n document,\n '#circularity-index',\n HTMLElement,\n );\n\n let userSatisfaction = 0;\n const userSatisfactionElement = guardedQuerySelector(\n document,\n '#user-satisfaction',\n HTMLElement,\n );\n\n const visualization = await Visualization.create(model);\n document.body.prepend(visualization.element);\n\n function toChartRecord(record: Record) {\n return CircularEconomyModel.elementIds\n .map((key) =>\n Object.entries(record[key]).map(([id, value]) => ({ id, value })),\n )\n .reduce((cur, acc) => [...cur, ...acc], []);\n }\n\n const initialChartRecord = toChartRecord(modelSimulator.record);\n\n const chartCanvas = document.getElementById('chart') as HTMLCanvasElement;\n assert(chartCanvas !== null, 'chart element not found');\n const chart = new Chart(chartCanvas, {\n type: 'bar',\n data: {\n labels: initialChartRecord.map((row) => row.id),\n datasets: [\n {\n label: 'Values',\n data: initialChartRecord.map((row) => row.value),\n },\n ],\n },\n options: { animation: false },\n });\n\n function updateIndices(record: Record) {\n const smoothingFactor = 0.5;\n\n const { phonesInUse } = record.stocks;\n const {\n produceFromNaturalResources,\n acquireNewlyProduced,\n acquireUsed,\n acquireRepaired,\n acquireRefurbished,\n disposeHibernating,\n disposeBroken,\n landfill,\n } = record.flows;\n const { phoneGoal } = record.variables;\n\n const naturalResourcesShare = Math.min(\n 1.0,\n produceFromNaturalResources /\n (acquireNewlyProduced +\n acquireUsed +\n acquireRepaired +\n acquireRefurbished),\n );\n const landfillShare = Math.min(\n 1.0,\n landfill / (disposeHibernating + disposeBroken),\n );\n const circularityIndexTarget = Math.min(\n 1.0 - naturalResourcesShare,\n 1.0 - landfillShare,\n );\n\n circularityIndex +=\n (circularityIndexTarget - circularityIndex) * smoothingFactor;\n circularityIndexElement.innerText = `${(circularityIndex * 100).toFixed(\n 1,\n )}%`;\n\n const userSatisfactionTarget =\n phonesInUse < phoneGoal\n ? phonesInUse / phoneGoal\n : phoneGoal / phonesInUse;\n userSatisfaction +=\n (userSatisfactionTarget - userSatisfaction) * smoothingFactor;\n userSatisfactionElement.innerText = `${(userSatisfaction * 100).toFixed(\n 1,\n )}%`;\n }\n\n function stepSimulation(deltaMs: number) {\n // TODO: pass deltaMs to modelSimulator.step()\n const record = modelSimulator.step();\n\n updateIndices(record);\n\n const chartRecord = toChartRecord(record);\n // console.log(chartRecord);\n chart.data.datasets[0].data = chartRecord.map((row) => row.value);\n\n chart.update();\n\n visualization.update(deltaMs, modelSimulator.h, record);\n }\n\n let running = false;\n const runCheckBox = document.getElementById('run') as HTMLInputElement;\n assert(runCheckBox !== null, 'run checkbox not found');\n\n async function loopSimulation() {\n running = true;\n let lastTimeMs: DOMHighResTimeStamp | null = null;\n\n while (runCheckBox.checked) {\n // eslint-disable-next-line no-await-in-loop\n const currentTimeMs = await animationFrame();\n const deltaMs = lastTimeMs === null ? 0 : currentTimeMs - lastTimeMs;\n stepSimulation(deltaMs);\n lastTimeMs = currentTimeMs;\n }\n running = false;\n }\n\n runCheckBox.addEventListener('input', () => {\n if (!running)\n loopSimulation().catch((err) => {\n throw err;\n });\n });\n\n stepSimulation(0);\n\n const circularEconomyApi: CircularEconomyApi = {\n model,\n modelSimulator,\n parameterTransforms,\n };\n\n return circularEconomyApi;\n}\n\ndeclare global {\n interface Window {\n circularEconomy: Promise;\n }\n}\n\nwindow.circularEconomy = documentReady().then(init);\n","import {Chart, registerables} from '../dist/chart.js';\n\nChart.register(...registerables);\n\nexport * from '../dist/chart.js';\nexport default Chart;\n","/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */\nimport { r as requestAnimFrame, a as resolve, e as effects, c as color, i as isObject, d as defaults, b as isArray, v as valueOrDefault, u as unlistenArrayEvents, l as listenArrayEvents, f as resolveObjectKey, g as isNumberFinite, h as defined, s as sign, j as createContext, k as isNullOrUndef, _ as _arrayUnique, t as toRadians, m as toPercentage, n as toDimension, T as TAU, o as formatNumber, p as _angleBetween, H as HALF_PI, P as PI, q as _getStartAndCountOfVisiblePoints, w as _scaleRangesChanged, x as isNumber, y as _parseObjectDataRadialScale, z as getRelativePosition, A as _rlookupByKey, B as _lookupByKey, C as _isPointInArea, D as getAngleFromPoint, E as toPadding, F as each, G as getMaximumSize, I as _getParentNode, J as readUsedSize, K as supportsEventListenerOptions, L as throttled, M as _isDomSupported, N as _factorize, O as finiteOrDefault, Q as callback, R as _addGrace, S as _limitValue, U as toDegrees, V as _measureText, W as _int16Range, X as _alignPixel, Y as clipArea, Z as renderText, $ as unclipArea, a0 as toFont, a1 as _toLeftRightCenter, a2 as _alignStartEnd, a3 as overrides, a4 as merge, a5 as _capitalize, a6 as descriptors, a7 as isFunction, a8 as _attachContext, a9 as _createResolver, aa as _descriptors, ab as mergeIf, ac as uid, ad as debounce, ae as retinaScale, af as clearCanvas, ag as setsEqual, ah as _elementsEqual, ai as _isClickEvent, aj as _isBetween, ak as _readValueToProps, al as _updateBezierControlPoints, am as _computeSegments, an as _boundSegments, ao as _steppedInterpolation, ap as _bezierInterpolation, aq as _pointInLine, ar as _steppedLineTo, as as _bezierCurveTo, at as drawPoint, au as addRoundedRectPath, av as toTRBL, aw as toTRBLCorners, ax as _boundSegment, ay as _normalizeAngle, az as getRtlAdapter, aA as overrideTextDirection, aB as _textX, aC as restoreTextDirection, aD as drawPointLegend, aE as distanceBetweenPoints, aF as noop, aG as _setMinAndMaxByKey, aH as niceNum, aI as almostWhole, aJ as almostEquals, aK as _decimalPlaces, aL as Ticks, aM as log10, aN as _longestText, aO as _filterBetween, aP as _lookup } from './chunks/helpers.segment.js';\nimport '@kurkle/color';\n\nclass Animator {\n constructor(){\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n callbacks.forEach((fn)=>fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n this._request = requestAnimFrame.call(window, ()=>{\n this._update();\n this._request = null;\n if (this._running) {\n this._refresh();\n }\n });\n }\n _update(date = Date.now()) {\n let remaining = 0;\n this._charts.forEach((anims, chart)=>{\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n for(; i >= 0; --i){\n item = items[i];\n if (item._active) {\n if (item._total > anims.duration) {\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n remaining += items.length;\n });\n this._lastDate = date;\n if (remaining === 0) {\n this._running = false;\n }\n }\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur)=>Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n for(; i >= 0; --i){\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\nvar animator = /* #__PURE__ */ new Animator();\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean (from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n color (from, to, factor) {\n const c0 = color(from || transparent);\n const c1 = c0.valid && color(to || transparent);\n return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to;\n },\n number (from, to, factor) {\n return from + (to - from) * factor;\n }\n};\nclass Animation {\n constructor(cfg, target, prop, to){\n const currentValue = target[prop];\n to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n const from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n active() {\n return this._active;\n }\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n this._from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n }\n }\n cancel() {\n if (this._active) {\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n this._active = from !== to && (loop || elapsed < duration);\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n factor = elapsed / duration % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n this._target[prop] = this._fn(from, to, factor);\n }\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej)=>{\n promises.push({\n res,\n rej\n });\n });\n }\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for(let i = 0; i < promises.length; i++){\n promises[i][method]();\n }\n }\n}\n\nclass Animations {\n constructor(chart, config){\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n Object.getOwnPropertyNames(config).forEach((key)=>{\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions){\n resolved[option] = cfg[option];\n }\n (isArray(cfg.properties) && cfg.properties || [\n key\n ]).forEach((prop)=>{\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n awaitAll(target.options.$animations, newOptions).then(()=>{\n target.options = newOptions;\n }, ()=>{\n });\n }\n return animations;\n }\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n for(i = props.length - 1; i >= 0; --i){\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n if (animation) {\n if (cfg && animation.active()) {\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n target[prop] = value;\n continue;\n }\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n update(target, values) {\n if (this._properties.size === 0) {\n Object.assign(target, values);\n return;\n }\n const animations = this._createAnimations(target, values);\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for(let i = 0; i < keys.length; i++){\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n return Promise.all(running);\n}\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n target.options = options = Object.assign({}, options, {\n $shared: false,\n $animations: {}\n });\n }\n return options;\n}\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\nfunction toClip(value) {\n let t, r, b, l;\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n keys.push(metasets[i].index);\n }\n return keys;\n}\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n if (value === null) {\n return;\n }\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isNumberFinite(otherValue) && (singleMode || value === 0 || sign(value) === sign(otherValue))) {\n value += otherValue;\n }\n }\n return value;\n}\nfunction convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || stacked === undefined && meta.stack !== undefined;\n}\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction getUserBounds(scale) {\n const { min , max , minDefined , maxDefined } = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()){\n const value = stack[meta.index];\n if (positive && value > 0 || !positive && value < 0) {\n return meta.index;\n }\n }\n return null;\n}\nfunction updateStacks(controller, parsed) {\n const { chart , _cachedMeta: meta } = controller;\n const stacks = chart._stacks || (chart._stacks = {});\n const { iScale , vScale , index: datasetIndex } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n for(let i = 0; i < ilen; ++i){\n const item = parsed[i];\n const { [iAxis]: index , [vAxis]: value } = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter((key)=>scales[key].axis === axis).shift();\n}\nfunction createDatasetContext(parent, index) {\n return createContext(parent, {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n });\n}\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\nfunction clearStacks(meta, items) {\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n items = items || meta._parsed;\n for (const parsed of items){\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n delete stacks[axis]._visualValues[datasetIndex];\n }\n }\n}\nconst isDirectUpdateMode = (mode)=>mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared)=>shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart)=>canStack && !meta.hidden && meta._stacked && {\n keys: getSortedDatasetIndices(chart, true),\n values: null\n };\nclass DatasetController {\n static defaults = {};\n static datasetElementType = null;\n static dataElementType = null;\n constructor(chart, datasetIndex){\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n this.initialize();\n }\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n 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\");\n }\n }\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n const chooseId = (axis, x, y, r)=>axis === 'x' ? x : axis === 'r' ? r : y;\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale ? meta.vScale : meta.iScale;\n }\n reset() {\n this._update('reset');\n }\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n if (isObject(data)) {\n this._data = convertObjectDataToArray(data);\n } else if (_data !== data) {\n if (_data) {\n unlistenArrayEvents(_data, this);\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n addElements() {\n const meta = this._cachedMeta;\n this._dataCheck();\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n this._dataCheck();\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n this._resyncElements(resetNewElements);\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n }\n }\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n parse(start, count) {\n const { _cachedMeta: meta , _data: data } = this;\n const { iScale , _stacked } = meta;\n const iAxis = iScale.axis;\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n const isNotInOrderComparedToPrev = ()=>cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];\n for(i = 0; i < count; ++i){\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n parsePrimitiveData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return applyStack(stack, value, meta.index, {\n mode\n });\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n const { min: otherMin , max: otherMax } = getUserBounds(otherScale);\n let i, parsed;\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n for(i = 0; i < ilen; ++i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n break;\n }\n }\n if (sorted) {\n for(i = ilen - 1; i >= 0; --i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n for(i = 0, ilen = parsed.length; i < ilen; ++i){\n value = parsed[i][scale.axis];\n if (isNumberFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n getMaxOverflow() {\n return false;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n update(mode) {}\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || elements.length - start;\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n for(i = start; i < start + count; ++i){\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n for(i = 0; i < active.length; ++i){\n active[i].draw(ctx, area);\n }\n }\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index || 0, mode);\n }\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context || (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [\n `${elementType}Hover`,\n 'hover',\n elementType,\n ''\n ] : [\n elementType,\n ''\n ];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n const context = ()=>this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n if (values.$shared) {\n values.$shared = sharing;\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n return values;\n }\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions;\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {\n sharedOptions,\n includeOptions\n };\n }\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n options: !active && this.getSharedOptions(options) || options\n });\n }\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n for (const [method, arg1, arg2] of this._syncList){\n this[method](arg1, arg2);\n }\n this._syncList = [];\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n if (count) {\n this.parse(0, count);\n }\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n const move = (arr)=>{\n arr.length += count;\n for(i = arr.length - 1; i >= end; i--){\n arr[i] = arr[i - count];\n }\n };\n move(data);\n for(i = start; i < end; ++i){\n data[i] = new this.dataElementType();\n }\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n updateElements(element, start, count, mode) {}\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([\n this.index,\n ...args\n ]);\n }\n _onDataPush() {\n const count = arguments.length;\n this._sync([\n '_insertElements',\n this.getDataset().data.length - count,\n count\n ]);\n }\n _onDataPop() {\n this._sync([\n '_removeElements',\n this._cachedMeta.data.length - 1,\n 1\n ]);\n }\n _onDataShift() {\n this._sync([\n '_removeElements',\n 0,\n 1\n ]);\n }\n _onDataSplice(start, count) {\n if (count) {\n this._sync([\n '_removeElements',\n start,\n count\n ]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync([\n '_insertElements',\n start,\n newCount\n ]);\n }\n }\n _onDataUnshift() {\n this._sync([\n '_insertElements',\n 0,\n arguments.length\n ]);\n }\n}\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n for(let i = 0, ilen = visibleMetas.length; i < ilen; i++){\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b)=>a - b));\n }\n return scale._cache.$bar;\n}\n function computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = ()=>{\n if (curr === 32767 || curr === -32768) {\n return;\n }\n if (defined(prev)) {\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n for(i = 0, ilen = values.length; i < ilen; ++i){\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n prev = undefined;\n for(i = 0, ilen = scale.ticks.length; i < ilen; ++i){\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n return min;\n}\n function computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n size = thickness * stackCount;\n ratio = 1;\n }\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - size / 2\n };\n}\n function computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n if (prev === null) {\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n if (next === null) {\n next = curr + curr - prev;\n }\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n item[vScale.axis] = barEnd;\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n for(i = start, ilen = start + count; i < ilen; ++i){\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {\n start,\n end,\n reverse,\n top,\n bottom\n };\n}\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n if (edge === true) {\n properties.borderSkipped = {\n top: true,\n right: true,\n bottom: true,\n left: true\n };\n return;\n }\n const { start , end , reverse , top , bottom } = borderProps(properties);\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\nfunction setInflateAmount(properties, { inflateAmount }, ratio) {\n properties.inflateAmount = inflateAmount === 'auto' ? ratio === 1 ? 0.33 : 0 : inflateAmount;\n}\nclass BarController extends DatasetController {\n static id = 'bar';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true\n }\n }\n };\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseObjectData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for(i = start, ilen = start + count; i < ilen; ++i){\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n getMaxOverflow() {\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const { iScale , vScale } = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom) ? '[' + custom.start + ', ' + custom.end + ']' : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const { index , _cachedMeta: { vScale } } = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n for(let i = start; i < start + count; i++){\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {\n base,\n head: base\n } : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || index === stack._top || index === stack._bottom,\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n _getStacks(last, dataIndex) {\n const { iScale } = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const skipNull = (meta)=>{\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n for (const meta of metasets){\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === undefined && meta.stack === undefined) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n if (!stacks.length) {\n stacks.push(undefined);\n }\n return stacks;\n }\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = name !== undefined ? stacks.indexOf(name) : -1;\n return index === -1 ? stacks.length - 1 : index;\n }\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n for(i = 0, ilen = meta.data.length; i < ilen; ++i){\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n _calculateBarValuePixels(index) {\n const { _cachedMeta: { vScale , _stacked , index: datasetIndex } , options: { base: baseValue , minBarLength } } = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n if (length !== value) {\n start = length - value;\n length = value;\n }\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n head = base;\n }\n size = head - base;\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n if (_stacked && !floating) {\n parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n }\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex' ? computeFlexCategoryTraits(index, ruler, options, stackCount) : computeFitCategoryTraits(index, ruler, options, stackCount);\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + range.chunk * stackIndex + range.chunk / 2;\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n for(; i < ilen; ++i){\n if (this.getParsed(i)[vScale.axis] !== null) {\n rects[i].draw(this._ctx);\n }\n }\n }\n}\n\nclass BubbleController extends DatasetController {\n static id = 'bubble';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'borderWidth',\n 'radius'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n update(mode) {\n const points = this._cachedMeta.data;\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n if (reset) {\n properties.options.radius = 0;\n }\n }\n this.updateElement(point, i, properties, mode);\n }\n }\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n if (values.$shared) {\n values = Object.assign({}, values, {\n $shared: false\n });\n }\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n return values;\n }\n}\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {\n ratioX,\n ratioY,\n offsetX,\n offsetY\n };\n}\nclass DoughnutController extends DatasetController {\n static id = 'doughnut';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'circumference',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'startAngle',\n 'x',\n 'y',\n 'offset',\n 'borderWidth',\n 'spacing'\n ]\n }\n },\n cutout: '50%',\n rotation: 0,\n circumference: 360,\n radius: '100%',\n spacing: 0,\n indexAxis: 'r'\n };\n static descriptors = {\n _scriptable: (name)=>name !== 'spacing',\n _indexable: (name)=>name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash')\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n linkScales() {}\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i)=>+data[i];\n if (isObject(data[start])) {\n const { key ='value' } = this._parsing;\n getter = (i)=>+resolveObjectKey(data[i], key);\n }\n let i, ilen;\n for(i = start, ilen = start + count; i < ilen; ++i){\n meta._parsed[i] = getter(i);\n }\n }\n }\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n for(let i = 0; i < this.chart.data.datasets.length; ++i){\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n return {\n rotation: min,\n circumference: max - min\n };\n }\n update(mode) {\n const chart = this.chart;\n const { chartArea } = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n const { circumference , rotation } = this._getRotationExtents();\n const { ratioX , ratioY , offsetX , offsetY } = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n meta.total = this.calculateTotal();\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n for(i = 0; i < start; ++i){\n startAngle += this._circumference(i, reset);\n }\n for(i = start; i < start + count; ++i){\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n this.updateElement(arc, i, properties, mode);\n }\n }\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n for(i = 0; i < metaData.length; i++){\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n return total;\n }\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n if (!arcs) {\n for(i = 0, ilen = chart.data.datasets.length; i < ilen; ++i){\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n if (!arcs) {\n return 0;\n }\n for(i = 0, ilen = arcs.length; i < ilen; ++i){\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n getMaxOffset(arcs) {\n let max = 0;\n for(let i = 0, ilen = arcs.length; i < ilen; ++i){\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n for(let i = 0; i < datasetIndex; ++i){\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n return ringWeightOffset;\n }\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n\nclass LineController extends DatasetController {\n static id = 'line';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n showLine: true,\n spanGaps: false\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category'\n },\n _value_: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { dataset: line , data: points = [] , _dataset } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n this.updateElements(points, start, count, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = 0; i < pointsCount; ++i){\n const point = points[i];\n const properties = directUpdate ? point : {};\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n\nclass PolarAreaController extends DatasetController {\n static id = 'polarArea';\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ]\n }\n },\n indexAxis: 'r',\n startAngle: 0\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const arcs = this._cachedMeta.data;\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n meta.data.forEach((element, index)=>{\n const parsed = this.getParsed(index).r;\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n return range;\n }\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n this.outerRadius = outerRadius - radiusLength * this.index;\n this.innerRadius = this.outerRadius - radiusLength;\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n const defaultAngle = 360 / this.countVisibleElements();\n for(i = 0; i < start; ++i){\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for(i = start; i < start + count; i++){\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n this.updateElement(arc, i, properties, mode);\n }\n }\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n meta.data.forEach((element, index)=>{\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n return count;\n }\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index) ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle) : 0;\n }\n}\n\nclass PieController extends DoughnutController {\n static id = 'pie';\n static defaults = {\n cutout: 0,\n rotation: 0,\n circumference: 360,\n radius: '100%'\n };\n}\n\nclass RadarController extends DatasetController {\n static id = 'radar';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n }\n };\n static overrides = {\n aspectRatio: 1,\n scales: {\n r: {\n type: 'radialLinear'\n }\n }\n };\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n line.points = points;\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n this.updateElement(line, undefined, properties, mode);\n }\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n\nclass ScatterController extends DatasetController {\n static id = 'scatter';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n static overrides = {\n interaction: {\n mode: 'point'\n },\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { data: points = [] } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n if (this.options.showLine) {\n if (!this.datasetElementType) {\n this.addElements();\n }\n const { dataset: line , _dataset } = meta;\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n } else if (this.datasetElementType) {\n delete meta.dataset;\n this.datasetElementType = false;\n }\n this.updateElements(points, start, count, mode);\n }\n addElements() {\n const { showLine } = this.options;\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n super.addElements();\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = start; i < start + count; ++i){\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n if (!this.options.showLine) {\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n\nvar controllers = /*#__PURE__*/Object.freeze({\n__proto__: null,\nBarController: BarController,\nBubbleController: BubbleController,\nDoughnutController: DoughnutController,\nLineController: LineController,\nPieController: PieController,\nPolarAreaController: PolarAreaController,\nRadarController: RadarController,\nScatterController: ScatterController\n});\n\n/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */ function abstract() {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */ class DateAdapterBase {\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */ static override(members) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n options;\n constructor(options){\n this.options = options || {};\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n formats() {\n return abstract();\n }\n parse() {\n return abstract();\n }\n format() {\n return abstract();\n }\n add() {\n return abstract();\n }\n diff() {\n return abstract();\n }\n startOf() {\n return abstract();\n }\n endOf() {\n return abstract();\n }\n}\nvar adapters = {\n _date: DateAdapterBase\n};\n\nfunction binarySearch(metaset, axis, value, intersect) {\n const { controller , data , _sorted } = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {\n lo: start.lo,\n hi: end.hi\n };\n }\n }\n }\n return {\n lo: 0,\n hi: data.length - 1\n };\n}\n function evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for(let i = 0, ilen = metasets.length; i < ilen; ++i){\n const { index , data } = metasets[i];\n const { lo , hi } = binarySearch(metasets[i], axis, value, intersect);\n for(let j = lo; j <= hi; ++j){\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n function getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n function getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n };\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n function getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n function evaluationFunc(element, datasetIndex, index) {\n const { startAngle , endAngle } = element.getProps([\n 'startAngle',\n 'endAngle'\n ], useFinalPosition);\n const { angle } = getAngleFromPoint(element, {\n x: position.x,\n y: position.y\n });\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [\n {\n element,\n datasetIndex,\n index\n }\n ];\n minDistance = distance;\n } else if (distance === minDistance) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n return axis === 'r' && !intersect ? getNearestRadialItems(chart, position, axis, useFinalPosition) : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n function getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index)=>{\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n var Interaction = {\n evaluateInteractionItems,\n modes: {\n index (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n if (!items.length) {\n return [];\n }\n chart.getSortedVisibleDatasetMetas().forEach((meta)=>{\n const index = items[0].index;\n const element = meta.data[index];\n if (element && !element.skip) {\n elements.push({\n element,\n datasetIndex: meta.index,\n index\n });\n }\n });\n return elements;\n },\n dataset (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for(let i = 0; i < data.length; ++i){\n items.push({\n element: data[i],\n datasetIndex,\n index: i\n });\n }\n }\n return items;\n },\n point (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n nearest (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n x (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n y (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n\nconst STATIC_POSITIONS = [\n 'left',\n 'top',\n 'right',\n 'bottom'\n];\nfunction filterByPosition(array, position) {\n return array.filter((v)=>v.pos === position);\n}\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter((v)=>STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b)=>{\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;\n });\n}\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n for(i = 0, ilen = (boxes || []).length; i < ilen; ++i){\n box = boxes[i];\n ({ position: pos , options: { stack , stackWeight =1 } } = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && pos + stack,\n stackWeight\n });\n }\n return layoutBoxes;\n}\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts){\n const { stack , pos , stackWeight } = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {\n count: 0,\n placed: 0,\n weight: 0,\n size: 0\n });\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n function setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const { vBoxMaxWidth , hBoxMaxHeight } = params;\n let i, ilen, layout;\n for(i = 0, ilen = layouts.length; i < ilen; ++i){\n layout = layouts[i];\n const { fullSize } = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction updateDims(chartArea, params, layout, stacks) {\n const { pos , box } = layout;\n const maxPadding = chartArea.maxPadding;\n if (!isObject(pos)) {\n if (layout.size) {\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {\n size: 0,\n count: 1\n };\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n return layout.horizontal ? {\n same: widthChanged,\n other: heightChanged\n } : {\n same: heightChanged,\n other: widthChanged\n };\n}\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n function marginForPositions(positions) {\n const margin = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n positions.forEach((pos)=>{\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n return horizontal ? marginForPositions([\n 'left',\n 'right'\n ]) : marginForPositions([\n 'top',\n 'bottom'\n ]);\n}\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n for(i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i){\n layout = boxes[i];\n box = layout.box;\n box.update(layout.width || chartArea.w, layout.height || chartArea.h, getMargins(layout.horizontal, chartArea));\n const { same , other } = updateDims(chartArea, params, layout, stacks);\n refit |= same && refitBoxes.length;\n changed = changed || other;\n if (!box.fullSize) {\n refitBoxes.push(layout);\n }\n }\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let { x , y } = chartArea;\n for (const layout of boxes){\n const box = layout.box;\n const stack = stacks[layout.stack] || {\n count: 1,\n placed: 0,\n weight: 1\n };\n const weight = layout.stackWeight / stack.weight || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n chartArea.x = x;\n chartArea.y = y;\n}\nvar layouts = {\n addBox (chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n item._layers = item._layers || function() {\n return [\n {\n z: 0,\n draw (chartArea) {\n item.draw(chartArea);\n }\n }\n ];\n };\n chart.boxes.push(item);\n },\n removeBox (chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n configure (chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n update (chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n each(chart.boxes, (box)=>{\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap)=>wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n handleMaxPadding(chartArea);\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w\n };\n each(boxes.chartArea, (layout)=>{\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n });\n });\n }\n};\n\nclass BasePlatform {\n acquireContext(canvas, aspectRatio) {}\n releaseContext(context) {\n return false;\n }\n addEventListener(chart, type, listener) {}\n removeEventListener(chart, type, listener) {}\n getDevicePixelRatio() {\n return 1;\n }\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n isAttached(canvas) {\n return true;\n }\n updateConfig(config) {\n }\n}\n\nclass BasicPlatform extends BasePlatform {\n acquireContext(item) {\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n\nconst EXPANDO_KEY = '$chartjs';\n const EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\nconst isNullOrEmpty = (value)=>value === null || value === '';\n function initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n style.display = style.display || 'block';\n style.boxSizing = style.boxSizing || 'border-box';\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n return canvas;\n}\nconst eventListenerOptions = supportsEventListenerOptions ? {\n passive: true\n} : false;\nfunction addListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n}\nfunction removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const { x , y } = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null\n };\n}\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList){\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart)=>{\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height)=>{\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n listener();\n }\n }, window);\n const observer = new ResizeObserver((entries)=>{\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n return observer;\n}\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event)=>{\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n addListener(canvas, type, proxy);\n return proxy;\n}\n class DomPlatform extends BasePlatform {\n acquireContext(canvas, aspectRatio) {\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n if (context && context.canvas === canvas) {\n initCanvas(canvas, aspectRatio);\n return context;\n }\n return null;\n }\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n const initial = canvas[EXPANDO_KEY].initial;\n [\n 'height',\n 'width'\n ].forEach((prop)=>{\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n const style = initial.style || {};\n Object.keys(style).forEach((key)=>{\n canvas.style[key] = style[key];\n });\n canvas.width = canvas.width;\n delete canvas[EXPANDO_KEY];\n return true;\n }\n addEventListener(chart, type, listener) {\n this.removeEventListener(chart, type);\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n if (!proxy) {\n return;\n }\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n isAttached(canvas) {\n const container = _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n\nfunction _detectPlatform(canvas) {\n if (!_isDomSupported() || typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nclass Element {\n static defaults = {};\n static defaultRoutes = undefined;\n x;\n y;\n active = false;\n options;\n $animations;\n tooltipPosition(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n getProps(props, final) {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this;\n }\n const ret = {};\n props.forEach((prop)=>{\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n });\n return ret;\n }\n}\n\nfunction autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for(i = 0, ilen = numMajorIndices - 1; i < ilen; i++){\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n function calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n const factors = _factorize(evenMajorSpacing);\n for(let i = 0, ilen = factors.length - 1; i < ilen; i++){\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n function getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n function skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n spacing = Math.ceil(spacing);\n for(i = 0; i < ticks.length; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n function skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n next = start;\n while(next < 0){\n count++;\n next = Math.round(start + count * spacing);\n }\n for(i = Math.max(start, 0); i < end; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n function getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n if (len < 2) {\n return false;\n }\n for(diff = arr[0], i = 1; i < len; ++i){\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n\nconst reverseAlign = (align)=>align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset)=>edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit)=>Math.min(maxTicksLimit || ticksLength, ticksLength);\n function sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n for(; i < len; i += increment){\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n function getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6;\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n function garbageCollect(caches, length) {\n each(caches, (cache)=>{\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for(i = 0; i < gcLen; ++i){\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n function getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n function getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n return lines * font.lineHeight + padding.height;\n}\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\nfunction titleAlign(align, position, reverse) {\n let ret = _toLeftRightCenter(align);\n if (reverse && position !== 'right' || !reverse && position === 'right') {\n ret = reverseAlign(ret);\n }\n return ret;\n}\nfunction titleArgs(scale, offset, position, align) {\n const { top , left , bottom , right , chart } = scale;\n const { chartArea , scales } = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n}\nclass Scale extends Element {\n constructor(cfg){\n super();\n this.id = cfg.id;\n this.type = cfg.type;\n this.options = undefined;\n this.ctx = cfg.ctx;\n this.chart = cfg.chart;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.paddingTop = undefined;\n this.paddingBottom = undefined;\n this.paddingLeft = undefined;\n this.paddingRight = undefined;\n this.axis = undefined;\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n this.ticks = [];\n this._gridLineItems = null;\n this._labelItems = null;\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n this._startPixel = undefined;\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n init(options) {\n this.options = options.setContext(this.getContext());\n this.axis = options.axis;\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n parse(raw, index) {\n return raw;\n }\n getUserBounds() {\n let { _userMin , _userMax , _suggestedMin , _suggestedMax } = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isNumberFinite(_userMin),\n maxDefined: isNumberFinite(_userMax)\n };\n }\n getMinMax(canStack) {\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n let range;\n if (minDefined && maxDefined) {\n return {\n min,\n max\n };\n }\n const metas = this.getMatchingVisibleMetas();\n for(let i = 0, ilen = metas.length; i < ilen; ++i){\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n getTicks() {\n return this.ticks;\n }\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n beforeUpdate() {\n callback(this.options.beforeUpdate, [\n this\n ]);\n }\n update(maxWidth, maxHeight, margins) {\n const { beginAtZero , grace , ticks: tickOpts } = this.options;\n const sampleSize = tickOpts.sampleSize;\n this.beforeUpdate();\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n this.beforeBuildTicks();\n this.ticks = this.buildTicks() || [];\n this.afterBuildTicks();\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n this.configure();\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation();\n this.afterCalculateLabelRotation();\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n if (samplingEnabled) {\n this._convertTicksToLabels(this.ticks);\n }\n this.beforeFit();\n this.fit();\n this.afterFit();\n this.afterUpdate();\n }\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n afterUpdate() {\n callback(this.options.afterUpdate, [\n this\n ]);\n }\n beforeSetDimensions() {\n callback(this.options.beforeSetDimensions, [\n this\n ]);\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = 0;\n this.bottom = this.height;\n }\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n callback(this.options.afterSetDimensions, [\n this\n ]);\n }\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n callback(this.options[name], [\n this\n ]);\n }\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n beforeTickToLabelConversion() {\n callback(this.options.beforeTickToLabelConversion, [\n this\n ]);\n }\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n tick = ticks[i];\n tick.label = callback(tickOpts.callback, [\n tick.value,\n i,\n ticks\n ], this);\n }\n }\n afterTickToLabelConversion() {\n callback(this.options.afterTickToLabelConversion, [\n this\n ]);\n }\n beforeCalculateLabelRotation() {\n callback(this.options.beforeCalculateLabelRotation, [\n this\n ]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n callback(this.options.afterCalculateLabelRotation, [\n this\n ]);\n }\n afterAutoSkip() {}\n beforeFit() {\n callback(this.options.beforeFit, [\n this\n ]);\n }\n fit() {\n const minSize = {\n width: 0,\n height: 0\n };\n const { chart , options: { ticks: tickOpts , title: titleOpts , grid: gridOpts } } = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight;\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n if (tickOpts.display && this.ticks.length) {\n const { first , last , widest , highest } = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n if (isHorizontal) {\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n this._handleMargins();\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n _calculatePadding(first, last, sin, cos) {\n const { ticks: { align , padding } , position } = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n afterFit() {\n callback(this.options.afterFit, [\n this\n ]);\n }\n isHorizontal() {\n const { axis , position } = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n isFullSize() {\n return this.options.fullSize;\n }\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n this.generateTickLabels(ticks);\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n this.afterTickToLabelConversion();\n }\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n return labelSizes;\n }\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const { ctx , _longestTextCache: caches } = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n for(i = 0; i < length; i += increment){\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {\n data: {},\n gc: []\n };\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n for(j = 0, jlen = label.length; j < jlen; ++j){\n nestedLabel = label[j];\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n const valueAt = (idx)=>({\n width: widths[idx] || 0,\n height: heights[idx] || 0\n });\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights\n };\n }\n getLabelForValue(value) {\n return value;\n }\n getPixelForValue(value, index) {\n return NaN;\n }\n getValueForPixel(pixel) {}\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n getBaseValue() {\n const { min , max } = this;\n return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0;\n }\n getContext(index) {\n const ticks = this.ticks || [];\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context || (tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this));\n }\n _tickSize() {\n const optionTicks = this.options.ticks;\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin;\n }\n _isVisible() {\n const display = this.options.display;\n if (display !== 'auto') {\n return !!display;\n }\n return this.getMatchingVisibleMetas().length > 0;\n }\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const { grid , position , border } = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for(i = 0; i < ticksLength; i += step){\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n lineValue = getPixelForGridLine(this, i, offset);\n if (lineValue === undefined) {\n continue;\n }\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset\n });\n }\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n return items;\n }\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const { position , ticks: optionTicks } = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const { align , crossAlign , padding , mirror } = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = (chartArea.left + chartArea.right) / 2 - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n const labelSizes = this._getLabelSizes();\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n label = tick.label;\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n if (isHorizontal) {\n x = pixel;\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += lineHeight / 2 * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n let backdrop;\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n switch(textBaseline){\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n }\n switch(textAlign){\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n }\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n color: optsAtIndex.backdropColor\n };\n }\n items.push({\n label,\n font,\n textOffset,\n options: {\n rotation,\n color,\n strokeColor,\n strokeWidth,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [\n x,\n y\n ],\n backdrop\n }\n });\n }\n return items;\n }\n _getXAxisLabelAlignment() {\n const { position , ticks } = this.options;\n const rotation = -toRadians(this.labelRotation);\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n let align = 'center';\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n return align;\n }\n _getYAxisLabelAlignment(tl) {\n const { position , ticks: { crossAlign , mirror , padding } } = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n let textAlign;\n let x;\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n return {\n textAlign,\n x\n };\n }\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n const chart = this.chart;\n const position = this.options.position;\n if (position === 'left' || position === 'right') {\n return {\n top: 0,\n left: this.left,\n bottom: chart.height,\n right: this.right\n };\n }\n if (position === 'top' || position === 'bottom') {\n return {\n top: this.top,\n left: 0,\n bottom: this.bottom,\n right: chart.width\n };\n }\n }\n drawBackground() {\n const { ctx , options: { backgroundColor } , left , top , width , height } = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex((t)=>t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n const drawLine = (p1, p2, style)=>{\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n if (grid.display) {\n for(i = 0, ilen = items.length; i < ilen; ++i){\n const item = items[i];\n if (grid.drawOnChartArea) {\n drawLine({\n x: item.x1,\n y: item.y1\n }, {\n x: item.x2,\n y: item.y2\n }, item);\n }\n if (grid.drawTicks) {\n drawLine({\n x: item.tx1,\n y: item.ty1\n }, {\n x: item.tx2,\n y: item.ty2\n }, {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n });\n }\n }\n }\n }\n drawBorder() {\n const { chart , ctx , options: { border , grid } } = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.restore();\n }\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n if (!optionTicks.display) {\n return;\n }\n const ctx = this.ctx;\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n const items = this.getLabelItems(chartArea);\n for (const item of items){\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n if (area) {\n unclipArea(ctx);\n }\n }\n drawTitle() {\n const { ctx , options: { position , title , reverse } } = this;\n if (!title.display) {\n return;\n }\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n const { titleX , titleY , maxWidth , rotation } = titleArgs(this, offset, position, align);\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n return [\n {\n z: tz,\n draw: (chartArea)=>{\n this.draw(chartArea);\n }\n }\n ];\n }\n return [\n {\n z: gz,\n draw: (chartArea)=>{\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n },\n {\n z: bz,\n draw: ()=>{\n this.drawBorder();\n }\n },\n {\n z: tz,\n draw: (chartArea)=>{\n this.drawLabels(chartArea);\n }\n }\n ];\n }\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n\nclass TypedRegistry {\n constructor(type, scope, override){\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n if (isIChartComponent(proto)) {\n parentScope = this.register(proto);\n }\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n if (id in items) {\n return scope;\n }\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n return scope;\n }\n get(id) {\n return this.items[id];\n }\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n if (id in items) {\n delete items[id];\n }\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\nfunction registerDefaults(item, scope, parentScope) {\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n defaults.set(scope, itemDefaults);\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach((property)=>{\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [\n scope\n ].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n\nclass Registry {\n constructor(){\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n this._typedRegistries = [\n this.controllers,\n this.scales,\n this.elements\n ];\n }\n add(...args) {\n this._each('register', args);\n }\n remove(...args) {\n this._each('unregister', args);\n }\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n _each(method, args, typedRegistry) {\n [\n ...args\n ].forEach((arg)=>{\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) {\n this._exec(method, reg, arg);\n } else {\n each(arg, (item)=>{\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n callback(component['before' + camelMethod], [], component);\n registry[method](component);\n callback(component['after' + camelMethod], [], component);\n }\n _getRegistryForType(type) {\n for(let i = 0; i < this._typedRegistries.length; i++){\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n return this.plugins;\n }\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n}\nvar registry = /* #__PURE__ */ new Registry();\n\nclass PluginService {\n constructor(){\n this._init = [];\n }\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors){\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [\n chart,\n args,\n descriptor.options\n ];\n if (callback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n return true;\n }\n invalidate() {\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n const descriptors = this._cache = this._createDescriptors(chart);\n this._notifyStateChanges(chart);\n return descriptors;\n }\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\n function allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for(let i = 0; i < keys.length; i++){\n plugins.push(registry.getPlugin(keys[i]));\n }\n const local = config.plugins || [];\n for(let i = 0; i < local.length; i++){\n const plugin = local[i];\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n return {\n plugins,\n localIds\n };\n}\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\nfunction createDescriptors(chart, { plugins , localIds }, options, all) {\n const result = [];\n const context = chart.getContext();\n for (const plugin of plugins){\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {\n plugin,\n local: localIds[id]\n }, opts, context)\n });\n }\n return result;\n}\nfunction pluginOpts(config, { plugin , local }, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [\n ''\n ], {\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n\nfunction getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\nfunction idMatchesAxis(id) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n}\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\nfunction determineAxis(id, ...scaleOptions) {\n if (idMatchesAxis(id)) {\n return id;\n }\n for (const opts of scaleOptions){\n const axis = opts.axis || axisFromPosition(opts.position) || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n if (axis) {\n return axis;\n }\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\nfunction getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + 'AxisID'] === id) {\n return {\n axis\n };\n }\n}\nfunction retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d)=>d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) {\n return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n }\n }\n return {};\n}\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {\n scales: {}\n };\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n Object.keys(configScales).forEach((id)=>{\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [\n {\n axis\n },\n scaleConf,\n defaultScaleOptions[axis],\n defaultScaleOptions[defaultId]\n ]);\n });\n config.data.datasets.forEach((dataset)=>{\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach((defaultID)=>{\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [\n {\n axis\n },\n configScales[id],\n defaultScaleOptions[defaultID]\n ]);\n });\n });\n Object.keys(scales).forEach((key)=>{\n const scale = scales[key];\n mergeIf(scale, [\n defaults.scales[scale.type],\n defaults.scale\n ]);\n });\n return scales;\n}\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n initOptions(config);\n return config;\n}\nconst keyCache = new Map();\nconst keysCached = new Set();\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\nconst addIfFound = (set, obj, key)=>{\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\nclass Config {\n constructor(config){\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n get platform() {\n return this._config.platform;\n }\n get type() {\n return this._config.type;\n }\n set type(type) {\n this._config.type = type;\n }\n get data() {\n return this._config.data;\n }\n set data(data) {\n this._config.data = initData(data);\n }\n get options() {\n return this._config.options;\n }\n set options(options) {\n this._config.options = options;\n }\n get plugins() {\n return this._config.plugins;\n }\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType, ()=>[\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`, ()=>[\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`\n ],\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`, ()=>[\n [\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]\n ]);\n }\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`, ()=>[\n [\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || []\n ]\n ]);\n }\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n getOptionScopes(mainScope, keyLists, resetCache) {\n const { options , type } = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n const scopes = new Set();\n keyLists.forEach((keys)=>{\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach((key)=>addIfFound(scopes, mainScope, key));\n }\n keys.forEach((key)=>addIfFound(scopes, options, key));\n keys.forEach((key)=>addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach((key)=>addIfFound(scopes, defaults, key));\n keys.forEach((key)=>addIfFound(scopes, descriptors, key));\n });\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n chartOptionScopes() {\n const { options , type } = this;\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {},\n {\n type\n },\n defaults,\n descriptors\n ];\n }\n resolveNamedOptions(scopes, names, context, prefixes = [\n ''\n ]) {\n const result = {\n $shared: true\n };\n const { resolver , subPrefixes } = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n for (const prop of names){\n result[prop] = options[prop];\n }\n return result;\n }\n createResolver(scopes, context, prefixes = [\n ''\n ], descriptorDefaults) {\n const { resolver } = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context) ? _attachContext(resolver, context, undefined, descriptorDefaults) : resolver;\n }\n}\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter((p)=>!p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\nconst hasFunction = (value)=>isObject(value) && Object.getOwnPropertyNames(value).reduce((acc, key)=>acc || isFunction(value[key]), false);\nfunction needContext(proxy, names) {\n const { isScriptable , isIndexable } = _descriptors(proxy);\n for (const prop of names){\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if (scriptable && (isFunction(value) || hasFunction(value)) || indexable && isArray(value)) {\n return true;\n }\n }\n return false;\n}\n\nvar version = \"4.4.0\";\n\nconst KNOWN_POSITIONS = [\n 'top',\n 'bottom',\n 'left',\n 'right',\n 'chartArea'\n];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';\n}\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1];\n };\n}\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n chart.notifyPlugins('afterRender');\n callback(animationOptions && animationOptions.onComplete, [\n context\n ], chart);\n}\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callback(animationOptions && animationOptions.onProgress, [\n context\n ], chart);\n}\n function getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n item = item[0];\n }\n if (item && item.canvas) {\n item = item.canvas;\n }\n return item;\n}\nconst instances = {};\nconst getChart = (key)=>{\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c)=>c.canvas === canvas).pop();\n};\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys){\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n function determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\nfunction getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\nfunction getDatasetArea(meta, chartArea) {\n const { xScale , yScale } = meta;\n if (xScale && yScale) {\n return {\n left: getSizeForArea(xScale, chartArea, 'left'),\n right: getSizeForArea(xScale, chartArea, 'right'),\n top: getSizeForArea(yScale, chartArea, 'top'),\n bottom: getSizeForArea(yScale, chartArea, 'bottom')\n };\n }\n return chartArea;\n}\nclass Chart {\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n constructor(item, userConfig){\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error('Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' + ' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.');\n }\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce((mode)=>this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n instances[this.id] = this;\n if (!context || !canvas) {\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n get aspectRatio() {\n const { options: { aspectRatio , maintainAspectRatio } , width , height , _aspectRatio } = this;\n if (!isNullOrUndef(aspectRatio)) {\n return aspectRatio;\n }\n if (maintainAspectRatio && _aspectRatio) {\n return _aspectRatio;\n }\n return height ? width / height : null;\n }\n get data() {\n return this.config.data;\n }\n set data(data) {\n this.config.data = data;\n }\n get options() {\n return this._options;\n }\n set options(options) {\n this.config.options = options;\n }\n get registry() {\n return registry;\n }\n _initialize() {\n this.notifyPlugins('beforeInit');\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n this.bindEvents();\n this.notifyPlugins('afterInit');\n return this;\n }\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n stop() {\n animator.stop(this);\n return this;\n }\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {\n width,\n height\n };\n }\n }\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n this.notifyPlugins('resize', {\n size: newSize\n });\n callback(options.onResize, [\n this,\n newSize\n ], this);\n if (this.attached) {\n if (this._doResize(mode)) {\n this.render();\n }\n }\n }\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n each(scalesOptions, (axisOptions, axisID)=>{\n axisOptions.id = axisID;\n });\n }\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id)=>{\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n if (scaleOpts) {\n items = items.concat(Object.keys(scaleOpts).map((id)=>{\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n }));\n }\n each(items, (item)=>{\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n scale.init(scaleOptions, options);\n });\n each(updated, (hasUpdated, id)=>{\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n each(scales, (scale)=>{\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n metasets.sort((a, b)=>a.index - b.index);\n if (numMeta > numData) {\n for(let i = numData; i < numMeta; ++i){\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n _removeUnreferencedMetasets() {\n const { _metasets: metasets , data: { datasets } } = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index)=>{\n if (datasets.filter((x)=>x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n this._removeUnreferencedMetasets();\n for(i = 0, ilen = datasets.length; i < ilen; i++){\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const { datasetElementType , dataElementType } = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n this._updateMetasets();\n return newControllers;\n }\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex)=>{\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n update(mode) {\n const config = this.config;\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n this._plugins.invalidate();\n if (this.notifyPlugins('beforeUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n const newControllers = this.buildOrUpdateControllers();\n this.notifyPlugins('beforeElementsUpdate');\n let minPadding = 0;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; i++){\n const { controller } = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n if (!animsDisabled) {\n each(newControllers, (controller)=>{\n controller.reset();\n });\n }\n this._updateDatasets(mode);\n this.notifyPlugins('afterUpdate', {\n mode\n });\n this._layers.sort(compare2Level('z', '_idx'));\n const { _active , _lastEvent } = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n this.render();\n }\n _updateScales() {\n each(this.scales, (scale)=>{\n layouts.removeBox(this, scale);\n });\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n this.unbindEvents();\n this.bindEvents();\n }\n }\n _updateHiddenIndices() {\n const { _hiddenIndices } = this;\n const changes = this._getUniformDataChanges() || [];\n for (const { method , start , count } of changes){\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx)=>new Set(_dataChanges.filter((c)=>c[0] === idx).map((c, i)=>i + ',' + c.splice(1).join(',')));\n const changeSet = makeSet(0);\n for(let i = 1; i < datasetCount; i++){\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet).map((c)=>c.split(',')).map((a)=>({\n method: a[1],\n start: +a[2],\n count: +a[3]\n }));\n }\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {\n cancelable: true\n }) === false) {\n return;\n }\n layouts.update(this, this.width, this.height, minPadding);\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n this._layers = [];\n each(this.boxes, (box)=>{\n if (noArea && box.position === 'chartArea') {\n return;\n }\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n this._layers.forEach((item, index)=>{\n item._idx = index;\n });\n this.notifyPlugins('afterLayout');\n }\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this.getDatasetMeta(i).controller.configure();\n }\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this._updateDataset(i, isFunction(mode) ? mode({\n datasetIndex: i\n }) : mode);\n }\n this.notifyPlugins('afterDatasetsUpdate', {\n mode\n });\n }\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {\n meta,\n index,\n mode,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n meta.controller._update(mode);\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n render() {\n if (this.notifyPlugins('beforeRender', {\n cancelable: true\n }) === false) {\n return;\n }\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({\n chart: this\n });\n }\n }\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const { width , height } = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n if (this.notifyPlugins('beforeDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const layers = this._layers;\n for(i = 0; i < layers.length && layers[i].z <= 0; ++i){\n layers[i].draw(this.chartArea);\n }\n this._drawDatasets();\n for(; i < layers.length; ++i){\n layers[i].draw(this.chartArea);\n }\n this.notifyPlugins('afterDraw');\n }\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n return result;\n }\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const metasets = this.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n this._drawDataset(metasets[i]);\n }\n this.notifyPlugins('afterDatasetsDraw');\n }\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta, this.chartArea);\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n meta.controller.draw();\n if (useClip) {\n unclipArea(ctx);\n }\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n return [];\n }\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter((x)=>x && x._dataset === dataset).pop();\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n return meta;\n }\n getContext() {\n return this.$context || (this.$context = createContext(null, {\n chart: this,\n type: 'chart'\n }));\n }\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n const meta = this.getDatasetMeta(datasetIndex);\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n anims.update(meta, {\n visible\n });\n this.update((ctx)=>ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n for(i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this._destroyDatasetMeta(i);\n }\n }\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const { canvas , ctx } = this;\n this._stop();\n this.config.clearCache();\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n delete instances[this.id];\n this.notifyPlugins('afterDestroy');\n }\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const listener = (e, x, y)=>{\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n each(this.options.events, (type)=>_add(type, listener));\n }\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener)=>{\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n const listener = (width, height)=>{\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n let detached;\n const attached = ()=>{\n _remove('attach', attached);\n this.attached = true;\n this.resize();\n _add('resize', listener);\n _add('detach', detached);\n };\n detached = ()=>{\n this.attached = false;\n _remove('resize', listener);\n this._stop();\n this._resize(0, 0);\n _add('attach', attached);\n };\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n unbindEvents() {\n each(this._listeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n each(this._responsiveListeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n if (changed) {\n this._active = active;\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter((p)=>p.plugin.id === pluginId).length === 1;\n }\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin)=>(plugin.options.events || this.options.events).includes(e.native.type);\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n const changed = this._handleEvent(e, replay, args.inChartArea);\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n if (changed || args.changed) {\n this.render();\n }\n return this;\n }\n _handleEvent(e, replay, inChartArea) {\n const { _active: lastActive = [] , options } = this;\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n if (inChartArea) {\n this._lastEvent = null;\n callback(options.onHover, [\n e,\n active,\n this\n ], this);\n if (isClick) {\n callback(options.onClick, [\n e,\n active,\n this\n ], this);\n }\n }\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n this._lastEvent = lastEvent;\n return changed;\n }\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart)=>chart._plugins.invalidate());\n}\n\nfunction clipArc(ctx, element, endAngle) {\n const { startAngle , pixelMargin , x , y , outerRadius , innerRadius } = element;\n let angleMargin = pixelMargin / outerRadius;\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, [\n 'outerStart',\n 'outerEnd',\n 'innerStart',\n 'innerEnd'\n ]);\n}\n/**\n * Parse border radius from the provided options\n */ function parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val)=>{\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit)\n };\n}\n/**\n * Convert (r, 𝜃) to (x, y)\n */ function rThetaToXY(r, theta, x, y) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta)\n };\n}\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */ function pathArc(ctx, element, offset, spacing, end, circular) {\n const { x , y , startAngle: start , pixelMargin , innerRadius: innerR } = element;\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n let spacingOffset = 0;\n const alpha = end - start;\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const { outerStart , outerEnd , innerStart , innerEnd } = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n ctx.beginPath();\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2;\n ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true);\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n ctx.closePath();\n}\nfunction drawArc(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference } = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\nfunction drawBorder(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference , options } = element;\n const { borderWidth , borderJoinStyle , borderDash , borderDashOffset } = options;\n const inner = options.borderAlign === 'inner';\n if (!borderWidth) {\n return;\n }\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\nclass ArcElement extends Element {\n static id = 'arc';\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n static descriptors = {\n _scriptable: true,\n _indexable: (name)=>name !== 'borderDash'\n };\n circumference;\n endAngle;\n fullCircles;\n innerRadius;\n outerRadius;\n pixelMargin;\n startAngle;\n constructor(cfg){\n super();\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(chartX, chartY, useFinalPosition) {\n const point = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n const { angle , distance } = getAngleFromPoint(point, {\n x: chartX,\n y: chartY\n });\n const { startAngle , endAngle , innerRadius , outerRadius , circumference } = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n return betweenAngles && withinRadius;\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , startAngle , endAngle , innerRadius , outerRadius } = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ], useFinalPosition);\n const { offset , spacing } = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n tooltipPosition(useFinalPosition) {\n return this.getCenterPoint(useFinalPosition);\n }\n draw(ctx) {\n const { options , circumference } = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = options.borderAlign === 'inner' ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n ctx.save();\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n ctx.restore();\n }\n}\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\n function getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n return lineTo;\n}\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const { start: paramsStart = 0 , end: paramsEnd = count - 1 } = params;\n const { start: segmentStart , end: segmentEnd } = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n function pathSegment(ctx, line, segment, params) {\n const { points , options } = line;\n const { count , start , loop , ilen } = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n let { move =true , reverse } = params || {};\n let i, point, prev;\n for(i = 0; i <= ilen; ++i){\n point = points[(start + (reverse ? ilen - i : i)) % count];\n if (point.skip) {\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n prev = point;\n }\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n return !!loop;\n}\n function fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const { count , start , ilen } = pathVars(points, segment, params);\n const { move =true , reverse } = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n const pointIndex = (index)=>(start + (reverse ? ilen - index : index)) % count;\n const drawX = ()=>{\n if (minY !== maxY) {\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n ctx.lineTo(avgX, lastY);\n }\n };\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n for(i = 0; i <= ilen; ++i){\n point = points[pointIndex(i)];\n if (point.skip) {\n continue;\n }\n const x = point.x;\n const y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n ctx.lineTo(x, y);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n lastY = y;\n }\n drawX();\n}\n function _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n function _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n return _pointInLine;\n}\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\nfunction strokePathDirect(ctx, line, start, count) {\n const { segments , options } = line;\n const segmentMethod = _getSegmentMethod(line);\n for (const segment of segments){\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {\n start,\n end: start + count - 1\n })) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\nconst usePath2D = typeof Path2D === 'function';\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\nclass LineElement extends Element {\n static id = 'line';\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n static descriptors = {\n _scriptable: true,\n _indexable: (name)=>name !== 'borderDash' && name !== 'fill'\n };\n constructor(cfg){\n super();\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n get points() {\n return this._points;\n }\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {\n property,\n start: value,\n end: value\n });\n if (!segments.length) {\n return;\n }\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for(i = 0, ilen = segments.length; i < ilen; ++i){\n const { start , end } = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n start = start || 0;\n count = count || this.points.length - start;\n for (const segment of segments){\n loop &= segmentMethod(ctx, this, segment, {\n start,\n end: start + count - 1\n });\n }\n return !!loop;\n }\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n if (points.length && options.borderWidth) {\n ctx.save();\n draw(ctx, this, start, count);\n ctx.restore();\n }\n if (this.animated) {\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n\nfunction inRange$1(el, pos, axis, useFinalPosition) {\n const options = el.options;\n const { [axis]: value } = el.getProps([\n axis\n ], useFinalPosition);\n return Math.abs(pos - value) < options.radius + options.hitRadius;\n}\nclass PointElement extends Element {\n static id = 'point';\n parsed;\n skip;\n stop;\n /**\n * @type {any}\n */ static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n /**\n * @type {any}\n */ static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n const options = this.options;\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange$1(this, mouseX, 'x', useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange$1(this, mouseY, 'y', useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n size(options) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n draw(ctx, area) {\n const options = this.options;\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n\nfunction getBarBounds(bar, useFinalPosition) {\n const { x , y , base , width , height } = bar.getProps([\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ], useFinalPosition);\n let left, right, top, bottom, half;\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n return {\n left,\n top,\n right,\n bottom\n };\n}\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\nfunction parseBorderRadius(bar, maxW, maxH) {\n const { enableBorderRadius } = bar.getProps([\n 'enableBorderRadius'\n ]);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n const enableBorder = enableBorderRadius || isObject(value);\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))\n }\n }\n };\n}\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n return bounds && (skipX || _isBetween(x, bounds.left, bounds.right)) && (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n function addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\nclass BarElement extends Element {\n static id = 'bar';\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n draw(ctx) {\n const { inflateAmount , options: { borderColor , backgroundColor } } = this;\n const { inner , outer } = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n ctx.save();\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , base , horizontal } = this.getProps([\n 'x',\n 'y',\n 'base',\n 'horizontal'\n ], useFinalPosition);\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n\nvar elements = /*#__PURE__*/Object.freeze({\n__proto__: null,\nArcElement: ArcElement,\nBarElement: BarElement,\nLineElement: LineElement,\nPointElement: PointElement\n});\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)',\n 'rgb(255, 99, 132)',\n 'rgb(255, 159, 64)',\n 'rgb(255, 205, 86)',\n 'rgb(75, 192, 192)',\n 'rgb(153, 102, 255)',\n 'rgb(201, 203, 207)' // grey\n];\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map((color)=>color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\nfunction getBorderColor(i) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\nfunction getBackgroundColor(i) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\nfunction colorizeDefaultDataset(dataset, i) {\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n return ++i;\n}\nfunction colorizeDoughnutDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>getBorderColor(i++));\n return i;\n}\nfunction colorizePolarAreaDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>getBackgroundColor(i++));\n return i;\n}\nfunction getColorizer(chart) {\n let i = 0;\n return (dataset, datasetIndex)=>{\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n if (controller instanceof DoughnutController) {\n i = colorizeDoughnutDataset(dataset, i);\n } else if (controller instanceof PolarAreaController) {\n i = colorizePolarAreaDataset(dataset, i);\n } else if (controller) {\n i = colorizeDefaultDataset(dataset, i);\n }\n };\n}\nfunction containsColorsDefinitions(descriptors) {\n let k;\n for(k in descriptors){\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n return false;\n}\nfunction containsColorsDefinition(descriptor) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\nvar plugin_colors = {\n id: 'colors',\n defaults: {\n enabled: true,\n forceOverride: false\n },\n beforeLayout (chart, _args, options) {\n if (!options.enabled) {\n return;\n }\n const { data: { datasets } , options: chartOptions } = chart.config;\n const { elements } = chartOptions;\n if (!options.forceOverride && (containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || elements && containsColorsDefinitions(elements))) {\n return;\n }\n const colorizer = getColorizer(chart);\n datasets.forEach(colorizer);\n }\n};\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n const samples = options.samples || availableWidth;\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n const decimated = [];\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n decimated[sampledIndex++] = data[a];\n for(i = 0; i < samples - 2; i++){\n let avgX = 0;\n let avgY = 0;\n let j;\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n for(j = avgRangeStart; j < avgRangeEnd; j++){\n avgX += data[j].x;\n avgY += data[j].y;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const { x: pointAx , y: pointAy } = data[a];\n maxArea = area = -1;\n for(j = rangeOffs; j < rangeTo; j++){\n area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy));\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n decimated[sampledIndex++] = data[endIndex];\n return decimated;\n}\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n for(i = start; i < start + count; ++i){\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n const lastIndex = i - 1;\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n if (i > 0 && lastIndex !== startIndex) {\n decimated.push(data[lastIndex]);\n }\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n return decimated;\n}\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data\n });\n }\n}\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset)=>{\n cleanDecimatedDataset(dataset);\n });\n}\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n let start = 0;\n let count;\n const { iScale } = meta;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n return {\n start,\n count\n };\n}\nvar plugin_decimation = {\n id: 'decimation',\n defaults: {\n algorithm: 'min-max',\n enabled: false\n },\n beforeElementsUpdate: (chart, args, options)=>{\n if (!options.enabled) {\n cleanDecimatedData(chart);\n return;\n }\n const availableWidth = chart.width;\n chart.data.datasets.forEach((dataset, datasetIndex)=>{\n const { _data , indexAxis } = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n if (resolve([\n indexAxis,\n chart.options.indexAxis\n ]) === 'y') {\n return;\n }\n if (!meta.controller.supportsDecimation) {\n return;\n }\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n return;\n }\n if (chart.options.parsing) {\n return;\n }\n let { start , count } = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n cleanDecimatedDataset(dataset);\n return;\n }\n if (isNullOrUndef(_data)) {\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n let decimated;\n switch(options.algorithm){\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n dataset._decimated = decimated;\n });\n },\n destroy (chart) {\n cleanDecimatedData(chart);\n }\n};\n\nfunction _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n for (const segment of segments){\n let { start , end } = segment;\n end = _findSegmentEnd(start, end, points);\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n if (!target.segments) {\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n const targetSegments = _boundSegments(target, bounds);\n for (const tgt of targetSegments){\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n for (const fillSource of fillSources){\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\nfunction _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {\n property,\n start,\n end\n };\n}\nfunction _pointsFromSegments(boundary, line) {\n const { x =null , y =null } = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({ start , end })=>{\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({\n x: first.x,\n y\n });\n points.push({\n x: last.x,\n y\n });\n } else if (x !== null) {\n points.push({\n x,\n y: first.y\n });\n points.push({\n x,\n y: last.y\n });\n }\n });\n return points;\n}\nfunction _findSegmentEnd(start, end, points) {\n for(; end > start; end--){\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n\nfunction _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n if (isArray(boundary)) {\n _loop = true;\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n return points.length ? new LineElement({\n points,\n options: {\n tension: 0\n },\n _loop,\n _fullLoop: _loop\n }) : null;\n}\nfunction _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n\nfunction _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [\n index\n ];\n let target;\n if (!propagate) {\n return fill;\n }\n while(fill !== false && visited.indexOf(fill) === -1){\n if (!isNumberFinite(fill)) {\n return fill;\n }\n target = sources[fill];\n if (!target) {\n return false;\n }\n if (target.visible) {\n return fill;\n }\n visited.push(fill);\n fill = target.fill;\n }\n return false;\n}\n function _decodeFill(line, index, count) {\n const fill = parseFillOption(line);\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n let target = parseFloat(fill);\n if (isNumberFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n return [\n 'origin',\n 'start',\n 'end',\n 'stack',\n 'shape'\n ].indexOf(fill) >= 0 && fill;\n}\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n return target;\n}\n function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n function _getTargetValue(fill, scale, startValue) {\n let value;\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n function parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n if (fill === false || fill === null) {\n return false;\n }\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n\nfunction _buildStackLine(source) {\n const { scale , index , line } = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({\n x: null,\n y: scale.bottom\n }, line));\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n for(let j = segment.start; j <= segment.end; j++){\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({\n points,\n options: {}\n });\n}\n function getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n for(let i = 0; i < metas.length; i++){\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n function addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for(let j = 0; j < linesBelow.length; j++){\n const line = linesBelow[j];\n const { first , last , point } = findPoint(line, sourcePoint, 'x');\n if (!point || first && last) {\n continue;\n }\n if (first) {\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n break;\n }\n }\n }\n points.push(...postponed);\n}\n function findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {\n first,\n last,\n point\n };\n}\n\nclass simpleArc {\n constructor(opts){\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n pathSegment(ctx, bounds, opts) {\n const { x , y , radius } = this;\n bounds = bounds || {\n start: 0,\n end: TAU\n };\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n interpolate(point) {\n const { x , y , radius } = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n\nfunction _getTarget(source) {\n const { chart , fill , line } = source;\n if (isNumberFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n if (fill === 'shape') {\n return true;\n }\n const boundary = computeBoundary(source);\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n return _createBoundaryLine(boundary, line);\n}\n function getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\nfunction computeLinearBoundary(source) {\n const { scale ={} , fill } = source;\n const pixel = _getTargetPixel(fill, scale);\n if (isNumberFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n return null;\n}\nfunction computeCircularBoundary(source) {\n const { scale , fill } = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n for(let i = 0; i < length; ++i){\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\nfunction _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const { line , scale , axis } = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const { above =color , below =color } = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {\n line,\n target,\n above,\n below,\n area,\n scale,\n axis\n });\n unclipArea(ctx);\n }\n}\nfunction doFill(ctx, cfg) {\n const { line , target , above , below , area , scale } = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n ctx.save();\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {\n line,\n target,\n color: above,\n scale,\n property\n });\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {\n line,\n target,\n color: below,\n scale,\n property\n });\n ctx.restore();\n}\nfunction clipVertical(ctx, target, clipY) {\n const { segments , points } = target;\n let first = true;\n let lineLoop = false;\n ctx.beginPath();\n for (const segment of segments){\n const { start , end } = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {\n move: lineLoop\n });\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\nfunction fill(ctx, cfg) {\n const { line , target , property , color , scale } = cfg;\n const segments = _segments(line, target, property);\n for (const { source: src , target: tgt , start , end } of segments){\n const { style: { backgroundColor =color } = {} } = src;\n const notShape = target !== true;\n ctx.save();\n ctx.fillStyle = backgroundColor;\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n ctx.beginPath();\n const lineLoop = !!line.pathSegment(ctx, src);\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n const targetLoop = !!target.pathSegment(ctx, tgt, {\n move: lineLoop,\n reverse: true\n });\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n ctx.restore();\n }\n}\nfunction clipBounds(ctx, scale, bounds) {\n const { top , bottom } = scale.chart.chartArea;\n const { property , start , end } = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\nvar index = {\n id: 'filler',\n afterDatasetsUpdate (chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n for(i = 0; i < count; ++i){\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line\n };\n }\n meta.$filler = source;\n sources.push(source);\n }\n for(i = 0; i < count; ++i){\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n beforeDraw (chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n beforeDatasetsDraw (chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n const metasets = chart.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n beforeDatasetDraw (chart, args, options) {\n const source = args.meta.$filler;\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n\nconst getBoxSize = (labelOpts, fontSize)=>{\n let { boxHeight =fontSize , boxWidth =fontSize } = labelOpts;\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\nconst itemsEqual = (a, b)=>a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass Legend extends Element {\n constructor(config){\n super();\n this._added = false;\n this.legendHitBoxes = [];\n this._hoveredItem = null;\n this.doughnutMode = false;\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = callback(labelOpts.generateLabels, [\n this.chart\n ], this) || [];\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item)=>labelOpts.filter(item, this.chart.data));\n }\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b)=>labelOpts.sort(a, b, this.chart.data));\n }\n if (this.options.reverse) {\n legendItems.reverse();\n }\n this.legendItems = legendItems;\n }\n fit() {\n const { options , ctx } = this;\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const { boxWidth , itemHeight } = getBoxSize(labelOpts, fontSize);\n let width, height;\n ctx.font = labelFont.string;\n if (this.isHorizontal()) {\n width = this.maxWidth;\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight;\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const { ctx , maxWidth , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const lineWidths = this.lineWidths = [\n 0\n ];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i)=>{\n const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n hitboxes[i] = {\n left: 0,\n top,\n row,\n width: itemWidth,\n height: itemHeight\n };\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n return totalHeight;\n }\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const { ctx , maxHeight , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n let left = 0;\n let col = 0;\n this.legendItems.forEach((legendItem, i)=>{\n const { itemWidth , itemHeight } = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n hitboxes[i] = {\n left,\n top: currentColHeight,\n col,\n width: itemWidth,\n height: itemHeight\n };\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n totalWidth += currentColWidth;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n return totalWidth;\n }\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const { legendHitBoxes: hitboxes , options: { align , labels: { padding } , rtl } } = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes){\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes){\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n this._draw();\n unclipArea(ctx);\n }\n }\n _draw() {\n const { options: opts , columnSizes , lineWidths , ctx } = this;\n const { align , labels: labelOpts } = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const { padding } = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n this.drawTitle();\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n const { boxWidth , boxHeight , itemHeight } = getBoxSize(labelOpts, fontSize);\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n ctx.save();\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n if (labelOpts.usePointStyle) {\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n ctx.beginPath();\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n ctx.restore();\n };\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n overrideTextDirection(this.ctx, opts.textDirection);\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i)=>{\n ctx.strokeStyle = legendItem.fontColor;\n ctx.fillStyle = legendItem.fontColor;\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n rtlHelper.setWidth(this.width);\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n const realX = rtlHelper.x(x);\n drawLegendBox(realX, y, legendItem);\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n fillText(rtlHelper.x(x), y, legendItem);\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n if (!titleOpts.display) {\n return;\n }\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n let left = this.left;\n let maxWidth = this.width;\n if (this.isHorizontal()) {\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n const maxHeight = this.columnSizes.reduce((acc, size)=>Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n const x = _alignStartEnd(position, left, left + maxWidth);\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n if (_isBetween(x, this.left, this.right) && _isBetween(y, this.top, this.bottom)) {\n lh = this.legendHitBoxes;\n for(i = 0; i < lh.length; ++i){\n hitBox = lh[i];\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width) && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n return this.legendItems[i];\n }\n }\n }\n return null;\n }\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n callback(opts.onLeave, [\n e,\n previous,\n this\n ], this);\n }\n this._hoveredItem = hoveredItem;\n if (hoveredItem && !sameItem) {\n callback(opts.onHover, [\n e,\n hoveredItem,\n this\n ], this);\n }\n } else if (hoveredItem) {\n callback(opts.onClick, [\n e,\n hoveredItem,\n this\n ], this);\n }\n }\n}\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {\n itemWidth,\n itemHeight\n };\n}\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b)=>a.length > b.length ? a : b);\n }\n return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width;\n}\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\nvar plugin_legend = {\n id: 'legend',\n _element: Legend,\n start (chart, _args, options) {\n const legend = chart.legend = new Legend({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n stop (chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n beforeUpdate (chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n afterUpdate (chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n afterEvent (chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n onClick (e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n onHover: null,\n onLeave: null,\n labels: {\n color: (ctx)=>ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n generateLabels (chart) {\n const datasets = chart.data.datasets;\n const { labels: { usePointStyle , pointStyle , textAlign , color , useBorderRadius , borderRadius } } = chart.legend.options;\n return chart._getSortedDatasetMetas().map((meta)=>{\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n title: {\n color: (ctx)=>ctx.chart.options.color,\n display: false,\n position: 'center',\n text: ''\n }\n },\n descriptors: {\n _scriptable: (name)=>!name.startsWith('on'),\n labels: {\n _scriptable: (name)=>![\n 'generateLabels',\n 'filter',\n 'sort'\n ].includes(name)\n }\n }\n};\n\nclass Title extends Element {\n constructor(config){\n super();\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight) {\n const opts = this.options;\n this.left = 0;\n this.top = 0;\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n _drawArgs(offset) {\n const { top , left , bottom , right , options } = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n }\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n if (!opts.display) {\n return;\n }\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const { titleX , titleY , maxWidth , rotation } = this._drawArgs(offset);\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n}\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\nvar plugin_title = {\n id: 'title',\n _element: Title,\n start (chart, _args, options) {\n createTitle(chart, options);\n },\n stop (chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n beforeUpdate (chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold'\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst map = new WeakMap();\nvar plugin_subtitle = {\n id: 'subtitle',\n start (chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n stop (chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n beforeUpdate (chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal'\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst positioners = {\n average (items) {\n if (!items.length) {\n return false;\n }\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n return {\n x: x / count,\n y: y / count\n };\n },\n nearest (items, eventPosition) {\n if (!items.length) {\n return false;\n }\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n return {\n x,\n y\n };\n }\n};\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n return base;\n}\n function splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n function createTooltipItem(chart, item) {\n const { element , datasetIndex , index } = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const { label , value } = controller.getLabelAndValue(index);\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n function getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const { body , footer , title } = tooltip;\n const { boxWidth , boxHeight } = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n let combinedBodyLength = body.reduce((count, bodyItem)=>count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;\n }\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n ctx.save();\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;\n each(body, (bodyItem)=>{\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n widthPadding = 0;\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n ctx.restore();\n width += padding.width;\n return {\n width,\n height\n };\n}\nfunction determineYAlign(chart, size) {\n const { y , height } = size;\n if (y < height / 2) {\n return 'top';\n } else if (y > chart.height - height / 2) {\n return 'bottom';\n }\n return 'center';\n}\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const { x , width } = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\nfunction determineXAlign(chart, options, size, yAlign) {\n const { x , width } = size;\n const { width: chartWidth , chartArea: { left , right } } = chart;\n let xAlign = 'center';\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n return xAlign;\n}\n function determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\nfunction alignX(size, xAlign) {\n let { x , width } = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= width / 2;\n }\n return x;\n}\nfunction alignY(size, yAlign, paddingAndSize) {\n let { y , height } = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= height / 2;\n }\n return y;\n}\n function getBackgroundPoint(options, size, alignment, chart) {\n const { caretSize , caretPadding , cornerRadius } = options;\n const { xAlign , yAlign } = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n return align === 'center' ? tooltip.x + tooltip.width / 2 : align === 'right' ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;\n}\n function getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\nconst defaultCallbacks = {\n beforeTitle: noop,\n title (tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n return '';\n },\n afterTitle: noop,\n beforeBody: noop,\n beforeLabel: noop,\n label (tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n let label = tooltipItem.dataset.label || '';\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0\n };\n },\n labelTextColor () {\n return this.options.bodyColor;\n },\n labelPointStyle (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation\n };\n },\n afterLabel: noop,\n afterBody: noop,\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n function invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n return result;\n}\nclass Tooltip extends Element {\n static positioners = positioners;\n constructor(config){\n super();\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n if (cached) {\n return cached;\n }\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n return animations;\n }\n getContext() {\n return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n getTitle(context, options) {\n const { callbacks } = options;\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n return lines;\n }\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems));\n }\n getBody(tooltipItems, options) {\n const { callbacks } = options;\n const bodyItems = [];\n each(tooltipItems, (context)=>{\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n bodyItems.push(bodyItem);\n });\n return bodyItems;\n }\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems));\n }\n getFooter(tooltipItems, options) {\n const { callbacks } = options;\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n return lines;\n }\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n for(i = 0, len = active.length; i < len; ++i){\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array)=>options.filter(element, index, array, data));\n }\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b)=>options.itemSort(a, b, data));\n }\n each(tooltipItems, (context)=>{\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n if (changed && options.external) {\n options.external.call(this, {\n chart: this.chart,\n tooltip: this,\n replay\n });\n }\n }\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n getCaretPosition(tooltipPoint, size, options) {\n const { xAlign , yAlign } = this;\n const { caretSize , cornerRadius } = options;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n const { x: ptX , y: ptY } = tooltipPoint;\n const { width , height } = size;\n let x1, x2, x3, y1, y2, y3;\n if (yAlign === 'center') {\n y2 = ptY + height / 2;\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {\n x1,\n x2,\n x3,\n y1,\n y2,\n y3\n };\n }\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.titleAlign, options);\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing;\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing;\n }\n }\n }\n }\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const { boxHeight , boxWidth } = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2,\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1;\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = toTRBLCorners(labelColor.borderRadius);\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n ctx.fillStyle = this.labelTextColors[i];\n }\n drawBody(pt, ctx, options) {\n const { body } = this;\n const { bodySpacing , bodyAlign , displayColors , boxHeight , boxWidth , boxPadding } = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right' ? bodyAlign === 'center' ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;\n for(i = 0, ilen = body.length; i < ilen; ++i){\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n lines = bodyItem.lines;\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n for(j = 0, jlen = lines.length; j < jlen; ++j){\n fillLineOfText(lines[j]);\n bodyLineHeight = bodyFont.lineHeight;\n }\n each(bodyItem.after, fillLineOfText);\n }\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing;\n }\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n footerFont = toFont(options.footerFont);\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n drawBackground(pt, ctx, tooltipSize, options) {\n const { xAlign , yAlign } = this;\n const { x , y } = pt;\n const { width , height } = tooltipSize;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(options.cornerRadius);\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n _willRender() {\n return !!this.opacity;\n }\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n if (!opacity) {\n return;\n }\n this._updateAnimationTarget(options);\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n const padding = toPadding(options.padding);\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n this.drawBackground(pt, ctx, tooltipSize, options);\n overrideTextDirection(ctx, options.textDirection);\n pt.y += padding.top;\n this.drawTitle(pt, ctx, options);\n this.drawBody(pt, ctx, options);\n this.drawFooter(pt, ctx, options);\n restoreTextDirection(ctx, options.textDirection);\n ctx.restore();\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.chart.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n const positionChanged = this._positionChanged(active, e);\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n if (changed) {\n this._active = active;\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n this.update(true, replay);\n }\n }\n return changed;\n }\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n if (options.reverse) {\n active.reverse();\n }\n return active;\n }\n _positionChanged(active, e) {\n const { caretX , caretY , options } = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\nvar plugin_tooltip = {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n afterInit (chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({\n chart,\n options\n });\n }\n },\n beforeUpdate (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n reset (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n afterDraw (chart) {\n const tooltip = chart.tooltip;\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n if (chart.notifyPlugins('beforeTooltipDraw', {\n ...args,\n cancelable: true\n }) === false) {\n return;\n }\n tooltip.draw(chart.ctx);\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n afterEvent (chart, args) {\n if (chart.tooltip) {\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n args.changed = true;\n }\n }\n },\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold'\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {},\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold'\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts)=>opts.bodyFont.size,\n boxWidth: (ctx, opts)=>opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart'\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'width',\n 'height',\n 'caretX',\n 'caretY'\n ]\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n descriptors: {\n _scriptable: (name)=>name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n additionalOptionScopes: [\n 'interaction'\n ]\n};\n\nvar plugins = /*#__PURE__*/Object.freeze({\n__proto__: null,\nColors: plugin_colors,\nDecimation: plugin_decimation,\nFiller: index,\nLegend: plugin_legend,\nSubTitle: plugin_subtitle,\nTitle: plugin_title,\nTooltip: plugin_tooltip\n});\n\nconst addIfString = (labels, raw, index, addedLabels)=>{\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({\n index,\n label: raw\n });\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\nconst validIndex = (index, max)=>index === null ? null : _limitValue(Math.round(index), 0, max);\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\nclass CategoryScale extends Scale {\n static id = 'category';\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n constructor(cfg){\n super(cfg);\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const { index , label } of added){\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n determineDataLimits() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this.getMinMax(true);\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1);\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n for(let value = min; value <= max; value++){\n ticks.push({\n value\n });\n }\n return ticks;\n }\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n configure() {\n super.configure();\n if (!this.isHorizontal()) {\n this._reversePixels = !this._reversePixels;\n }\n }\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n getBasePixel() {\n return this.bottom;\n }\n}\n\nfunction generateTicks$1(generationOptions, dataRange) {\n const ticks = [];\n const MIN_SPACING = 1e-14;\n const { bounds , step , min , max , precision , count , maxTicks , maxDigits , includeBounds } = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const { min: rmin , max: rmax } = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [\n {\n value: rmin\n },\n {\n value: rmax\n }\n ];\n }\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n if (!isNullOrUndef(precision)) {\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n numSpaces = (niceMax - niceMin) / spacing;\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n const decimalPlaces = Math.max(_decimalPlaces(spacing), _decimalPlaces(niceMin));\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({\n value: min\n });\n if (niceMin < min) {\n j++;\n }\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n for(; j < numSpaces; ++j){\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) {\n break;\n }\n ticks.push({\n value: tickValue\n });\n }\n if (maxDefined && includeBounds && niceMax !== max) {\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({\n value: max\n });\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({\n value: niceMax\n });\n }\n return ticks;\n}\nfunction relativeLabelSize(value, minSpacing, { horizontal , minRotation }) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\nclass LinearScaleBase extends Scale {\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._endValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n return +raw;\n }\n handleTickRangeOptions() {\n const { beginAtZero } = this.options;\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n setMax(max + offset);\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n getTickLimit() {\n const tickOpts = this.options.ticks;\n let { maxTicksLimit , stepSize } = tickOpts;\n let maxTicks;\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n return maxTicks;\n }\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks$1(numericGeneratorOptions, dataRange);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n super.configure();\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n\nclass LinearScale extends LinearScaleBase {\n static id = 'linear';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? min : 0;\n this.max = isNumberFinite(max) ? max : 1;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n\nconst log10Floor = (v)=>Math.floor(log10(v));\nconst changeExponent = (v, m)=>Math.pow(10, log10Floor(v) + m);\nfunction isMajor(tickVal) {\n const remain = tickVal / Math.pow(10, log10Floor(tickVal));\n return remain === 1;\n}\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while(steps(min, max, rangeExp) > 10){\n rangeExp++;\n }\n while(steps(min, max, rangeExp) < 10){\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n function generateTicks(generationOptions, { min , max }) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while(value < max){\n ticks.push({\n value,\n major: isMajor(value),\n significand\n });\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({\n value: lastTick,\n major: isMajor(lastTick),\n significand\n });\n return ticks;\n}\nclass LogarithmicScale extends Scale {\n static id = 'logarithmic';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [\n raw,\n index\n ]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isNumberFinite(value) && value > 0 ? value : null;\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? Math.max(0, min) : null;\n this.max = isNumberFinite(max) ? Math.max(0, max) : null;\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n if (this._zero && this.min !== this._suggestedMin && !isNumberFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n this.handleTickRangeOptions();\n }\n handleTickRangeOptions() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (min === max) {\n if (min <= 0) {\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n setMax(changeExponent(min, +1));\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const opts = this.options;\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n getLabelForValue(value) {\n return value === undefined ? '0' : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n configure() {\n const start = this.min;\n super.configure();\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min ? 0 : (log10(value) - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [\n label\n ];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - size / 2,\n end: pos + size / 2\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n return {\n start: pos,\n end: pos + size\n };\n}\n function fitWithPointLabels(scale) {\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n for(let i = 0; i < valueCount; i++){\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b);\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\nfunction createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const { extra , additionalAngle , padding , size } = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n visible: true,\n x: pointLabelPosition.x,\n y,\n textAlign,\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\nfunction isNotOverlapped(item, area) {\n if (!area) {\n return true;\n }\n const { left , top , right , bottom } = item;\n const apexesInArea = _isPointInArea({\n x: left,\n y: top\n }, area) || _isPointInArea({\n x: left,\n y: bottom\n }, area) || _isPointInArea({\n x: right,\n y: top\n }, area) || _isPointInArea({\n x: right,\n y: bottom\n }, area);\n return !apexesInArea;\n}\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const { centerPointLabels , display } = opts.pointLabels;\n const itemOpts = {\n extra: getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? PI / valueCount : 0\n };\n let area;\n for(let i = 0; i < valueCount; i++){\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n const item = createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === 'auto') {\n item.visible = isNotOverlapped(item, area);\n if (item.visible) {\n area = item;\n }\n }\n }\n return items;\n}\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n return 'right';\n}\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= w / 2;\n }\n return x;\n}\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= h / 2;\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\nfunction drawPointLabelBox(ctx, opts, item) {\n const { left , top , right , bottom } = item;\n const { backdropColor } = opts;\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(opts.borderRadius);\n const padding = toPadding(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n}\nfunction drawPointLabels(scale, labelCount) {\n const { ctx , options: { pointLabels } } = scale;\n for(let i = labelCount - 1; i >= 0; i--){\n const item = scale._pointLabelItems[i];\n if (!item.visible) {\n continue;\n }\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = toFont(optsAtIndex.font);\n const { x , y , textAlign } = item;\n renderText(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n });\n }\n}\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const { ctx } = scale;\n if (circular) {\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n for(let i = 1; i < labelCount; i++){\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n const { color , lineWidth } = gridLineOpts;\n if (!circular && !labelCount || !color || !lineWidth || radius < 0) {\n return;\n }\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\nclass RadialLinearScale extends LinearScaleBase {\n static id = 'radialLinear';\n static defaults = {\n display: true,\n animate: true,\n position: 'chartArea',\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n grid: {\n circular: false\n },\n startAngle: 0,\n ticks: {\n showLabelBackdrop: true,\n callback: Ticks.formatters.numeric\n },\n pointLabels: {\n backdropColor: undefined,\n backdropPadding: 2,\n display: true,\n font: {\n size: 10\n },\n callback (label) {\n return label;\n },\n padding: 5,\n centerPointLabels: false\n }\n };\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n constructor(cfg){\n super(cfg);\n this.xCenter = undefined;\n this.yCenter = undefined;\n this.drawingArea = undefined;\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n setDimensions() {\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(false);\n this.min = isNumberFinite(min) && !isNaN(min) ? min : 0;\n this.max = isNumberFinite(max) && !isNaN(max) ? max : 0;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n this._pointLabels = this.getLabels().map((value, index)=>{\n const label = callback(this.options.pointLabels.callback, [\n value,\n index\n ], this);\n return label || label === 0 ? label : '';\n }).filter((v, i)=>this.chart.getDataVisibility(i));\n }\n fit() {\n const opts = this.options;\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n getPointLabelPosition(index) {\n const { left , top , right , bottom } = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom\n };\n }\n drawBackground() {\n const { backgroundColor , grid: { circular } } = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const { angleLines , grid , border } = opts;\n const labelCount = this._pointLabels.length;\n let i, offset, position;\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n if (grid.display) {\n this.ticks.forEach((tick, index)=>{\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n if (angleLines.display) {\n ctx.save();\n for(i = labelCount - 1; i >= 0; i--){\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const { color , lineWidth } = optsAtIndex;\n if (!lineWidth || !color) {\n continue;\n }\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n ctx.restore();\n }\n }\n drawBorder() {}\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n if (!tickOpts.display) {\n return;\n }\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n this.ticks.forEach((tick, index)=>{\n if (index === 0 && !opts.reverse) {\n return;\n }\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height);\n }\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth\n });\n });\n ctx.restore();\n }\n drawTitle() {}\n}\n\nconst INTERVALS = {\n millisecond: {\n common: true,\n size: 1,\n steps: 1000\n },\n second: {\n common: true,\n size: 1000,\n steps: 60\n },\n minute: {\n common: true,\n size: 60000,\n steps: 60\n },\n hour: {\n common: true,\n size: 3600000,\n steps: 24\n },\n day: {\n common: true,\n size: 86400000,\n steps: 30\n },\n week: {\n common: false,\n size: 604800000,\n steps: 4\n },\n month: {\n common: true,\n size: 2.628e9,\n steps: 12\n },\n quarter: {\n common: false,\n size: 7.884e9,\n steps: 4\n },\n year: {\n common: true,\n size: 3.154e10\n }\n};\n const UNITS = /* #__PURE__ */ Object.keys(INTERVALS);\n function sorter(a, b) {\n return a - b;\n}\n function parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n const adapter = scale._adapter;\n const { parser , round , isoWeekday } = scale._parseOpts;\n let value = input;\n if (typeof parser === 'function') {\n value = parser(value);\n }\n if (!isNumberFinite(value)) {\n value = typeof parser === 'string' ? adapter.parse(value, parser) : adapter.parse(value);\n }\n if (value === null) {\n return null;\n }\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, 'isoWeek', isoWeekday) : adapter.startOf(value, round);\n }\n return +value;\n}\n function determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n for(let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i){\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n return UNITS[ilen - 1];\n}\n function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for(let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--){\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n function determineMajorUnit(unit) {\n for(let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i){\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n function addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const { lo , hi } = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n function setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n for(major = first; major <= last; major = +adapter.add(major, 1, majorUnit)){\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n function ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n const map = {};\n const ilen = values.length;\n let i, value;\n for(i = 0; i < ilen; ++i){\n value = values[i];\n map[value] = i;\n ticks.push({\n value,\n major: false\n });\n }\n return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass TimeScale extends Scale {\n static id = 'time';\n static defaults = {\n bounds: 'data',\n adapters: {},\n time: {\n parser: false,\n unit: false,\n round: false,\n isoWeekday: false,\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n source: 'auto',\n callback: false,\n major: {\n enabled: false\n }\n }\n };\n constructor(props){\n super(props);\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n this._unit = 'day';\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n adapter.init(opts);\n mergeIf(time.displayFormats, adapter.formats());\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n super.init(scaleOpts);\n this._normalized = opts.normalized;\n }\n parse(raw, index) {\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n if (!minDefined || !maxDefined) {\n _applyBounds(this._getLabelBounds());\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {\n min,\n max\n };\n }\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n const min = this.min;\n const max = this.max;\n const ticks = _filterBetween(timestamps, min, max);\n this._unit = timeOpts.unit || (tickOpts.autoSkip ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n if (options.reverse) {\n ticks.reverse();\n }\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n afterAutoSkip() {\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map((tick)=>+tick.value));\n }\n }\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n this._offsets = {\n start,\n end,\n factor: 1 / (start + 1 + end)\n };\n }\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for(time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++){\n addTick(ticks, time, timestamps);\n }\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n return Object.keys(ticks).sort(sorter).map((x)=>+x);\n }\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n if (formatter) {\n return callback(formatter, [\n time,\n index,\n ticks\n ], this);\n }\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n generateTickLabels(ticks) {\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n return {\n w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,\n h: tickLabelWidth * sinRotation + tickFontSize * cosRotation\n };\n }\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [\n exampleTime\n ], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const metas = this.getMatchingVisibleMetas();\n if (this._normalized && metas.length) {\n return this._cache.data = metas[0].controller.getAllParsedValues(this);\n }\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n return this._cache.data = this.normalize(timestamps);\n }\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const labels = this.getLabels();\n for(i = 0, ilen = labels.length; i < ilen; ++i){\n timestamps.push(parse(this, labels[i]));\n }\n return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);\n }\n normalize(values) {\n return _arrayUnique(values.sort(sorter));\n }\n}\n\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({ lo , hi } = _lookupByKey(table, 'pos', val));\n }\n ({ pos: prevSource , time: prevTarget } = table[lo]);\n ({ pos: nextSource , time: nextTarget } = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({ lo , hi } = _lookupByKey(table, 'time', val));\n }\n ({ time: prevSource , pos: prevTarget } = table[lo]);\n ({ time: nextSource , pos: nextTarget } = table[hi]);\n }\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass TimeSeriesScale extends TimeScale {\n static id = 'timeseries';\n static defaults = TimeScale.defaults;\n constructor(props){\n super(props);\n this._table = [];\n this._minPos = undefined;\n this._tableRange = undefined;\n }\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n buildLookupTable(timestamps) {\n const { min , max } = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n for(i = 0, ilen = timestamps.length; i < ilen; ++i){\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n if (items.length < 2) {\n return [\n {\n time: min,\n pos: 0\n },\n {\n time: max,\n pos: 1\n }\n ];\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({\n time: curr,\n pos: i / (ilen - 1)\n });\n }\n }\n return table;\n }\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) {\n timestamps.splice(0, 0, min);\n }\n if (!timestamps.includes(max) || timestamps.length === 1) {\n timestamps.push(max);\n }\n return timestamps.sort((a, b)=>a - b);\n }\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n if (timestamps.length) {\n return timestamps;\n }\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n return timestamps;\n }\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\n\nvar scales = /*#__PURE__*/Object.freeze({\n__proto__: null,\nCategoryScale: CategoryScale,\nLinearScale: LinearScale,\nLogarithmicScale: LogarithmicScale,\nRadialLinearScale: RadialLinearScale,\nTimeScale: TimeScale,\nTimeSeriesScale: TimeSeriesScale\n});\n\nconst registerables = [\n controllers,\n elements,\n plugins,\n scales\n];\n\nexport { Animation, Animations, ArcElement, BarController, BarElement, BasePlatform, BasicPlatform, BubbleController, CategoryScale, Chart, plugin_colors as Colors, DatasetController, plugin_decimation as Decimation, DomPlatform, DoughnutController, Element, index as Filler, Interaction, plugin_legend as Legend, LineController, LineElement, LinearScale, LogarithmicScale, PieController, PointElement, PolarAreaController, RadarController, RadialLinearScale, Scale, ScatterController, plugin_subtitle as SubTitle, Ticks, TimeScale, TimeSeriesScale, plugin_title as Title, plugin_tooltip as Tooltip, adapters as _adapters, _detectPlatform, animator, controllers, defaults, elements, layouts, plugins, registerables, registry, scales };\n//# sourceMappingURL=chart.js.map\n","import {requestAnimFrame} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('./core.animation.js').default } Animation\n * @typedef { import('./core.controller.js').default } Chart\n */\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is export for typedoc\n */\nexport class Animator {\n constructor() {\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n\n /**\n\t * @private\n\t */\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n\n callbacks.forEach(fn => fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n\n /**\n\t * @private\n\t */\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n\n this._request = requestAnimFrame.call(window, () => {\n this._update();\n this._request = null;\n\n if (this._running) {\n this._refresh();\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _update(date = Date.now()) {\n let remaining = 0;\n\n this._charts.forEach((anims, chart) => {\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n\n for (; i >= 0; --i) {\n item = items[i];\n\n if (item._active) {\n if (item._total > anims.duration) {\n // if the animation has been updated and its duration prolonged,\n // update to total duration of current animations run (for progress event)\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n // Remove the item by replacing it with last item and removing the last\n // A lot faster than splice.\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n\n remaining += items.length;\n });\n\n this._lastDate = date;\n\n if (remaining === 0) {\n this._running = false;\n }\n }\n\n /**\n\t * @private\n\t */\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} event - event name\n\t * @param {Function} cb - callback\n\t */\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n\n /**\n\t * Add animations\n\t * @param {Chart} chart\n\t * @param {Animation[]} items - animations\n\t */\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n\n /**\n\t * Counts number of active animations for the chart\n\t * @param {Chart} chart\n\t */\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n\n /**\n\t * Start animating (all charts)\n\t * @param {Chart} chart\n\t */\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n\n /**\n\t * Stop all animations for the chart\n\t * @param {Chart} chart\n\t */\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n\n for (; i >= 0; --i) {\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n\n /**\n\t * Remove chart from Animator\n\t * @param {Chart} chart\n\t */\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Animator();\n","import effects from '../helpers/helpers.easing.js';\nimport {resolve} from '../helpers/helpers.options.js';\nimport {color as helpersColor} from '../helpers/helpers.color.js';\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean(from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n /**\n * @param {string} from\n * @param {string} to\n * @param {number} factor\n */\n color(from, to, factor) {\n const c0 = helpersColor(from || transparent);\n const c1 = c0.valid && helpersColor(to || transparent);\n return c1 && c1.valid\n ? c1.mix(c0, factor).hexString()\n : to;\n },\n number(from, to, factor) {\n return from + (to - from) * factor;\n }\n};\n\nexport default class Animation {\n constructor(cfg, target, prop, to) {\n const currentValue = target[prop];\n\n to = resolve([cfg.to, to, currentValue, cfg.from]);\n const from = resolve([cfg.from, currentValue, to]);\n\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n\n active() {\n return this._active;\n }\n\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([cfg.to, to, currentValue, cfg.from]);\n this._from = resolve([cfg.from, currentValue, to]);\n }\n }\n\n cancel() {\n if (this._active) {\n // update current evaluated value, for smoother animations\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n\n this._active = from !== to && (loop || (elapsed < duration));\n\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n\n factor = (elapsed / duration) % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n\n this._target[prop] = this._fn(from, to, factor);\n }\n\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej) => {\n promises.push({res, rej});\n });\n }\n\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for (let i = 0; i < promises.length; i++) {\n promises[i][method]();\n }\n }\n}\n","import animator from './core.animator.js';\nimport Animation from './core.animation.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isObject} from '../helpers/helpers.core.js';\n\nexport default class Animations {\n constructor(chart, config) {\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n\n Object.getOwnPropertyNames(config).forEach(key => {\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions) {\n resolved[option] = cfg[option];\n }\n\n (isArray(cfg.properties) && cfg.properties || [key]).forEach((prop) => {\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n\n /**\n\t * Utility to handle animation of `options`.\n\t * @private\n\t */\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n // Going to shared options:\n // After all animations are done, assign the shared options object to the element\n // So any new updates to the shared options are observed\n awaitAll(target.options.$animations, newOptions).then(() => {\n target.options = newOptions;\n }, () => {\n // rejected, noop\n });\n }\n\n return animations;\n }\n\n /**\n\t * @private\n\t */\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n\n for (i = props.length - 1; i >= 0; --i) {\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n\n if (animation) {\n if (cfg && animation.active()) {\n // There is an existing active animation, let's update that\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n // not animated, set directly to new value\n target[prop] = value;\n continue;\n }\n\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n\n\n /**\n\t * Update `target` properties to new values, using configured animations\n\t * @param {object} target - object to update\n\t * @param {object} values - new target properties\n\t * @returns {boolean|undefined} - `true` if animations were started\n\t **/\n update(target, values) {\n if (this._properties.size === 0) {\n // Nothing is animated, just apply the new values.\n Object.assign(target, values);\n return;\n }\n\n const animations = this._createAnimations(target, values);\n\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\n\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for (let i = 0; i < keys.length; i++) {\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n // @ts-ignore\n return Promise.all(running);\n}\n\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n // Going from shared options to distinct one:\n // Create new options object containing the old shared values and start updating that.\n target.options = options = Object.assign({}, options, {$shared: false, $animations: {}});\n }\n return options;\n}\n","import Animations from './core.animations.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isFinite, isObject, valueOrDefault, resolveObjectKey, defined} from '../helpers/helpers.core.js';\nimport {listenArrayEvents, unlistenArrayEvents} from '../helpers/helpers.collection.js';\nimport {createContext, sign} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('./core.scale.js').default } Scale\n */\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\n\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\n\nfunction toClip(value) {\n let t, r, b, l;\n\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\n\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n keys.push(metasets[i].index);\n }\n return keys;\n}\n\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n\n if (value === null) {\n return;\n }\n\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) {\n value += otherValue;\n }\n }\n return value;\n}\n\nfunction convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\n\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || (stacked === undefined && meta.stack !== undefined);\n}\n\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\n\nfunction getUserBounds(scale) {\n const {min, max, minDefined, maxDefined} = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\n\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\n\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {\n const value = stack[meta.index];\n if ((positive && value > 0) || (!positive && value < 0)) {\n return meta.index;\n }\n }\n\n return null;\n}\n\nfunction updateStacks(controller, parsed) {\n const {chart, _cachedMeta: meta} = controller;\n const stacks = chart._stacks || (chart._stacks = {}); // map structure is {stackKey: {datasetIndex: value}}\n const {iScale, vScale, index: datasetIndex} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n\n for (let i = 0; i < ilen; ++i) {\n const item = parsed[i];\n const {[iAxis]: index, [vAxis]: value} = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\n\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter(key => scales[key].axis === axis).shift();\n}\n\nfunction createDatasetContext(parent, index) {\n return createContext(parent,\n {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n }\n );\n}\n\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\n\nfunction clearStacks(meta, items) {\n // Not using meta.index here, because it might be already updated if the dataset changed location\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n\n items = items || meta._parsed;\n for (const parsed of items) {\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n delete stacks[axis]._visualValues[datasetIndex];\n }\n }\n}\n\nconst isDirectUpdateMode = (mode) => mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked\n && {keys: getSortedDatasetIndices(chart, true), values: null};\n\nexport default class DatasetController {\n\n /**\n * @type {any}\n */\n static defaults = {};\n\n /**\n * Element type used to generate a meta dataset (e.g. Chart.element.LineElement).\n */\n static datasetElementType = null;\n\n /**\n * Element type used to generate a meta data (e.g. Chart.element.PointElement).\n */\n static dataElementType = null;\n\n /**\n\t * @param {Chart} chart\n\t * @param {number} datasetIndex\n\t */\n constructor(chart, datasetIndex) {\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n /** @type {boolean | object} */\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n\n this.initialize();\n }\n\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n 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\");\n }\n }\n\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n\n const chooseId = (axis, x, y, r) => axis === 'x' ? x : axis === 'r' ? r : y;\n\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n\n /**\n\t * @param {string} scaleID\n\t * @return {Scale}\n\t */\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n\n /**\n\t * @private\n\t */\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale\n ? meta.vScale\n : meta.iScale;\n }\n\n reset() {\n this._update('reset');\n }\n\n /**\n\t * @private\n\t */\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n\n /**\n\t * @private\n\t */\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n\n // In order to correctly handle data addition/deletion animation (and thus simulate\n // real-time charts), we need to monitor these data modifications and synchronize\n // the internal metadata accordingly.\n\n if (isObject(data)) {\n this._data = convertObjectDataToArray(data);\n } else if (_data !== data) {\n if (_data) {\n // This case happens when the user replaced the data array instance.\n unlistenArrayEvents(_data, this);\n // Discard old parsed data and stacks\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n\n addElements() {\n const meta = this._cachedMeta;\n\n this._dataCheck();\n\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n\n this._dataCheck();\n\n // make sure cached _stacked status is current\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n\n // detect change in stack option\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n // remove values from old stack\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n\n // Re-sync meta data in case the user replaced the data array or if we missed\n // any updates and so make sure that we handle number of datapoints changing.\n this._resyncElements(resetNewElements);\n\n // if stack changed, update stack values for the whole dataset\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n }\n }\n\n /**\n\t * Merges user-supplied and default dataset-level options\n\t * @private\n\t */\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n\n /**\n\t * @param {number} start\n\t * @param {number} count\n\t */\n parse(start, count) {\n const {_cachedMeta: meta, _data: data} = this;\n const {iScale, _stacked} = meta;\n const iAxis = iScale.axis;\n\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n\n const isNotInOrderComparedToPrev = () => cur[iAxis] === null || (prev && cur[iAxis] < prev[iAxis]);\n for (i = 0; i < count; ++i) {\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n\n /**\n\t * Parse array of primitive values\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [1,3,4]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {xScale0: 0, yScale0: 1}\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [[1,2],[3,4]]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {x: 0, y: 1}\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [{x:1, y:5}, {x:2, y:10}]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id. _custom is optional\n\t * Example: {xScale0: 0, yScale0: 1, _custom: {r: 10, foo: 'bar'}}\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n\n /**\n\t * @protected\n\t */\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n\n /**\n\t * @protected\n\t */\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return applyStack(stack, value, meta.index, {mode});\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n\n /**\n\t * @protected\n\t */\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n const {min: otherMin, max: otherMax} = getUserBounds(otherScale);\n let i, parsed;\n\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n\n for (i = 0; i < ilen; ++i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n // if the data is sorted, we don't need to check further from this end of array\n break;\n }\n }\n if (sorted) {\n // in the sorted case, find first non-skipped value from other end of array\n for (i = ilen - 1; i >= 0; --i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n\n for (i = 0, ilen = parsed.length; i < ilen; ++i) {\n value = parsed[i][scale.axis];\n if (isFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return false;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n\n /**\n\t * @private\n\t */\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {} // eslint-disable-line no-unused-vars\n\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || (elements.length - start);\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n\n for (i = start; i < start + count; ++i) {\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n\n for (i = 0; i < active.length; ++i) {\n active[i].draw(ctx, area);\n }\n }\n\n /**\n\t * Returns a set of predefined style properties that should be used to represent the dataset\n\t * or the data if the index is specified\n\t * @param {number} index - data index\n\t * @param {boolean} [active] - true if hover\n\t * @return {object} style object\n\t */\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset\n ? this.resolveDatasetElementOptions(mode)\n : this.resolveDataElementOptions(index || 0, mode);\n }\n\n /**\n\t * @protected\n\t */\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context ||\n (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context ||\n (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n\n /**\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n\n /**\n\t * @private\n\t */\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [`${elementType}Hover`, 'hover', elementType, ''] : [elementType, ''];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n // context is provided as a function, and is called only if needed,\n // so we don't create a context for each element if not needed.\n const context = () => this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n\n if (values.$shared) {\n // `$shared` indicates this set of options can be shared between multiple elements.\n // Sharing is used to reduce number of properties to change during animation.\n values.$shared = sharing;\n\n // We cache options by `mode`, which can be 'active' for example. This enables us\n // to have the 'active' element options and 'default' options to switch between\n // when interacting.\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n\n return values;\n }\n\n\n /**\n\t * @private\n\t */\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n\n /**\n\t * Utility for getting the options object shared between elements\n\t * @protected\n\t */\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n\n /**\n\t * Utility for determining if `options` should be included in the updated properties\n\t * @protected\n\t */\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n\n /**\n * @todo v4, rename to getSharedOptions and remove excess functions\n */\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || (sharedOptions !== previouslySharedOptions);\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {sharedOptions, includeOptions};\n }\n\n /**\n\t * Utility for updating an element with new properties, using animations when appropriate.\n\t * @protected\n\t */\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n\n /**\n\t * Utility to animate the shared options, that are potentially affecting multiple elements.\n\t * @protected\n\t */\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n\n /**\n\t * @private\n\t */\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n // When going from active to inactive, we need to update to the shared options.\n // This way the once hovered element will end up with the same original shared options instance, after animation.\n options: (!active && this.getSharedOptions(options)) || options\n });\n }\n\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n\n /**\n\t * @private\n\t */\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n\n /**\n\t * @private\n\t */\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n\n /**\n\t * @private\n\t */\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n\n // Apply changes detected through array listeners\n for (const [method, arg1, arg2] of this._syncList) {\n this[method](arg1, arg2);\n }\n this._syncList = [];\n\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n\n if (count) {\n // TODO: It is not optimal to always parse the old data\n // This is done because we are not detecting direct assignments:\n // chart.data.datasets[0].data[5] = 10;\n // chart.data.datasets[0].data[5].y = 10;\n this.parse(0, count);\n }\n\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n\n /**\n\t * @private\n\t */\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n\n const move = (arr) => {\n arr.length += count;\n for (i = arr.length - 1; i >= end; i--) {\n arr[i] = arr[i - count];\n }\n };\n move(data);\n\n for (i = start; i < end; ++i) {\n data[i] = new this.dataElementType();\n }\n\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n\n updateElements(element, start, count, mode) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @private\n\t */\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n\n /**\n\t * @private\n */\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([this.index, ...args]);\n }\n\n _onDataPush() {\n const count = arguments.length;\n this._sync(['_insertElements', this.getDataset().data.length - count, count]);\n }\n\n _onDataPop() {\n this._sync(['_removeElements', this._cachedMeta.data.length - 1, 1]);\n }\n\n _onDataShift() {\n this._sync(['_removeElements', 0, 1]);\n }\n\n _onDataSplice(start, count) {\n if (count) {\n this._sync(['_removeElements', start, count]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync(['_insertElements', start, newCount]);\n }\n }\n\n _onDataUnshift() {\n this._sync(['_insertElements', 0, arguments.length]);\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {\n _arrayUnique, isArray, isNullOrUndef,\n valueOrDefault, resolveObjectKey, sign, defined\n} from '../helpers/index.js';\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n\n for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));\n }\n return scale._cache.$bar;\n}\n\n/**\n * Computes the \"optimal\" sample size to maintain bars equally sized while preventing overlap.\n * @private\n */\nfunction computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = () => {\n if (curr === 32767 || curr === -32768) {\n // Ignore truncated pixels\n return;\n }\n if (defined(prev)) {\n // curr - prev === 0 is ignored\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n\n for (i = 0, ilen = values.length; i < ilen; ++i) {\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n\n prev = undefined;\n for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) {\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n\n return min;\n}\n\n/**\n * Computes an \"ideal\" category based on the absolute bar thickness or, if undefined or null,\n * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This\n * mode currently always generates bars equally sized (until we introduce scriptable options?).\n * @private\n */\nfunction computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n // When bar thickness is enforced, category and bar percentages are ignored.\n // Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n // and deprecate barPercentage since this value is ignored when thickness is absolute.\n size = thickness * stackCount;\n ratio = 1;\n }\n\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - (size / 2)\n };\n}\n\n/**\n * Computes an \"optimal\" category that globally arranges bars side by side (no gap when\n * percentage options are 1), based on the previous and following categories. This mode\n * generates bars with different widths when data are not evenly spaced.\n * @private\n */\nfunction computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n\n if (prev === null) {\n // first data: its size is double based on the next point or,\n // if it's also the last data, we use the scale size.\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n\n if (next === null) {\n // last data: its size is also double based on the previous point.\n next = curr + curr - prev;\n }\n\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\n\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n\n // Store `barEnd` (furthest away from origin) as parsed value,\n // to make stacking straight forward\n item[vScale.axis] = barEnd;\n\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\n\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\n\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n\n for (i = start, ilen = start + count; i < ilen; ++i) {\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\n\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\n\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\n\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {start, end, reverse, top, bottom};\n}\n\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n\n if (edge === true) {\n properties.borderSkipped = {top: true, right: true, bottom: true, left: true};\n return;\n }\n\n const {start, end, reverse, top, bottom} = borderProps(properties);\n\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\n\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\n\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\n\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\n\nfunction setInflateAmount(properties, {inflateAmount}, ratio) {\n properties.inflateAmount = inflateAmount === 'auto'\n ? ratio === 1 ? 0.33 : 0\n : inflateAmount;\n}\n\nexport default class BarController extends DatasetController {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'base', 'width', 'height']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true,\n }\n }\n };\n\n\n /**\n\t * Overriding primitive data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding array data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding object data parsing since we support mixed primitive/array\n\t * value-scale data for float bars\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n // float bar: only one end of the bar is considered by `super`\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const {iScale, vScale} = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom)\n ? '[' + custom.start + ', ' + custom.end + ']'\n : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n\n initialize() {\n this.enableOptionSharing = true;\n\n super.initialize();\n\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const {index, _cachedMeta: {vScale}} = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n\n for (let i = start; i < start + count; i++) {\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {base, head: base} : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index === stack._top || index === stack._bottom),\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n\n /**\n\t * Returns the stacks based on groups and bar visibility.\n\t * @param {number} [last] - The dataset index\n\t * @param {number} [dataIndex] - The data index of the ruler\n\t * @returns {string[]} The list of stack IDs\n\t * @private\n\t */\n _getStacks(last, dataIndex) {\n const {iScale} = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type)\n .filter(meta => meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n\n const skipNull = (meta) => {\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n\n for (const meta of metasets) {\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n\n // stacked | meta.stack\n // | found | not found | undefined\n // false | x | x | x\n // true | | x |\n // undefined | | x | x\n if (stacked === false || stacks.indexOf(meta.stack) === -1 ||\n\t\t\t\t(stacked === undefined && meta.stack === undefined)) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n\n // No stacks? that means there is no visible data. Let's still initialize an `undefined`\n // stack where possible invisible bars will be located.\n // https://github.com/chartjs/Chart.js/issues/6368\n if (!stacks.length) {\n stacks.push(undefined);\n }\n\n return stacks;\n }\n\n /**\n\t * Returns the effective number of stacks based on groups and bar visibility.\n\t * @private\n\t */\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n\n /**\n\t * Returns the stack index for the given dataset based on groups and bar visibility.\n\t * @param {number} [datasetIndex] - The dataset index\n\t * @param {string} [name] - The stack name to find\n * @param {number} [dataIndex]\n\t * @returns {number} The stack index\n\t * @private\n\t */\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = (name !== undefined)\n ? stacks.indexOf(name)\n : -1; // indexOf returns -1 if element is not present\n\n return (index === -1)\n ? stacks.length - 1\n : index;\n }\n\n /**\n\t * @private\n\t */\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n\n for (i = 0, ilen = meta.data.length; i < ilen; ++i) {\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n // bar thickness ratio used for non-grouped bars\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n\n /**\n\t * Note: pixel values are not clamped to the scale area.\n\t * @private\n\t */\n _calculateBarValuePixels(index) {\n const {_cachedMeta: {vScale, _stacked, index: datasetIndex}, options: {base: baseValue, minBarLength}} = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n\n if (length !== value) {\n start = length - value;\n length = value;\n }\n\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n // bars crossing origin are not stacked\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n // When not visible, no height\n head = base;\n }\n\n size = head - base;\n\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n\n if (_stacked && !floating) {\n // visual data coordinates after applying minBarLength\n parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n }\n\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n\n /**\n\t * @private\n\t */\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex'\n ? computeFlexCategoryTraits(index, ruler, options, stackCount)\n : computeFitCategoryTraits(index, ruler, options, stackCount);\n\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n // For non-grouped bar charts, exact pixel values are used\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n\n for (; i < ilen; ++i) {\n if (this.getParsed(i)[vScale.axis] !== null) {\n rects[i].draw(this._ctx);\n }\n }\n }\n\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {valueOrDefault} from '../helpers/helpers.core.js';\n\nexport default class BubbleController extends DatasetController {\n\n static id = 'bubble';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'borderWidth', 'radius']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n\n /**\n\t * Parse array of primitive values\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n\n update(mode) {\n const points = this._cachedMeta.data;\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n\n if (reset) {\n properties.options.radius = 0;\n }\n }\n\n this.updateElement(point, i, properties, mode);\n }\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n\n // In case values were cached (and thus frozen), we need to clone the values\n if (values.$shared) {\n values = Object.assign({}, values, {$shared: false});\n }\n\n // Custom radius resolution\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n\n return values;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isObject, resolveObjectKey, toPercentage, toDimension, valueOrDefault} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {toRadians, PI, TAU, HALF_PI, _angleBetween} from '../helpers/helpers.math.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n // If the chart's circumference isn't a full circle, calculate size as a ratio of the width/height of the arc\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {ratioX, ratioY, offsetX, offsetY};\n}\n\nexport default class DoughnutController extends DatasetController {\n\n static id = 'doughnut';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n // Boolean - Whether we animate the rotation of the Doughnut\n animateRotate: true,\n // Boolean - Whether we animate scaling the Doughnut from the centre\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['circumference', 'endAngle', 'innerRadius', 'outerRadius', 'startAngle', 'x', 'y', 'offset', 'borderWidth', 'spacing']\n },\n },\n // The percentage of the chart that we cut out of the middle.\n cutout: '50%',\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%',\n\n // Spacing between arcs\n spacing: 0,\n\n indexAxis: 'r',\n };\n\n static descriptors = {\n _scriptable: (name) => name !== 'spacing',\n _indexable: (name) => name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash'),\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n // Need to override these to give a nice default\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n\n linkScales() {}\n\n /**\n\t * Override data parsing, since we are not using scales\n\t */\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i) => +data[i];\n\n if (isObject(data[start])) {\n const {key = 'value'} = this._parsing;\n getter = (i) => +resolveObjectKey(data[i], key);\n }\n\n let i, ilen;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n meta._parsed[i] = getter(i);\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n\n /**\n\t * @private\n\t */\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n\n /**\n\t * Get the maximal rotation & circumference extents\n\t * across all visible datasets.\n\t */\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n\n for (let i = 0; i < this.chart.data.datasets.length; ++i) {\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n\n return {\n rotation: min,\n circumference: max - min,\n };\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {\n const chart = this.chart;\n const {chartArea} = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n\n // Compute the maximal rotation & circumference limits.\n // If we only consider our dataset, this can cause problems when two datasets\n // are both less than a circle with different rotations (starting angles)\n const {circumference, rotation} = this._getRotationExtents();\n const {ratioX, ratioY, offsetX, offsetY} = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n\n meta.total = this.calculateTotal();\n\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @private\n */\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if ((reset && opts.animation.animateRotate) || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n\n for (i = 0; i < start; ++i) {\n startAngle += this._circumference(i, reset);\n }\n\n for (i = start; i < start + count; ++i) {\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n\n for (i = 0; i < metaData.length; i++) {\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n\n return total;\n }\n\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n\n if (!arcs) {\n // Find the outmost visible dataset\n for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n\n if (!arcs) {\n return 0;\n }\n\n for (i = 0, ilen = arcs.length; i < ilen; ++i) {\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n\n getMaxOffset(arcs) {\n let max = 0;\n\n for (let i = 0, ilen = arcs.length; i < ilen; ++i) {\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n\n /**\n\t * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly\n\t * @private\n\t */\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n\n for (let i = 0; i < datasetIndex; ++i) {\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n\n return ringWeightOffset;\n }\n\n /**\n\t * @private\n\t */\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n\n /**\n\t * Returns the sum of all visible data set weights.\n\t * @private\n\t */\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class LineController extends DatasetController {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n\n showLine: true,\n spanGaps: false,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n },\n _value_: {\n type: 'linear',\n },\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {dataset: line, data: points = [], _dataset} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = 0; i < pointsCount; ++i) {\n const point = points[i];\n const properties = directUpdate ? point : {};\n\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {toRadians, PI, formatNumber, _parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class PolarAreaController extends DatasetController {\n\n static id = 'polarArea';\n\n /**\n * @type {any}\n */\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'startAngle', 'endAngle', 'innerRadius', 'outerRadius']\n },\n },\n indexAxis: 'r',\n startAngle: 0,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const arcs = this._cachedMeta.data;\n\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @protected\n */\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n\n meta.data.forEach((element, index) => {\n const parsed = this.getParsed(index).r;\n\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n\n return range;\n }\n\n /**\n\t * @private\n\t */\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? (outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n\n this.outerRadius = outerRadius - (radiusLength * this.index);\n this.innerRadius = this.outerRadius - radiusLength;\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n\n const defaultAngle = 360 / this.countVisibleElements();\n\n for (i = 0; i < start; ++i) {\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for (i = start; i < start + count; i++) {\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n\n meta.data.forEach((element, index) => {\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n\n return count;\n }\n\n /**\n\t * @private\n\t */\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index)\n ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle)\n : 0;\n }\n}\n","import DoughnutController from './controller.doughnut.js';\n\n// Pie charts are Doughnut chart with different defaults\nexport default class PieController extends DoughnutController {\n\n static id = 'pie';\n\n /**\n * @type {any}\n */\n static defaults = {\n // The percentage of the chart that we cut out of the middle.\n cutout: 0,\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%'\n };\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {_parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class RadarController extends DatasetController {\n\n static id = 'radar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n },\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n scales: {\n r: {\n type: 'radialLinear',\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n\n // Update Line\n line.points = points;\n // In resize mode only point locations change, so no need to set the points or options.\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n\n this.updateElement(line, undefined, properties, mode);\n }\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class ScatterController extends DatasetController {\n\n static id = 'scatter';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n\n interaction: {\n mode: 'point'\n },\n\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {data: points = []} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n if (this.options.showLine) {\n\n // https://github.com/chartjs/Chart.js/issues/11333\n if (!this.datasetElementType) {\n this.addElements();\n }\n const {dataset: line, _dataset} = meta;\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n } else if (this.datasetElementType) {\n // https://github.com/chartjs/Chart.js/issues/11333\n delete meta.dataset;\n this.datasetElementType = false;\n }\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n addElements() {\n const {showLine} = this.options;\n\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n\n super.addElements();\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = start; i < start + count; ++i) {\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n\n if (!this.options.showLine) {\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n\n if (!data.length) {\n return border;\n }\n\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n","/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartOptions} from '../types/index.js';\n\nexport type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';\n\nexport interface DateAdapter {\n readonly options: T;\n /**\n * Will called with chart options after adapter creation.\n */\n init(this: DateAdapter, chartOptions: ChartOptions): void;\n /**\n * Returns a map of time formats for the supported formatting units defined\n * in Unit as well as 'datetime' representing a detailed date/time string.\n */\n formats(this: DateAdapter): Record;\n /**\n * Parses the given `value` and return the associated timestamp.\n * @param value - the value to parse (usually comes from the data)\n * @param [format] - the expected data format\n */\n parse(this: DateAdapter, value: unknown, format?: TimeUnit): number | null;\n /**\n * Returns the formatted date in the specified `format` for a given `timestamp`.\n * @param timestamp - the timestamp to format\n * @param format - the date/time token\n */\n format(this: DateAdapter, timestamp: number, format: TimeUnit): string;\n /**\n * Adds the specified `amount` of `unit` to the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param amount - the amount to add\n * @param unit - the unit as string\n */\n add(this: DateAdapter, timestamp: number, amount: number, unit: TimeUnit): number;\n /**\n * Returns the number of `unit` between the given timestamps.\n * @param a - the input timestamp (reference)\n * @param b - the timestamp to subtract\n * @param unit - the unit as string\n */\n diff(this: DateAdapter, a: number, b: number, unit: TimeUnit): number;\n /**\n * Returns start of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n * @param [weekday] - the ISO day of the week with 1 being Monday\n * and 7 being Sunday (only needed if param *unit* is `isoWeek`).\n */\n startOf(this: DateAdapter, timestamp: number, unit: TimeUnit | 'isoWeek', weekday?: number): number;\n /**\n * Returns end of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n */\n endOf(this: DateAdapter, timestamp: number, unit: TimeUnit | 'isoWeek'): number;\n}\n\nfunction abstract(): T {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */\nclass DateAdapterBase implements DateAdapter {\n\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */\n static override(\n members: Partial, 'options'>>\n ) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n\n readonly options: AnyObject;\n\n constructor(options: AnyObject) {\n this.options = options || {};\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n\n formats(): Record {\n return abstract();\n }\n\n parse(): number | null {\n return abstract();\n }\n\n format(): string {\n return abstract();\n }\n\n add(): number {\n return abstract();\n }\n\n diff(): number {\n return abstract();\n }\n\n startOf(): number {\n return abstract();\n }\n\n endOf(): number {\n return abstract();\n }\n}\n\nexport default {\n _date: DateAdapterBase\n};\n","import {_lookupByKey, _rlookupByKey} from '../helpers/helpers.collection.js';\nimport {getRelativePosition} from '../helpers/helpers.dom.js';\nimport {_angleBetween, getAngleFromPoint} from '../helpers/helpers.math.js';\nimport {_isPointInArea} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef {{axis?: string, intersect?: boolean, includeInvisible?: boolean}} InteractionOptions\n * @typedef {{datasetIndex: number, index: number, element: import('./core.element.js').default}} InteractionItem\n * @typedef { import('../types/index.js').Point } Point\n */\n\n/**\n * Helper function to do binary search when possible\n * @param {object} metaset - the dataset meta\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {number} value - the value to find\n * @param {boolean} [intersect] - should the element intersect\n * @returns {{lo:number, hi:number}} indices to search data array between\n */\nfunction binarySearch(metaset, axis, value, intersect) {\n const {controller, data, _sorted} = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n // _sharedOptions indicates that each element has equal options -> equal proportions\n // So we can do a ranged binary search based on the range of first element and\n // be confident to get the full range of indices that can intersect with the value.\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {lo: start.lo, hi: end.hi};\n }\n }\n }\n // Default to all elements, when binary search can not be used.\n return {lo: 0, hi: data.length - 1};\n}\n\n/**\n * Helper function to select candidate elements for interaction\n * @param {Chart} chart - the chart\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {function} handler - the callback to execute for each visible item\n * @param {boolean} [intersect] - consider intersecting items\n */\nfunction evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for (let i = 0, ilen = metasets.length; i < ilen; ++i) {\n const {index, data} = metasets[i];\n const {lo, hi} = binarySearch(metasets[i], axis, value, intersect);\n for (let j = lo; j <= hi; ++j) {\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n\n/**\n * Get a distance metric function for two points based on the\n * axis mode setting\n * @param {string} axis - the axis mode. x|y|xy|r\n */\nfunction getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n\n/**\n * Helper function to get the items that intersect the event position\n * @param {Chart} chart - the chart\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({element, datasetIndex, index});\n }\n };\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a radial chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n\n function evaluationFunc(element, datasetIndex, index) {\n const {startAngle, endAngle} = element.getProps(['startAngle', 'endAngle'], useFinalPosition);\n const {angle} = getAngleFromPoint(element, {x: position.x, y: position.y});\n\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a cartesian chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [{element, datasetIndex, index}];\n minDistance = distance;\n } else if (distance === minDistance) {\n // Can have multiple items at the same distance in which case we sort by size\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position considering all visible items in the chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n\n return axis === 'r' && !intersect\n ? getNearestRadialItems(chart, position, axis, useFinalPosition)\n : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n\n/**\n * Helper function to get the items matching along the given X or Y axis\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis to match\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index) => {\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({element, datasetIndex, index});\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n\n // If we want to trigger on an intersect and we don't have any items\n // that intersect the position, return nothing\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n\n/**\n * Contains interaction related functions\n * @namespace Chart.Interaction\n */\nexport default {\n // Part of the public API to facilitate developers creating their own modes\n evaluateInteractionItems,\n\n // Helper function for different modes\n modes: {\n /**\n\t\t * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\n\t\t * @function Chart.Interaction.modes.index\n\t\t * @since v2.4.0\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n index(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n // Default axis for index mode is 'x' to match old behaviour\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible)\n : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n\n if (!items.length) {\n return [];\n }\n\n chart.getSortedVisibleDatasetMetas().forEach((meta) => {\n const index = items[0].index;\n const element = meta.data[index];\n\n // don't count items that are skipped (null data)\n if (element && !element.skip) {\n elements.push({element, datasetIndex: meta.index, index});\n }\n });\n\n return elements;\n },\n\n /**\n\t\t * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect is false, we find the nearest item and return the items in that dataset\n\t\t * @function Chart.Interaction.modes.dataset\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n dataset(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) :\n getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for (let i = 0; i < data.length; ++i) {\n items.push({element: data[i], datasetIndex, index: i});\n }\n }\n\n return items;\n },\n\n /**\n\t\t * Point mode returns all elements that hit test based on the event position\n\t\t * of the event\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n point(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * nearest mode returns the element closest to the point\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n nearest(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * x mode returns the elements that hit-test at the current x coordinate\n\t\t * @function Chart.Interaction.modes.x\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n x(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n\n /**\n\t\t * y mode returns the elements that hit-test at the current y coordinate\n\t\t * @function Chart.Interaction.modes.y\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n y(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n","import {defined, each, isObject} from '../helpers/helpers.core.js';\nimport {toPadding} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n */\n\nconst STATIC_POSITIONS = ['left', 'top', 'right', 'bottom'];\n\nfunction filterByPosition(array, position) {\n return array.filter(v => v.pos === position);\n}\n\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter(v => STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\n\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b) => {\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ?\n v0.index - v1.index :\n v0.weight - v1.weight;\n });\n}\n\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n\n for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\n box = boxes[i];\n ({position: pos, options: {stack, stackWeight = 1}} = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && (pos + stack),\n stackWeight\n });\n }\n return layoutBoxes;\n}\n\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts) {\n const {stack, pos, stackWeight} = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {count: 0, placed: 0, weight: 0, size: 0});\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n\n/**\n * store dimensions used instead of available chartArea in fitBoxes\n **/\nfunction setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const {vBoxMaxWidth, hBoxMaxHeight} = params;\n let i, ilen, layout;\n for (i = 0, ilen = layouts.length; i < ilen; ++i) {\n layout = layouts[i];\n const {fullSize} = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\n\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter(wrap => wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\n\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\n\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\n\nfunction updateDims(chartArea, params, layout, stacks) {\n const {pos, box} = layout;\n const maxPadding = chartArea.maxPadding;\n\n // dynamically placed boxes size is not considered\n if (!isObject(pos)) {\n if (layout.size) {\n // this layout was already counted for, lets first reduce old size\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {size: 0, count: 1};\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n\n // return booleans on the changes per direction\n return layout.horizontal\n ? {same: widthChanged, other: heightChanged}\n : {same: heightChanged, other: widthChanged};\n}\n\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\n\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function marginForPositions(positions) {\n const margin = {left: 0, top: 0, right: 0, bottom: 0};\n positions.forEach((pos) => {\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n\n return horizontal\n ? marginForPositions(['left', 'right'])\n : marginForPositions(['top', 'bottom']);\n}\n\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n\n for (i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i) {\n layout = boxes[i];\n box = layout.box;\n\n box.update(\n layout.width || chartArea.w,\n layout.height || chartArea.h,\n getMargins(layout.horizontal, chartArea)\n );\n const {same, other} = updateDims(chartArea, params, layout, stacks);\n\n // Dimensions changed and there were non full width boxes before this\n // -> we have to refit those\n refit |= same && refitBoxes.length;\n\n // Chart area changed in the opposite direction\n changed = changed || other;\n\n if (!box.fullSize) { // fullSize boxes don't need to be re-fitted in any case\n refitBoxes.push(layout);\n }\n }\n\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\n\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\n\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let {x, y} = chartArea;\n\n for (const layout of boxes) {\n const box = layout.box;\n const stack = stacks[layout.stack] || {count: 1, placed: 0, weight: 1};\n const weight = (layout.stackWeight / stack.weight) || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n\n chartArea.x = x;\n chartArea.y = y;\n}\n\n/**\n * @interface LayoutItem\n * @typedef {object} LayoutItem\n * @prop {string} position - The position of the item in the chart layout. Possible values are\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\n * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area\n * @prop {boolean} fullSize - if true, and the item is horizontal, then push vertical boxes down\n * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\n * @prop {function} update - Takes two parameters: width and height. Returns size of item\n * @prop {function} draw - Draws the element\n * @prop {function} [getPadding] - Returns an object with padding on the edges\n * @prop {number} width - Width of item. Must be valid after update()\n * @prop {number} height - Height of item. Must be valid after update()\n * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update\n * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update\n * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update\n * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\n */\n\n// The layout service is very self explanatory. It's responsible for the layout within a chart.\n// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\n// It is this service's responsibility of carrying out that layout.\nexport default {\n\n /**\n\t * Register a box to a chart.\n\t * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\n\t * @param {Chart} chart - the chart to use\n\t * @param {LayoutItem} item - the item to add to be laid out\n\t */\n addBox(chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n\n // initialize item with default values\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n // @ts-ignore\n item._layers = item._layers || function() {\n return [{\n z: 0,\n draw(chartArea) {\n item.draw(chartArea);\n }\n }];\n };\n\n chart.boxes.push(item);\n },\n\n /**\n\t * Remove a layoutItem from a chart\n\t * @param {Chart} chart - the chart to remove the box from\n\t * @param {LayoutItem} layoutItem - the item to remove from the layout\n\t */\n removeBox(chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n\n /**\n\t * Sets (or updates) options on the given `item`.\n\t * @param {Chart} chart - the chart in which the item lives (or will be added to)\n\t * @param {LayoutItem} item - the item to configure with the given options\n\t * @param {object} options - the new item options.\n\t */\n configure(chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n\n /**\n\t * Fits boxes of the given chart into the given size by having each box measure itself\n\t * then running a fitting algorithm\n\t * @param {Chart} chart - the chart\n\t * @param {number} width - the width to fit into\n\t * @param {number} height - the height to fit into\n * @param {number} minPadding - minimum padding required for each side of chart area\n\t */\n update(chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n\n // Before any changes are made, notify boxes that an update is about to being\n // This is used to clear any cached data (e.g. scale limits)\n each(chart.boxes, box => {\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n\n // Essentially we now have any number of boxes on each of the 4 sides.\n // Our canvas looks like the following.\n // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\n // B1 is the bottom axis\n // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\n // These locations are single-box locations only, when trying to register a chartArea location that is already taken,\n // an error will be thrown.\n //\n // |----------------------------------------------------|\n // | T1 (Full Width) |\n // |----------------------------------------------------|\n // | | | T2 | |\n // | |----|-------------------------------------|----|\n // | | | C1 | | C2 | |\n // | | |----| |----| |\n // | | | | |\n // | L1 | L2 | ChartArea (C0) | R1 |\n // | | | | |\n // | | |----| |----| |\n // | | | C3 | | C4 | |\n // | |----|-------------------------------------|----|\n // | | | B1 | |\n // |----------------------------------------------------|\n // | B2 (Full Width) |\n // |----------------------------------------------------|\n //\n\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>\n wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n\n // First fit the fullSize boxes, to reduce probability of re-fitting.\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n\n // Then fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n\n // Then fit horizontal boxes\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n // if the area changed, re-fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n\n handleMaxPadding(chartArea);\n\n // Finally place the boxes to correct coordinates\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n\n // Move to opposite side of chart\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w,\n };\n\n // Finally update boxes in chartArea (radial scale for example)\n each(boxes.chartArea, (layout) => {\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {left: 0, top: 0, right: 0, bottom: 0});\n });\n }\n};\n","\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\n/**\n * Abstract class that allows abstracting platform dependencies away from the chart.\n */\nexport default class BasePlatform {\n /**\n\t * Called at chart construction time, returns a context2d instance implementing\n\t * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.\n\t * @param {HTMLCanvasElement} canvas - The canvas from which to acquire context (platform specific)\n\t * @param {number} [aspectRatio] - The chart options\n\t */\n acquireContext(canvas, aspectRatio) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Called at chart destruction time, releases any resources associated to the context\n\t * previously returned by the acquireContext() method.\n\t * @param {CanvasRenderingContext2D} context - The context2d instance\n\t * @returns {boolean} true if the method succeeded, else false\n\t */\n releaseContext(context) { // eslint-disable-line no-unused-vars\n return false;\n }\n\n /**\n\t * Registers the specified listener on the given chart.\n\t * @param {Chart} chart - Chart from which to listen for event\n\t * @param {string} type - The ({@link ChartEvent}) type to listen for\n\t * @param {function} listener - Receives a notification (an object that implements\n\t * the {@link ChartEvent} interface) when an event of the specified type occurs.\n\t */\n addEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Removes the specified listener previously registered with addEventListener.\n\t * @param {Chart} chart - Chart from which to remove the listener\n\t * @param {string} type - The ({@link ChartEvent}) type to remove\n\t * @param {function} listener - The listener function to remove from the event target.\n\t */\n removeEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @returns {number} the current devicePixelRatio of the device this platform is connected to.\n\t */\n getDevicePixelRatio() {\n return 1;\n }\n\n /**\n\t * Returns the maximum size in pixels of given canvas element.\n\t * @param {HTMLCanvasElement} element\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @returns {boolean} true if the canvas is attached to the platform, false if not.\n\t */\n isAttached(canvas) { // eslint-disable-line no-unused-vars\n return true;\n }\n\n /**\n * Updates config with platform specific requirements\n * @param {import('../core/core.config.js').default} config\n */\n updateConfig(config) { // eslint-disable-line no-unused-vars\n // no-op\n }\n}\n","/**\n * Platform fallback implementation (minimal).\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\n */\n\nimport BasePlatform from './platform.base.js';\n\n/**\n * Platform class for charts without access to the DOM or to many element properties\n * This platform is used by default for any chart passed an OffscreenCanvas.\n * @extends BasePlatform\n */\nexport default class BasicPlatform extends BasePlatform {\n acquireContext(item) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n","/**\n * Chart.Platform implementation for targeting a web browser\n */\n\nimport BasePlatform from './platform.base.js';\nimport {_getParentNode, getRelativePosition, supportsEventListenerOptions, readUsedSize, getMaximumSize} from '../helpers/helpers.dom.js';\nimport {throttled} from '../helpers/helpers.extras.js';\nimport {isNullOrUndef} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nconst EXPANDO_KEY = '$chartjs';\n\n/**\n * DOM event types -> Chart.js event types.\n * Note: only events with different types are mapped.\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\n */\nconst EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\n\nconst isNullOrEmpty = value => value === null || value === '';\n/**\n * Initializes the canvas style and render size without modifying the canvas display size,\n * since responsiveness is handled by the controller.resize() method. The config is used\n * to determine the aspect ratio to apply in case no explicit height has been specified.\n * @param {HTMLCanvasElement} canvas\n * @param {number} [aspectRatio]\n */\nfunction initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n\n // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\n // returns null or '' if no explicit value has been set to the canvas attribute.\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n\n // Chart.js modifies some canvas values that we want to restore on destroy\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n\n // Force canvas to display as block to avoid extra space caused by inline\n // elements, which would interfere with the responsive resize process.\n // https://github.com/chartjs/Chart.js/issues/2538\n style.display = style.display || 'block';\n // Include possible borders in the size\n style.boxSizing = style.boxSizing || 'border-box';\n\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n // If no explicit render height and style height, let's apply the aspect ratio,\n // which one can be specified by the user but also by charts as default option\n // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n\n return canvas;\n}\n\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\n// https://github.com/chartjs/Chart.js/issues/4287\nconst eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\n\nfunction addListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n}\n\nfunction removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\n\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const {x, y} = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null,\n };\n}\n\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList) {\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\n\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\n\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart) => {\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\n\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\n\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\n\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height) => {\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n // If the container size shrank during chart resize, let's assume\n // scrollbar appeared. So we resize again with the scrollbar visible -\n // effectively making chart smaller and the scrollbar hidden again.\n // Because we are inside `throttled`, and currently `ticking`, scroll\n // events are ignored during this whole 2 resize process.\n // If we assumed wrong and something else happened, we are resizing\n // twice in a frame (potential performance issue)\n listener();\n }\n }, window);\n\n // @ts-ignore until https://github.com/microsoft/TypeScript/issues/37861 implemented\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n // When its container's display is set to 'none' the callback will be called with a\n // size of (0, 0), which will cause the chart to lose its original height, so skip\n // resizing in such case.\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n\n return observer;\n}\n\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\n\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event) => {\n // This case can occur if the chart is destroyed while waiting\n // for the throttled function to occur. We prevent crashes by checking\n // for a destroyed chart\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n\n addListener(canvas, type, proxy);\n\n return proxy;\n}\n\n/**\n * Platform class for charts that can access the DOM and global window/document properties\n * @extends BasePlatform\n */\nexport default class DomPlatform extends BasePlatform {\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [aspectRatio]\n\t * @return {CanvasRenderingContext2D|null}\n\t */\n acquireContext(canvas, aspectRatio) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n\n // `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the canvas is\n // inside an iframe or when running in a protected environment. We could guess the\n // types from their toString() value but let's keep things flexible and assume it's\n // a sufficient condition if the canvas has a context2D which has canvas as `canvas`.\n // https://github.com/chartjs/Chart.js/issues/3887\n // https://github.com/chartjs/Chart.js/issues/4102\n // https://github.com/chartjs/Chart.js/issues/4152\n if (context && context.canvas === canvas) {\n // Load platform resources on first chart creation, to make it possible to\n // import the library before setting platform options.\n initCanvas(canvas, aspectRatio);\n return context;\n }\n\n return null;\n }\n\n /**\n\t * @param {CanvasRenderingContext2D} context\n\t */\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n\n const initial = canvas[EXPANDO_KEY].initial;\n ['height', 'width'].forEach((prop) => {\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n\n const style = initial.style || {};\n Object.keys(style).forEach((key) => {\n canvas.style[key] = style[key];\n });\n\n // The canvas render size might have been changed (and thus the state stack discarded),\n // we can't use save() and restore() to restore the initial state. So make sure that at\n // least the canvas context is reset to the default state by setting the canvas width.\n // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html\n // eslint-disable-next-line no-self-assign\n canvas.width = canvas.width;\n\n delete canvas[EXPANDO_KEY];\n return true;\n }\n\n /**\n\t *\n\t * @param {Chart} chart\n\t * @param {string} type\n\t * @param {function} listener\n\t */\n addEventListener(chart, type, listener) {\n // Can have only one listener per type, so make sure previous is removed\n this.removeEventListener(chart, type);\n\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} type\n\t */\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n\n if (!proxy) {\n return;\n }\n\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t */\n isAttached(canvas) {\n const container = _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n","import {_isDomSupported} from '../helpers/index.js';\nimport BasePlatform from './platform.base.js';\nimport BasicPlatform from './platform.basic.js';\nimport DomPlatform from './platform.dom.js';\n\nexport function _detectPlatform(canvas) {\n if (!_isDomSupported() || (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas)) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nexport {BasePlatform, BasicPlatform, DomPlatform};\n","import type {AnyObject} from '../types/basic.js';\nimport type {Point} from '../types/geometric.js';\nimport type {Animation} from '../types/animation.js';\nimport {isNumber} from '../helpers/helpers.math.js';\n\nexport default class Element {\n\n static defaults = {};\n static defaultRoutes = undefined;\n\n x: number;\n y: number;\n active = false;\n options: O;\n $animations: Record;\n\n tooltipPosition(useFinalPosition: boolean): Point {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y} as Point;\n }\n\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n\n /**\n * Gets the current or final value of each prop. Can return extra properties (whole object).\n * @param props - properties to get\n * @param [final] - get the final value (animation target)\n */\n getProps

(props: P, final?: boolean): Pick;\n getProps

(props: P[], final?: boolean): Partial>;\n getProps(props: string[], final?: boolean): Partial> {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this as Record;\n }\n const ret: Record = {};\n props.forEach((prop) => {\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop as string];\n });\n return ret;\n }\n}\n","import {isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\nimport {_factorize} from '../helpers/helpers.math.js';\n\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a subset of ticks to be plotted to avoid overlapping labels.\n * @param {import('./core.scale.js').default} scale\n * @param {Tick[]} ticks\n * @return {Tick[]}\n * @private\n */\nexport function autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n\n // If there are too many major ticks to display them all\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\n\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n\n/**\n * @param {number[]} majorIndices\n * @param {Tick[]} ticks\n * @param {number} ticksLimit\n */\nfunction calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n\n // If the major ticks are evenly spaced apart, place the minor ticks\n // so that they divide the major ticks into even chunks\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n\n const factors = _factorize(evenMajorSpacing);\n for (let i = 0, ilen = factors.length - 1; i < ilen; i++) {\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n\n/**\n * @param {Tick[]} ticks\n */\nfunction getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number[]} majorIndices\n * @param {number} spacing\n */\nfunction skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n\n spacing = Math.ceil(spacing);\n for (i = 0; i < ticks.length; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number} spacing\n * @param {number} [majorStart]\n * @param {number} [majorEnd]\n */\nfunction skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n\n next = start;\n\n while (next < 0) {\n count++;\n next = Math.round(start + count * spacing);\n }\n\n for (i = Math.max(start, 0); i < end; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n\n\n/**\n * @param {number[]} arr\n */\nfunction getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n\n if (len < 2) {\n return false;\n }\n\n for (diff = arr[0], i = 1; i < len; ++i) {\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n","import Element from './core.element.js';\nimport {_alignPixel, _measureText, renderText, clipArea, unclipArea} from '../helpers/helpers.canvas.js';\nimport {callback as call, each, finiteOrDefault, isArray, isFinite, isNullOrUndef, isObject, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toDegrees, toRadians, _int16Range, _limitValue, HALF_PI} from '../helpers/helpers.math.js';\nimport {_alignStartEnd, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {createContext, toFont, toPadding, _addGrace} from '../helpers/helpers.options.js';\nimport {autoSkip} from './core.scale.autoskip.js';\n\nconst reverseAlign = (align) => align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset) => edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit) => Math.min(maxTicksLimit || ticksLength, ticksLength);\n\n/**\n * @typedef { import('../types/index.js').Chart } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a new array containing numItems from arr\n * @param {any[]} arr\n * @param {number} numItems\n */\nfunction sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n\n for (; i < len; i += increment) {\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @param {boolean} offsetGridLines\n */\nfunction getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n\n // Return undefined if the pixel is out of the range\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n\n/**\n * @param {object} caches\n * @param {number} length\n */\nfunction garbageCollect(caches, length) {\n each(caches, (cache) => {\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for (i = 0; i < gcLen; ++i) {\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n\n/**\n * @param {object} options\n */\nfunction getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n\n/**\n * @param {object} options\n */\nfunction getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n\n return (lines * font.lineHeight) + padding.height;\n}\n\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\n\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\n\nfunction titleAlign(align, position, reverse) {\n /** @type {CanvasTextAlign} */\n let ret = _toLeftRightCenter(align);\n if ((reverse && position !== 'right') || (!reverse && position === 'right')) {\n ret = reverseAlign(ret);\n }\n return ret;\n}\n\nfunction titleArgs(scale, offset, position, align) {\n const {top, left, bottom, right, chart} = scale;\n const {chartArea, scales} = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {titleX, titleY, maxWidth, rotation};\n}\n\nexport default class Scale extends Element {\n\n // eslint-disable-next-line max-statements\n constructor(cfg) {\n super();\n\n /** @type {string} */\n this.id = cfg.id;\n /** @type {string} */\n this.type = cfg.type;\n /** @type {any} */\n this.options = undefined;\n /** @type {CanvasRenderingContext2D} */\n this.ctx = cfg.ctx;\n /** @type {Chart} */\n this.chart = cfg.chart;\n\n // implements box\n /** @type {number} */\n this.top = undefined;\n /** @type {number} */\n this.bottom = undefined;\n /** @type {number} */\n this.left = undefined;\n /** @type {number} */\n this.right = undefined;\n /** @type {number} */\n this.width = undefined;\n /** @type {number} */\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n /** @type {number} */\n this.maxWidth = undefined;\n /** @type {number} */\n this.maxHeight = undefined;\n /** @type {number} */\n this.paddingTop = undefined;\n /** @type {number} */\n this.paddingBottom = undefined;\n /** @type {number} */\n this.paddingLeft = undefined;\n /** @type {number} */\n this.paddingRight = undefined;\n\n // scale-specific properties\n /** @type {string=} */\n this.axis = undefined;\n /** @type {number=} */\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n /** @type {Tick[]} */\n this.ticks = [];\n /** @type {object[]|null} */\n this._gridLineItems = null;\n /** @type {object[]|null} */\n this._labelItems = null;\n /** @type {object|null} */\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n /** @type {number} */\n this._startPixel = undefined;\n /** @type {number} */\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n\n /**\n\t * @param {any} options\n\t * @since 3.0\n\t */\n init(options) {\n this.options = options.setContext(this.getContext());\n\n this.axis = options.axis;\n\n // parse min/max value, so we can properly determine min/max for other scales\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n\n /**\n\t * Parse a supported input value to internal representation.\n\t * @param {*} raw\n\t * @param {number} [index]\n\t * @since 3.0\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n return raw;\n }\n\n /**\n\t * @return {{min: number, max: number, minDefined: boolean, maxDefined: boolean}}\n\t * @protected\n\t * @since 3.0\n\t */\n getUserBounds() {\n let {_userMin, _userMax, _suggestedMin, _suggestedMax} = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isFinite(_userMin),\n maxDefined: isFinite(_userMax)\n };\n }\n\n /**\n\t * @param {boolean} canStack\n\t * @return {{min: number, max: number}}\n\t * @protected\n\t * @since 3.0\n\t */\n getMinMax(canStack) {\n // eslint-disable-next-line prefer-const\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n let range;\n\n if (minDefined && maxDefined) {\n return {min, max};\n }\n\n const metas = this.getMatchingVisibleMetas();\n for (let i = 0, ilen = metas.length; i < ilen; ++i) {\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n\n // Make sure min <= max when only min or max is defined by user and the data is outside that range\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n\n /**\n\t * Get the padding needed for the scale\n\t * @return {{top: number, left: number, bottom: number, right: number}} the necessary padding\n\t * @private\n\t */\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n\n /**\n\t * Returns the scale tick objects\n\t * @return {Tick[]}\n\t * @since 2.7\n\t */\n getTicks() {\n return this.ticks;\n }\n\n /**\n\t * @return {string[]}\n\t */\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n\n /**\n * @return {import('../types.js').LabelItem[]}\n */\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n\n // When a new layout is created, reset the data limits cache\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n\n // These methods are ordered by lifecycle. Utilities then follow.\n // Any function defined here is inherited by all scale types.\n // Any function can be extended by the scale type\n\n beforeUpdate() {\n call(this.options.beforeUpdate, [this]);\n }\n\n /**\n\t * @param {number} maxWidth - the max width in pixels\n\t * @param {number} maxHeight - the max height in pixels\n\t * @param {{top: number, left: number, bottom: number, right: number}} margins - the space between the edge of the other scales and edge of the chart\n\t * This space comes from two sources:\n\t * - padding - space that's required to show the labels at the edges of the scale\n\t * - thickness of scales or legends in another orientation\n\t */\n update(maxWidth, maxHeight, margins) {\n const {beginAtZero, grace, ticks: tickOpts} = this.options;\n const sampleSize = tickOpts.sampleSize;\n\n // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n this.beforeUpdate();\n\n // Absorb the master measurements\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n\n // Dimensions\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n\n this._maxLength = this.isHorizontal()\n ? this.width + margins.left + margins.right\n : this.height + margins.top + margins.bottom;\n\n // Data min/max\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n\n this.beforeBuildTicks();\n\n this.ticks = this.buildTicks() || [];\n\n // Allow modification of ticks in callback.\n this.afterBuildTicks();\n\n // Compute tick rotation and fit using a sampled subset of labels\n // We generally don't need to compute the size of every single label for determining scale size\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n\n // configure is called twice, once here, once from core.controller.updateLayout.\n // Here we haven't been positioned yet, but dimensions are correct.\n // Variables set in configure are needed for calculateLabelRotation, and\n // it's ok that coordinates are not correct there, only dimensions matter.\n this.configure();\n\n // Tick Rotation\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation(); // Preconditions: number of ticks and sizes of largest labels must be calculated beforehand\n this.afterCalculateLabelRotation();\n\n // Auto-skip\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n\n if (samplingEnabled) {\n // Generate labels using all non-skipped ticks\n this._convertTicksToLabels(this.ticks);\n }\n\n this.beforeFit();\n this.fit(); // Preconditions: label rotation and label sizes must be calculated beforehand\n this.afterFit();\n\n // IMPORTANT: after this point, we consider that `this.ticks` will NEVER change!\n\n this.afterUpdate();\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n // by default vertical scales are from bottom to top, so pixels are reversed\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n\n afterUpdate() {\n call(this.options.afterUpdate, [this]);\n }\n\n //\n\n beforeSetDimensions() {\n call(this.options.beforeSetDimensions, [this]);\n }\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n if (this.isHorizontal()) {\n // Reset position before calculating rotation\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n\n // Reset position before calculating rotation\n this.top = 0;\n this.bottom = this.height;\n }\n\n // Reset padding\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n call(this.options.afterSetDimensions, [this]);\n }\n\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n call(this.options[name], [this]);\n }\n\n // Data limits\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n\n //\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n /**\n\t * @return {object[]} the ticks\n\t */\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n\n beforeTickToLabelConversion() {\n call(this.options.beforeTickToLabelConversion, [this]);\n }\n /**\n\t * Convert ticks to label strings\n\t * @param {Tick[]} ticks\n\t */\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n tick = ticks[i];\n tick.label = call(tickOpts.callback, [tick.value, i, ticks], this);\n }\n }\n afterTickToLabelConversion() {\n call(this.options.afterTickToLabelConversion, [this]);\n }\n\n //\n\n beforeCalculateLabelRotation() {\n call(this.options.beforeCalculateLabelRotation, [this]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n\n // Estimate the width of each grid based on the canvas width, the maximum\n // label width and the number of tick intervals\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n\n // Allow 3 pixels x2 padding either side for label readability\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid)\n\t\t\t\t- tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(\n Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),\n Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))\n ));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n call(this.options.afterCalculateLabelRotation, [this]);\n }\n afterAutoSkip() {}\n\n //\n\n beforeFit() {\n call(this.options.beforeFit, [this]);\n }\n fit() {\n // Reset\n const minSize = {\n width: 0,\n height: 0\n };\n\n const {chart, options: {ticks: tickOpts, title: titleOpts, grid: gridOpts}} = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight; // fill all the height\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n\n // Don't bother fitting the ticks if we are not showing the labels\n if (tickOpts.display && this.ticks.length) {\n const {first, last, widest, highest} = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n\n if (isHorizontal) {\n // A horizontal axis is more constrained by the height.\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n // A vertical axis is more constrained by the width. Labels are the\n // dominant factor here, so get that length first and account for padding\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n\n this._handleMargins();\n\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n\n _calculatePadding(first, last, sin, cos) {\n const {ticks: {align, padding}, position} = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n\n // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned\n // which means that the right padding is dominated by the font height\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n\n // Adjust padding taking into account changes in offsets\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n\n /**\n\t * Handle margins and padding interactions\n\t * @private\n\t */\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n\n afterFit() {\n call(this.options.afterFit, [this]);\n }\n\n // Shared Methods\n /**\n\t * @return {boolean}\n\t */\n isHorizontal() {\n const {axis, position} = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n /**\n\t * @return {boolean}\n\t */\n isFullSize() {\n return this.options.fullSize;\n }\n\n /**\n\t * @param {Tick[]} ticks\n\t * @private\n\t */\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n\n this.generateTickLabels(ticks);\n\n // Ticks should be skipped when callback returns null or undef, so lets remove those.\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n\n this.afterTickToLabelConversion();\n }\n\n /**\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n\n return labelSizes;\n }\n\n /**\n\t * Returns {width, height, offset} objects for the first, last, widest, highest tick\n\t * labels where offset indicates the anchor point offset from the top in pixels.\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const {ctx, _longestTextCache: caches} = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n\n for (i = 0; i < length; i += increment) {\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n // if it is an array let's measure each element\n for (j = 0, jlen = label.length; j < jlen; ++j) {\n nestedLabel = /** @type {string} */ (label[j]);\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n\n const valueAt = (idx) => ({width: widths[idx] || 0, height: heights[idx] || 0});\n\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights,\n };\n }\n\n /**\n\t * Used to get the label to display in the tooltip for the given value\n\t * @param {*} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value;\n }\n\n /**\n\t * Returns the location of the given data point. Value can either be an index or a numerical value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {*} value\n\t * @param {number} [index]\n\t * @return {number}\n\t */\n getPixelForValue(value, index) { // eslint-disable-line no-unused-vars\n return NaN;\n }\n\n /**\n\t * Used to get the data value from a given pixel. This is the inverse of getPixelForValue\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} pixel\n\t * @return {*}\n\t */\n getValueForPixel(pixel) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Returns the location of the tick at the given index\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} index\n\t * @return {number}\n\t */\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n /**\n\t * Utility for getting the pixel location of a percentage of scale\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} decimal\n\t * @return {number}\n\t */\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n\n /**\n\t * Returns the pixel for the minimum chart value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @return {number}\n\t */\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n\n /**\n\t * @return {number}\n\t */\n getBaseValue() {\n const {min, max} = this;\n\n return min < 0 && max < 0 ? max :\n min > 0 && max > 0 ? min :\n 0;\n }\n\n /**\n\t * @protected\n\t */\n getContext(index) {\n const ticks = this.ticks || [];\n\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context ||\n\t\t\t\t(tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context ||\n\t\t\t(this.$context = createScaleContext(this.chart.getContext(), this));\n }\n\n /**\n\t * @return {number}\n\t * @private\n\t */\n _tickSize() {\n const optionTicks = this.options.ticks;\n\n // Calculate space needed by label in axis direction.\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n\n // Calculate space needed for 1 tick in axis direction.\n return this.isHorizontal()\n ? h * cos > w * sin ? w / cos : h / sin\n : h * sin < w * cos ? h / cos : w / sin;\n }\n\n /**\n\t * @return {boolean}\n\t * @private\n\t */\n _isVisible() {\n const display = this.options.display;\n\n if (display !== 'auto') {\n return !!display;\n }\n\n return this.getMatchingVisibleMetas().length > 0;\n }\n\n /**\n\t * @private\n\t */\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const {grid, position, border} = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for (i = 0; i < ticksLength; i += step) {\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n\n lineValue = getPixelForGridLine(this, i, offset);\n\n // Skip if the pixel is out of the range\n if (lineValue === undefined) {\n continue;\n }\n\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset,\n });\n }\n\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n\n return items;\n }\n\n /**\n\t * @private\n\t */\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const {position, ticks: optionTicks} = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const {align, crossAlign, padding, mirror} = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = ((chartArea.top + chartArea.bottom) / 2) + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = ((chartArea.left + chartArea.right) / 2) - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n\n const labelSizes = this._getLabelSizes();\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n label = tick.label;\n\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n\n if (isHorizontal) {\n x = pixel;\n\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += (lineHeight / 2) * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n\n let backdrop;\n\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n\n switch (textBaseline) {\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n default:\n break;\n }\n\n switch (textAlign) {\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n default:\n break;\n }\n\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n\n color: optsAtIndex.backdropColor,\n };\n }\n\n items.push({\n label,\n font,\n textOffset,\n options: {\n rotation,\n color,\n strokeColor,\n strokeWidth,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [x, y],\n backdrop,\n }\n });\n }\n\n return items;\n }\n\n _getXAxisLabelAlignment() {\n const {position, ticks} = this.options;\n const rotation = -toRadians(this.labelRotation);\n\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n\n let align = 'center';\n\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n\n return align;\n }\n\n _getYAxisLabelAlignment(tl) {\n const {position, ticks: {crossAlign, mirror, padding}} = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n\n let textAlign;\n let x;\n\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += (widest / 2);\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n\n return {textAlign, x};\n }\n\n /**\n\t * @private\n\t */\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n\n const chart = this.chart;\n const position = this.options.position;\n\n if (position === 'left' || position === 'right') {\n return {top: 0, left: this.left, bottom: chart.height, right: this.right};\n } if (position === 'top' || position === 'bottom') {\n return {top: this.top, left: 0, bottom: this.bottom, right: chart.width};\n }\n }\n\n /**\n * @protected\n */\n drawBackground() {\n const {ctx, options: {backgroundColor}, left, top, width, height} = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex(t => t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n\n const drawLine = (p1, p2, style) => {\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n\n if (grid.display) {\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n const item = items[i];\n\n if (grid.drawOnChartArea) {\n drawLine(\n {x: item.x1, y: item.y1},\n {x: item.x2, y: item.y2},\n item\n );\n }\n\n if (grid.drawTicks) {\n drawLine(\n {x: item.tx1, y: item.ty1},\n {x: item.tx2, y: item.ty2},\n {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n }\n );\n }\n }\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {\n const {chart, ctx, options: {border, grid}} = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n\n if (!optionTicks.display) {\n return;\n }\n\n const ctx = this.ctx;\n\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n\n const items = this.getLabelItems(chartArea);\n for (const item of items) {\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n\n if (area) {\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const {ctx, options: {position, title, reverse}} = this;\n\n if (!title.display) {\n return;\n }\n\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n\n const {titleX, titleY, maxWidth, rotation} = titleArgs(this, offset, position, align);\n\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n\n /**\n\t * @return {object[]}\n\t * @private\n\t */\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n // backward compatibility: draw has been overridden by custom scale\n return [{\n z: tz,\n draw: (chartArea) => {\n this.draw(chartArea);\n }\n }];\n }\n\n return [{\n z: gz,\n draw: (chartArea) => {\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n }, {\n z: bz,\n draw: () => {\n this.drawBorder();\n }\n }, {\n z: tz,\n draw: (chartArea) => {\n this.drawLabels(chartArea);\n }\n }];\n }\n\n /**\n\t * Returns visible dataset metas that are attached to this scale\n\t * @param {string} [type] - if specified, also filter by dataset type\n\t * @return {object[]}\n\t */\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n\n /**\n\t * @param {number} index\n\t * @return {object}\n\t * @protected\n \t */\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n\n /**\n * @protected\n */\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n","import {merge} from '../helpers/index.js';\nimport defaults, {overrides} from './core.defaults.js';\n\n/**\n * @typedef {{id: string, defaults: any, overrides?: any, defaultRoutes: any}} IChartComponent\n */\n\nexport default class TypedRegistry {\n constructor(type, scope, override) {\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n\n /**\n\t * @param {IChartComponent} item\n\t * @returns {string} The scope where items defaults were registered to.\n\t */\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n\n if (isIChartComponent(proto)) {\n // Make sure the parent is registered and note the scope where its defaults are.\n parentScope = this.register(proto);\n }\n\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n\n if (id in items) {\n // already registered\n return scope;\n }\n\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n\n return scope;\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object?}\n\t */\n get(id) {\n return this.items[id];\n }\n\n /**\n\t * @param {IChartComponent} item\n\t */\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n\n if (id in items) {\n delete items[id];\n }\n\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\n\nfunction registerDefaults(item, scope, parentScope) {\n // Inherit the parent's defaults and keep existing defaults\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n\n defaults.set(scope, itemDefaults);\n\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\n\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach(property => {\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [scope].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\n\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n","import DatasetController from './core.datasetController.js';\nimport Element from './core.element.js';\nimport Scale from './core.scale.js';\nimport TypedRegistry from './core.typedRegistry.js';\nimport {each, callback as call, _capitalize} from '../helpers/helpers.core.js';\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Registry {\n constructor() {\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n // Order is important, Scale has Element in prototype chain,\n // so Scales must be before Elements. Plugins are a fallback, so not listed here.\n this._typedRegistries = [this.controllers, this.scales, this.elements];\n }\n\n /**\n\t * @param {...any} args\n\t */\n add(...args) {\n this._each('register', args);\n }\n\n remove(...args) {\n this._each('unregister', args);\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof DatasetController}\n\t */\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Element}\n\t */\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object}\n\t */\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Scale}\n\t */\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n\n /**\n\t * @private\n\t */\n _each(method, args, typedRegistry) {\n [...args].forEach(arg => {\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || (reg === this.plugins && arg.id)) {\n this._exec(method, reg, arg);\n } else {\n // Handle loopable args\n // Use case:\n // import * as plugins from './plugins.js';\n // Chart.register(plugins);\n each(arg, item => {\n // If there are mixed types in the loopable, make sure those are\n // registered in correct registry\n // Use case: (treemap exporting controller, elements etc)\n // import * as treemap from 'chartjs-chart-treemap.js';\n // Chart.register(treemap);\n\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n call(component['before' + camelMethod], [], component); // beforeRegister / beforeUnregister\n registry[method](component);\n call(component['after' + camelMethod], [], component); // afterRegister / afterUnregister\n }\n\n /**\n\t * @private\n\t */\n _getRegistryForType(type) {\n for (let i = 0; i < this._typedRegistries.length; i++) {\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n // plugins is the fallback registry\n return this.plugins;\n }\n\n /**\n\t * @private\n\t */\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Registry();\n","import registry from './core.registry.js';\nimport {callback as callCallback, isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../plugins/plugin.tooltip.js').default } Tooltip\n */\n\n/**\n * @callback filterCallback\n * @param {{plugin: object, options: object}} value\n * @param {number} [index]\n * @param {array} [array]\n * @param {object} [thisArg]\n * @return {boolean}\n */\n\n\nexport default class PluginService {\n constructor() {\n this._init = [];\n }\n\n /**\n\t * Calls enabled plugins for `chart` on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {Chart} chart - The chart instance for which plugins should be called.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {object} [args] - Extra arguments to apply to the hook call.\n * @param {filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n\n /**\n\t * @private\n\t */\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors) {\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [chart, args, descriptor.options];\n if (callCallback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n\n return true;\n }\n\n invalidate() {\n // When plugins are registered, there is the possibility of a double\n // invalidate situation. In this case, we only want to invalidate once.\n // If we invalidate multiple times, the `_oldCache` is lost and all of the\n // plugins are restarted without being correctly stopped.\n // See https://github.com/chartjs/Chart.js/issues/8147\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n\n const descriptors = this._cache = this._createDescriptors(chart);\n\n this._notifyStateChanges(chart);\n\n return descriptors;\n }\n\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n // options === false => all plugins are disabled\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b) => a.filter(x => !b.some(y => x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\n\n/**\n * @param {import('./core.config.js').default} config\n */\nfunction allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for (let i = 0; i < keys.length; i++) {\n plugins.push(registry.getPlugin(keys[i]));\n }\n\n const local = config.plugins || [];\n for (let i = 0; i < local.length; i++) {\n const plugin = local[i];\n\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n\n return {plugins, localIds};\n}\n\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\n\nfunction createDescriptors(chart, {plugins, localIds}, options, all) {\n const result = [];\n const context = chart.getContext();\n\n for (const plugin of plugins) {\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {plugin, local: localIds[id]}, opts, context)\n });\n }\n\n return result;\n}\n\nfunction pluginOpts(config, {plugin, local}, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n // make sure plugin defaults are in scopes for local (not registered) plugins\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [''], {\n // These are just defaults that plugins can override\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n","import defaults, {overrides, descriptors} from './core.defaults.js';\nimport {mergeIf, resolveObjectKey, isArray, isFunction, valueOrDefault, isObject} from '../helpers/helpers.core.js';\nimport {_attachContext, _createResolver, _descriptors} from '../helpers/helpers.config.js';\n\nexport function getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\n\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\n\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\n\nfunction idMatchesAxis(id) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n}\n\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\n\nexport function determineAxis(id, ...scaleOptions) {\n if (idMatchesAxis(id)) {\n return id;\n }\n for (const opts of scaleOptions) {\n const axis = opts.axis\n || axisFromPosition(opts.position)\n || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n if (axis) {\n return axis;\n }\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\n\nfunction getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + 'AxisID'] === id) {\n return {axis};\n }\n}\n\nfunction retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d) => d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) {\n return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n }\n }\n return {};\n}\n\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {scales: {}};\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n\n // First figure out first scale id's per axis.\n Object.keys(configScales).forEach(id => {\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [{axis}, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]);\n });\n\n // Then merge dataset defaults to scale configs\n config.data.datasets.forEach(dataset => {\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach(defaultID => {\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [{axis}, configScales[id], defaultScaleOptions[defaultID]]);\n });\n });\n\n // apply scale defaults, if not overridden by dataset defaults\n Object.keys(scales).forEach(key => {\n const scale = scales[key];\n mergeIf(scale, [defaults.scales[scale.type], defaults.scale]);\n });\n\n return scales;\n}\n\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\n\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\n\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n\n initOptions(config);\n\n return config;\n}\n\nconst keyCache = new Map();\nconst keysCached = new Set();\n\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\n\nconst addIfFound = (set, obj, key) => {\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\n\nexport default class Config {\n constructor(config) {\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n\n get platform() {\n return this._config.platform;\n }\n\n get type() {\n return this._config.type;\n }\n\n set type(type) {\n this._config.type = type;\n }\n\n get data() {\n return this._config.data;\n }\n\n set data(data) {\n this._config.data = initData(data);\n }\n\n get options() {\n return this._config.options;\n }\n\n set options(options) {\n this._config.options = options;\n }\n\n get plugins() {\n return this._config.plugins;\n }\n\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n\n /**\n * Returns the option scope keys for resolving dataset options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @return {string[][]}\n */\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType,\n () => [[\n `datasets.${datasetType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the option scope keys for resolving dataset animation options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @param {string} transition\n * @return {string[][]}\n */\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`,\n () => [\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`,\n ],\n // The following are used for looking up the `animations` and `animation` keys\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n\n /**\n * Returns the options scope keys for resolving element options that belong\n * to an dataset. These keys do not include the dataset itself, because it\n * is not under options.\n * @param {string} datasetType\n * @param {string} elementType\n * @return {string[][]}\n */\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`,\n () => [[\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the options scope keys for resolving plugin options.\n * @param {{id: string, additionalOptionScopes?: string[]}} plugin\n * @return {string[][]}\n */\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`,\n () => [[\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || [],\n ]]);\n }\n\n /**\n * @private\n */\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n\n /**\n * Resolves the objects from options and defaults for option value resolution.\n * @param {object} mainScope - The main scope object for options\n * @param {string[][]} keyLists - The arrays of keys in resolution order\n * @param {boolean} [resetCache] - reset the cache for this mainScope\n */\n getOptionScopes(mainScope, keyLists, resetCache) {\n const {options, type} = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n\n const scopes = new Set();\n\n keyLists.forEach(keys => {\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach(key => addIfFound(scopes, mainScope, key));\n }\n keys.forEach(key => addIfFound(scopes, options, key));\n keys.forEach(key => addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach(key => addIfFound(scopes, defaults, key));\n keys.forEach(key => addIfFound(scopes, descriptors, key));\n });\n\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n\n /**\n * Returns the option scopes for resolving chart options\n * @return {object[]}\n */\n chartOptionScopes() {\n const {options, type} = this;\n\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {}, // https://github.com/chartjs/Chart.js/issues/8531\n {type},\n defaults,\n descriptors\n ];\n }\n\n /**\n * @param {object[]} scopes\n * @param {string[]} names\n * @param {function|object} context\n * @param {string[]} [prefixes]\n * @return {object}\n */\n resolveNamedOptions(scopes, names, context, prefixes = ['']) {\n const result = {$shared: true};\n const {resolver, subPrefixes} = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n // subResolver is passed to scriptable options. It should not resolve to hover options.\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n\n for (const prop of names) {\n result[prop] = options[prop];\n }\n return result;\n }\n\n /**\n * @param {object[]} scopes\n * @param {object} [context]\n * @param {string[]} [prefixes]\n * @param {{scriptable: boolean, indexable: boolean, allKeys?: boolean}} [descriptorDefaults]\n */\n createResolver(scopes, context, prefixes = [''], descriptorDefaults) {\n const {resolver} = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context)\n ? _attachContext(resolver, context, undefined, descriptorDefaults)\n : resolver;\n }\n}\n\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter(p => !p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\n\nconst hasFunction = value => isObject(value)\n && Object.getOwnPropertyNames(value).reduce((acc, key) => acc || isFunction(value[key]), false);\n\nfunction needContext(proxy, names) {\n const {isScriptable, isIndexable} = _descriptors(proxy);\n\n for (const prop of names) {\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if ((scriptable && (isFunction(value) || hasFunction(value)))\n || (indexable && isArray(value))) {\n return true;\n }\n }\n return false;\n}\n","import animator from './core.animator.js';\nimport defaults, {overrides} from './core.defaults.js';\nimport Interaction from './core.interaction.js';\nimport layouts from './core.layouts.js';\nimport {_detectPlatform} from '../platform/index.js';\nimport PluginService from './core.plugins.js';\nimport registry from './core.registry.js';\nimport Config, {determineAxis, getIndexAxis} from './core.config.js';\nimport {retinaScale, _isDomSupported} from '../helpers/helpers.dom.js';\nimport {each, callback as callCallback, uid, valueOrDefault, _elementsEqual, isNullOrUndef, setsEqual, defined, isFunction, _isClickEvent} from '../helpers/helpers.core.js';\nimport {clearCanvas, clipArea, createContext, unclipArea, _isPointInArea} from '../helpers/index.js';\n// @ts-ignore\nimport {version} from '../../package.json';\nimport {debounce} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').Point } Point\n */\n\nconst KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || (KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x');\n}\n\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1]\n ? a[l2] - b[l2]\n : a[l1] - b[l1];\n };\n}\n\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n\n chart.notifyPlugins('afterRender');\n callCallback(animationOptions && animationOptions.onComplete, [context], chart);\n}\n\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callCallback(animationOptions && animationOptions.onProgress, [context], chart);\n}\n\n/**\n * Chart.js can take a string id of a canvas element, a 2d context, or a canvas element itself.\n * Attempt to unwrap the item passed into the chart constructor so that it is a canvas element (if possible).\n */\nfunction getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n // Support for array based queries (such as jQuery)\n item = item[0];\n }\n\n if (item && item.canvas) {\n // Support for any object associated to a canvas (including a context2d)\n item = item.canvas;\n }\n return item;\n}\n\nconst instances = {};\nconst getChart = (key) => {\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c) => c.canvas === canvas).pop();\n};\n\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys) {\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n\n/**\n * @param {ChartEvent} e\n * @param {ChartEvent|null} lastEvent\n * @param {boolean} inChartArea\n * @param {boolean} isClick\n * @returns {ChartEvent|null}\n */\nfunction determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\n\nfunction getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\n\nfunction getDatasetArea(meta, chartArea) {\n const {xScale, yScale} = meta;\n if (xScale && yScale) {\n return {\n left: getSizeForArea(xScale, chartArea, 'left'),\n right: getSizeForArea(xScale, chartArea, 'right'),\n top: getSizeForArea(yScale, chartArea, 'top'),\n bottom: getSizeForArea(yScale, chartArea, 'bottom')\n };\n }\n return chartArea;\n}\n\nclass Chart {\n\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n\n // eslint-disable-next-line max-statements\n constructor(item, userConfig) {\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error(\n 'Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' +\n\t\t\t\t' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.'\n );\n }\n\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n // Store the previously used aspect ratio to determine if a resize\n // is needed during updates. Do this after _options is set since\n // aspectRatio uses a getter\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n /** @type {?{attach?: function, detach?: function, resize?: function}} */\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce(mode => this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n\n // Add the chart instance to the global namespace\n instances[this.id] = this;\n\n if (!context || !canvas) {\n // The given item is not a compatible context2d element, let's return before finalizing\n // the chart initialization but after setting basic chart / controller properties that\n // can help to figure out that the chart is not valid (e.g chart.canvas !== null);\n // https://github.com/chartjs/Chart.js/issues/2807\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n\n get aspectRatio() {\n const {options: {aspectRatio, maintainAspectRatio}, width, height, _aspectRatio} = this;\n if (!isNullOrUndef(aspectRatio)) {\n // If aspectRatio is defined in options, use that.\n return aspectRatio;\n }\n\n if (maintainAspectRatio && _aspectRatio) {\n // If maintainAspectRatio is truthly and we had previously determined _aspectRatio, use that\n return _aspectRatio;\n }\n\n // Calculate\n return height ? width / height : null;\n }\n\n get data() {\n return this.config.data;\n }\n\n set data(data) {\n this.config.data = data;\n }\n\n get options() {\n return this._options;\n }\n\n set options(options) {\n this.config.options = options;\n }\n\n get registry() {\n return registry;\n }\n\n /**\n\t * @private\n\t */\n _initialize() {\n // Before init plugin notification\n this.notifyPlugins('beforeInit');\n\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n\n this.bindEvents();\n\n // After init plugin notification\n this.notifyPlugins('afterInit');\n\n return this;\n }\n\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n\n stop() {\n animator.stop(this);\n return this;\n }\n\n /**\n\t * Resize the chart to its container or to explicit dimensions.\n\t * @param {number} [width]\n\t * @param {number} [height]\n\t */\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {width, height};\n }\n }\n\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n\n this.notifyPlugins('resize', {size: newSize});\n\n callCallback(options.onResize, [this, newSize], this);\n\n if (this.attached) {\n if (this._doResize(mode)) {\n // The resize update is delayed, only draw without updating.\n this.render();\n }\n }\n }\n\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n\n each(scalesOptions, (axisOptions, axisID) => {\n axisOptions.id = axisID;\n });\n }\n\n /**\n\t * Builds a map of scale ID to scale object for future lookup.\n\t */\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id) => {\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n\n if (scaleOpts) {\n items = items.concat(\n Object.keys(scaleOpts).map((id) => {\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n })\n );\n }\n\n each(items, (item) => {\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n\n scale.init(scaleOptions, options);\n });\n // clear up discarded scales\n each(updated, (hasUpdated, id) => {\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n\n each(scales, (scale) => {\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n\n /**\n\t * @private\n\t */\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n\n metasets.sort((a, b) => a.index - b.index);\n if (numMeta > numData) {\n for (let i = numData; i < numMeta; ++i) {\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n\n /**\n\t * @private\n\t */\n _removeUnreferencedMetasets() {\n const {_metasets: metasets, data: {datasets}} = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index) => {\n if (datasets.filter(x => x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n\n this._removeUnreferencedMetasets();\n\n for (i = 0, ilen = datasets.length; i < ilen; i++) {\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const {datasetElementType, dataElementType} = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n\n this._updateMetasets();\n return newControllers;\n }\n\n /**\n\t * Reset the elements of all datasets\n\t * @private\n\t */\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex) => {\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n\n /**\n\t* Resets the chart back to its state before the initial animation\n\t*/\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n\n update(mode) {\n const config = this.config;\n\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n\n // plugins options references might have change, let's invalidate the cache\n // https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\n this._plugins.invalidate();\n\n if (this.notifyPlugins('beforeUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n // Make sure dataset controllers are updated and new controllers are reset\n const newControllers = this.buildOrUpdateControllers();\n\n this.notifyPlugins('beforeElementsUpdate');\n\n // Make sure all dataset controllers have correct meta data counts\n let minPadding = 0;\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; i++) {\n const {controller} = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n // New controllers will be reset after the layout pass, so we only want to modify\n // elements added to new datasets\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n\n // Only reset the controllers if we have animations\n if (!animsDisabled) {\n // Can only reset the new controllers after the scales have been updated\n // Reset is done to get the starting point for the initial animation\n each(newControllers, (controller) => {\n controller.reset();\n });\n }\n\n this._updateDatasets(mode);\n\n // Do this before render so that any plugins that need final scale updates can use it\n this.notifyPlugins('afterUpdate', {mode});\n\n this._layers.sort(compare2Level('z', '_idx'));\n\n // Replay last event from before update, or set hover styles on active elements\n const {_active, _lastEvent} = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n\n this.render();\n }\n\n /**\n * @private\n */\n _updateScales() {\n each(this.scales, (scale) => {\n layouts.removeBox(this, scale);\n });\n\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n\n /**\n * @private\n */\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n // The configured events have changed. Rebind.\n this.unbindEvents();\n this.bindEvents();\n }\n }\n\n /**\n * @private\n */\n _updateHiddenIndices() {\n const {_hiddenIndices} = this;\n const changes = this._getUniformDataChanges() || [];\n for (const {method, start, count} of changes) {\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n\n /**\n * @private\n */\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx) => new Set(\n _dataChanges\n .filter(c => c[0] === idx)\n .map((c, i) => i + ',' + c.splice(1).join(','))\n );\n\n const changeSet = makeSet(0);\n for (let i = 1; i < datasetCount; i++) {\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet)\n .map(c => c.split(','))\n .map(a => ({method: a[1], start: +a[2], count: +a[3]}));\n }\n\n /**\n\t * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`\n\t * hook, in which case, plugins will not be called on `afterLayout`.\n\t * @private\n\t */\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {cancelable: true}) === false) {\n return;\n }\n\n layouts.update(this, this.width, this.height, minPadding);\n\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n\n this._layers = [];\n each(this.boxes, (box) => {\n if (noArea && box.position === 'chartArea') {\n // Skip drawing and configuring chartArea boxes when chartArea is zero or negative\n return;\n }\n\n // configure is called twice, once in core.scale.update and once here.\n // Here the boxes are fully updated and at their final positions.\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n\n this._layers.forEach((item, index) => {\n item._idx = index;\n });\n\n this.notifyPlugins('afterLayout');\n }\n\n /**\n\t * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.\n\t * @private\n\t */\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this.getDatasetMeta(i).controller.configure();\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);\n }\n\n this.notifyPlugins('afterDatasetsUpdate', {mode});\n }\n\n /**\n\t * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetUpdate`.\n\t * @private\n\t */\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {meta, index, mode, cancelable: true};\n\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n\n meta.controller._update(mode);\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n\n render() {\n if (this.notifyPlugins('beforeRender', {cancelable: true}) === false) {\n return;\n }\n\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({chart: this});\n }\n }\n\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const {width, height} = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n\n if (this.notifyPlugins('beforeDraw', {cancelable: true}) === false) {\n return;\n }\n\n // Because of plugin hooks (before/afterDatasetsDraw), datasets can't\n // currently be part of layers. Instead, we draw\n // layers <= 0 before(default, backward compat), and the rest after\n const layers = this._layers;\n for (i = 0; i < layers.length && layers[i].z <= 0; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this._drawDatasets();\n\n // Rest of layers\n for (; i < layers.length; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this.notifyPlugins('afterDraw');\n }\n\n /**\n\t * @private\n\t */\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n\n return result;\n }\n\n /**\n\t * Gets the visible dataset metas in drawing order\n\t * @return {object[]}\n\t */\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n\n /**\n\t * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetsDraw`.\n\t * @private\n\t */\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {cancelable: true}) === false) {\n return;\n }\n\n const metasets = this.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n this._drawDataset(metasets[i]);\n }\n\n this.notifyPlugins('afterDatasetsDraw');\n }\n\n /**\n\t * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetDraw`.\n\t * @private\n\t */\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta, this.chartArea);\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n\n meta.controller.draw();\n\n if (useClip) {\n unclipArea(ctx);\n }\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n\n /**\n * Checks whether the given point is in the chart area.\n * @param {Point} point - in relative coordinates (see, e.g., getRelativePosition)\n * @returns {boolean}\n */\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n\n return [];\n }\n\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter(x => x && x._dataset === dataset).pop();\n\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\t\t\t// See isDatasetVisible() comment\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n\n return meta;\n }\n\n getContext() {\n return this.$context || (this.$context = createContext(null, {chart: this, type: 'chart'}));\n }\n\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n\n const meta = this.getDatasetMeta(datasetIndex);\n\n // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,\n // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n\n /**\n\t * @private\n\t */\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n // Animate visible state, so hide animation can be seen. This could be handled better if update / updateDataset returned a Promise.\n anims.update(meta, {visible});\n this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n\n /**\n\t * @private\n\t */\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n\n for (i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._destroyDatasetMeta(i);\n }\n }\n\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const {canvas, ctx} = this;\n\n this._stop();\n this.config.clearCache();\n\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n\n delete instances[this.id];\n\n this.notifyPlugins('afterDestroy');\n }\n\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n\n /**\n\t * @private\n\t */\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n\n /**\n * @private\n */\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n\n const listener = (e, x, y) => {\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n\n each(this.options.events, (type) => _add(type, listener));\n }\n\n /**\n * @private\n */\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener) => {\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n\n const listener = (width, height) => {\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n\n let detached; // eslint-disable-line prefer-const\n const attached = () => {\n _remove('attach', attached);\n\n this.attached = true;\n this.resize();\n\n _add('resize', listener);\n _add('detach', detached);\n };\n\n detached = () => {\n this.attached = false;\n\n _remove('resize', listener);\n\n // Stop animating and remove metasets, so when re-attached, the animations start from beginning.\n this._stop();\n this._resize(0, 0);\n\n _add('attach', attached);\n };\n\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n\n /**\n\t * @private\n\t */\n unbindEvents() {\n each(this._listeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n\n each(this._responsiveListeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n\n /**\n\t * Get active (hovered) elements\n\t * @returns array\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active (hovered) elements\n\t * @param {array} activeElements New active data points\n\t */\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n\n if (changed) {\n this._active = active;\n // Make sure we don't use the previous mouse event to override the active elements in update.\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n\n /**\n\t * Calls enabled plugins on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {Object} [args] - Extra arguments to apply to the hook call.\n * @param {import('./core.plugins.js').filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n\n /**\n * Check if a plugin with the specific ID is registered and enabled\n * @param {string} pluginId - The ID of the plugin of which to check if it is enabled\n * @returns {boolean}\n */\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter(p => p.plugin.id === pluginId).length === 1;\n }\n\n /**\n\t * @private\n\t */\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b) => a.filter(x => !b.some(y => x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n\n /**\n\t * @private\n\t */\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type);\n\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n\n const changed = this._handleEvent(e, replay, args.inChartArea);\n\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n\n if (changed || args.changed) {\n this.render();\n }\n\n return this;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e the event to handle\n\t * @param {boolean} [replay] - true if the event was replayed by `update`\n * @param {boolean} [inChartArea] - true if the event is inside chartArea\n\t * @return {boolean} true if the chart needs to re-render\n\t * @private\n\t */\n _handleEvent(e, replay, inChartArea) {\n const {_active: lastActive = [], options} = this;\n\n // If the event is replayed from `update`, we should evaluate with the final positions.\n //\n // The `replay`:\n // It's the last event (excluding click) that has occurred before `update`.\n // So mouse has not moved. It's also over the chart, because there is a `replay`.\n //\n // The why:\n // If animations are active, the elements haven't moved yet compared to state before update.\n // But if they will, we are activating the elements that would be active, if this check\n // was done after the animations have completed. => \"final positions\".\n // If there is no animations, the \"final\" and \"current\" positions are equal.\n // This is done so we do not have to evaluate the active elements each animation frame\n // - it would be expensive.\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n\n if (inChartArea) {\n // Set _lastEvent to null while we are processing the event handlers.\n // This prevents recursion if the handler calls chart.update()\n this._lastEvent = null;\n\n // Invoke onHover hook\n callCallback(options.onHover, [e, active, this], this);\n\n if (isClick) {\n callCallback(options.onClick, [e, active, this], this);\n }\n }\n\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n\n this._lastEvent = lastEvent;\n\n return changed;\n }\n\n /**\n * @param {ChartEvent} e - The event\n * @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements\n * @param {boolean} inChartArea - Is the envent inside chartArea\n * @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after animation) element positions\n * @returns {import('../types/index.js').ActiveElement[]} - The active elements\n * @pravate\n */\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n return lastActive;\n }\n\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\n\n// @ts-ignore\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart) => chart._plugins.invalidate());\n}\n\nexport default Chart;\n","import Element from '../core/core.element.js';\nimport {_angleBetween, getAngleFromPoint, TAU, HALF_PI, valueOrDefault} from '../helpers/index.js';\nimport {PI, _isBetween, _limitValue} from '../helpers/helpers.math.js';\nimport {_readValueToProps} from '../helpers/helpers.options.js';\nimport type {ArcOptions, Point} from '../types/index.js';\n\n\nfunction clipArc(ctx: CanvasRenderingContext2D, element: ArcElement, endAngle: number) {\n const {startAngle, pixelMargin, x, y, outerRadius, innerRadius} = element;\n let angleMargin = pixelMargin / outerRadius;\n\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\n\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, ['outerStart', 'outerEnd', 'innerStart', 'innerEnd']);\n}\n\n/**\n * Parse border radius from the provided options\n */\nfunction parseBorderRadius(arc: ArcElement, innerRadius: number, outerRadius: number, angleDelta: number) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val) => {\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit),\n };\n}\n\n/**\n * Convert (r, 𝜃) to (x, y)\n */\nfunction rThetaToXY(r: number, theta: number, x: number, y: number) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta),\n };\n}\n\n\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */\nfunction pathArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n end: number,\n circular: boolean,\n) {\n const {x, y, startAngle: start, pixelMargin, innerRadius: innerR} = element;\n\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n\n let spacingOffset = 0;\n const alpha = end - start;\n\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? (alpha * avNogSpacingRadius) / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const {outerStart, outerEnd, innerStart, innerEnd} = parseBorderRadius(element, innerRadius, outerRadius, endAngle - startAngle);\n\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n\n ctx.beginPath();\n\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = ((endAngle - (innerEnd / innerRadius)) + (startAngle + (innerStart / innerRadius))) / 2;\n ctx.arc(x, y, innerRadius, endAngle - (innerEnd / innerRadius), innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + (innerStart / innerRadius), true);\n\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n\n ctx.closePath();\n}\n\nfunction drawArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference} = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\n\nfunction drawBorder(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference, options} = element;\n const {borderWidth, borderJoinStyle, borderDash, borderDashOffset} = options;\n const inner = options.borderAlign === 'inner';\n\n if (!borderWidth) {\n return;\n }\n\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\n\nexport interface ArcProps extends Point {\n startAngle: number;\n endAngle: number;\n innerRadius: number;\n outerRadius: number;\n circumference: number;\n}\n\nexport default class ArcElement extends Element {\n\n static id = 'arc';\n\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true,\n };\n\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash'\n };\n\n circumference: number;\n endAngle: number;\n fullCircles: number;\n innerRadius: number;\n outerRadius: number;\n pixelMargin: number;\n startAngle: number;\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(chartX: number, chartY: number, useFinalPosition: boolean) {\n const point = this.getProps(['x', 'y'], useFinalPosition);\n const {angle, distance} = getAngleFromPoint(point, {x: chartX, y: chartY});\n const {startAngle, endAngle, innerRadius, outerRadius, circumference} = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n\n return (betweenAngles && withinRadius);\n }\n\n getCenterPoint(useFinalPosition: boolean) {\n const {x, y, startAngle, endAngle, innerRadius, outerRadius} = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ], useFinalPosition);\n const {offset, spacing} = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n\n tooltipPosition(useFinalPosition: boolean) {\n return this.getCenterPoint(useFinalPosition);\n }\n\n draw(ctx: CanvasRenderingContext2D) {\n const {options, circumference} = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = (options.borderAlign === 'inner') ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n\n ctx.save();\n\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n\n ctx.restore();\n }\n}\n","import Element from '../core/core.element.js';\nimport {_bezierInterpolation, _pointInLine, _steppedInterpolation} from '../helpers/helpers.interpolation.js';\nimport {_computeSegments, _boundSegments} from '../helpers/helpers.segment.js';\nimport {_steppedLineTo, _bezierCurveTo} from '../helpers/helpers.canvas.js';\nimport {_updateBezierControlPoints} from '../helpers/helpers.curve.js';\nimport {valueOrDefault} from '../helpers/index.js';\n\n/**\n * @typedef { import('./element.point.js').default } PointElement\n */\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\n\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @returns {any}\n */\nfunction getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n\n return lineTo;\n}\n\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const {start: paramsStart = 0, end: paramsEnd = count - 1} = params;\n const {start: segmentStart, end: segmentEnd} = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction pathSegment(ctx, line, segment, params) {\n const {points, options} = line;\n const {count, start, loop, ilen} = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n // eslint-disable-next-line prefer-const\n let {move = true, reverse} = params || {};\n let i, point, prev;\n\n for (i = 0; i <= ilen; ++i) {\n point = points[(start + (reverse ? ilen - i : i)) % count];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n prev = point;\n }\n\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n return !!loop;\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const {count, start, ilen} = pathVars(points, segment, params);\n const {move = true, reverse} = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n\n const pointIndex = (index) => (start + (reverse ? ilen - index : index)) % count;\n const drawX = () => {\n if (minY !== maxY) {\n // Draw line to maxY and minY, using the average x-coordinate\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n // Line to y-value of last point in group. So the line continues\n // from correct position. Not using move, to have solid path.\n ctx.lineTo(avgX, lastY);\n }\n };\n\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n\n for (i = 0; i <= ilen; ++i) {\n point = points[pointIndex(i)];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n }\n\n const x = point.x;\n const y = point.y;\n const truncX = x | 0; // truncated x-coordinate\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n // Draw line to next x-position, using the first (or only)\n // y-value in that group\n ctx.lineTo(x, y);\n\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n // Keep track of the last y-value in group\n lastY = y;\n }\n drawX();\n}\n\n/**\n * @param {LineElement} line - the line\n * @returns {function}\n * @private\n */\nfunction _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n\n/**\n * @private\n */\nfunction _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n\n return _pointInLine;\n}\n\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\n\nfunction strokePathDirect(ctx, line, start, count) {\n const {segments, options} = line;\n const segmentMethod = _getSegmentMethod(line);\n\n for (const segment of segments) {\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {start, end: start + count - 1})) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\n\nconst usePath2D = typeof Path2D === 'function';\n\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\n\nexport default class LineElement extends Element {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0,\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash' && name !== 'fill',\n };\n\n\n constructor(cfg) {\n super();\n\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n\n get points() {\n return this._points;\n }\n\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n\n /**\n\t * First non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n\n /**\n\t * Last non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n\n /**\n\t * Interpolate a point in this line at the same value on `property` as\n\t * the reference `point` provided\n\t * @param {PointElement} point - the reference point\n\t * @param {string} property - the property to match on\n\t * @returns {PointElement|undefined}\n\t */\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {property, start: value, end: value});\n\n if (!segments.length) {\n return;\n }\n\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for (i = 0, ilen = segments.length; i < ilen; ++i) {\n const {start, end} = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n\n /**\n\t * Append a segment of this line to current path.\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} segment\n\t * @param {number} segment.start - start index of the segment, referring the points array\n \t * @param {number} segment.end - end index of the segment, referring the points array\n \t * @param {boolean} segment.loop - indicates that the segment is a loop\n\t * @param {object} params\n\t * @param {boolean} params.move - move to starting point (vs line to it)\n\t * @param {boolean} params.reverse - path the segment from end to start\n\t * @param {number} params.start - limit segment to points starting from `start` index\n\t * @param {number} params.end - limit segment to points ending at `start` + `count` index\n\t * @returns {undefined|boolean} - true if the segment is a full loop (path should be closed)\n\t */\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n\n /**\n\t * Append all segments of this line to current path.\n\t * @param {CanvasRenderingContext2D|Path2D} ctx\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t * @returns {undefined|boolean} - true if line is a full loop (path should be closed)\n\t */\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n\n start = start || 0;\n count = count || (this.points.length - start);\n\n for (const segment of segments) {\n loop &= segmentMethod(ctx, this, segment, {start, end: start + count - 1});\n }\n return !!loop;\n }\n\n /**\n\t * Draw\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} chartArea\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t */\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n\n if (points.length && options.borderWidth) {\n ctx.save();\n\n draw(ctx, this, start, count);\n\n ctx.restore();\n }\n\n if (this.animated) {\n // When line is animated, the control points and path are not cached.\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n","import Element from '../core/core.element.js';\nimport {drawPoint, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport type {\n CartesianParsedData,\n ChartArea,\n Point,\n PointHoverOptions,\n PointOptions,\n} from '../types/index.js';\n\nfunction inRange(el: PointElement, pos: number, axis: 'x' | 'y', useFinalPosition?: boolean) {\n const options = el.options;\n const {[axis]: value} = el.getProps([axis], useFinalPosition);\n\n return (Math.abs(pos - value) < options.radius + options.hitRadius);\n}\n\nexport type PointProps = Point\n\nexport default class PointElement extends Element {\n\n static id = 'point';\n\n parsed: CartesianParsedData;\n skip?: boolean;\n stop?: boolean;\n\n /**\n * @type {any}\n */\n static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean) {\n const options = this.options;\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return ((Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2)) < Math.pow(options.hitRadius + options.radius, 2));\n }\n\n inXRange(mouseX: number, useFinalPosition?: boolean) {\n return inRange(this, mouseX, 'x', useFinalPosition);\n }\n\n inYRange(mouseY: number, useFinalPosition?: boolean) {\n return inRange(this, mouseY, 'y', useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition?: boolean) {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y};\n }\n\n size(options?: Partial) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n\n draw(ctx: CanvasRenderingContext2D, area: ChartArea) {\n const options = this.options;\n\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n","import Element from '../core/core.element.js';\nimport {isObject, _isBetween, _limitValue} from '../helpers/index.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {toTRBL, toTRBLCorners} from '../helpers/helpers.options.js';\n\n/** @typedef {{ x: number, y: number, base: number, horizontal: boolean, width: number, height: number }} BarProps */\n\n/**\n * Helper function to get the bounds of the bar regardless of the orientation\n * @param {BarElement} bar the bar\n * @param {boolean} [useFinalPosition]\n * @return {object} bounds of the bar\n * @private\n */\nfunction getBarBounds(bar, useFinalPosition) {\n const {x, y, base, width, height} = /** @type {BarProps} */ (bar.getProps(['x', 'y', 'base', 'width', 'height'], useFinalPosition));\n\n let left, right, top, bottom, half;\n\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n\n return {left, top, right, bottom};\n}\n\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\n\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\n\nfunction parseBorderRadius(bar, maxW, maxH) {\n const {enableBorderRadius} = bar.getProps(['enableBorderRadius']);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n\n // If the value is an object, assume the user knows what they are doing\n // and apply as directed.\n const enableBorder = enableBorderRadius || isObject(value);\n\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\n\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)),\n }\n }\n };\n}\n\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n\n return bounds\n\t\t&& (skipX || _isBetween(x, bounds.left, bounds.right))\n\t\t&& (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\n\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n\n/**\n * Add a path of a rectangle to the current sub-path\n * @param {CanvasRenderingContext2D} ctx Context\n * @param {*} rect Bounding rect\n */\nfunction addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\n\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\n\nexport default class BarElement extends Element {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n draw(ctx) {\n const {inflateAmount, options: {borderColor, backgroundColor}} = this;\n const {inner, outer} = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n\n ctx.save();\n\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n\n ctx.restore();\n }\n\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition) {\n const {x, y, base, horizontal} = /** @type {BarProps} */ (this.getProps(['x', 'y', 'base', 'horizontal'], useFinalPosition));\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n","import {DoughnutController, PolarAreaController} from '../index.js';\nimport type {Chart, ChartDataset} from '../types.js';\n\nexport interface ColorsPluginOptions {\n enabled?: boolean;\n forceOverride?: boolean;\n}\n\ninterface ColorsDescriptor {\n backgroundColor?: unknown;\n borderColor?: unknown;\n}\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)', // blue\n 'rgb(255, 99, 132)', // red\n 'rgb(255, 159, 64)', // orange\n 'rgb(255, 205, 86)', // yellow\n 'rgb(75, 192, 192)', // green\n 'rgb(153, 102, 255)', // purple\n 'rgb(201, 203, 207)' // grey\n];\n\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map(color => color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\n\nfunction getBorderColor(i: number) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\n\nfunction getBackgroundColor(i: number) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\n\nfunction colorizeDefaultDataset(dataset: ChartDataset, i: number) {\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n\n return ++i;\n}\n\nfunction colorizeDoughnutDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBorderColor(i++));\n\n return i;\n}\n\nfunction colorizePolarAreaDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBackgroundColor(i++));\n\n return i;\n}\n\nfunction getColorizer(chart: Chart) {\n let i = 0;\n\n return (dataset: ChartDataset, datasetIndex: number) => {\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n\n if (controller instanceof DoughnutController) {\n i = colorizeDoughnutDataset(dataset, i);\n } else if (controller instanceof PolarAreaController) {\n i = colorizePolarAreaDataset(dataset, i);\n } else if (controller) {\n i = colorizeDefaultDataset(dataset, i);\n }\n };\n}\n\nfunction containsColorsDefinitions(\n descriptors: ColorsDescriptor[] | Record\n) {\n let k: number | string;\n\n for (k in descriptors) {\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction containsColorsDefinition(\n descriptor: ColorsDescriptor\n) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\n\nexport default {\n id: 'colors',\n\n defaults: {\n enabled: true,\n forceOverride: false\n } as ColorsPluginOptions,\n\n beforeLayout(chart: Chart, _args, options: ColorsPluginOptions) {\n if (!options.enabled) {\n return;\n }\n\n const {\n data: {datasets},\n options: chartOptions\n } = chart.config;\n const {elements} = chartOptions;\n\n if (!options.forceOverride && (containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || (elements && containsColorsDefinitions(elements)))) {\n return;\n }\n\n const colorizer = getColorizer(chart);\n\n datasets.forEach(colorizer);\n }\n};\n","import {_limitValue, _lookupByKey, isNullOrUndef, resolve} from '../helpers/index.js';\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n /**\n * Implementation of the Largest Triangle Three Buckets algorithm.\n *\n * This implementation is based on the original implementation by Sveinn Steinarsson\n * in https://github.com/sveinn-steinarsson/flot-downsample/blob/master/jquery.flot.downsample.js\n *\n * The original implementation is MIT licensed.\n */\n const samples = options.samples || availableWidth;\n // There are less points than the threshold, returning the whole array\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n\n const decimated = [];\n\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n // Starting from offset\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n\n decimated[sampledIndex++] = data[a];\n\n for (i = 0; i < samples - 2; i++) {\n let avgX = 0;\n let avgY = 0;\n let j;\n\n // Adding offset\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n\n for (j = avgRangeStart; j < avgRangeEnd; j++) {\n avgX += data[j].x;\n avgY += data[j].y;\n }\n\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n\n // Adding offset\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const {x: pointAx, y: pointAy} = data[a];\n\n // Note that this is changed from the original algorithm which initializes these\n // values to 1. The reason for this change is that if the area is small, nextA\n // would never be set and thus a crash would occur in the next loop as `a` would become\n // `undefined`. Since the area is always positive, but could be 0 in the case of a flat trace,\n // initializing with a negative number is the correct solution.\n maxArea = area = -1;\n\n for (j = rangeOffs; j < rangeTo; j++) {\n area = 0.5 * Math.abs(\n (pointAx - avgX) * (data[j].y - pointAy) -\n (pointAx - data[j].x) * (avgY - pointAy)\n );\n\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n\n // Include the last point\n decimated[sampledIndex++] = data[endIndex];\n\n return decimated;\n}\n\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n\n for (i = start; i < start + count; ++i) {\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n // Use point.x here because we're computing the average data `x` value\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n // Push up to 4 points, 3 for the last interval and the first point for this interval\n const lastIndex = i - 1;\n\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n // The interval is defined by 4 points: start, min, max, end.\n // The starting point is already considered at this point, so we need to determine which\n // of the other points to add. We need to sort these points to ensure the decimated data\n // is still sorted and then ensure there are no duplicates.\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX,\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n\n // lastIndex === startIndex will occur when a range has only 1 point which could\n // happen with very uneven data\n if (i > 0 && lastIndex !== startIndex) {\n // Last point in the previous interval\n decimated.push(data[lastIndex]);\n }\n\n // Start of the new interval\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n\n return decimated;\n}\n\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data,\n });\n }\n}\n\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset) => {\n cleanDecimatedDataset(dataset);\n });\n}\n\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n\n let start = 0;\n let count;\n\n const {iScale} = meta;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n\n return {start, count};\n}\n\nexport default {\n id: 'decimation',\n\n defaults: {\n algorithm: 'min-max',\n enabled: false,\n },\n\n beforeElementsUpdate: (chart, args, options) => {\n if (!options.enabled) {\n // The decimation plugin may have been previously enabled. Need to remove old `dataset._data` handlers\n cleanDecimatedData(chart);\n return;\n }\n\n // Assume the entire chart is available to show a few more points than needed\n const availableWidth = chart.width;\n\n chart.data.datasets.forEach((dataset, datasetIndex) => {\n const {_data, indexAxis} = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n\n if (resolve([indexAxis, chart.options.indexAxis]) === 'y') {\n // Decimation is only supported for lines that have an X indexAxis\n return;\n }\n\n if (!meta.controller.supportsDecimation) {\n // Only line datasets are supported\n return;\n }\n\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n // Only linear interpolation is supported\n return;\n }\n\n if (chart.options.parsing) {\n // Plugin only supports data that does not need parsing\n return;\n }\n\n let {start, count} = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n // No decimation is required until we are above this threshold\n cleanDecimatedDataset(dataset);\n return;\n }\n\n if (isNullOrUndef(_data)) {\n // First time we are seeing this dataset\n // We override the 'data' property with a setter that stores the\n // raw data in _data, but reads the decimated data from _decimated\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n\n // Point the chart to the decimated data\n let decimated;\n switch (options.algorithm) {\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n\n dataset._decimated = decimated;\n });\n },\n\n destroy(chart) {\n cleanDecimatedData(chart);\n }\n};\n","import {_boundSegment, _boundSegments, _normalizeAngle} from '../../helpers/index.js';\n\nexport function _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n\n for (const segment of segments) {\n let {start, end} = segment;\n end = _findSegmentEnd(start, end, points);\n\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n\n if (!target.segments) {\n // Special case for boundary not supporting `segments` (simpleArc)\n // Bounds are provided as `target` for partial circle, or undefined for full circle\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n\n // Get all segments from `target` that intersect the bounds of current segment of `line`\n const targetSegments = _boundSegments(target, bounds);\n\n for (const tgt of targetSegments) {\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n\n for (const fillSource of fillSources) {\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\n\nexport function _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {property, start, end};\n}\n\nexport function _pointsFromSegments(boundary, line) {\n const {x = null, y = null} = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({start, end}) => {\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({x: first.x, y});\n points.push({x: last.x, y});\n } else if (x !== null) {\n points.push({x, y: first.y});\n points.push({x, y: last.y});\n }\n });\n return points;\n}\n\nexport function _findSegmentEnd(start, end, points) {\n for (;end > start; end--) {\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\n\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {isArray} from '../../helpers/index.js';\nimport {_pointsFromSegments} from './filler.segment.js';\n\n/**\n * @param {PointElement[] | { x: number; y: number; }} boundary\n * @param {LineElement} line\n * @return {LineElement?}\n */\nexport function _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n\n if (isArray(boundary)) {\n _loop = true;\n // @ts-ignore\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n\n return points.length ? new LineElement({\n points,\n options: {tension: 0},\n _loop,\n _fullLoop: _loop\n }) : null;\n}\n\nexport function _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n","import {isObject, isFinite, valueOrDefault} from '../../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.line.js').default } LineElement\n * @typedef { import('../../types/index.js').FillTarget } FillTarget\n * @typedef { import('../../types/index.js').ComplexFillTarget } ComplexFillTarget\n */\n\nexport function _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [index];\n let target;\n\n if (!propagate) {\n return fill;\n }\n\n while (fill !== false && visited.indexOf(fill) === -1) {\n if (!isFinite(fill)) {\n return fill;\n }\n\n target = sources[fill];\n if (!target) {\n return false;\n }\n\n if (target.visible) {\n return fill;\n }\n\n visited.push(fill);\n fill = target.fill;\n }\n\n return false;\n}\n\n/**\n * @param {LineElement} line\n * @param {number} index\n * @param {number} count\n */\nexport function _decodeFill(line, index, count) {\n /** @type {string | {value: number}} */\n const fill = parseFillOption(line);\n\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n\n let target = parseFloat(fill);\n\n if (isFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n\n return ['origin', 'start', 'end', 'stack', 'shape'].indexOf(fill) >= 0 && fill;\n}\n\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n\n return target;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @returns {number | null}\n */\nexport function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n // @ts-ignore\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @param {number} startValue\n * @returns {number | undefined}\n */\nexport function _getTargetValue(fill, scale, startValue) {\n let value;\n\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n // @ts-ignore\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n\n/**\n * @param {LineElement} line\n */\nfunction parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n\n if (fill === false || fill === null) {\n return false;\n }\n\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {_isBetween} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\n\n/**\n * @param {{ chart: Chart; scale: Scale; index: number; line: LineElement; }} source\n * @return {LineElement}\n */\nexport function _buildStackLine(source) {\n const {scale, index, line} = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({x: null, y: scale.bottom}, line));\n\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n for (let j = segment.start; j <= segment.end; j++) {\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({points, options: {}});\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @return {LineElement[]}\n */\nfunction getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n\n for (let i = 0; i < metas.length; i++) {\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n\n/**\n * @param {PointElement[]} points\n * @param {PointElement} sourcePoint\n * @param {LineElement[]} linesBelow\n */\nfunction addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for (let j = 0; j < linesBelow.length; j++) {\n const line = linesBelow[j];\n const {first, last, point} = findPoint(line, sourcePoint, 'x');\n\n if (!point || (first && last)) {\n continue;\n }\n if (first) {\n // First point of an segment -> need to add another point before this,\n // from next line below.\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n // In the middle of an segment, no need to add more points.\n break;\n }\n }\n }\n points.push(...postponed);\n}\n\n/**\n * @param {LineElement} line\n * @param {PointElement} sourcePoint\n * @param {string} property\n * @returns {{point?: PointElement, first?: boolean, last?: boolean}}\n */\nfunction findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {first, last, point};\n}\n","import {TAU} from '../../helpers/index.js';\n\n// TODO: use elements.ArcElement instead\nexport class simpleArc {\n constructor(opts) {\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n\n pathSegment(ctx, bounds, opts) {\n const {x, y, radius} = this;\n bounds = bounds || {start: 0, end: TAU};\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n\n interpolate(point) {\n const {x, y, radius} = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n","import {isFinite} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\nimport {_getTargetPixel, _getTargetValue} from './filler.options.js';\nimport {_buildStackLine} from './filler.target.stack.js';\nimport {simpleArc} from './simpleArc.js';\n\n/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nexport function _getTarget(source) {\n const {chart, fill, line} = source;\n\n if (isFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n\n if (fill === 'shape') {\n return true;\n }\n\n const boundary = computeBoundary(source);\n\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n\n return _createBoundaryLine(boundary, line);\n}\n\n/**\n * @param {Chart} chart\n * @param {number} index\n */\nfunction getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\n\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\n\n\nfunction computeLinearBoundary(source) {\n const {scale = {}, fill} = source;\n const pixel = _getTargetPixel(fill, scale);\n\n if (isFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n\n return null;\n}\n\nfunction computeCircularBoundary(source) {\n const {scale, fill} = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n\n for (let i = 0; i < length; ++i) {\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\n","import {clipArea, unclipArea} from '../../helpers/index.js';\nimport {_findSegmentEnd, _getBounds, _segments} from './filler.segment.js';\nimport {_getTarget} from './filler.target.js';\n\nexport function _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const {line, scale, axis} = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const {above = color, below = color} = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {line, target, above, below, area, scale, axis});\n unclipArea(ctx);\n }\n}\n\nfunction doFill(ctx, cfg) {\n const {line, target, above, below, area, scale} = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n\n ctx.save();\n\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {line, target, color: above, scale, property});\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {line, target, color: below, scale, property});\n\n ctx.restore();\n}\n\nfunction clipVertical(ctx, target, clipY) {\n const {segments, points} = target;\n let first = true;\n let lineLoop = false;\n\n ctx.beginPath();\n for (const segment of segments) {\n const {start, end} = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {move: lineLoop});\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\n\nfunction fill(ctx, cfg) {\n const {line, target, property, color, scale} = cfg;\n const segments = _segments(line, target, property);\n\n for (const {source: src, target: tgt, start, end} of segments) {\n const {style: {backgroundColor = color} = {}} = src;\n const notShape = target !== true;\n\n ctx.save();\n ctx.fillStyle = backgroundColor;\n\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n\n ctx.beginPath();\n\n const lineLoop = !!line.pathSegment(ctx, src);\n\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n\n const targetLoop = !!target.pathSegment(ctx, tgt, {move: lineLoop, reverse: true});\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n\n ctx.restore();\n }\n}\n\nfunction clipBounds(ctx, scale, bounds) {\n const {top, bottom} = scale.chart.chartArea;\n const {property, start, end} = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\n\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\n","/**\n * Plugin based on discussion from the following Chart.js issues:\n * @see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569\n * @see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897\n */\n\nimport LineElement from '../../elements/element.line.js';\nimport {_drawfill} from './filler.drawing.js';\nimport {_shouldApplyFill} from './filler.helper.js';\nimport {_decodeFill, _resolveTarget} from './filler.options.js';\n\nexport default {\n id: 'filler',\n\n afterDatasetsUpdate(chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n\n for (i = 0; i < count; ++i) {\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line,\n };\n }\n\n meta.$filler = source;\n sources.push(source);\n }\n\n for (i = 0; i < count; ++i) {\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n\n beforeDraw(chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n\n beforeDatasetsDraw(chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n\n const metasets = chart.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n\n beforeDatasetDraw(chart, args, options) {\n const source = args.meta.$filler;\n\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n","import defaults from '../core/core.defaults.js';\nimport Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {addRoundedRectPath, drawPointLegend, renderText} from '../helpers/helpers.canvas.js';\nimport {\n _isBetween,\n callback as call,\n clipArea,\n getRtlAdapter,\n overrideTextDirection,\n restoreTextDirection,\n toFont,\n toPadding,\n unclipArea,\n valueOrDefault,\n} from '../helpers/index.js';\nimport {_alignStartEnd, _textX, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {toTRBLCorners} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n */\n\nconst getBoxSize = (labelOpts, fontSize) => {\n let {boxHeight = fontSize, boxWidth = fontSize} = labelOpts;\n\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\n\nconst itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\n\nexport class Legend extends Element {\n\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this._added = false;\n\n // Contains hit boxes for each dataset (in dataset order)\n this.legendHitBoxes = [];\n\n /**\n \t\t * @private\n \t\t */\n this._hoveredItem = null;\n\n // Are we in doughnut mode which has a different data type\n this.doughnutMode = false;\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = call(labelOpts.generateLabels, [this.chart], this) || [];\n\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));\n }\n\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, this.chart.data));\n }\n\n if (this.options.reverse) {\n legendItems.reverse();\n }\n\n this.legendItems = legendItems;\n }\n\n fit() {\n const {options, ctx} = this;\n\n // The legend may not be displayed for a variety of reasons including\n // the fact that the defaults got set to `false`.\n // When the legend is not displayed, there are no guarantees that the options\n // are correctly formatted so we need to bail out as early as possible.\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const {boxWidth, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n let width, height;\n\n ctx.font = labelFont.string;\n\n if (this.isHorizontal()) {\n width = this.maxWidth; // fill all the width\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight; // fill all the height\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n\n /**\n\t * @private\n\t */\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const {ctx, maxWidth, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one\n const lineWidths = this.lineWidths = [0];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i) => {\n const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n\n hitboxes[i] = {left: 0, top, row, width: itemWidth, height: itemHeight};\n\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n\n return totalHeight;\n }\n\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const {ctx, maxHeight, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n\n let left = 0;\n let col = 0;\n\n this.legendItems.forEach((legendItem, i) => {\n const {itemWidth, itemHeight} = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n\n // If too tall, go to new column\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n\n // Store the hitbox width and height here. Final position will be updated in `draw`\n hitboxes[i] = {left, top: currentColHeight, col, width: itemWidth, height: itemHeight};\n\n // Get max width\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n\n totalWidth += currentColWidth;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n\n return totalWidth;\n }\n\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const {legendHitBoxes: hitboxes, options: {align, labels: {padding}, rtl}} = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes) {\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes) {\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n\n this._draw();\n\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @private\n\t */\n _draw() {\n const {options: opts, columnSizes, lineWidths, ctx} = this;\n const {align, labels: labelOpts} = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const {padding} = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n\n this.drawTitle();\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n\n const {boxWidth, boxHeight, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n // current position\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n\n // Set the ctx for the box\n ctx.save();\n\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n\n if (labelOpts.usePointStyle) {\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n\n // Draw pointStyle as legend symbol\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n // Draw box as legend symbol\n // Adjust position when boxHeight < fontSize (want it centered)\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n\n ctx.beginPath();\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n\n ctx.restore();\n };\n\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + (itemHeight / 2), labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n\n // Horizontal\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n\n overrideTextDirection(this.ctx, opts.textDirection);\n\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i) => {\n ctx.strokeStyle = legendItem.fontColor; // for strikethrough effect\n ctx.fillStyle = legendItem.fontColor; // render in correct colour\n\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n\n rtlHelper.setWidth(this.width);\n\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n\n const realX = rtlHelper.x(x);\n\n drawLegendBox(realX, y, legendItem);\n\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n\n // Fill the actual label\n fillText(rtlHelper.x(x), y, legendItem);\n\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n\n if (!titleOpts.display) {\n return;\n }\n\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n\n // These defaults are used when the legend is vertical.\n // When horizontal, they are computed below.\n let left = this.left;\n let maxWidth = this.width;\n\n if (this.isHorizontal()) {\n // Move left / right so that the title is above the legend lines\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n // Move down so that the title is above the legend stack in every alignment\n const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n\n // Now that we know the left edge of the inner legend box, compute the correct\n // X coordinate from the title alignment\n const x = _alignStartEnd(position, left, left + maxWidth);\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n\n /**\n\t * @private\n\t */\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n\n /**\n\t * @private\n\t */\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n\n if (_isBetween(x, this.left, this.right)\n && _isBetween(y, this.top, this.bottom)) {\n // See if we are touching one of the dataset boxes\n lh = this.legendHitBoxes;\n for (i = 0; i < lh.length; ++i) {\n hitBox = lh[i];\n\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width)\n && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n // Touching an element\n return this.legendItems[i];\n }\n }\n }\n\n return null;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t */\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n\n // Chart event already has relative position in it\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n call(opts.onLeave, [e, previous, this], this);\n }\n\n this._hoveredItem = hoveredItem;\n\n if (hoveredItem && !sameItem) {\n call(opts.onHover, [e, hoveredItem, this], this);\n }\n } else if (hoveredItem) {\n call(opts.onClick, [e, hoveredItem, this], this);\n }\n }\n}\n\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {itemWidth, itemHeight};\n}\n\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b) => a.length > b.length ? a : b);\n }\n return boxWidth + (labelFont.size / 2) + ctx.measureText(legendItemText).width;\n}\n\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\n\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\n\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\n\nexport default {\n id: 'legend',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Legend,\n\n start(chart, _args, options) {\n const legend = chart.legend = new Legend({ctx: chart.ctx, options, chart});\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n\n stop(chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n\n // During the beforeUpdate step, the layout configuration needs to run\n // This ensures that if the legend position changes (via an option update)\n // the layout system respects the change. See https://github.com/chartjs/Chart.js/issues/7527\n beforeUpdate(chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n\n // The labels need to be built after datasets are updated to ensure that colors\n // and other styling are correct. See https://github.com/chartjs/Chart.js/issues/6968\n afterUpdate(chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n\n\n afterEvent(chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n\n // a callback that will handle\n onClick(e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n\n onHover: null,\n onLeave: null,\n\n labels: {\n color: (ctx) => ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n // Generates labels shown in the legend\n // Valid properties to return:\n // text : text to display\n // fillStyle : fill of coloured box\n // strokeStyle: stroke of coloured box\n // hidden : if this legend item refers to a hidden item\n // lineCap : cap style for line\n // lineDash\n // lineDashOffset :\n // lineJoin :\n // lineWidth :\n generateLabels(chart) {\n const datasets = chart.data.datasets;\n const {labels: {usePointStyle, pointStyle, textAlign, color, useBorderRadius, borderRadius}} = chart.legend.options;\n\n return chart._getSortedDatasetMetas().map((meta) => {\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n\n // Below is extra data used for toggling the datasets\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n\n title: {\n color: (ctx) => ctx.chart.options.color,\n display: false,\n position: 'center',\n text: '',\n }\n },\n\n descriptors: {\n _scriptable: (name) => !name.startsWith('on'),\n labels: {\n _scriptable: (name) => !['generateLabels', 'filter', 'sort'].includes(name),\n }\n },\n};\n","import Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {PI, isArray, toPadding, toFont} from '../helpers/index.js';\nimport {_toLeftRightCenter, _alignStartEnd} from '../helpers/helpers.extras.js';\nimport {renderText} from '../helpers/helpers.canvas.js';\n\nexport class Title extends Element {\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight) {\n const opts = this.options;\n\n this.left = 0;\n this.top = 0;\n\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n\n _drawArgs(offset) {\n const {top, left, bottom, right, options} = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {titleX, titleY, maxWidth, rotation};\n }\n\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n\n if (!opts.display) {\n return;\n }\n\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const {titleX, titleY, maxWidth, rotation} = this._drawArgs(offset);\n\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n}\n\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\n\nexport default {\n id: 'title',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Title,\n\n start(chart, _args, options) {\n createTitle(chart, options);\n },\n\n stop(chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n\n beforeUpdate(chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold',\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000 // by default greater than legend (1000) to be above\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import {Title} from './plugin.title.js';\nimport layouts from '../core/core.layouts.js';\n\nconst map = new WeakMap();\n\nexport default {\n id: 'subtitle',\n\n start(chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n\n stop(chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n\n beforeUpdate(chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal',\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500 // by default greater than legend (1000) and smaller than title (2000)\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import Animations from '../core/core.animations.js';\nimport Element from '../core/core.element.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {each, noop, isNullOrUndef, isArray, _elementsEqual, isObject} from '../helpers/helpers.core.js';\nimport {toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\nimport {getRtlAdapter, overrideTextDirection, restoreTextDirection} from '../helpers/helpers.rtl.js';\nimport {distanceBetweenPoints, _limitValue} from '../helpers/helpers.math.js';\nimport {createContext, drawPoint} from '../helpers/index.js';\n\n/**\n * @typedef { import('../platform/platform.base.js').Chart } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').ActiveElement } ActiveElement\n * @typedef { import('../core/core.interaction.js').InteractionItem } InteractionItem\n */\n\nconst positioners = {\n /**\n\t * Average mode places the tooltip at the average position of the elements shown\n\t */\n average(items) {\n if (!items.length) {\n return false;\n }\n\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n\n return {\n x: x / count,\n y: y / count\n };\n },\n\n /**\n\t * Gets the tooltip position nearest of the item nearest to the event position\n\t */\n nearest(items, eventPosition) {\n if (!items.length) {\n return false;\n }\n\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n\n return {\n x,\n y\n };\n }\n};\n\n// Helper to push or concat based on if the 2nd parameter is an array or not\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n}\n\n/**\n * Returns array of strings split by newline\n * @param {*} str - The value to split by newline.\n * @returns {string|string[]} value if newline present - Returned from String split() method\n * @function\n */\nfunction splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n\n\n/**\n * Private helper to create a tooltip item model\n * @param {Chart} chart\n * @param {ActiveElement} item - {element, index, datasetIndex} to create the tooltip item for\n * @return new tooltip item\n */\nfunction createTooltipItem(chart, item) {\n const {element, datasetIndex, index} = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const {label, value} = controller.getLabelAndValue(index);\n\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n\n/**\n * Get the size of the tooltip\n */\nfunction getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const {body, footer, title} = tooltip;\n const {boxWidth, boxHeight} = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n\n // Count of all lines in the body\n let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight\n\t\t\t+ (titleLineCount - 1) * options.titleSpacing\n\t\t\t+ options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n // Body lines may include some extra height depending on boxHeight\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight\n\t\t\t+ (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight\n\t\t\t+ (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop\n\t\t\t+ footerLineCount * footerFont.lineHeight\n\t\t\t+ (footerLineCount - 1) * options.footerSpacing;\n }\n\n // Title width\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n\n ctx.save();\n\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n\n // Body width\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n\n // Body lines may include some extra width due to the color box\n widthPadding = options.displayColors ? (boxWidth + 2 + options.boxPadding) : 0;\n each(body, (bodyItem) => {\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n\n // Reset back to 0\n widthPadding = 0;\n\n // Footer width\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n\n ctx.restore();\n\n // Add padding\n width += padding.width;\n\n return {width, height};\n}\n\nfunction determineYAlign(chart, size) {\n const {y, height} = size;\n\n if (y < height / 2) {\n return 'top';\n } else if (y > (chart.height - height / 2)) {\n return 'bottom';\n }\n return 'center';\n}\n\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const {x, width} = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\n\nfunction determineXAlign(chart, options, size, yAlign) {\n const {x, width} = size;\n const {width: chartWidth, chartArea: {left, right}} = chart;\n let xAlign = 'center';\n\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n\n return xAlign;\n}\n\n/**\n * Helper to get the alignment of a tooltip given the size\n */\nfunction determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\n\nfunction alignX(size, xAlign) {\n let {x, width} = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= (width / 2);\n }\n return x;\n}\n\nfunction alignY(size, yAlign, paddingAndSize) {\n // eslint-disable-next-line prefer-const\n let {y, height} = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= (height / 2);\n }\n return y;\n}\n\n/**\n * Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment\n */\nfunction getBackgroundPoint(options, size, alignment, chart) {\n const {caretSize, caretPadding, cornerRadius} = options;\n const {xAlign, yAlign} = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\n\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n\n return align === 'center'\n ? tooltip.x + tooltip.width / 2\n : align === 'right'\n ? tooltip.x + tooltip.width - padding.right\n : tooltip.x + padding.left;\n}\n\n/**\n * Helper to build before and after body lines\n */\nfunction getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\n\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\n\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\n\nconst defaultCallbacks = {\n // Args are: (tooltipItems, data)\n beforeTitle: noop,\n title(tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n\n return '';\n },\n afterTitle: noop,\n\n // Args are: (tooltipItems, data)\n beforeBody: noop,\n\n // Args are: (tooltipItem, data)\n beforeLabel: noop,\n label(tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n\n let label = tooltipItem.dataset.label || '';\n\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0,\n };\n },\n labelTextColor() {\n return this.options.bodyColor;\n },\n labelPointStyle(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation,\n };\n },\n afterLabel: noop,\n\n // Args are: (tooltipItems, data)\n afterBody: noop,\n\n // Args are: (tooltipItems, data)\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n\n/**\n * Invoke callback from object with context and arguments.\n * If callback returns `undefined`, then will be invoked default callback.\n * @param {Record} callbacks\n * @param {keyof typeof defaultCallbacks} name\n * @param {*} ctx\n * @param {*} arg\n * @returns {any}\n */\nfunction invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n\n return result;\n}\n\nexport class Tooltip extends Element {\n\n /**\n * @namespace Chart.Tooltip.positioners\n */\n static positioners = positioners;\n\n constructor(config) {\n super();\n\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n // TODO: V4, make this private, rename to `_labelStyles`, and combine with `labelPointStyles`\n // and `labelTextColors` to create a single variable\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n\n /**\n\t * @private\n\t */\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n\n if (cached) {\n return cached;\n }\n\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n\n return animations;\n }\n\n /**\n\t * @protected\n\t */\n getContext() {\n return this.$context ||\n\t\t\t(this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n\n getTitle(context, options) {\n const {callbacks} = options;\n\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n\n return lines;\n }\n\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems)\n );\n }\n\n getBody(tooltipItems, options) {\n const {callbacks} = options;\n const bodyItems = [];\n\n each(tooltipItems, (context) => {\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n\n bodyItems.push(bodyItem);\n });\n\n return bodyItems;\n }\n\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems)\n );\n }\n\n // Get the footer and beforeFooter and afterFooter lines\n getFooter(tooltipItems, options) {\n const {callbacks} = options;\n\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n\n return lines;\n }\n\n /**\n\t * @private\n\t */\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n\n for (i = 0, len = active.length; i < len; ++i) {\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n\n // If the user provided a filter function, use it to modify the tooltip items\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array) => options.filter(element, index, array, data));\n }\n\n // If the user provided a sorting function, use it to modify the tooltip items\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b) => options.itemSort(a, b, data));\n }\n\n // Determine colors for boxes\n each(tooltipItems, (context) => {\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n\n if (changed && options.external) {\n options.external.call(this, {chart: this.chart, tooltip: this, replay});\n }\n }\n\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n\n getCaretPosition(tooltipPoint, size, options) {\n const {xAlign, yAlign} = this;\n const {caretSize, cornerRadius} = options;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n const {x: ptX, y: ptY} = tooltipPoint;\n const {width, height} = size;\n let x1, x2, x3, y1, y2, y3;\n\n if (yAlign === 'center') {\n y2 = ptY + (height / 2);\n\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n\n // Left draws bottom -> top, this y1 is on the bottom\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n\n // Right draws top -> bottom, thus y1 is on the top\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + (caretSize);\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n\n // Top draws left -> right, thus x1 is on the left\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n\n // Bottom draws right -> left, thus x1 is on the right\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {x1, x2, x3, y1, y2, y3};\n }\n\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.titleAlign, options);\n\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing; // Line Height and spacing\n\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing\n }\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const {boxHeight, boxWidth} = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2, // fit the circle in the box\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n\n // Fill the point with white so that colours merge nicely if the opacity is < 1\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n\n // Draw the point\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n // Border\n ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : (labelColor.borderWidth || 1); // TODO, v4 remove fallback\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n\n // Fill a white rect so that colours merge nicely if the opacity is < 1\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = toTRBLCorners(labelColor.borderRadius);\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n ctx.fill();\n ctx.stroke();\n\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n // Normal rect\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n\n // restore fillStyle\n ctx.fillStyle = this.labelTextColors[i];\n }\n\n drawBody(pt, ctx, options) {\n const {body} = this;\n const {bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding} = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n\n // Before body lines\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right'\n ? bodyAlign === 'center' ? (boxWidth / 2 + boxPadding) : (boxWidth + 2 + boxPadding)\n : 0;\n\n // Draw body lines now\n for (i = 0, ilen = body.length; i < ilen; ++i) {\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n\n lines = bodyItem.lines;\n // Draw Legend-like boxes if needed\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n\n for (j = 0, jlen = lines.length; j < jlen; ++j) {\n fillLineOfText(lines[j]);\n // Reset for any lines that don't include colorbox\n bodyLineHeight = bodyFont.lineHeight;\n }\n\n each(bodyItem.after, fillLineOfText);\n }\n\n // Reset back to 0 for after body\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n\n // After body lines\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing; // Remove last body spacing\n }\n\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n\n footerFont = toFont(options.footerFont);\n\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n\n drawBackground(pt, ctx, tooltipSize, options) {\n const {xAlign, yAlign} = this;\n const {x, y} = pt;\n const {width, height} = tooltipSize;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(options.cornerRadius);\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n\n ctx.fill();\n\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n\n /**\n\t * Update x/y animation targets when _active elements are animating too\n\t * @private\n\t */\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n\n /**\n * Determine if the tooltip will draw anything\n * @returns {boolean} True if the tooltip will render\n */\n _willRender() {\n return !!this.opacity;\n }\n\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n\n if (!opacity) {\n return;\n }\n\n this._updateAnimationTarget(options);\n\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n\n // IE11/Edge does not like very small opacities, so snap to 0\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n\n const padding = toPadding(options.padding);\n\n // Truthy/falsey value for empty tooltip\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n\n // Draw Background\n this.drawBackground(pt, ctx, tooltipSize, options);\n\n overrideTextDirection(ctx, options.textDirection);\n\n pt.y += padding.top;\n\n // Titles\n this.drawTitle(pt, ctx, options);\n\n // Body\n this.drawBody(pt, ctx, options);\n\n // Footer\n this.drawFooter(pt, ctx, options);\n\n restoreTextDirection(ctx, options.textDirection);\n\n ctx.restore();\n }\n }\n\n /**\n\t * Get active elements in the tooltip\n\t * @returns {Array} Array of elements that are active in the tooltip\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active elements in the tooltip\n\t * @param {array} activeElements Array of active datasetIndex/index pairs.\n\t * @param {object} eventPosition Synthetic event position used in positioning\n\t */\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.chart.getDatasetMeta(datasetIndex);\n\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {boolean} true if the tooltip changed\n\t */\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n\n // When there are multiple items shown, but the tooltip position is nearest mode\n // an update may need to be made because our position may have changed even though\n // the items are the same as before.\n const positionChanged = this._positionChanged(active, e);\n\n // Remember Last Actives\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n\n // Only handle target event on tooltip change\n if (changed) {\n this._active = active;\n\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n\n this.update(true, replay);\n }\n }\n\n return changed;\n }\n\n /**\n\t * Helper for determining the active elements for event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {InteractionItem[]} lastActive - Previously active elements\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {InteractionItem[]} - Active elements\n\t * @private\n\t */\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n return lastActive;\n }\n\n // Find Active Elements for tooltips\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n\n if (options.reverse) {\n active.reverse();\n }\n\n return active;\n }\n\n /**\n\t * Determine if the active elements + event combination changes the\n\t * tooltip position\n\t * @param {array} active - Active elements\n\t * @param {ChartEvent} e - Event that triggered the position change\n\t * @returns {boolean} True if the position has changed\n\t */\n _positionChanged(active, e) {\n const {caretX, caretY, options} = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\n\nexport default {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n\n afterInit(chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({chart, options});\n }\n },\n\n beforeUpdate(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n reset(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n afterDraw(chart) {\n const tooltip = chart.tooltip;\n\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n\n if (chart.notifyPlugins('beforeTooltipDraw', {...args, cancelable: true}) === false) {\n return;\n }\n\n tooltip.draw(chart.ctx);\n\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n\n afterEvent(chart, args) {\n if (chart.tooltip) {\n // If the event is replayed from `update`, we should evaluate with the final positions.\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n // notify chart about the change, so it will render\n args.changed = true;\n }\n }\n },\n\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold',\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {\n },\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold',\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts) => opts.bodyFont.size,\n boxWidth: (ctx, opts) => opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart',\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'width', 'height', 'caretX', 'caretY'],\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n\n descriptors: {\n _scriptable: (name) => name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false,\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n\n // Resolve additionally from `interaction` options and defaults.\n additionalOptionScopes: ['interaction']\n};\n","import Scale from '../core/core.scale.js';\nimport {isNullOrUndef, valueOrDefault, _limitValue} from '../helpers/index.js';\n\nconst addIfString = (labels, raw, index, addedLabels) => {\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({index, label: raw});\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\n\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\n\nconst validIndex = (index, max) => index === null ? null : _limitValue(Math.round(index), 0, max);\n\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\n\nexport default class CategoryScale extends Scale {\n\n static id = 'category';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const {index, label} of added) {\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index\n : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n\n determineDataLimits() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this.getMinMax(true);\n\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n\n // If we are viewing some subset of labels, slice the original array\n labels = (min === 0 && max === labels.length - 1) ? labels : labels.slice(min, max + 1);\n\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n\n for (let value = min; value <= max; value++) {\n ticks.push({value});\n }\n return ticks;\n }\n\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n super.configure();\n\n if (!this.isHorizontal()) {\n // For backward compatibility, vertical category scale reverse is inverted.\n this._reversePixels = !this._reversePixels;\n }\n }\n\n // Used to get data value locations. Value can either be an index or a numerical value\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n // Must override base implementation because it calls getPixelForValue\n // and category scale can have duplicate values\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n\n getBasePixel() {\n return this.bottom;\n }\n}\n","import {isNullOrUndef} from '../helpers/helpers.core.js';\nimport {almostEquals, almostWhole, niceNum, _decimalPlaces, _setMinAndMaxByKey, sign, toRadians} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\n\n/**\n * Generate a set of linear ticks for an axis\n * 1. If generationOptions.min, generationOptions.max, and generationOptions.step are defined:\n * if (max - min) / step is an integer, ticks are generated as [min, min + step, ..., max]\n * Note that the generationOptions.maxCount setting is respected in this scenario\n *\n * 2. If generationOptions.min, generationOptions.max, and generationOptions.count is defined\n * spacing = (max - min) / count\n * Ticks are generated as [min, min + spacing, ..., max]\n *\n * 3. If generationOptions.count is defined\n * spacing = (niceMax - niceMin) / count\n *\n * 4. Compute optimal spacing of ticks using niceNum algorithm\n *\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, dataRange) {\n const ticks = [];\n // To get a \"nice\" value for the tick spacing, we will use the appropriately named\n // \"nice number\" algorithm. See https://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks\n // for details.\n\n const MIN_SPACING = 1e-14;\n const {bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds} = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const {min: rmin, max: rmax} = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n\n // Beyond MIN_SPACING floating point numbers being to lose precision\n // such that we can't do the math necessary to generate ticks\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [{value: rmin}, {value: rmax}];\n }\n\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n // If the calculated num of spaces exceeds maxNumSpaces, recalculate it\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n\n if (!isNullOrUndef(precision)) {\n // If the user specified a precision, round to that number of decimal places\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n // Case 1: If min, max and stepSize are set and they make an evenly spaced scale use it.\n // spacing = step;\n // numSpaces = (max - min) / spacing;\n // Note that we round here to handle the case where almostWhole translated an FP error\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n // Cases 2 & 3, we have a count specified. Handle optional user defined edges to the range.\n // Sometimes these are no-ops, but it makes the code a lot clearer\n // and when a user defined range is specified, we want the correct ticks\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n // Case 4\n numSpaces = (niceMax - niceMin) / spacing;\n\n // If very close to our rounded value, use it.\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n\n // The spacing will have changed in cases 1, 2, and 3 so the factor cannot be computed\n // until this point\n const decimalPlaces = Math.max(\n _decimalPlaces(spacing),\n _decimalPlaces(niceMin)\n );\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({value: min});\n\n if (niceMin < min) {\n j++; // Skip niceMin\n }\n // If the next nice tick is close to min, skip it\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n\n for (; j < numSpaces; ++j) {\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) {\n break;\n }\n ticks.push({value: tickValue});\n }\n\n if (maxDefined && includeBounds && niceMax !== max) {\n // If the previous tick is too close to max, replace it with max, else add max\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({value: max});\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({value: niceMax});\n }\n\n return ticks;\n}\n\nfunction relativeLabelSize(value, minSpacing, {horizontal, minRotation}) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\n\nexport default class LinearScaleBase extends Scale {\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n /** @type {number} */\n this._endValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n\n return +raw;\n }\n\n handleTickRangeOptions() {\n const {beginAtZero} = this.options;\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n\n setMax(max + offset);\n\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n\n getTickLimit() {\n const tickOpts = this.options.ticks;\n // eslint-disable-next-line prefer-const\n let {maxTicksLimit, stepSize} = tickOpts;\n let maxTicks;\n\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n\n return maxTicks;\n }\n\n /**\n\t * @protected\n\t */\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n // Figure out what the max number of ticks we can support it is based on the size of\n // the axis area. For now, we say that the minimum tick spacing in pixels must be 40\n // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n // the graph. Make sure we always have at least 2 ticks\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks(numericGeneratorOptions, dataRange);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n\n super.configure();\n\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n","import {isFinite} from '../helpers/helpers.core.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {toRadians} from '../helpers/index.js';\n\nexport default class LinearScale extends LinearScaleBase {\n\n static id = 'linear';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? min : 0;\n this.max = isFinite(max) ? max : 1;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n \t */\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n\n // Utils\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n","import {finiteOrDefault, isFinite} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {_setMinAndMaxByKey, log10} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\n\nconst log10Floor = v => Math.floor(log10(v));\nconst changeExponent = (v, m) => Math.pow(10, log10Floor(v) + m);\n\nfunction isMajor(tickVal) {\n const remain = tickVal / (Math.pow(10, log10Floor(tickVal)));\n return remain === 1;\n}\n\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\n\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while (steps(min, max, rangeExp) > 10) {\n rangeExp++;\n }\n while (steps(min, max, rangeExp) < 10) {\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n\n\n/**\n * Generate a set of logarithmic ticks\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, {min, max}) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while (value < max) {\n ticks.push({value, major: isMajor(value), significand});\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({value: lastTick, major: isMajor(lastTick), significand});\n\n return ticks;\n}\n\nexport default class LogarithmicScale extends Scale {\n\n static id = 'logarithmic';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [raw, index]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isFinite(value) && value > 0 ? value : null;\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? Math.max(0, min) : null;\n this.max = isFinite(max) ? Math.max(0, max) : null;\n\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n\n // if data has `0` in it or `beginAtZero` is true, min (non zero) value is at bottom\n // of scale, and it does not equal suggestedMin, lower the min bound by one exp.\n if (this._zero && this.min !== this._suggestedMin && !isFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n\n this.handleTickRangeOptions();\n }\n\n handleTickRangeOptions() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (min === max) {\n if (min <= 0) { // includes null\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n\n setMax(changeExponent(min, +1));\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const opts = this.options;\n\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value === undefined\n ? '0'\n : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const start = this.min;\n\n super.configure();\n\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min\n ? 0\n : (log10(value) - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n","import defaults from '../core/core.defaults.js';\nimport {_longestText, addRoundedRectPath, renderText, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport {HALF_PI, TAU, toDegrees, toRadians, _normalizeAngle, PI} from '../helpers/helpers.math.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {valueOrDefault, isArray, isFinite, callback as callCallback, isNullOrUndef} from '../helpers/helpers.core.js';\nimport {createContext, toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\n\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [label];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\n\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - (size / 2),\n end: pos + (size / 2)\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n\n return {\n start: pos,\n end: pos + size\n };\n}\n\n/**\n * Helper function to fit a radial linear scale with point labels\n */\nfunction fitWithPointLabels(scale) {\n\n // Right, this is really confusing and there is a lot of maths going on here\n // The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n //\n // Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n //\n // Solution:\n //\n // We assume the radius of the polygon is half the size of the canvas at first\n // at each index we check if the text overlaps.\n //\n // Where it does, we store that angle and that index.\n //\n // After finding the largest index and angle we calculate how much we need to remove\n // from the shape radius to move the point inwards by that x.\n //\n // We average the left and right distances to get the maximum shape radius that can fit in the box\n // along with labels.\n //\n // Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n // on each side, removing that from the size, halving it and adding the left x protrusion width.\n //\n // This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n // and position it in the most space efficient manner\n //\n // https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n\n // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n\n for (let i = 0; i < valueCount; i++) {\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n\n scale.setCenterPoint(\n orig.l - limits.l,\n limits.r - orig.r,\n orig.t - limits.t,\n limits.b - orig.b\n );\n\n // Now that text size is determined, compute the full positions\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\n\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\n\nfunction createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const {extra, additionalAngle, padding, size} = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n // if to draw or overlapped\n visible: true,\n\n // Text position\n x: pointLabelPosition.x,\n y,\n\n // Text rendering data\n textAlign,\n\n // Bounding box\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\n\nfunction isNotOverlapped(item, area) {\n if (!area) {\n return true;\n }\n const {left, top, right, bottom} = item;\n const apexesInArea = _isPointInArea({x: left, y: top}, area) || _isPointInArea({x: left, y: bottom}, area) ||\n _isPointInArea({x: right, y: top}, area) || _isPointInArea({x: right, y: bottom}, area);\n return !apexesInArea;\n}\n\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const {centerPointLabels, display} = opts.pointLabels;\n const itemOpts = {\n extra: getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? PI / valueCount : 0\n };\n let area;\n\n for (let i = 0; i < valueCount; i++) {\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n\n const item = createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === 'auto') {\n item.visible = isNotOverlapped(item, area);\n if (item.visible) {\n area = item;\n }\n }\n }\n return items;\n}\n\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n\n return 'right';\n}\n\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= (w / 2);\n }\n return x;\n}\n\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= (h / 2);\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\n\nfunction drawPointLabelBox(ctx, opts, item) {\n const {left, top, right, bottom} = item;\n const {backdropColor} = opts;\n\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(opts.borderRadius);\n const padding = toPadding(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n}\n\nfunction drawPointLabels(scale, labelCount) {\n const {ctx, options: {pointLabels}} = scale;\n\n for (let i = labelCount - 1; i >= 0; i--) {\n const item = scale._pointLabelItems[i];\n if (!item.visible) {\n // overlapping\n continue;\n }\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = toFont(optsAtIndex.font);\n const {x, y, textAlign} = item;\n\n renderText(\n ctx,\n scale._pointLabels[i],\n x,\n y + (plFont.lineHeight / 2),\n plFont,\n {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n }\n );\n }\n}\n\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const {ctx} = scale;\n if (circular) {\n // Draw circular arcs between the points\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n // Draw straight lines connecting each index\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n\n for (let i = 1; i < labelCount; i++) {\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\n\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n\n const {color, lineWidth} = gridLineOpts;\n\n if ((!circular && !labelCount) || !color || !lineWidth || radius < 0) {\n return;\n }\n\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\n\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\n\nexport default class RadialLinearScale extends LinearScaleBase {\n\n static id = 'radialLinear';\n\n /**\n * @type {any}\n */\n static defaults = {\n display: true,\n\n // Boolean - Whether to animate scaling the chart from the centre\n animate: true,\n position: 'chartArea',\n\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n\n grid: {\n circular: false\n },\n\n startAngle: 0,\n\n // label settings\n ticks: {\n // Boolean - Show a backdrop to the scale label\n showLabelBackdrop: true,\n\n callback: Ticks.formatters.numeric\n },\n\n pointLabels: {\n backdropColor: undefined,\n\n // Number - The backdrop padding above & below the label in pixels\n backdropPadding: 2,\n\n // Boolean - if true, show point labels\n display: true,\n\n // Number - Point label font size in pixels\n font: {\n size: 10\n },\n\n // Function - Used to convert point labels\n callback(label) {\n return label;\n },\n\n // Number - Additionl padding between scale and pointLabel\n padding: 5,\n\n // Boolean - if true, center point labels to slices in polar chart\n centerPointLabels: false\n }\n };\n\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.xCenter = undefined;\n /** @type {number} */\n this.yCenter = undefined;\n /** @type {number} */\n this.drawingArea = undefined;\n /** @type {string[]} */\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(false);\n\n this.min = isFinite(min) && !isNaN(min) ? min : 0;\n this.max = isFinite(max) && !isNaN(max) ? max : 0;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n\t */\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n\n // Point labels\n this._pointLabels = this.getLabels()\n .map((value, index) => {\n const label = callCallback(this.options.pointLabels.callback, [value, index], this);\n return label || label === 0 ? label : '';\n })\n .filter((v, i) => this.chart.getDataVisibility(i));\n }\n\n fit() {\n const opts = this.options;\n\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n\n // Take into account half font size + the yPadding of the top value\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n\n getPointLabelPosition(index) {\n const {left, top, right, bottom} = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom,\n };\n }\n\n /**\n\t * @protected\n\t */\n drawBackground() {\n const {backgroundColor, grid: {circular}} = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const {angleLines, grid, border} = opts;\n const labelCount = this._pointLabels.length;\n\n let i, offset, position;\n\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n\n if (grid.display) {\n this.ticks.forEach((tick, index) => {\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n\n if (angleLines.display) {\n ctx.save();\n\n for (i = labelCount - 1; i >= 0; i--) {\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const {color, lineWidth} = optsAtIndex;\n\n if (!lineWidth || !color) {\n continue;\n }\n\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {}\n\n /**\n\t * @protected\n\t */\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n if (!tickOpts.display) {\n return;\n }\n\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n\n this.ticks.forEach((tick, index) => {\n if (index === 0 && !opts.reverse) {\n return;\n }\n\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(\n -width / 2 - padding.left,\n -offset - tickFont.size / 2 - padding.top,\n width + padding.width,\n tickFont.size + padding.height\n );\n }\n\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth,\n });\n });\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {}\n}\n","import adapters from '../core/core.adapters.js';\nimport {callback as call, isFinite, isNullOrUndef, mergeIf, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toRadians, isNumber, _limitValue} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {_arrayUnique, _filterBetween, _lookup} from '../helpers/helpers.collection.js';\n\n/**\n * @typedef { import('../core/core.adapters.js').TimeUnit } Unit\n * @typedef {{common: boolean, size: number, steps?: number}} Interval\n * @typedef { import('../core/core.adapters.js').DateAdapter } DateAdapter\n */\n\n/**\n * @type {Object}\n */\nconst INTERVALS = {\n millisecond: {common: true, size: 1, steps: 1000},\n second: {common: true, size: 1000, steps: 60},\n minute: {common: true, size: 60000, steps: 60},\n hour: {common: true, size: 3600000, steps: 24},\n day: {common: true, size: 86400000, steps: 30},\n week: {common: false, size: 604800000, steps: 4},\n month: {common: true, size: 2.628e9, steps: 12},\n quarter: {common: false, size: 7.884e9, steps: 4},\n year: {common: true, size: 3.154e10}\n};\n\n/**\n * @type {Unit[]}\n */\nconst UNITS = /** @type Unit[] */ /* #__PURE__ */ (Object.keys(INTERVALS));\n\n/**\n * @param {number} a\n * @param {number} b\n */\nfunction sorter(a, b) {\n return a - b;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {*} input\n * @return {number}\n */\nfunction parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n\n const adapter = scale._adapter;\n const {parser, round, isoWeekday} = scale._parseOpts;\n let value = input;\n\n if (typeof parser === 'function') {\n value = parser(value);\n }\n\n // Only parse if it's not a timestamp already\n if (!isFinite(value)) {\n value = typeof parser === 'string'\n ? adapter.parse(value, /** @type {Unit} */ (parser))\n : adapter.parse(value);\n }\n\n if (value === null) {\n return null;\n }\n\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true)\n ? adapter.startOf(value, 'isoWeek', isoWeekday)\n : adapter.startOf(value, round);\n }\n\n return +value;\n}\n\n/**\n * Figures out what unit results in an appropriate number of auto-generated ticks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @param {number} capacity\n * @return {object}\n */\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n\n for (let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n\n return UNITS[ilen - 1];\n}\n\n/**\n * Figures out what unit to format a set of ticks with\n * @param {TimeScale} scale\n * @param {number} numTicks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @return {Unit}\n */\nfunction determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for (let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n\n/**\n * @param {Unit} unit\n * @return {object}\n */\nfunction determineMajorUnit(unit) {\n for (let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n\n/**\n * @param {object} ticks\n * @param {number} time\n * @param {number[]} [timestamps] - if defined, snap to these timestamps\n */\nfunction addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const {lo, hi} = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n\n/**\n * @param {TimeScale} scale\n * @param {object[]} ticks\n * @param {object} map\n * @param {Unit} majorUnit\n * @return {object[]}\n */\nfunction setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n\n for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {number[]} values\n * @param {Unit|undefined} [majorUnit]\n * @return {object[]}\n */\nfunction ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n /** @type {Object} */\n const map = {};\n const ilen = values.length;\n let i, value;\n\n for (i = 0; i < ilen; ++i) {\n value = values[i];\n map[value] = i;\n\n ticks.push({\n value,\n major: false\n });\n }\n\n // We set the major ticks separately from the above loop because calling startOf for every tick\n // is expensive when there is a large number of ticks\n return (ilen === 0 || !majorUnit) ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\n\nexport default class TimeScale extends Scale {\n\n static id = 'time';\n\n /**\n * @type {any}\n */\n static defaults = {\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 2.7.0\n */\n bounds: 'data',\n\n adapters: {},\n time: {\n parser: false, // false == a pattern string from or a custom callback that converts its argument to a timestamp\n unit: false, // false == automatic or override with week, month, year, etc.\n round: false, // none, or override with week, month, year, etc.\n isoWeekday: false, // override week start day\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n /**\n * Ticks generation input values:\n * - 'auto': generates \"optimal\" ticks based on scale size and time options.\n * - 'data': generates ticks from data (including labels from data {t|x|y} objects).\n * - 'labels': generates ticks from user given `data.labels` values ONLY.\n * @see https://github.com/chartjs/Chart.js/pull/4507\n * @since 2.7.0\n */\n source: 'auto',\n\n callback: false,\n\n major: {\n enabled: false\n }\n }\n };\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {{data: number[], labels: number[], all: number[]}} */\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n\n /** @type {Unit} */\n this._unit = 'day';\n /** @type {Unit=} */\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n /** @type {DateAdapter} */\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n\n adapter.init(opts);\n\n // Backward compatibility: before introducing adapter, `displayFormats` was\n // supposed to contain *all* unit/string pairs but this can't be resolved\n // when loading the scale (adapters are loaded afterward), so let's populate\n // missing formats on update\n mergeIf(time.displayFormats, adapter.formats());\n\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n\n super.init(scaleOpts);\n\n this._normalized = opts.normalized;\n }\n\n /**\n\t * @param {*} raw\n\t * @param {number?} [index]\n\t * @return {number}\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n // eslint-disable-next-line prefer-const\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n\n /**\n\t\t * @param {object} bounds\n\t\t */\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n\n // If we have user provided `min` and `max` labels / data bounds can be ignored\n if (!minDefined || !maxDefined) {\n // Labels are always considered, when user did not force bounds\n _applyBounds(this._getLabelBounds());\n\n // If `bounds` is `'ticks'` and `ticks.source` is `'labels'`,\n // data bounds are ignored (and don't need to be determined)\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n\n min = isFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n\n // Make sure that max is strictly higher than min (required by the timeseries lookup table)\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n\n /**\n\t * @private\n\t */\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {min, max};\n }\n\n /**\n\t * @return {object[]}\n\t */\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n\n const min = this.min;\n const max = this.max;\n\n const ticks = _filterBetween(timestamps, min, max);\n\n // PRIVATE\n // determineUnitForFormatting relies on the number of ticks so we don't use it when\n // autoSkip is enabled because we don't yet know what the final number of ticks will be\n this._unit = timeOpts.unit || (tickOpts.autoSkip\n ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min))\n : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined\n : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n\n if (options.reverse) {\n ticks.reverse();\n }\n\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n\n afterAutoSkip() {\n // Offsets for bar charts need to be handled with the auto skipped\n // ticks. Once ticks have been skipped, we re-compute the offsets.\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map(tick => +tick.value));\n }\n }\n\n /**\n\t * Returns the start and end offsets from edges in the form of {start, end}\n\t * where each value is a relative width to the scale and ranges between 0 and 1.\n\t * They add extra margins on the both sides by scaling down the original scale.\n\t * Offsets are added when the `offset` option is true.\n\t * @param {number[]} timestamps\n\t * @protected\n\t */\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n\n this._offsets = {start, end, factor: 1 / (start + 1 + end)};\n }\n\n /**\n\t * Generates a maximum of `capacity` timestamps between min and max, rounded to the\n\t * `minor` unit using the given scale time `options`.\n\t * Important: this method can return ticks outside the min and max range, it's the\n\t * responsibility of the calling code to clamp values if needed.\n\t * @protected\n\t */\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n // @ts-ignore\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n\n // For 'week' unit, handle the first day of week option\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n\n // Align first ticks on unit\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n\n // Prevent browser from freezing in case user options request millions of milliseconds\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) {\n addTick(ticks, time, timestamps);\n }\n\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n\n // @ts-ignore\n return Object.keys(ticks).sort(sorter).map(x => +x);\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n\n /**\n\t * @param {number} value\n\t * @param {string|undefined} format\n\t * @return {string}\n\t */\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n\n /**\n\t * Function to format an individual tick mark\n\t * @param {number} time\n\t * @param {number} index\n\t * @param {object[]} ticks\n\t * @param {string|undefined} [format]\n\t * @return {string}\n\t * @private\n\t */\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n\n if (formatter) {\n return call(formatter, [time, index, ticks], this);\n }\n\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n\n /**\n\t * @param {object[]} ticks\n\t */\n generateTickLabels(ticks) {\n let i, ilen, tick;\n\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n\n /**\n\t * @param {string} label\n\t * @return {{w:number, h:number}}\n\t * @private\n\t */\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n\n return {\n w: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation),\n h: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation)\n };\n }\n\n /**\n\t * @param {number} exampleTime\n\t * @return {number}\n\t * @private\n\t */\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n\n // pick the longest format (milliseconds) for guesstimation\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [exampleTime], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n // subtract 1 - if offset then there's one less label than tick\n // if not offset then one half label padding is added to each end leaving room for one less label\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n\n /**\n\t * @protected\n\t */\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const metas = this.getMatchingVisibleMetas();\n\n if (this._normalized && metas.length) {\n return (this._cache.data = metas[0].controller.getAllParsedValues(this));\n }\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n\n return (this._cache.data = this.normalize(timestamps));\n }\n\n /**\n\t * @protected\n\t */\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const labels = this.getLabels();\n for (i = 0, ilen = labels.length; i < ilen; ++i) {\n timestamps.push(parse(this, labels[i]));\n }\n\n return (this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps));\n }\n\n /**\n\t * @param {number[]} values\n\t * @protected\n\t */\n normalize(values) {\n // It seems to be somewhat faster to do sorting first\n return _arrayUnique(values.sort(sorter));\n }\n}\n","import TimeScale from './scale.time.js';\nimport {_lookupByKey} from '../helpers/helpers.collection.js';\n\n/**\n * Linearly interpolates the given source `val` using the table. If value is out of bounds, values\n * at edges are used for the interpolation.\n * @param {object} table\n * @param {number} val\n * @param {boolean} [reverse] lookup time based on position instead of vice versa\n * @return {object}\n */\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({lo, hi} = _lookupByKey(table, 'pos', val));\n }\n ({pos: prevSource, time: prevTarget} = table[lo]);\n ({pos: nextSource, time: nextTarget} = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({lo, hi} = _lookupByKey(table, 'time', val));\n }\n ({time: prevSource, pos: prevTarget} = table[lo]);\n ({time: nextSource, pos: nextTarget} = table[hi]);\n }\n\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\n\nclass TimeSeriesScale extends TimeScale {\n\n static id = 'timeseries';\n\n /**\n * @type {any}\n */\n static defaults = TimeScale.defaults;\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {object[]} */\n this._table = [];\n /** @type {number} */\n this._minPos = undefined;\n /** @type {number} */\n this._tableRange = undefined;\n }\n\n /**\n\t * @protected\n\t */\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n\n /**\n\t * Returns an array of {time, pos} objects used to interpolate a specific `time` or position\n\t * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is\n\t * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other\n\t * extremity (left + width or top + height). Note that it would be more optimized to directly\n\t * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need\n\t * to create the lookup table. The table ALWAYS contains at least two items: min and max.\n\t * @param {number[]} timestamps\n\t * @return {object[]}\n\t * @protected\n\t */\n buildLookupTable(timestamps) {\n const {min, max} = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n\n for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n\n if (items.length < 2) {\n // In case there is less that 2 timestamps between min and max, the scale is defined by min and max\n return [\n {time: min, pos: 0},\n {time: max, pos: 1}\n ];\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n\n // only add points that breaks the scale linearity\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({time: curr, pos: i / (ilen - 1)});\n }\n }\n return table;\n }\n\n /**\n * Generates all timestamps defined in the data.\n * Important: this method can return ticks outside the min and max range, it's the\n * responsibility of the calling code to clamp values if needed.\n * @protected\n */\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) {\n timestamps.splice(0, 0, min);\n }\n if (!timestamps.includes(max) || timestamps.length === 1) {\n timestamps.push(max);\n }\n return timestamps.sort((a, b) => a - b);\n }\n\n /**\n\t * Returns all timestamps\n\t * @return {number[]}\n\t * @private\n\t */\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n // If combining labels and data (data might not contain all labels),\n // we need to recheck uniqueness and sort\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n\n return timestamps;\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\n\nexport default TimeSeriesScale;\n","export * from './controllers/index.js';\nexport * from './core/index.js';\nexport * from './elements/index.js';\nexport * from './platform/index.js';\nexport * from './plugins/index.js';\nexport * from './scales/index.js';\n\nimport * as controllers from './controllers/index.js';\nimport * as elements from './elements/index.js';\nimport * as plugins from './plugins/index.js';\nimport * as scales from './scales/index.js';\n\nexport {\n controllers,\n elements,\n plugins,\n scales,\n};\n\nexport const registerables = [\n controllers,\n elements,\n plugins,\n scales,\n];\n","export function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });\n } else obj[key] = value;\n\n return obj;\n}\nexport { _define_property as _ };\n","/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */\nimport { Color } from '@kurkle/color';\n\n/**\n * @namespace Chart.helpers\n */ /**\n * An empty function that can be used, for example, for optional callback.\n */ function noop() {\n/* noop */ }\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */ const uid = (()=>{\n let id = 0;\n return ()=>id++;\n})();\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isNullOrUndef(value) {\n return value === null || typeof value === 'undefined';\n}\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */ function isArray(value) {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isObject(value) {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */ function isNumberFinite(value) {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */ function finiteOrDefault(value, defaultValue) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */ function valueOrDefault(value, defaultValue) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\nconst toPercentage = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 : +value / dimension;\nconst toDimension = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 * dimension : +value;\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */ function callback(fn, args, thisArg) {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\nfunction each(loopable, fn, thisArg, reverse) {\n let i, len, keys;\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for(i = len - 1; i >= 0; i--){\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */ function _elementsEqual(a0, a1) {\n let i, ilen, v0, v1;\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n for(i = 0, ilen = a0.length; i < ilen; ++i){\n v0 = a0[i];\n v1 = a1[i];\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n return true;\n}\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */ function clone(source) {\n if (isArray(source)) {\n return source.map(clone);\n }\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n for(; k < klen; ++k){\n target[keys[k]] = clone(source[keys[k]]);\n }\n return target;\n }\n return source;\n}\nfunction isValidKey(key) {\n return [\n '__proto__',\n 'prototype',\n 'constructor'\n ].indexOf(key) === -1;\n}\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */ function _merger(key, target, source, options) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone(sval);\n }\n}\nfunction merge(target, source, options) {\n const sources = isArray(source) ? source : [\n source\n ];\n const ilen = sources.length;\n if (!isObject(target)) {\n return target;\n }\n options = options || {};\n const merger = options.merger || _merger;\n let current;\n for(let i = 0; i < ilen; ++i){\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n const keys = Object.keys(current);\n for(let k = 0, klen = keys.length; k < klen; ++k){\n merger(keys[k], target, current, options);\n }\n }\n return target;\n}\nfunction mergeIf(target, source) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge(target, source, {\n merger: _mergerIf\n });\n}\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */ function _mergerIf(key, target, source) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone(sval);\n }\n}\n/**\n * @private\n */ function _deprecated(scope, value, previous, current) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous + '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': (v)=>v,\n // default resolvers\n x: (o)=>o.x,\n y: (o)=>o.y\n};\n/**\n * @private\n */ function _splitKey(key) {\n const parts = key.split('.');\n const keys = [];\n let tmp = '';\n for (const part of parts){\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\nfunction _getKeyResolver(key) {\n const keys = _splitKey(key);\n return (obj)=>{\n for (const k of keys){\n if (k === '') {\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\nfunction resolveObjectKey(obj, key) {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n/**\n * @private\n */ function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst defined = (value)=>typeof value !== 'undefined';\nconst isFunction = (value)=>typeof value === 'function';\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nconst setsEqual = (a, b)=>{\n if (a.size !== b.size) {\n return false;\n }\n for (const item of a){\n if (!b.has(item)) {\n return false;\n }\n }\n return true;\n};\n/**\n * @param e - The event\n * @private\n */ function _isClickEvent(e) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */ const PI = Math.PI;\nconst TAU = 2 * PI;\nconst PITAU = TAU + PI;\nconst INFINITY = Number.POSITIVE_INFINITY;\nconst RAD_PER_DEG = PI / 180;\nconst HALF_PI = PI / 2;\nconst QUARTER_PI = PI / 4;\nconst TWO_THIRDS_PI = PI * 2 / 3;\nconst log10 = Math.log10;\nconst sign = Math.sign;\nfunction almostEquals(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n}\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */ function niceNum(range) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */ function _factorize(value) {\n const result = [];\n const sqrt = Math.sqrt(value);\n let i;\n for(i = 1; i < sqrt; i++){\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) {\n result.push(sqrt);\n }\n result.sort((a, b)=>a - b).pop();\n return result;\n}\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction almostWhole(x, epsilon) {\n const rounded = Math.round(x);\n return rounded - epsilon <= x && rounded + epsilon >= x;\n}\n/**\n * @private\n */ function _setMinAndMaxByKey(array, target, property) {\n let i, ilen, value;\n for(i = 0, ilen = array.length; i < ilen; i++){\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\nfunction toRadians(degrees) {\n return degrees * (PI / 180);\n}\nfunction toDegrees(radians) {\n return radians * (180 / PI);\n}\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */ function _decimalPlaces(x) {\n if (!isNumberFinite(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while(Math.round(x * e) / e !== x){\n e *= 10;\n p++;\n }\n return p;\n}\n// Gets the angle from vertical upright to the point about a centre.\nfunction getAngleFromPoint(centrePoint, anglePoint) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n if (angle < -0.5 * PI) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\nfunction distanceBetweenPoints(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */ function _angleDiff(a, b) {\n return (a - b + PITAU) % TAU - PI;\n}\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */ function _normalizeAngle(a) {\n return (a % TAU + TAU) % TAU;\n}\n/**\n * @private\n */ function _angleBetween(angle, start, end, sameAngleIsFullCircle) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle;\n}\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */ function _limitValue(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n/**\n * @param {number} value\n * @private\n */ function _int16Range(value) {\n return _limitValue(value, -32768, 32767);\n}\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */ function _isBetween(value, start, end, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n\nfunction _lookup(table, value, cmp) {\n cmp = cmp || ((index)=>table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid;\n while(hi - lo > 1){\n mid = lo + hi >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return {\n lo,\n hi\n };\n}\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */ const _lookupByKey = (table, key, value, last)=>_lookup(table, value, last ? (index)=>{\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n } : (index)=>table[index][key] < value);\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */ const _rlookupByKey = (table, key, value)=>_lookup(table, value, (index)=>table[index][key] >= value);\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */ function _filterBetween(values, min, max) {\n let start = 0;\n let end = values.length;\n while(start < end && values[start] < min){\n start++;\n }\n while(end > start && values[end - 1] > max){\n end--;\n }\n return start > 0 || end < values.length ? values.slice(start, end) : values;\n}\nconst arrayEvents = [\n 'push',\n 'pop',\n 'shift',\n 'splice',\n 'unshift'\n];\nfunction listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [\n listener\n ]\n }\n });\n arrayEvents.forEach((key)=>{\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value (...args) {\n const res = base.apply(this, args);\n array._chartjs.listeners.forEach((object)=>{\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n return res;\n }\n });\n });\n}\nfunction unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n if (listeners.length > 0) {\n return;\n }\n arrayEvents.forEach((key)=>{\n delete array[key];\n });\n delete array._chartjs;\n}\n/**\n * @param items\n */ function _arrayUnique(items) {\n const set = new Set(items);\n if (set.size === items.length) {\n return items;\n }\n return Array.from(set);\n}\n\nfunction fontString(pixelSize, fontStyle, fontFamily) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n/**\n* Request animation polyfill\n*/ const requestAnimFrame = function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}();\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */ function throttled(fn, thisArg) {\n let argsToUse = [];\n let ticking = false;\n return function(...args) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, ()=>{\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n/**\n * Debounces calling `fn` for `delay` ms\n */ function debounce(fn, delay) {\n let timeout;\n return function(...args) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */ const _toLeftRightCenter = (align)=>align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */ const _alignStartEnd = (align, start, end)=>align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */ const _textX = (align, left, right, rtl)=>{\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n/**\n * Return start and count of visible points.\n * @private\n */ function _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {\n const pointCount = points.length;\n let start = 0;\n let count = pointCount;\n if (meta._sorted) {\n const { iScale , _parsed } = meta;\n const axis = iScale.axis;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(Math.min(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, axis, min).lo, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1), start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n return {\n start,\n count\n };\n}\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */ function _scaleRangesChanged(meta) {\n const { xScale , yScale , _scaleRanges } = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n\nconst atEdge = (t)=>t === 0 || t === 1;\nconst elasticIn = (t, s, p)=>-(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t, s, p)=>Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */ const effects = {\n linear: (t)=>t,\n easeInQuad: (t)=>t * t,\n easeOutQuad: (t)=>-t * (t - 2),\n easeInOutQuad: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1),\n easeInCubic: (t)=>t * t * t,\n easeOutCubic: (t)=>(t -= 1) * t * t + 1,\n easeInOutCubic: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2),\n easeInQuart: (t)=>t * t * t * t,\n easeOutQuart: (t)=>-((t -= 1) * t * t * t - 1),\n easeInOutQuart: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2),\n easeInQuint: (t)=>t * t * t * t * t,\n easeOutQuint: (t)=>(t -= 1) * t * t * t * t + 1,\n easeInOutQuint: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2),\n easeInSine: (t)=>-Math.cos(t * HALF_PI) + 1,\n easeOutSine: (t)=>Math.sin(t * HALF_PI),\n easeInOutSine: (t)=>-0.5 * (Math.cos(PI * t) - 1),\n easeInExpo: (t)=>t === 0 ? 0 : Math.pow(2, 10 * (t - 1)),\n easeOutExpo: (t)=>t === 1 ? 1 : -Math.pow(2, -10 * t) + 1,\n easeInOutExpo: (t)=>atEdge(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n easeInCirc: (t)=>t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1),\n easeOutCirc: (t)=>Math.sqrt(1 - (t -= 1) * t),\n easeInOutCirc: (t)=>(t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n easeInElastic: (t)=>atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n easeOutElastic: (t)=>atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n easeInOutElastic (t) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t : t < 0.5 ? 0.5 * elasticIn(t * 2, s, p) : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n easeInBack (t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n easeOutBack (t) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n easeInOutBack (t) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);\n },\n easeInBounce: (t)=>1 - effects.easeOutBounce(1 - t),\n easeOutBounce (t) {\n const m = 7.5625;\n const d = 2.75;\n if (t < 1 / d) {\n return m * t * t;\n }\n if (t < 2 / d) {\n return m * (t -= 1.5 / d) * t + 0.75;\n }\n if (t < 2.5 / d) {\n return m * (t -= 2.25 / d) * t + 0.9375;\n }\n return m * (t -= 2.625 / d) * t + 0.984375;\n },\n easeInOutBounce: (t)=>t < 0.5 ? effects.easeInBounce(t * 2) * 0.5 : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5\n};\n\nfunction isPatternOrGradient(value) {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n return false;\n}\nfunction color(value) {\n return isPatternOrGradient(value) ? value : new Color(value);\n}\nfunction getHoverColor(value) {\n return isPatternOrGradient(value) ? value : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n\nconst numbers = [\n 'x',\n 'y',\n 'borderWidth',\n 'radius',\n 'tension'\n];\nconst colors = [\n 'color',\n 'borderColor',\n 'backgroundColor'\n];\nfunction applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined\n });\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name)=>name !== 'onProgress' && name !== 'onComplete' && name !== 'fn'\n });\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n }\n });\n defaults.describe('animations', {\n _fallback: 'animation'\n });\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0\n }\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: (v)=>v | 0\n }\n }\n }\n });\n}\n\nfunction applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n\nconst intlCache = new Map();\nfunction getNumberFormat(locale, options) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\nfunction formatNumber(num, locale, options) {\n return getNumberFormat(locale, options).format(num);\n}\n\nconst formatters = {\n values (value) {\n return isArray(value) ? value : '' + value;\n },\n numeric (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue;\n if (ticks.length > 1) {\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n delta = calculateDelta(tickValue, ticks);\n }\n const logDelta = log10(Math.abs(delta));\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n const options = {\n notation,\n minimumFractionDigits: numDecimal,\n maximumFractionDigits: numDecimal\n };\n Object.assign(options, this.options.ticks.format);\n return formatNumber(tickValue, locale, options);\n },\n logarithmic (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || tickValue / Math.pow(10, Math.floor(log10(tickValue)));\n if ([\n 1,\n 2,\n 3,\n 5,\n 10,\n 15\n ].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n};\nfunction calculateDelta(tickValue, ticks) {\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n var Ticks = {\n formatters\n};\n\nfunction applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n bounds: 'ticks',\n clip: true,\n grace: 0,\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options)=>options.lineWidth,\n tickColor: (_ctx, options)=>options.color,\n offset: false\n },\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n title: {\n display: false,\n text: '',\n padding: {\n top: 4,\n bottom: 4\n }\n },\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2\n }\n });\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name)=>!name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name)=>name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash'\n });\n defaults.describe('scales', {\n _fallback: 'scale'\n });\n defaults.describe('scale.ticks', {\n _scriptable: (name)=>name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name)=>name !== 'backdropPadding'\n });\n}\n\nconst overrides = Object.create(null);\nconst descriptors = Object.create(null);\n function getScope$1(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for(let i = 0, n = keys.length; i < n; ++i){\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope$1(root, scope), values);\n }\n return merge(getScope$1(root, ''), scope);\n}\n class Defaults {\n constructor(_descriptors, _appliers){\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context)=>context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options)=>getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options)=>getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options)=>getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n set(scope, values) {\n return set(this, scope, values);\n }\n get(scope) {\n return getScope$1(this, scope);\n }\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n override(scope, values) {\n return set(overrides, scope, values);\n }\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope$1(this, scope);\n const targetScopeObject = getScope$1(this, targetScope);\n const privateName = '_' + name;\n Object.defineProperties(scopeObject, {\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n [name]: {\n enumerable: true,\n get () {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set (value) {\n this[privateName] = value;\n }\n }\n });\n }\n apply(appliers) {\n appliers.forEach((apply)=>apply(this));\n }\n}\nvar defaults = /* #__PURE__ */ new Defaults({\n _scriptable: (name)=>!name.startsWith('on'),\n _indexable: (name)=>name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false\n }\n}, [\n applyAnimationsDefaults,\n applyLayoutsDefaults,\n applyScaleDefaults\n]);\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */ function toFontString(font) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n return (font.style ? font.style + ' ' : '') + (font.weight ? font.weight + ' ' : '') + font.size + 'px ' + font.family;\n}\n/**\n * @private\n */ function _measureText(ctx, data, gc, longest, string) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n/**\n * @private\n */ // eslint-disable-next-line complexity\nfunction _longestText(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n ctx.save();\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i, j, jlen, thing, nestedThing;\n for(i = 0; i < ilen; i++){\n thing = arrayOfThings[i];\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !isArray(thing)) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for(j = 0, jlen = thing.length; j < jlen; j++){\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n ctx.restore();\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for(i = 0; i < gcLen; i++){\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */ function _alignPixel(chart, pixel, width) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n/**\n * Clears the entire canvas.\n */ function clearCanvas(canvas, ctx) {\n ctx = ctx || canvas.getContext('2d');\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\nfunction drawPoint(ctx, options, x, y) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n drawPointLegend(ctx, options, x, y, null);\n}\n// eslint-disable-next-line complexity\nfunction drawPointLegend(ctx, options, x, y, w) {\n let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n ctx.beginPath();\n switch(style){\n // Default includes circle\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n /* falls through */ case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n /* falls through */ case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */ function _isPointInArea(point, area, margin) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;\n}\nfunction clipArea(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\nfunction unclipArea(ctx) {\n ctx.restore();\n}\n/**\n * @private\n */ function _steppedLineTo(ctx, previous, target, flip, mode) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n/**\n * @private\n */ function _bezierCurveTo(ctx, previous, target, flip) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y);\n}\nfunction setRenderOpts(ctx, opts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\nfunction decorateText(ctx, x, y, line, opts) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */ const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\nfunction drawBackdrop(ctx, opts) {\n const oldColor = ctx.fillStyle;\n ctx.fillStyle = opts.color;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n/**\n * Render text onto the canvas\n */ function renderText(ctx, text, x, y, font, opts = {}) {\n const lines = isArray(text) ? text : [\n text\n ];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i, line;\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n for(i = 0; i < lines.length; ++i){\n line = lines[i];\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n y += Number(font.lineHeight);\n }\n ctx.restore();\n}\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */ function addRoundedRectPath(ctx, rect) {\n const { x , y , w , h , radius } = rect;\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n/**\n * @alias Chart.helpers.options\n * @namespace\n */ /**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */ function toLineHeight(value, size) {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n value = +matches[2];\n switch(matches[3]){\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n }\n return size * value;\n}\nconst numberOrZero = (v)=>+v || 0;\nfunction _readValueToProps(value, props) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value) ? objProps ? (prop)=>valueOrDefault(value[prop], value[props[prop]]) : (prop)=>value[prop] : ()=>value;\n for (const prop of keys){\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */ function toTRBL(value) {\n return _readValueToProps(value, {\n top: 'y',\n right: 'x',\n bottom: 'y',\n left: 'x'\n });\n}\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */ function toTRBLCorners(value) {\n return _readValueToProps(value, [\n 'topLeft',\n 'topRight',\n 'bottomLeft',\n 'bottomRight'\n ]);\n}\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */ function toPadding(value) {\n const obj = toTRBL(value);\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n return obj;\n}\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */ function toFont(options, fallback) {\n options = options || {};\n fallback = fallback || defaults.font;\n let size = valueOrDefault(options.size, fallback.size);\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n font.string = toFontString(font);\n return font;\n}\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */ function resolve(inputs, context, index, info) {\n let cacheable = true;\n let i, ilen, value;\n for(i = 0, ilen = inputs.length; i < ilen; ++i){\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */ function _addGrace(minmax, grace, beginAtZero) {\n const { min , max } = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value, add)=>beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\nfunction createContext(parentContext, context) {\n return Object.assign(Object.create(parentContext), context);\n}\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */ function _createResolver(scopes, prefixes = [\n ''\n], rootScopes, fallback, getTarget = ()=>scopes[0]) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === 'undefined') {\n fallback = _resolve('_fallback', scopes);\n }\n const cache = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope)=>_createResolver([\n scope,\n ...scopes\n ], prefixes, finalRootScopes, fallback)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop) {\n return _cached(target, prop, ()=>_resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys (target) {\n return getKeysFromAllScopes(target);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n });\n}\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */ function _attachContext(proxy, context, subProxy, descriptorDefaults) {\n const cache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx)=>_attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope)=>_attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop, receiver) {\n return _cached(target, prop, ()=>_resolveWithContext(target, prop, receiver));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? {\n enumerable: true,\n configurable: true\n } : undefined : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(proxy);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return Reflect.has(proxy, prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys () {\n return Reflect.ownKeys(proxy);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n });\n}\n/**\n * @private\n */ function _descriptors(proxy, defaults = {\n scriptable: true,\n indexable: true\n}) {\n const { _scriptable =defaults.scriptable , _indexable =defaults.indexable , _allKeys =defaults.allKeys } = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : ()=>_scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : ()=>_indexable\n };\n}\nconst readKey = (prefix, name)=>prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop, value)=>isObject(value) && prop !== 'adapters' && (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction _cached(target, prop, resolve) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) {\n return target[prop];\n }\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\nfunction _resolveWithContext(target, prop, receiver) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n let value = _proxy[prop]; // resolve from proxy\n // resolve with context\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n // if the resolved value is an object, create a sub resolver for it\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\nfunction _resolveScriptable(prop, getValue, target, receiver) {\n const { _proxy , _context , _subProxy , _stack } = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n // When scriptable option returns an object, create a resolver on that.\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\nfunction _resolveArray(prop, value, target, isIndexable) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n return value[_context.index % value.length];\n } else if (isObject(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter((s)=>s !== arr);\n value = [];\n for (const item of arr){\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\nfunction resolveFallback(fallback, prop, value) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\nconst getScope = (key, parent)=>key === true ? parent : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\nfunction addScopes(set, parentScopes, key, parentFallback, value) {\n for (const parent of parentScopes){\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n }\n } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n }\n return false;\n}\nfunction createSubResolver(parentScopes, resolver, prop, value) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [\n ...parentScopes,\n ...rootScopes\n ];\n const set = new Set();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (typeof fallback !== 'undefined' && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [\n ''\n ], rootScopes, fallback, ()=>subGetTarget(resolver, prop, value));\n}\nfunction addScopesFromKey(set, allScopes, key, fallback, item) {\n while(key){\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\nfunction subGetTarget(resolver, prop, value) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n // For array of objects, the object is used to store updated values\n return value;\n }\n return target || {};\n}\nfunction _resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n let value;\n for (const prefix of prefixes){\n value = _resolve(readKey(prefix, prop), scopes);\n if (typeof value !== 'undefined') {\n return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value;\n }\n }\n}\nfunction _resolve(key, scopes) {\n for (const scope of scopes){\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n}\nfunction getKeysFromAllScopes(target) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\nfunction resolveKeysFromAllScopes(scopes) {\n const set = new Set();\n for (const scope of scopes){\n for (const key of Object.keys(scope).filter((k)=>!k.startsWith('_'))){\n set.add(key);\n }\n }\n return Array.from(set);\n}\nfunction _parseObjectDataRadialScale(meta, data, start, count) {\n const { iScale } = meta;\n const { key ='r' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n\nconst EPSILON = Number.EPSILON || 1e-14;\nconst getPoint = (points, i)=>i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis)=>indexAxis === 'x' ? 'y' : 'x';\nfunction splineCurve(firstPoint, middlePoint, afterPoint, t) {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n // This function must also respect \"skipped\" points\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n/**\n * Adjust tangents to ensure monotonic properties\n */ function monotoneAdjust(points, deltaK, mK) {\n const pointsLen = points.length;\n let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen - 1; ++i){\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\nfunction monotoneCompute(points, mK, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */ function splineCurveMonotone(points, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK = Array(pointsLen).fill(0);\n const mK = Array(pointsLen);\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : sign(deltaK[i - 1]) !== sign(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n monotoneAdjust(points, deltaK, mK);\n monotoneCompute(points, mK, indexAxis);\n}\nfunction capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n}\nfunction capBezierPoints(points, area) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for(i = 0, ilen = points.length; i < ilen; ++i){\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n/**\n * @private\n */ function _updateBezierControlPoints(points, options, area, loop, indexAxis) {\n let i, ilen, point, controlPoints;\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt)=>!pt.skip);\n }\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for(i = 0, ilen = points.length; i < ilen; ++i){\n point = points[i];\n controlPoints = splineCurve(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension);\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */ /**\n * @private\n */ function _isDomSupported() {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n/**\n * @private\n */ function _getParentNode(domNode) {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = parent.host;\n }\n return parent;\n}\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */ function parseMaxStyle(styleValue, node, parentProperty) {\n let valueInPixels;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n return valueInPixels;\n}\nconst getComputedStyle = (element)=>element.ownerDocument.defaultView.getComputedStyle(element, null);\nfunction getStyle(el, property) {\n return getComputedStyle(el).getPropertyValue(property);\n}\nconst positions = [\n 'top',\n 'right',\n 'bottom',\n 'left'\n];\nfunction getPositionedStyle(styles, style, suffix) {\n const result = {};\n suffix = suffix ? '-' + suffix : '';\n for(let i = 0; i < 4; i++){\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\nconst useOffsetPos = (x, y, target)=>(x > 0 || y > 0) && (!target || !target.shadowRoot);\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */ function getCanvasPosition(e, canvas) {\n const touches = e.touches;\n const source = touches && touches.length ? touches[0] : e;\n const { offsetX , offsetY } = source;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {\n x,\n y,\n box\n };\n}\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */ function getRelativePosition(event, chart) {\n if ('native' in event) {\n return event;\n }\n const { canvas , currentDevicePixelRatio } = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const { x , y , box } = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n let { width , height } = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\nfunction getContainerSize(canvas, width, height) {\n let maxWidth, maxHeight;\n if (width === undefined || height === undefined) {\n const container = _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\nconst round1 = (v)=>Math.round(v * 10) / 10;\n// eslint-disable-next-line complexity\nfunction getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let { width , height } = containerSize;\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n return {\n width,\n height\n };\n}\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */ function retinaScale(chart, forceRatio, forceStyle) {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n const canvas = chart.canvas;\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */ const supportsEventListenerOptions = function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive () {\n passiveSupported = true;\n return false;\n }\n };\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}();\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */ function readUsedSize(element, property) {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n\n/**\n * @private\n */ function _pointInLine(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n/**\n * @private\n */ function _steppedInterpolation(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y : mode === 'after' ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y\n };\n}\n/**\n * @private\n */ function _bezierInterpolation(p1, p2, t, mode) {\n const cp1 = {\n x: p1.cp2x,\n y: p1.cp2y\n };\n const cp2 = {\n x: p2.cp1x,\n y: p2.cp1y\n };\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n\nconst getRightToLeftAdapter = function(rectX, width) {\n return {\n x (x) {\n return rectX + rectX + width - x;\n },\n setWidth (w) {\n width = w;\n },\n textAlign (align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus (x, value) {\n return x - value;\n },\n leftForLtr (x, itemWidth) {\n return x - itemWidth;\n }\n };\n};\nconst getLeftToRightAdapter = function() {\n return {\n x (x) {\n return x;\n },\n setWidth (w) {},\n textAlign (align) {\n return align;\n },\n xPlus (x, value) {\n return x + value;\n },\n leftForLtr (x, _itemWidth) {\n return x;\n }\n };\n};\nfunction getRtlAdapter(rtl, rectX, width) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\nfunction overrideTextDirection(ctx, direction) {\n let style, original;\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction')\n ];\n style.setProperty('direction', direction, 'important');\n ctx.prevTextDirection = original;\n }\n}\nfunction restoreTextDirection(ctx, original) {\n if (original !== undefined) {\n delete ctx.prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle\n };\n }\n return {\n between: _isBetween,\n compare: (a, b)=>a - b,\n normalize: (x)=>x\n };\n}\nfunction normalizeSegment({ start , end , count , loop , style }) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\nfunction getSegment(segment, points, bounds) {\n const { property , start: startBound , end: endBound } = bounds;\n const { between , normalize } = propertyFn(property);\n const count = points.length;\n let { start , end , loop } = segment;\n let i, ilen;\n if (loop) {\n start += count;\n end += count;\n for(i = 0, ilen = count; i < ilen; ++i){\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n if (end < start) {\n end += count;\n }\n return {\n start,\n end,\n loop,\n style: segment.style\n };\n}\n function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [\n segment\n ];\n }\n const { property , start: startBound , end: endBound } = bounds;\n const count = points.length;\n const { compare , between , normalize } = propertyFn(property);\n const { start , end , loop , style } = getSegment(segment, points, bounds);\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n const startIsBefore = ()=>between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = ()=>compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = ()=>inside || startIsBefore();\n const shouldStop = ()=>!inside || endIsBefore();\n for(let i = start, prev = start; i <= end; ++i){\n point = points[i % count];\n if (point.skip) {\n continue;\n }\n value = normalize(point[property]);\n if (value === prevValue) {\n continue;\n }\n inside = between(value, startBound, endBound);\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({\n start: subStart,\n end: i,\n loop,\n count,\n style\n }));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n if (subStart !== null) {\n result.push(normalizeSegment({\n start: subStart,\n end,\n loop,\n count,\n style\n }));\n }\n return result;\n}\n function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n for(let i = 0; i < segments.length; i++){\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n function findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n if (loop && !spanGaps) {\n while(start < count && !points[start].skip){\n start++;\n }\n }\n while(start < count && points[start].skip){\n start++;\n }\n start %= count;\n if (loop) {\n end += start;\n }\n while(end > start && points[end % count].skip){\n end--;\n }\n end %= count;\n return {\n start,\n end\n };\n}\n function solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n for(end = start + 1; end <= max; ++end){\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({\n start: start % count,\n end: (end - 1) % count,\n loop\n });\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n if (last !== null) {\n result.push({\n start: start % count,\n end: last % count,\n loop\n });\n }\n return result;\n}\n function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n if (!count) {\n return [];\n }\n const loop = !!line._loop;\n const { start , end } = findStartAndEnd(points, count, loop, spanGaps);\n if (spanGaps === true) {\n return splitByStyles(line, [\n {\n start,\n end,\n loop\n }\n ], points, segmentOptions);\n }\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n function splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n function doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const { _datasetIndex: datasetIndex , options: { spanGaps } } = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n s += count;\n while(points[s % count].skip){\n s -= dir;\n }\n while(points[e % count].skip){\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({\n start: s % count,\n end: e % count,\n loop: l,\n style: st\n });\n prevStyle = st;\n start = e % count;\n }\n }\n for (const segment of segments){\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for(i = start + 1; i <= segment.end; i++){\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n return result;\n}\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\nfunction styleChanged(style, prevStyle) {\n if (!prevStyle) {\n return false;\n }\n const cache = [];\n const replacer = function(key, value) {\n if (!isPatternOrGradient(value)) {\n return value;\n }\n if (!cache.includes(value)) {\n cache.push(value);\n }\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n\nexport { unclipArea as $, _rlookupByKey as A, _lookupByKey as B, _isPointInArea as C, getAngleFromPoint as D, toPadding as E, each as F, getMaximumSize as G, HALF_PI as H, _getParentNode as I, readUsedSize as J, supportsEventListenerOptions as K, throttled as L, _isDomSupported as M, _factorize as N, finiteOrDefault as O, PI as P, callback as Q, _addGrace as R, _limitValue as S, TAU as T, toDegrees as U, _measureText as V, _int16Range as W, _alignPixel as X, clipArea as Y, renderText as Z, _arrayUnique as _, resolve as a, fontString as a$, toFont as a0, _toLeftRightCenter as a1, _alignStartEnd as a2, overrides as a3, merge as a4, _capitalize as a5, descriptors as a6, isFunction as a7, _attachContext as a8, _createResolver as a9, overrideTextDirection as aA, _textX as aB, restoreTextDirection as aC, drawPointLegend as aD, distanceBetweenPoints as aE, noop as aF, _setMinAndMaxByKey as aG, niceNum as aH, almostWhole as aI, almostEquals as aJ, _decimalPlaces as aK, Ticks as aL, log10 as aM, _longestText as aN, _filterBetween as aO, _lookup as aP, isPatternOrGradient as aQ, getHoverColor as aR, clone as aS, _merger as aT, _mergerIf as aU, _deprecated as aV, _splitKey as aW, toFontString as aX, splineCurve as aY, splineCurveMonotone as aZ, getStyle as a_, _descriptors as aa, mergeIf as ab, uid as ac, debounce as ad, retinaScale as ae, clearCanvas as af, setsEqual as ag, _elementsEqual as ah, _isClickEvent as ai, _isBetween as aj, _readValueToProps as ak, _updateBezierControlPoints as al, _computeSegments as am, _boundSegments as an, _steppedInterpolation as ao, _bezierInterpolation as ap, _pointInLine as aq, _steppedLineTo as ar, _bezierCurveTo as as, drawPoint as at, addRoundedRectPath as au, toTRBL as av, toTRBLCorners as aw, _boundSegment as ax, _normalizeAngle as ay, getRtlAdapter as az, isArray as b, toLineHeight as b0, PITAU as b1, INFINITY as b2, RAD_PER_DEG as b3, QUARTER_PI as b4, TWO_THIRDS_PI as b5, _angleDiff as b6, color as c, defaults as d, effects as e, resolveObjectKey as f, isNumberFinite as g, defined as h, isObject as i, createContext as j, isNullOrUndef as k, listenArrayEvents as l, toPercentage as m, toDimension as n, formatNumber as o, _angleBetween as p, _getStartAndCountOfVisiblePoints as q, requestAnimFrame as r, sign as s, toRadians as t, unlistenArrayEvents as u, valueOrDefault as v, _scaleRangesChanged as w, isNumber as x, _parseObjectDataRadialScale as y, getRelativePosition as z };\n//# sourceMappingURL=helpers.segment.js.map\n","/**\n * @namespace Chart.helpers\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ActiveDataPoint, ChartEvent} from '../types/index.js';\n\n/**\n * An empty function that can be used, for example, for optional callback.\n */\nexport function noop() {\n /* noop */\n}\n\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */\nexport const uid = (() => {\n let id = 0;\n return () => id++;\n})();\n\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isNullOrUndef(value: unknown): value is null | undefined {\n return value === null || typeof value === 'undefined';\n}\n\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */\nexport function isArray(value: unknown): value is T[] {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isObject(value: unknown): value is AnyObject {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */\nfunction isNumberFinite(value: unknown): value is number {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\nexport {\n isNumberFinite as isFinite,\n};\n\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */\nexport function finiteOrDefault(value: unknown, defaultValue: number) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */\nexport function valueOrDefault(value: T | undefined, defaultValue: T) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\n\nexport const toPercentage = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100\n : +value / dimension;\n\nexport const toDimension = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100 * dimension\n : +value;\n\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */\nexport function callback R, TA, R>(\n fn: T | undefined,\n args: unknown[],\n thisArg?: TA\n): R | undefined {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\n\n/**\n * Note(SB) for performance sake, this method should only be used when loopable type\n * is unknown or in none intensive code (not called often and small loopable). Else\n * it's preferable to use a regular for() loop and save extra function calls.\n * @param loopable - The object or array to be iterated.\n * @param fn - The function to call for each item.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n * @param [reverse] - If true, iterates backward on the loopable.\n */\nexport function each(\n loopable: Record,\n fn: (this: TA, v: T, i: string) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each(\n loopable: T[],\n fn: (this: TA, v: T, i: number) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each(\n loopable: T[] | Record,\n fn: (this: TA, v: T, i: any) => void,\n thisArg?: TA,\n reverse?: boolean\n) {\n let i: number, len: number, keys: string[];\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for (i = len - 1; i >= 0; i--) {\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */\nexport function _elementsEqual(a0: ActiveDataPoint[], a1: ActiveDataPoint[]) {\n let i: number, ilen: number, v0: ActiveDataPoint, v1: ActiveDataPoint;\n\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n\n for (i = 0, ilen = a0.length; i < ilen; ++i) {\n v0 = a0[i];\n v1 = a1[i];\n\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */\nexport function clone(source: T): T {\n if (isArray(source)) {\n return source.map(clone) as unknown as T;\n }\n\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n\n for (; k < klen; ++k) {\n target[keys[k]] = clone(source[keys[k]]);\n }\n\n return target;\n }\n\n return source;\n}\n\nfunction isValidKey(key: string) {\n return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;\n}\n\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */\nexport function _merger(key: string, target: AnyObject, source: AnyObject, options: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone(sval);\n }\n}\n\nexport interface MergeOptions {\n merger?: (key: string, target: AnyObject, source: AnyObject, options?: AnyObject) => void;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` with the given `options`.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @param [options] - Merging options:\n * @param [options.merger] - The merge method (key, target, source, options)\n * @returns The `target` object.\n */\nexport function merge(target: T, source: [], options?: MergeOptions): T;\nexport function merge(target: T, source: S1, options?: MergeOptions): T & S1;\nexport function merge(target: T, source: [S1], options?: MergeOptions): T & S1;\nexport function merge(target: T, source: [S1, S2], options?: MergeOptions): T & S1 & S2;\nexport function merge(target: T, source: [S1, S2, S3], options?: MergeOptions): T & S1 & S2 & S3;\nexport function merge(\n target: T,\n source: [S1, S2, S3, S4],\n options?: MergeOptions\n): T & S1 & S2 & S3 & S4;\nexport function merge(target: T, source: AnyObject[], options?: MergeOptions): AnyObject;\nexport function merge(target: T, source: AnyObject[], options?: MergeOptions): AnyObject {\n const sources = isArray(source) ? source : [source];\n const ilen = sources.length;\n\n if (!isObject(target)) {\n return target as AnyObject;\n }\n\n options = options || {};\n const merger = options.merger || _merger;\n let current: AnyObject;\n\n for (let i = 0; i < ilen; ++i) {\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n\n const keys = Object.keys(current);\n for (let k = 0, klen = keys.length; k < klen; ++k) {\n merger(keys[k], target, current, options as AnyObject);\n }\n }\n\n return target;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` *only* if not defined in target.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @returns The `target` object.\n */\nexport function mergeIf(target: T, source: []): T;\nexport function mergeIf(target: T, source: S1): T & S1;\nexport function mergeIf(target: T, source: [S1]): T & S1;\nexport function mergeIf(target: T, source: [S1, S2]): T & S1 & S2;\nexport function mergeIf(target: T, source: [S1, S2, S3]): T & S1 & S2 & S3;\nexport function mergeIf(target: T, source: [S1, S2, S3, S4]): T & S1 & S2 & S3 & S4;\nexport function mergeIf(target: T, source: AnyObject[]): AnyObject;\nexport function mergeIf(target: T, source: AnyObject[]): AnyObject {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge(target, source, {merger: _mergerIf});\n}\n\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */\nexport function _mergerIf(key: string, target: AnyObject, source: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone(sval);\n }\n}\n\n/**\n * @private\n */\nexport function _deprecated(scope: string, value: unknown, previous: string, current: string) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous +\n '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': v => v,\n // default resolvers\n x: o => o.x,\n y: o => o.y\n};\n\n/**\n * @private\n */\nexport function _splitKey(key: string) {\n const parts = key.split('.');\n const keys: string[] = [];\n let tmp = '';\n for (const part of parts) {\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\n\nfunction _getKeyResolver(key: string) {\n const keys = _splitKey(key);\n return obj => {\n for (const k of keys) {\n if (k === '') {\n // For backward compatibility:\n // Chart.helpers.core resolveObjectKey should break at empty key\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\n\nexport function resolveObjectKey(obj: AnyObject, key: string): any {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n\n/**\n * @private\n */\nexport function _capitalize(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n\nexport const defined = (value: unknown) => typeof value !== 'undefined';\n\nexport const isFunction = (value: unknown): value is (...args: any[]) => any => typeof value === 'function';\n\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nexport const setsEqual = (a: Set, b: Set) => {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const item of a) {\n if (!b.has(item)) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * @param e - The event\n * @private\n */\nexport function _isClickEvent(e: ChartEvent) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n","import type {Point} from '../types/geometric.js';\nimport {isFinite as isFiniteNumber} from './helpers.core.js';\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */\n\nexport const PI = Math.PI;\nexport const TAU = 2 * PI;\nexport const PITAU = TAU + PI;\nexport const INFINITY = Number.POSITIVE_INFINITY;\nexport const RAD_PER_DEG = PI / 180;\nexport const HALF_PI = PI / 2;\nexport const QUARTER_PI = PI / 4;\nexport const TWO_THIRDS_PI = PI * 2 / 3;\n\nexport const log10 = Math.log10;\nexport const sign = Math.sign;\n\nexport function almostEquals(x: number, y: number, epsilon: number) {\n return Math.abs(x - y) < epsilon;\n}\n\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */\nexport function niceNum(range: number) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */\nexport function _factorize(value: number) {\n const result: number[] = [];\n const sqrt = Math.sqrt(value);\n let i: number;\n\n for (i = 1; i < sqrt; i++) {\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) { // if value is a square number\n result.push(sqrt);\n }\n\n result.sort((a, b) => a - b).pop();\n return result;\n}\n\nexport function isNumber(n: unknown): n is number {\n return !isNaN(parseFloat(n as string)) && isFinite(n as number);\n}\n\nexport function almostWhole(x: number, epsilon: number) {\n const rounded = Math.round(x);\n return ((rounded - epsilon) <= x) && ((rounded + epsilon) >= x);\n}\n\n/**\n * @private\n */\nexport function _setMinAndMaxByKey(\n array: Record[],\n target: { min: number, max: number },\n property: string\n) {\n let i: number, ilen: number, value: number;\n\n for (i = 0, ilen = array.length; i < ilen; i++) {\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\n\nexport function toRadians(degrees: number) {\n return degrees * (PI / 180);\n}\n\nexport function toDegrees(radians: number) {\n return radians * (180 / PI);\n}\n\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */\nexport function _decimalPlaces(x: number) {\n if (!isFiniteNumber(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while (Math.round(x * e) / e !== x) {\n e *= 10;\n p++;\n }\n return p;\n}\n\n// Gets the angle from vertical upright to the point about a centre.\nexport function getAngleFromPoint(\n centrePoint: Point,\n anglePoint: Point\n) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n\n if (angle < (-0.5 * PI)) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\n\nexport function distanceBetweenPoints(pt1: Point, pt2: Point) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */\nexport function _angleDiff(a: number, b: number) {\n return (a - b + PITAU) % TAU - PI;\n}\n\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */\nexport function _normalizeAngle(a: number) {\n return (a % TAU + TAU) % TAU;\n}\n\n/**\n * @private\n */\nexport function _angleBetween(angle: number, start: number, end: number, sameAngleIsFullCircle?: boolean) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || (sameAngleIsFullCircle && s === e)\n || (angleToStart > angleToEnd && startToAngle < endToAngle);\n}\n\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */\nexport function _limitValue(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\n/**\n * @param {number} value\n * @private\n */\nexport function _int16Range(value: number) {\n return _limitValue(value, -32768, 32767);\n}\n\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */\nexport function _isBetween(value: number, start: number, end: number, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n","import {_capitalize} from './helpers.core.js';\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param value - value to find\n * @param cmp\n * @private\n */\nexport function _lookup(\n table: number[],\n value: number,\n cmp?: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup(\n table: T[],\n value: number,\n cmp: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup(\n table: unknown[],\n value: number,\n cmp?: (value: number) => boolean\n) {\n cmp = cmp || ((index) => table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid: number;\n\n while (hi - lo > 1) {\n mid = (lo + hi) >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n\n return {lo, hi};\n}\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */\nexport const _lookupByKey = (\n table: Record[],\n key: string,\n value: number,\n last?: boolean\n) =>\n _lookup(table, value, last\n ? index => {\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n }\n : index => table[index][key] < value);\n\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */\nexport const _rlookupByKey = (\n table: Record[],\n key: string,\n value: number\n) =>\n _lookup(table, value, index => table[index][key] >= value);\n\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */\nexport function _filterBetween(values: number[], min: number, max: number) {\n let start = 0;\n let end = values.length;\n\n while (start < end && values[start] < min) {\n start++;\n }\n while (end > start && values[end - 1] > max) {\n end--;\n }\n\n return start > 0 || end < values.length\n ? values.slice(start, end)\n : values;\n}\n\nconst arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'] as const;\n\nexport interface ArrayListener {\n _onDataPush?(...item: T[]): void;\n _onDataPop?(): void;\n _onDataShift?(): void;\n _onDataSplice?(index: number, deleteCount: number, ...items: T[]): void;\n _onDataUnshift?(...item: T[]): void;\n}\n\n/**\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\n * called on the '_onData*' callbacks (e.g. _onDataPush, etc.) with same arguments.\n */\nexport function listenArrayEvents(array: T[], listener: ArrayListener): void;\nexport function listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n\n arrayEvents.forEach((key) => {\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value(...args) {\n const res = base.apply(this, args);\n\n array._chartjs.listeners.forEach((object) => {\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n\n return res;\n }\n });\n });\n}\n\n\n/**\n * Removes the given array event listener and cleanup extra attached properties (such as\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\n */\nexport function unlistenArrayEvents(array: T[], listener: ArrayListener): void;\nexport function unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n\n if (listeners.length > 0) {\n return;\n }\n\n arrayEvents.forEach((key) => {\n delete array[key];\n });\n\n delete array._chartjs;\n}\n\n/**\n * @param items\n */\nexport function _arrayUnique(items: T[]) {\n const set = new Set(items);\n\n if (set.size === items.length) {\n return items;\n }\n\n return Array.from(set);\n}\n","import type {ChartMeta, PointElement} from '../types/index.js';\n\nimport {_limitValue} from './helpers.math.js';\nimport {_lookupByKey} from './helpers.collection.js';\n\nexport function fontString(pixelSize: number, fontStyle: string, fontFamily: string) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n\n/**\n* Request animation polyfill\n*/\nexport const requestAnimFrame = (function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}());\n\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */\nexport function throttled>(\n fn: (...args: TArgs) => void,\n thisArg: any,\n) {\n let argsToUse = [] as TArgs;\n let ticking = false;\n\n return function(...args: TArgs) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, () => {\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n\n/**\n * Debounces calling `fn` for `delay` ms\n */\nexport function debounce>(fn: (...args: TArgs) => void, delay: number) {\n let timeout;\n return function(...args: TArgs) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */\nexport const _toLeftRightCenter = (align: 'start' | 'end' | 'center') => align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */\nexport const _alignStartEnd = (align: 'start' | 'end' | 'center', start: number, end: number) => align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */\nexport const _textX = (align: 'left' | 'right' | 'center', left: number, right: number, rtl: boolean) => {\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n\n/**\n * Return start and count of visible points.\n * @private\n */\nexport function _getStartAndCountOfVisiblePoints(meta: ChartMeta<'line' | 'scatter'>, points: PointElement[], animationsDisabled: boolean) {\n const pointCount = points.length;\n\n let start = 0;\n let count = pointCount;\n\n if (meta._sorted) {\n const {iScale, _parsed} = meta;\n const axis = iScale.axis;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(Math.min(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, axis, min).lo,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo),\n 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1),\n start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n\n return {start, count};\n}\n\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */\nexport function _scaleRangesChanged(meta) {\n const {xScale, yScale, _scaleRanges} = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min\n\t\t|| _scaleRanges.xmax !== xScale.max\n\t\t|| _scaleRanges.ymin !== yScale.min\n\t\t|| _scaleRanges.ymax !== yScale.max;\n\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n","import {PI, TAU, HALF_PI} from './helpers.math.js';\n\nconst atEdge = (t: number) => t === 0 || t === 1;\nconst elasticIn = (t: number, s: number, p: number) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t: number, s: number, p: number) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */\nconst effects = {\n linear: (t: number) => t,\n\n easeInQuad: (t: number) => t * t,\n\n easeOutQuad: (t: number) => -t * (t - 2),\n\n easeInOutQuad: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t\n : -0.5 * ((--t) * (t - 2) - 1),\n\n easeInCubic: (t: number) => t * t * t,\n\n easeOutCubic: (t: number) => (t -= 1) * t * t + 1,\n\n easeInOutCubic: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t\n : 0.5 * ((t -= 2) * t * t + 2),\n\n easeInQuart: (t: number) => t * t * t * t,\n\n easeOutQuart: (t: number) => -((t -= 1) * t * t * t - 1),\n\n easeInOutQuart: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t\n : -0.5 * ((t -= 2) * t * t * t - 2),\n\n easeInQuint: (t: number) => t * t * t * t * t,\n\n easeOutQuint: (t: number) => (t -= 1) * t * t * t * t + 1,\n\n easeInOutQuint: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t * t\n : 0.5 * ((t -= 2) * t * t * t * t + 2),\n\n easeInSine: (t: number) => -Math.cos(t * HALF_PI) + 1,\n\n easeOutSine: (t: number) => Math.sin(t * HALF_PI),\n\n easeInOutSine: (t: number) => -0.5 * (Math.cos(PI * t) - 1),\n\n easeInExpo: (t: number) => (t === 0) ? 0 : Math.pow(2, 10 * (t - 1)),\n\n easeOutExpo: (t: number) => (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1,\n\n easeInOutExpo: (t: number) => atEdge(t) ? t : t < 0.5\n ? 0.5 * Math.pow(2, 10 * (t * 2 - 1))\n : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n\n easeInCirc: (t: number) => (t >= 1) ? t : -(Math.sqrt(1 - t * t) - 1),\n\n easeOutCirc: (t: number) => Math.sqrt(1 - (t -= 1) * t),\n\n easeInOutCirc: (t: number) => ((t /= 0.5) < 1)\n ? -0.5 * (Math.sqrt(1 - t * t) - 1)\n : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n\n easeInElastic: (t: number) => atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n\n easeOutElastic: (t: number) => atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n\n easeInOutElastic(t: number) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t :\n t < 0.5\n ? 0.5 * elasticIn(t * 2, s, p)\n : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n\n easeInBack(t: number) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n\n easeOutBack(t: number) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n\n easeInOutBack(t: number) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n },\n\n easeInBounce: (t: number) => 1 - effects.easeOutBounce(1 - t),\n\n easeOutBounce(t: number) {\n const m = 7.5625;\n const d = 2.75;\n if (t < (1 / d)) {\n return m * t * t;\n }\n if (t < (2 / d)) {\n return m * (t -= (1.5 / d)) * t + 0.75;\n }\n if (t < (2.5 / d)) {\n return m * (t -= (2.25 / d)) * t + 0.9375;\n }\n return m * (t -= (2.625 / d)) * t + 0.984375;\n },\n\n easeInOutBounce: (t: number) => (t < 0.5)\n ? effects.easeInBounce(t * 2) * 0.5\n : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5,\n} as const;\n\nexport type EasingFunction = keyof typeof effects\n\nexport default effects;\n","import {Color} from '@kurkle/color';\n\nexport function isPatternOrGradient(value: unknown): value is CanvasPattern | CanvasGradient {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n\n return false;\n}\n\nexport function color(value: CanvasGradient): CanvasGradient;\nexport function color(value: CanvasPattern): CanvasPattern;\nexport function color(\n value:\n | string\n | { r: number; g: number; b: number; a: number }\n | [number, number, number]\n | [number, number, number, number]\n): Color;\nexport function color(value) {\n return isPatternOrGradient(value) ? value : new Color(value);\n}\n\nexport function getHoverColor(value: CanvasGradient): CanvasGradient;\nexport function getHoverColor(value: CanvasPattern): CanvasPattern;\nexport function getHoverColor(value: string): string;\nexport function getHoverColor(value) {\n return isPatternOrGradient(value)\n ? value\n : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n","const numbers = ['x', 'y', 'borderWidth', 'radius', 'tension'];\nconst colors = ['color', 'borderColor', 'backgroundColor'];\n\nexport function applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined,\n });\n\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name) => name !== 'onProgress' && name !== 'onComplete' && name !== 'fn',\n });\n\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n },\n });\n\n defaults.describe('animations', {\n _fallback: 'animation',\n });\n\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0 // show immediately\n },\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: v => v | 0 // for keeping the dataset visible all the way through the animation\n },\n }\n }\n });\n}\n","export function applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n","\nconst intlCache = new Map();\n\nfunction getNumberFormat(locale: string, options?: Intl.NumberFormatOptions) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\n\nexport function formatNumber(num: number, locale: string, options?: Intl.NumberFormatOptions) {\n return getNumberFormat(locale, options).format(num);\n}\n","import {isArray} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {log10} from '../helpers/helpers.math.js';\n\n/**\n * Namespace to hold formatters for different types of ticks\n * @namespace Chart.Ticks.formatters\n */\nconst formatters = {\n /**\n * Formatter for value labels\n * @method Chart.Ticks.formatters.values\n * @param value the value to display\n * @return {string|string[]} the label to display\n */\n values(value) {\n return isArray(value) ? /** @type {string[]} */ (value) : '' + value;\n },\n\n /**\n * Formatter for numeric ticks\n * @method Chart.Ticks.formatters.numeric\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n numeric(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0'; // never show decimal places for 0\n }\n\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue; // This is used when there are less than 2 ticks as the tick interval.\n\n if (ticks.length > 1) {\n // all ticks are small or there huge numbers; use scientific notation\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n\n delta = calculateDelta(tickValue, ticks);\n }\n\n const logDelta = log10(Math.abs(delta));\n\n // When datasets have values approaching Number.MAX_VALUE, the tick calculations might result in\n // infinity and eventually NaN. Passing NaN for minimumFractionDigits or maximumFractionDigits\n // will make the number formatter throw. So instead we check for isNaN and use a fallback value.\n //\n // toFixed has a max of 20 decimal places\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n\n const options = {notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal};\n Object.assign(options, this.options.ticks.format);\n\n return formatNumber(tickValue, locale, options);\n },\n\n\n /**\n * Formatter for logarithmic ticks\n * @method Chart.Ticks.formatters.logarithmic\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n logarithmic(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || (tickValue / (Math.pow(10, Math.floor(log10(tickValue)))));\n if ([1, 2, 3, 5, 10, 15].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n\n};\n\n\nfunction calculateDelta(tickValue, ticks) {\n // Figure out how many digits to show\n // The space between the first two ticks might be smaller than normal spacing\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n\n // If we have a number like 2.5 as the delta, figure out how many decimal places we need\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n // not an integer\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n\n/**\n * Namespace to hold static tick generation functions\n * @namespace Chart.Ticks\n */\nexport default {formatters};\n","import Ticks from './core.ticks.js';\n\nexport function applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 3.0.0\n */\n bounds: 'ticks',\n\n clip: true,\n\n /**\n * Addition grace added to max and reduced from min data value.\n * @since 3.0.0\n */\n grace: 0,\n\n // grid line settings\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options) => options.lineWidth,\n tickColor: (_ctx, options) => options.color,\n offset: false,\n },\n\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n\n // scale title\n title: {\n // display property\n display: false,\n\n // actual label\n text: '',\n\n // top/bottom padding\n padding: {\n top: 4,\n bottom: 4\n }\n },\n\n // label settings\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2,\n }\n });\n\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name) => !name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name) => name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash',\n });\n\n defaults.describe('scales', {\n _fallback: 'scale',\n });\n\n defaults.describe('scale.ticks', {\n _scriptable: (name) => name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name) => name !== 'backdropPadding',\n });\n}\n","import {getHoverColor} from '../helpers/helpers.color.js';\nimport {isObject, merge, valueOrDefault} from '../helpers/helpers.core.js';\nimport {applyAnimationsDefaults} from './core.animations.defaults.js';\nimport {applyLayoutsDefaults} from './core.layouts.defaults.js';\nimport {applyScaleDefaults} from './core.scale.defaults.js';\n\nexport const overrides = Object.create(null);\nexport const descriptors = Object.create(null);\n\n/**\n * @param {object} node\n * @param {string} key\n * @return {object}\n */\nfunction getScope(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for (let i = 0, n = keys.length; i < n; ++i) {\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\n\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope(root, scope), values);\n }\n return merge(getScope(root, ''), scope);\n}\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Defaults {\n constructor(_descriptors, _appliers) {\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options) => getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n set(scope, values) {\n return set(this, scope, values);\n }\n\n /**\n\t * @param {string} scope\n\t */\n get(scope) {\n return getScope(this, scope);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n\n override(scope, values) {\n return set(overrides, scope, values);\n }\n\n /**\n\t * Routes the named defaults to fallback to another scope/name.\n\t * This routing is useful when those target values, like defaults.color, are changed runtime.\n\t * If the values would be copied, the runtime change would not take effect. By routing, the\n\t * fallback is evaluated at each access, so its always up to date.\n\t *\n\t * Example:\n\t *\n\t * \tdefaults.route('elements.arc', 'backgroundColor', '', 'color')\n\t * - reads the backgroundColor from defaults.color when undefined locally\n\t *\n\t * @param {string} scope Scope this route applies to.\n\t * @param {string} name Property name that should be routed to different namespace when not defined here.\n\t * @param {string} targetScope The namespace where those properties should be routed to.\n\t * Empty string ('') is the root of defaults.\n\t * @param {string} targetName The target name in the target scope the property should be routed to.\n\t */\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope(this, scope);\n const targetScopeObject = getScope(this, targetScope);\n const privateName = '_' + name;\n\n Object.defineProperties(scopeObject, {\n // A private property is defined to hold the actual value, when this property is set in its scope (set in the setter)\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n // The actual property is defined as getter/setter so we can do the routing when value is not locally set.\n [name]: {\n enumerable: true,\n get() {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set(value) {\n this[privateName] = value;\n }\n }\n });\n }\n\n apply(appliers) {\n appliers.forEach((apply) => apply(this));\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Defaults({\n _scriptable: (name) => !name.startsWith('on'),\n _indexable: (name) => name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false,\n }\n}, [applyAnimationsDefaults, applyLayoutsDefaults, applyScaleDefaults]);\n","import type {\n Chart,\n Point,\n FontSpec,\n CanvasFontSpec,\n PointStyle,\n RenderTextOpts,\n BackdropOptions\n} from '../types/index.js';\nimport type {\n TRBL,\n SplinePoint,\n RoundedRect,\n TRBLCorners\n} from '../types/geometric.js';\nimport {isArray, isNullOrUndef} from './helpers.core.js';\nimport {PI, TAU, HALF_PI, QUARTER_PI, TWO_THIRDS_PI, RAD_PER_DEG} from './helpers.math.js';\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */\nexport function toFontString(font: FontSpec) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n\n return (font.style ? font.style + ' ' : '')\n\t\t+ (font.weight ? font.weight + ' ' : '')\n\t\t+ font.size + 'px '\n\t\t+ font.family;\n}\n\n/**\n * @private\n */\nexport function _measureText(\n ctx: CanvasRenderingContext2D,\n data: Record,\n gc: string[],\n longest: number,\n string: string\n) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n\ntype Thing = string | undefined | null\ntype Things = (Thing | Thing[])[]\n\n/**\n * @private\n */\n// eslint-disable-next-line complexity\nexport function _longestText(\n ctx: CanvasRenderingContext2D,\n font: string,\n arrayOfThings: Things,\n cache?: {data?: Record, garbageCollect?: string[], font?: string}\n) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n\n ctx.save();\n\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i: number, j: number, jlen: number, thing: Thing | Thing[], nestedThing: Thing | Thing[];\n for (i = 0; i < ilen; i++) {\n thing = arrayOfThings[i];\n\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !isArray(thing)) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for (j = 0, jlen = thing.length; j < jlen; j++) {\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n\n ctx.restore();\n\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for (i = 0; i < gcLen; i++) {\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */\nexport function _alignPixel(chart: Chart, pixel: number, width: number) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n\n/**\n * Clears the entire canvas.\n */\nexport function clearCanvas(canvas: HTMLCanvasElement, ctx?: CanvasRenderingContext2D) {\n ctx = ctx || canvas.getContext('2d');\n\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\n\nexport interface DrawPointOptions {\n pointStyle: PointStyle;\n rotation?: number;\n radius: number;\n borderWidth: number;\n}\n\nexport function drawPoint(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number\n) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n drawPointLegend(ctx, options, x, y, null);\n}\n\n// eslint-disable-next-line complexity\nexport function drawPointLegend(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number,\n w: number\n) {\n let type: string, xOffset: number, yOffset: number, size: number, cornerRadius: number, width: number, xOffsetW: number, yOffsetW: number;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n\n ctx.beginPath();\n\n switch (style) {\n // Default includes circle\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n /* falls through */\n case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n /* falls through */\n case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */\nexport function _isPointInArea(\n point: Point,\n area: TRBL,\n margin?: number\n) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n\n return !area || (point && point.x > area.left - margin && point.x < area.right + margin &&\n\t\tpoint.y > area.top - margin && point.y < area.bottom + margin);\n}\n\nexport function clipArea(ctx: CanvasRenderingContext2D, area: TRBL) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\n\nexport function unclipArea(ctx: CanvasRenderingContext2D) {\n ctx.restore();\n}\n\n/**\n * @private\n */\nexport function _steppedLineTo(\n ctx: CanvasRenderingContext2D,\n previous: Point,\n target: Point,\n flip?: boolean,\n mode?: string\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @private\n */\nexport function _bezierCurveTo(\n ctx: CanvasRenderingContext2D,\n previous: SplinePoint,\n target: SplinePoint,\n flip?: boolean\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(\n flip ? previous.cp1x : previous.cp2x,\n flip ? previous.cp1y : previous.cp2y,\n flip ? target.cp2x : target.cp1x,\n flip ? target.cp2y : target.cp1y,\n target.x,\n target.y);\n}\n\nfunction setRenderOpts(ctx: CanvasRenderingContext2D, opts: RenderTextOpts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\n\nfunction decorateText(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n line: string,\n opts: RenderTextOpts\n) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */\n const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\n\nfunction drawBackdrop(ctx: CanvasRenderingContext2D, opts: BackdropOptions) {\n const oldColor = ctx.fillStyle;\n\n ctx.fillStyle = opts.color as string;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n\n/**\n * Render text onto the canvas\n */\nexport function renderText(\n ctx: CanvasRenderingContext2D,\n text: string | string[],\n x: number,\n y: number,\n font: CanvasFontSpec,\n opts: RenderTextOpts = {}\n) {\n const lines = isArray(text) ? text : [text];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i: number, line: string;\n\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n\n for (i = 0; i < lines.length; ++i) {\n line = lines[i];\n\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n\n y += Number(font.lineHeight);\n }\n\n ctx.restore();\n}\n\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */\nexport function addRoundedRectPath(\n ctx: CanvasRenderingContext2D,\n rect: RoundedRect & { radius: TRBLCorners }\n) {\n const {x, y, w, h, radius} = rect;\n\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\n","import defaults from '../core/core.defaults.js';\nimport {isArray, isObject, toDimension, valueOrDefault} from './helpers.core.js';\nimport {toFontString} from './helpers.canvas.js';\nimport type {ChartArea, FontSpec, Point} from '../types/index.js';\nimport type {TRBL, TRBLCorners} from '../types/geometric.js';\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n\n/**\n * @alias Chart.helpers.options\n * @namespace\n */\n/**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */\nexport function toLineHeight(value: number | string, size: number): number {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n\n value = +matches[2];\n\n switch (matches[3]) {\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n default:\n break;\n }\n\n return size * value;\n}\n\nconst numberOrZero = (v: unknown) => +v || 0;\n\n/**\n * @param value\n * @param props\n */\nexport function _readValueToProps(value: number | Record, props: K[]): Record;\nexport function _readValueToProps(value: number | Record, props: Record): Record;\nexport function _readValueToProps(value: number | Record, props: string[] | Record) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value)\n ? objProps\n ? prop => valueOrDefault(value[prop], value[props[prop]])\n : prop => value[prop]\n : () => value;\n\n for (const prop of keys) {\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */\nexport function toTRBL(value: number | TRBL | Point) {\n return _readValueToProps(value, {top: 'y', right: 'x', bottom: 'y', left: 'x'});\n}\n\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */\nexport function toTRBLCorners(value: number | TRBLCorners) {\n return _readValueToProps(value, ['topLeft', 'topRight', 'bottomLeft', 'bottomRight']);\n}\n\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */\nexport function toPadding(value?: number | TRBL): ChartArea {\n const obj = toTRBL(value) as ChartArea;\n\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n\n return obj;\n}\n\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */\n\nexport function toFont(options: Partial, fallback?: Partial) {\n options = options || {};\n fallback = fallback || defaults.font as FontSpec;\n\n let size = valueOrDefault(options.size, fallback.size);\n\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n\n font.string = toFontString(font);\n return font;\n}\n\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */\nexport function resolve(inputs: Array, context?: object, index?: number, info?: { cacheable: boolean }) {\n let cacheable = true;\n let i: number, ilen: number, value: unknown;\n\n for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */\nexport function _addGrace(minmax: { min: number; max: number; }, grace: number | string, beginAtZero: boolean) {\n const {min, max} = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value: number, add: number) => beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\n\n/**\n * Create a context inheriting parentContext\n * @param parentContext\n * @param context\n * @returns\n */\nexport function createContext(parentContext: null, context: T): T;\nexport function createContext(parentContext: P, context: T): P & T;\nexport function createContext(parentContext: object, context: object) {\n return Object.assign(Object.create(parentContext), context);\n}\n","/* eslint-disable @typescript-eslint/no-use-before-define */\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartMeta} from '../types/index.js';\nimport type {\n ResolverObjectKey,\n ResolverCache,\n ResolverProxy,\n DescriptorDefaults,\n Descriptor,\n ContextCache,\n ContextProxy\n} from './helpers.config.types.js';\nimport {isArray, isFunction, isObject, resolveObjectKey, _capitalize} from './helpers.core.js';\n\nexport * from './helpers.config.types.js';\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */\nexport function _createResolver<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n scopes: T,\n prefixes = [''],\n rootScopes?: R,\n fallback?: ResolverObjectKey,\n getTarget = () => scopes[0]\n) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === 'undefined') {\n fallback = _resolve('_fallback', scopes);\n }\n const cache: ResolverCache = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope: AnyObject) => _createResolver([scope, ...scopes], prefixes, finalRootScopes, fallback),\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop: string) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string) {\n return _cached(target, prop,\n () => _resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop: string) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys(target) {\n return getKeysFromAllScopes(target);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop: string, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n }) as ResolverProxy;\n}\n\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */\nexport function _attachContext<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n proxy: ResolverProxy,\n context: AnyObject,\n subProxy?: ResolverProxy,\n descriptorDefaults?: DescriptorDefaults\n) {\n const cache: ContextCache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx: AnyObject) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope: AnyObject) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string, receiver) {\n return _cached(target, prop,\n () => _resolveWithContext(target, prop, receiver));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return target._descriptors.allKeys\n ? Reflect.has(proxy, prop) ? {enumerable: true, configurable: true} : undefined\n : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(proxy);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop) {\n return Reflect.has(proxy, prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys() {\n return Reflect.ownKeys(proxy);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n }) as ContextProxy;\n}\n\n/**\n * @private\n */\nexport function _descriptors(\n proxy: ResolverCache,\n defaults: DescriptorDefaults = {scriptable: true, indexable: true}\n): Descriptor {\n const {_scriptable = defaults.scriptable, _indexable = defaults.indexable, _allKeys = defaults.allKeys} = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : () => _indexable\n };\n}\n\nconst readKey = (prefix: string, name: string) => prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop: string, value: unknown) => isObject(value) && prop !== 'adapters' &&\n (Object.getPrototypeOf(value) === null || value.constructor === Object);\n\nfunction _cached(\n target: AnyObject,\n prop: string,\n resolve: () => unknown\n) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) {\n return target[prop];\n }\n\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\n\nfunction _resolveWithContext(\n target: ContextCache,\n prop: string,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n let value = _proxy[prop]; // resolve from proxy\n\n // resolve with context\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n // if the resolved value is an object, create a sub resolver for it\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\n\nfunction _resolveScriptable(\n prop: string,\n getValue: (ctx: AnyObject, sub: AnyObject) => unknown,\n target: ContextCache,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _stack} = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n // When scriptable option returns an object, create a resolver on that.\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\n\nfunction _resolveArray(\n prop: string,\n value: unknown[],\n target: ContextCache,\n isIndexable: (key: string) => boolean\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n\n if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n return value[_context.index % value.length];\n } else if (isObject(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter(s => s !== arr);\n value = [];\n for (const item of arr) {\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\n\nfunction resolveFallback(\n fallback: ResolverObjectKey | ((prop: ResolverObjectKey, value: unknown) => ResolverObjectKey),\n prop: ResolverObjectKey,\n value: unknown\n) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\n\nconst getScope = (key: ResolverObjectKey, parent: AnyObject) => key === true ? parent\n : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\n\nfunction addScopes(\n set: Set,\n parentScopes: AnyObject[],\n key: ResolverObjectKey,\n parentFallback: ResolverObjectKey,\n value: unknown\n) {\n for (const parent of parentScopes) {\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n }\n } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n }\n return false;\n}\n\nfunction createSubResolver(\n parentScopes: AnyObject[],\n resolver: ResolverCache,\n prop: ResolverObjectKey,\n value: unknown\n) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [...parentScopes, ...rootScopes];\n const set = new Set();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (typeof fallback !== 'undefined' && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [''], rootScopes, fallback,\n () => subGetTarget(resolver, prop as string, value));\n}\n\nfunction addScopesFromKey(\n set: Set,\n allScopes: AnyObject[],\n key: ResolverObjectKey,\n fallback: ResolverObjectKey,\n item: unknown\n) {\n while (key) {\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\n\nfunction subGetTarget(\n resolver: ResolverCache,\n prop: string,\n value: unknown\n) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n // For array of objects, the object is used to store updated values\n return value;\n }\n return target || {};\n}\n\nfunction _resolveWithPrefixes(\n prop: string,\n prefixes: string[],\n scopes: AnyObject[],\n proxy: ResolverProxy\n) {\n let value: unknown;\n for (const prefix of prefixes) {\n value = _resolve(readKey(prefix, prop), scopes);\n if (typeof value !== 'undefined') {\n return needsSubResolver(prop, value)\n ? createSubResolver(scopes, proxy, prop, value)\n : value;\n }\n }\n}\n\nfunction _resolve(key: string, scopes: AnyObject[]) {\n for (const scope of scopes) {\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n}\n\nfunction getKeysFromAllScopes(target: ResolverCache) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\n\nfunction resolveKeysFromAllScopes(scopes: AnyObject[]) {\n const set = new Set();\n for (const scope of scopes) {\n for (const key of Object.keys(scope).filter(k => !k.startsWith('_'))) {\n set.add(key);\n }\n }\n return Array.from(set);\n}\n\nexport function _parseObjectDataRadialScale(\n meta: ChartMeta<'line' | 'scatter'>,\n data: AnyObject[],\n start: number,\n count: number\n) {\n const {iScale} = meta;\n const {key = 'r'} = this._parsing;\n const parsed = new Array<{r: unknown}>(count);\n let i: number, ilen: number, index: number, item: AnyObject;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n","import {almostEquals, distanceBetweenPoints, sign} from './helpers.math.js';\nimport {_isPointInArea} from './helpers.canvas.js';\nimport type {ChartArea} from '../types/index.js';\nimport type {SplinePoint} from '../types/geometric.js';\n\nconst EPSILON = Number.EPSILON || 1e-14;\n\ntype OptionalSplinePoint = SplinePoint | false\nconst getPoint = (points: SplinePoint[], i: number): OptionalSplinePoint => i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis: 'x' | 'y') => indexAxis === 'x' ? 'y' : 'x';\n\nexport function splineCurve(\n firstPoint: SplinePoint,\n middlePoint: SplinePoint,\n afterPoint: SplinePoint,\n t: number\n): {\n previous: SplinePoint\n next: SplinePoint\n } {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n\n // This function must also respect \"skipped\" points\n\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n\n/**\n * Adjust tangents to ensure monotonic properties\n */\nfunction monotoneAdjust(points: SplinePoint[], deltaK: number[], mK: number[]) {\n const pointsLen = points.length;\n\n let alphaK: number, betaK: number, tauK: number, squaredMagnitude: number, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n for (let i = 0; i < pointsLen - 1; ++i) {\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\n\nfunction monotoneCompute(points: SplinePoint[], mK: number[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta: number, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (let i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */\nexport function splineCurveMonotone(points: SplinePoint[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK: number[] = Array(pointsLen).fill(0);\n const mK: number[] = Array(pointsLen);\n\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i]\n : !pointAfter ? deltaK[i - 1]\n : (sign(deltaK[i - 1]) !== sign(deltaK[i])) ? 0\n : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n\n monotoneAdjust(points, deltaK, mK);\n\n monotoneCompute(points, mK, indexAxis);\n}\n\nfunction capControlPoint(pt: number, min: number, max: number) {\n return Math.max(Math.min(pt, max), min);\n}\n\nfunction capBezierPoints(points: SplinePoint[], area: ChartArea) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n\n/**\n * @private\n */\nexport function _updateBezierControlPoints(\n points: SplinePoint[],\n options,\n area: ChartArea,\n loop: boolean,\n indexAxis: 'x' | 'y'\n) {\n let i: number, ilen: number, point: SplinePoint, controlPoints: ReturnType;\n\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt) => !pt.skip);\n }\n\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n point = points[i];\n controlPoints = splineCurve(\n prev,\n point,\n points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen],\n options.tension\n );\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n","import type {ChartArea, Scale} from '../types/index.js';\nimport type Chart from '../core/core.controller.js';\nimport type {ChartEvent} from '../types.js';\nimport {INFINITY} from './helpers.math.js';\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */\n\n/**\n * @private\n */\nexport function _isDomSupported(): boolean {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * @private\n */\nexport function _getParentNode(domNode: HTMLCanvasElement): HTMLCanvasElement {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = (parent as ShadowRoot).host;\n }\n return parent as HTMLCanvasElement;\n}\n\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */\n\nfunction parseMaxStyle(styleValue: string | number, node: HTMLElement, parentProperty: string) {\n let valueInPixels: number;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = (valueInPixels / 100) * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n\n return valueInPixels;\n}\n\nconst getComputedStyle = (element: HTMLElement): CSSStyleDeclaration =>\n element.ownerDocument.defaultView.getComputedStyle(element, null);\n\nexport function getStyle(el: HTMLElement, property: string): string {\n return getComputedStyle(el).getPropertyValue(property);\n}\n\nconst positions = ['top', 'right', 'bottom', 'left'];\nfunction getPositionedStyle(styles: CSSStyleDeclaration, style: string, suffix?: string): ChartArea {\n const result = {} as ChartArea;\n suffix = suffix ? '-' + suffix : '';\n for (let i = 0; i < 4; i++) {\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\n\nconst useOffsetPos = (x: number, y: number, target: HTMLElement | EventTarget) =>\n (x > 0 || y > 0) && (!target || !(target as HTMLElement).shadowRoot);\n\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */\nfunction getCanvasPosition(\n e: Event | TouchEvent | MouseEvent,\n canvas: HTMLCanvasElement\n): {\n x: number;\n y: number;\n box: boolean;\n } {\n const touches = (e as TouchEvent).touches;\n const source = (touches && touches.length ? touches[0] : e) as MouseEvent;\n const {offsetX, offsetY} = source as MouseEvent;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {x, y, box};\n}\n\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */\n\nexport function getRelativePosition(\n event: Event | ChartEvent | TouchEvent | MouseEvent,\n chart: Chart\n): { x: number; y: number } {\n if ('native' in event) {\n return event;\n }\n\n const {canvas, currentDevicePixelRatio} = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const {x, y, box} = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n\n let {width, height} = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\n\nfunction getContainerSize(canvas: HTMLCanvasElement, width: number, height: number): Partial {\n let maxWidth: number, maxHeight: number;\n\n if (width === undefined || height === undefined) {\n const container = _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\n\nconst round1 = (v: number) => Math.round(v * 10) / 10;\n\n// eslint-disable-next-line complexity\nexport function getMaximumSize(\n canvas: HTMLCanvasElement,\n bbWidth?: number,\n bbHeight?: number,\n aspectRatio?: number\n): { width: number; height: number } {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let {width, height} = containerSize;\n\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n\n return {width, height};\n}\n\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */\nexport function retinaScale(\n chart: Chart,\n forceRatio: number,\n forceStyle?: boolean\n): boolean | void {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n\n const canvas = chart.canvas;\n\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || (!canvas.style.height && !canvas.style.width))) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n\n if (chart.currentDevicePixelRatio !== pixelRatio\n || canvas.height !== deviceHeight\n || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */\nexport const supportsEventListenerOptions = (function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive() { // This function will be called when the browser attempts to access the passive property.\n passiveSupported = true;\n return false;\n }\n } as EventListenerOptions;\n\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}());\n\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */\n\nexport function readUsedSize(\n element: HTMLElement,\n property: 'width' | 'height'\n): number | undefined {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n","import type {Point, SplinePoint} from '../types/geometric.js';\n\n/**\n * @private\n */\nexport function _pointInLine(p1: Point, p2: Point, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n\n/**\n * @private\n */\nexport function _steppedInterpolation(\n p1: Point,\n p2: Point,\n t: number, mode: 'middle' | 'after' | unknown\n) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y\n : mode === 'after' ? t < 1 ? p1.y : p2.y\n : t > 0 ? p2.y : p1.y\n };\n}\n\n/**\n * @private\n */\nexport function _bezierInterpolation(p1: SplinePoint, p2: SplinePoint, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n const cp1 = {x: p1.cp2x, y: p1.cp2y};\n const cp2 = {x: p2.cp1x, y: p2.cp1y};\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n","export interface RTLAdapter {\n x(x: number): number;\n setWidth(w: number): void;\n textAlign(align: 'center' | 'left' | 'right'): 'center' | 'left' | 'right';\n xPlus(x: number, value: number): number;\n leftForLtr(x: number, itemWidth: number): number;\n}\n\nconst getRightToLeftAdapter = function(rectX: number, width: number): RTLAdapter {\n return {\n x(x) {\n return rectX + rectX + width - x;\n },\n setWidth(w) {\n width = w;\n },\n textAlign(align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus(x, value) {\n return x - value;\n },\n leftForLtr(x, itemWidth) {\n return x - itemWidth;\n },\n };\n};\n\nconst getLeftToRightAdapter = function(): RTLAdapter {\n return {\n x(x) {\n return x;\n },\n setWidth(w) { // eslint-disable-line no-unused-vars\n },\n textAlign(align) {\n return align;\n },\n xPlus(x, value) {\n return x + value;\n },\n leftForLtr(x, _itemWidth) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return x;\n },\n };\n};\n\nexport function getRtlAdapter(rtl: boolean, rectX: number, width: number) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\n\nexport function overrideTextDirection(ctx: CanvasRenderingContext2D, direction: 'ltr' | 'rtl') {\n let style: CSSStyleDeclaration, original: [string, string];\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction'),\n ];\n\n style.setProperty('direction', direction, 'important');\n (ctx as { prevTextDirection?: [string, string] }).prevTextDirection = original;\n }\n}\n\nexport function restoreTextDirection(ctx: CanvasRenderingContext2D, original?: [string, string]) {\n if (original !== undefined) {\n delete (ctx as { prevTextDirection?: [string, string] }).prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n","import {_angleBetween, _angleDiff, _isBetween, _normalizeAngle} from './helpers.math.js';\nimport {createContext} from './helpers.options.js';\nimport {isPatternOrGradient} from './helpers.color.js';\n\n/**\n * @typedef { import('../elements/element.line.js').default } LineElement\n * @typedef { import('../elements/element.point.js').default } PointElement\n * @typedef {{start: number, end: number, loop: boolean, style?: any}} Segment\n */\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle,\n };\n }\n return {\n between: _isBetween,\n compare: (a, b) => a - b,\n normalize: x => x\n };\n}\n\nfunction normalizeSegment({start, end, count, loop, style}) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\n\nfunction getSegment(segment, points, bounds) {\n const {property, start: startBound, end: endBound} = bounds;\n const {between, normalize} = propertyFn(property);\n const count = points.length;\n // eslint-disable-next-line prefer-const\n let {start, end, loop} = segment;\n let i, ilen;\n\n if (loop) {\n start += count;\n end += count;\n for (i = 0, ilen = count; i < ilen; ++i) {\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n\n if (end < start) {\n end += count;\n }\n return {start, end, loop, style: segment.style};\n}\n\n/**\n * Returns the sub-segment(s) of a line segment that fall in the given bounds\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} [segment.style] - segment style\n * @param {PointElement[]} points - the points that this segment refers to\n * @param {object} [bounds]\n * @param {string} bounds.property - the property of a `PointElement` we are bounding. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the property\n * @param {number} bounds.end - end value of the property\n * @private\n **/\nexport function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [segment];\n }\n\n const {property, start: startBound, end: endBound} = bounds;\n const count = points.length;\n const {compare, between, normalize} = propertyFn(property);\n const {start, end, loop, style} = getSegment(segment, points, bounds);\n\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n\n const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = () => inside || startIsBefore();\n const shouldStop = () => !inside || endIsBefore();\n\n for (let i = start, prev = start; i <= end; ++i) {\n point = points[i % count];\n\n if (point.skip) {\n continue;\n }\n\n value = normalize(point[property]);\n\n if (value === prevValue) {\n continue;\n }\n\n inside = between(value, startBound, endBound);\n\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({start: subStart, end: i, loop, count, style}));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n\n if (subStart !== null) {\n result.push(normalizeSegment({start: subStart, end, loop, count, style}));\n }\n\n return result;\n}\n\n\n/**\n * Returns the segments of the line that are inside given bounds\n * @param {LineElement} line\n * @param {object} [bounds]\n * @param {string} bounds.property - the property we are bounding with. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the `property`\n * @param {number} bounds.end - end value of the `property`\n * @private\n */\nexport function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n\n for (let i = 0; i < segments.length; i++) {\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n\n/**\n * Find start and end index of a line.\n */\nfunction findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n\n if (loop && !spanGaps) {\n // loop and not spanning gaps, first find a gap to start from\n while (start < count && !points[start].skip) {\n start++;\n }\n }\n\n // find first non skipped point (after the first gap possibly)\n while (start < count && points[start].skip) {\n start++;\n }\n\n // if we looped to count, start needs to be 0\n start %= count;\n\n if (loop) {\n // loop will go past count, if start > 0\n end += start;\n }\n\n while (end > start && points[end % count].skip) {\n end--;\n }\n\n // end could be more than count, normalize\n end %= count;\n\n return {start, end};\n}\n\n/**\n * Compute solid segments from Points, when spanGaps === false\n * @param {PointElement[]} points - the points\n * @param {number} start - start index\n * @param {number} max - max index (can go past count on a loop)\n * @param {boolean} loop - boolean indicating that this would be a loop if no gaps are found\n */\nfunction solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n\n for (end = start + 1; end <= max; ++end) {\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({start: start % count, end: (end - 1) % count, loop});\n // @ts-ignore\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n\n if (last !== null) {\n result.push({start: start % count, end: last % count, loop});\n }\n\n return result;\n}\n\n/**\n * Compute the continuous segments that define the whole line\n * There can be skipped points within a segment, if spanGaps is true.\n * @param {LineElement} line\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n * @private\n */\nexport function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n\n if (!count) {\n return [];\n }\n\n const loop = !!line._loop;\n const {start, end} = findStartAndEnd(points, count, loop, spanGaps);\n\n if (spanGaps === true) {\n return splitByStyles(line, [{start, end, loop}], points, segmentOptions);\n }\n\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n\n/**\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n\n/**\n * @param {LineElement} line\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const {_datasetIndex: datasetIndex, options: {spanGaps}} = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n // Style can not start/end on a skipped point, adjust indices accordingly\n s += count;\n while (points[s % count].skip) {\n s -= dir;\n }\n while (points[e % count].skip) {\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({start: s % count, end: e % count, loop: l, style: st});\n prevStyle = st;\n start = e % count;\n }\n }\n\n for (const segment of segments) {\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for (i = start + 1; i <= segment.end; i++) {\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n\n return result;\n}\n\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\n\nfunction styleChanged(style, prevStyle) {\n if (!prevStyle) {\n return false;\n }\n const cache = [];\n const replacer = function(key, value) {\n if (!isPatternOrGradient(value)) {\n return value;\n }\n if (!cache.includes(value)) {\n cache.push(value);\n }\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n","/*!\n * @kurkle/color v0.3.2\n * https://github.com/kurkle/color#readme\n * (c) 2023 Jukka Kurkela\n * Released under the MIT License\n */\nfunction round(v) {\n return v + 0.5 | 0;\n}\nconst lim = (v, l, h) => Math.max(Math.min(v, h), l);\nfunction p2b(v) {\n return lim(round(v * 2.55), 0, 255);\n}\nfunction b2p(v) {\n return lim(round(v / 2.55), 0, 100);\n}\nfunction n2b(v) {\n return lim(round(v * 255), 0, 255);\n}\nfunction b2n(v) {\n return lim(round(v / 2.55) / 100, 0, 1);\n}\nfunction n2p(v) {\n return lim(round(v * 100), 0, 100);\n}\n\nconst map$1 = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15};\nconst hex = [...'0123456789ABCDEF'];\nconst h1 = b => hex[b & 0xF];\nconst h2 = b => hex[(b & 0xF0) >> 4] + hex[b & 0xF];\nconst eq = b => ((b & 0xF0) >> 4) === (b & 0xF);\nconst isShort = v => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);\nfunction hexParse(str) {\n var len = str.length;\n var ret;\n if (str[0] === '#') {\n if (len === 4 || len === 5) {\n ret = {\n r: 255 & map$1[str[1]] * 17,\n g: 255 & map$1[str[2]] * 17,\n b: 255 & map$1[str[3]] * 17,\n a: len === 5 ? map$1[str[4]] * 17 : 255\n };\n } else if (len === 7 || len === 9) {\n ret = {\n r: map$1[str[1]] << 4 | map$1[str[2]],\n g: map$1[str[3]] << 4 | map$1[str[4]],\n b: map$1[str[5]] << 4 | map$1[str[6]],\n a: len === 9 ? (map$1[str[7]] << 4 | map$1[str[8]]) : 255\n };\n }\n }\n return ret;\n}\nconst alpha = (a, f) => a < 255 ? f(a) : '';\nfunction hexString(v) {\n var f = isShort(v) ? h1 : h2;\n return v\n ? '#' + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f)\n : undefined;\n}\n\nconst HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction hsl2rgbn(h, s, l) {\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [f(0), f(8), f(4)];\n}\nfunction hsv2rgbn(h, s, v) {\n const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n return [f(5), f(3), f(1)];\n}\nfunction hwb2rgbn(h, w, b) {\n const rgb = hsl2rgbn(h, 1, 0.5);\n let i;\n if (w + b > 1) {\n i = 1 / (w + b);\n w *= i;\n b *= i;\n }\n for (i = 0; i < 3; i++) {\n rgb[i] *= 1 - w - b;\n rgb[i] += w;\n }\n return rgb;\n}\nfunction hueValue(r, g, b, d, max) {\n if (r === max) {\n return ((g - b) / d) + (g < b ? 6 : 0);\n }\n if (g === max) {\n return (b - r) / d + 2;\n }\n return (r - g) / d + 4;\n}\nfunction rgb2hsl(v) {\n const range = 255;\n const r = v.r / range;\n const g = v.g / range;\n const b = v.b / range;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s, d;\n if (max !== min) {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = hueValue(r, g, b, d, max);\n h = h * 60 + 0.5;\n }\n return [h | 0, s || 0, l];\n}\nfunction calln(f, a, b, c) {\n return (\n Array.isArray(a)\n ? f(a[0], a[1], a[2])\n : f(a, b, c)\n ).map(n2b);\n}\nfunction hsl2rgb(h, s, l) {\n return calln(hsl2rgbn, h, s, l);\n}\nfunction hwb2rgb(h, w, b) {\n return calln(hwb2rgbn, h, w, b);\n}\nfunction hsv2rgb(h, s, v) {\n return calln(hsv2rgbn, h, s, v);\n}\nfunction hue(h) {\n return (h % 360 + 360) % 360;\n}\nfunction hueParse(str) {\n const m = HUE_RE.exec(str);\n let a = 255;\n let v;\n if (!m) {\n return;\n }\n if (m[5] !== v) {\n a = m[6] ? p2b(+m[5]) : n2b(+m[5]);\n }\n const h = hue(+m[2]);\n const p1 = +m[3] / 100;\n const p2 = +m[4] / 100;\n if (m[1] === 'hwb') {\n v = hwb2rgb(h, p1, p2);\n } else if (m[1] === 'hsv') {\n v = hsv2rgb(h, p1, p2);\n } else {\n v = hsl2rgb(h, p1, p2);\n }\n return {\n r: v[0],\n g: v[1],\n b: v[2],\n a: a\n };\n}\nfunction rotate(v, deg) {\n var h = rgb2hsl(v);\n h[0] = hue(h[0] + deg);\n h = hsl2rgb(h);\n v.r = h[0];\n v.g = h[1];\n v.b = h[2];\n}\nfunction hslString(v) {\n if (!v) {\n return;\n }\n const a = rgb2hsl(v);\n const h = a[0];\n const s = n2p(a[1]);\n const l = n2p(a[2]);\n return v.a < 255\n ? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`\n : `hsl(${h}, ${s}%, ${l}%)`;\n}\n\nconst map = {\n x: 'dark',\n Z: 'light',\n Y: 're',\n X: 'blu',\n W: 'gr',\n V: 'medium',\n U: 'slate',\n A: 'ee',\n T: 'ol',\n S: 'or',\n B: 'ra',\n C: 'lateg',\n D: 'ights',\n R: 'in',\n Q: 'turquois',\n E: 'hi',\n P: 'ro',\n O: 'al',\n N: 'le',\n M: 'de',\n L: 'yello',\n F: 'en',\n K: 'ch',\n G: 'arks',\n H: 'ea',\n I: 'ightg',\n J: 'wh'\n};\nconst names$1 = {\n OiceXe: 'f0f8ff',\n antiquewEte: 'faebd7',\n aqua: 'ffff',\n aquamarRe: '7fffd4',\n azuY: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '0',\n blanKedOmond: 'ffebcd',\n Xe: 'ff',\n XeviTet: '8a2be2',\n bPwn: 'a52a2a',\n burlywood: 'deb887',\n caMtXe: '5f9ea0',\n KartYuse: '7fff00',\n KocTate: 'd2691e',\n cSO: 'ff7f50',\n cSnflowerXe: '6495ed',\n cSnsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: 'ffff',\n xXe: '8b',\n xcyan: '8b8b',\n xgTMnPd: 'b8860b',\n xWay: 'a9a9a9',\n xgYF: '6400',\n xgYy: 'a9a9a9',\n xkhaki: 'bdb76b',\n xmagFta: '8b008b',\n xTivegYF: '556b2f',\n xSange: 'ff8c00',\n xScEd: '9932cc',\n xYd: '8b0000',\n xsOmon: 'e9967a',\n xsHgYF: '8fbc8f',\n xUXe: '483d8b',\n xUWay: '2f4f4f',\n xUgYy: '2f4f4f',\n xQe: 'ced1',\n xviTet: '9400d3',\n dAppRk: 'ff1493',\n dApskyXe: 'bfff',\n dimWay: '696969',\n dimgYy: '696969',\n dodgerXe: '1e90ff',\n fiYbrick: 'b22222',\n flSOwEte: 'fffaf0',\n foYstWAn: '228b22',\n fuKsia: 'ff00ff',\n gaRsbSo: 'dcdcdc',\n ghostwEte: 'f8f8ff',\n gTd: 'ffd700',\n gTMnPd: 'daa520',\n Way: '808080',\n gYF: '8000',\n gYFLw: 'adff2f',\n gYy: '808080',\n honeyMw: 'f0fff0',\n hotpRk: 'ff69b4',\n RdianYd: 'cd5c5c',\n Rdigo: '4b0082',\n ivSy: 'fffff0',\n khaki: 'f0e68c',\n lavFMr: 'e6e6fa',\n lavFMrXsh: 'fff0f5',\n lawngYF: '7cfc00',\n NmoncEffon: 'fffacd',\n ZXe: 'add8e6',\n ZcSO: 'f08080',\n Zcyan: 'e0ffff',\n ZgTMnPdLw: 'fafad2',\n ZWay: 'd3d3d3',\n ZgYF: '90ee90',\n ZgYy: 'd3d3d3',\n ZpRk: 'ffb6c1',\n ZsOmon: 'ffa07a',\n ZsHgYF: '20b2aa',\n ZskyXe: '87cefa',\n ZUWay: '778899',\n ZUgYy: '778899',\n ZstAlXe: 'b0c4de',\n ZLw: 'ffffe0',\n lime: 'ff00',\n limegYF: '32cd32',\n lRF: 'faf0e6',\n magFta: 'ff00ff',\n maPon: '800000',\n VaquamarRe: '66cdaa',\n VXe: 'cd',\n VScEd: 'ba55d3',\n VpurpN: '9370db',\n VsHgYF: '3cb371',\n VUXe: '7b68ee',\n VsprRggYF: 'fa9a',\n VQe: '48d1cc',\n VviTetYd: 'c71585',\n midnightXe: '191970',\n mRtcYam: 'f5fffa',\n mistyPse: 'ffe4e1',\n moccasR: 'ffe4b5',\n navajowEte: 'ffdead',\n navy: '80',\n Tdlace: 'fdf5e6',\n Tive: '808000',\n TivedBb: '6b8e23',\n Sange: 'ffa500',\n SangeYd: 'ff4500',\n ScEd: 'da70d6',\n pOegTMnPd: 'eee8aa',\n pOegYF: '98fb98',\n pOeQe: 'afeeee',\n pOeviTetYd: 'db7093',\n papayawEp: 'ffefd5',\n pHKpuff: 'ffdab9',\n peru: 'cd853f',\n pRk: 'ffc0cb',\n plum: 'dda0dd',\n powMrXe: 'b0e0e6',\n purpN: '800080',\n YbeccapurpN: '663399',\n Yd: 'ff0000',\n Psybrown: 'bc8f8f',\n PyOXe: '4169e1',\n saddNbPwn: '8b4513',\n sOmon: 'fa8072',\n sandybPwn: 'f4a460',\n sHgYF: '2e8b57',\n sHshell: 'fff5ee',\n siFna: 'a0522d',\n silver: 'c0c0c0',\n skyXe: '87ceeb',\n UXe: '6a5acd',\n UWay: '708090',\n UgYy: '708090',\n snow: 'fffafa',\n sprRggYF: 'ff7f',\n stAlXe: '4682b4',\n tan: 'd2b48c',\n teO: '8080',\n tEstN: 'd8bfd8',\n tomato: 'ff6347',\n Qe: '40e0d0',\n viTet: 'ee82ee',\n JHt: 'f5deb3',\n wEte: 'ffffff',\n wEtesmoke: 'f5f5f5',\n Lw: 'ffff00',\n LwgYF: '9acd32'\n};\nfunction unpack() {\n const unpacked = {};\n const keys = Object.keys(names$1);\n const tkeys = Object.keys(map);\n let i, j, k, ok, nk;\n for (i = 0; i < keys.length; i++) {\n ok = nk = keys[i];\n for (j = 0; j < tkeys.length; j++) {\n k = tkeys[j];\n nk = nk.replace(k, map[k]);\n }\n k = parseInt(names$1[ok], 16);\n unpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];\n }\n return unpacked;\n}\n\nlet names;\nfunction nameParse(str) {\n if (!names) {\n names = unpack();\n names.transparent = [0, 0, 0, 0];\n }\n const a = names[str.toLowerCase()];\n return a && {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length === 4 ? a[3] : 255\n };\n}\n\nconst RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction rgbParse(str) {\n const m = RGB_RE.exec(str);\n let a = 255;\n let r, g, b;\n if (!m) {\n return;\n }\n if (m[7] !== r) {\n const v = +m[7];\n a = m[8] ? p2b(v) : lim(v * 255, 0, 255);\n }\n r = +m[1];\n g = +m[3];\n b = +m[5];\n r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));\n g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));\n b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\nfunction rgbString(v) {\n return v && (\n v.a < 255\n ? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`\n : `rgb(${v.r}, ${v.g}, ${v.b})`\n );\n}\n\nconst to = v => v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst from = v => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction interpolate(rgb1, rgb2, t) {\n const r = from(b2n(rgb1.r));\n const g = from(b2n(rgb1.g));\n const b = from(b2n(rgb1.b));\n return {\n r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),\n g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),\n b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),\n a: rgb1.a + t * (rgb2.a - rgb1.a)\n };\n}\n\nfunction modHSL(v, i, ratio) {\n if (v) {\n let tmp = rgb2hsl(v);\n tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n tmp = hsl2rgb(tmp);\n v.r = tmp[0];\n v.g = tmp[1];\n v.b = tmp[2];\n }\n}\nfunction clone(v, proto) {\n return v ? Object.assign(proto || {}, v) : v;\n}\nfunction fromObject(input) {\n var v = {r: 0, g: 0, b: 0, a: 255};\n if (Array.isArray(input)) {\n if (input.length >= 3) {\n v = {r: input[0], g: input[1], b: input[2], a: 255};\n if (input.length > 3) {\n v.a = n2b(input[3]);\n }\n }\n } else {\n v = clone(input, {r: 0, g: 0, b: 0, a: 1});\n v.a = n2b(v.a);\n }\n return v;\n}\nfunction functionParse(str) {\n if (str.charAt(0) === 'r') {\n return rgbParse(str);\n }\n return hueParse(str);\n}\nclass Color {\n constructor(input) {\n if (input instanceof Color) {\n return input;\n }\n const type = typeof input;\n let v;\n if (type === 'object') {\n v = fromObject(input);\n } else if (type === 'string') {\n v = hexParse(input) || nameParse(input) || functionParse(input);\n }\n this._rgb = v;\n this._valid = !!v;\n }\n get valid() {\n return this._valid;\n }\n get rgb() {\n var v = clone(this._rgb);\n if (v) {\n v.a = b2n(v.a);\n }\n return v;\n }\n set rgb(obj) {\n this._rgb = fromObject(obj);\n }\n rgbString() {\n return this._valid ? rgbString(this._rgb) : undefined;\n }\n hexString() {\n return this._valid ? hexString(this._rgb) : undefined;\n }\n hslString() {\n return this._valid ? hslString(this._rgb) : undefined;\n }\n mix(color, weight) {\n if (color) {\n const c1 = this.rgb;\n const c2 = color.rgb;\n let w2;\n const p = weight === w2 ? 0.5 : weight;\n const w = 2 * p - 1;\n const a = c1.a - c2.a;\n const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n w2 = 1 - w1;\n c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n c1.a = p * c1.a + (1 - p) * c2.a;\n this.rgb = c1;\n }\n return this;\n }\n interpolate(color, t) {\n if (color) {\n this._rgb = interpolate(this._rgb, color._rgb, t);\n }\n return this;\n }\n clone() {\n return new Color(this.rgb);\n }\n alpha(a) {\n this._rgb.a = n2b(a);\n return this;\n }\n clearer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 - ratio;\n return this;\n }\n greyscale() {\n const rgb = this._rgb;\n const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n rgb.r = rgb.g = rgb.b = val;\n return this;\n }\n opaquer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 + ratio;\n return this;\n }\n negate() {\n const v = this._rgb;\n v.r = 255 - v.r;\n v.g = 255 - v.g;\n v.b = 255 - v.b;\n return this;\n }\n lighten(ratio) {\n modHSL(this._rgb, 2, ratio);\n return this;\n }\n darken(ratio) {\n modHSL(this._rgb, 2, -ratio);\n return this;\n }\n saturate(ratio) {\n modHSL(this._rgb, 1, ratio);\n return this;\n }\n desaturate(ratio) {\n modHSL(this._rgb, 1, -ratio);\n return this;\n }\n rotate(deg) {\n rotate(this._rgb, deg);\n return this;\n }\n}\n\nfunction index_esm(input) {\n return new Color(input);\n}\n\nexport { Color, b2n, b2p, index_esm as default, hexParse, hexString, hsl2rgb, hslString, hsv2rgb, hueParse, hwb2rgb, lim, n2b, n2p, nameParse, p2b, rgb2hsl, rgbParse, rgbString, rotate, round };\n","/**!\n * Sortable 1.15.1\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n return target;\n}\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n return _typeof(obj);\n}\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = _objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.1\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction matches( /**HTMLElement*/el, /**String*/selector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n return false;\n}\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n return null;\n}\nvar R_SPACE = /\\s+/g;\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\nfunction css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n } while (!selfOnly && (el = el.parentNode));\n }\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n return list;\n }\n return [];\n}\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect();\n\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n } while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n\n/**\r\n * Returns the content rect of the element (bounding rect minus border and padding)\r\n * @param {HTMLElement} el \r\n */\nfunction getContentRect(el) {\n var rect = getRect(el);\n var paddingLeft = parseInt(css(el, 'padding-left')),\n paddingTop = parseInt(css(el, 'padding-top')),\n paddingRight = parseInt(css(el, 'padding-right')),\n paddingBottom = parseInt(css(el, 'padding-bottom'));\n rect.top += paddingTop + parseInt(css(el, 'border-top-width'));\n rect.left += paddingLeft + parseInt(css(el, 'border-left-width'));\n // Client Width/Height includes padding only\n rect.width = el.clientWidth - paddingLeft - paddingRight;\n rect.height = el.clientHeight - paddingTop - paddingBottom;\n rect.bottom = rect.top + rect.height;\n rect.right = rect.left + rect.width;\n return rect;\n}\n\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n\n /* jshint boss:true */\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n currentChild++;\n }\n i++;\n }\n return null;\n}\n\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n return last || null;\n}\n\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */\nfunction index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) {\n return -1;\n }\n\n /* jshint boss:true */\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n return index;\n}\n\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n return [offsetLeft, offsetTop];\n}\n\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n } while (elem = elem.parentNode);\n return getWindowScrollingElement();\n}\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n return dst;\n}\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar _throttleTimeout;\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);\n\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&\n // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n }\n\n // if fromRect != toRect: animate\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) {\n time = _this.options.animation;\n }\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction repaint(target) {\n return target.offsetWidth;\n}\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n\n // Add default options from plugin\n _extends(defaults, initialized.defaults);\n });\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\n ghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n\n _silent = false,\n savedInputChecked = [];\n\n/** @const */\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\n supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return;\n // false when <= IE11\n if (IE11OrLess) {\n return false;\n }\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n }(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n },\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n },\n /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n },\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n },\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n },\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n };\n\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[expando]._onDragOver(event);\n }\n }\n};\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n this.el = el; // root element\n this.options = options = _extends({}, options);\n\n // Export instance\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults);\n\n // Set default options\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n _prepareGroup(options);\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n }\n\n // Bind events\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n sortables.push(this.el);\n\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n\n // Add animation state manager\n _extends(this, AnimationStateManager());\n}\nSortable.prototype = /** @lends Sortable.prototype */{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {\n if (!evt.cancelable) return;\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n _saveInputCheckedState(el);\n\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if (dragEl) {\n return;\n }\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n }\n\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) {\n return;\n }\n\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n target = closest(target, options.draggable, el, false);\n if (target && target.animated) {\n return;\n }\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n }\n\n // Get the index of the dragged element within its parent\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable);\n\n // Check filter\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n }\n\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n }\n\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n\n // Drag start event\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n });\n\n // Chosen item\n toggleClass(dragEl, options.chosenClass, true);\n };\n\n // Disable \"draggable\"\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop);\n\n // Make dragEl draggable (must be before delay for FireFox)\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n pluginEvent('delayStart', this, {\n evt: evt\n });\n\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n awaitingDragStarted = false;\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n var options = this.options;\n\n // Apply effect\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost();\n\n // Drag start event\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n _hideGhostForTarget();\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n target = parent; // store last element\n }\n /* jshint boss:true */ while (parent = parent.parentNode);\n }\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n\n // only set the status to dragging, when we are actually dragging\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n this._onDragStart(evt, true);\n }\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options;\n\n // Position absolutely\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl);\n\n // Set transform-origin\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n pluginEvent('setupClone', this);\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n this._hideClone();\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n }\n\n // #1143: IFrame support workaround\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n _this._hideClone();\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true);\n\n // Set proper drop events\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n on(document, 'drop', _this);\n\n // #1276 fix:\n css(dragEl, 'transform', 'translateZ(0)');\n }\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver( /**Event*/evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n if (_silent) return;\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n\n // Capture animation state\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n _this.captureAnimationState();\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n }\n\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n }\n\n // Animation\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n\n // Null lastTarget if it is not inside a previously swapped element\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n }\n\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n\n // Do not detect for empty insert if already inserted\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n\n // Call when dragEl has been inserted\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n if (revert) {\n parentEl = rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent('revert');\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n return completed(true);\n }\n var elLastChild = lastChild(el, options.draggable);\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n }\n\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n if (target) {\n targetRect = getRect(target);\n }\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n if (firstChild === dragEl) {\n return completed(false);\n }\n target = firstChild;\n targetRect = getRect(target);\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n }\n\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n parentEl = dragEl.parentNode; // actualization\n\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n changed();\n return completed(true);\n }\n }\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop( /**Event*/evt) {\n var el = this.el,\n options = this.options;\n\n // Get the index of the dragged element within its parent\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode;\n\n // Get again after plugin event\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n if (Sortable.eventCanceled) {\n this._nulling();\n return;\n }\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n _cancelNextTick(this.cloneId);\n _cancelNextTick(this._dragStartId);\n\n // Unbind events\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n css(dragEl, 'transform', '');\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n _disableDraggable(dragEl);\n dragEl.style['will-change'] = '';\n\n // Remove classes\n // ghostClass is added in dragStarted\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n toggleClass(dragEl, this.options.chosenClass, false);\n\n // Drag stop event\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n // Remove event\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // drag from one list and drop into another\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent( /**Event*/evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n break;\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n _globalDragOver(evt);\n }\n break;\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n for (; i < n; i++) {\n el = children[i];\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n return;\n }\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return;\n\n // show clone at dragEl or original position\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\nfunction _globalDragOver( /**Event*/evt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n evt.cancelable && evt.preventDefault();\n}\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n return retVal;\n}\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\nfunction _unsilent() {\n _silent = false;\n}\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var sortableContentRect = getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX < sortableContentRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < sortableContentRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction _ghostIsLast(evt, vertical, sortable) {\n var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var sortableContentRect = getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX > sortableContentRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > sortableContentRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n return 0;\n}\n\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n while (i--) {\n sum += str.charCodeAt(i);\n }\n return sum.toString(36);\n}\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n}\n\n// Fixed #973:\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n}\n\n// Export utils\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\nSortable.get = function (element) {\n return element[expando];\n};\n\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n};\n\n// Export\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt;\n\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback);\n\n // Listener for pointer element change\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn;\n\n // New scroll root, set scrollEl\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n var layersOut = 0;\n var currentParent = scrollEl;\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n }\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction Revert() {}\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n this.sortable.animateAll();\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\nfunction Remove() {}\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\n multiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\n folding = false,\n // Folding any other time\n dragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n dataTransfer.setData('Text', data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n });\n\n // Sort multi-drag elements\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n\n sortable.captureAnimationState();\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n }\n\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute);\n\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n }\n\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n activeSortable._showClone(sortable);\n\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children;\n\n // Multi-drag selection\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n }\n\n // Multi-drag drop\n if (dragStarted && this.isMultiDrag) {\n folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n multiDragIndex++;\n });\n\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent('update');\n dispatchSortableEvent('sort');\n }\n }\n }\n\n // Must be done after capturing individual rects (scroll bar)\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n multiDragSortable = toSortable;\n }\n\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return;\n\n // Only deselect if selection is in this sortable\n if (multiDragSortable !== this.sortable) return;\n\n // Only deselect if target is not item in this sortable\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n multiDragSortable = sortable;\n }\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n\n // multiDragElements will already be sorted if folding\n var newIndex;\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n return key;\n }\n }\n });\n}\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","export async function animationFrame(): Promise {\n return new Promise((resolve) => {\n requestAnimationFrame(resolve);\n });\n}\n","import {\n Model,\n ModelElementObject,\n ModelElementId,\n ModelElementArray,\n ModelRecord,\n} from './model';\n\nconst stockIds = [\n 'capacityOfNewlyProducedPhones',\n 'capacityOfRecycledMaterials',\n 'capacityOfRefurbishedPhones',\n 'capacityOfRepairedPhones',\n 'phonesInUse',\n 'supplyOfBrokenPhones',\n 'supplyOfDisposedPhones',\n 'supplyOfHibernatingPhones',\n 'supplyOfNewlyProducedPhones',\n 'supplyOfRecycledMaterials',\n 'supplyOfRefurbishedPhones',\n 'supplyOfRepairedPhones',\n] as const;\n\nconst flowIds = [\n 'abandon',\n 'acquireNewlyProduced',\n 'acquireRefurbished',\n 'acquireRepaired',\n 'acquireUsed',\n 'capacityOfNewlyProducedPhonesAdjustment',\n 'capacityOfRecycledMaterialsAdjustment',\n 'capacityOfRefurbishedPhonesAdjustment',\n 'disposeBroken',\n 'disposeHibernating',\n 'goBroken',\n 'landfill',\n 'produceFromNaturalResources',\n 'produceFromRecycledMaterials',\n 'recycle',\n 'refurbish',\n 'repair',\n 'repairShopCapcityAdjustment',\n] as const;\n\nconst variableIds = [\n 'demandForNaturalResources',\n 'demandForNewlyProducedPhones',\n 'demandForPhones',\n 'demandForRecycledMaterials',\n 'demandForRecycling',\n 'demandForRefurbishedPhones',\n 'demandForRefurbishment',\n 'demandForRepair',\n 'demandForRepairedPhones',\n 'demandForResources',\n 'demandForReusedPhones',\n 'inflowIncentiveSumForPhonesInUse',\n 'phoneGoal',\n 'phonesInUseExcess',\n 'supplyOfBrokenPhonesForDisposal',\n 'supplyOfBrokenPhonesForRepair',\n 'supplyOfDisposedPhonesForLandfilling',\n 'supplyOfDisposedPhonesForRecycling',\n 'supplyOfHibernatingPhonesForDisposal',\n 'supplyOfHibernatingPhonesForRefurbishment',\n 'supplyOfHibernatingPhonesForReuse',\n] as const;\n\nconst parameterIds = [\n 'abandonExcessRate',\n 'abandonRate',\n 'acquireRate',\n 'breakRate',\n 'capacityAdjustmentRate',\n 'disposeIncentive',\n 'disposeRate',\n 'landfillIncentive',\n 'landfillRate',\n 'naturalResourcesIncentive',\n 'newPhoneProductionRate',\n 'newlyProducedPhoneIncentive',\n 'numberOfUsers',\n 'phonesPerUserGoal',\n 'recycleRate',\n 'recyclingIncentive',\n 'refurbishmentIncentive',\n 'refurbishmentRate',\n 'repairIncentive',\n 'repairRate',\n 'reuseIncentive',\n] as const;\n\ntype StockIds = typeof stockIds;\ntype StockId = ModelElementId;\ntype Stocks = ModelElementObject;\ntype StockArray = ModelElementArray;\n\ntype FlowIds = typeof flowIds;\ntype FlowId = ModelElementId;\ntype Flows = ModelElementObject;\ntype FlowArray = ModelElementArray;\n\ntype VariableIds = typeof variableIds;\ntype VariableId = ModelElementId;\ntype Variables = ModelElementObject;\ntype VariableArray = ModelElementArray;\n\ntype ParameterIds = typeof parameterIds;\ntype ParameterId = ModelElementId;\ntype Parameters = ModelElementObject;\ntype ParameterArray = ModelElementArray;\n\ntype Record = ModelRecord;\n\nclass CircularEconomyModel extends Model<\n StockIds,\n FlowIds,\n VariableIds,\n ParameterIds\n> {\n public static readonly initialStocks: Readonly = {\n capacityOfNewlyProducedPhones: 0,\n capacityOfRecycledMaterials: 0,\n capacityOfRefurbishedPhones: 0,\n capacityOfRepairedPhones: 0,\n phonesInUse: 0,\n supplyOfBrokenPhones: 0,\n supplyOfDisposedPhones: 0,\n supplyOfHibernatingPhones: 0,\n supplyOfNewlyProducedPhones: 0,\n supplyOfRecycledMaterials: 0,\n supplyOfRefurbishedPhones: 0,\n supplyOfRepairedPhones: 0,\n };\n\n public static readonly defaultParameters: Readonly = {\n abandonExcessRate: 0.5,\n abandonRate: 0.1,\n acquireRate: 1,\n breakRate: 0.1,\n capacityAdjustmentRate: 0.1,\n disposeIncentive: 0.5,\n disposeRate: 0.5,\n landfillIncentive: 0.5,\n landfillRate: 1,\n naturalResourcesIncentive: 0.5,\n newPhoneProductionRate: 0.5,\n newlyProducedPhoneIncentive: 0.82,\n numberOfUsers: 1000000,\n phonesPerUserGoal: 1,\n recycleRate: 1,\n recyclingIncentive: 0.89,\n refurbishmentIncentive: 0.5,\n refurbishmentRate: 1,\n repairIncentive: 0.5,\n repairRate: 1,\n reuseIncentive: 0.86,\n };\n\n constructor() {\n super(stockIds, flowIds, variableIds, parameterIds);\n }\n\n // eslint-disable-next-line class-methods-use-this\n public evaluate(stocks: Stocks, parameters: Parameters, t: number): Record {\n const {\n capacityOfNewlyProducedPhones,\n capacityOfRecycledMaterials,\n capacityOfRefurbishedPhones,\n capacityOfRepairedPhones,\n phonesInUse,\n supplyOfBrokenPhones,\n supplyOfDisposedPhones,\n supplyOfHibernatingPhones,\n supplyOfNewlyProducedPhones,\n supplyOfRecycledMaterials,\n supplyOfRefurbishedPhones,\n supplyOfRepairedPhones,\n } = stocks;\n const {\n abandonExcessRate,\n abandonRate,\n acquireRate,\n breakRate,\n capacityAdjustmentRate,\n disposeIncentive,\n disposeRate,\n landfillIncentive,\n landfillRate,\n naturalResourcesIncentive,\n newPhoneProductionRate,\n newlyProducedPhoneIncentive,\n numberOfUsers,\n phonesPerUserGoal,\n recycleRate,\n recyclingIncentive,\n refurbishmentIncentive,\n refurbishmentRate,\n repairIncentive,\n repairRate,\n reuseIncentive,\n } = parameters;\n\n const phoneGoal = numberOfUsers * phonesPerUserGoal;\n const phonesInUseExcess = Math.max(phonesInUse - phoneGoal, 0);\n const abandon =\n abandonRate * phonesInUse + abandonExcessRate * phonesInUseExcess;\n const inflowIncentiveSumForPhonesInUse =\n reuseIncentive +\n repairIncentive +\n refurbishmentIncentive +\n newlyProducedPhoneIncentive;\n const goBroken = breakRate * phonesInUse;\n const demandForPhones = Math.max(\n 0,\n phoneGoal - phonesInUse + goBroken + abandon,\n );\n const demandForNewlyProducedPhones =\n (newlyProducedPhoneIncentive / inflowIncentiveSumForPhonesInUse) *\n demandForPhones;\n const acquireNewlyProduced =\n acquireRate *\n Math.min(supplyOfNewlyProducedPhones, demandForNewlyProducedPhones);\n const demandForRefurbishedPhones =\n (refurbishmentIncentive / inflowIncentiveSumForPhonesInUse) *\n demandForPhones;\n const acquireRefurbished =\n acquireRate *\n Math.min(demandForRefurbishedPhones, supplyOfRefurbishedPhones);\n const demandForRepairedPhones =\n (repairIncentive / inflowIncentiveSumForPhonesInUse) * demandForPhones;\n const acquireRepaired =\n acquireRate * Math.min(demandForRepairedPhones, supplyOfRepairedPhones);\n const supplyOfHibernatingPhonesForReuse =\n (reuseIncentive /\n (reuseIncentive + refurbishmentIncentive + disposeIncentive)) *\n supplyOfHibernatingPhones;\n const demandForReusedPhones =\n (reuseIncentive / inflowIncentiveSumForPhonesInUse) * demandForPhones;\n const acquireUsed =\n acquireRate *\n Math.min(supplyOfHibernatingPhonesForReuse, demandForReusedPhones);\n const capacityOfNewlyProducedPhonesAdjustment =\n capacityAdjustmentRate *\n (demandForNewlyProducedPhones - capacityOfNewlyProducedPhones);\n const demandForResources = Math.max(\n capacityOfNewlyProducedPhones -\n supplyOfNewlyProducedPhones +\n acquireNewlyProduced,\n 0,\n );\n const demandForRecycledMaterials =\n (recyclingIncentive / (naturalResourcesIncentive + recyclingIncentive)) *\n demandForResources;\n const capacityOfRecycledMaterialsAdjustment =\n capacityAdjustmentRate *\n (demandForRecycledMaterials - capacityOfRecycledMaterials);\n const capacityOfRefurbishedPhonesAdjustment =\n capacityAdjustmentRate *\n (demandForRefurbishedPhones - capacityOfRefurbishedPhones);\n const supplyOfBrokenPhonesForDisposal =\n (disposeIncentive / (repairIncentive + disposeIncentive)) *\n supplyOfBrokenPhones;\n const disposeBroken = disposeRate * supplyOfBrokenPhonesForDisposal;\n const supplyOfHibernatingPhonesForDisposal =\n (disposeIncentive /\n (reuseIncentive + refurbishmentIncentive + disposeIncentive)) *\n supplyOfHibernatingPhones;\n const disposeHibernating =\n disposeRate * supplyOfHibernatingPhonesForDisposal;\n const supplyOfDisposedPhonesForLandfilling =\n (landfillIncentive / (recyclingIncentive + landfillIncentive)) *\n supplyOfDisposedPhones;\n const landfill = landfillRate * supplyOfDisposedPhonesForLandfilling;\n const demandForNaturalResources =\n (naturalResourcesIncentive /\n (naturalResourcesIncentive + recyclingIncentive)) *\n demandForResources;\n const produceFromNaturalResources =\n newPhoneProductionRate * demandForNaturalResources;\n const produceFromRecycledMaterials =\n newPhoneProductionRate *\n Math.min(demandForRecycledMaterials, supplyOfRecycledMaterials);\n const supplyOfDisposedPhonesForRecycling =\n (recyclingIncentive / (recyclingIncentive + landfillIncentive)) *\n supplyOfDisposedPhones;\n const demandForRecycling = Math.max(\n capacityOfRecycledMaterials -\n supplyOfRecycledMaterials +\n produceFromRecycledMaterials,\n 0,\n );\n const recycle =\n recycleRate *\n Math.min(supplyOfDisposedPhonesForRecycling, demandForRecycling);\n const supplyOfHibernatingPhonesForRefurbishment =\n (refurbishmentIncentive /\n (reuseIncentive + refurbishmentIncentive + disposeIncentive)) *\n supplyOfHibernatingPhones;\n const demandForRefurbishment = Math.max(\n capacityOfRefurbishedPhones -\n supplyOfRefurbishedPhones +\n acquireRefurbished,\n 0,\n );\n const refurbish =\n refurbishmentRate *\n Math.min(\n supplyOfHibernatingPhonesForRefurbishment,\n demandForRefurbishment,\n );\n const demandForRepair = Math.max(\n capacityOfRepairedPhones - supplyOfRepairedPhones + acquireRepaired,\n 0,\n );\n const repair = repairRate * Math.min(supplyOfBrokenPhones, demandForRepair);\n const repairShopCapcityAdjustment =\n capacityAdjustmentRate *\n (demandForRepairedPhones - capacityOfRepairedPhones);\n const supplyOfBrokenPhonesForRepair =\n (repairIncentive / (repairIncentive + disposeIncentive)) *\n supplyOfBrokenPhones;\n\n const variables = {\n demandForNaturalResources,\n demandForNewlyProducedPhones,\n demandForPhones,\n demandForRecycledMaterials,\n demandForRecycling,\n demandForRefurbishedPhones,\n demandForRefurbishment,\n demandForRepair,\n demandForRepairedPhones,\n demandForResources,\n demandForReusedPhones,\n inflowIncentiveSumForPhonesInUse,\n phoneGoal,\n phonesInUseExcess,\n supplyOfBrokenPhonesForDisposal,\n supplyOfBrokenPhonesForRepair,\n supplyOfDisposedPhonesForLandfilling,\n supplyOfDisposedPhonesForRecycling,\n supplyOfHibernatingPhonesForDisposal,\n supplyOfHibernatingPhonesForRefurbishment,\n supplyOfHibernatingPhonesForReuse,\n };\n const flows = {\n abandon,\n acquireNewlyProduced,\n acquireRefurbished,\n acquireRepaired,\n acquireUsed,\n capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhonesAdjustment,\n disposeBroken,\n disposeHibernating,\n goBroken,\n landfill,\n produceFromNaturalResources,\n produceFromRecycledMaterials,\n recycle,\n refurbish,\n repair,\n repairShopCapcityAdjustment,\n };\n\n return { t, stocks, parameters, variables, flows };\n }\n\n // eslint-disable-next-line class-methods-use-this\n public accumulateFlowsPerStock(flows: Flows): Stocks {\n const {\n abandon,\n acquireNewlyProduced,\n acquireRefurbished,\n acquireRepaired,\n acquireUsed,\n capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhonesAdjustment,\n disposeBroken,\n disposeHibernating,\n goBroken,\n landfill,\n produceFromNaturalResources,\n produceFromRecycledMaterials,\n recycle,\n refurbish,\n repair,\n repairShopCapcityAdjustment,\n } = flows;\n\n const flowPerStock: Stocks = {\n capacityOfNewlyProducedPhones: capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterials: capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhones: capacityOfRefurbishedPhonesAdjustment,\n capacityOfRepairedPhones: repairShopCapcityAdjustment,\n phonesInUse:\n acquireNewlyProduced +\n acquireRefurbished +\n acquireRepaired +\n acquireUsed -\n (abandon + goBroken),\n supplyOfBrokenPhones: goBroken - (disposeBroken + repair),\n supplyOfDisposedPhones:\n disposeBroken + disposeHibernating - (landfill + recycle),\n supplyOfHibernatingPhones:\n abandon - (acquireUsed + disposeHibernating + refurbish),\n supplyOfNewlyProducedPhones:\n produceFromNaturalResources +\n produceFromRecycledMaterials -\n acquireNewlyProduced,\n supplyOfRecycledMaterials: recycle - produceFromRecycledMaterials,\n supplyOfRefurbishedPhones: refurbish - acquireRefurbished,\n supplyOfRepairedPhones: repair - acquireRepaired,\n };\n\n return flowPerStock;\n }\n}\nexport type {\n StockIds,\n StockId,\n Stocks,\n StockArray,\n FlowIds,\n FlowId,\n Flows,\n FlowArray,\n VariableIds,\n VariableId,\n Variables,\n VariableArray,\n ParameterIds,\n ParameterId,\n Parameters,\n ParameterArray,\n Record,\n};\n\nexport default CircularEconomyModel;\n","import {\n step,\n FlowEvaluator,\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n} from './box-model/box-model';\nimport type {\n ConvertTupleToUnion,\n ConvertTupleToObject,\n ConvertTupleItemType,\n} from './util/type-helpers';\n\ntype ModelElementIds = readonly string[];\ntype ModelElementId = ConvertTupleToUnion;\ntype ModelElementObject = ConvertTupleToObject<\n I,\n number\n>;\ntype ModelElementArray = ConvertTupleItemType<\n I,\n number\n>;\n\ntype ModelRecord<\n S extends ModelElementIds,\n F extends ModelElementIds,\n V extends ModelElementIds,\n P extends ModelElementIds,\n> = {\n t: number;\n stocks: ModelElementObject;\n flows: ModelElementObject;\n variables: ModelElementObject;\n parameters: ModelElementObject

;\n};\n\nabstract class Model<\n S extends ModelElementIds,\n F extends ModelElementIds,\n V extends ModelElementIds,\n P extends ModelElementIds,\n> {\n public static elementIds = [\n 'stocks',\n 'parameters',\n 'variables',\n 'flows',\n ] as const;\n\n public readonly stockIds: S;\n\n public readonly flowIds: F;\n\n public readonly variableIds: V;\n\n public readonly parameterIds: P;\n\n protected constructor(\n stocksIds: S,\n flowIds: F,\n variableIds: V,\n parameterIds: P,\n ) {\n this.stockIds = stocksIds;\n this.flowIds = flowIds;\n this.variableIds = variableIds;\n this.parameterIds = parameterIds;\n }\n\n public static elementObjectToArray(\n ids: I,\n object: Readonly>,\n ): ModelElementArray {\n return ids.map(\n (id: ModelElementId) => object[id],\n ) as ModelElementArray;\n }\n\n public static arrayToElementObject(\n ids: I,\n array: readonly [...ModelElementArray],\n ): ModelElementObject {\n const result: Partial> = {};\n for (let i = 0; i < ids.length; i += 1) {\n const id: ModelElementId = ids[i];\n result[id] = array[i];\n }\n return result as ModelElementObject;\n }\n\n public stocksToStockArray(\n stocks: Readonly>,\n ): ModelElementArray {\n return Model.elementObjectToArray(this.stockIds, stocks);\n }\n\n public stockArrayToStocks(\n stockArray: readonly [...ModelElementArray],\n ): ModelElementObject {\n return Model.arrayToElementObject(this.stockIds, stockArray);\n }\n\n public flowsToFlowArray(\n flows: Readonly>,\n ): ModelElementArray {\n return Model.elementObjectToArray(this.flowIds, flows);\n }\n\n public flowArrayToFlows(\n flowArray: readonly [...ModelElementArray],\n ): ModelElementObject {\n return Model.arrayToElementObject(this.flowIds, flowArray);\n }\n\n public variablesToVariableArray(\n variables: Readonly>,\n ): ModelElementArray {\n return Model.elementObjectToArray(this.variableIds, variables);\n }\n\n public variableArrayToVariables(\n variableArray: readonly [...ModelElementArray],\n ): ModelElementObject {\n return Model.arrayToElementObject(this.variableIds, variableArray);\n }\n\n public parametersToParameterArray(\n parameters: Readonly>,\n ): ModelElementArray

{\n return Model.elementObjectToArray(this.parameterIds, parameters);\n }\n\n public parameterArrayToParameters(\n parameterArray: readonly [...ModelElementArray

],\n ): ModelElementObject

{\n return Model.arrayToElementObject(this.parameterIds, parameterArray);\n }\n\n public abstract evaluate(\n stocks: ModelElementObject,\n parameters: ModelElementObject

,\n t: number,\n ): ModelRecord;\n\n public abstract accumulateFlowsPerStock(\n flows: ModelElementObject,\n ): ModelElementObject;\n\n public evaluateFlowPerStock(\n stocks: ModelElementObject,\n parameters: ModelElementObject

,\n t: number,\n ): ModelElementObject {\n const { flows } = this.evaluate(stocks, parameters, t);\n return this.accumulateFlowsPerStock(flows);\n }\n\n public createFlowEvaluator(\n parameters: Readonly>,\n ): FlowEvaluator> {\n const result = (\n stocksArray: IntegrationEngineInputArray>,\n t: number,\n ): IntegrationEngineOutputArray> => {\n const stocks = this.stockArrayToStocks(stocksArray);\n const flowsPerStock = this.evaluateFlowPerStock(stocks, parameters, t);\n const flowPerStockArray = this.stocksToStockArray(flowsPerStock);\n return flowPerStockArray;\n };\n return result;\n }\n\n public step(\n stocks: Readonly>,\n t: number,\n h: number,\n flowEvaluator: FlowEvaluator>,\n ): ModelElementObject {\n const stocksArray: ModelElementArray = this.stocksToStockArray(stocks);\n const newStocksArray = step>(\n stocksArray,\n t,\n h,\n flowEvaluator,\n );\n return this.stockArrayToStocks(newStocksArray);\n }\n}\n\nexport type {\n ModelElementIds,\n ModelElementId,\n ModelElementObject,\n ModelElementArray,\n ModelRecord,\n};\n\nexport { Model };\n","import type { FlowEvaluator, ConvergenceCriterion } from './types';\nimport { step as stepImpl, converge as convergeImpl } from './engine';\nimport {\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n IVPIntegrator,\n} from './types';\n\nfunction step5(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray {\n return stepImpl(stocksAtT, t, h, computeFlows, integrator);\n}\n\nfunction step6(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray {\n const mutableFlowsAtT: IntegrationEngineOutputArray = [...flowsAtT];\n const getFlows: FlowEvaluator = (y, x) =>\n x === t ? mutableFlowsAtT : computeFlows(y, x);\n return stepImpl(stocksAtT, t, h, getFlows, integrator);\n}\n\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray;\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray;\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n tOrFlowsAtT: number | IntegrationEngineInputArray,\n tOrH: number,\n hOrComputeFlows: number | FlowEvaluator,\n computeFlowsOrIntegrator?: FlowEvaluator | IVPIntegrator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray {\n if (typeof tOrFlowsAtT === 'number')\n return step5(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as FlowEvaluator,\n computeFlowsOrIntegrator as IVPIntegrator,\n );\n\n return step6(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as number,\n computeFlowsOrIntegrator as FlowEvaluator,\n integrator as IVPIntegrator,\n );\n}\n\nfunction converge6(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C {\n return convergeImpl(stocksAtT, t, h, computeFlows, criterion, integrator);\n}\n\nfunction converge7(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C {\n const mutableFlowsAtT: IntegrationEngineOutputArray = [...flowsAtT];\n const getFlows: FlowEvaluator = (y, x) =>\n x === t ? mutableFlowsAtT : computeFlows(y, x);\n return convergeImpl(stocksAtT, t, h, getFlows, criterion, integrator);\n}\n\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C;\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C;\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n tOrFlowsAtT: number | IntegrationEngineInputArray,\n tOrH: number,\n hOrComputeFlows: number | FlowEvaluator,\n computeFlowsOrCriterion: FlowEvaluator | ConvergenceCriterion,\n criterionOrIntegrator?: ConvergenceCriterion | IVPIntegrator,\n integrator?: IVPIntegrator,\n): C {\n if (typeof tOrFlowsAtT === 'number')\n return converge6(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as FlowEvaluator,\n computeFlowsOrCriterion as ConvergenceCriterion,\n criterionOrIntegrator as IVPIntegrator,\n );\n\n return converge7(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as number,\n computeFlowsOrCriterion as FlowEvaluator,\n criterionOrIntegrator as ConvergenceCriterion,\n integrator as IVPIntegrator,\n );\n}\n\nexport type {\n FlowEvaluator,\n ConvergenceCriterion,\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n};\nexport { step, converge };\n","import {\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n FlowEvaluator,\n IVPIntegrator,\n ConvergenceCriterion,\n} from './types';\nimport { rk4 } from './ode';\n\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n getFlows: FlowEvaluator,\n integrator: IVPIntegrator = rk4,\n): IntegrationEngineOutputArray {\n return integrator(stocksAtT, t, h, getFlows);\n}\n\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n getFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator: IVPIntegrator = rk4,\n): C {\n let iterations = 0;\n let { userdata, done } = criterion(stocksAtT, t, undefined, iterations);\n\n if (!done) {\n let newT = t;\n let newStocks: IntegrationEngineOutputArray | undefined;\n\n do {\n newStocks = integrator(newStocks ?? stocksAtT, newT, h, getFlows);\n newT += h;\n iterations += 1;\n ({ userdata, done } = criterion(newStocks, newT, userdata, iterations));\n } while (!done);\n }\n\n return userdata;\n}\n\nexport type { FlowEvaluator, ConvergenceCriterion };\nexport { step, converge };\n","import {\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n} from './types';\n\nexport function euler(\n y: IntegrationEngineInputArray,\n x: number,\n h: number,\n derivatives: (\n y: IntegrationEngineInputArray,\n x: number,\n ) => IntegrationEngineOutputArray,\n): IntegrationEngineOutputArray {\n const n: number = y.length;\n const dydx = derivatives(y, x);\n const yTemp = dydx; // Reuse array for result to avoid allocation and GC\n for (let i = 0; i < n; i += 1) yTemp[i] = y[i] + h * dydx[i];\n return yTemp;\n}\n\nexport function rk4(\n y: IntegrationEngineInputArray,\n x: number,\n h: number,\n derivatives: (\n y: IntegrationEngineInputArray,\n x: number,\n ) => IntegrationEngineOutputArray,\n): IntegrationEngineOutputArray {\n const n: number = y.length;\n\n const dydx = derivatives(y, x);\n const yTemp = new Array(n) as IntegrationEngineOutputArray;\n\n const h2 = h / 2.0;\n const h6 = h / 6.0;\n const xhh = x + h2;\n\n for (let i = 0; i < n; i += 1) yTemp[i] = y[i] + h2 * dydx[i];\n let dydxTemp = derivatives(yTemp, xhh);\n\n for (let i = 0; i < n; i += 1) yTemp[i] = y[i] + h2 * dydxTemp[i];\n const dydxM = derivatives(yTemp, xhh);\n\n for (let i = 0; i < n; i += 1) {\n yTemp[i] = y[i] + h * dydxM[i];\n dydxM[i] += dydxTemp[i];\n }\n dydxTemp = derivatives(yTemp, x + h);\n\n for (let i = 0; i < n; i += 1)\n yTemp[i] = y[i] + h6 * (dydx[i] + dydxTemp[i] + 2.0 * dydxM[i]);\n return yTemp;\n}\n","import type {\n ModelElementIds,\n ModelElementArray,\n ModelElementObject,\n ModelRecord,\n} from './model';\nimport { Model } from './model';\n\nimport { FlowEvaluator } from './box-model/types';\n\nclass ModelSimulator<\n S extends ModelElementIds,\n F extends ModelElementIds,\n V extends ModelElementIds,\n P extends ModelElementIds,\n> {\n public readonly model: Model;\n\n public readonly parameters: ModelElementObject

;\n\n public record: ModelRecord;\n\n public h: number;\n\n protected flowPerStockCache: {\n t: number;\n value: readonly [...ModelElementArray];\n } | null;\n\n protected flowEvaluator: FlowEvaluator>;\n\n protected flowEvaluatorWithCache: FlowEvaluator>;\n\n constructor(\n model: Model,\n stocks: ModelElementObject,\n parameters: ModelElementObject

,\n t: number,\n h: number,\n ) {\n this.model = model;\n this.parameters = parameters;\n this.flowPerStockCache = null;\n this.record = this.model.evaluate(stocks, parameters, t);\n this.h = h;\n this.flowEvaluator = this.model.createFlowEvaluator(parameters);\n this.flowEvaluatorWithCache = this.evaluateFlowPerStockWithCache.bind(this);\n }\n\n protected evaluateFlowPerStockWithCache(\n stockArray: readonly [...ModelElementArray],\n t: number,\n ): [...ModelElementArray] {\n if (this.flowPerStockCache !== null && this.flowPerStockCache.t === t)\n return [...this.flowPerStockCache.value];\n\n return this.flowEvaluator(stockArray, t);\n }\n\n step(): ModelRecord {\n const { stocks, parameters, t } = this.record;\n const newStocks = this.model.step(\n stocks,\n t,\n this.h,\n this.flowEvaluatorWithCache,\n );\n const newRecord = this.model.evaluate(newStocks, parameters, t + this.h);\n this.flowPerStockCache = {\n t: newRecord.t,\n value: this.model.stocksToStockArray(\n this.model.accumulateFlowsPerStock(newRecord.flows),\n ),\n };\n this.record = newRecord;\n return newRecord;\n }\n}\n\nexport default ModelSimulator;\n","import kebabCase from 'lodash/kebabCase';\n\nimport { ModelElementObject } from './model';\nimport CircularEconomyModel, { Record } from './circular-economy-model';\nimport { loadSvg } from './util/load-svg';\nimport { guardedQuerySelector } from './util/guarded-query-selectors';\n\nconst svgUrl = new URL('../svg/model.svg', import.meta.url);\n\nconst mainFlowIds = [\n 'abandon',\n 'acquireNewlyProduced',\n 'acquireRefurbished',\n 'acquireRepaired',\n 'acquireUsed',\n 'disposeBroken',\n 'disposeHibernating',\n 'goBroken',\n 'landfill',\n 'produceFromNaturalResources',\n 'produceFromRecycledMaterials',\n 'recycle',\n 'refurbish',\n 'repair',\n] as const;\n\ntype MainFlowIds = typeof mainFlowIds;\n\nconst flowVizSigns: ModelElementObject = {\n abandon: +1,\n acquireNewlyProduced: -1,\n acquireRefurbished: -1,\n acquireRepaired: -1,\n acquireUsed: -1,\n disposeBroken: -1,\n disposeHibernating: -1,\n goBroken: -1,\n landfill: -1,\n produceFromNaturalResources: -1,\n produceFromRecycledMaterials: -1,\n recycle: -1,\n refurbish: -1,\n repair: -1,\n};\n\nconst dashGap = 30; // FIXME: Calculate from CSS\nconst lineWidth = 10; // FIXME: Calculate from CSS\nconst dotRadius = 20; // FIXME: Calculate from CSS\nconst lineSegmentArea = lineWidth * dashGap;\nconst dotWithoutLineSegmentArea =\n Math.sqrt(dotRadius ** 2 - lineWidth ** 2) * lineWidth;\nconst averageFlowVizWidth = lineSegmentArea + dotWithoutLineSegmentArea;\nconsole.log(lineSegmentArea, dotWithoutLineSegmentArea, averageFlowVizWidth);\nconst quantityScaleFactor = 30000.0;\nexport default class Visualization {\n protected readonly model: CircularEconomyModel;\n\n public readonly element: HTMLDivElement;\n\n protected readonly svg: SVGSVGElement;\n\n protected constructor(model: CircularEconomyModel, svg: SVGSVGElement) {\n this.model = model;\n this.svg = svg;\n\n this.element = document.createElement('div');\n this.element.append(this.svg);\n }\n\n protected updateSvgFlows(\n deltaMs: DOMHighResTimeStamp,\n stepSize: number,\n record: Record,\n ) {\n const { flows } = record;\n const flowVizScale =\n (stepSize * (quantityScaleFactor / record.parameters.numberOfUsers)) /\n averageFlowVizWidth;\n mainFlowIds.forEach((id) => {\n const flow = flows[id];\n const flowVizSign = flowVizSigns[id];\n const elementId = `${kebabCase(id)}-flow`;\n const element = guardedQuerySelector(\n this.svg,\n `#${elementId}`,\n SVGPathElement,\n );\n const lastDashOffset = parseFloat(\n element.getAttribute('stroke-dashoffset') ?? '0',\n );\n // The dash offset step must not be small compared to the dash gap.\n // Otherwise, the flow animation may appear to move backwards.\n const dashOffsetStep = Math.max(\n -0.3 * dashGap,\n Math.min(flowVizSign * (deltaMs * flow) * flowVizScale, 0.1 * dashGap),\n );\n const dashOffset =\n (Number.isNaN(lastDashOffset) ? 0 : lastDashOffset) + dashOffsetStep;\n\n element.setAttribute('stroke-dashoffset', `${dashOffset}`);\n element.setAttribute('stroke-dasharray', `0 ${dashGap}`);\n });\n }\n\n protected updateSvgStocks(\n deltaMs: DOMHighResTimeStamp,\n stepSize: number,\n record: Record,\n ) {\n const { stocks } = record;\n const stockVizScale = quantityScaleFactor / record.parameters.numberOfUsers;\n this.model.stockIds.forEach((id) => {\n const elementId = kebabCase(id);\n const element = this.svg.getElementById(elementId);\n if (element === null) {\n throw new Error(\n `SVG element with id ${elementId} for stock ${id} not found.`,\n );\n }\n if (!(element instanceof SVGCircleElement)) {\n throw new Error(\n `Stock element for stock ${id} with id ${elementId} is not an SVG circle element.`,\n );\n }\n const stock = stocks[id];\n const radius = Math.sqrt((stock * stockVizScale) / Math.PI);\n element.setAttribute('r', `${radius}`);\n });\n }\n\n protected updateSvg(\n deltaMs: DOMHighResTimeStamp,\n stepSize: number,\n record: Record,\n ) {\n this.updateSvgFlows(deltaMs, stepSize, record);\n this.updateSvgStocks(deltaMs, stepSize, record);\n }\n\n public update(\n deltaMs: DOMHighResTimeStamp,\n stepSize: number,\n record: Record,\n ) {\n this.updateSvg(deltaMs, stepSize, record);\n }\n\n public static prepareSvg(model: CircularEconomyModel, svg: SVGSVGElement) {\n const createSVGElement = (tagName: string) =>\n svg.ownerDocument.createElementNS('http://www.w3.org/2000/svg', tagName);\n\n svg.classList.add('model-visualization');\n svg.querySelectorAll('circle, rect, path, text').forEach((element) => {\n element.removeAttribute('style');\n });\n\n const elementsToRemove = [...svg.children];\n\n const labelLayer = createSVGElement('g');\n labelLayer.classList.add('labels');\n\n const supplyLayer = createSVGElement('g');\n supplyLayer.classList.add('supplies');\n\n const capacityLayer = createSVGElement('g');\n capacityLayer.classList.add('capacities');\n\n const flowLayer = createSVGElement('g');\n flowLayer.classList.add('flows');\n svg.append(capacityLayer, flowLayer, supplyLayer, labelLayer);\n\n svg.querySelectorAll('text').forEach((baseElement) => {\n const clone = baseElement.cloneNode(true) as SVGTextElement;\n clone.classList.add('label');\n labelLayer.append(clone);\n });\n\n svg.querySelectorAll('rect').forEach((baseElement) => {\n const clone = baseElement.cloneNode(false) as SVGRectElement;\n clone.classList.add('capacity');\n capacityLayer.append(clone);\n });\n\n model.stockIds\n .filter((id) => id.startsWith('supplyOf'))\n .forEach((id) => {\n const baseElementId = kebabCase(id.replace(/^supplyOf/, ''));\n const baseElement = guardedQuerySelector(\n svg,\n `#${baseElementId}`,\n SVGGeometryElement,\n );\n\n const clone = baseElement.cloneNode(false) as SVGGeometryElement;\n clone.id = `supply-of-${baseElement.id}`;\n clone.classList.add('stock', 'supply');\n supplyLayer.append(clone);\n });\n const phonesInUse = guardedQuerySelector(\n svg,\n '#phones-in-use',\n SVGGeometryElement,\n );\n const phonesInUseClone = phonesInUse.cloneNode(false) as SVGGeometryElement;\n supplyLayer.append(phonesInUseClone);\n\n model.stockIds\n .filter((id) => id.startsWith('capacityOf'))\n .forEach((id) => {\n const baseElementId = kebabCase(id.replace(/^capacityOf/, ''));\n const baseElement = guardedQuerySelector(\n svg,\n `#${baseElementId}`,\n SVGGeometryElement,\n );\n\n const clone = baseElement.cloneNode(false) as SVGGeometryElement;\n clone.id = `capacity-of-${baseElementId}`;\n clone.classList.add('stock', 'capacity');\n capacityLayer.append(clone);\n });\n mainFlowIds.forEach((id) => {\n const baseElementId = kebabCase(id);\n const baseElement = guardedQuerySelector(\n svg,\n `#${baseElementId}`,\n SVGGeometryElement,\n );\n\n const edge = baseElement.cloneNode(false) as SVGGeometryElement;\n edge.id = `${baseElementId}-edge`;\n edge.removeAttribute('style');\n edge.classList.add('flow', 'edge');\n flowLayer.append(edge);\n\n const flow = baseElement.cloneNode(false) as SVGGeometryElement;\n flow.id = `${baseElementId}-flow`;\n flow.removeAttribute('style');\n flow.classList.add('flow', 'anim-edge');\n flowLayer.append(flow);\n });\n\n elementsToRemove.forEach((element) => element.remove());\n }\n\n public static async create(model: CircularEconomyModel) {\n const svg = await loadSvg(svgUrl);\n this.prepareSvg(model, svg);\n return new Visualization(model, svg);\n }\n}\n","var createCompounder = require('./_createCompounder');\n\n/**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\nvar kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n});\n\nmodule.exports = kebabCase;\n","var arrayReduce = require('./_arrayReduce'),\n deburr = require('./deburr'),\n words = require('./words');\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\";\n\n/** Used to match apostrophes. */\nvar reApos = RegExp(rsApos, 'g');\n\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\nfunction createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n}\n\nmodule.exports = createCompounder;\n","/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduce;\n","var deburrLetter = require('./_deburrLetter'),\n toString = require('./toString');\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */\nvar reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n/** Used to compose unicode character classes. */\nvar rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;\n\n/** Used to compose unicode capture groups. */\nvar rsCombo = '[' + rsComboRange + ']';\n\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\nvar reComboMark = RegExp(rsCombo, 'g');\n\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\nfunction deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n}\n\nmodule.exports = deburr;\n","var basePropertyOf = require('./_basePropertyOf');\n\n/** Used to map Latin Unicode letters to basic Latin letters. */\nvar deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n};\n\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\nvar deburrLetter = basePropertyOf(deburredLetters);\n\nmodule.exports = deburrLetter;\n","/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = basePropertyOf;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var asciiWords = require('./_asciiWords'),\n hasUnicodeWord = require('./_hasUnicodeWord'),\n toString = require('./toString'),\n unicodeWords = require('./_unicodeWords');\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\nfunction words(string, pattern, guard) {\n string = toString(string);\n pattern = guard ? undefined : pattern;\n\n if (pattern === undefined) {\n return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);\n }\n return string.match(pattern) || [];\n}\n\nmodule.exports = words;\n","/** Used to match words composed of alphanumeric characters. */\nvar reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction asciiWords(string) {\n return string.match(reAsciiWord) || [];\n}\n\nmodule.exports = asciiWords;\n","/** Used to detect strings that need a more robust regexp to match words. */\nvar reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\nfunction hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n}\n\nmodule.exports = hasUnicodeWord;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\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',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\",\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;\n\n/** Used to match complex or compound words. */\nvar reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n].join('|'), 'g');\n\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n}\n\nmodule.exports = unicodeWords;\n","/**\n * Loads an external SVG file and returns the DOM tree of its first element.\n *\n * @param {string|URL} uri\n * @param {boolean} clearStyles\n * If true removes the style elements from the file\n * @return {Promise}\n */\nexport async function loadSvg(uri: string | URL, clearStyles = true) {\n const response = await fetch(uri);\n if (response.status < 200 || response.status >= 300) {\n throw new Error(\n `Server returned status ${response.status} (${\n response.statusText\n }) loading ${new URL(uri).href}.`,\n );\n }\n const svgText = await response.text();\n const div = document.createElement('div');\n div.innerHTML = svgText;\n const svgDoc = div.querySelector('svg');\n if (svgDoc === null) {\n throw new Error(`No SVG element found in ${new URL(uri).href}.`);\n }\n\n if (clearStyles) {\n svgDoc.querySelectorAll('style')?.forEach((s) => s.remove());\n }\n\n return svgDoc;\n}\n","export function guardedQuerySelector(\n elem: Element | Document,\n selector: string,\n type: { new (...args: unknown[]): T },\n): T {\n const result = elem.querySelector(selector);\n if (result === null) {\n throw new Error(`No element found matching selector ${selector}.`);\n }\n if (!(result instanceof type)) {\n throw new Error(\n `Element matching selector ${selector} has the wrong type.`,\n );\n }\n return result;\n}\n\nexport function guardedQuerySelectorAll(\n elem: Element | Document,\n selector: string,\n type: { new (...args: unknown[]): T },\n): NodeListOf {\n const results = elem.querySelectorAll(selector);\n results.forEach((result) => {\n if (!(result instanceof type)) {\n throw new Error(\n `An element matching selector ${selector} has the wrong type.`,\n );\n }\n });\n\n return results as NodeListOf;\n}\n","module.exports = require('./helpers/bundle-url').getBundleURL('kdWl4') + \"model.f8e270f6.svg\";","export async function documentReady() {\n return new Promise((resolve) => {\n const state = document.readyState;\n if (state === 'complete' || state === 'interactive') {\n setTimeout(resolve, 0);\n }\n\n document.addEventListener('DOMContentLoaded', () => resolve());\n });\n}\n","import isVarName from '../util/is-var-name';\n\nimport FunctionParameterTransform, {\n PararameterTransformFunction,\n} from './function-parameter-transform';\nimport { ModelElementIds, ModelElementObject } from '../model';\n\nexport default class ScriptedParameterTransform<\n P extends ModelElementIds,\n> extends FunctionParameterTransform

{\n public readonly script: string;\n\n constructor(i18nKey: string, parameterIds: P, script: string) {\n super(\n i18nKey,\n ScriptedParameterTransform.createFunction(parameterIds, script),\n );\n this.script = script;\n }\n\n static createFunction

(\n parameterIds: P,\n script: string,\n ): PararameterTransformFunction

{\n parameterIds.forEach((parameterId) => {\n if (!isVarName(parameterId)) {\n throw new Error(\n `Parameter name '${parameterId}' can not be used as a variable`,\n );\n }\n });\n\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const wrappedScript = new Function(script).toString();\n\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const func = new Function(\n `{ ${parameterIds.join(', ')} }`,\n `(${wrappedScript})(); return { ${parameterIds.join(', ')} }`,\n ) as PararameterTransformFunction

;\n\n return >(parameters: T) => {\n const transformedParameters = func(parameters);\n Object.assign(parameters, transformedParameters);\n return parameters;\n };\n }\n}\n","export default function isVarName(str: unknown): boolean {\n if (typeof str !== 'string') {\n return false;\n }\n\n if (str.trim() !== str) {\n return false;\n }\n\n if (str.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/) === null) {\n return false;\n }\n\n return true;\n}\n","import ParameterTransform from './parameter-transform';\nimport { ModelElementIds, ModelElementObject } from '../model';\n\nexport type PararameterTransformFunction

= <\n T extends ModelElementObject

,\n>(\n parameters: T,\n) => T;\n\nexport default class FunctionParameterTransform<\n P extends ModelElementIds,\n> extends ParameterTransform

{\n protected readonly callable: PararameterTransformFunction

;\n\n constructor(i18nKey: string, callable: PararameterTransformFunction

) {\n super(i18nKey);\n this.callable = callable;\n }\n\n applyTo>(parameters: T): T {\n this.callable(parameters);\n return parameters;\n }\n}\n","import type { ModelElementIds, ModelElementObject } from '../model';\n\nexport default abstract class ParameterTransform

{\n public readonly i18nKey: string;\n\n protected constructor(i18nKey: string) {\n this.i18nKey = i18nKey;\n }\n\n abstract applyTo>(parameters: T): T;\n}\n"],"names":["$d892378a320191c0$var$names","id","callback","$parcel$global","globalThis","self","window","global","$parcel$interopDefault","a","__esModule","default","$parcel$modules","$parcel$inits","parcelRequire","exports","init","module","call","err","Error","code","register","parcelRegister","Constructor","protoProps","staticProps","$08030b30a83dd10b$var$isDeepEqual","$08030b30a83dd10b$var$isDeepStrictEqual","$bYqme","$08030b30a83dd10b$var$_typeof","o","Symbol","iterator","constructor","prototype","$08030b30a83dd10b$var$_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","$08030b30a83dd10b$var$_toPropertyKey","arg","key","$08030b30a83dd10b$var$_toPrimitive","input","hint","prim","toPrimitive","undefined","res","TypeError","String","Number","$08030b30a83dd10b$var$_require$codes","$idZmf","codes","$08030b30a83dd10b$var$ERR_AMBIGUOUS_ARGUMENT","ERR_AMBIGUOUS_ARGUMENT","$08030b30a83dd10b$var$ERR_INVALID_ARG_TYPE","ERR_INVALID_ARG_TYPE","$08030b30a83dd10b$var$ERR_INVALID_ARG_VALUE","ERR_INVALID_ARG_VALUE","$08030b30a83dd10b$var$ERR_INVALID_RETURN_VALUE","ERR_INVALID_RETURN_VALUE","$08030b30a83dd10b$var$ERR_MISSING_ARGS","ERR_MISSING_ARGS","$dfdGN","$5d0kT","$08030b30a83dd10b$var$inspect","inspect","$08030b30a83dd10b$require$_require$types","types","$08030b30a83dd10b$var$isPromise","isPromise","$08030b30a83dd10b$var$isRegExp","isRegExp","$08030b30a83dd10b$var$objectAssign","$08030b30a83dd10b$var$objectIs","$08030b30a83dd10b$var$RegExpPrototypeTest","$08030b30a83dd10b$var$lazyLoadComparison","comparison","isDeepEqual","isDeepStrictEqual","$08030b30a83dd10b$var$warned","$08030b30a83dd10b$var$assert","$08030b30a83dd10b$var$ok","$08030b30a83dd10b$var$NO_EXCEPTION_SENTINEL","$08030b30a83dd10b$var$innerFail","obj","message","$08030b30a83dd10b$var$innerOk","fn","argLen","value","generatedMessage","actual","expected","operator","stackStartFn","_len","arguments","args","Array","_key","apply","concat","fail","$08030b30a83dd10b$var$fail","internalMessage","argsLen","warn","emitWarning","console","bind","errArgs","AssertionError","ok","equal","notEqual","deepEqual","notDeepEqual","deepStrictEqual","notDeepStrictEqual","$08030b30a83dd10b$var$notDeepStrictEqual","strictEqual","notStrictEqual","$08030b30a83dd10b$var$Comparison","Comparison","keys","_this","$08030b30a83dd10b$var$_classCallCheck","instance","forEach","$08030b30a83dd10b$var$expectedException","msg","name","push","$08030b30a83dd10b$var$compareExceptionKey","isPrototypeOf","$08030b30a83dd10b$var$getActual","e","$08030b30a83dd10b$var$checkIsPromise","then","catch","$08030b30a83dd10b$var$waitForActual","promiseFn","Promise","resolve","resultPromise","$08030b30a83dd10b$var$expectsError","error","details","fnType","$08030b30a83dd10b$var$expectsNoError","$08030b30a83dd10b$var$internalMatch","string","regexp","fnName","match","throws","_len2","_key2","rejects","_len3","_key3","result","doesNotThrow","_len4","_key4","doesNotReject","_len5","_key5","ifError","newErr","origStack","stack","tmp2","split","shift","tmp1","pos","indexOf","slice","join","doesNotMatch","strict","$08030b30a83dd10b$var$strict","_len6","_key6","$8b79be5a44896e9e$var$cachedSetTimeout","$8b79be5a44896e9e$var$cachedClearTimeout","$8b79be5a44896e9e$var$currentQueue","$8b79be5a44896e9e$var$process","$8b79be5a44896e9e$var$defaultSetTimout","$8b79be5a44896e9e$var$defaultClearTimeout","$8b79be5a44896e9e$var$runTimeout","fun","setTimeout","clearTimeout","$8b79be5a44896e9e$var$queue","$8b79be5a44896e9e$var$draining","$8b79be5a44896e9e$var$queueIndex","$8b79be5a44896e9e$var$cleanUpNextTick","$8b79be5a44896e9e$var$drainQueue","timeout","len","run","$8b79be5a44896e9e$var$runClearTimeout","marker","$8b79be5a44896e9e$var$Item","array","$8b79be5a44896e9e$var$noop","nextTick","title","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","$d44909437516936e$var$_typeof","$d44909437516936e$var$_defineProperties","$d44909437516936e$var$_toPropertyKey","$d44909437516936e$var$_toPrimitive","$d44909437516936e$var$_setPrototypeOf","p","setPrototypeOf","__proto__","$d44909437516936e$var$_getPrototypeOf","getPrototypeOf","get","$d44909437516936e$export$e45cb6485273080e","set","v","$d44909437516936e$var$assert","$d44909437516936e$var$util","$d44909437516936e$var$codes","$d44909437516936e$var$createErrorType","Base","NodeError","_Base","$d44909437516936e$var$_inherits","subClass","superClass","create","hasNativeReflectConstruct","_super","$d44909437516936e$var$_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","valueOf","Super","NewTarget","$d44909437516936e$var$_possibleConstructorReturn","$d44909437516936e$var$_assertThisInitialized","ReferenceError","arg1","arg2","arg3","$d44909437516936e$var$_classCallCheck","$d44909437516936e$var$oneOf","thing","isArray","map","search","str","substr","determiner","replace","this_len","substring","start","type","$d44909437516936e$var$includes","reason","inspected","RangeError","$3cae6d5803bad4b3$var$getOwnPropertyDescriptors","getOwnPropertyDescriptors","descriptors","getOwnPropertyDescriptor","$3cae6d5803bad4b3$var$formatRegExp","format","f","$3cae6d5803bad4b3$var$isString","objects","$3cae6d5803bad4b3$var$inspect","x","JSON","stringify","_","$3cae6d5803bad4b3$var$isNull","$3cae6d5803bad4b3$var$isObject","deprecate","noDeprecation","warned","throwDeprecation","traceDeprecation","trace","$3cae6d5803bad4b3$var$debugs","$3cae6d5803bad4b3$var$debugEnvRegex","opts","ctx","seen","stylize","$3cae6d5803bad4b3$var$stylizeNoColor","depth","colors","$3cae6d5803bad4b3$var$isBoolean","showHidden","_extend","$3cae6d5803bad4b3$var$isUndefined","customInspect","$3cae6d5803bad4b3$var$stylizeWithColor","$3cae6d5803bad4b3$var$formatValue","styleType","style","styles","recurseTimes","$3cae6d5803bad4b3$var$isFunction","base","braces","numLinesEst","hash","output","ret","primitive","$3cae6d5803bad4b3$var$formatPrimitive","simple","$3cae6d5803bad4b3$var$isNumber","visibleKeys","val","idx","getOwnPropertyNames","$3cae6d5803bad4b3$var$isError","$3cae6d5803bad4b3$var$formatError","$3cae6d5803bad4b3$var$isRegExp","RegExp","toString","$3cae6d5803bad4b3$var$isDate","Date","$3cae6d5803bad4b3$var$isArray","toUTCString","$3cae6d5803bad4b3$var$formatArray","l","$3cae6d5803bad4b3$var$hasOwnProperty","$3cae6d5803bad4b3$var$formatProperty","pop","reduce","prev","cur","desc","line","ar","re","$3cae6d5803bad4b3$var$objectToString","d","$3cae6d5803bad4b3$var$pad","n","debuglog","toUpperCase","test","pid","isBoolean","isNull","isNullOrUndefined","isNumber","isString","isSymbol","isUndefined","isObject","isDate","isError","isNativeError","isFunction","isPrimitive","isBuffer","$3cae6d5803bad4b3$var$months","prop","hasOwnProperty","log","time","getHours","getMinutes","getSeconds","getDate","getMonth","inherits","origin","add","$3cae6d5803bad4b3$var$kCustomPromisifiedSymbol","$3cae6d5803bad4b3$var$callbackifyOnRejected","cb","newReason","promisify","original","promiseResolve","promiseReject","promise","reject","defineProperties","custom","callbackify","callbackified","maybeCb","rej","$hQsBH","$lCUJL","$iVfsl","$6n4Tb","$d2e6ca9e43aacb42$var$uncurryThis","$d2e6ca9e43aacb42$var$BigIntSupported","BigInt","$d2e6ca9e43aacb42$var$SymbolSupported","$d2e6ca9e43aacb42$var$ObjectToString","$d2e6ca9e43aacb42$var$numberValue","$d2e6ca9e43aacb42$var$stringValue","$d2e6ca9e43aacb42$var$booleanValue","$d2e6ca9e43aacb42$var$bigIntValue","$d2e6ca9e43aacb42$var$symbolValue","$d2e6ca9e43aacb42$var$checkBoxedPrimitive","prototypeValueOf","$d2e6ca9e43aacb42$var$isMapToString","$d2e6ca9e43aacb42$var$isSetToString","$d2e6ca9e43aacb42$var$isWeakMapToString","$d2e6ca9e43aacb42$var$isWeakSetToString","$d2e6ca9e43aacb42$var$isArrayBufferToString","$d2e6ca9e43aacb42$var$isArrayBuffer","ArrayBuffer","working","$d2e6ca9e43aacb42$var$isDataViewToString","$d2e6ca9e43aacb42$var$isDataView","DataView","isArgumentsObject","isGeneratorFunction","isTypedArray","isArrayBufferView","isView","isUint8Array","isUint8ClampedArray","isUint16Array","isUint32Array","isInt8Array","isInt16Array","isInt32Array","isFloat32Array","isFloat64Array","isBigInt64Array","isBigUint64Array","Map","isMap","Set","isSet","WeakMap","isWeakMap","WeakSet","isWeakSet","isArrayBuffer","isDataView","$d2e6ca9e43aacb42$var$SharedArrayBufferCopy","SharedArrayBuffer","$d2e6ca9e43aacb42$var$isSharedArrayBufferToString","$d2e6ca9e43aacb42$var$isSharedArrayBuffer","$d2e6ca9e43aacb42$var$isNumberObject","$d2e6ca9e43aacb42$var$isStringObject","$d2e6ca9e43aacb42$var$isBooleanObject","$d2e6ca9e43aacb42$var$isBigIntObject","$d2e6ca9e43aacb42$var$isSymbolObject","isSharedArrayBuffer","isAsyncFunction","isMapIterator","isSetIterator","isGeneratorObject","isWebAssemblyCompiledModule","isNumberObject","isStringObject","isBooleanObject","isBigIntObject","isSymbolObject","isBoxedPrimitive","isAnyArrayBuffer","Uint8Array","method","$cfdd7bc16a6f0391$var$hasToStringTag","$cfdd7bc16a6f0391$var$$toString","$9rEHq","$cfdd7bc16a6f0391$var$isStandardArguments","toStringTag","$cfdd7bc16a6f0391$var$isLegacyArguments","callee","$cfdd7bc16a6f0391$var$supportsStandardArguments","isLegacyArguments","$iswqS","getOwnPropertySymbols","sym","symObj","syms","propertyIsEnumerable","$cbV5a","$6gXjj","$6e0634b5d975b0a1$var$$indexOf","allowMissing","intrinsic","$8e02ca77d270b092$var$$SyntaxError","SyntaxError","$8e02ca77d270b092$var$$Function","Function","$8e02ca77d270b092$var$$TypeError","$8e02ca77d270b092$var$getEvalledConstructor","expressionSyntax","$8e02ca77d270b092$var$$gOPD","$8e02ca77d270b092$var$throwTypeError","$8e02ca77d270b092$var$ThrowTypeError","calleeThrows","gOPDthrows","$8e02ca77d270b092$var$hasSymbols","$8e02ca77d270b092$var$hasProto","$8e02ca77d270b092$var$getProto","$8e02ca77d270b092$var$needsEval","$8e02ca77d270b092$var$TypedArray","$8e02ca77d270b092$var$INTRINSICS","AggregateError","Atomics","BigInt64Array","BigUint64Array","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","isNaN","Math","parseFloat","parseInt","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakRef","$8e02ca77d270b092$var$errorProto","$8e02ca77d270b092$var$doEval","doEval","gen","$8e02ca77d270b092$var$LEGACY_ALIASES","$eSJCt","$hhJZr","$8e02ca77d270b092$var$$concat","$8e02ca77d270b092$var$$spliceApply","splice","$8e02ca77d270b092$var$$replace","$8e02ca77d270b092$var$$strSlice","$8e02ca77d270b092$var$$exec","exec","$8e02ca77d270b092$var$rePropName","$8e02ca77d270b092$var$reEscapeChar","$8e02ca77d270b092$var$stringToPath","first","last","number","quote","subString","$8e02ca77d270b092$var$getBaseIntrinsic","alias","intrinsicName","parts","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","$d8964bbb1743abbb$var$origSymbol","$4287230ea792b293$var$test","foo","$4287230ea792b293$var$$Object","$7uTAw","$5756745b39df06db$var$toStr","$5756745b39df06db$var$max","max","$5756745b39df06db$var$concatty","b","arr","j","$5756745b39df06db$var$slicy","arrLike","offset","$5756745b39df06db$var$joiny","joiner","that","bound","$5756745b39df06db$var$ERROR_MESSAGE","boundLength","boundArgs","Empty","$c957b2d89cf0941a$var$call","$c957b2d89cf0941a$var$$hasOwn","$8wQgk","$49123e876306bb42$var$$TypeError","$49123e876306bb42$var$$apply","$49123e876306bb42$var$$call","$49123e876306bb42$var$$reflectApply","$49123e876306bb42$var$$defineProperty","$49123e876306bb42$var$$max","originalFunction","func","$49123e876306bb42$var$applyBind","$dEYu7","$6359da1a4da0c32b$var$hasDescriptors","$lpldP","$6359da1a4da0c32b$var$$TypeError","$6359da1a4da0c32b$var$$floor","loose","functionLengthIsConfigurable","functionLengthIsWritable","$9f1dedcd246e3ad0$var$hasPropertyDescriptors","$9f1dedcd246e3ad0$var$$defineProperty","$9f1dedcd246e3ad0$var$$SyntaxError","$9f1dedcd246e3ad0$var$$TypeError","property","nonEnumerable","nonWritable","nonConfigurable","$bc65a1d1be87ac6b$var$$defineProperty","$bc65a1d1be87ac6b$var$hasPropertyDescriptors","hasArrayLengthDefineBug","$f95c650c3c50a0b9$var$$gOPD","$fbe9286b8c5d6014$var$GeneratorFunction","$fbe9286b8c5d6014$var$toStr","$fbe9286b8c5d6014$var$fnToStr","$fbe9286b8c5d6014$var$isFnRegex","$fbe9286b8c5d6014$var$hasToStringTag","$fbe9286b8c5d6014$var$getProto","$fbe9286b8c5d6014$var$getGeneratorFunc","generatorFunc","$e6WPe","$i6TQG","$dc698a21108030ad$var$$toString","$dc698a21108030ad$var$hasToStringTag","$dc698a21108030ad$var$g","$dc698a21108030ad$var$typedArrays","$dc698a21108030ad$var$$slice","$dc698a21108030ad$var$getPrototypeOf","$dc698a21108030ad$var$$indexOf","$dc698a21108030ad$var$cache","typedArray","proto","$dc698a21108030ad$var$tryTypedArrays","found","getter","$dc698a21108030ad$var$trySlices","tag","$liz7M","$a45f41b45e745637$var$toStr","$a45f41b45e745637$var$hasOwnProperty","$a45f41b45e745637$var$forEachArray","receiver","$a45f41b45e745637$var$forEachString","charAt","$a45f41b45e745637$var$forEachObject","object","k","list","thisArg","$f8168662f23765f9$var$badArrayLike","$f8168662f23765f9$var$isCallableMarker","$f8168662f23765f9$var$fnToStr","$f8168662f23765f9$var$reflectApply","$f8168662f23765f9$var$constructorRegex","$f8168662f23765f9$var$isES6ClassFn","fnStr","$f8168662f23765f9$var$tryFunctionObject","$f8168662f23765f9$var$toStr","$f8168662f23765f9$var$hasToStringTag","$f8168662f23765f9$var$isIE68","$f8168662f23765f9$var$isDDA","document","$f8168662f23765f9$var$all","all","strClass","$d2f41beb2623cba4$var$possibleNames","$d2f41beb2623cba4$var$g","out","copy","fill","readUInt8","ctor","superCtor","super_","TempCtor","$9a474b7dcd09c5ab$var$ownKeys","r","t","filter","$9a474b7dcd09c5ab$var$_objectSpread","$9a474b7dcd09c5ab$var$_toPropertyKey","$9a474b7dcd09c5ab$var$_defineProperties","$9a474b7dcd09c5ab$var$_toPrimitive","$9a474b7dcd09c5ab$var$_typeof","$9a474b7dcd09c5ab$var$_possibleConstructorReturn","$9a474b7dcd09c5ab$var$_assertThisInitialized","$9a474b7dcd09c5ab$var$_wrapNativeSuper","Class","_cache","has","Wrapper","$9a474b7dcd09c5ab$var$_construct","$9a474b7dcd09c5ab$var$_getPrototypeOf","$9a474b7dcd09c5ab$var$_setPrototypeOf","Parent","$9a474b7dcd09c5ab$var$_isNativeReflectConstruct","$9a474b7dcd09c5ab$var$inspect","$9a474b7dcd09c5ab$var$ERR_INVALID_ARG_TYPE","$9a474b7dcd09c5ab$var$endsWith","$9a474b7dcd09c5ab$var$blue","$9a474b7dcd09c5ab$var$green","$9a474b7dcd09c5ab$var$red","$9a474b7dcd09c5ab$var$white","$9a474b7dcd09c5ab$var$kReadableOperator","strictEqualObject","notStrictEqualObject","notIdentical","$9a474b7dcd09c5ab$var$copyError","source","$9a474b7dcd09c5ab$var$inspectValue","compact","maxArrayLength","Infinity","breakLength","showProxy","sorted","getters","$9a474b7dcd09c5ab$var$AssertionError","_Error","_inspect$custom","$9a474b7dcd09c5ab$var$_inherits","options","$9a474b7dcd09c5ab$var$_classCallCheck","limit","stackTraceLimit","stderr","isTTY","getColorDepth","$9a474b7dcd09c5ab$var$createErrDiff","other","lastPos","end","skipped","actualInspected","actualLines","expectedLines","indicator","inputLength","columns","$9a474b7dcd09c5ab$var$repeat","count","floor","maxCount","maxLines","_actualLines","printedLines","skippedMsg","expectedLine","actualLine","divergingLines","_res","knownOperators","captureStackTrace","$4pa7q","$411c56e62e13ea6c$var$lacksProperEnumerationOrder","assign","letters","$411c56e62e13ea6c$var$assignHasPendingExceptions","preventExtensions","thrower","$dOa0R","$3351589ec22f2476$var$hasSymbols","$3351589ec22f2476$var$toObject","$3351589ec22f2476$var$$push","$3351589ec22f2476$var$$propIsEnumerable","$3351589ec22f2476$var$originalGetSymbols","source1","to","s","from","getSymbols","nextKey","propValue","$a0d7b63dfc6f5323$var$slice","$1ie2q","$a0d7b63dfc6f5323$var$origKeys","$a0d7b63dfc6f5323$var$keysShim","$a0d7b63dfc6f5323$var$originalKeys","shim","$0f125c9239cfced8$var$toStr","isArgs","$115fb06b4e6cce1c$var$keysShim","$115fb06b4e6cce1c$var$has","$115fb06b4e6cce1c$var$toStr","$115fb06b4e6cce1c$var$isArgs","$115fb06b4e6cce1c$var$isEnumerable","$115fb06b4e6cce1c$var$hasDontEnumBug","$115fb06b4e6cce1c$var$hasProtoEnumBug","$115fb06b4e6cce1c$var$dontEnums","$115fb06b4e6cce1c$var$equalsConstructorPrototype","$115fb06b4e6cce1c$var$excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","$115fb06b4e6cce1c$var$hasAutomationEqualityBug","$115fb06b4e6cce1c$var$equalsConstructorPrototypeIfNotBuggy","isArguments","theKeys","skipProto","skipConstructor","$hcnrk","is","$c855bd4e3973b6ef$var$numberIsNaN","$c0f15dcd943db777$var$_slicedToArray","$c0f15dcd943db777$var$_arrayWithHoles","$c0f15dcd943db777$var$_iterableToArrayLimit","u","next","done","return","$c0f15dcd943db777$var$_unsupportedIterableToArray","minLen","$c0f15dcd943db777$var$_arrayLikeToArray","$c0f15dcd943db777$var$_nonIterableRest","arr2","$c0f15dcd943db777$var$_typeof","$c0f15dcd943db777$var$regexFlagsSupported","flags","$c0f15dcd943db777$var$arrayFromSet","$c0f15dcd943db777$var$arrayFromMap","$c0f15dcd943db777$var$objectIs","$c0f15dcd943db777$var$objectGetOwnPropertySymbols","$c0f15dcd943db777$var$numberIsNaN","$c0f15dcd943db777$var$uncurryThis","$c0f15dcd943db777$var$hasOwnProperty","$c0f15dcd943db777$var$propertyIsEnumerable","$c0f15dcd943db777$var$objectToString","$c0f15dcd943db777$require$_require$types","$c0f15dcd943db777$var$isAnyArrayBuffer","$c0f15dcd943db777$var$isArrayBufferView","$c0f15dcd943db777$var$isDate","$c0f15dcd943db777$var$isMap","$c0f15dcd943db777$var$isRegExp","$c0f15dcd943db777$var$isSet","$c0f15dcd943db777$var$isNativeError","$c0f15dcd943db777$var$isBoxedPrimitive","$c0f15dcd943db777$var$isNumberObject","$c0f15dcd943db777$var$isStringObject","$c0f15dcd943db777$var$isBooleanObject","$c0f15dcd943db777$var$isBigIntObject","$c0f15dcd943db777$var$isSymbolObject","$c0f15dcd943db777$var$isFloat32Array","$c0f15dcd943db777$var$isFloat64Array","$c0f15dcd943db777$var$isNonIndex","charCodeAt","$c0f15dcd943db777$var$getOwnNonIndexProperties","$c0f15dcd943db777$var$compare","y","min","$c0f15dcd943db777$var$ONLY_ENUMERABLE","$c0f15dcd943db777$var$innerDeepEqual","val1","val2","memos","val1Tag","keys1","keys2","$c0f15dcd943db777$var$keyCheck","getTime","$c0f15dcd943db777$var$areSimilarFloatArrays","byteLength","buffer","byteOffset","_keys","_keys2","size","buf1","buf2","$c0f15dcd943db777$var$getEnumerables","iterationType","aKeys","bKeys","symbolKeysA","symbolKeysB","_symbolKeysB","position","val2MemoA","val2MemoB","areEq","$c0f15dcd943db777$var$objEquiv","$c0f15dcd943db777$var$setEquiv","memo","aValues","$c0f15dcd943db777$var$setMightHaveLoosePrim","altValue","$c0f15dcd943db777$var$findLooseMatchingPrimitives","bValues","_i","_val","$c0f15dcd943db777$var$setHasEqualElement","$c0f15dcd943db777$var$mapEquiv","aEntries","_aEntries$i","item1","item2","$c0f15dcd943db777$var$mapMightHaveLoosePrim","item","curB","bEntries","_i2","_bEntries$_i","$c0f15dcd943db777$var$mapHasEqualEntry","keysA","delete","setValues","key1","key2","$eh8QP","$2bLwM","$3QoWE","$9ee575a850970206$var$polyfill","getPolyfill","implementation","$a64984d95ac93f0f$var$hasSymbols","$a64984d95ac93f0f$var$toStr","$a64984d95ac93f0f$var$concat","$a64984d95ac93f0f$var$supportsDescriptors","$a64984d95ac93f0f$var$defineProperty","predicate","$a64984d95ac93f0f$var$defineProperties","predicates","supportsDescriptors","polyfill","$k6E7V","$8ZPJ8","$gKbkx","$28112f95a033d6f5$var$polyfill","NaN","$GE7rZ","$00f31ca755459a2b$export$1e71eb4bef00f6b0","$d892378a320191c0$export$2077e0241d6afd3c","$d892378a320191c0$export$837ba5c449269406","h","$d892378a320191c0$export$bcc6e673dfa14d36","$d892378a320191c0$export$ed9bd8dcaeba14f6","$d892378a320191c0$export$dbf961a8d278dbef","$d892378a320191c0$export$aa35ef1f24408ab9","$d892378a320191c0$var$map$1","A","B","C","D","E","F","c","$d892378a320191c0$var$hex","$d892378a320191c0$var$h1","$d892378a320191c0$var$h2","$d892378a320191c0$var$eq","$d892378a320191c0$var$isShort","g","$d892378a320191c0$var$alpha","$d892378a320191c0$var$HUE_RE","$d892378a320191c0$var$hsl2rgbn","$d892378a320191c0$var$hsv2rgbn","$d892378a320191c0$var$hwb2rgbn","w","rgb","$d892378a320191c0$export$b5ba70b240f8f7f","$d892378a320191c0$var$calln","$d892378a320191c0$var$hue","$d892378a320191c0$var$map","Z","Y","X","W","V","U","T","S","R","Q","P","O","N","M","L","K","G","H","I","J","$d892378a320191c0$var$names$1","OiceXe","antiquewEte","aqua","aquamarRe","azuY","beige","bisque","black","blanKedOmond","Xe","XeviTet","bPwn","burlywood","caMtXe","KartYuse","KocTate","cSO","cSnflowerXe","cSnsilk","crimson","cyan","xXe","xcyan","xgTMnPd","xWay","xgYF","xgYy","xkhaki","xmagFta","xTivegYF","xSange","xScEd","xYd","xsOmon","xsHgYF","xUXe","xUWay","xUgYy","xQe","xviTet","dAppRk","dApskyXe","dimWay","dimgYy","dodgerXe","fiYbrick","flSOwEte","foYstWAn","fuKsia","gaRsbSo","ghostwEte","gTd","gTMnPd","Way","gYF","gYFLw","gYy","honeyMw","hotpRk","RdianYd","Rdigo","ivSy","khaki","lavFMr","lavFMrXsh","lawngYF","NmoncEffon","ZXe","ZcSO","Zcyan","ZgTMnPdLw","ZWay","ZgYF","ZgYy","ZpRk","ZsOmon","ZsHgYF","ZskyXe","ZUWay","ZUgYy","ZstAlXe","ZLw","lime","limegYF","lRF","magFta","maPon","VaquamarRe","VXe","VScEd","VpurpN","VsHgYF","VUXe","VsprRggYF","VQe","VviTetYd","midnightXe","mRtcYam","mistyPse","moccasR","navajowEte","navy","Tdlace","Tive","TivedBb","Sange","SangeYd","ScEd","pOegTMnPd","pOegYF","pOeQe","pOeviTetYd","papayawEp","pHKpuff","peru","pRk","plum","powMrXe","purpN","YbeccapurpN","Yd","Psybrown","PyOXe","saddNbPwn","sOmon","sandybPwn","sHgYF","sHshell","siFna","silver","skyXe","UXe","UWay","UgYy","snow","sprRggYF","stAlXe","tan","teO","tEstN","tomato","Qe","viTet","JHt","wEte","wEtesmoke","Lw","LwgYF","$d892378a320191c0$var$RGB_RE","$d892378a320191c0$var$to","pow","$d892378a320191c0$var$from","$d892378a320191c0$var$modHSL","ratio","tmp","$d892378a320191c0$var$clone","$d892378a320191c0$var$fromObject","$d892378a320191c0$export$892596cec99bc70e","valid","_valid","_rgb","rgbString","hexString","hslString","$d892378a320191c0$export$a197af1c58e6260c","mix","color","weight","w2","c1","c2","w1","interpolate","$d892378a320191c0$var$interpolate","rgb1","rgb2","clone","alpha","clearer","greyscale","opaquer","negate","lighten","darken","saturate","desaturate","rotate","deg","$d892378a320191c0$export$625a38b961e8b5e9","$d892378a320191c0$export$b2f06b640faad956","$d892378a320191c0$var$unpack","nk","unpacked","tkeys","transparent","toLowerCase","$d892378a320191c0$export$91aedb20f296e541","m","$d892378a320191c0$export$5e91288c399be4f9","p1","p2","$c4d1694fa24f1a71$export$cf2f7c5792f80b46","$c4d1694fa24f1a71$export$2219238a014317b0","$c4d1694fa24f1a71$export$342063e11d6c3cad","$c4d1694fa24f1a71$export$8b22cf2602fb60ce","$c4d1694fa24f1a71$export$23f2a1d2818174ef","$c4d1694fa24f1a71$export$39b482c5e57630a8","$c4d1694fa24f1a71$export$c4ce752e73470fba","defaultValue","$c4d1694fa24f1a71$export$90a7f3efeed30595","$c4d1694fa24f1a71$export$953cecd6e717a553","dimension","endsWith","$c4d1694fa24f1a71$export$7ccc53e8f1e7dfc5","$c4d1694fa24f1a71$export$3722cfe417b6ed86","$c4d1694fa24f1a71$export$d66501df72047452","loopable","reverse","$c4d1694fa24f1a71$export$995eb9fca571757","a0","a1","ilen","v0","v1","datasetIndex","index","$c4d1694fa24f1a71$export$d377dcb2b61d6c4e","klen","$c4d1694fa24f1a71$var$isValidKey","$c4d1694fa24f1a71$export$667d3bf0c5f83305","tval","sval","$c4d1694fa24f1a71$export$efca4cbe5dd06740","current","sources","merger","$c4d1694fa24f1a71$export$555508cbc6add439","$c4d1694fa24f1a71$export$317a3d46287192d8","$c4d1694fa24f1a71$var$keyResolvers","$c4d1694fa24f1a71$export$2d1720544b23b823","resolver","$c4d1694fa24f1a71$var$_getKeyResolver","$c4d1694fa24f1a71$export$9d0e2d13d04f7070","$c4d1694fa24f1a71$export$a8550f7dbe79f93a","$c4d1694fa24f1a71$export$dda1d9f60106f0e9","$c4d1694fa24f1a71$export$a93c5207d687da10","$c4d1694fa24f1a71$export$ee7c8ad385a60b7b","$c4d1694fa24f1a71$export$56c0d5a1e737357d","PI","$c4d1694fa24f1a71$export$971d5caa766a69d7","$c4d1694fa24f1a71$export$d29e374196577086","$c4d1694fa24f1a71$export$2ec5befb9e6c97d4","POSITIVE_INFINITY","$c4d1694fa24f1a71$export$53c86fa97d611818","$c4d1694fa24f1a71$export$7f8ddf7c7c20b3cd","$c4d1694fa24f1a71$export$39c1cc7c062529d4","$c4d1694fa24f1a71$export$7a0bdf7d4a91ea88","$c4d1694fa24f1a71$export$9f4f30ee63539e24","log10","$c4d1694fa24f1a71$export$2408f22a0fab9ae5","sign","$c4d1694fa24f1a71$export$a05254e7c3aeba6e","epsilon","abs","$c4d1694fa24f1a71$export$a33b77bbdbb8366c","range","roundedRange","round","niceRange","fraction","niceFraction","$c4d1694fa24f1a71$export$d141bba7fdc215a3","$c4d1694fa24f1a71$export$53a70dd1ebbae346","$c4d1694fa24f1a71$export$625550452a3fa3ec","degrees","$c4d1694fa24f1a71$export$23ebac1979863676","$c4d1694fa24f1a71$export$96f57966bedc81b4","centrePoint","anglePoint","distanceFromXCenter","distanceFromYCenter","angle","atan2","distance","sqrt","$c4d1694fa24f1a71$export$158acd800e1ef08b","pt1","pt2","$c4d1694fa24f1a71$export$c18d01048907ea92","$c4d1694fa24f1a71$export$28f7fcd39efa255","$c4d1694fa24f1a71$export$ffb5f4729a158638","sameAngleIsFullCircle","angleToStart","angleToEnd","startToAngle","endToAngle","$c4d1694fa24f1a71$export$25ce5a424b770e84","$c4d1694fa24f1a71$export$3b513254972cfc9c","$c4d1694fa24f1a71$export$2ed0fc6709e59212","table","cmp","mid","hi","lo","$c4d1694fa24f1a71$export$ef35774e6d314e91","ti","$c4d1694fa24f1a71$export$ebd11618f299a286","$c4d1694fa24f1a71$var$arrayEvents","$c4d1694fa24f1a71$export$3b14a55fb2447963","listener","stub","_chartjs","$c4d1694fa24f1a71$export$71511d61b312f219","items","$c4d1694fa24f1a71$export$43caf9889c228507","requestAnimationFrame","$c4d1694fa24f1a71$export$61196ced6d74a310","argsToUse","ticking","$c4d1694fa24f1a71$export$3c2fa207a37baaea","align","$c4d1694fa24f1a71$export$ce26c07117d59d6a","$c4d1694fa24f1a71$export$9d398bebfec1c039","left","right","rtl","$c4d1694fa24f1a71$export$9e5f44173e64f162","meta","points","animationsDisabled","pointCount","_sorted","iScale","_parsed","axis","minDefined","maxDefined","getUserBounds","getPixelForValue","$c4d1694fa24f1a71$export$efccba1c4a2ef57b","xScale","yScale","_scaleRanges","newRanges","xmin","xmax","ymin","ymax","changed","$c4d1694fa24f1a71$var$atEdge","$c4d1694fa24f1a71$var$elasticIn","sin","$c4d1694fa24f1a71$var$elasticOut","$c4d1694fa24f1a71$export$f1e1789686576879","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","cos","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce","$c4d1694fa24f1a71$export$f96d196f7728bb5","$c4d1694fa24f1a71$export$db3b6bfb95261072","$c4d1694fa24f1a71$export$738ab4df8bf92ae9","$c4d1694fa24f1a71$var$numbers","$c4d1694fa24f1a71$var$colors","$c4d1694fa24f1a71$var$intlCache","$c4d1694fa24f1a71$export$ae1af26003f05816","num","locale","$c4d1694fa24f1a71$var$getNumberFormat","cacheKey","formatter","Intl","NumberFormat","$c4d1694fa24f1a71$var$formatters","values","numeric","tickValue","ticks","notation","chart","delta","maxTick","logDelta","numDecimal","minimumFractionDigits","maximumFractionDigits","logarithmic","remain","significand","includes","$c4d1694fa24f1a71$export$91477dc880baac21","formatters","$c4d1694fa24f1a71$export$6559d589eb85fbb6","$c4d1694fa24f1a71$export$2e2af4578d910ddf","$c4d1694fa24f1a71$var$getScope$1","node","$c4d1694fa24f1a71$var$set","root","scope","$c4d1694fa24f1a71$export$4368d992c4eafac0","describe","override","route","targetScope","targetName","scopeObject","targetScopeObject","privateName","local","appliers","_descriptors","_appliers","animation","backgroundColor","borderColor","datasets","devicePixelRatio","context","platform","getDevicePixelRatio","elements","events","font","family","lineHeight","hover","hoverBackgroundColor","hoverBorderColor","hoverColor","indexAxis","interaction","mode","intersect","includeInvisible","maintainAspectRatio","onHover","onClick","parsing","plugins","responsive","scale","scales","showLine","drawActiveElementsOnTop","_scriptable","startsWith","_indexable","_fallback","defaults","delay","duration","easing","loop","properties","numbers","active","resize","show","animations","visible","hide","autoPadding","padding","top","bottom","display","beginAtZero","bounds","clip","grace","grid","lineWidth","drawOnChartArea","drawTicks","tickLength","tickWidth","_ctx","tickColor","border","dash","dashOffset","width","text","minRotation","maxRotation","mirror","textStrokeWidth","textStrokeColor","autoSkip","autoSkipPadding","labelOffset","minor","major","crossAlign","showLabelBackdrop","backdropColor","backdropPadding","$c4d1694fa24f1a71$export$e7c866399fa523f5","data","gc","longest","textWidth","measureText","$c4d1694fa24f1a71$export$78acf4525d8a74c4","pixel","currentDevicePixelRatio","halfWidth","$c4d1694fa24f1a71$export$c9170ad7d4cd7e57","canvas","getContext","save","resetTransform","clearRect","height","restore","$c4d1694fa24f1a71$export$493d36ec626b6698","$c4d1694fa24f1a71$export$24baa2b76016ce0e","xOffset","yOffset","cornerRadius","xOffsetW","yOffsetW","pointStyle","rotation","radius","rad","translate","drawImage","beginPath","ellipse","arc","closePath","moveTo","lineTo","SQRT1_2","rect","borderWidth","stroke","$c4d1694fa24f1a71$export$e7094788287c5e9b","point","area","margin","$c4d1694fa24f1a71$export$8743009a87fcb00f","$c4d1694fa24f1a71$export$3d8c2f653ac9d0b9","$c4d1694fa24f1a71$export$d24c54395ce0c509","previous","flip","midpoint","$c4d1694fa24f1a71$export$6554612db691658e","bezierCurveTo","cp1x","cp2x","cp1y","cp2y","$c4d1694fa24f1a71$export$dc98b0b04f4c7758","lines","strokeWidth","strokeColor","translation","fillStyle","textAlign","textBaseline","backdrop","$c4d1694fa24f1a71$var$drawBackdrop","oldColor","fillRect","strokeStyle","strokeText","maxWidth","fillText","$c4d1694fa24f1a71$var$decorateText","strikethrough","underline","metrics","actualBoundingBoxLeft","actualBoundingBoxRight","actualBoundingBoxAscent","actualBoundingBoxDescent","yDecoration","decorationWidth","$c4d1694fa24f1a71$export$1fbe638ecf81657e","topLeft","bottomLeft","bottomRight","topRight","$c4d1694fa24f1a71$var$LINE_HEIGHT","$c4d1694fa24f1a71$var$FONT_STYLE","$c4d1694fa24f1a71$var$numberOrZero","$c4d1694fa24f1a71$export$21579262ef46735b","objProps","read","$c4d1694fa24f1a71$export$d66dc83d8cfc8dd","$c4d1694fa24f1a71$export$92108d983e8ee699","$c4d1694fa24f1a71$export$a9c23c6ac3fc3eca","$c4d1694fa24f1a71$export$34aec0b863436764","fallback","$c4d1694fa24f1a71$export$8c78c7c36408ea29","matches","$c4d1694fa24f1a71$export$407448d2b89b1813","inputs","info","cacheable","$c4d1694fa24f1a71$export$35e795649ee09318","parentContext","$c4d1694fa24f1a71$export$a9c996f45e5784d0","scopes","prefixes","rootScopes","getTarget","finalRootScopes","$c4d1694fa24f1a71$var$_resolve","cache","_cacheable","_scopes","_rootScopes","_getTarget","deleteProperty","$c4d1694fa24f1a71$var$_cached","$c4d1694fa24f1a71$var$_resolveWithPrefixes","proxy","prefix","$c4d1694fa24f1a71$var$readKey","$c4d1694fa24f1a71$var$needsSubResolver","$c4d1694fa24f1a71$var$createSubResolver","$c4d1694fa24f1a71$var$getKeysFromAllScopes","ownKeys","storage","_storage","$c4d1694fa24f1a71$export$c3950d9923825c02","subProxy","descriptorDefaults","_proxy","_context","_subProxy","_stack","$c4d1694fa24f1a71$export$7910e0436ed8d1de","setContext","$c4d1694fa24f1a71$var$_resolveWithContext","isScriptable","$c4d1694fa24f1a71$var$_resolveScriptable","getValue","$c4d1694fa24f1a71$var$_resolveArray","isIndexable","allKeys","scriptable","indexable","_allKeys","$c4d1694fa24f1a71$var$getScope","parent","parentScopes","allScopes","$c4d1694fa24f1a71$var$addScopesFromKey","$c4d1694fa24f1a71$var$subGetTarget","$c4d1694fa24f1a71$var$addScopes","parentFallback","$c4d1694fa24f1a71$var$resolveKeysFromAllScopes","$c4d1694fa24f1a71$export$4a5767248b18ef41","_parsing","parsed","parse","$c4d1694fa24f1a71$var$EPSILON","EPSILON","$c4d1694fa24f1a71$var$getPoint","skip","$c4d1694fa24f1a71$var$getValueAxis","$c4d1694fa24f1a71$var$capControlPoint","pt","$c4d1694fa24f1a71$export$3a1a48c8f6ef640e","$c4d1694fa24f1a71$export$9bb611d729802a56","domNode","parentNode","host","$c4d1694fa24f1a71$var$parseMaxStyle","styleValue","parentProperty","valueInPixels","$c4d1694fa24f1a71$var$getComputedStyle","element","ownerDocument","defaultView","getComputedStyle","$c4d1694fa24f1a71$var$positions","$c4d1694fa24f1a71$var$getPositionedStyle","suffix","$c4d1694fa24f1a71$var$useOffsetPos","shadowRoot","$c4d1694fa24f1a71$export$df995fae86a55f06","event","borderBox","boxSizing","paddings","borders","box","$c4d1694fa24f1a71$var$getCanvasPosition","touches","offsetX","offsetY","getBoundingClientRect","clientX","clientY","$c4d1694fa24f1a71$var$round1","$c4d1694fa24f1a71$export$f787f51d84a910ad","forceRatio","forceStyle","pixelRatio","deviceHeight","deviceWidth","setTransform","$c4d1694fa24f1a71$export$3466f893ebf79586","passiveSupported","passive","addEventListener","removeEventListener","$c4d1694fa24f1a71$export$b4171a6734a65d42","getPropertyValue","$c4d1694fa24f1a71$export$8a5498727ef6be21","$c4d1694fa24f1a71$export$7a38258bbe170828","$c4d1694fa24f1a71$export$2f6ca3d3b1f80bf5","cp1","cp2","$c4d1694fa24f1a71$export$3d12bd131bb975d1","rectX","setWidth","xPlus","leftForLtr","itemWidth","_itemWidth","$c4d1694fa24f1a71$export$91c6e00c14e7e6fd","direction","getPropertyPriority","setProperty","prevTextDirection","$c4d1694fa24f1a71$export$890c4ad488842ce7","$c4d1694fa24f1a71$var$propertyFn","between","compare","normalize","$c4d1694fa24f1a71$var$normalizeSegment","$c4d1694fa24f1a71$export$9fa96a7d116ea3ce","segment","prevValue","startBound","endBound","$c4d1694fa24f1a71$var$getSegment","inside","subStart","startIsBefore","endIsBefore","shouldStart","shouldStop","$c4d1694fa24f1a71$export$306ddfe3a8403e2","segments","sub","$c4d1694fa24f1a71$var$splitByStyles","segmentOptions","$c4d1694fa24f1a71$var$doSplitByStyles","chartContext","_chart","baseStyle","$c4d1694fa24f1a71$var$readStyle","_datasetIndex","spanGaps","prevStyle","addStyle","st","$c4d1694fa24f1a71$var$styleChanged","replacer","p0","p0DataIndex","p1DataIndex","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","$dfc006ada1995968$export$a424a0aa8f687495","_notify","anims","date","callbacks","numSteps","initial","currentStep","_refresh","_request","_running","_update","now","remaining","_charts","running","draw","_active","_total","tick","_lastDate","_getAnims","charts","complete","progress","listen","acc","_duration","stop","cancel","remove","$dfc006ada1995968$var$transparent","$dfc006ada1995968$var$interpolators","boolean","factor","c0","$dfc006ada1995968$export$c35d437ae5945fcd","update","cfg","currentValue","_target","_prop","elapsed","_start","_loop","_to","_from","_easing","_fn","wait","promises","_promises","resolved","$dfc006ada1995968$export$8ab227dac26677d","configure","config","animationOptions","animatedProps","_properties","option","_animateOptions","newOptions","$dfc006ada1995968$var$resolveTargetOptions","$shared","$animations","_createAnimations","$dfc006ada1995968$var$awaitAll","anim","$dfc006ada1995968$var$scaleClip","allowedOverflow","$dfc006ada1995968$var$getSortedDatasetIndices","filterVisible","metasets","_getSortedDatasetMetas","$dfc006ada1995968$var$applyStack","dsIndex","otherValue","singleMode","$dfc006ada1995968$var$isStacked","stacked","$dfc006ada1995968$var$getLastIndexInStack","vScale","positive","getMatchingVisibleMetas","$dfc006ada1995968$var$updateStacks","controller","_cachedMeta","stacks","_stacks","iAxis","vAxis","indexScale","valueScale","itemStacks","$dfc006ada1995968$var$getOrCreateStack","stackKey","indexValue","subStack","_top","_bottom","visualValues","_visualValues","$dfc006ada1995968$var$getFirstScaleId","$dfc006ada1995968$var$clearStacks","$dfc006ada1995968$var$isDirectUpdateMode","$dfc006ada1995968$var$cloneIfNotShared","cached","shared","$dfc006ada1995968$var$createStack","canStack","hidden","_stacked","$dfc006ada1995968$export$75572ec5c55b4048","initialize","linkScales","addElements","isPluginEnabled","updateIndex","dataset","getDataset","chooseId","xid","xAxisID","yid","yAxisID","rid","rAxisID","iid","iAxisID","vid","vAxisID","getScaleForId","rScale","getMeta","getDatasetMeta","scaleID","_getOtherScale","reset","_destroy","_data","_dataCheck","$dfc006ada1995968$var$convertObjectDataToArray","adata","isExtensible","_syncList","datasetElementType","buildOrUpdateElements","resetNewElements","stackChanged","oldStacked","_resyncElements","scopeKeys","datasetScopeKeys","_type","getOptionScopes","createResolver","_cachedDataOpts","parseArrayData","parseObjectData","parsePrimitiveData","isNotInOrderComparedToPrev","labels","getLabels","singleScale","xAxisKey","yAxisKey","getParsed","getDataElement","applyStack","updateRangeFromParsed","parsedValue","getMinMax","otherScale","NEGATIVE_INFINITY","otherMin","otherMax","$dfc006ada1995968$var$getUserBounds","_skip","getAllParsedValues","getMaxOverflow","getLabelAndValue","label","getLabelForValue","_clip","$dfc006ada1995968$var$defaultClip","disabled","chartArea","_drawStart","_drawCount","getStyle","resolveDatasetElementOptions","resolveDataElementOptions","$context","dataIndex","raw","_resolveElementOptions","dataElementType","elementType","sharing","enableOptionSharing","datasetElementScopeKeys","names","resolveNamedOptions","freeze","_resolveAnimations","transition","datasetAnimationScopeKeys","getSharedOptions","_sharedOptions","includeOptions","sharedOptions","_animationsDisabled","_getSharedOptions","firstOpts","previouslySharedOptions","updateSharedOptions","updateElement","_setStyle","removeHoverStyle","setHoverStyle","_removeDatasetHoverStyle","_setDatasetHoverStyle","numMeta","numData","_insertElements","_removeElements","move","updateElements","removed","_sync","_dataChanges","_onDataPush","_onDataPop","_onDataShift","_onDataSplice","newCount","_onDataUnshift","_objectData","supportsDecimation","$dfc006ada1995968$var$parseValue","entry","$dfc006ada1995968$var$parseFloatBar","startValue","endValue","barStart","barEnd","_custom","$dfc006ada1995968$var$parseArrayOrPrimitive","$dfc006ada1995968$var$isFloatBar","$dfc006ada1995968$var$parseEdge","edge","orig","$dfc006ada1995968$var$startEnd","$dfc006ada1995968$export$e97d5dc64e999004","iAxisKey","vAxisKey","bars","getBasePixel","horizontal","isHorizontal","ruler","_getRuler","vpixels","head","_calculateBarValuePixels","ipixels","_calculateBarIndexPixels","enableBorderRadius","center","$dfc006ada1995968$var$setBorderSkipped","borderSkipped","$dfc006ada1995968$var$setInflateAmount","inflateAmount","_getStacks","grouped","skipNull","_getStackCount","_getStackIndex","pixels","barThickness","$dfc006ada1995968$var$computeMinSampleSize","curr","$dfc006ada1995968$var$getAllScaleValues","$bar","visibleMetas","sort","_length","updateMinAndPrev","getPixelForTick","_startPixel","_endPixel","stackCount","categoryPercentage","barPercentage","baseValue","minBarLength","actualBase","floating","getDataVisibility","startPixel","getPixelForDecimal","endPixel","getValueForPixel","halfGrid","getLineWidthForValue","maxBarThickness","$dfc006ada1995968$var$computeFlexCategoryTraits","percent","chunk","$dfc006ada1995968$var$computeFitCategoryTraits","thickness","stackIndex","rects","_index_","_value_","$dfc006ada1995968$export$19b5c4773f17abe","iPixel","vPixel","$dfc006ada1995968$export$e04603e7d8b77172","_getRotation","_getCircumference","circumference","_getRotationExtents","isDatasetVisible","arcs","spacing","getMaxBorderWidth","getMaxOffset","maxSize","cutout","chartWeight","_getRingWeight","ratioX","ratioY","$dfc006ada1995968$var$getRatioAndOffset","endAngle","startAngle","startX","startY","endX","endY","calcMax","calcMin","maxX","maxY","minX","minY","maxHeight","outerRadius","innerRadius","radiusLength","_getVisibleDatasetWeightTotal","total","calculateTotal","_getRingWeightOffset","_circumference","animateRotate","calculateCircumference","animationOpts","centerX","centerY","animateScale","metaData","borderAlign","hoverBorderWidth","hoverOffset","ringWeightOffset","aspectRatio","legend","generateLabels","fontColor","legendItem","toggleDataVisibility","$dfc006ada1995968$export$3c9b5d28c11cbfd0","_dataset","_decimated","animated","maxGapLength","directUpdate","pointsCount","prevParsed","nullData","firstPoint","lastPoint","updateControlPoints","$dfc006ada1995968$export$2a270b3a0d973c85","_updateRadius","minSize","cutoutPercentage","getVisibleDatasetCount","xCenter","yCenter","datasetStartAngle","getIndexAngle","defaultAngle","countVisibleElements","_computeAngle","getDistanceFromCenterForValue","angleLines","circular","pointLabels","$dfc006ada1995968$export$b21a3f1286706191","$dfc006ada1995968$export$48dbc6ac651bf8be","_fullLoop","pointPosition","getPointPositionForValue","$dfc006ada1995968$export$b2f2bae6713db87","registry","getElement","$dfc006ada1995968$export$a6506504f799c5d5","BarController","BubbleController","DoughnutController","LineController","PieController","PolarAreaController","RadarController","ScatterController","$dfc006ada1995968$var$abstract","$dfc006ada1995968$var$DateAdapterBase","members","formats","diff","startOf","endOf","$dfc006ada1995968$export$f32766ea09ec8bc4","_date","$dfc006ada1995968$var$evaluateInteractionItems","handler","getSortedVisibleDatasetMetas","$dfc006ada1995968$var$binarySearch","metaset","lookupMethod","_reversePixels","el","getRange","$dfc006ada1995968$var$getIntersectItems","useFinalPosition","isPointInArea","inRange","$dfc006ada1995968$var$getNearestItems","$dfc006ada1995968$var$getNearestCartesianItems","distanceMetric","$dfc006ada1995968$var$getDistanceMetricForAxis","useX","useY","deltaX","deltaY","minDistance","getCenterPoint","pointInArea","getProps","$dfc006ada1995968$var$getAxisItems","rangeMethod","intersectsItem","$dfc006ada1995968$export$a13296960cae0384","modes","nearest","$dfc006ada1995968$var$STATIC_POSITIONS","$dfc006ada1995968$var$filterByPosition","$dfc006ada1995968$var$filterDynamicPositionByAxis","$dfc006ada1995968$var$sortByWeight","$dfc006ada1995968$var$getCombinedMax","maxPadding","$dfc006ada1995968$var$updateMaxPadding","boxPadding","$dfc006ada1995968$var$fitBoxes","boxes","params","layout","refit","refitBoxes","$dfc006ada1995968$var$getMargins","positions","same","$dfc006ada1995968$var$updateDims","getPadding","newWidth","outerWidth","newHeight","outerHeight","widthChanged","heightChanged","fullSize","$dfc006ada1995968$var$setBoxDims","$dfc006ada1995968$var$placeBoxes","userPadding","placed","stackWeight","$dfc006ada1995968$export$1ecca0613f5e56d2","addBox","_layers","z","removeBox","layoutItem","minPadding","availableWidth","availableHeight","$dfc006ada1995968$var$buildLayoutBoxes","layoutBoxes","$dfc006ada1995968$var$wrapBoxes","wrap","centerHorizontal","centerVertical","leftAndTop","rightAndBottom","vertical","verticalBoxes","horizontalBoxes","beforeLayout","visibleVerticalBoxCount","vBoxMaxWidth","hBoxMaxHeight","$dfc006ada1995968$var$setLayoutDims","layouts","$dfc006ada1995968$var$buildStacks","$dfc006ada1995968$var$handleMaxPadding","updatePos","change","$dfc006ada1995968$export$7b1aeb87f31f7da8","acquireContext","releaseContext","getMaximumSize","isAttached","updateConfig","$dfc006ada1995968$export$a40a96b24b46cf35","$dfc006ada1995968$var$EXPANDO_KEY","$dfc006ada1995968$var$EVENT_TYPES","touchstart","touchmove","touchend","pointerenter","pointerdown","pointermove","pointerup","pointerleave","pointerout","$dfc006ada1995968$var$isNullOrEmpty","$dfc006ada1995968$var$eventListenerOptions","$dfc006ada1995968$var$removeListener","$dfc006ada1995968$var$nodeListContains","nodeList","contains","$dfc006ada1995968$var$createAttachObserver","observer","MutationObserver","entries","trigger","addedNodes","removedNodes","observe","childList","subtree","$dfc006ada1995968$var$createDetachObserver","$dfc006ada1995968$var$drpListeningCharts","$dfc006ada1995968$var$oldDevicePixelRatio","$dfc006ada1995968$var$onWindowResize","dpr","$dfc006ada1995968$var$createResizeObserver","container","clientWidth","ResizeObserver","contentRect","$dfc006ada1995968$var$releaseObserver","disconnect","$dfc006ada1995968$var$createProxyAndListen","$dfc006ada1995968$var$fromNativeEvent","native","$dfc006ada1995968$var$addListener","$dfc006ada1995968$export$f02da7f882cf6b2e","$dfc006ada1995968$var$initCanvas","renderHeight","getAttribute","renderWidth","displayWidth","displayHeight","removeAttribute","setAttribute","proxies","$proxies","handlers","attach","detach","bbWidth","bbHeight","margins","containerSize","$c4d1694fa24f1a71$var$getContainerSize","containerStyle","containerBorder","containerPadding","clientHeight","maintainHeight","isConnected","$dfc006ada1995968$export$db77ccec0bb4ccac","tooltipPosition","hasValue","final","$dfc006ada1995968$var$skip","newTicks","majorStart","majorEnd","ceil","$dfc006ada1995968$var$reverseAlign","$dfc006ada1995968$var$offsetFromEdge","$dfc006ada1995968$var$getTicksLimit","ticksLength","maxTicksLimit","$dfc006ada1995968$var$sample","numItems","increment","$dfc006ada1995968$var$getTickMarkLength","$dfc006ada1995968$var$getTitleHeight","$dfc006ada1995968$export$d60cfc58d3c358b6","_userMin","_userMax","_suggestedMin","suggestedMin","_suggestedMax","suggestedMax","metas","paddingLeft","paddingTop","paddingRight","paddingBottom","getTicks","xLabels","yLabels","getLabelItems","_labelItems","_computeLabelItems","_dataLimitsCached","beforeUpdate","tickOpts","sampleSize","_margins","_labelSizes","_gridLineItems","beforeSetDimensions","setDimensions","afterSetDimensions","_maxLength","beforeDataLimits","determineDataLimits","afterDataLimits","_range","minmax","keepZero","beforeBuildTicks","buildTicks","afterBuildTicks","samplingEnabled","_convertTicksToLabels","beforeCalculateLabelRotation","calculateLabelRotation","afterCalculateLabelRotation","$dfc006ada1995968$var$autoSkip","determinedMaxTicks","$dfc006ada1995968$var$determineMaxTicks","_tickSize","maxScale","maxChart","ticksLimit","majorIndices","enabled","$dfc006ada1995968$var$getMajorIndices","numMajorIndices","$dfc006ada1995968$var$skipMajors","$dfc006ada1995968$var$calculateSpacing","evenMajorSpacing","$dfc006ada1995968$var$getEvenSpacing","factors","avgMajorSpacing","afterAutoSkip","beforeFit","fit","afterFit","afterUpdate","reversePixels","_alignToPixels","alignToPixels","_callHooks","notifyPlugins","beforeTickToLabelConversion","generateTickLabels","afterTickToLabelConversion","maxLabelDiagonal","numTicks","labelRotation","_isVisible","labelSizes","_getLabelSizes","maxLabelWidth","widest","maxLabelHeight","highest","radians","asin","titleOpts","gridOpts","titleHeight","tickPadding","angleRadians","labelHeight","labelWidth","_calculatePadding","_handleMargins","isRotated","labelsBelowTicks","offsetLeft","offsetRight","isFullSize","_computeLabelSizes","jlen","tickFont","fontString","nestedLabel","_longestTextCache","caches","widths","heights","widestLabelSize","highestLabelSize","_resolveTickFontOptions","gcLen","valueAt","decimal","getDecimalForPixel","getBaseValue","optionTicks","rot","_computeGridLineItems","borderValue","lineValue","alignedLineValue","tx1","ty1","tx2","ty2","x1","y1","x2","y2","tl","borderOpts","axisWidth","axisHalfWidth","alignBorderValue","positionAxisID","step","optsAtIndex","optsAtIndexBorder","lineColor","tickBorderDash","tickBorderDashOffset","$dfc006ada1995968$var$getPixelForGridLine","offsetGridLines","validIndex","_ticksLength","_borderValue","lineCount","textOffset","tickAndPadding","hTickAndPadding","_getXAxisLabelAlignment","_getYAxisLabelAlignment","halfCount","tickTextAlign","labelPadding","_computeLabelArea","drawBackground","findIndex","drawGrid","drawLine","setLineDash","lineDashOffset","drawBorder","lastLineWidth","drawLabels","renderTextOptions","drawTitle","titleX","titleY","$dfc006ada1995968$var$titleArgs","tz","gz","bz","axisID","_maxDigits","fontSize","$dfc006ada1995968$var$TypedRegistry","isForType","parentScope","$dfc006ada1995968$var$registerDefaults","itemDefaults","defaultRoutes","$dfc006ada1995968$var$routeDefaults","routes","propertyParts","sourceName","sourceScope","overrides","unregister","$dfc006ada1995968$export$4bb7493d241fd8a5","_each","addControllers","controllers","addPlugins","addScales","getController","_get","getPlugin","getScale","removeControllers","removeElements","removePlugins","removeScales","typedRegistry","reg","_getRegistryForType","_exec","itemReg","component","camelMethod","_typedRegistries","$dfc006ada1995968$var$PluginService","notify","hook","_init","_createDescriptors","plugin","cancelable","invalidate","_oldCache","_notifyStateChanges","$dfc006ada1995968$var$allPlugins","localIds","$dfc006ada1995968$var$createDescriptors","$dfc006ada1995968$var$pluginOpts","pluginScopeKeys","previousDescriptors","some","$dfc006ada1995968$var$getIndexAxis","datasetDefaults","datasetOptions","$dfc006ada1995968$var$idMatchesAxis","$dfc006ada1995968$var$determineAxis","scaleOptions","$dfc006ada1995968$var$getAxisFromDataset","$dfc006ada1995968$var$initOptions","$dfc006ada1995968$var$mergeScaleConfig","chartDefaults","configScales","chartIndexAxis","scaleConf","$dfc006ada1995968$var$retrieveAxisFromDatasets","boundDs","defaultId","defaultScaleOptions","defaultID","$dfc006ada1995968$var$initData","$dfc006ada1995968$var$keyCache","$dfc006ada1995968$var$keysCached","$dfc006ada1995968$var$cachedKeys","generate","$dfc006ada1995968$var$addIfFound","$dfc006ada1995968$var$Config","_config","clearCache","_scopeCache","clear","_resolverCache","datasetType","additionalOptionScopes","_cachedScopes","mainScope","resetCache","keyLists","chartOptionScopes","subPrefixes","$dfc006ada1995968$var$getResolver","$dfc006ada1995968$var$needContext","$dfc006ada1995968$var$hasFunction","subResolver","resolverCache","$dfc006ada1995968$var$KNOWN_POSITIONS","$dfc006ada1995968$var$positionIsHorizontal","$dfc006ada1995968$var$compare2Level","l1","l2","$dfc006ada1995968$var$onAnimationsComplete","onComplete","$dfc006ada1995968$var$onAnimationProgress","onProgress","$dfc006ada1995968$var$getCanvas","getElementById","$dfc006ada1995968$var$instances","$dfc006ada1995968$var$getChart","$dfc006ada1995968$var$getSizeForArea","field","$dfc006ada1995968$export$acaa6426d77a227e","$dfc006ada1995968$var$invalidatePlugins","_aspectRatio","_options","_initialize","bindEvents","_resizeBeforeDraw","_resize","newSize","newRatio","onResize","attached","_doResize","render","ensureScalesHaveIDs","scalesOptions","axisOptions","buildOrUpdateScales","scaleOpts","updated","isRadial","dposition","dtype","scaleType","scaleClass","hasUpdated","_updateMetasets","_metasets","_destroyDatasetMeta","_sortedMetasets","_removeUnreferencedMetasets","buildOrUpdateControllers","newControllers","order","ControllerClass","_resetElements","animsDisabled","_updateScales","_checkEventBindings","_updateHiddenIndices","_plugins","_minPadding","_updateLayout","_updateDatasets","_lastEvent","_eventHandler","_updateHoverStyles","existingEvents","_listeners","newEvents","_responsiveListeners","unbindEvents","_hiddenIndices","changes","_getUniformDataChanges","$dfc006ada1995968$var$moveNumericKeys","intKey","datasetCount","makeSet","changeSet","noArea","_idx","_updateDataset","layers","_drawDatasets","_drawDataset","useClip","$dfc006ada1995968$var$getDatasetArea","getElementsAtEventForMode","setDatasetVisibility","_updateVisibility","_stop","destroy","toBase64Image","toDataURL","bindUserEvents","bindResponsiveEvents","_add","detached","_remove","updateHoverStyle","getActiveElements","setActiveElements","activeElements","lastActive","pluginId","replay","hoverOptions","deactivated","activated","inChartArea","eventFilter","_handleEvent","lastEvent","_getActiveElements","isClick","userConfig","initialCanvas","existingChart","OffscreenCanvas","resizeDelay","instances","$dfc006ada1995968$var$rThetaToXY","theta","$dfc006ada1995968$var$pathArc","pixelMargin","innerR","spacingOffset","noSpacingOuterRadius","avNogSpacingRadius","noSpacingInnerRadius","beta","angleOffset","outerStart","outerEnd","innerStart","innerEnd","$dfc006ada1995968$var$parseBorderRadius$1","angleDelta","borderRadius","halfThickness","innerLimit","computeOuterLimit","outerArcLimit","outerStartAdjustedRadius","outerEndAdjustedRadius","outerStartAdjustedAngle","outerEndAdjustedAngle","innerStartAdjustedRadius","innerEndAdjustedRadius","innerStartAdjustedAngle","innerEndAdjustedAngle","outerMidAdjustedAngle","pCenter","p4","innerMidAdjustedAngle","p8","outerStartX","outerStartY","outerEndX","outerEndY","$dfc006ada1995968$export$d48203c759d6a1fc","chartX","chartY","rAdjust","betweenAngles","withinRadius","halfAngle","halfRadius","fullCircles","fix","radiusOffset","$dfc006ada1995968$var$drawArc","$dfc006ada1995968$var$drawBorder","inner","lineJoin","$dfc006ada1995968$var$clipArc","angleMargin","$dfc006ada1995968$var$setStyle","lineCap","$dfc006ada1995968$var$lineTo","$dfc006ada1995968$var$pathVars","paramsStart","paramsEnd","segmentStart","segmentEnd","$dfc006ada1995968$var$pathSegment","lineMethod","stepped","tension","cubicInterpolationMode","$dfc006ada1995968$var$fastPathSegment","prevX","lastY","avgX","countX","pointIndex","drawX","truncX","$dfc006ada1995968$var$_getSegmentMethod","useFastPath","$dfc006ada1995968$var$usePath2D","Path2D","$dfc006ada1995968$export$55e463fa7bcd3469","_pointsUpdated","controlPoints","$c4d1694fa24f1a71$export$527e9aa3390079e9","pointBefore","pointCurrent","valueAxis","pointsLen","deltaK","mK","pointAfter","slopeDelta","$c4d1694fa24f1a71$var$monotoneAdjust","alphaK","betaK","tauK","squaredMagnitude","$c4d1694fa24f1a71$var$monotoneCompute","$c4d1694fa24f1a71$export$e171bab687b50e0","middlePoint","afterPoint","d01","d12","s01","s12","fa","fb","capBezierPoints","$c4d1694fa24f1a71$var$capBezierPoints","inArea","inAreaPrev","inAreaNext","_points","_segments","_path","$c4d1694fa24f1a71$var$findStartAndEnd","completeLoop","$c4d1694fa24f1a71$var$solidSegments","_interpolate","interpolated","pathSegment","segmentMethod","path","$dfc006ada1995968$var$draw","$dfc006ada1995968$var$strokePathWithCache","$dfc006ada1995968$var$strokePathDirect","$dfc006ada1995968$var$inRange$1","hitRadius","$dfc006ada1995968$export$bd159b522b230b7a","mouseX","mouseY","inXRange","inYRange","hoverRadius","$dfc006ada1995968$var$getBarBounds","bar","half","$dfc006ada1995968$var$skipOrLimit","$dfc006ada1995968$var$inRange","skipX","skipY","$dfc006ada1995968$var$addNormalRectPath","$dfc006ada1995968$var$inflateRect","amount","refRect","$dfc006ada1995968$export$a16ed71bf4b07672","outer","$dfc006ada1995968$var$boundingRects","$dfc006ada1995968$var$parseBorderWidth","maxW","maxH","$dfc006ada1995968$var$parseBorderRadius","maxR","enableBorder","addRectPath","$dfc006ada1995968$var$hasRadius","$dfc006ada1995968$export$7a5d735b2ab6389d","ArcElement","BarElement","LineElement","PointElement","$dfc006ada1995968$var$BORDER_COLORS","$dfc006ada1995968$var$BACKGROUND_COLORS","$dfc006ada1995968$var$getBorderColor","$dfc006ada1995968$var$getBackgroundColor","$dfc006ada1995968$var$containsColorsDefinitions","$dfc006ada1995968$var$cleanDecimatedDataset","$dfc006ada1995968$var$cleanDecimatedData","$dfc006ada1995968$var$_getBounds","$dfc006ada1995968$var$_findSegmentEnd","$dfc006ada1995968$var$_getEdge","$dfc006ada1995968$var$_createBoundaryLine","boundary","$dfc006ada1995968$var$_pointsFromSegments","linePoints","$dfc006ada1995968$var$_shouldApplyFill","$dfc006ada1995968$var$simpleArc","$dfc006ada1995968$var$_drawfill","$dfc006ada1995968$var$_getTarget","$dfc006ada1995968$var$getLineByIndex","$dfc006ada1995968$var$_buildStackLine","sourcePoints","linesBelow","$dfc006ada1995968$var$getLinesBelow","below","unshift","$dfc006ada1995968$var$addPointsBelow","sourcePoint","postponed","$dfc006ada1995968$var$findPoint","pointValue","firstValue","lastValue","$dfc006ada1995968$var$computeBoundary","$dfc006ada1995968$var$computeCircularBoundary","$dfc006ada1995968$var$computeLinearBoundary","lineOpts","fillOption","above","$dfc006ada1995968$var$doFill","$dfc006ada1995968$var$clipVertical","$dfc006ada1995968$var$fill","clipY","lineLoop","$dfc006ada1995968$var$_segments","tpoints","targetSegments","tgt","subBounds","fillSources","fillSource","src","notShape","$dfc006ada1995968$var$clipBounds","$dfc006ada1995968$var$interpolatedLineTo","targetLoop","interpolatedPoint","$dfc006ada1995968$var$getBoxSize","labelOpts","boxHeight","boxWidth","usePointStyle","pointStyleWidth","itemHeight","$dfc006ada1995968$var$itemsEqual","$dfc006ada1995968$var$Legend","buildLabels","legendItems","labelFont","_computeTitleHeight","_fitRows","_fitCols","hitboxes","legendHitBoxes","lineWidths","totalHeight","row","_itemHeight","columnSizes","heightLimit","totalWidth","currentColWidth","currentColHeight","col","$dfc006ada1995968$var$calculateItemSize","fontLineHeight","legendItemText","$dfc006ada1995968$var$calculateLegendItemHeight","adjustHitBoxes","rtlHelper","hitbox","_draw","cursor","defaultColor","halfFontSize","drawLegendBox","lineDash","drawOptions","SQRT2","yBoxTop","xBoxLeft","textDirection","realX","titleFont","titlePadding","topPaddingPlusHalfFontSize","_getLegendItemAt","hitBox","lh","handleEvent","onLeave","hoveredItem","_hoveredItem","sameItem","_added","doughnutMode","$dfc006ada1995968$var$Title","_padding","textSize","_drawArgs","fontOpts","$dfc006ada1995968$var$map","$dfc006ada1995968$var$positioners","average","eventPosition","nearestElement","tp","$dfc006ada1995968$var$pushOrConcat","toPush","$dfc006ada1995968$var$splitNewlines","$dfc006ada1995968$var$getTooltipSize","tooltip","body","footer","bodyFont","footerFont","titleLineCount","footerLineCount","bodyLineItemCount","combinedBodyLength","bodyItem","before","after","beforeBody","afterBody","titleSpacing","titleMarginBottom","bodyLineHeight","displayColors","bodySpacing","footerMarginTop","footerSpacing","widthPadding","maxLineWidth","$dfc006ada1995968$var$determineAlignment","yAlign","$dfc006ada1995968$var$determineYAlign","xAlign","$dfc006ada1995968$var$determineXAlign","chartWidth","$dfc006ada1995968$var$doesNotFitWithAlign","caret","caretSize","caretPadding","$dfc006ada1995968$var$getBackgroundPoint","alignment","paddingAndSize","$dfc006ada1995968$var$alignX","$dfc006ada1995968$var$alignY","$dfc006ada1995968$var$getAlignedX","$dfc006ada1995968$var$overrideCallbacks","$dfc006ada1995968$var$defaultCallbacks","beforeTitle","tooltipItems","labelCount","afterTitle","beforeLabel","tooltipItem","formattedValue","labelColor","labelTextColor","bodyColor","labelPointStyle","afterLabel","beforeFooter","afterFooter","$dfc006ada1995968$var$invokeCallbackWithFallback","$dfc006ada1995968$var$Tooltip","_cachedAnimations","_tooltipItems","getTitle","getBeforeBody","getBody","bodyItems","scoped","getAfterBody","getFooter","_createItems","labelColors","labelPointStyles","labelTextColors","$dfc006ada1995968$var$createTooltipItem","itemSort","dataPoints","_eventPosition","_size","positionAndSize","backgroundPoint","opacity","caretX","caretY","external","drawCaret","tooltipPoint","caretPosition","getCaretPosition","x3","y3","ptX","ptY","titleAlign","titleColor","_drawColorBox","colorX","rtlColorX","yOffSet","colorY","multiKeyBackground","outerX","innerX","strokeRect","drawBody","textColor","bodyAlign","xLinePadding","fillLineOfText","bodyAlignForCalculation","drawFooter","footerAlign","footerColor","tooltipSize","quadraticCurveTo","_updateAnimationTarget","animX","animY","_willRender","hasTooltipContent","globalAlpha","positionChanged","_positionChanged","_ignoreReplayEvents","$dfc006ada1995968$export$8b3ca321c77fdea6","Colors","forceOverride","_args","chartOptions","colorizer","Decimation","algorithm","beforeElementsUpdate","decimated","xAxis","$dfc006ada1995968$var$getStartAndCountOfVisiblePointsSimplified","threshold","$dfc006ada1995968$var$lttbDecimation","maxAreaPoint","maxArea","nextA","samples","bucketWidth","sampledIndex","endIndex","avgY","avgRangeStart","avgRangeEnd","avgRangeLength","rangeOffs","rangeTo","pointAx","pointAy","$dfc006ada1995968$var$minMaxDecimation","minIndex","maxIndex","startIndex","xMin","xMax","dx","lastIndex","intermediateIndex1","intermediateIndex2","Filler","afterDatasetsUpdate","$dfc006ada1995968$var$_decodeFill","firstCh","$dfc006ada1995968$var$parseFillOption","$filler","$dfc006ada1995968$var$_resolveTarget","propagate","visited","beforeDraw","drawTime","beforeDatasetsDraw","beforeDatasetDraw","Legend","_element","afterEvent","ci","useBorderRadius","SubTitle","Title","$dfc006ada1995968$var$createTitle","titleBlock","Tooltip","positioners","afterInit","afterDraw","$dfc006ada1995968$var$addIfString","addedLabels","$dfc006ada1995968$var$validIndex","$dfc006ada1995968$var$_getLabelForValue","$dfc006ada1995968$export$29e663ba4d09fe7","added","_addedLabels","$dfc006ada1995968$var$findOrAddLabel","lastIndexOf","_valueRange","_startValue","$dfc006ada1995968$var$relativeLabelSize","minSpacing","$dfc006ada1995968$var$LinearScaleBase","handleTickRangeOptions","setMin","setMax","minSign","maxSign","getTickLimit","maxTicks","stepSize","computeTickLimit","numericGeneratorOptions","precision","maxDigits","includeBounds","dataRange","$dfc006ada1995968$var$generateTicks$1","generationOptions","niceMin","niceMax","numSpaces","unit","maxSpaces","rmin","rmax","countDefined","rounded","decimalPlaces","_endValue","$dfc006ada1995968$export$e7f4e5e8656f0b93","$dfc006ada1995968$var$log10Floor","$dfc006ada1995968$var$changeExponent","$dfc006ada1995968$var$isMajor","tickVal","$dfc006ada1995968$var$steps","rangeExp","rangeStep","$dfc006ada1995968$export$85295eaf7cb3ac3e","_zero","$dfc006ada1995968$var$generateTicks","minExp","exp","$dfc006ada1995968$var$startExp","lastTick","$dfc006ada1995968$var$getTickBackdropHeight","$dfc006ada1995968$var$determineLimits","$dfc006ada1995968$var$pathRadiusLine","getPointPosition","$dfc006ada1995968$export$cfafc36d95386d38","drawingArea","_pointLabels","$dfc006ada1995968$var$fitWithPointLabels","limits","valueCount","pointLabelOpts","additionalAngle","centerPointLabels","getPointLabelContext","plFont","arrayOfThings","nestedThing","garbageCollect","hLimits","vLimits","$dfc006ada1995968$var$updateLimits","setCenterPoint","_pointLabelItems","$dfc006ada1995968$var$buildPointLabelItems","itemOpts","extra","$dfc006ada1995968$var$createPointLabelItem","outerDistance","pointLabelPosition","$dfc006ada1995968$var$isNotOverlapped","apexesInArea","leftMovement","rightMovement","topMovement","bottomMovement","angleMultiplier","scalingFactor","getValueForDistanceFromCenter","scaledDistance","pointLabel","distanceFromCenter","getBasePosition","getPointLabelPosition","$dfc006ada1995968$var$drawPointLabels","$dfc006ada1995968$var$drawPointLabelBox","backdropLeft","backdropTop","backdropWidth","backdropHeight","$dfc006ada1995968$var$drawRadiusLine","gridLineOpts","animate","$dfc006ada1995968$var$INTERVALS","millisecond","common","steps","second","minute","hour","day","week","month","quarter","year","$dfc006ada1995968$var$UNITS","$dfc006ada1995968$var$sorter","$dfc006ada1995968$var$parse","adapter","_adapter","parser","isoWeekday","_parseOpts","$dfc006ada1995968$var$determineUnitForAutoTicks","minUnit","capacity","interval","MAX_SAFE_INTEGER","$dfc006ada1995968$var$addTick","timestamps","timestamp","$dfc006ada1995968$var$ticksFromTimestamps","majorUnit","$dfc006ada1995968$var$setMajorTicks","$dfc006ada1995968$export$a894c72689ff3ec","adapters","displayFormats","_normalized","normalized","_applyBounds","_getLabelBounds","getLabelTimestamps","timeOpts","_generate","_unit","_getLabelCapacity","$dfc006ada1995968$var$determineUnitForFormatting","_majorUnit","$dfc006ada1995968$var$determineMajorUnit","initOffsets","offsetAfterAutoskip","getDecimalForValue","_offsets","weekday","hasWeekday","getDataTimestamps","tooltipFormat","datetime","fmt","_tickFormatFunction","minorFormat","majorFormat","offsets","_getLabelSize","ticksOpts","tickLabelWidth","cosRotation","sinRotation","tickFontSize","exampleTime","exampleLabel","$dfc006ada1995968$var$interpolate","prevSource","nextSource","prevTarget","nextTarget","span","$dfc006ada1995968$export$85df64a8eb6dc986","_getTimestampsForTable","_table","buildLookupTable","_minPos","_tableRange","$dfc006ada1995968$export$bcac1c16f1530ec2","CategoryScale","LinearScale","LogarithmicScale","RadialLinearScale","TimeScale","TimeSeriesScale","$c8f95463ff5f043e$var$ownKeys","enumerableOnly","symbols","$c8f95463ff5f043e$var$_objectSpread2","$c8f95463ff5f043e$var$_typeof","$c8f95463ff5f043e$var$_extends","$c8f95463ff5f043e$var$userAgent","pattern","navigator","userAgent","$c8f95463ff5f043e$var$IE11OrLess","$c8f95463ff5f043e$var$Edge","$c8f95463ff5f043e$var$FireFox","$c8f95463ff5f043e$var$Safari","$c8f95463ff5f043e$var$IOS","$c8f95463ff5f043e$var$ChromeForAndroid","$c8f95463ff5f043e$var$captureMode","capture","$c8f95463ff5f043e$var$on","$c8f95463ff5f043e$var$off","$c8f95463ff5f043e$var$matches","selector","msMatchesSelector","webkitMatchesSelector","$c8f95463ff5f043e$var$closest","includeCTX","nodeType","$c8f95463ff5f043e$var$R_SPACE","$c8f95463ff5f043e$var$toggleClass","state","classList","className","$c8f95463ff5f043e$var$css","currentStyle","$c8f95463ff5f043e$var$matrix","selfOnly","appliedTransforms","transform","matrixFn","DOMMatrix","WebKitCSSMatrix","CSSMatrix","MSCSSMatrix","$c8f95463ff5f043e$var$find","tagName","getElementsByTagName","$c8f95463ff5f043e$var$getWindowScrollingElement","scrollingElement","documentElement","$c8f95463ff5f043e$var$getRect","relativeToContainingBlock","relativeToNonStaticParent","undoScale","elRect","innerHeight","innerWidth","containerRect","elMatrix","scaleX","scaleY","$c8f95463ff5f043e$var$getContentRect","$c8f95463ff5f043e$var$isScrolledPast","elSide","parentSide","$c8f95463ff5f043e$var$getParentAutoScrollElement","elSideVal","parentSideVal","$c8f95463ff5f043e$var$getChild","childNum","includeDragEl","currentChild","children","$c8f95463ff5f043e$export$31b3ca70d8f57423","ghost","dragged","draggable","$c8f95463ff5f043e$var$lastChild","lastElementChild","previousElementSibling","$c8f95463ff5f043e$var$index","nodeName","$c8f95463ff5f043e$var$getRelativeScrollOffset","offsetTop","winScroller","scrollLeft","scrollTop","includeSelf","elem","gotSelf","scrollWidth","scrollHeight","elemCSS","overflowX","overflowY","$c8f95463ff5f043e$var$isRectEqual","rect1","rect2","$c8f95463ff5f043e$var$throttle","ms","$c8f95463ff5f043e$var$_throttleTimeout","$c8f95463ff5f043e$var$scrollBy","$c8f95463ff5f043e$var$clone","Polymer","$","jQuery","Zepto","dom","cloneNode","$c8f95463ff5f043e$var$expando","$c8f95463ff5f043e$var$plugins","$c8f95463ff5f043e$var$defaults","initializeByDefault","$c8f95463ff5f043e$var$PluginManager","mount","pluginName","pluginEvent","eventName","sortable","evt","eventCanceled","eventNameGlobal","initializePlugins","initialized","modified","modifyOption","getEventProperties","eventProperties","modifiedValue","optionListeners","$c8f95463ff5f043e$var$_excluded","$c8f95463ff5f043e$var$pluginEvent","_ref","originalEvent","$c8f95463ff5f043e$var$_objectWithoutProperties","excluded","$c8f95463ff5f043e$var$_objectWithoutPropertiesLoose","sourceKeys","sourceSymbolKeys","dragEl","$c8f95463ff5f043e$var$dragEl","parentEl","$c8f95463ff5f043e$var$parentEl","ghostEl","$c8f95463ff5f043e$var$ghostEl","rootEl","$c8f95463ff5f043e$var$rootEl","nextEl","$c8f95463ff5f043e$var$nextEl","lastDownEl","$c8f95463ff5f043e$var$lastDownEl","cloneEl","$c8f95463ff5f043e$var$cloneEl","cloneHidden","$c8f95463ff5f043e$var$cloneHidden","dragStarted","$c8f95463ff5f043e$var$moved","putSortable","$c8f95463ff5f043e$var$putSortable","activeSortable","oldIndex","$c8f95463ff5f043e$var$oldIndex","oldDraggableIndex","$c8f95463ff5f043e$var$oldDraggableIndex","newIndex","$c8f95463ff5f043e$var$newIndex","newDraggableIndex","$c8f95463ff5f043e$var$newDraggableIndex","hideGhostForTarget","$c8f95463ff5f043e$var$_hideGhostForTarget","unhideGhostForTarget","$c8f95463ff5f043e$var$_unhideGhostForTarget","cloneNowHidden","cloneNowShown","dispatchSortableEvent","$c8f95463ff5f043e$var$_dispatchEvent","$c8f95463ff5f043e$var$dispatchEvent","targetEl","toEl","fromEl","extraEventProperties","onName","CustomEvent","createEvent","initEvent","bubbles","pullMode","lastPutMode","allEventProperties","dispatchEvent","$c8f95463ff5f043e$var$activeGroup","$c8f95463ff5f043e$var$tapEvt","$c8f95463ff5f043e$var$touchEvt","$c8f95463ff5f043e$var$lastDx","$c8f95463ff5f043e$var$lastDy","$c8f95463ff5f043e$var$tapDistanceLeft","$c8f95463ff5f043e$var$tapDistanceTop","$c8f95463ff5f043e$var$lastTarget","$c8f95463ff5f043e$var$lastDirection","$c8f95463ff5f043e$var$targetMoveDistance","$c8f95463ff5f043e$var$ghostRelativeParent","$c8f95463ff5f043e$var$awaitingDragStarted","$c8f95463ff5f043e$var$ignoreNextClick","$c8f95463ff5f043e$var$sortables","$c8f95463ff5f043e$var$pastFirstInvertThresh","$c8f95463ff5f043e$var$isCircumstantialInvert","$c8f95463ff5f043e$var$ghostRelativeParentInitialScroll","$c8f95463ff5f043e$var$_silent","$c8f95463ff5f043e$var$savedInputChecked","$c8f95463ff5f043e$var$documentExists","$c8f95463ff5f043e$var$CSSFloatProperty","$c8f95463ff5f043e$var$supportDraggable","createElement","$c8f95463ff5f043e$var$supportCssPointerEvents","cssText","pointerEvents","$c8f95463ff5f043e$var$_detectDirection","elCSS","elWidth","borderLeftWidth","borderRightWidth","child1","child2","firstChildCSS","secondChildCSS","firstChildWidth","marginLeft","marginRight","secondChildWidth","flexDirection","gridTemplateColumns","touchingSideChild2","$c8f95463ff5f043e$var$_dragElInRowColumn","dragRect","targetRect","dragElS1Opp","dragElS2Opp","dragElOppLength","targetS1Opp","targetS2Opp","targetOppLength","$c8f95463ff5f043e$var$_detectNearestEmptySortable","emptyInsertThreshold","insideHorizontally","insideVertically","$c8f95463ff5f043e$var$_prepareGroup","toFn","pull","sameGroup","group","otherGroup","originalGroup","checkPull","checkPut","put","revertClone","preventDefault","stopPropagation","stopImmediatePropagation","$c8f95463ff5f043e$var$nearestEmptyInsertDetectEvent","_onDragOver","$c8f95463ff5f043e$var$_checkOutsideTargetEl","_isOutsideThisEl","animationCallbackId","animationStates","store","handle","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","ghostClass","chosenClass","dragClass","ignore","preventOnFilter","setData","dataTransfer","textContent","dropBubble","dragoverBubble","dataIdAttr","delayOnTouchOnly","touchStartThreshold","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","nativeDraggable","_onTapStart","captureAnimationState","child","fromRect","thisAnimationDuration","childMatrix","addAnimationState","removeAnimationState","$c8f95463ff5f043e$var$indexOfObject","animateAll","animating","animationTime","toRect","prevFromRect","prevToRect","animatingRect","targetMatrix","animationResetTimer","currentRect","translateX","translateY","animatingX","animatingY","forRepaintDummy","offsetWidth","$c8f95463ff5f043e$var$_onMove","willInsertAfter","retVal","onMoveFn","onMove","draggedRect","related","relatedRect","$c8f95463ff5f043e$var$_disableDraggable","$c8f95463ff5f043e$var$_unsilent","$c8f95463ff5f043e$var$_nextTick","$c8f95463ff5f043e$var$_cancelNextTick","_getDirection","touch","pointerType","originalTarget","composedPath","$c8f95463ff5f043e$var$_saveInputCheckedState","checked","button","isContentEditable","criteria","trim","_prepareDragStart","dragStartFn","nextSibling","_lastX","_lastY","_onDrop","_disableDelayedDragEvents","_triggerDragStart","_disableDelayedDrag","_delayedDragTouchMoveHandler","_dragStartTimer","_onTouchMove","_onDragStart","selection","empty","getSelection","removeAllRanges","_dragStarted","_appendGhost","_nulling","_emulateDragOver","elementFromPoint","inserted","ghostMatrix","relativeScrollOffset","$c8f95463ff5f043e$var$PositionGhostAbsolutely","dy","cssMatrix","appendChild","_hideClone","cloneId","insertBefore","_loopId","setInterval","effectAllowed","_dragStartId","revert","isOwner","canSort","fromSortable","completedFired","dragOverEvent","_ignoreWhileAnimating","completed","elLastChild","$c8f95463ff5f043e$var$_ghostIsLast","lastElRect","sortableContentRect","firstElRect","firstChild","sibling","targetBeforeFirstSwap","differentLevel","differentRowCol","side1","scrolledPastTop","scrollBefore","$c8f95463ff5f043e$var$_getSwapDirection","isLastTarget","mouseOnAxis","targetLength","targetS1","targetS2","invert","dragIndex","nextElementSibling","moveVector","insertion","_showClone","_offMoveEvents","_offUpEvents","clearInterval","removeChild","dropEffect","toArray","$c8f95463ff5f043e$var$_generateId","href","sum","useAnimation","closest","querySelectorAll","utils","css","find","extend","dst","throttle","toggleClass","cancelNextTick","detectDirection","getChild","$c8f95463ff5f043e$var$scrollEl","$c8f95463ff5f043e$var$scrollRootEl","$c8f95463ff5f043e$var$lastAutoScrollX","$c8f95463ff5f043e$var$lastAutoScrollY","$c8f95463ff5f043e$var$touchEvt$1","$c8f95463ff5f043e$var$pointerElemChangedInterval","$c8f95463ff5f043e$var$autoScrolls","$c8f95463ff5f043e$var$scrolling","$c8f95463ff5f043e$var$clearAutoScrolls","autoScroll","$c8f95463ff5f043e$var$clearPointerElemChangedInterval","$c8f95463ff5f043e$var$autoScroll","isFallback","scroll","scrollCustomFn","sens","scrollSensitivity","speed","scrollSpeed","scrollThisInstance","scrollFn","layersOut","currentParent","canScrollX","canScrollY","scrollPosX","scrollPosY","vx","vy","layer","scrollOffsetY","scrollOffsetX","bubbleScroll","$c8f95463ff5f043e$var$drop","toSortable","changedTouches","onSpill","$c8f95463ff5f043e$var$Revert","$c8f95463ff5f043e$var$Remove","$918fc77ea978604c$export$1402cba6a733f33a","$a5e7d2d106c3fea1$export$926181dbdeb3ce30","derivatives","dydx","yTemp","h2","h6","xhh","dydxTemp","dydxM","$12561087c4c3e6ef$export$35d34bc0ed591a92","stocksAtT","getFlows","integrator","dragStart","_ref2","_ref3","drop","_ref4","parentSortable","AutoScroll","forceAutoScrollFallback","_handleAutoScroll","_handleFallbackAutoScroll","dragOverCompleted","dragOverBubble","nulling","ogElemScroller","newElem","$ca4792769be6b7d6$export$a1edc412be3e1841","elementObjectToArray","ids","arrayToElementObject","stocksToStockArray","stocks","stockIds","stockArrayToStocks","stockArray","flowsToFlowArray","flows","flowIds","flowArrayToFlows","flowArray","variablesToVariableArray","variables","variableIds","variableArrayToVariables","variableArray","parametersToParameterArray","parameters","parameterIds","parameterArrayToParameters","parameterArray","evaluateFlowPerStock","evaluate","accumulateFlowsPerStock","createFlowEvaluator","stocksArray","flowsPerStock","flowPerStockArray","flowEvaluator","computeFlowsOrIntegrator","newStocksArray","$77c357198c6cf64b$var$step6","flowsAtT","computeFlows","mutableFlowsAtT","stocksIds","elementIds","$995a1f169f5e286f$var$stockIds","$995a1f169f5e286f$var$flowIds","$995a1f169f5e286f$var$variableIds","$995a1f169f5e286f$var$parameterIds","$995a1f169f5e286f$var$CircularEconomyModel","capacityOfNewlyProducedPhones","capacityOfRecycledMaterials","capacityOfRefurbishedPhones","capacityOfRepairedPhones","phonesInUse","supplyOfBrokenPhones","supplyOfDisposedPhones","supplyOfHibernatingPhones","supplyOfNewlyProducedPhones","supplyOfRecycledMaterials","supplyOfRefurbishedPhones","supplyOfRepairedPhones","abandonExcessRate","abandonRate","acquireRate","breakRate","capacityAdjustmentRate","disposeIncentive","disposeRate","landfillIncentive","landfillRate","naturalResourcesIncentive","newPhoneProductionRate","newlyProducedPhoneIncentive","numberOfUsers","phonesPerUserGoal","recycleRate","recyclingIncentive","refurbishmentIncentive","refurbishmentRate","repairIncentive","repairRate","reuseIncentive","phoneGoal","phonesInUseExcess","abandon","inflowIncentiveSumForPhonesInUse","goBroken","demandForPhones","demandForNewlyProducedPhones","acquireNewlyProduced","demandForRefurbishedPhones","acquireRefurbished","demandForRepairedPhones","acquireRepaired","supplyOfHibernatingPhonesForReuse","demandForReusedPhones","demandForResources","demandForRecycledMaterials","supplyOfBrokenPhonesForDisposal","supplyOfHibernatingPhonesForDisposal","supplyOfDisposedPhonesForLandfilling","demandForNaturalResources","produceFromRecycledMaterials","supplyOfDisposedPhonesForRecycling","demandForRecycling","supplyOfHibernatingPhonesForRefurbishment","demandForRefurbishment","demandForRepair","supplyOfBrokenPhonesForRepair","acquireUsed","capacityOfNewlyProducedPhonesAdjustment","capacityOfRecycledMaterialsAdjustment","capacityOfRefurbishedPhonesAdjustment","disposeBroken","disposeHibernating","landfill","produceFromNaturalResources","recycle","refurbish","repair","repairShopCapcityAdjustment","initialStocks","defaultParameters","$2495d722a6806b18$export$2e2bcd8739ae039","evaluateFlowPerStockWithCache","flowPerStockCache","record","newStocks","model","flowEvaluatorWithCache","newRecord","$c87ac678829b8e5f$exports","$1b7ff3cd61804da8$exports","iteratee","accumulator","initAccum","$1f2a8327a9c6cd40$exports","$22d081411f8ece61$exports","$cbf1cd6f0a53572d$exports","$ee44123cee6ab817$exports","$e5d1c83d06342727$exports","$8ae6ebea7b194487$exports","$5c41b9a5519f3a64$exports","$d6b32571b971a536$var$freeSelf","$d6b32571b971a536$exports","$19ec4e0dcd973343$exports","$80ba2d19709662a3$exports","$f2239ecfa31470ab$exports","$a72fb30b329d5697$exports","$cc11b91eeb6cba09$exports","$cc11b91eeb6cba09$var$objectProto","$cc11b91eeb6cba09$var$hasOwnProperty","$cc11b91eeb6cba09$var$nativeObjectToString","$cc11b91eeb6cba09$var$symToStringTag","unmasked","$34878bff9c6a1b5d$exports","$34878bff9c6a1b5d$var$nativeObjectToString","$34878bff9c6a1b5d$var$objectProto","$a72fb30b329d5697$var$symToStringTag","$12765be2afa50e71$exports","$e5d1c83d06342727$var$INFINITY","$e5d1c83d06342727$var$symbolProto","$e5d1c83d06342727$var$symbolToString","$e5d1c83d06342727$var$baseToString","$1f2a8327a9c6cd40$var$reLatin","$1f2a8327a9c6cd40$var$reComboMark","$31925c2e0b1bffc8$exports","$9589882a1b02d2bd$exports","$9589882a1b02d2bd$var$reAsciiWord","$5f3800a21019ebc5$exports","$5f3800a21019ebc5$var$reHasUnicodeWord","$59413fe1d37c7fe4$exports","$59413fe1d37c7fe4$var$rsAstralRange","$59413fe1d37c7fe4$var$rsDingbatRange","$59413fe1d37c7fe4$var$rsLowerRange","$59413fe1d37c7fe4$var$rsUpperRange","$59413fe1d37c7fe4$var$rsBreakRange","$59413fe1d37c7fe4$var$rsMathOpRange","$59413fe1d37c7fe4$var$rsApos","$59413fe1d37c7fe4$var$rsBreak","$59413fe1d37c7fe4$var$rsLower","$59413fe1d37c7fe4$var$rsMisc","$59413fe1d37c7fe4$var$rsRegional","$59413fe1d37c7fe4$var$rsSurrPair","$59413fe1d37c7fe4$var$rsUpper","$59413fe1d37c7fe4$var$rsMiscLower","$59413fe1d37c7fe4$var$rsOptContrLower","$59413fe1d37c7fe4$var$rsOptContrUpper","$59413fe1d37c7fe4$var$reOptMod","$59413fe1d37c7fe4$var$rsModifier","$59413fe1d37c7fe4$var$rsOptVar","$59413fe1d37c7fe4$var$rsOptJoin","$59413fe1d37c7fe4$var$rsEmoji","$59413fe1d37c7fe4$var$reUnicodeWord","$59413fe1d37c7fe4$var$rsMiscUpper","guard","$08c10a8642478998$var$reApos","$22519adc90afc1c6$export$b6a2e78b63791dfa","uri","clearStyles","_svgDoc_querySelectorAll","response","fetch","status","statusText","URL","svgText","div","innerHTML","svgDoc","querySelector","$853946bed0db7ade$export$99496351b147462","word","$eaf19eafa3312639$exports","getBundleURL","$fee6658e550852f2$var$svgUrl","$fee6658e550852f2$var$mainFlowIds","$fee6658e550852f2$var$flowVizSigns","$fee6658e550852f2$var$dotWithoutLineSegmentArea","$fee6658e550852f2$var$dotRadius","$fee6658e550852f2$var$averageFlowVizWidth","$fee6658e550852f2$var$lineSegmentArea","$fee6658e550852f2$var$lineWidth","$fee6658e550852f2$export$2e2bcd8739ae039","updateSvgFlows","deltaMs","flowVizScale","$fee6658e550852f2$var$quantityScaleFactor","_element_getAttribute","flow","flowVizSign","elementId","svg","SVGPathElement","lastDashOffset","updateSvgStocks","stockVizScale","SVGCircleElement","stock","updateSvg","prepareSvg","createSVGElement","createElementNS","elementsToRemove","labelLayer","supplyLayer","capacityLayer","flowLayer","append","baseElement","baseElementId","SVGGeometryElement","phonesInUseClone","$eeb33a528debb3be$export$3e2b244719956741","readyState","$279b597edf84dcbf$export$2e2bcd8739ae039","i18nKey","$0d00df7a0e9c1179$export$2e2bcd8739ae039","applyTo","callable","$c66a53d1ef21207e$export$2e2bcd8739ae039","createFunction","script","parameterId","wrappedScript","transformedParameters","$157dc5a8c12caacb$var$initialParameters","$157dc5a8c12caacb$var$init","modelSimulator","availableParameterTransformsContainer","HTMLElement","activeParameterTransformsContainer","availableParameterTransforms","updateParameters","parameterTransform","backupParameters","distinctParameters","getDistinctParameters","removeOnSpill","onSort","parameterTransforms","dummyElement","parameterTransformElement","idElement","HTMLInputElement","scriptElement","HTMLTextAreaElement","sliderContainer","sliderElementLabel","sliderElement","updateSliderValue","innerText","sliderWrapperElement","circularityIndex","circularityIndexElement","userSatisfaction","userSatisfactionElement","visualization","toChartRecord","prepend","initialChartRecord","chartCanvas","stepSimulation","updateIndices","circularityIndexTarget","toFixed","userSatisfactionTarget","chartRecord","runCheckBox","loopSimulation","lastTimeMs","currentTimeMs","circularEconomy","Animator","requestAnimFrame","interpolators","helpersColor","Animation","effects","Animations","resolveTargetOptions","awaitAll","animator","scaleClip","defaultClip","toClip","getSortedDatasetIndices","convertObjectDataToArray","isStacked","getStackKey","getOrCreateStack","getLastIndexInStack","updateStacks","getFirstScaleId","createDatasetContext","createContext","createDataContext","clearStacks","isDirectUpdateMode","cloneIfNotShared","createStack","DatasetController","valueOrDefault","unlistenArrayEvents","listenArrayEvents","resolveObjectKey","defined","getAllScaleValues","_arrayUnique","computeMinSampleSize","computeFitCategoryTraits","isNullOrUndef","computeFlexCategoryTraits","parseFloatBar","parseValue","parseArrayOrPrimitive","isFloatBar","barSign","borderProps","setBorderSkipped","parseEdge","swap","startEnd","v2","setInflateAmount","getRatioAndOffset","TAU","_angleBetween","HALF_PI","toRadians","toPercentage","maxRadius","toDimension","formatNumber","_getStartAndCountOfVisiblePoints","_scaleRangesChanged","_parseObjectDataRadialScale","abstract","DateAdapterBase","binarySearch","_rlookupByKey","_lookupByKey","evaluateInteractionItems","getDistanceMetricForAxis","getIntersectItems","evaluationFunc","_isPointInArea","getNearestRadialItems","getAngleFromPoint","getNearestCartesianItems","getNearestItems","getAxisItems","getRelativePosition","STATIC_POSITIONS","filterByPosition","filterDynamicPositionByAxis","sortByWeight","wrapBoxes","buildStacks","setLayoutDims","buildLayoutBoxes","getCombinedMax","updateMaxPadding","updateDims","handleMaxPadding","getMargins","marginForPositions","fitBoxes","setBoxDims","placeBoxes","toPadding","each","BasePlatform","BasicPlatform","EXPANDO_KEY","EVENT_TYPES","isNullOrEmpty","initCanvas","readUsedSize","eventListenerOptions","supportsEventListenerOptions","fromNativeEvent","nodeListContains","createAttachObserver","createDetachObserver","drpListeningCharts","oldDevicePixelRatio","onWindowResize","listenDevicePixelRatioChanges","unlistenDevicePixelRatioChanges","createResizeObserver","_getParentNode","throttled","releaseObserver","createProxyAndListen","DomPlatform","_detectPlatform","_isDomSupported","Element","determineMaxTicks","getMajorIndices","skipMajors","calculateSpacing","getEvenSpacing","_factorize","reverseAlign","offsetFromEdge","getTicksLimit","sample","getPixelForGridLine","getTickMarkLength","getTitleHeight","toFont","createScaleContext","createTickContext","_toLeftRightCenter","titleArgs","_alignStartEnd","Scale","finiteOrDefault","_addGrace","_limitValue","toDegrees","_measureText","_int16Range","_alignPixel","clipArea","renderText","unclipArea","TypedRegistry","isIChartComponent","registerDefaults","merge","routeDefaults","Registry","_capitalize","PluginService","callCallback","allPlugins","createDescriptors","getOpts","pluginOpts","getIndexAxis","getAxisFromDefaultScaleID","getDefaultScaleIDFromAxis","idMatchesAxis","axisFromPosition","determineAxis","getAxisFromDataset","retrieveAxisFromDatasets","mergeScaleConfig","mergeIf","initOptions","initData","initConfig","keyCache","keysCached","cachedKeys","addIfFound","Config","getResolver","needContext","_attachContext","_createResolver","hasFunction","KNOWN_POSITIONS","positionIsHorizontal","compare2Level","onAnimationsComplete","onAnimationProgress","getCanvas","getChart","moveNumericKeys","determineLastEvent","getSizeForArea","getDatasetArea","Chart","invalidatePlugins","uid","debounce","retinaScale","clearCanvas","setsEqual","Interaction","_elementsEqual","_isClickEvent","clipArc","toRadiusCorners","_readValueToProps","parseBorderRadius","rThetaToXY","pathArc","adjustedAngle","drawArc","_isBetween","setStyle","getLineMethod","_steppedLineTo","_bezierCurveTo","pathVars","outside","fastPathSegment","_getSegmentMethod","_getInterpolationMethod","_steppedInterpolation","_bezierInterpolation","_pointInLine","strokePathWithCache","strokePathDirect","usePath2D","_updateBezierControlPoints","_computeSegments","_boundSegments","drawPoint","getBarBounds","skipOrLimit","parseBorderWidth","toTRBL","toTRBLCorners","boundingRects","skipBoth","hasRadius","addNormalRectPath","inflateRect","addRoundedRectPath","BORDER_COLORS","BACKGROUND_COLORS","getBorderColor","getBackgroundColor","colorizeDefaultDataset","colorizeDoughnutDataset","colorizePolarAreaDataset","getColorizer","containsColorsDefinitions","containsColorsDefinition","lttbDecimation","minMaxDecimation","cleanDecimatedDataset","cleanDecimatedData","getStartAndCountOfVisiblePointsSimplified","_findSegmentEnd","_getBounds","_boundSegment","_getEdge","_normalizeAngle","_pointsFromSegments","_createBoundaryLine","_shouldApplyFill","_resolveTarget","_decodeFill","parseFillOption","decodeTargetIndex","_getTargetPixel","_getTargetValue","_buildStackLine","getLinesBelow","addPointsBelow","findPoint","simpleArc","getLineByIndex","computeBoundary","computeCircularBoundary","computeLinearBoundary","_drawfill","doFill","clipVertical","clipBounds","interpolatedLineTo","getBoxSize","itemsEqual","calculateItemSize","getRtlAdapter","drawPointLegend","overrideTextDirection","_textX","calculateLegendItemHeight","restoreTextDirection","isListened","calculateItemWidth","calculateItemHeight","createTitle","distanceBetweenPoints","pushOrConcat","splitNewlines","createTooltipItem","getTooltipSize","determineYAlign","doesNotFitWithAlign","determineXAlign","determineAlignment","alignX","alignY","getBackgroundPoint","getAlignedX","getBeforeAfterBodyLines","createTooltipContext","overrideCallbacks","defaultCallbacks","noop","invokeCallbackWithFallback","addIfString","findOrAddLabel","_getLabelForValue","generateTicks","MIN_SPACING","niceNum","almostWhole","almostEquals","_decimalPlaces","relativeLabelSize","LinearScaleBase","_setMinAndMaxByKey","Ticks","log10Floor","changeExponent","isMajor","startExp","getTickBackdropHeight","measureLabelSize","_longestText","determineLimits","fitWithPointLabels","updateLimits","buildPointLabelItems","createPointLabelItem","yForAngle","getTextAlignForAngle","leftForTextAlign","isNotOverlapped","drawPointLabelBox","drawPointLabels","pathRadiusLine","drawRadiusLine","createPointLabelContext","INTERVALS","UNITS","sorter","determineUnitForAutoTicks","determineUnitForFormatting","determineMajorUnit","addTick","_lookup","setMajorTicks","ticksFromTimestamps","_filterBetween","registerables","isNumberFinite","isValidKey","_merger","_mergerIf","_deprecated","keyResolvers","_splitKey","_getKeyResolver","PITAU","INFINITY","RAD_PER_DEG","QUARTER_PI","TWO_THIRDS_PI","isFiniteNumber","radialDistanceFromCenter","_angleDiff","arrayEvents","pixelSize","fontStyle","fontFamily","check","atEdge","elasticIn","elasticOut","isPatternOrGradient","Color","getHoverColor","applyAnimationsDefaults","applyLayoutsDefaults","intlCache","getNumberFormat","calculateDelta","applyScaleDefaults","getScope","Defaults","toFontString","setRenderOpts","decorateText","drawBackdrop","LINE_HEIGHT","FONT_STYLE","toLineHeight","numberOrZero","_resolve","_cached","_resolveWithPrefixes","getKeysFromAllScopes","_resolveWithContext","readKey","needsSubResolver","_resolveScriptable","_resolveArray","createSubResolver","resolveFallback","addScopes","addScopesFromKey","subGetTarget","resolveKeysFromAllScopes","getPoint","getValueAxis","splineCurve","monotoneAdjust","monotoneCompute","splineCurveMonotone","capControlPoint","parseMaxStyle","getPositionedStyle","useOffsetPos","getCanvasPosition","getContainerSize","round1","getRightToLeftAdapter","getLeftToRightAdapter","propertyFn","normalizeSegment","getSegment","findStartAndEnd","solidSegments","splitByStyles","doSplitByStyles","readStyle","styleChanged"],"version":3,"file":"index.97bcdae1.js.map"} \ No newline at end of file diff --git a/assets/index.a403ea04.js.map b/assets/index.a403ea04.js.map deleted file mode 100644 index a715aed..0000000 --- a/assets/index.a403ea04.js.map +++ /dev/null @@ -1 +0,0 @@ -{"mappings":"C,A,e2HuXI,EpBrWEC,E,I+BDoB,E,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,S,E,C,E,O,G,E,U,C,E,O,C,C,C,I,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,I,E,E,Q,C,E,Q,S,C,C,C,ErIjB1B,+CAA+C;AAC/C,iFAAiF;AAEjF,oDAAoD;AACpD,oDAAoD;AACpD,EAAE;AACF,+EAA+E;AAC/E,2EAA2E;AAC3E,6EAA6E;AAC7E,8EAA8E;AAC9E,6E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EO,KACL,CAAuC,CACvC,CAAS,CACT,CAAS,CACT,CAAkD,CAC3B,KC7HzB,ED8HE,IAAM,EAAoC,IAAI,CAAC,kBAAkB,CAAC,GAC5D,EC5HR,AAAI,AAAuB,UAAvB,OD8HA,ECtKG,AAAA,GDqKH,EACA,EACA,EACA,EC1HA,GAGG,AA9CT,SACE,CAAyC,CACzC,CAAwC,CACxC,CAAS,CACT,CAAS,CACT,CAA8B,CAC9B,CAA6B,EAE7B,IAAM,EAAmD,IAAI,EAAS,CAGtE,OAAO,AAAA,GAAY,EAAW,EAAG,EAFE,CAAC,EAAG,IACrC,IAAM,EAAI,EAAkB,EAAa,EAAG,GACA,EAChD,EDsJM,EACA,EACA,EACA,EClHF,EAhBF,KAAA,GDoIE,OAAO,IAAI,CAAC,kBAAkB,CAAC,EACjC,CAjIA,YACE,CAAY,CACZ,CAAU,CACV,CAAc,CACd,CAAe,CACf,CACA,IAAI,CAAC,QAAQ,CAAG,EAChB,IAAI,CAAC,OAAO,CAAG,EACf,IAAI,CAAC,WAAW,CAAG,EACnB,IAAI,CAAC,YAAY,CAAG,CACtB,CAwHF,CAvJe,GAMC,UAAA,CAAa,CACzB,SACA,aACA,YACA,QACD,CDvCH,IAAM,GAAW,CACf,gCACA,8BACA,8BACA,2BACA,cACA,uBACA,yBACA,4BACA,8BACA,4BACA,4BACA,yBACD,CAEK,GAAU,CACd,UACA,uBACA,qBACA,kBACA,cACA,0CACA,wCACA,wCACA,gBACA,qBACA,WACA,WACA,8BACA,+BACA,UACA,YACA,SACA,8BACD,CAEK,GAAc,CAClB,4BACA,+BACA,kBACA,6BACA,6BACA,yBACA,0BACA,wBACA,mCACA,YACA,oBACA,gBACA,eACA,iBACA,kCACA,gCACA,uCACA,qCACD,CAEK,GAAe,CACnB,oBACA,cACA,cACA,YACA,yBACA,mBACA,cACA,aACA,oBACA,eACA,4BACA,yBACA,8BACA,gBACA,oBACA,cACA,qBACA,yBACA,oBACA,kBACA,aACA,iBACD,AAwBD,O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,OAG5C,eAAe,IACb,EAAU,CAAA,EACV,IAAI,EAAyC,KAE7C,KAAO,EAAY,OAAO,EAAE,CAC1B,4CAA4C;AAC5C,IAAM,EAAgB,MAAM,AAAA,KACtB,EAAU,AAAe,OAAf,EAAsB,EAAI,EAAgB,EAC1D,EAAe,GACf,EAAa,CACf,CACA,EAAU,CAAA,CACZ,OAdA,AAAA,CAAA,EAAA,EAAA,MAAK,AAAL,EAAO,AAAgB,OAAhB,EAAsB,0BAgB7B,EAAY,gBAAgB,CAAC,QAAS,KAC/B,GACH,IAAiB,KAAK,CAAC,AAAC,IACtB,MAAM,CACR,EACJ,GAEA,EAAe,GAEgC,CAC7C,MAAA,EACA,eAAA,EACA,oBAAA,CACF,CAGF,CAQA,OAAO,eAAe,CAAG,AAAA,KAAgB,IAAI,CAAC,G,G,4D","sources":["","node_modules/assert/build/assert.js","node_modules/process/browser.js","node_modules/assert/build/internal/errors.js","node_modules/util/util.js","node_modules/util/support/types.js","node_modules/is-arguments/index.js","node_modules/has-tostringtag/shams.js","node_modules/has-symbols/shams.js","node_modules/call-bind/callBound.js","node_modules/get-intrinsic/index.js","node_modules/has-symbols/index.js","node_modules/has-proto/index.js","node_modules/function-bind/index.js","node_modules/function-bind/implementation.js","node_modules/hasown/index.js","node_modules/call-bind/index.js","node_modules/set-function-length/index.js","node_modules/define-data-property/index.js","node_modules/has-property-descriptors/index.js","node_modules/gopd/index.js","node_modules/is-generator-function/index.js","node_modules/which-typed-array/index.js","node_modules/for-each/index.js","node_modules/is-callable/index.js","node_modules/available-typed-arrays/index.js","node_modules/is-typed-array/index.js","node_modules/util/support/isBufferBrowser.js","node_modules/inherits/inherits_browser.js","node_modules/assert/build/internal/assert/assertion_error.js","node_modules/object.assign/polyfill.js","node_modules/object.assign/implementation.js","node_modules/object-keys/index.js","node_modules/object-keys/isArguments.js","node_modules/object-keys/implementation.js","node_modules/object-is/polyfill.js","node_modules/object-is/implementation.js","node_modules/assert/build/internal/util/comparisons.js","node_modules/object-is/index.js","node_modules/define-properties/index.js","node_modules/object-is/shim.js","node_modules/is-nan/index.js","node_modules/is-nan/implementation.js","node_modules/is-nan/polyfill.js","node_modules/is-nan/shim.js","src/ts/index.ts","node_modules/chart.js/auto/auto.js","node_modules/chart.js/dist/chart.js","node_modules/chart.js/src/core/core.animator.js","node_modules/chart.js/src/core/core.animation.js","node_modules/chart.js/src/core/core.animations.js","node_modules/chart.js/src/core/core.datasetController.js","node_modules/chart.js/src/controllers/controller.bar.js","node_modules/chart.js/src/controllers/controller.bubble.js","node_modules/chart.js/src/controllers/controller.doughnut.js","node_modules/chart.js/src/controllers/controller.line.js","node_modules/chart.js/src/controllers/controller.polarArea.js","node_modules/chart.js/src/controllers/controller.pie.js","node_modules/chart.js/src/controllers/controller.radar.js","node_modules/chart.js/src/controllers/controller.scatter.js","node_modules/chart.js/src/core/core.adapters.ts","node_modules/chart.js/src/core/core.interaction.js","node_modules/chart.js/src/core/core.layouts.js","node_modules/chart.js/src/platform/platform.base.js","node_modules/chart.js/src/platform/platform.basic.js","node_modules/chart.js/src/platform/platform.dom.js","node_modules/chart.js/src/platform/index.js","node_modules/chart.js/src/core/core.element.ts","node_modules/chart.js/src/core/core.scale.autoskip.js","node_modules/chart.js/src/core/core.scale.js","node_modules/chart.js/src/core/core.typedRegistry.js","node_modules/chart.js/src/core/core.registry.js","node_modules/chart.js/src/core/core.plugins.js","node_modules/chart.js/src/core/core.config.js","node_modules/chart.js/src/core/core.controller.js","node_modules/chart.js/src/elements/element.arc.ts","node_modules/chart.js/src/elements/element.line.js","node_modules/chart.js/src/elements/element.point.ts","node_modules/chart.js/src/elements/element.bar.js","node_modules/chart.js/src/plugins/plugin.colors.ts","node_modules/chart.js/src/plugins/plugin.decimation.js","node_modules/chart.js/src/plugins/plugin.filler/filler.segment.js","node_modules/chart.js/src/plugins/plugin.filler/filler.helper.js","node_modules/chart.js/src/plugins/plugin.filler/filler.options.js","node_modules/chart.js/src/plugins/plugin.filler/filler.target.stack.js","node_modules/chart.js/src/plugins/plugin.filler/simpleArc.js","node_modules/chart.js/src/plugins/plugin.filler/filler.target.js","node_modules/chart.js/src/plugins/plugin.filler/filler.drawing.js","node_modules/chart.js/src/plugins/plugin.filler/index.js","node_modules/chart.js/src/plugins/plugin.legend.js","node_modules/chart.js/src/plugins/plugin.title.js","node_modules/chart.js/src/plugins/plugin.subtitle.js","node_modules/chart.js/src/plugins/plugin.tooltip.js","node_modules/chart.js/src/scales/scale.category.js","node_modules/chart.js/src/scales/scale.linearbase.js","node_modules/chart.js/src/scales/scale.linear.js","node_modules/chart.js/src/scales/scale.logarithmic.js","node_modules/chart.js/src/scales/scale.radialLinear.js","node_modules/chart.js/src/scales/scale.time.js","node_modules/chart.js/src/scales/scale.timeseries.js","node_modules/chart.js/src/index.ts","node_modules/@swc/helpers/esm/_define_property.js","node_modules/chart.js/dist/chunks/helpers.segment.js","node_modules/chart.js/src/helpers/helpers.core.ts","node_modules/chart.js/src/helpers/helpers.math.ts","node_modules/chart.js/src/helpers/helpers.collection.ts","node_modules/chart.js/src/helpers/helpers.extras.ts","node_modules/chart.js/src/helpers/helpers.easing.ts","node_modules/chart.js/src/helpers/helpers.color.ts","node_modules/chart.js/src/core/core.animations.defaults.js","node_modules/chart.js/src/core/core.layouts.defaults.js","node_modules/chart.js/src/helpers/helpers.intl.ts","node_modules/chart.js/src/core/core.ticks.js","node_modules/chart.js/src/core/core.scale.defaults.js","node_modules/chart.js/src/core/core.defaults.js","node_modules/chart.js/src/helpers/helpers.canvas.ts","node_modules/chart.js/src/helpers/helpers.options.ts","node_modules/chart.js/src/helpers/helpers.config.ts","node_modules/chart.js/src/helpers/helpers.curve.ts","node_modules/chart.js/src/helpers/helpers.dom.ts","node_modules/chart.js/src/helpers/helpers.interpolation.ts","node_modules/chart.js/src/helpers/helpers.rtl.ts","node_modules/chart.js/src/helpers/helpers.segment.js","node_modules/@kurkle/color/dist/color.esm.js","node_modules/sortablejs/modular/sortable.esm.js","src/ts/util/animation-frame.ts","src/ts/circular-economy-model.ts","src/ts/model.ts","src/ts/box-model/box-model.ts","src/ts/box-model/engine.ts","src/ts/box-model/ode.ts","src/ts/model-simulator.ts","src/ts/visualization.ts","node_modules/lodash/kebabCase.js","node_modules/lodash/_createCompounder.js","node_modules/lodash/_arrayReduce.js","node_modules/lodash/deburr.js","node_modules/lodash/_deburrLetter.js","node_modules/lodash/_basePropertyOf.js","node_modules/lodash/toString.js","node_modules/lodash/_baseToString.js","node_modules/lodash/_Symbol.js","node_modules/lodash/_root.js","node_modules/lodash/_freeGlobal.js","node_modules/lodash/_arrayMap.js","node_modules/lodash/isArray.js","node_modules/lodash/isSymbol.js","node_modules/lodash/_baseGetTag.js","node_modules/lodash/_getRawTag.js","node_modules/lodash/_objectToString.js","node_modules/lodash/isObjectLike.js","node_modules/lodash/words.js","node_modules/lodash/_asciiWords.js","node_modules/lodash/_hasUnicodeWord.js","node_modules/lodash/_unicodeWords.js","src/ts/util/load-svg.ts","src/ts/util/guarded-query-selectors.ts","node_modules/@parcel/runtime-js/lib/runtime-76f357baab7f9b6d.js","src/ts/util/document-ready.ts","src/ts/parameter-transform/scripted-parameter-transform.ts","src/ts/util/is-var-name.ts","src/ts/parameter-transform/function-parameter-transform.ts","src/ts/parameter-transform/parameter-transform.ts"],"sourcesContent":["(function () {\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec7f3\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec7f3\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"cgw1K\", function(module, exports) {\n// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar $2fLxs = parcelRequire(\"2fLxs\");\n\"use strict\";\nfunction $8edfd2951adbea03$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $8edfd2951adbea03$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $8edfd2951adbea03$var$_typeof(o);\n}\nfunction $8edfd2951adbea03$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, $8edfd2951adbea03$var$_toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction $8edfd2951adbea03$var$_createClass(Constructor, protoProps, staticProps) {\n if (protoProps) $8edfd2951adbea03$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $8edfd2951adbea03$var$_defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction $8edfd2951adbea03$var$_toPropertyKey(arg) {\n var key = $8edfd2951adbea03$var$_toPrimitive(arg, \"string\");\n return $8edfd2951adbea03$var$_typeof(key) === \"symbol\" ? key : String(key);\n}\nfunction $8edfd2951adbea03$var$_toPrimitive(input, hint) {\n if ($8edfd2951adbea03$var$_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if ($8edfd2951adbea03$var$_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction $8edfd2951adbea03$var$_classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\n\nvar $fgTSu = parcelRequire(\"fgTSu\");\nvar $8edfd2951adbea03$var$_require$codes = $fgTSu.codes, $8edfd2951adbea03$var$ERR_AMBIGUOUS_ARGUMENT = $8edfd2951adbea03$var$_require$codes.ERR_AMBIGUOUS_ARGUMENT, $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE = $8edfd2951adbea03$var$_require$codes.ERR_INVALID_ARG_TYPE, $8edfd2951adbea03$var$ERR_INVALID_ARG_VALUE = $8edfd2951adbea03$var$_require$codes.ERR_INVALID_ARG_VALUE, $8edfd2951adbea03$var$ERR_INVALID_RETURN_VALUE = $8edfd2951adbea03$var$_require$codes.ERR_INVALID_RETURN_VALUE, $8edfd2951adbea03$var$ERR_MISSING_ARGS = $8edfd2951adbea03$var$_require$codes.ERR_MISSING_ARGS;\n\nvar $7aMwq = parcelRequire(\"7aMwq\");\n\nvar $gQylu = parcelRequire(\"gQylu\");\nvar $8edfd2951adbea03$var$inspect = $gQylu.inspect;\n\nvar $gQylu = parcelRequire(\"gQylu\");\nvar $8edfd2951adbea03$require$_require$types = $gQylu.types;\nvar $8edfd2951adbea03$var$isPromise = $8edfd2951adbea03$require$_require$types.isPromise, $8edfd2951adbea03$var$isRegExp = $8edfd2951adbea03$require$_require$types.isRegExp;\n\nvar $8edfd2951adbea03$var$objectAssign = (parcelRequire(\"8D6gL\"))();\n\nvar $8edfd2951adbea03$var$objectIs = (parcelRequire(\"bxl1N\"))();\n\nvar $8edfd2951adbea03$var$RegExpPrototypeTest = (parcelRequire(\"3e3ab\"))(\"RegExp.prototype.test\");\nvar $8edfd2951adbea03$var$errorCache = new Map();\nvar $8edfd2951adbea03$var$isDeepEqual;\nvar $8edfd2951adbea03$var$isDeepStrictEqual;\nvar $8edfd2951adbea03$var$parseExpressionAt;\nvar $8edfd2951adbea03$var$findNodeAround;\nvar $8edfd2951adbea03$var$decoder;\n\nfunction $8edfd2951adbea03$var$lazyLoadComparison() {\n var comparison = (parcelRequire(\"2DPC6\"));\n $8edfd2951adbea03$var$isDeepEqual = comparison.isDeepEqual;\n $8edfd2951adbea03$var$isDeepStrictEqual = comparison.isDeepStrictEqual;\n}\n// Escape control characters but not \\n and \\t to keep the line breaks and\n// indentation intact.\n// eslint-disable-next-line no-control-regex\nvar $8edfd2951adbea03$var$escapeSequencesRegExp = /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/g;\nvar $8edfd2951adbea03$var$meta = [\n \"\\\\u0000\",\n \"\\\\u0001\",\n \"\\\\u0002\",\n \"\\\\u0003\",\n \"\\\\u0004\",\n \"\\\\u0005\",\n \"\\\\u0006\",\n \"\\\\u0007\",\n \"\\\\b\",\n \"\",\n \"\",\n \"\\\\u000b\",\n \"\\\\f\",\n \"\",\n \"\\\\u000e\",\n \"\\\\u000f\",\n \"\\\\u0010\",\n \"\\\\u0011\",\n \"\\\\u0012\",\n \"\\\\u0013\",\n \"\\\\u0014\",\n \"\\\\u0015\",\n \"\\\\u0016\",\n \"\\\\u0017\",\n \"\\\\u0018\",\n \"\\\\u0019\",\n \"\\\\u001a\",\n \"\\\\u001b\",\n \"\\\\u001c\",\n \"\\\\u001d\",\n \"\\\\u001e\",\n \"\\\\u001f\"\n];\nvar $8edfd2951adbea03$var$escapeFn = function escapeFn(str) {\n return $8edfd2951adbea03$var$meta[str.charCodeAt(0)];\n};\nvar $8edfd2951adbea03$var$warned = false;\n// The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\nvar $8edfd2951adbea03$var$assert = module.exports = $8edfd2951adbea03$var$ok;\nvar $8edfd2951adbea03$var$NO_EXCEPTION_SENTINEL = {};\n// All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\nfunction $8edfd2951adbea03$var$innerFail(obj) {\n if (obj.message instanceof Error) throw obj.message;\n throw new $7aMwq(obj);\n}\nfunction $8edfd2951adbea03$var$fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length;\n var internalMessage;\n if (argsLen === 0) internalMessage = \"Failed\";\n else if (argsLen === 1) {\n message = actual;\n actual = undefined;\n } else {\n if ($8edfd2951adbea03$var$warned === false) {\n $8edfd2951adbea03$var$warned = true;\n var warn = $2fLxs.emitWarning ? $2fLxs.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n if (argsLen === 2) operator = \"!=\";\n }\n if (message instanceof Error) throw message;\n var errArgs = {\n actual: actual,\n expected: expected,\n operator: operator === undefined ? \"fail\" : operator,\n stackStartFn: stackStartFn || $8edfd2951adbea03$var$fail\n };\n if (message !== undefined) errArgs.message = message;\n var err = new $7aMwq(errArgs);\n if (internalMessage) {\n err.message = internalMessage;\n err.generatedMessage = true;\n }\n throw err;\n}\n$8edfd2951adbea03$var$assert.fail = $8edfd2951adbea03$var$fail;\n// The AssertionError is defined in internal/error.\n$8edfd2951adbea03$var$assert.AssertionError = $7aMwq;\nfunction $8edfd2951adbea03$var$innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = false;\n if (argLen === 0) {\n generatedMessage = true;\n message = \"No value argument passed to `assert.ok()`\";\n } else if (message instanceof Error) throw message;\n var err = new $7aMwq({\n actual: value,\n expected: true,\n message: message,\n operator: \"==\",\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\n// Pure assertion tests whether a value is truthy, as determined\n// by !!value.\nfunction $8edfd2951adbea03$var$ok() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];\n $8edfd2951adbea03$var$innerOk.apply(void 0, [\n $8edfd2951adbea03$var$ok,\n args.length\n ].concat(args));\n}\n$8edfd2951adbea03$var$assert.ok = $8edfd2951adbea03$var$ok;\n// The equality assertion tests shallow, coercive equality with ==.\n/* eslint-disable no-restricted-properties */ $8edfd2951adbea03$var$assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n // eslint-disable-next-line eqeqeq\n if (actual != expected) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"==\",\n stackStartFn: equal\n });\n};\n// The non-equality assertion tests for whether two objects are not\n// equal with !=.\n$8edfd2951adbea03$var$assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n // eslint-disable-next-line eqeqeq\n if (actual == expected) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n};\n// The equivalence assertion tests a deep equality relation.\n$8edfd2951adbea03$var$assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($8edfd2951adbea03$var$isDeepEqual === undefined) $8edfd2951adbea03$var$lazyLoadComparison();\n if (!$8edfd2951adbea03$var$isDeepEqual(actual, expected)) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n};\n// The non-equivalence assertion tests for any deep inequality.\n$8edfd2951adbea03$var$assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($8edfd2951adbea03$var$isDeepEqual === undefined) $8edfd2951adbea03$var$lazyLoadComparison();\n if ($8edfd2951adbea03$var$isDeepEqual(actual, expected)) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n};\n/* eslint-enable */ $8edfd2951adbea03$var$assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($8edfd2951adbea03$var$isDeepEqual === undefined) $8edfd2951adbea03$var$lazyLoadComparison();\n if (!$8edfd2951adbea03$var$isDeepStrictEqual(actual, expected)) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n};\n$8edfd2951adbea03$var$assert.notDeepStrictEqual = $8edfd2951adbea03$var$notDeepStrictEqual;\nfunction $8edfd2951adbea03$var$notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($8edfd2951adbea03$var$isDeepEqual === undefined) $8edfd2951adbea03$var$lazyLoadComparison();\n if ($8edfd2951adbea03$var$isDeepStrictEqual(actual, expected)) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: $8edfd2951adbea03$var$notDeepStrictEqual\n });\n}\n$8edfd2951adbea03$var$assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!$8edfd2951adbea03$var$objectIs(actual, expected)) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n};\n$8edfd2951adbea03$var$assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2) throw new $8edfd2951adbea03$var$ERR_MISSING_ARGS(\"actual\", \"expected\");\n if ($8edfd2951adbea03$var$objectIs(actual, expected)) $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n};\nvar $8edfd2951adbea03$var$Comparison = /*#__PURE__*/ $8edfd2951adbea03$var$_createClass(function Comparison(obj, keys, actual) {\n var _this = this;\n $8edfd2951adbea03$var$_classCallCheck(this, Comparison);\n keys.forEach(function(key) {\n if (key in obj) {\n if (actual !== undefined && typeof actual[key] === \"string\" && $8edfd2951adbea03$var$isRegExp(obj[key]) && $8edfd2951adbea03$var$RegExpPrototypeTest(obj[key], actual[key])) _this[key] = actual[key];\n else _this[key] = obj[key];\n }\n });\n});\nfunction $8edfd2951adbea03$var$compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !$8edfd2951adbea03$var$isDeepStrictEqual(actual[key], expected[key])) {\n if (!message) {\n // Create placeholder objects to create a nice output.\n var a = new $8edfd2951adbea03$var$Comparison(actual, keys);\n var b = new $8edfd2951adbea03$var$Comparison(expected, keys, actual);\n var err = new $7aMwq({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n err.actual = actual;\n err.expected = expected;\n err.operator = fn.name;\n throw err;\n }\n $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n}\nfunction $8edfd2951adbea03$var$expectedException(actual, expected, msg, fn) {\n if (typeof expected !== \"function\") {\n if ($8edfd2951adbea03$var$isRegExp(expected)) return $8edfd2951adbea03$var$RegExpPrototypeTest(expected, actual);\n // assert.doesNotThrow does not accept objects.\n if (arguments.length === 2) throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE(\"expected\", [\n \"Function\",\n \"RegExp\"\n ], expected);\n // Handle primitives properly.\n if ($8edfd2951adbea03$var$_typeof(actual) !== \"object\" || actual === null) {\n var err = new $7aMwq({\n actual: actual,\n expected: expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n err.operator = fn.name;\n throw err;\n }\n var keys = Object.keys(expected);\n // Special handle errors to make sure the name and the message are compared\n // as well.\n if (expected instanceof Error) keys.push(\"name\", \"message\");\n else if (keys.length === 0) throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n if ($8edfd2951adbea03$var$isDeepEqual === undefined) $8edfd2951adbea03$var$lazyLoadComparison();\n keys.forEach(function(key) {\n if (typeof actual[key] === \"string\" && $8edfd2951adbea03$var$isRegExp(expected[key]) && $8edfd2951adbea03$var$RegExpPrototypeTest(expected[key], actual[key])) return;\n $8edfd2951adbea03$var$compareExceptionKey(actual, expected, key, msg, keys, fn);\n });\n return true;\n }\n // Guard instanceof against arrow functions as they don't have a prototype.\n if (expected.prototype !== undefined && actual instanceof expected) return true;\n if (Error.isPrototypeOf(expected)) return false;\n return expected.call({}, actual) === true;\n}\nfunction $8edfd2951adbea03$var$getActual(fn) {\n if (typeof fn !== \"function\") throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return $8edfd2951adbea03$var$NO_EXCEPTION_SENTINEL;\n}\nfunction $8edfd2951adbea03$var$checkIsPromise(obj) {\n // Accept native ES6 promises and promises that are implemented in a similar\n // way. Do not accept thenables that use a function as `obj` and that have no\n // `catch` handler.\n // TODO: thenables are checked up until they have the correct methods,\n // but according to documentation, the `then` method should receive\n // the `fulfill` and `reject` arguments as well or it may be never resolved.\n return $8edfd2951adbea03$var$isPromise(obj) || obj !== null && $8edfd2951adbea03$var$_typeof(obj) === \"object\" && typeof obj.then === \"function\" && typeof obj.catch === \"function\";\n}\nfunction $8edfd2951adbea03$var$waitForActual(promiseFn) {\n return Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn === \"function\") {\n // Return a rejected promise if `promiseFn` throws synchronously.\n resultPromise = promiseFn();\n // Fail in case no promise is returned.\n if (!$8edfd2951adbea03$var$checkIsPromise(resultPromise)) throw new $8edfd2951adbea03$var$ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if ($8edfd2951adbea03$var$checkIsPromise(promiseFn)) resultPromise = promiseFn;\n else throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE(\"promiseFn\", [\n \"Function\",\n \"Promise\"\n ], promiseFn);\n return Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return $8edfd2951adbea03$var$NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n}\nfunction $8edfd2951adbea03$var$expectsError(stackStartFn, actual, error, message) {\n if (typeof error === \"string\") {\n if (arguments.length === 4) throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE(\"error\", [\n \"Object\",\n \"Error\",\n \"Function\",\n \"RegExp\"\n ], error);\n if ($8edfd2951adbea03$var$_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error) throw new $8edfd2951adbea03$var$ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error) throw new $8edfd2951adbea03$var$ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error;\n error = undefined;\n } else if (error != null && $8edfd2951adbea03$var$_typeof(error) !== \"object\" && typeof error !== \"function\") throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE(\"error\", [\n \"Object\",\n \"Error\",\n \"Function\",\n \"RegExp\"\n ], error);\n if (actual === $8edfd2951adbea03$var$NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n if (error && error.name) details += \" (\".concat(error.name, \")\");\n details += message ? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" ? \"rejection\" : \"exception\";\n $8edfd2951adbea03$var$innerFail({\n actual: undefined,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn: stackStartFn\n });\n }\n if (error && !$8edfd2951adbea03$var$expectedException(actual, error, message, stackStartFn)) throw actual;\n}\nfunction $8edfd2951adbea03$var$expectsNoError(stackStartFn, actual, error, message) {\n if (actual === $8edfd2951adbea03$var$NO_EXCEPTION_SENTINEL) return;\n if (typeof error === \"string\") {\n message = error;\n error = undefined;\n }\n if (!error || $8edfd2951adbea03$var$expectedException(actual, error)) {\n var details = message ? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"doesNotReject\" ? \"rejection\" : \"exception\";\n $8edfd2951adbea03$var$innerFail({\n actual: actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, \"\\n\") + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn: stackStartFn\n });\n }\n throw actual;\n}\n$8edfd2951adbea03$var$assert.throws = function throws(promiseFn) {\n for(var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++)args[_key2 - 1] = arguments[_key2];\n $8edfd2951adbea03$var$expectsError.apply(void 0, [\n throws,\n $8edfd2951adbea03$var$getActual(promiseFn)\n ].concat(args));\n};\n$8edfd2951adbea03$var$assert.rejects = function rejects(promiseFn) {\n for(var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++)args[_key3 - 1] = arguments[_key3];\n return $8edfd2951adbea03$var$waitForActual(promiseFn).then(function(result) {\n return $8edfd2951adbea03$var$expectsError.apply(void 0, [\n rejects,\n result\n ].concat(args));\n });\n};\n$8edfd2951adbea03$var$assert.doesNotThrow = function doesNotThrow(fn) {\n for(var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++)args[_key4 - 1] = arguments[_key4];\n $8edfd2951adbea03$var$expectsNoError.apply(void 0, [\n doesNotThrow,\n $8edfd2951adbea03$var$getActual(fn)\n ].concat(args));\n};\n$8edfd2951adbea03$var$assert.doesNotReject = function doesNotReject(fn) {\n for(var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++)args[_key5 - 1] = arguments[_key5];\n return $8edfd2951adbea03$var$waitForActual(fn).then(function(result) {\n return $8edfd2951adbea03$var$expectsNoError.apply(void 0, [\n doesNotReject,\n result\n ].concat(args));\n });\n};\n$8edfd2951adbea03$var$assert.ifError = function ifError(err) {\n if (err !== null && err !== undefined) {\n var message = \"ifError got unwanted exception: \";\n if ($8edfd2951adbea03$var$_typeof(err) === \"object\" && typeof err.message === \"string\") {\n if (err.message.length === 0 && err.constructor) message += err.constructor.name;\n else message += err.message;\n } else message += $8edfd2951adbea03$var$inspect(err);\n var newErr = new $7aMwq({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message: message,\n stackStartFn: ifError\n });\n // Make sure we actually have a stack trace!\n var origStack = err.stack;\n if (typeof origStack === \"string\") {\n // This will remove any duplicated frames from the error frames taken\n // from within `ifError` and add the original error frames to the newly\n // created ones.\n var tmp2 = origStack.split(\"\\n\");\n tmp2.shift();\n // Filter all frames existing in err.stack.\n var tmp1 = newErr.stack.split(\"\\n\");\n for(var i = 0; i < tmp2.length; i++){\n // Find the first occurrence of the frame.\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n // Only keep new frames.\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(\"\\n\"), \"\\n\").concat(tmp2.join(\"\\n\"));\n }\n throw newErr;\n }\n};\n// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a871df3dfb8ea663ef5e1f8f62701ec51384ecb\nfunction $8edfd2951adbea03$var$internalMatch(string, regexp, message, fn, fnName) {\n if (!$8edfd2951adbea03$var$isRegExp(regexp)) throw new $8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE(\"regexp\", \"RegExp\", regexp);\n var match = fnName === \"match\";\n if (typeof string !== \"string\" || $8edfd2951adbea03$var$RegExpPrototypeTest(regexp, string) !== match) {\n if (message instanceof Error) throw message;\n var generatedMessage = !message;\n // 'The input was expected to not match the regular expression ' +\n message = message || (typeof string !== \"string\" ? 'The \"string\" argument must be of type string. Received type ' + \"\".concat($8edfd2951adbea03$var$_typeof(string), \" (\").concat($8edfd2951adbea03$var$inspect(string), \")\") : (match ? \"The input did not match the regular expression \" : \"The input was expected to not match the regular expression \") + \"\".concat($8edfd2951adbea03$var$inspect(regexp), \". Input:\\n\\n\").concat($8edfd2951adbea03$var$inspect(string), \"\\n\"));\n var err = new $7aMwq({\n actual: string,\n expected: regexp,\n message: message,\n operator: fnName,\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\n$8edfd2951adbea03$var$assert.match = function match(string, regexp, message) {\n $8edfd2951adbea03$var$internalMatch(string, regexp, message, match, \"match\");\n};\n$8edfd2951adbea03$var$assert.doesNotMatch = function doesNotMatch(string, regexp, message) {\n $8edfd2951adbea03$var$internalMatch(string, regexp, message, doesNotMatch, \"doesNotMatch\");\n};\n// Expose a strict only variant of assert\nfunction $8edfd2951adbea03$var$strict() {\n for(var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++)args[_key6] = arguments[_key6];\n $8edfd2951adbea03$var$innerOk.apply(void 0, [\n $8edfd2951adbea03$var$strict,\n args.length\n ].concat(args));\n}\n$8edfd2951adbea03$var$assert.strict = $8edfd2951adbea03$var$objectAssign($8edfd2951adbea03$var$strict, $8edfd2951adbea03$var$assert, {\n equal: $8edfd2951adbea03$var$assert.strictEqual,\n deepEqual: $8edfd2951adbea03$var$assert.deepStrictEqual,\n notEqual: $8edfd2951adbea03$var$assert.notStrictEqual,\n notDeepEqual: $8edfd2951adbea03$var$assert.notDeepStrictEqual\n});\n$8edfd2951adbea03$var$assert.strict.strict = $8edfd2951adbea03$var$assert.strict;\n\n});\nparcelRegister(\"2fLxs\", function(module, exports) {\n// shim for using process in browser\nvar $1a41dbb141a3c8c6$var$process = module.exports = {};\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\nvar $1a41dbb141a3c8c6$var$cachedSetTimeout;\nvar $1a41dbb141a3c8c6$var$cachedClearTimeout;\nfunction $1a41dbb141a3c8c6$var$defaultSetTimout() {\n throw new Error(\"setTimeout has not been defined\");\n}\nfunction $1a41dbb141a3c8c6$var$defaultClearTimeout() {\n throw new Error(\"clearTimeout has not been defined\");\n}\n(function() {\n try {\n if (typeof setTimeout === \"function\") $1a41dbb141a3c8c6$var$cachedSetTimeout = setTimeout;\n else $1a41dbb141a3c8c6$var$cachedSetTimeout = $1a41dbb141a3c8c6$var$defaultSetTimout;\n } catch (e) {\n $1a41dbb141a3c8c6$var$cachedSetTimeout = $1a41dbb141a3c8c6$var$defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === \"function\") $1a41dbb141a3c8c6$var$cachedClearTimeout = clearTimeout;\n else $1a41dbb141a3c8c6$var$cachedClearTimeout = $1a41dbb141a3c8c6$var$defaultClearTimeout;\n } catch (e) {\n $1a41dbb141a3c8c6$var$cachedClearTimeout = $1a41dbb141a3c8c6$var$defaultClearTimeout;\n }\n})();\nfunction $1a41dbb141a3c8c6$var$runTimeout(fun) {\n if ($1a41dbb141a3c8c6$var$cachedSetTimeout === setTimeout) //normal enviroments in sane situations\n return setTimeout(fun, 0);\n // if setTimeout wasn't available but was latter defined\n if (($1a41dbb141a3c8c6$var$cachedSetTimeout === $1a41dbb141a3c8c6$var$defaultSetTimout || !$1a41dbb141a3c8c6$var$cachedSetTimeout) && setTimeout) {\n $1a41dbb141a3c8c6$var$cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return $1a41dbb141a3c8c6$var$cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return $1a41dbb141a3c8c6$var$cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return $1a41dbb141a3c8c6$var$cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\nfunction $1a41dbb141a3c8c6$var$runClearTimeout(marker) {\n if ($1a41dbb141a3c8c6$var$cachedClearTimeout === clearTimeout) //normal enviroments in sane situations\n return clearTimeout(marker);\n // if clearTimeout wasn't available but was latter defined\n if (($1a41dbb141a3c8c6$var$cachedClearTimeout === $1a41dbb141a3c8c6$var$defaultClearTimeout || !$1a41dbb141a3c8c6$var$cachedClearTimeout) && clearTimeout) {\n $1a41dbb141a3c8c6$var$cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return $1a41dbb141a3c8c6$var$cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return $1a41dbb141a3c8c6$var$cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return $1a41dbb141a3c8c6$var$cachedClearTimeout.call(this, marker);\n }\n }\n}\nvar $1a41dbb141a3c8c6$var$queue = [];\nvar $1a41dbb141a3c8c6$var$draining = false;\nvar $1a41dbb141a3c8c6$var$currentQueue;\nvar $1a41dbb141a3c8c6$var$queueIndex = -1;\nfunction $1a41dbb141a3c8c6$var$cleanUpNextTick() {\n if (!$1a41dbb141a3c8c6$var$draining || !$1a41dbb141a3c8c6$var$currentQueue) return;\n $1a41dbb141a3c8c6$var$draining = false;\n if ($1a41dbb141a3c8c6$var$currentQueue.length) $1a41dbb141a3c8c6$var$queue = $1a41dbb141a3c8c6$var$currentQueue.concat($1a41dbb141a3c8c6$var$queue);\n else $1a41dbb141a3c8c6$var$queueIndex = -1;\n if ($1a41dbb141a3c8c6$var$queue.length) $1a41dbb141a3c8c6$var$drainQueue();\n}\nfunction $1a41dbb141a3c8c6$var$drainQueue() {\n if ($1a41dbb141a3c8c6$var$draining) return;\n var timeout = $1a41dbb141a3c8c6$var$runTimeout($1a41dbb141a3c8c6$var$cleanUpNextTick);\n $1a41dbb141a3c8c6$var$draining = true;\n var len = $1a41dbb141a3c8c6$var$queue.length;\n while(len){\n $1a41dbb141a3c8c6$var$currentQueue = $1a41dbb141a3c8c6$var$queue;\n $1a41dbb141a3c8c6$var$queue = [];\n while(++$1a41dbb141a3c8c6$var$queueIndex < len)if ($1a41dbb141a3c8c6$var$currentQueue) $1a41dbb141a3c8c6$var$currentQueue[$1a41dbb141a3c8c6$var$queueIndex].run();\n $1a41dbb141a3c8c6$var$queueIndex = -1;\n len = $1a41dbb141a3c8c6$var$queue.length;\n }\n $1a41dbb141a3c8c6$var$currentQueue = null;\n $1a41dbb141a3c8c6$var$draining = false;\n $1a41dbb141a3c8c6$var$runClearTimeout(timeout);\n}\n$1a41dbb141a3c8c6$var$process.nextTick = function(fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) for(var i = 1; i < arguments.length; i++)args[i - 1] = arguments[i];\n $1a41dbb141a3c8c6$var$queue.push(new $1a41dbb141a3c8c6$var$Item(fun, args));\n if ($1a41dbb141a3c8c6$var$queue.length === 1 && !$1a41dbb141a3c8c6$var$draining) $1a41dbb141a3c8c6$var$runTimeout($1a41dbb141a3c8c6$var$drainQueue);\n};\n// v8 likes predictible objects\nfunction $1a41dbb141a3c8c6$var$Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\n$1a41dbb141a3c8c6$var$Item.prototype.run = function() {\n this.fun.apply(null, this.array);\n};\n$1a41dbb141a3c8c6$var$process.title = \"browser\";\n$1a41dbb141a3c8c6$var$process.browser = true;\n$1a41dbb141a3c8c6$var$process.env = {};\n$1a41dbb141a3c8c6$var$process.argv = [];\n$1a41dbb141a3c8c6$var$process.version = \"\"; // empty string to avoid regexp issues\n$1a41dbb141a3c8c6$var$process.versions = {};\nfunction $1a41dbb141a3c8c6$var$noop() {}\n$1a41dbb141a3c8c6$var$process.on = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.addListener = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.once = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.off = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.removeListener = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.removeAllListeners = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.emit = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.prependListener = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.prependOnceListener = $1a41dbb141a3c8c6$var$noop;\n$1a41dbb141a3c8c6$var$process.listeners = function(name) {\n return [];\n};\n$1a41dbb141a3c8c6$var$process.binding = function(name) {\n throw new Error(\"process.binding is not supported\");\n};\n$1a41dbb141a3c8c6$var$process.cwd = function() {\n return \"/\";\n};\n$1a41dbb141a3c8c6$var$process.chdir = function(dir) {\n throw new Error(\"process.chdir is not supported\");\n};\n$1a41dbb141a3c8c6$var$process.umask = function() {\n return 0;\n};\n\n});\n\nparcelRegister(\"fgTSu\", function(module, exports) {\n\n$parcel$export(module.exports, \"codes\", function () { return $b1e3b1d2b38bd4b2$export$e45cb6485273080e; }, function (v) { return $b1e3b1d2b38bd4b2$export$e45cb6485273080e = v; });\n// Currently in sync with Node.js lib/internal/errors.js\n// https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f\n/* eslint node-core/documented-errors: \"error\" */ /* eslint node-core/alphabetize-errors: \"error\" */ /* eslint node-core/prefer-util-format-errors: \"error\" */ var $b1e3b1d2b38bd4b2$export$e45cb6485273080e;\n\"use strict\";\n// The whole point behind this internal module is to allow Node.js to no\n// longer be forced to treat every error message change as a semver-major\n// change. The NodeError classes here all expose a `code` property whose\n// value statically and permanently identifies the error. While the error\n// message may change, the code should not.\nfunction $b1e3b1d2b38bd4b2$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $b1e3b1d2b38bd4b2$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $b1e3b1d2b38bd4b2$var$_typeof(o);\n}\nfunction $b1e3b1d2b38bd4b2$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, $b1e3b1d2b38bd4b2$var$_toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction $b1e3b1d2b38bd4b2$var$_createClass(Constructor, protoProps, staticProps) {\n if (protoProps) $b1e3b1d2b38bd4b2$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $b1e3b1d2b38bd4b2$var$_defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction $b1e3b1d2b38bd4b2$var$_toPropertyKey(arg) {\n var key = $b1e3b1d2b38bd4b2$var$_toPrimitive(arg, \"string\");\n return $b1e3b1d2b38bd4b2$var$_typeof(key) === \"symbol\" ? key : String(key);\n}\nfunction $b1e3b1d2b38bd4b2$var$_toPrimitive(input, hint) {\n if ($b1e3b1d2b38bd4b2$var$_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if ($b1e3b1d2b38bd4b2$var$_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction $b1e3b1d2b38bd4b2$var$_classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction $b1e3b1d2b38bd4b2$var$_inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) throw new TypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) $b1e3b1d2b38bd4b2$var$_setPrototypeOf(subClass, superClass);\n}\nfunction $b1e3b1d2b38bd4b2$var$_setPrototypeOf(o, p) {\n $b1e3b1d2b38bd4b2$var$_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return $b1e3b1d2b38bd4b2$var$_setPrototypeOf(o, p);\n}\nfunction $b1e3b1d2b38bd4b2$var$_createSuper(Derived) {\n var hasNativeReflectConstruct = $b1e3b1d2b38bd4b2$var$_isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = $b1e3b1d2b38bd4b2$var$_getPrototypeOf(Derived), result;\n if (hasNativeReflectConstruct) {\n var NewTarget = $b1e3b1d2b38bd4b2$var$_getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else result = Super.apply(this, arguments);\n return $b1e3b1d2b38bd4b2$var$_possibleConstructorReturn(this, result);\n };\n}\nfunction $b1e3b1d2b38bd4b2$var$_possibleConstructorReturn(self, call) {\n if (call && ($b1e3b1d2b38bd4b2$var$_typeof(call) === \"object\" || typeof call === \"function\")) return call;\n else if (call !== void 0) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return $b1e3b1d2b38bd4b2$var$_assertThisInitialized(self);\n}\nfunction $b1e3b1d2b38bd4b2$var$_assertThisInitialized(self) {\n if (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n}\nfunction $b1e3b1d2b38bd4b2$var$_isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n}\nfunction $b1e3b1d2b38bd4b2$var$_getPrototypeOf(o) {\n $b1e3b1d2b38bd4b2$var$_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return $b1e3b1d2b38bd4b2$var$_getPrototypeOf(o);\n}\nvar $b1e3b1d2b38bd4b2$var$codes = {};\n// Lazy loaded\nvar $b1e3b1d2b38bd4b2$var$assert;\nvar $b1e3b1d2b38bd4b2$var$util;\nfunction $b1e3b1d2b38bd4b2$var$createErrorType(code, message, Base) {\n if (!Base) Base = Error;\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === \"string\") return message;\n else return message(arg1, arg2, arg3);\n }\n var NodeError = /*#__PURE__*/ function(_Base) {\n $b1e3b1d2b38bd4b2$var$_inherits(NodeError, _Base);\n var _super = $b1e3b1d2b38bd4b2$var$_createSuper(NodeError);\n function NodeError(arg1, arg2, arg3) {\n var _this;\n $b1e3b1d2b38bd4b2$var$_classCallCheck(this, NodeError);\n _this = _super.call(this, getMessage(arg1, arg2, arg3));\n _this.code = code;\n return _this;\n }\n return $b1e3b1d2b38bd4b2$var$_createClass(NodeError);\n }(Base);\n $b1e3b1d2b38bd4b2$var$codes[code] = NodeError;\n}\n// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\nfunction $b1e3b1d2b38bd4b2$var$oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function(i) {\n return String(i);\n });\n if (len > 2) return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1];\n else if (len === 2) return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n else return \"of \".concat(thing, \" \").concat(expected[0]);\n } else return \"of \".concat(thing, \" \").concat(String(expected));\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\nfunction $b1e3b1d2b38bd4b2$var$startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction $b1e3b1d2b38bd4b2$var$endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) this_len = str.length;\n return str.substring(this_len - search.length, this_len) === search;\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\nfunction $b1e3b1d2b38bd4b2$var$includes(str, search, start) {\n if (typeof start !== \"number\") start = 0;\n if (start + search.length > str.length) return false;\n else return str.indexOf(search, start) !== -1;\n}\n$b1e3b1d2b38bd4b2$var$createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError);\n\n$b1e3b1d2b38bd4b2$var$createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n if ($b1e3b1d2b38bd4b2$var$assert === undefined) $b1e3b1d2b38bd4b2$var$assert = (parcelRequire(\"cgw1K\"));\n $b1e3b1d2b38bd4b2$var$assert(typeof name === \"string\", \"'name' must be a string\");\n // determiner: 'must be' or 'must not be'\n var determiner;\n if (typeof expected === \"string\" && $b1e3b1d2b38bd4b2$var$startsWith(expected, \"not \")) {\n determiner = \"must not be\";\n expected = expected.replace(/^not /, \"\");\n } else determiner = \"must be\";\n var msg;\n if ($b1e3b1d2b38bd4b2$var$endsWith(name, \" argument\")) // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat($b1e3b1d2b38bd4b2$var$oneOf(expected, \"type\"));\n else {\n var type = $b1e3b1d2b38bd4b2$var$includes(name, \".\") ? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat($b1e3b1d2b38bd4b2$var$oneOf(expected, \"type\"));\n }\n // TODO(BridgeAR): Improve the output by showing `null` and similar.\n msg += \". Received type \".concat($b1e3b1d2b38bd4b2$var$_typeof(actual));\n return msg;\n}, TypeError);\n\n$b1e3b1d2b38bd4b2$var$createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"is invalid\";\n if ($b1e3b1d2b38bd4b2$var$util === undefined) $b1e3b1d2b38bd4b2$var$util = (parcelRequire(\"gQylu\"));\n var inspected = $b1e3b1d2b38bd4b2$var$util.inspect(value);\n if (inspected.length > 128) inspected = \"\".concat(inspected.slice(0, 128), \"...\");\n return \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n}, TypeError, RangeError);\n$b1e3b1d2b38bd4b2$var$createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n if (value && value.constructor && value.constructor.name) type = \"instance of \".concat(value.constructor.name);\n else type = \"type \".concat($b1e3b1d2b38bd4b2$var$_typeof(value));\n return \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n}, TypeError);\n\n$b1e3b1d2b38bd4b2$var$createErrorType(\"ERR_MISSING_ARGS\", function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];\n if ($b1e3b1d2b38bd4b2$var$assert === undefined) $b1e3b1d2b38bd4b2$var$assert = (parcelRequire(\"cgw1K\"));\n $b1e3b1d2b38bd4b2$var$assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \";\n var len = args.length;\n args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n });\n switch(len){\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \");\n msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n}, TypeError);\n$b1e3b1d2b38bd4b2$export$e45cb6485273080e = $b1e3b1d2b38bd4b2$var$codes;\n\n});\nparcelRegister(\"gQylu\", function(module, exports) {\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar $2fLxs = parcelRequire(\"2fLxs\");\nvar $c43c250226d47bfa$var$getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for(var i = 0; i < keys.length; i++)descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n return descriptors;\n};\nvar $c43c250226d47bfa$var$formatRegExp = /%[sdj%]/g;\nmodule.exports.format = function(f) {\n if (!$c43c250226d47bfa$var$isString(f)) {\n var objects = [];\n for(var i = 0; i < arguments.length; i++)objects.push($c43c250226d47bfa$var$inspect(arguments[i]));\n return objects.join(\" \");\n }\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace($c43c250226d47bfa$var$formatRegExp, function(x) {\n if (x === \"%%\") return \"%\";\n if (i >= len) return x;\n switch(x){\n case \"%s\":\n return String(args[i++]);\n case \"%d\":\n return Number(args[i++]);\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return \"[Circular]\";\n }\n default:\n return x;\n }\n });\n for(var x = args[i]; i < len; x = args[++i])if ($c43c250226d47bfa$var$isNull(x) || !$c43c250226d47bfa$var$isObject(x)) str += \" \" + x;\n else str += \" \" + $c43c250226d47bfa$var$inspect(x);\n return str;\n};\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nmodule.exports.deprecate = function(fn, msg) {\n if (typeof $2fLxs !== \"undefined\" && $2fLxs.noDeprecation === true) return fn;\n // Allow for deprecating things in the process of starting up.\n if (typeof $2fLxs === \"undefined\") return function() {\n return module.exports.deprecate(fn, msg).apply(this, arguments);\n };\n var warned = false;\n function deprecated() {\n if (!warned) {\n if ($2fLxs.throwDeprecation) throw new Error(msg);\n else if ($2fLxs.traceDeprecation) console.trace(msg);\n else console.error(msg);\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n return deprecated;\n};\nvar $c43c250226d47bfa$var$debugs = {};\nvar $c43c250226d47bfa$var$debugEnvRegex = /^$/;\nvar $c43c250226d47bfa$var$debugEnv;\nmodule.exports.debuglog = function(set) {\n set = set.toUpperCase();\n if (!$c43c250226d47bfa$var$debugs[set]) {\n if ($c43c250226d47bfa$var$debugEnvRegex.test(set)) {\n var pid = $2fLxs.pid;\n $c43c250226d47bfa$var$debugs[set] = function() {\n var msg = module.exports.format.apply(module.exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else $c43c250226d47bfa$var$debugs[set] = function() {};\n }\n return $c43c250226d47bfa$var$debugs[set];\n};\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */ /* legacy: obj, showHidden, depth, colors*/ function $c43c250226d47bfa$var$inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: $c43c250226d47bfa$var$stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if ($c43c250226d47bfa$var$isBoolean(opts)) // legacy...\n ctx.showHidden = opts;\n else if (opts) // got an \"options\" object\n module.exports._extend(ctx, opts);\n // set default options\n if ($c43c250226d47bfa$var$isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if ($c43c250226d47bfa$var$isUndefined(ctx.depth)) ctx.depth = 2;\n if ($c43c250226d47bfa$var$isUndefined(ctx.colors)) ctx.colors = false;\n if ($c43c250226d47bfa$var$isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = $c43c250226d47bfa$var$stylizeWithColor;\n return $c43c250226d47bfa$var$formatValue(ctx, obj, ctx.depth);\n}\nmodule.exports.inspect = $c43c250226d47bfa$var$inspect;\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\n$c43c250226d47bfa$var$inspect.colors = {\n \"bold\": [\n 1,\n 22\n ],\n \"italic\": [\n 3,\n 23\n ],\n \"underline\": [\n 4,\n 24\n ],\n \"inverse\": [\n 7,\n 27\n ],\n \"white\": [\n 37,\n 39\n ],\n \"grey\": [\n 90,\n 39\n ],\n \"black\": [\n 30,\n 39\n ],\n \"blue\": [\n 34,\n 39\n ],\n \"cyan\": [\n 36,\n 39\n ],\n \"green\": [\n 32,\n 39\n ],\n \"magenta\": [\n 35,\n 39\n ],\n \"red\": [\n 31,\n 39\n ],\n \"yellow\": [\n 33,\n 39\n ]\n};\n// Don't use 'blue' not visible on cmd.exe\n$c43c250226d47bfa$var$inspect.styles = {\n \"special\": \"cyan\",\n \"number\": \"yellow\",\n \"boolean\": \"yellow\",\n \"undefined\": \"grey\",\n \"null\": \"bold\",\n \"string\": \"green\",\n \"date\": \"magenta\",\n // \"name\": intentionally not styling\n \"regexp\": \"red\"\n};\nfunction $c43c250226d47bfa$var$stylizeWithColor(str, styleType) {\n var style = $c43c250226d47bfa$var$inspect.styles[styleType];\n if (style) return \"\\x1b[\" + $c43c250226d47bfa$var$inspect.colors[style][0] + \"m\" + str + \"\\x1b[\" + $c43c250226d47bfa$var$inspect.colors[style][1] + \"m\";\n else return str;\n}\nfunction $c43c250226d47bfa$var$stylizeNoColor(str, styleType) {\n return str;\n}\nfunction $c43c250226d47bfa$var$arrayToHash(array) {\n var hash = {};\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n return hash;\n}\nfunction $c43c250226d47bfa$var$formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect && value && $c43c250226d47bfa$var$isFunction(value.inspect) && // Filter out the util module, it's inspect function is special\n value.inspect !== module.exports.inspect && // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!$c43c250226d47bfa$var$isString(ret)) ret = $c43c250226d47bfa$var$formatValue(ctx, ret, recurseTimes);\n return ret;\n }\n // Primitive types cannot have properties\n var primitive = $c43c250226d47bfa$var$formatPrimitive(ctx, value);\n if (primitive) return primitive;\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = $c43c250226d47bfa$var$arrayToHash(keys);\n if (ctx.showHidden) keys = Object.getOwnPropertyNames(value);\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if ($c43c250226d47bfa$var$isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0)) return $c43c250226d47bfa$var$formatError(value);\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if ($c43c250226d47bfa$var$isFunction(value)) {\n var name = value.name ? \": \" + value.name : \"\";\n return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n }\n if ($c43c250226d47bfa$var$isRegExp(value)) return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n if ($c43c250226d47bfa$var$isDate(value)) return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n if ($c43c250226d47bfa$var$isError(value)) return $c43c250226d47bfa$var$formatError(value);\n }\n var base = \"\", array = false, braces = [\n \"{\",\n \"}\"\n ];\n // Make Array say that they are Array\n if ($c43c250226d47bfa$var$isArray(value)) {\n array = true;\n braces = [\n \"[\",\n \"]\"\n ];\n }\n // Make functions say that they are functions\n if ($c43c250226d47bfa$var$isFunction(value)) {\n var n = value.name ? \": \" + value.name : \"\";\n base = \" [Function\" + n + \"]\";\n }\n // Make RegExps say that they are RegExps\n if ($c43c250226d47bfa$var$isRegExp(value)) base = \" \" + RegExp.prototype.toString.call(value);\n // Make dates with properties first say the date\n if ($c43c250226d47bfa$var$isDate(value)) base = \" \" + Date.prototype.toUTCString.call(value);\n // Make error with message first say the error\n if ($c43c250226d47bfa$var$isError(value)) base = \" \" + $c43c250226d47bfa$var$formatError(value);\n if (keys.length === 0 && (!array || value.length == 0)) return braces[0] + base + braces[1];\n if (recurseTimes < 0) {\n if ($c43c250226d47bfa$var$isRegExp(value)) return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n else return ctx.stylize(\"[Object]\", \"special\");\n }\n ctx.seen.push(value);\n var output;\n if (array) output = $c43c250226d47bfa$var$formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n else output = keys.map(function(key) {\n return $c43c250226d47bfa$var$formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n ctx.seen.pop();\n return $c43c250226d47bfa$var$reduceToSingleString(output, base, braces);\n}\nfunction $c43c250226d47bfa$var$formatPrimitive(ctx, value) {\n if ($c43c250226d47bfa$var$isUndefined(value)) return ctx.stylize(\"undefined\", \"undefined\");\n if ($c43c250226d47bfa$var$isString(value)) {\n var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return ctx.stylize(simple, \"string\");\n }\n if ($c43c250226d47bfa$var$isNumber(value)) return ctx.stylize(\"\" + value, \"number\");\n if ($c43c250226d47bfa$var$isBoolean(value)) return ctx.stylize(\"\" + value, \"boolean\");\n // For some reason typeof null is \"object\", so special case here.\n if ($c43c250226d47bfa$var$isNull(value)) return ctx.stylize(\"null\", \"null\");\n}\nfunction $c43c250226d47bfa$var$formatError(value) {\n return \"[\" + Error.prototype.toString.call(value) + \"]\";\n}\nfunction $c43c250226d47bfa$var$formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for(var i = 0, l = value.length; i < l; ++i)if ($c43c250226d47bfa$var$hasOwnProperty(value, String(i))) output.push($c43c250226d47bfa$var$formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));\n else output.push(\"\");\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) output.push($c43c250226d47bfa$var$formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));\n });\n return output;\n}\nfunction $c43c250226d47bfa$var$formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n };\n if (desc.get) {\n if (desc.set) str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n else str = ctx.stylize(\"[Getter]\", \"special\");\n } else if (desc.set) str = ctx.stylize(\"[Setter]\", \"special\");\n if (!$c43c250226d47bfa$var$hasOwnProperty(visibleKeys, key)) name = \"[\" + key + \"]\";\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if ($c43c250226d47bfa$var$isNull(recurseTimes)) str = $c43c250226d47bfa$var$formatValue(ctx, desc.value, null);\n else str = $c43c250226d47bfa$var$formatValue(ctx, desc.value, recurseTimes - 1);\n if (str.indexOf(\"\\n\") > -1) {\n if (array) str = str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\").slice(2);\n else str = \"\\n\" + str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\");\n }\n } else str = ctx.stylize(\"[Circular]\", \"special\");\n }\n if ($c43c250226d47bfa$var$isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) return str;\n name = JSON.stringify(\"\" + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.slice(1, -1);\n name = ctx.stylize(name, \"name\");\n } else {\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, \"string\");\n }\n }\n return name + \": \" + str;\n}\nfunction $c43c250226d47bfa$var$reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf(\"\\n\") >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, \"\").length + 1;\n }, 0);\n if (length > 60) return braces[0] + (base === \"\" ? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n \") + \" \" + braces[1];\n return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n}\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nmodule.exports.types = (parcelRequire(\"dIzU8\"));\nfunction $c43c250226d47bfa$var$isArray(ar) {\n return Array.isArray(ar);\n}\nmodule.exports.isArray = $c43c250226d47bfa$var$isArray;\nfunction $c43c250226d47bfa$var$isBoolean(arg) {\n return typeof arg === \"boolean\";\n}\nmodule.exports.isBoolean = $c43c250226d47bfa$var$isBoolean;\nfunction $c43c250226d47bfa$var$isNull(arg) {\n return arg === null;\n}\nmodule.exports.isNull = $c43c250226d47bfa$var$isNull;\nfunction $c43c250226d47bfa$var$isNullOrUndefined(arg) {\n return arg == null;\n}\nmodule.exports.isNullOrUndefined = $c43c250226d47bfa$var$isNullOrUndefined;\nfunction $c43c250226d47bfa$var$isNumber(arg) {\n return typeof arg === \"number\";\n}\nmodule.exports.isNumber = $c43c250226d47bfa$var$isNumber;\nfunction $c43c250226d47bfa$var$isString(arg) {\n return typeof arg === \"string\";\n}\nmodule.exports.isString = $c43c250226d47bfa$var$isString;\nfunction $c43c250226d47bfa$var$isSymbol(arg) {\n return typeof arg === \"symbol\";\n}\nmodule.exports.isSymbol = $c43c250226d47bfa$var$isSymbol;\nfunction $c43c250226d47bfa$var$isUndefined(arg) {\n return arg === void 0;\n}\nmodule.exports.isUndefined = $c43c250226d47bfa$var$isUndefined;\nfunction $c43c250226d47bfa$var$isRegExp(re) {\n return $c43c250226d47bfa$var$isObject(re) && $c43c250226d47bfa$var$objectToString(re) === \"[object RegExp]\";\n}\nmodule.exports.isRegExp = $c43c250226d47bfa$var$isRegExp;\nmodule.exports.types.isRegExp = $c43c250226d47bfa$var$isRegExp;\nfunction $c43c250226d47bfa$var$isObject(arg) {\n return typeof arg === \"object\" && arg !== null;\n}\nmodule.exports.isObject = $c43c250226d47bfa$var$isObject;\nfunction $c43c250226d47bfa$var$isDate(d) {\n return $c43c250226d47bfa$var$isObject(d) && $c43c250226d47bfa$var$objectToString(d) === \"[object Date]\";\n}\nmodule.exports.isDate = $c43c250226d47bfa$var$isDate;\nmodule.exports.types.isDate = $c43c250226d47bfa$var$isDate;\nfunction $c43c250226d47bfa$var$isError(e) {\n return $c43c250226d47bfa$var$isObject(e) && ($c43c250226d47bfa$var$objectToString(e) === \"[object Error]\" || e instanceof Error);\n}\nmodule.exports.isError = $c43c250226d47bfa$var$isError;\nmodule.exports.types.isNativeError = $c43c250226d47bfa$var$isError;\nfunction $c43c250226d47bfa$var$isFunction(arg) {\n return typeof arg === \"function\";\n}\nmodule.exports.isFunction = $c43c250226d47bfa$var$isFunction;\nfunction $c43c250226d47bfa$var$isPrimitive(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || // ES6 symbol\n typeof arg === \"undefined\";\n}\nmodule.exports.isPrimitive = $c43c250226d47bfa$var$isPrimitive;\n\nmodule.exports.isBuffer = (parcelRequire(\"1qVfH\"));\nfunction $c43c250226d47bfa$var$objectToString(o) {\n return Object.prototype.toString.call(o);\n}\nfunction $c43c250226d47bfa$var$pad(n) {\n return n < 10 ? \"0\" + n.toString(10) : n.toString(10);\n}\nvar $c43c250226d47bfa$var$months = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n];\n// 26 Feb 16:19:34\nfunction $c43c250226d47bfa$var$timestamp() {\n var d = new Date();\n var time = [\n $c43c250226d47bfa$var$pad(d.getHours()),\n $c43c250226d47bfa$var$pad(d.getMinutes()),\n $c43c250226d47bfa$var$pad(d.getSeconds())\n ].join(\":\");\n return [\n d.getDate(),\n $c43c250226d47bfa$var$months[d.getMonth()],\n time\n ].join(\" \");\n}\n// log is just a thin wrapper to console.log that prepends a timestamp\nmodule.exports.log = function() {\n console.log(\"%s - %s\", $c43c250226d47bfa$var$timestamp(), module.exports.format.apply(module.exports, arguments));\n};\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */ module.exports.inherits = (parcelRequire(\"9TvxW\"));\nmodule.exports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !$c43c250226d47bfa$var$isObject(add)) return origin;\n var keys = Object.keys(add);\n var i = keys.length;\n while(i--)origin[keys[i]] = add[keys[i]];\n return origin;\n};\nfunction $c43c250226d47bfa$var$hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\nvar $c43c250226d47bfa$var$kCustomPromisifiedSymbol = typeof Symbol !== \"undefined\" ? Symbol(\"util.promisify.custom\") : undefined;\nmodule.exports.promisify = function promisify(original) {\n if (typeof original !== \"function\") throw new TypeError('The \"original\" argument must be of type Function');\n if ($c43c250226d47bfa$var$kCustomPromisifiedSymbol && original[$c43c250226d47bfa$var$kCustomPromisifiedSymbol]) {\n var fn = original[$c43c250226d47bfa$var$kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\") throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n Object.defineProperty(fn, $c43c250226d47bfa$var$kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: false,\n writable: false,\n configurable: true\n });\n return fn;\n }\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function(resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n var args = [];\n for(var i = 0; i < arguments.length; i++)args.push(arguments[i]);\n args.push(function(err, value) {\n if (err) promiseReject(err);\n else promiseResolve(value);\n });\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n if ($c43c250226d47bfa$var$kCustomPromisifiedSymbol) Object.defineProperty(fn, $c43c250226d47bfa$var$kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: false,\n writable: false,\n configurable: true\n });\n return Object.defineProperties(fn, $c43c250226d47bfa$var$getOwnPropertyDescriptors(original));\n};\nmodule.exports.promisify.custom = $c43c250226d47bfa$var$kCustomPromisifiedSymbol;\nfunction $c43c250226d47bfa$var$callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\nfunction $c43c250226d47bfa$var$callbackify(original) {\n if (typeof original !== \"function\") throw new TypeError('The \"original\" argument must be of type Function');\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for(var i = 0; i < arguments.length; i++)args.push(arguments[i]);\n var maybeCb = args.pop();\n if (typeof maybeCb !== \"function\") throw new TypeError(\"The last argument must be of type Function\");\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args).then(function(ret) {\n $2fLxs.nextTick(cb.bind(null, null, ret));\n }, function(rej) {\n $2fLxs.nextTick($c43c250226d47bfa$var$callbackifyOnRejected.bind(null, rej, cb));\n });\n }\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified, $c43c250226d47bfa$var$getOwnPropertyDescriptors(original));\n return callbackified;\n}\nmodule.exports.callbackify = $c43c250226d47bfa$var$callbackify;\n\n});\nparcelRegister(\"dIzU8\", function(module, exports) {\n// Currently in sync with Node.js lib/internal/util/types.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\"use strict\";\n\nvar $avzh7 = parcelRequire(\"avzh7\");\n\nvar $9mPZQ = parcelRequire(\"9mPZQ\");\n\nvar $6Sxxf = parcelRequire(\"6Sxxf\");\n\nvar $bbrRm = parcelRequire(\"bbrRm\");\nfunction $9fcb3c45d02987bb$var$uncurryThis(f) {\n return f.call.bind(f);\n}\nvar $9fcb3c45d02987bb$var$BigIntSupported = typeof BigInt !== \"undefined\";\nvar $9fcb3c45d02987bb$var$SymbolSupported = typeof Symbol !== \"undefined\";\nvar $9fcb3c45d02987bb$var$ObjectToString = $9fcb3c45d02987bb$var$uncurryThis(Object.prototype.toString);\nvar $9fcb3c45d02987bb$var$numberValue = $9fcb3c45d02987bb$var$uncurryThis(Number.prototype.valueOf);\nvar $9fcb3c45d02987bb$var$stringValue = $9fcb3c45d02987bb$var$uncurryThis(String.prototype.valueOf);\nvar $9fcb3c45d02987bb$var$booleanValue = $9fcb3c45d02987bb$var$uncurryThis(Boolean.prototype.valueOf);\nif ($9fcb3c45d02987bb$var$BigIntSupported) var $9fcb3c45d02987bb$var$bigIntValue = $9fcb3c45d02987bb$var$uncurryThis(BigInt.prototype.valueOf);\nif ($9fcb3c45d02987bb$var$SymbolSupported) var $9fcb3c45d02987bb$var$symbolValue = $9fcb3c45d02987bb$var$uncurryThis(Symbol.prototype.valueOf);\nfunction $9fcb3c45d02987bb$var$checkBoxedPrimitive(value, prototypeValueOf) {\n if (typeof value !== \"object\") return false;\n try {\n prototypeValueOf(value);\n return true;\n } catch (e) {\n return false;\n }\n}\nmodule.exports.isArgumentsObject = $avzh7;\nmodule.exports.isGeneratorFunction = $9mPZQ;\nmodule.exports.isTypedArray = $bbrRm;\n// Taken from here and modified for better browser support\n// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js\nfunction $9fcb3c45d02987bb$var$isPromise(input) {\n return typeof Promise !== \"undefined\" && input instanceof Promise || input !== null && typeof input === \"object\" && typeof input.then === \"function\" && typeof input.catch === \"function\";\n}\nmodule.exports.isPromise = $9fcb3c45d02987bb$var$isPromise;\nfunction $9fcb3c45d02987bb$var$isArrayBufferView(value) {\n if (typeof ArrayBuffer !== \"undefined\" && ArrayBuffer.isView) return ArrayBuffer.isView(value);\n return $bbrRm(value) || $9fcb3c45d02987bb$var$isDataView(value);\n}\nmodule.exports.isArrayBufferView = $9fcb3c45d02987bb$var$isArrayBufferView;\nfunction $9fcb3c45d02987bb$var$isUint8Array(value) {\n return $6Sxxf(value) === \"Uint8Array\";\n}\nmodule.exports.isUint8Array = $9fcb3c45d02987bb$var$isUint8Array;\nfunction $9fcb3c45d02987bb$var$isUint8ClampedArray(value) {\n return $6Sxxf(value) === \"Uint8ClampedArray\";\n}\nmodule.exports.isUint8ClampedArray = $9fcb3c45d02987bb$var$isUint8ClampedArray;\nfunction $9fcb3c45d02987bb$var$isUint16Array(value) {\n return $6Sxxf(value) === \"Uint16Array\";\n}\nmodule.exports.isUint16Array = $9fcb3c45d02987bb$var$isUint16Array;\nfunction $9fcb3c45d02987bb$var$isUint32Array(value) {\n return $6Sxxf(value) === \"Uint32Array\";\n}\nmodule.exports.isUint32Array = $9fcb3c45d02987bb$var$isUint32Array;\nfunction $9fcb3c45d02987bb$var$isInt8Array(value) {\n return $6Sxxf(value) === \"Int8Array\";\n}\nmodule.exports.isInt8Array = $9fcb3c45d02987bb$var$isInt8Array;\nfunction $9fcb3c45d02987bb$var$isInt16Array(value) {\n return $6Sxxf(value) === \"Int16Array\";\n}\nmodule.exports.isInt16Array = $9fcb3c45d02987bb$var$isInt16Array;\nfunction $9fcb3c45d02987bb$var$isInt32Array(value) {\n return $6Sxxf(value) === \"Int32Array\";\n}\nmodule.exports.isInt32Array = $9fcb3c45d02987bb$var$isInt32Array;\nfunction $9fcb3c45d02987bb$var$isFloat32Array(value) {\n return $6Sxxf(value) === \"Float32Array\";\n}\nmodule.exports.isFloat32Array = $9fcb3c45d02987bb$var$isFloat32Array;\nfunction $9fcb3c45d02987bb$var$isFloat64Array(value) {\n return $6Sxxf(value) === \"Float64Array\";\n}\nmodule.exports.isFloat64Array = $9fcb3c45d02987bb$var$isFloat64Array;\nfunction $9fcb3c45d02987bb$var$isBigInt64Array(value) {\n return $6Sxxf(value) === \"BigInt64Array\";\n}\nmodule.exports.isBigInt64Array = $9fcb3c45d02987bb$var$isBigInt64Array;\nfunction $9fcb3c45d02987bb$var$isBigUint64Array(value) {\n return $6Sxxf(value) === \"BigUint64Array\";\n}\nmodule.exports.isBigUint64Array = $9fcb3c45d02987bb$var$isBigUint64Array;\nfunction $9fcb3c45d02987bb$var$isMapToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object Map]\";\n}\n$9fcb3c45d02987bb$var$isMapToString.working = typeof Map !== \"undefined\" && $9fcb3c45d02987bb$var$isMapToString(new Map());\nfunction $9fcb3c45d02987bb$var$isMap(value) {\n if (typeof Map === \"undefined\") return false;\n return $9fcb3c45d02987bb$var$isMapToString.working ? $9fcb3c45d02987bb$var$isMapToString(value) : value instanceof Map;\n}\nmodule.exports.isMap = $9fcb3c45d02987bb$var$isMap;\nfunction $9fcb3c45d02987bb$var$isSetToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object Set]\";\n}\n$9fcb3c45d02987bb$var$isSetToString.working = typeof Set !== \"undefined\" && $9fcb3c45d02987bb$var$isSetToString(new Set());\nfunction $9fcb3c45d02987bb$var$isSet(value) {\n if (typeof Set === \"undefined\") return false;\n return $9fcb3c45d02987bb$var$isSetToString.working ? $9fcb3c45d02987bb$var$isSetToString(value) : value instanceof Set;\n}\nmodule.exports.isSet = $9fcb3c45d02987bb$var$isSet;\nfunction $9fcb3c45d02987bb$var$isWeakMapToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object WeakMap]\";\n}\n$9fcb3c45d02987bb$var$isWeakMapToString.working = typeof WeakMap !== \"undefined\" && $9fcb3c45d02987bb$var$isWeakMapToString(new WeakMap());\nfunction $9fcb3c45d02987bb$var$isWeakMap(value) {\n if (typeof WeakMap === \"undefined\") return false;\n return $9fcb3c45d02987bb$var$isWeakMapToString.working ? $9fcb3c45d02987bb$var$isWeakMapToString(value) : value instanceof WeakMap;\n}\nmodule.exports.isWeakMap = $9fcb3c45d02987bb$var$isWeakMap;\nfunction $9fcb3c45d02987bb$var$isWeakSetToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object WeakSet]\";\n}\n$9fcb3c45d02987bb$var$isWeakSetToString.working = typeof WeakSet !== \"undefined\" && $9fcb3c45d02987bb$var$isWeakSetToString(new WeakSet());\nfunction $9fcb3c45d02987bb$var$isWeakSet(value) {\n return $9fcb3c45d02987bb$var$isWeakSetToString(value);\n}\nmodule.exports.isWeakSet = $9fcb3c45d02987bb$var$isWeakSet;\nfunction $9fcb3c45d02987bb$var$isArrayBufferToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object ArrayBuffer]\";\n}\n$9fcb3c45d02987bb$var$isArrayBufferToString.working = typeof ArrayBuffer !== \"undefined\" && $9fcb3c45d02987bb$var$isArrayBufferToString(new ArrayBuffer());\nfunction $9fcb3c45d02987bb$var$isArrayBuffer(value) {\n if (typeof ArrayBuffer === \"undefined\") return false;\n return $9fcb3c45d02987bb$var$isArrayBufferToString.working ? $9fcb3c45d02987bb$var$isArrayBufferToString(value) : value instanceof ArrayBuffer;\n}\nmodule.exports.isArrayBuffer = $9fcb3c45d02987bb$var$isArrayBuffer;\nfunction $9fcb3c45d02987bb$var$isDataViewToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object DataView]\";\n}\n$9fcb3c45d02987bb$var$isDataViewToString.working = typeof ArrayBuffer !== \"undefined\" && typeof DataView !== \"undefined\" && $9fcb3c45d02987bb$var$isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1));\nfunction $9fcb3c45d02987bb$var$isDataView(value) {\n if (typeof DataView === \"undefined\") return false;\n return $9fcb3c45d02987bb$var$isDataViewToString.working ? $9fcb3c45d02987bb$var$isDataViewToString(value) : value instanceof DataView;\n}\nmodule.exports.isDataView = $9fcb3c45d02987bb$var$isDataView;\n// Store a copy of SharedArrayBuffer in case it's deleted elsewhere\nvar $9fcb3c45d02987bb$var$SharedArrayBufferCopy = typeof SharedArrayBuffer !== \"undefined\" ? SharedArrayBuffer : undefined;\nfunction $9fcb3c45d02987bb$var$isSharedArrayBufferToString(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object SharedArrayBuffer]\";\n}\nfunction $9fcb3c45d02987bb$var$isSharedArrayBuffer(value) {\n if (typeof $9fcb3c45d02987bb$var$SharedArrayBufferCopy === \"undefined\") return false;\n if (typeof $9fcb3c45d02987bb$var$isSharedArrayBufferToString.working === \"undefined\") $9fcb3c45d02987bb$var$isSharedArrayBufferToString.working = $9fcb3c45d02987bb$var$isSharedArrayBufferToString(new $9fcb3c45d02987bb$var$SharedArrayBufferCopy());\n return $9fcb3c45d02987bb$var$isSharedArrayBufferToString.working ? $9fcb3c45d02987bb$var$isSharedArrayBufferToString(value) : value instanceof $9fcb3c45d02987bb$var$SharedArrayBufferCopy;\n}\nmodule.exports.isSharedArrayBuffer = $9fcb3c45d02987bb$var$isSharedArrayBuffer;\nfunction $9fcb3c45d02987bb$var$isAsyncFunction(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object AsyncFunction]\";\n}\nmodule.exports.isAsyncFunction = $9fcb3c45d02987bb$var$isAsyncFunction;\nfunction $9fcb3c45d02987bb$var$isMapIterator(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object Map Iterator]\";\n}\nmodule.exports.isMapIterator = $9fcb3c45d02987bb$var$isMapIterator;\nfunction $9fcb3c45d02987bb$var$isSetIterator(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object Set Iterator]\";\n}\nmodule.exports.isSetIterator = $9fcb3c45d02987bb$var$isSetIterator;\nfunction $9fcb3c45d02987bb$var$isGeneratorObject(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object Generator]\";\n}\nmodule.exports.isGeneratorObject = $9fcb3c45d02987bb$var$isGeneratorObject;\nfunction $9fcb3c45d02987bb$var$isWebAssemblyCompiledModule(value) {\n return $9fcb3c45d02987bb$var$ObjectToString(value) === \"[object WebAssembly.Module]\";\n}\nmodule.exports.isWebAssemblyCompiledModule = $9fcb3c45d02987bb$var$isWebAssemblyCompiledModule;\nfunction $9fcb3c45d02987bb$var$isNumberObject(value) {\n return $9fcb3c45d02987bb$var$checkBoxedPrimitive(value, $9fcb3c45d02987bb$var$numberValue);\n}\nmodule.exports.isNumberObject = $9fcb3c45d02987bb$var$isNumberObject;\nfunction $9fcb3c45d02987bb$var$isStringObject(value) {\n return $9fcb3c45d02987bb$var$checkBoxedPrimitive(value, $9fcb3c45d02987bb$var$stringValue);\n}\nmodule.exports.isStringObject = $9fcb3c45d02987bb$var$isStringObject;\nfunction $9fcb3c45d02987bb$var$isBooleanObject(value) {\n return $9fcb3c45d02987bb$var$checkBoxedPrimitive(value, $9fcb3c45d02987bb$var$booleanValue);\n}\nmodule.exports.isBooleanObject = $9fcb3c45d02987bb$var$isBooleanObject;\nfunction $9fcb3c45d02987bb$var$isBigIntObject(value) {\n return $9fcb3c45d02987bb$var$BigIntSupported && $9fcb3c45d02987bb$var$checkBoxedPrimitive(value, $9fcb3c45d02987bb$var$bigIntValue);\n}\nmodule.exports.isBigIntObject = $9fcb3c45d02987bb$var$isBigIntObject;\nfunction $9fcb3c45d02987bb$var$isSymbolObject(value) {\n return $9fcb3c45d02987bb$var$SymbolSupported && $9fcb3c45d02987bb$var$checkBoxedPrimitive(value, $9fcb3c45d02987bb$var$symbolValue);\n}\nmodule.exports.isSymbolObject = $9fcb3c45d02987bb$var$isSymbolObject;\nfunction $9fcb3c45d02987bb$var$isBoxedPrimitive(value) {\n return $9fcb3c45d02987bb$var$isNumberObject(value) || $9fcb3c45d02987bb$var$isStringObject(value) || $9fcb3c45d02987bb$var$isBooleanObject(value) || $9fcb3c45d02987bb$var$isBigIntObject(value) || $9fcb3c45d02987bb$var$isSymbolObject(value);\n}\nmodule.exports.isBoxedPrimitive = $9fcb3c45d02987bb$var$isBoxedPrimitive;\nfunction $9fcb3c45d02987bb$var$isAnyArrayBuffer(value) {\n return typeof Uint8Array !== \"undefined\" && ($9fcb3c45d02987bb$var$isArrayBuffer(value) || $9fcb3c45d02987bb$var$isSharedArrayBuffer(value));\n}\nmodule.exports.isAnyArrayBuffer = $9fcb3c45d02987bb$var$isAnyArrayBuffer;\n[\n \"isProxy\",\n \"isExternal\",\n \"isModuleNamespaceObject\"\n].forEach(function(method) {\n Object.defineProperty(module.exports, method, {\n enumerable: false,\n value: function() {\n throw new Error(method + \" is not supported in userland\");\n }\n });\n});\n\n});\nparcelRegister(\"avzh7\", function(module, exports) {\n\"use strict\";\n\nvar $7a682982bd21c890$var$hasToStringTag = (parcelRequire(\"goA1T\"))();\n\nvar $3e3ab = parcelRequire(\"3e3ab\");\nvar $7a682982bd21c890$var$$toString = $3e3ab(\"Object.prototype.toString\");\nvar $7a682982bd21c890$var$isStandardArguments = function isArguments(value) {\n if ($7a682982bd21c890$var$hasToStringTag && value && typeof value === \"object\" && Symbol.toStringTag in value) return false;\n return $7a682982bd21c890$var$$toString(value) === \"[object Arguments]\";\n};\nvar $7a682982bd21c890$var$isLegacyArguments = function isArguments(value) {\n if ($7a682982bd21c890$var$isStandardArguments(value)) return true;\n return value !== null && typeof value === \"object\" && typeof value.length === \"number\" && value.length >= 0 && $7a682982bd21c890$var$$toString(value) !== \"[object Array]\" && $7a682982bd21c890$var$$toString(value.callee) === \"[object Function]\";\n};\nvar $7a682982bd21c890$var$supportsStandardArguments = function() {\n return $7a682982bd21c890$var$isStandardArguments(arguments);\n}();\n$7a682982bd21c890$var$isStandardArguments.isLegacyArguments = $7a682982bd21c890$var$isLegacyArguments; // for tests\nmodule.exports = $7a682982bd21c890$var$supportsStandardArguments ? $7a682982bd21c890$var$isStandardArguments : $7a682982bd21c890$var$isLegacyArguments;\n\n});\nparcelRegister(\"goA1T\", function(module, exports) {\n\"use strict\";\n\nvar $grYrm = parcelRequire(\"grYrm\");\nmodule.exports = function hasToStringTagShams() {\n return $grYrm() && !!Symbol.toStringTag;\n};\n\n});\nparcelRegister(\"grYrm\", function(module, exports) {\n\"use strict\";\n/* eslint complexity: [2, 18], max-statements: [2, 33] */ module.exports = function hasSymbols() {\n if (typeof Symbol !== \"function\" || typeof Object.getOwnPropertySymbols !== \"function\") return false;\n if (typeof Symbol.iterator === \"symbol\") return true;\n var obj = {};\n var sym = Symbol(\"test\");\n var symObj = Object(sym);\n if (typeof sym === \"string\") return false;\n if (Object.prototype.toString.call(sym) !== \"[object Symbol]\") return false;\n if (Object.prototype.toString.call(symObj) !== \"[object Symbol]\") return false;\n // temp disabled per https://github.com/ljharb/object.assign/issues/17\n // if (sym instanceof Symbol) { return false; }\n // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n // if (!(symObj instanceof Symbol)) { return false; }\n // if (typeof Symbol.prototype.toString !== 'function') { return false; }\n // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n var symVal = 42;\n obj[sym] = symVal;\n for(sym in obj)return false;\n // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n if (typeof Object.keys === \"function\" && Object.keys(obj).length !== 0) return false;\n if (typeof Object.getOwnPropertyNames === \"function\" && Object.getOwnPropertyNames(obj).length !== 0) return false;\n var syms = Object.getOwnPropertySymbols(obj);\n if (syms.length !== 1 || syms[0] !== sym) return false;\n if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) return false;\n if (typeof Object.getOwnPropertyDescriptor === \"function\") {\n var descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n if (descriptor.value !== symVal || descriptor.enumerable !== true) return false;\n }\n return true;\n};\n\n});\n\n\nparcelRegister(\"3e3ab\", function(module, exports) {\n\"use strict\";\n\nvar $2VTxt = parcelRequire(\"2VTxt\");\n\nvar $70X2U = parcelRequire(\"70X2U\");\nvar $2595220fe67fde3d$var$$indexOf = $70X2U($2VTxt(\"String.prototype.indexOf\"));\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n var intrinsic = $2VTxt(name, !!allowMissing);\n if (typeof intrinsic === \"function\" && $2595220fe67fde3d$var$$indexOf(name, \".prototype.\") > -1) return $70X2U(intrinsic);\n return intrinsic;\n};\n\n});\nparcelRegister(\"2VTxt\", function(module, exports) {\n\"use strict\";\nvar $222bfc848c4c2d20$var$undefined1;\nvar $222bfc848c4c2d20$var$$SyntaxError = SyntaxError;\nvar $222bfc848c4c2d20$var$$Function = Function;\nvar $222bfc848c4c2d20$var$$TypeError = TypeError;\n// eslint-disable-next-line consistent-return\nvar $222bfc848c4c2d20$var$getEvalledConstructor = function(expressionSyntax) {\n try {\n return $222bfc848c4c2d20$var$$Function('\"use strict\"; return (' + expressionSyntax + \").constructor;\")();\n } catch (e) {}\n};\nvar $222bfc848c4c2d20$var$$gOPD = Object.getOwnPropertyDescriptor;\nif ($222bfc848c4c2d20$var$$gOPD) try {\n $222bfc848c4c2d20$var$$gOPD({}, \"\");\n} catch (e) {\n $222bfc848c4c2d20$var$$gOPD = null; // this is IE 8, which has a broken gOPD\n}\nvar $222bfc848c4c2d20$var$throwTypeError = function() {\n throw new $222bfc848c4c2d20$var$$TypeError();\n};\nvar $222bfc848c4c2d20$var$ThrowTypeError = $222bfc848c4c2d20$var$$gOPD ? function() {\n try {\n // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n arguments.callee; // IE 8 does not throw here\n return $222bfc848c4c2d20$var$throwTypeError;\n } catch (calleeThrows) {\n try {\n // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n return $222bfc848c4c2d20$var$$gOPD(arguments, \"callee\").get;\n } catch (gOPDthrows) {\n return $222bfc848c4c2d20$var$throwTypeError;\n }\n }\n}() : $222bfc848c4c2d20$var$throwTypeError;\n\nvar $222bfc848c4c2d20$var$hasSymbols = (parcelRequire(\"dk94G\"))();\n\nvar $222bfc848c4c2d20$var$hasProto = (parcelRequire(\"2GNOT\"))();\nvar $222bfc848c4c2d20$var$getProto = Object.getPrototypeOf || ($222bfc848c4c2d20$var$hasProto ? function(x) {\n return x.__proto__;\n} // eslint-disable-line no-proto\n : null);\nvar $222bfc848c4c2d20$var$needsEval = {};\nvar $222bfc848c4c2d20$var$TypedArray = typeof Uint8Array === \"undefined\" || !$222bfc848c4c2d20$var$getProto ? undefined : $222bfc848c4c2d20$var$getProto(Uint8Array);\nvar $222bfc848c4c2d20$var$INTRINSICS = {\n \"%AggregateError%\": typeof AggregateError === \"undefined\" ? undefined : AggregateError,\n \"%Array%\": Array,\n \"%ArrayBuffer%\": typeof ArrayBuffer === \"undefined\" ? undefined : ArrayBuffer,\n \"%ArrayIteratorPrototype%\": $222bfc848c4c2d20$var$hasSymbols && $222bfc848c4c2d20$var$getProto ? $222bfc848c4c2d20$var$getProto([][Symbol.iterator]()) : undefined,\n \"%AsyncFromSyncIteratorPrototype%\": undefined,\n \"%AsyncFunction%\": $222bfc848c4c2d20$var$needsEval,\n \"%AsyncGenerator%\": $222bfc848c4c2d20$var$needsEval,\n \"%AsyncGeneratorFunction%\": $222bfc848c4c2d20$var$needsEval,\n \"%AsyncIteratorPrototype%\": $222bfc848c4c2d20$var$needsEval,\n \"%Atomics%\": typeof Atomics === \"undefined\" ? undefined : Atomics,\n \"%BigInt%\": typeof BigInt === \"undefined\" ? undefined : BigInt,\n \"%BigInt64Array%\": typeof BigInt64Array === \"undefined\" ? undefined : BigInt64Array,\n \"%BigUint64Array%\": typeof BigUint64Array === \"undefined\" ? undefined : BigUint64Array,\n \"%Boolean%\": Boolean,\n \"%DataView%\": typeof DataView === \"undefined\" ? undefined : DataView,\n \"%Date%\": Date,\n \"%decodeURI%\": decodeURI,\n \"%decodeURIComponent%\": decodeURIComponent,\n \"%encodeURI%\": encodeURI,\n \"%encodeURIComponent%\": encodeURIComponent,\n \"%Error%\": Error,\n \"%eval%\": eval,\n \"%EvalError%\": EvalError,\n \"%Float32Array%\": typeof Float32Array === \"undefined\" ? undefined : Float32Array,\n \"%Float64Array%\": typeof Float64Array === \"undefined\" ? undefined : Float64Array,\n \"%FinalizationRegistry%\": typeof FinalizationRegistry === \"undefined\" ? undefined : FinalizationRegistry,\n \"%Function%\": $222bfc848c4c2d20$var$$Function,\n \"%GeneratorFunction%\": $222bfc848c4c2d20$var$needsEval,\n \"%Int8Array%\": typeof Int8Array === \"undefined\" ? undefined : Int8Array,\n \"%Int16Array%\": typeof Int16Array === \"undefined\" ? undefined : Int16Array,\n \"%Int32Array%\": typeof Int32Array === \"undefined\" ? undefined : Int32Array,\n \"%isFinite%\": isFinite,\n \"%isNaN%\": isNaN,\n \"%IteratorPrototype%\": $222bfc848c4c2d20$var$hasSymbols && $222bfc848c4c2d20$var$getProto ? $222bfc848c4c2d20$var$getProto($222bfc848c4c2d20$var$getProto([][Symbol.iterator]())) : undefined,\n \"%JSON%\": typeof JSON === \"object\" ? JSON : undefined,\n \"%Map%\": typeof Map === \"undefined\" ? undefined : Map,\n \"%MapIteratorPrototype%\": typeof Map === \"undefined\" || !$222bfc848c4c2d20$var$hasSymbols || !$222bfc848c4c2d20$var$getProto ? undefined : $222bfc848c4c2d20$var$getProto(new Map()[Symbol.iterator]()),\n \"%Math%\": Math,\n \"%Number%\": Number,\n \"%Object%\": Object,\n \"%parseFloat%\": parseFloat,\n \"%parseInt%\": parseInt,\n \"%Promise%\": typeof Promise === \"undefined\" ? undefined : Promise,\n \"%Proxy%\": typeof Proxy === \"undefined\" ? undefined : Proxy,\n \"%RangeError%\": RangeError,\n \"%ReferenceError%\": ReferenceError,\n \"%Reflect%\": typeof Reflect === \"undefined\" ? undefined : Reflect,\n \"%RegExp%\": RegExp,\n \"%Set%\": typeof Set === \"undefined\" ? undefined : Set,\n \"%SetIteratorPrototype%\": typeof Set === \"undefined\" || !$222bfc848c4c2d20$var$hasSymbols || !$222bfc848c4c2d20$var$getProto ? undefined : $222bfc848c4c2d20$var$getProto(new Set()[Symbol.iterator]()),\n \"%SharedArrayBuffer%\": typeof SharedArrayBuffer === \"undefined\" ? undefined : SharedArrayBuffer,\n \"%String%\": String,\n \"%StringIteratorPrototype%\": $222bfc848c4c2d20$var$hasSymbols && $222bfc848c4c2d20$var$getProto ? $222bfc848c4c2d20$var$getProto(\"\"[Symbol.iterator]()) : undefined,\n \"%Symbol%\": $222bfc848c4c2d20$var$hasSymbols ? Symbol : undefined,\n \"%SyntaxError%\": $222bfc848c4c2d20$var$$SyntaxError,\n \"%ThrowTypeError%\": $222bfc848c4c2d20$var$ThrowTypeError,\n \"%TypedArray%\": $222bfc848c4c2d20$var$TypedArray,\n \"%TypeError%\": $222bfc848c4c2d20$var$$TypeError,\n \"%Uint8Array%\": typeof Uint8Array === \"undefined\" ? undefined : Uint8Array,\n \"%Uint8ClampedArray%\": typeof Uint8ClampedArray === \"undefined\" ? undefined : Uint8ClampedArray,\n \"%Uint16Array%\": typeof Uint16Array === \"undefined\" ? undefined : Uint16Array,\n \"%Uint32Array%\": typeof Uint32Array === \"undefined\" ? undefined : Uint32Array,\n \"%URIError%\": URIError,\n \"%WeakMap%\": typeof WeakMap === \"undefined\" ? undefined : WeakMap,\n \"%WeakRef%\": typeof WeakRef === \"undefined\" ? undefined : WeakRef,\n \"%WeakSet%\": typeof WeakSet === \"undefined\" ? undefined : WeakSet\n};\nif ($222bfc848c4c2d20$var$getProto) try {\n null.error; // eslint-disable-line no-unused-expressions\n} catch (e) {\n // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n var $222bfc848c4c2d20$var$errorProto = $222bfc848c4c2d20$var$getProto($222bfc848c4c2d20$var$getProto(e));\n $222bfc848c4c2d20$var$INTRINSICS[\"%Error.prototype%\"] = $222bfc848c4c2d20$var$errorProto;\n}\nvar $222bfc848c4c2d20$var$doEval = function doEval(name) {\n var value;\n if (name === \"%AsyncFunction%\") value = $222bfc848c4c2d20$var$getEvalledConstructor(\"async function () {}\");\n else if (name === \"%GeneratorFunction%\") value = $222bfc848c4c2d20$var$getEvalledConstructor(\"function* () {}\");\n else if (name === \"%AsyncGeneratorFunction%\") value = $222bfc848c4c2d20$var$getEvalledConstructor(\"async function* () {}\");\n else if (name === \"%AsyncGenerator%\") {\n var fn = doEval(\"%AsyncGeneratorFunction%\");\n if (fn) value = fn.prototype;\n } else if (name === \"%AsyncIteratorPrototype%\") {\n var gen = doEval(\"%AsyncGenerator%\");\n if (gen && $222bfc848c4c2d20$var$getProto) value = $222bfc848c4c2d20$var$getProto(gen.prototype);\n }\n $222bfc848c4c2d20$var$INTRINSICS[name] = value;\n return value;\n};\nvar $222bfc848c4c2d20$var$LEGACY_ALIASES = {\n \"%ArrayBufferPrototype%\": [\n \"ArrayBuffer\",\n \"prototype\"\n ],\n \"%ArrayPrototype%\": [\n \"Array\",\n \"prototype\"\n ],\n \"%ArrayProto_entries%\": [\n \"Array\",\n \"prototype\",\n \"entries\"\n ],\n \"%ArrayProto_forEach%\": [\n \"Array\",\n \"prototype\",\n \"forEach\"\n ],\n \"%ArrayProto_keys%\": [\n \"Array\",\n \"prototype\",\n \"keys\"\n ],\n \"%ArrayProto_values%\": [\n \"Array\",\n \"prototype\",\n \"values\"\n ],\n \"%AsyncFunctionPrototype%\": [\n \"AsyncFunction\",\n \"prototype\"\n ],\n \"%AsyncGenerator%\": [\n \"AsyncGeneratorFunction\",\n \"prototype\"\n ],\n \"%AsyncGeneratorPrototype%\": [\n \"AsyncGeneratorFunction\",\n \"prototype\",\n \"prototype\"\n ],\n \"%BooleanPrototype%\": [\n \"Boolean\",\n \"prototype\"\n ],\n \"%DataViewPrototype%\": [\n \"DataView\",\n \"prototype\"\n ],\n \"%DatePrototype%\": [\n \"Date\",\n \"prototype\"\n ],\n \"%ErrorPrototype%\": [\n \"Error\",\n \"prototype\"\n ],\n \"%EvalErrorPrototype%\": [\n \"EvalError\",\n \"prototype\"\n ],\n \"%Float32ArrayPrototype%\": [\n \"Float32Array\",\n \"prototype\"\n ],\n \"%Float64ArrayPrototype%\": [\n \"Float64Array\",\n \"prototype\"\n ],\n \"%FunctionPrototype%\": [\n \"Function\",\n \"prototype\"\n ],\n \"%Generator%\": [\n \"GeneratorFunction\",\n \"prototype\"\n ],\n \"%GeneratorPrototype%\": [\n \"GeneratorFunction\",\n \"prototype\",\n \"prototype\"\n ],\n \"%Int8ArrayPrototype%\": [\n \"Int8Array\",\n \"prototype\"\n ],\n \"%Int16ArrayPrototype%\": [\n \"Int16Array\",\n \"prototype\"\n ],\n \"%Int32ArrayPrototype%\": [\n \"Int32Array\",\n \"prototype\"\n ],\n \"%JSONParse%\": [\n \"JSON\",\n \"parse\"\n ],\n \"%JSONStringify%\": [\n \"JSON\",\n \"stringify\"\n ],\n \"%MapPrototype%\": [\n \"Map\",\n \"prototype\"\n ],\n \"%NumberPrototype%\": [\n \"Number\",\n \"prototype\"\n ],\n \"%ObjectPrototype%\": [\n \"Object\",\n \"prototype\"\n ],\n \"%ObjProto_toString%\": [\n \"Object\",\n \"prototype\",\n \"toString\"\n ],\n \"%ObjProto_valueOf%\": [\n \"Object\",\n \"prototype\",\n \"valueOf\"\n ],\n \"%PromisePrototype%\": [\n \"Promise\",\n \"prototype\"\n ],\n \"%PromiseProto_then%\": [\n \"Promise\",\n \"prototype\",\n \"then\"\n ],\n \"%Promise_all%\": [\n \"Promise\",\n \"all\"\n ],\n \"%Promise_reject%\": [\n \"Promise\",\n \"reject\"\n ],\n \"%Promise_resolve%\": [\n \"Promise\",\n \"resolve\"\n ],\n \"%RangeErrorPrototype%\": [\n \"RangeError\",\n \"prototype\"\n ],\n \"%ReferenceErrorPrototype%\": [\n \"ReferenceError\",\n \"prototype\"\n ],\n \"%RegExpPrototype%\": [\n \"RegExp\",\n \"prototype\"\n ],\n \"%SetPrototype%\": [\n \"Set\",\n \"prototype\"\n ],\n \"%SharedArrayBufferPrototype%\": [\n \"SharedArrayBuffer\",\n \"prototype\"\n ],\n \"%StringPrototype%\": [\n \"String\",\n \"prototype\"\n ],\n \"%SymbolPrototype%\": [\n \"Symbol\",\n \"prototype\"\n ],\n \"%SyntaxErrorPrototype%\": [\n \"SyntaxError\",\n \"prototype\"\n ],\n \"%TypedArrayPrototype%\": [\n \"TypedArray\",\n \"prototype\"\n ],\n \"%TypeErrorPrototype%\": [\n \"TypeError\",\n \"prototype\"\n ],\n \"%Uint8ArrayPrototype%\": [\n \"Uint8Array\",\n \"prototype\"\n ],\n \"%Uint8ClampedArrayPrototype%\": [\n \"Uint8ClampedArray\",\n \"prototype\"\n ],\n \"%Uint16ArrayPrototype%\": [\n \"Uint16Array\",\n \"prototype\"\n ],\n \"%Uint32ArrayPrototype%\": [\n \"Uint32Array\",\n \"prototype\"\n ],\n \"%URIErrorPrototype%\": [\n \"URIError\",\n \"prototype\"\n ],\n \"%WeakMapPrototype%\": [\n \"WeakMap\",\n \"prototype\"\n ],\n \"%WeakSetPrototype%\": [\n \"WeakSet\",\n \"prototype\"\n ]\n};\n\nvar $l7UhJ = parcelRequire(\"l7UhJ\");\n\nvar $G9Faa = parcelRequire(\"G9Faa\");\nvar $222bfc848c4c2d20$var$$concat = $l7UhJ.call(Function.call, Array.prototype.concat);\nvar $222bfc848c4c2d20$var$$spliceApply = $l7UhJ.call(Function.apply, Array.prototype.splice);\nvar $222bfc848c4c2d20$var$$replace = $l7UhJ.call(Function.call, String.prototype.replace);\nvar $222bfc848c4c2d20$var$$strSlice = $l7UhJ.call(Function.call, String.prototype.slice);\nvar $222bfc848c4c2d20$var$$exec = $l7UhJ.call(Function.call, RegExp.prototype.exec);\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var $222bfc848c4c2d20$var$rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar $222bfc848c4c2d20$var$reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */ \nvar $222bfc848c4c2d20$var$stringToPath = function stringToPath(string) {\n var first = $222bfc848c4c2d20$var$$strSlice(string, 0, 1);\n var last = $222bfc848c4c2d20$var$$strSlice(string, -1);\n if (first === \"%\" && last !== \"%\") throw new $222bfc848c4c2d20$var$$SyntaxError(\"invalid intrinsic syntax, expected closing `%`\");\n else if (last === \"%\" && first !== \"%\") throw new $222bfc848c4c2d20$var$$SyntaxError(\"invalid intrinsic syntax, expected opening `%`\");\n var result = [];\n $222bfc848c4c2d20$var$$replace(string, $222bfc848c4c2d20$var$rePropName, function(match, number, quote, subString) {\n result[result.length] = quote ? $222bfc848c4c2d20$var$$replace(subString, $222bfc848c4c2d20$var$reEscapeChar, \"$1\") : number || match;\n });\n return result;\n};\n/* end adaptation */ var $222bfc848c4c2d20$var$getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n var intrinsicName = name;\n var alias;\n if ($G9Faa($222bfc848c4c2d20$var$LEGACY_ALIASES, intrinsicName)) {\n alias = $222bfc848c4c2d20$var$LEGACY_ALIASES[intrinsicName];\n intrinsicName = \"%\" + alias[0] + \"%\";\n }\n if ($G9Faa($222bfc848c4c2d20$var$INTRINSICS, intrinsicName)) {\n var value = $222bfc848c4c2d20$var$INTRINSICS[intrinsicName];\n if (value === $222bfc848c4c2d20$var$needsEval) value = $222bfc848c4c2d20$var$doEval(intrinsicName);\n if (typeof value === \"undefined\" && !allowMissing) throw new $222bfc848c4c2d20$var$$TypeError(\"intrinsic \" + name + \" exists, but is not available. Please file an issue!\");\n return {\n alias: alias,\n name: intrinsicName,\n value: value\n };\n }\n throw new $222bfc848c4c2d20$var$$SyntaxError(\"intrinsic \" + name + \" does not exist!\");\n};\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n if (typeof name !== \"string\" || name.length === 0) throw new $222bfc848c4c2d20$var$$TypeError(\"intrinsic name must be a non-empty string\");\n if (arguments.length > 1 && typeof allowMissing !== \"boolean\") throw new $222bfc848c4c2d20$var$$TypeError('\"allowMissing\" argument must be a boolean');\n if ($222bfc848c4c2d20$var$$exec(/^%?[^%]*%?$/, name) === null) throw new $222bfc848c4c2d20$var$$SyntaxError(\"`%` may not be present anywhere but at the beginning and end of the intrinsic name\");\n var parts = $222bfc848c4c2d20$var$stringToPath(name);\n var intrinsicBaseName = parts.length > 0 ? parts[0] : \"\";\n var intrinsic = $222bfc848c4c2d20$var$getBaseIntrinsic(\"%\" + intrinsicBaseName + \"%\", allowMissing);\n var intrinsicRealName = intrinsic.name;\n var value = intrinsic.value;\n var skipFurtherCaching = false;\n var alias = intrinsic.alias;\n if (alias) {\n intrinsicBaseName = alias[0];\n $222bfc848c4c2d20$var$$spliceApply(parts, $222bfc848c4c2d20$var$$concat([\n 0,\n 1\n ], alias));\n }\n for(var i = 1, isOwn = true; i < parts.length; i += 1){\n var part = parts[i];\n var first = $222bfc848c4c2d20$var$$strSlice(part, 0, 1);\n var last = $222bfc848c4c2d20$var$$strSlice(part, -1);\n if ((first === '\"' || first === \"'\" || first === \"`\" || last === '\"' || last === \"'\" || last === \"`\") && first !== last) throw new $222bfc848c4c2d20$var$$SyntaxError(\"property names with quotes must have matching quotes\");\n if (part === \"constructor\" || !isOwn) skipFurtherCaching = true;\n intrinsicBaseName += \".\" + part;\n intrinsicRealName = \"%\" + intrinsicBaseName + \"%\";\n if ($G9Faa($222bfc848c4c2d20$var$INTRINSICS, intrinsicRealName)) value = $222bfc848c4c2d20$var$INTRINSICS[intrinsicRealName];\n else if (value != null) {\n if (!(part in value)) {\n if (!allowMissing) throw new $222bfc848c4c2d20$var$$TypeError(\"base intrinsic for \" + name + \" exists, but the property is not available.\");\n return void 0;\n }\n if ($222bfc848c4c2d20$var$$gOPD && i + 1 >= parts.length) {\n var desc = $222bfc848c4c2d20$var$$gOPD(value, part);\n isOwn = !!desc;\n // By convention, when a data property is converted to an accessor\n // property to emulate a data property that does not suffer from\n // the override mistake, that accessor's getter is marked with\n // an `originalValue` property. Here, when we detect this, we\n // uphold the illusion by pretending to see that original data\n // property, i.e., returning the value rather than the getter\n // itself.\n if (isOwn && \"get\" in desc && !(\"originalValue\" in desc.get)) value = desc.get;\n else value = value[part];\n } else {\n isOwn = $G9Faa(value, part);\n value = value[part];\n }\n if (isOwn && !skipFurtherCaching) $222bfc848c4c2d20$var$INTRINSICS[intrinsicRealName] = value;\n }\n }\n return value;\n};\n\n});\nparcelRegister(\"dk94G\", function(module, exports) {\n\"use strict\";\nvar $9b342ea1c5e1f709$var$origSymbol = typeof Symbol !== \"undefined\" && Symbol;\n\nvar $grYrm = parcelRequire(\"grYrm\");\nmodule.exports = function hasNativeSymbols() {\n if (typeof $9b342ea1c5e1f709$var$origSymbol !== \"function\") return false;\n if (typeof Symbol !== \"function\") return false;\n if (typeof $9b342ea1c5e1f709$var$origSymbol(\"foo\") !== \"symbol\") return false;\n if (typeof Symbol(\"bar\") !== \"symbol\") return false;\n return $grYrm();\n};\n\n});\n\nparcelRegister(\"2GNOT\", function(module, exports) {\n\"use strict\";\nvar $1f56262e97e17693$var$test = {\n foo: {}\n};\nvar $1f56262e97e17693$var$$Object = Object;\nmodule.exports = function hasProto() {\n return ({\n __proto__: $1f56262e97e17693$var$test\n }).foo === $1f56262e97e17693$var$test.foo && !(({\n __proto__: null\n }) instanceof $1f56262e97e17693$var$$Object);\n};\n\n});\n\nparcelRegister(\"l7UhJ\", function(module, exports) {\n\"use strict\";\n\nvar $6LzS1 = parcelRequire(\"6LzS1\");\nmodule.exports = Function.prototype.bind || $6LzS1;\n\n});\nparcelRegister(\"6LzS1\", function(module, exports) {\n\"use strict\";\n/* eslint no-invalid-this: 1 */ var $4ed2f4f644981d90$var$ERROR_MESSAGE = \"Function.prototype.bind called on incompatible \";\nvar $4ed2f4f644981d90$var$toStr = Object.prototype.toString;\nvar $4ed2f4f644981d90$var$max = Math.max;\nvar $4ed2f4f644981d90$var$funcType = \"[object Function]\";\nvar $4ed2f4f644981d90$var$concatty = function concatty(a, b) {\n var arr = [];\n for(var i = 0; i < a.length; i += 1)arr[i] = a[i];\n for(var j = 0; j < b.length; j += 1)arr[j + a.length] = b[j];\n return arr;\n};\nvar $4ed2f4f644981d90$var$slicy = function slicy(arrLike, offset) {\n var arr = [];\n for(var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1)arr[j] = arrLike[i];\n return arr;\n};\nvar $4ed2f4f644981d90$var$joiny = function(arr, joiner) {\n var str = \"\";\n for(var i = 0; i < arr.length; i += 1){\n str += arr[i];\n if (i + 1 < arr.length) str += joiner;\n }\n return str;\n};\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== \"function\" || $4ed2f4f644981d90$var$toStr.apply(target) !== $4ed2f4f644981d90$var$funcType) throw new TypeError($4ed2f4f644981d90$var$ERROR_MESSAGE + target);\n var args = $4ed2f4f644981d90$var$slicy(arguments, 1);\n var bound;\n var binder = function() {\n if (this instanceof bound) {\n var result = target.apply(this, $4ed2f4f644981d90$var$concatty(args, arguments));\n if (Object(result) === result) return result;\n return this;\n }\n return target.apply(that, $4ed2f4f644981d90$var$concatty(args, arguments));\n };\n var boundLength = $4ed2f4f644981d90$var$max(0, target.length - args.length);\n var boundArgs = [];\n for(var i = 0; i < boundLength; i++)boundArgs[i] = \"$\" + i;\n bound = Function(\"binder\", \"return function (\" + $4ed2f4f644981d90$var$joiny(boundArgs, \",\") + \"){ return binder.apply(this,arguments); }\")(binder);\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n return bound;\n};\n\n});\n\n\nparcelRegister(\"G9Faa\", function(module, exports) {\n\"use strict\";\nvar $07eb6b366f8e40b5$var$call = Function.prototype.call;\nvar $07eb6b366f8e40b5$var$$hasOwn = Object.prototype.hasOwnProperty;\n\nvar $l7UhJ = parcelRequire(\"l7UhJ\");\n/** @type {(o: {}, p: PropertyKey) => p is keyof o} */ module.exports = $l7UhJ.call($07eb6b366f8e40b5$var$call, $07eb6b366f8e40b5$var$$hasOwn);\n\n});\n\n\nparcelRegister(\"70X2U\", function(module, exports) {\n\"use strict\";\n\nvar $l7UhJ = parcelRequire(\"l7UhJ\");\n\nvar $2VTxt = parcelRequire(\"2VTxt\");\n\nvar $5A9i6 = parcelRequire(\"5A9i6\");\nvar $0151647adf448d23$var$$TypeError = $2VTxt(\"%TypeError%\");\nvar $0151647adf448d23$var$$apply = $2VTxt(\"%Function.prototype.apply%\");\nvar $0151647adf448d23$var$$call = $2VTxt(\"%Function.prototype.call%\");\nvar $0151647adf448d23$var$$reflectApply = $2VTxt(\"%Reflect.apply%\", true) || $l7UhJ.call($0151647adf448d23$var$$call, $0151647adf448d23$var$$apply);\nvar $0151647adf448d23$var$$defineProperty = $2VTxt(\"%Object.defineProperty%\", true);\nvar $0151647adf448d23$var$$max = $2VTxt(\"%Math.max%\");\nif ($0151647adf448d23$var$$defineProperty) try {\n $0151647adf448d23$var$$defineProperty({}, \"a\", {\n value: 1\n });\n} catch (e) {\n // IE 8 has a broken defineProperty\n $0151647adf448d23$var$$defineProperty = null;\n}\nmodule.exports = function callBind(originalFunction) {\n if (typeof originalFunction !== \"function\") throw new $0151647adf448d23$var$$TypeError(\"a function is required\");\n var func = $0151647adf448d23$var$$reflectApply($l7UhJ, $0151647adf448d23$var$$call, arguments);\n return $5A9i6(func, 1 + $0151647adf448d23$var$$max(0, originalFunction.length - (arguments.length - 1)), true);\n};\nvar $0151647adf448d23$var$applyBind = function applyBind() {\n return $0151647adf448d23$var$$reflectApply($l7UhJ, $0151647adf448d23$var$$apply, arguments);\n};\nif ($0151647adf448d23$var$$defineProperty) $0151647adf448d23$var$$defineProperty(module.exports, \"apply\", {\n value: $0151647adf448d23$var$applyBind\n});\nelse module.exports.apply = $0151647adf448d23$var$applyBind;\n\n});\nparcelRegister(\"5A9i6\", function(module, exports) {\n\"use strict\";\n\nvar $2VTxt = parcelRequire(\"2VTxt\");\n\nvar $eHoge = parcelRequire(\"eHoge\");\n\nvar $4107858ba1a6bd6b$var$hasDescriptors = (parcelRequire(\"gkTZB\"))();\n\nvar $do5eO = parcelRequire(\"do5eO\");\nvar $4107858ba1a6bd6b$var$$TypeError = $2VTxt(\"%TypeError%\");\nvar $4107858ba1a6bd6b$var$$floor = $2VTxt(\"%Math.floor%\");\nmodule.exports = function setFunctionLength(fn, length) {\n if (typeof fn !== \"function\") throw new $4107858ba1a6bd6b$var$$TypeError(\"`fn` is not a function\");\n if (typeof length !== \"number\" || length < 0 || length > 0xFFFFFFFF || $4107858ba1a6bd6b$var$$floor(length) !== length) throw new $4107858ba1a6bd6b$var$$TypeError(\"`length` must be a positive 32-bit integer\");\n var loose = arguments.length > 2 && !!arguments[2];\n var functionLengthIsConfigurable = true;\n var functionLengthIsWritable = true;\n if (\"length\" in fn && $do5eO) {\n var desc = $do5eO(fn, \"length\");\n if (desc && !desc.configurable) functionLengthIsConfigurable = false;\n if (desc && !desc.writable) functionLengthIsWritable = false;\n }\n if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n if ($4107858ba1a6bd6b$var$hasDescriptors) $eHoge(fn, \"length\", length, true, true);\n else $eHoge(fn, \"length\", length);\n }\n return fn;\n};\n\n});\nparcelRegister(\"eHoge\", function(module, exports) {\n\"use strict\";\n\nvar $ab37e68af3e9e6be$var$hasPropertyDescriptors = (parcelRequire(\"gkTZB\"))();\n\nvar $2VTxt = parcelRequire(\"2VTxt\");\nvar $ab37e68af3e9e6be$var$$defineProperty = $ab37e68af3e9e6be$var$hasPropertyDescriptors && $2VTxt(\"%Object.defineProperty%\", true);\nif ($ab37e68af3e9e6be$var$$defineProperty) try {\n $ab37e68af3e9e6be$var$$defineProperty({}, \"a\", {\n value: 1\n });\n} catch (e) {\n // IE 8 has a broken defineProperty\n $ab37e68af3e9e6be$var$$defineProperty = false;\n}\nvar $ab37e68af3e9e6be$var$$SyntaxError = $2VTxt(\"%SyntaxError%\");\nvar $ab37e68af3e9e6be$var$$TypeError = $2VTxt(\"%TypeError%\");\n\nvar $do5eO = parcelRequire(\"do5eO\");\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */ module.exports = function defineDataProperty(obj, property, value) {\n if (!obj || typeof obj !== \"object\" && typeof obj !== \"function\") throw new $ab37e68af3e9e6be$var$$TypeError(\"`obj` must be an object or a function`\");\n if (typeof property !== \"string\" && typeof property !== \"symbol\") throw new $ab37e68af3e9e6be$var$$TypeError(\"`property` must be a string or a symbol`\");\n if (arguments.length > 3 && typeof arguments[3] !== \"boolean\" && arguments[3] !== null) throw new $ab37e68af3e9e6be$var$$TypeError(\"`nonEnumerable`, if provided, must be a boolean or null\");\n if (arguments.length > 4 && typeof arguments[4] !== \"boolean\" && arguments[4] !== null) throw new $ab37e68af3e9e6be$var$$TypeError(\"`nonWritable`, if provided, must be a boolean or null\");\n if (arguments.length > 5 && typeof arguments[5] !== \"boolean\" && arguments[5] !== null) throw new $ab37e68af3e9e6be$var$$TypeError(\"`nonConfigurable`, if provided, must be a boolean or null\");\n if (arguments.length > 6 && typeof arguments[6] !== \"boolean\") throw new $ab37e68af3e9e6be$var$$TypeError(\"`loose`, if provided, must be a boolean\");\n var nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n var nonWritable = arguments.length > 4 ? arguments[4] : null;\n var nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n var loose = arguments.length > 6 ? arguments[6] : false;\n /* @type {false | TypedPropertyDescriptor} */ var desc = !!$do5eO && $do5eO(obj, property);\n if ($ab37e68af3e9e6be$var$$defineProperty) $ab37e68af3e9e6be$var$$defineProperty(obj, property, {\n configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n value: value,\n writable: nonWritable === null && desc ? desc.writable : !nonWritable\n });\n else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n obj[property] = value; // eslint-disable-line no-param-reassign\n else throw new $ab37e68af3e9e6be$var$$SyntaxError(\"This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.\");\n};\n\n});\nparcelRegister(\"gkTZB\", function(module, exports) {\n\"use strict\";\n\nvar $2VTxt = parcelRequire(\"2VTxt\");\nvar $be49f289de13b757$var$$defineProperty = $2VTxt(\"%Object.defineProperty%\", true);\nvar $be49f289de13b757$var$hasPropertyDescriptors = function hasPropertyDescriptors() {\n if ($be49f289de13b757$var$$defineProperty) try {\n $be49f289de13b757$var$$defineProperty({}, \"a\", {\n value: 1\n });\n return true;\n } catch (e) {\n // IE 8 has a broken defineProperty\n return false;\n }\n return false;\n};\n$be49f289de13b757$var$hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n // node v0.6 has a bug where array lengths can be Set but not Defined\n if (!$be49f289de13b757$var$hasPropertyDescriptors()) return null;\n try {\n return $be49f289de13b757$var$$defineProperty([], \"length\", {\n value: 1\n }).length !== 1;\n } catch (e) {\n // In Firefox 4-22, defining length on an array throws an exception.\n return true;\n }\n};\nmodule.exports = $be49f289de13b757$var$hasPropertyDescriptors;\n\n});\n\nparcelRegister(\"do5eO\", function(module, exports) {\n\"use strict\";\n\nvar $2VTxt = parcelRequire(\"2VTxt\");\nvar $9bf19466cddb0914$var$$gOPD = $2VTxt(\"%Object.getOwnPropertyDescriptor%\", true);\nif ($9bf19466cddb0914$var$$gOPD) try {\n $9bf19466cddb0914$var$$gOPD([], \"length\");\n} catch (e) {\n // IE 8 has a broken gOPD\n $9bf19466cddb0914$var$$gOPD = null;\n}\nmodule.exports = $9bf19466cddb0914$var$$gOPD;\n\n});\n\n\n\n\n\n\nparcelRegister(\"9mPZQ\", function(module, exports) {\n\"use strict\";\nvar $6d1e808f9d1ac98b$var$toStr = Object.prototype.toString;\nvar $6d1e808f9d1ac98b$var$fnToStr = Function.prototype.toString;\nvar $6d1e808f9d1ac98b$var$isFnRegex = /^\\s*(?:function)?\\*/;\n\nvar $6d1e808f9d1ac98b$var$hasToStringTag = (parcelRequire(\"goA1T\"))();\nvar $6d1e808f9d1ac98b$var$getProto = Object.getPrototypeOf;\nvar $6d1e808f9d1ac98b$var$getGeneratorFunc = function() {\n if (!$6d1e808f9d1ac98b$var$hasToStringTag) return false;\n try {\n return Function(\"return function*() {}\")();\n } catch (e) {}\n};\nvar $6d1e808f9d1ac98b$var$GeneratorFunction;\nmodule.exports = function isGeneratorFunction(fn) {\n if (typeof fn !== \"function\") return false;\n if ($6d1e808f9d1ac98b$var$isFnRegex.test($6d1e808f9d1ac98b$var$fnToStr.call(fn))) return true;\n if (!$6d1e808f9d1ac98b$var$hasToStringTag) {\n var str = $6d1e808f9d1ac98b$var$toStr.call(fn);\n return str === \"[object GeneratorFunction]\";\n }\n if (!$6d1e808f9d1ac98b$var$getProto) return false;\n if (typeof $6d1e808f9d1ac98b$var$GeneratorFunction === \"undefined\") {\n var generatorFunc = $6d1e808f9d1ac98b$var$getGeneratorFunc();\n $6d1e808f9d1ac98b$var$GeneratorFunction = generatorFunc ? $6d1e808f9d1ac98b$var$getProto(generatorFunc) : false;\n }\n return $6d1e808f9d1ac98b$var$getProto(fn) === $6d1e808f9d1ac98b$var$GeneratorFunction;\n};\n\n});\n\nparcelRegister(\"6Sxxf\", function(module, exports) {\n\"use strict\";\n\nvar $98Y2N = parcelRequire(\"98Y2N\");\n\nvar $fHmwU = parcelRequire(\"fHmwU\");\n\nvar $70X2U = parcelRequire(\"70X2U\");\n\nvar $3e3ab = parcelRequire(\"3e3ab\");\n\nvar $do5eO = parcelRequire(\"do5eO\");\nvar $5021cc9e64bc53c4$var$$toString = $3e3ab(\"Object.prototype.toString\");\n\nvar $5021cc9e64bc53c4$var$hasToStringTag = (parcelRequire(\"goA1T\"))();\nvar $5021cc9e64bc53c4$var$g = typeof globalThis === \"undefined\" ? $parcel$global : globalThis;\nvar $5021cc9e64bc53c4$var$typedArrays = $fHmwU();\nvar $5021cc9e64bc53c4$var$$slice = $3e3ab(\"String.prototype.slice\");\nvar $5021cc9e64bc53c4$var$getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\nvar $5021cc9e64bc53c4$var$$indexOf = $3e3ab(\"Array.prototype.indexOf\", true) || function indexOf(array, value) {\n for(var i = 0; i < array.length; i += 1){\n if (array[i] === value) return i;\n }\n return -1;\n};\nvar $5021cc9e64bc53c4$var$cache = {\n __proto__: null\n};\nif ($5021cc9e64bc53c4$var$hasToStringTag && $do5eO && $5021cc9e64bc53c4$var$getPrototypeOf) $98Y2N($5021cc9e64bc53c4$var$typedArrays, function(typedArray) {\n var arr = new $5021cc9e64bc53c4$var$g[typedArray]();\n if (Symbol.toStringTag in arr) {\n var proto = $5021cc9e64bc53c4$var$getPrototypeOf(arr);\n var descriptor = $do5eO(proto, Symbol.toStringTag);\n if (!descriptor) {\n var superProto = $5021cc9e64bc53c4$var$getPrototypeOf(proto);\n descriptor = $do5eO(superProto, Symbol.toStringTag);\n }\n $5021cc9e64bc53c4$var$cache[\"$\" + typedArray] = $70X2U(descriptor.get);\n }\n});\nelse $98Y2N($5021cc9e64bc53c4$var$typedArrays, function(typedArray) {\n var arr = new $5021cc9e64bc53c4$var$g[typedArray]();\n var fn = arr.slice || arr.set;\n if (fn) $5021cc9e64bc53c4$var$cache[\"$\" + typedArray] = $70X2U(fn);\n});\nvar $5021cc9e64bc53c4$var$tryTypedArrays = function tryAllTypedArrays(value) {\n var found = false;\n $98Y2N($5021cc9e64bc53c4$var$cache, function(getter, typedArray) {\n if (!found) try {\n if (\"$\" + getter(value) === typedArray) found = $5021cc9e64bc53c4$var$$slice(typedArray, 1);\n } catch (e) {}\n });\n return found;\n};\nvar $5021cc9e64bc53c4$var$trySlices = function tryAllSlices(value) {\n var found = false;\n $98Y2N($5021cc9e64bc53c4$var$cache, function(getter, name) {\n if (!found) try {\n getter(value);\n found = $5021cc9e64bc53c4$var$$slice(name, 1);\n } catch (e) {}\n });\n return found;\n};\nmodule.exports = function whichTypedArray(value) {\n if (!value || typeof value !== \"object\") return false;\n if (!$5021cc9e64bc53c4$var$hasToStringTag) {\n var tag = $5021cc9e64bc53c4$var$$slice($5021cc9e64bc53c4$var$$toString(value), 8, -1);\n if ($5021cc9e64bc53c4$var$$indexOf($5021cc9e64bc53c4$var$typedArrays, tag) > -1) return tag;\n if (tag !== \"Object\") return false;\n // node < 0.6 hits here on real Typed Arrays\n return $5021cc9e64bc53c4$var$trySlices(value);\n }\n if (!$do5eO) return null;\n // unknown engine\n return $5021cc9e64bc53c4$var$tryTypedArrays(value);\n};\n\n});\nparcelRegister(\"98Y2N\", function(module, exports) {\n\"use strict\";\n\nvar $d13gJ = parcelRequire(\"d13gJ\");\nvar $6a836ff0bde6ce0d$var$toStr = Object.prototype.toString;\nvar $6a836ff0bde6ce0d$var$hasOwnProperty = Object.prototype.hasOwnProperty;\nvar $6a836ff0bde6ce0d$var$forEachArray = function forEachArray(array, iterator, receiver) {\n for(var i = 0, len = array.length; i < len; i++)if ($6a836ff0bde6ce0d$var$hasOwnProperty.call(array, i)) {\n if (receiver == null) iterator(array[i], i, array);\n else iterator.call(receiver, array[i], i, array);\n }\n};\nvar $6a836ff0bde6ce0d$var$forEachString = function forEachString(string, iterator, receiver) {\n for(var i = 0, len = string.length; i < len; i++)// no such thing as a sparse string.\n if (receiver == null) iterator(string.charAt(i), i, string);\n else iterator.call(receiver, string.charAt(i), i, string);\n};\nvar $6a836ff0bde6ce0d$var$forEachObject = function forEachObject(object, iterator, receiver) {\n for(var k in object)if ($6a836ff0bde6ce0d$var$hasOwnProperty.call(object, k)) {\n if (receiver == null) iterator(object[k], k, object);\n else iterator.call(receiver, object[k], k, object);\n }\n};\nvar $6a836ff0bde6ce0d$var$forEach = function forEach(list, iterator, thisArg) {\n if (!$d13gJ(iterator)) throw new TypeError(\"iterator must be a function\");\n var receiver;\n if (arguments.length >= 3) receiver = thisArg;\n if ($6a836ff0bde6ce0d$var$toStr.call(list) === \"[object Array]\") $6a836ff0bde6ce0d$var$forEachArray(list, iterator, receiver);\n else if (typeof list === \"string\") $6a836ff0bde6ce0d$var$forEachString(list, iterator, receiver);\n else $6a836ff0bde6ce0d$var$forEachObject(list, iterator, receiver);\n};\nmodule.exports = $6a836ff0bde6ce0d$var$forEach;\n\n});\nparcelRegister(\"d13gJ\", function(module, exports) {\n\"use strict\";\nvar $979de77de5cc0a8e$var$fnToStr = Function.prototype.toString;\nvar $979de77de5cc0a8e$var$reflectApply = typeof Reflect === \"object\" && Reflect !== null && Reflect.apply;\nvar $979de77de5cc0a8e$var$badArrayLike;\nvar $979de77de5cc0a8e$var$isCallableMarker;\nif (typeof $979de77de5cc0a8e$var$reflectApply === \"function\" && typeof Object.defineProperty === \"function\") try {\n $979de77de5cc0a8e$var$badArrayLike = Object.defineProperty({}, \"length\", {\n get: function() {\n throw $979de77de5cc0a8e$var$isCallableMarker;\n }\n });\n $979de77de5cc0a8e$var$isCallableMarker = {};\n // eslint-disable-next-line no-throw-literal\n $979de77de5cc0a8e$var$reflectApply(function() {\n throw 42;\n }, null, $979de77de5cc0a8e$var$badArrayLike);\n} catch (_) {\n if (_ !== $979de77de5cc0a8e$var$isCallableMarker) $979de77de5cc0a8e$var$reflectApply = null;\n}\nelse $979de77de5cc0a8e$var$reflectApply = null;\nvar $979de77de5cc0a8e$var$constructorRegex = /^\\s*class\\b/;\nvar $979de77de5cc0a8e$var$isES6ClassFn = function isES6ClassFunction(value) {\n try {\n var fnStr = $979de77de5cc0a8e$var$fnToStr.call(value);\n return $979de77de5cc0a8e$var$constructorRegex.test(fnStr);\n } catch (e) {\n return false; // not a function\n }\n};\nvar $979de77de5cc0a8e$var$tryFunctionObject = function tryFunctionToStr(value) {\n try {\n if ($979de77de5cc0a8e$var$isES6ClassFn(value)) return false;\n $979de77de5cc0a8e$var$fnToStr.call(value);\n return true;\n } catch (e) {\n return false;\n }\n};\nvar $979de77de5cc0a8e$var$toStr = Object.prototype.toString;\nvar $979de77de5cc0a8e$var$objectClass = \"[object Object]\";\nvar $979de77de5cc0a8e$var$fnClass = \"[object Function]\";\nvar $979de77de5cc0a8e$var$genClass = \"[object GeneratorFunction]\";\nvar $979de77de5cc0a8e$var$ddaClass = \"[object HTMLAllCollection]\"; // IE 11\nvar $979de77de5cc0a8e$var$ddaClass2 = \"[object HTML document.all class]\";\nvar $979de77de5cc0a8e$var$ddaClass3 = \"[object HTMLCollection]\"; // IE 9-10\nvar $979de77de5cc0a8e$var$hasToStringTag = typeof Symbol === \"function\" && !!Symbol.toStringTag; // better: use `has-tostringtag`\nvar $979de77de5cc0a8e$var$isIE68 = !(0 in [\n , \n]); // eslint-disable-line no-sparse-arrays, comma-spacing\nvar $979de77de5cc0a8e$var$isDDA = function isDocumentDotAll() {\n return false;\n};\nif (typeof document === \"object\") {\n // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n var $979de77de5cc0a8e$var$all = document.all;\n if ($979de77de5cc0a8e$var$toStr.call($979de77de5cc0a8e$var$all) === $979de77de5cc0a8e$var$toStr.call(document.all)) $979de77de5cc0a8e$var$isDDA = function isDocumentDotAll(value) {\n /* globals document: false */ // in IE 6-8, typeof document.all is \"object\" and it's truthy\n if (($979de77de5cc0a8e$var$isIE68 || !value) && (typeof value === \"undefined\" || typeof value === \"object\")) try {\n var str = $979de77de5cc0a8e$var$toStr.call(value);\n return (str === $979de77de5cc0a8e$var$ddaClass || str === $979de77de5cc0a8e$var$ddaClass2 || str === $979de77de5cc0a8e$var$ddaClass3 // opera 12.16\n || str === $979de77de5cc0a8e$var$objectClass // IE 6-8\n ) && value(\"\") == null; // eslint-disable-line eqeqeq\n } catch (e) {}\n return false;\n };\n}\nmodule.exports = $979de77de5cc0a8e$var$reflectApply ? function isCallable(value) {\n if ($979de77de5cc0a8e$var$isDDA(value)) return true;\n if (!value) return false;\n if (typeof value !== \"function\" && typeof value !== \"object\") return false;\n try {\n $979de77de5cc0a8e$var$reflectApply(value, null, $979de77de5cc0a8e$var$badArrayLike);\n } catch (e) {\n if (e !== $979de77de5cc0a8e$var$isCallableMarker) return false;\n }\n return !$979de77de5cc0a8e$var$isES6ClassFn(value) && $979de77de5cc0a8e$var$tryFunctionObject(value);\n} : function isCallable(value) {\n if ($979de77de5cc0a8e$var$isDDA(value)) return true;\n if (!value) return false;\n if (typeof value !== \"function\" && typeof value !== \"object\") return false;\n if ($979de77de5cc0a8e$var$hasToStringTag) return $979de77de5cc0a8e$var$tryFunctionObject(value);\n if ($979de77de5cc0a8e$var$isES6ClassFn(value)) return false;\n var strClass = $979de77de5cc0a8e$var$toStr.call(value);\n if (strClass !== $979de77de5cc0a8e$var$fnClass && strClass !== $979de77de5cc0a8e$var$genClass && !/^\\[object HTML/.test(strClass)) return false;\n return $979de77de5cc0a8e$var$tryFunctionObject(value);\n};\n\n});\n\n\nparcelRegister(\"fHmwU\", function(module, exports) {\n\"use strict\";\nvar $b6dc5923138db0e6$var$possibleNames = [\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Float32Array\",\n \"Float64Array\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\"\n];\nvar $b6dc5923138db0e6$var$g = typeof globalThis === \"undefined\" ? $parcel$global : globalThis;\nmodule.exports = function availableTypedArrays() {\n var out = [];\n for(var i = 0; i < $b6dc5923138db0e6$var$possibleNames.length; i++)if (typeof $b6dc5923138db0e6$var$g[$b6dc5923138db0e6$var$possibleNames[i]] === \"function\") out[out.length] = $b6dc5923138db0e6$var$possibleNames[i];\n return out;\n};\n\n});\n\n\nparcelRegister(\"bbrRm\", function(module, exports) {\n\"use strict\";\n\nvar $6Sxxf = parcelRequire(\"6Sxxf\");\nmodule.exports = function isTypedArray(value) {\n return !!$6Sxxf(value);\n};\n\n});\n\n\nparcelRegister(\"1qVfH\", function(module, exports) {\nmodule.exports = function isBuffer(arg) {\n return arg && typeof arg === \"object\" && typeof arg.copy === \"function\" && typeof arg.fill === \"function\" && typeof arg.readUInt8 === \"function\";\n};\n\n});\n\nparcelRegister(\"9TvxW\", function(module, exports) {\nif (typeof Object.create === \"function\") // implementation from standard node.js 'util' module\nmodule.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n};\nelse // old school shim for old browsers\nmodule.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function() {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n};\n\n});\n\n\n\nparcelRegister(\"7aMwq\", function(module, exports) {\n// Currently in sync with Node.js lib/internal/assert/assertion_error.js\n// https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c\n\nvar $2fLxs = parcelRequire(\"2fLxs\");\n\"use strict\";\nfunction $538f1b056a09a255$var$ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function(r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction $538f1b056a09a255$var$_objectSpread(e) {\n for(var r = 1; r < arguments.length; r++){\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? $538f1b056a09a255$var$ownKeys(Object(t), !0).forEach(function(r) {\n $538f1b056a09a255$var$_defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : $538f1b056a09a255$var$ownKeys(Object(t)).forEach(function(r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nfunction $538f1b056a09a255$var$_defineProperty(obj, key, value) {\n key = $538f1b056a09a255$var$_toPropertyKey(key);\n if (key in obj) Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n else obj[key] = value;\n return obj;\n}\nfunction $538f1b056a09a255$var$_classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction $538f1b056a09a255$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, $538f1b056a09a255$var$_toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction $538f1b056a09a255$var$_createClass(Constructor, protoProps, staticProps) {\n if (protoProps) $538f1b056a09a255$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $538f1b056a09a255$var$_defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction $538f1b056a09a255$var$_toPropertyKey(arg) {\n var key = $538f1b056a09a255$var$_toPrimitive(arg, \"string\");\n return $538f1b056a09a255$var$_typeof(key) === \"symbol\" ? key : String(key);\n}\nfunction $538f1b056a09a255$var$_toPrimitive(input, hint) {\n if ($538f1b056a09a255$var$_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if ($538f1b056a09a255$var$_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction $538f1b056a09a255$var$_inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) throw new TypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) $538f1b056a09a255$var$_setPrototypeOf(subClass, superClass);\n}\nfunction $538f1b056a09a255$var$_createSuper(Derived) {\n var hasNativeReflectConstruct = $538f1b056a09a255$var$_isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = $538f1b056a09a255$var$_getPrototypeOf(Derived), result;\n if (hasNativeReflectConstruct) {\n var NewTarget = $538f1b056a09a255$var$_getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else result = Super.apply(this, arguments);\n return $538f1b056a09a255$var$_possibleConstructorReturn(this, result);\n };\n}\nfunction $538f1b056a09a255$var$_possibleConstructorReturn(self, call) {\n if (call && ($538f1b056a09a255$var$_typeof(call) === \"object\" || typeof call === \"function\")) return call;\n else if (call !== void 0) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return $538f1b056a09a255$var$_assertThisInitialized(self);\n}\nfunction $538f1b056a09a255$var$_assertThisInitialized(self) {\n if (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n}\nfunction $538f1b056a09a255$var$_wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n $538f1b056a09a255$var$_wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !$538f1b056a09a255$var$_isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") throw new TypeError(\"Super expression must either be null or a function\");\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return $538f1b056a09a255$var$_construct(Class, arguments, $538f1b056a09a255$var$_getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return $538f1b056a09a255$var$_setPrototypeOf(Wrapper, Class);\n };\n return $538f1b056a09a255$var$_wrapNativeSuper(Class);\n}\nfunction $538f1b056a09a255$var$_construct(Parent, args, Class) {\n if ($538f1b056a09a255$var$_isNativeReflectConstruct()) $538f1b056a09a255$var$_construct = Reflect.construct.bind();\n else $538f1b056a09a255$var$_construct = function _construct(Parent, args, Class) {\n var a = [\n null\n ];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) $538f1b056a09a255$var$_setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n return $538f1b056a09a255$var$_construct.apply(null, arguments);\n}\nfunction $538f1b056a09a255$var$_isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n}\nfunction $538f1b056a09a255$var$_isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\nfunction $538f1b056a09a255$var$_setPrototypeOf(o, p) {\n $538f1b056a09a255$var$_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return $538f1b056a09a255$var$_setPrototypeOf(o, p);\n}\nfunction $538f1b056a09a255$var$_getPrototypeOf(o) {\n $538f1b056a09a255$var$_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return $538f1b056a09a255$var$_getPrototypeOf(o);\n}\nfunction $538f1b056a09a255$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $538f1b056a09a255$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $538f1b056a09a255$var$_typeof(o);\n}\n\nvar $gQylu = parcelRequire(\"gQylu\");\nvar $538f1b056a09a255$var$inspect = $gQylu.inspect;\n\nvar $fgTSu = parcelRequire(\"fgTSu\");\nvar $538f1b056a09a255$var$ERR_INVALID_ARG_TYPE = $fgTSu.codes.ERR_INVALID_ARG_TYPE;\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction $538f1b056a09a255$var$endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) this_len = str.length;\n return str.substring(this_len - search.length, this_len) === search;\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\nfunction $538f1b056a09a255$var$repeat(str, count) {\n count = Math.floor(count);\n if (str.length == 0 || count == 0) return \"\";\n var maxCount = str.length * count;\n count = Math.floor(Math.log(count) / Math.log(2));\n while(count){\n str += str;\n count--;\n }\n str += str.substring(0, maxCount - str.length);\n return str;\n}\nvar $538f1b056a09a255$var$blue = \"\";\nvar $538f1b056a09a255$var$green = \"\";\nvar $538f1b056a09a255$var$red = \"\";\nvar $538f1b056a09a255$var$white = \"\";\nvar $538f1b056a09a255$var$kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n};\n// Comparing short primitives should just show === / !== instead of using the\n// diff.\nvar $538f1b056a09a255$var$kMaxShortLength = 10;\nfunction $538f1b056a09a255$var$copyError(source) {\n var keys = Object.keys(source);\n var target = Object.create(Object.getPrototypeOf(source));\n keys.forEach(function(key) {\n target[key] = source[key];\n });\n Object.defineProperty(target, \"message\", {\n value: source.message\n });\n return target;\n}\nfunction $538f1b056a09a255$var$inspectValue(val) {\n // The util.inspect default values could be changed. This makes sure the\n // error messages contain the necessary information nevertheless.\n return $538f1b056a09a255$var$inspect(val, {\n compact: false,\n customInspect: false,\n depth: 1000,\n maxArrayLength: Infinity,\n // Assert compares only enumerable properties (with a few exceptions).\n showHidden: false,\n // Having a long line as error is better than wrapping the line for\n // comparison for now.\n // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we\n // have meta information about the inspected properties (i.e., know where\n // in what line the property starts and ends).\n breakLength: Infinity,\n // Assert does not detect proxies currently.\n showProxy: false,\n sorted: true,\n // Inspect getters as we also check them when comparing entries.\n getters: true\n });\n}\nfunction $538f1b056a09a255$var$createErrDiff(actual, expected, operator) {\n var other = \"\";\n var res = \"\";\n var lastPos = 0;\n var end = \"\";\n var skipped = false;\n var actualInspected = $538f1b056a09a255$var$inspectValue(actual);\n var actualLines = actualInspected.split(\"\\n\");\n var expectedLines = $538f1b056a09a255$var$inspectValue(expected).split(\"\\n\");\n var i = 0;\n var indicator = \"\";\n // In case both values are objects explicitly mark them as not reference equal\n // for the `strictEqual` operator.\n if (operator === \"strictEqual\" && $538f1b056a09a255$var$_typeof(actual) === \"object\" && $538f1b056a09a255$var$_typeof(expected) === \"object\" && actual !== null && expected !== null) operator = \"strictEqualObject\";\n // If \"actual\" and \"expected\" fit on a single line and they are not strictly\n // equal, check further special handling.\n if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n // If the character length of \"actual\" and \"expected\" together is less than\n // kMaxShortLength and if neither is an object and at least one of them is\n // not `zero`, use the strict equal comparison to visualize the output.\n if (inputLength <= $538f1b056a09a255$var$kMaxShortLength) {\n if (($538f1b056a09a255$var$_typeof(actual) !== \"object\" || actual === null) && ($538f1b056a09a255$var$_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0)) // -0 === +0\n return \"\".concat($538f1b056a09a255$var$kReadableOperator[operator], \"\\n\\n\") + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], \"\\n\");\n } else if (operator !== \"strictEqualObject\") {\n // If the stderr is a tty and the input length is lower than the current\n // columns per line, add a mismatch indicator below the output. If it is\n // not a tty, use a default value of 80 characters.\n var maxLength = $2fLxs.stderr && $2fLxs.stderr.isTTY ? $2fLxs.stderr.columns : 80;\n if (inputLength < maxLength) {\n while(actualLines[0][i] === expectedLines[0][i])i++;\n // Ignore the first characters.\n if (i > 2) {\n // Add position indicator for the first mismatch in case it is a\n // single line and the input length is less than the column length.\n indicator = \"\\n \".concat($538f1b056a09a255$var$repeat(\" \", i), \"^\");\n i = 0;\n }\n }\n }\n }\n // Remove all ending lines that match (this optimizes the output for\n // readability by reducing the number of total changed lines).\n var a = actualLines[actualLines.length - 1];\n var b = expectedLines[expectedLines.length - 1];\n while(a === b){\n if (i++ < 2) end = \"\\n \".concat(a).concat(end);\n else other = a;\n actualLines.pop();\n expectedLines.pop();\n if (actualLines.length === 0 || expectedLines.length === 0) break;\n a = actualLines[actualLines.length - 1];\n b = expectedLines[expectedLines.length - 1];\n }\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n // Strict equal with identical objects that are not identical by reference.\n // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() })\n if (maxLines === 0) {\n // We have to get the result again. The lines were all removed before.\n var _actualLines = actualInspected.split(\"\\n\");\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (_actualLines.length > 30) {\n _actualLines[26] = \"\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white);\n while(_actualLines.length > 27)_actualLines.pop();\n }\n return \"\".concat($538f1b056a09a255$var$kReadableOperator.notIdentical, \"\\n\\n\").concat(_actualLines.join(\"\\n\"), \"\\n\");\n }\n if (i > 3) {\n end = \"\\n\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white).concat(end);\n skipped = true;\n }\n if (other !== \"\") {\n end = \"\\n \".concat(other).concat(end);\n other = \"\";\n }\n var printedLines = 0;\n var msg = $538f1b056a09a255$var$kReadableOperator[operator] + \"\\n\".concat($538f1b056a09a255$var$green, \"+ actual\").concat($538f1b056a09a255$var$white, \" \").concat($538f1b056a09a255$var$red, \"- expected\").concat($538f1b056a09a255$var$white);\n var skippedMsg = \" \".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white, \" Lines skipped\");\n for(i = 0; i < maxLines; i++){\n // Only extra expected lines exist\n var cur = i - lastPos;\n if (actualLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(expectedLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(expectedLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the expected line to the cache.\n other += \"\\n\".concat($538f1b056a09a255$var$red, \"-\").concat($538f1b056a09a255$var$white, \" \").concat(expectedLines[i]);\n printedLines++;\n // Only extra actual lines exist\n } else if (expectedLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result.\n res += \"\\n\".concat($538f1b056a09a255$var$green, \"+\").concat($538f1b056a09a255$var$white, \" \").concat(actualLines[i]);\n printedLines++;\n // Lines diverge\n } else {\n var expectedLine = expectedLines[i];\n var actualLine = actualLines[i];\n // If the lines diverge, specifically check for lines that only diverge by\n // a trailing comma. In that case it is actually identical and we should\n // mark it as such.\n var divergingLines = actualLine !== expectedLine && (!$538f1b056a09a255$var$endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n // If the expected line has a trailing comma but is otherwise identical,\n // add a comma at the end of the actual line. Otherwise the output could\n // look weird as in:\n //\n // [\n // 1 // No comma at the end!\n // + 2\n // ]\n //\n if (divergingLines && $538f1b056a09a255$var$endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine) {\n divergingLines = false;\n actualLine += \",\";\n }\n if (divergingLines) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result and cache the expected diverging\n // line so consecutive diverging lines show up as +++--- and not +-+-+-.\n res += \"\\n\".concat($538f1b056a09a255$var$green, \"+\").concat($538f1b056a09a255$var$white, \" \").concat(actualLine);\n other += \"\\n\".concat($538f1b056a09a255$var$red, \"-\").concat($538f1b056a09a255$var$white, \" \").concat(expectedLine);\n printedLines += 2;\n // Lines are identical\n } else {\n // Add all cached information to the result before adding other things\n // and reset the cache.\n res += other;\n other = \"\";\n // If the last diverging line is exactly one line above or if it is the\n // very first line, add the line to the result.\n if (cur === 1 || i === 0) {\n res += \"\\n \".concat(actualLine);\n printedLines++;\n }\n }\n }\n // Inspected object to big (Show ~20 rows max)\n if (printedLines > 20 && i < maxLines - 2) return \"\".concat(msg).concat(skippedMsg, \"\\n\").concat(res, \"\\n\").concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white).concat(other, \"\\n\") + \"\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white);\n }\n return \"\".concat(msg).concat(skipped ? skippedMsg : \"\", \"\\n\").concat(res).concat(other).concat(end).concat(indicator);\n}\nvar $538f1b056a09a255$var$AssertionError = /*#__PURE__*/ function(_Error, _inspect$custom) {\n $538f1b056a09a255$var$_inherits(AssertionError, _Error);\n var _super = $538f1b056a09a255$var$_createSuper(AssertionError);\n function AssertionError(options) {\n var _this;\n $538f1b056a09a255$var$_classCallCheck(this, AssertionError);\n if ($538f1b056a09a255$var$_typeof(options) !== \"object\" || options === null) throw new $538f1b056a09a255$var$ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var message = options.message, operator = options.operator, stackStartFn = options.stackStartFn;\n var actual = options.actual, expected = options.expected;\n var limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n if (message != null) _this = _super.call(this, String(message));\n else {\n if ($2fLxs.stderr && $2fLxs.stderr.isTTY) {\n // Reset on each call to make sure we handle dynamically set environment\n // variables correct.\n if ($2fLxs.stderr && $2fLxs.stderr.getColorDepth && $2fLxs.stderr.getColorDepth() !== 1) {\n $538f1b056a09a255$var$blue = \"\\x1b[34m\";\n $538f1b056a09a255$var$green = \"\\x1b[32m\";\n $538f1b056a09a255$var$white = \"\\x1b[39m\";\n $538f1b056a09a255$var$red = \"\\x1b[31m\";\n } else {\n $538f1b056a09a255$var$blue = \"\";\n $538f1b056a09a255$var$green = \"\";\n $538f1b056a09a255$var$white = \"\";\n $538f1b056a09a255$var$red = \"\";\n }\n }\n // Prevent the error stack from being visible by duplicating the error\n // in a very close way to the original in case both sides are actually\n // instances of Error.\n if ($538f1b056a09a255$var$_typeof(actual) === \"object\" && actual !== null && $538f1b056a09a255$var$_typeof(expected) === \"object\" && expected !== null && \"stack\" in actual && actual instanceof Error && \"stack\" in expected && expected instanceof Error) {\n actual = $538f1b056a09a255$var$copyError(actual);\n expected = $538f1b056a09a255$var$copyError(expected);\n }\n if (operator === \"deepStrictEqual\" || operator === \"strictEqual\") _this = _super.call(this, $538f1b056a09a255$var$createErrDiff(actual, expected, operator));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n // In case the objects are equal but the operator requires unequal, show\n // the first object and say A equals B\n var base = $538f1b056a09a255$var$kReadableOperator[operator];\n var res = $538f1b056a09a255$var$inspectValue(actual).split(\"\\n\");\n // In case \"actual\" is an object, it should not be reference equal.\n if (operator === \"notStrictEqual\" && $538f1b056a09a255$var$_typeof(actual) === \"object\" && actual !== null) base = $538f1b056a09a255$var$kReadableOperator.notStrictEqualObject;\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (res.length > 30) {\n res[26] = \"\".concat($538f1b056a09a255$var$blue, \"...\").concat($538f1b056a09a255$var$white);\n while(res.length > 27)res.pop();\n }\n // Only print a single input.\n if (res.length === 1) _this = _super.call(this, \"\".concat(base, \" \").concat(res[0]));\n else _this = _super.call(this, \"\".concat(base, \"\\n\\n\").concat(res.join(\"\\n\"), \"\\n\"));\n } else {\n var _res = $538f1b056a09a255$var$inspectValue(actual);\n var other = \"\";\n var knownOperators = $538f1b056a09a255$var$kReadableOperator[operator];\n if (operator === \"notDeepEqual\" || operator === \"notEqual\") {\n _res = \"\".concat($538f1b056a09a255$var$kReadableOperator[operator], \"\\n\\n\").concat(_res);\n if (_res.length > 1024) _res = \"\".concat(_res.slice(0, 1021), \"...\");\n } else {\n other = \"\".concat($538f1b056a09a255$var$inspectValue(expected));\n if (_res.length > 512) _res = \"\".concat(_res.slice(0, 509), \"...\");\n if (other.length > 512) other = \"\".concat(other.slice(0, 509), \"...\");\n if (operator === \"deepEqual\" || operator === \"equal\") _res = \"\".concat(knownOperators, \"\\n\\n\").concat(_res, \"\\n\\nshould equal\\n\\n\");\n else other = \" \".concat(operator, \" \").concat(other);\n }\n _this = _super.call(this, \"\".concat(_res).concat(other));\n }\n }\n Error.stackTraceLimit = limit;\n _this.generatedMessage = !message;\n Object.defineProperty($538f1b056a09a255$var$_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: false,\n writable: true,\n configurable: true\n });\n _this.code = \"ERR_ASSERTION\";\n _this.actual = actual;\n _this.expected = expected;\n _this.operator = operator;\n if (Error.captureStackTrace) // eslint-disable-next-line no-restricted-syntax\n Error.captureStackTrace($538f1b056a09a255$var$_assertThisInitialized(_this), stackStartFn);\n // Create error message including the error code in the name.\n _this.stack;\n // Reset the name.\n _this.name = \"AssertionError\";\n return $538f1b056a09a255$var$_possibleConstructorReturn(_this);\n }\n $538f1b056a09a255$var$_createClass(AssertionError, [\n {\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: _inspect$custom,\n value: function value(recurseTimes, ctx) {\n // This limits the `actual` and `expected` property default inspection to\n // the minimum depth. Otherwise those values would be too verbose compared\n // to the actual error message which contains a combined view of these two\n // input values.\n return $538f1b056a09a255$var$inspect(this, $538f1b056a09a255$var$_objectSpread($538f1b056a09a255$var$_objectSpread({}, ctx), {}, {\n customInspect: false,\n depth: 0\n }));\n }\n }\n ]);\n return AssertionError;\n}(/*#__PURE__*/ $538f1b056a09a255$var$_wrapNativeSuper(Error), $538f1b056a09a255$var$inspect.custom);\nmodule.exports = $538f1b056a09a255$var$AssertionError;\n\n});\n\nparcelRegister(\"8D6gL\", function(module, exports) {\n\"use strict\";\n\nvar $8A6bc = parcelRequire(\"8A6bc\");\nvar $019f13f070986299$var$lacksProperEnumerationOrder = function() {\n if (!Object.assign) return false;\n /*\n\t * v8, specifically in node 4.x, has a bug with incorrect property enumeration order\n\t * note: this does not detect the bug unless there's 20 characters\n\t */ var str = \"abcdefghijklmnopqrst\";\n var letters = str.split(\"\");\n var map = {};\n for(var i = 0; i < letters.length; ++i)map[letters[i]] = letters[i];\n var obj = Object.assign({}, map);\n var actual = \"\";\n for(var k in obj)actual += k;\n return str !== actual;\n};\nvar $019f13f070986299$var$assignHasPendingExceptions = function() {\n if (!Object.assign || !Object.preventExtensions) return false;\n /*\n\t * Firefox 37 still has \"pending exception\" logic in its Object.assign implementation,\n\t * which is 72% slower than our shim, and Firefox 40's native implementation.\n\t */ var thrower = Object.preventExtensions({\n 1: 2\n });\n try {\n Object.assign(thrower, \"xy\");\n } catch (e) {\n return thrower[1] === \"y\";\n }\n return false;\n};\nmodule.exports = function getPolyfill() {\n if (!Object.assign) return $8A6bc;\n if ($019f13f070986299$var$lacksProperEnumerationOrder()) return $8A6bc;\n if ($019f13f070986299$var$assignHasPendingExceptions()) return $8A6bc;\n return Object.assign;\n};\n\n});\nparcelRegister(\"8A6bc\", function(module, exports) {\n\"use strict\";\n\nvar $gK6Se = parcelRequire(\"gK6Se\");\n\nvar $63f67aa80e2e6d42$var$hasSymbols = (parcelRequire(\"grYrm\"))();\n\nvar $3e3ab = parcelRequire(\"3e3ab\");\nvar $63f67aa80e2e6d42$var$toObject = Object;\nvar $63f67aa80e2e6d42$var$$push = $3e3ab(\"Array.prototype.push\");\nvar $63f67aa80e2e6d42$var$$propIsEnumerable = $3e3ab(\"Object.prototype.propertyIsEnumerable\");\nvar $63f67aa80e2e6d42$var$originalGetSymbols = $63f67aa80e2e6d42$var$hasSymbols ? Object.getOwnPropertySymbols : null;\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function assign(target, source1) {\n if (target == null) throw new TypeError(\"target must be an object\");\n var to = $63f67aa80e2e6d42$var$toObject(target); // step 1\n if (arguments.length === 1) return to; // step 2\n for(var s = 1; s < arguments.length; ++s){\n var from = $63f67aa80e2e6d42$var$toObject(arguments[s]); // step 3.a.i\n // step 3.a.ii:\n var keys = $gK6Se(from);\n var getSymbols = $63f67aa80e2e6d42$var$hasSymbols && (Object.getOwnPropertySymbols || $63f67aa80e2e6d42$var$originalGetSymbols);\n if (getSymbols) {\n var syms = getSymbols(from);\n for(var j = 0; j < syms.length; ++j){\n var key = syms[j];\n if ($63f67aa80e2e6d42$var$$propIsEnumerable(from, key)) $63f67aa80e2e6d42$var$$push(keys, key);\n }\n }\n // step 3.a.iii:\n for(var i = 0; i < keys.length; ++i){\n var nextKey = keys[i];\n if ($63f67aa80e2e6d42$var$$propIsEnumerable(from, nextKey)) {\n var propValue = from[nextKey]; // step 3.a.iii.2.a\n to[nextKey] = propValue; // step 3.a.iii.2.b\n }\n }\n }\n return to; // step 4\n};\n\n});\nparcelRegister(\"gK6Se\", function(module, exports) {\n\"use strict\";\nvar $c3064632e4f346e0$var$slice = Array.prototype.slice;\n\nvar $alwvH = parcelRequire(\"alwvH\");\nvar $c3064632e4f346e0$var$origKeys = Object.keys;\n\nvar $c3064632e4f346e0$var$keysShim = $c3064632e4f346e0$var$origKeys ? function keys(o) {\n return $c3064632e4f346e0$var$origKeys(o);\n} : (parcelRequire(\"2QCzs\"));\nvar $c3064632e4f346e0$var$originalKeys = Object.keys;\n$c3064632e4f346e0$var$keysShim.shim = function shimObjectKeys() {\n if (Object.keys) {\n var keysWorksWithArguments = function() {\n // Safari 5.0 bug\n var args = Object.keys(arguments);\n return args && args.length === arguments.length;\n }(1, 2);\n if (!keysWorksWithArguments) Object.keys = function keys(object) {\n if ($alwvH(object)) return $c3064632e4f346e0$var$originalKeys($c3064632e4f346e0$var$slice.call(object));\n return $c3064632e4f346e0$var$originalKeys(object);\n };\n } else Object.keys = $c3064632e4f346e0$var$keysShim;\n return Object.keys || $c3064632e4f346e0$var$keysShim;\n};\nmodule.exports = $c3064632e4f346e0$var$keysShim;\n\n});\nparcelRegister(\"alwvH\", function(module, exports) {\n\"use strict\";\nvar $7885156e7e68aa1f$var$toStr = Object.prototype.toString;\nmodule.exports = function isArguments(value) {\n var str = $7885156e7e68aa1f$var$toStr.call(value);\n var isArgs = str === \"[object Arguments]\";\n if (!isArgs) isArgs = str !== \"[object Array]\" && value !== null && typeof value === \"object\" && typeof value.length === \"number\" && value.length >= 0 && $7885156e7e68aa1f$var$toStr.call(value.callee) === \"[object Function]\";\n return isArgs;\n};\n\n});\n\nparcelRegister(\"2QCzs\", function(module, exports) {\n\"use strict\";\nvar $212e5b7e1daff425$var$keysShim;\n\nif (!Object.keys) {\n // modified from https://github.com/es-shims/es5-shim\n var $212e5b7e1daff425$var$has = Object.prototype.hasOwnProperty;\n var $212e5b7e1daff425$var$toStr = Object.prototype.toString;\n var $212e5b7e1daff425$var$isArgs = (parcelRequire(\"alwvH\")); // eslint-disable-line global-require\n var $212e5b7e1daff425$var$isEnumerable = Object.prototype.propertyIsEnumerable;\n var $212e5b7e1daff425$var$hasDontEnumBug = !$212e5b7e1daff425$var$isEnumerable.call({\n toString: null\n }, \"toString\");\n var $212e5b7e1daff425$var$hasProtoEnumBug = $212e5b7e1daff425$var$isEnumerable.call(function() {}, \"prototype\");\n var $212e5b7e1daff425$var$dontEnums = [\n \"toString\",\n \"toLocaleString\",\n \"valueOf\",\n \"hasOwnProperty\",\n \"isPrototypeOf\",\n \"propertyIsEnumerable\",\n \"constructor\"\n ];\n var $212e5b7e1daff425$var$equalsConstructorPrototype = function(o) {\n var ctor = o.constructor;\n return ctor && ctor.prototype === o;\n };\n var $212e5b7e1daff425$var$excludedKeys = {\n $applicationCache: true,\n $console: true,\n $external: true,\n $frame: true,\n $frameElement: true,\n $frames: true,\n $innerHeight: true,\n $innerWidth: true,\n $onmozfullscreenchange: true,\n $onmozfullscreenerror: true,\n $outerHeight: true,\n $outerWidth: true,\n $pageXOffset: true,\n $pageYOffset: true,\n $parent: true,\n $scrollLeft: true,\n $scrollTop: true,\n $scrollX: true,\n $scrollY: true,\n $self: true,\n $webkitIndexedDB: true,\n $webkitStorageInfo: true,\n $window: true\n };\n var $212e5b7e1daff425$var$hasAutomationEqualityBug = function() {\n /* global window */ if (typeof window === \"undefined\") return false;\n for(var k in window)try {\n if (!$212e5b7e1daff425$var$excludedKeys[\"$\" + k] && $212e5b7e1daff425$var$has.call(window, k) && window[k] !== null && typeof window[k] === \"object\") try {\n $212e5b7e1daff425$var$equalsConstructorPrototype(window[k]);\n } catch (e) {\n return true;\n }\n } catch (e) {\n return true;\n }\n return false;\n }();\n var $212e5b7e1daff425$var$equalsConstructorPrototypeIfNotBuggy = function(o) {\n /* global window */ if (typeof window === \"undefined\" || !$212e5b7e1daff425$var$hasAutomationEqualityBug) return $212e5b7e1daff425$var$equalsConstructorPrototype(o);\n try {\n return $212e5b7e1daff425$var$equalsConstructorPrototype(o);\n } catch (e) {\n return false;\n }\n };\n $212e5b7e1daff425$var$keysShim = function keys(object) {\n var isObject = object !== null && typeof object === \"object\";\n var isFunction = $212e5b7e1daff425$var$toStr.call(object) === \"[object Function]\";\n var isArguments = $212e5b7e1daff425$var$isArgs(object);\n var isString = isObject && $212e5b7e1daff425$var$toStr.call(object) === \"[object String]\";\n var theKeys = [];\n if (!isObject && !isFunction && !isArguments) throw new TypeError(\"Object.keys called on a non-object\");\n var skipProto = $212e5b7e1daff425$var$hasProtoEnumBug && isFunction;\n if (isString && object.length > 0 && !$212e5b7e1daff425$var$has.call(object, 0)) for(var i = 0; i < object.length; ++i)theKeys.push(String(i));\n if (isArguments && object.length > 0) for(var j = 0; j < object.length; ++j)theKeys.push(String(j));\n else {\n for(var name in object)if (!(skipProto && name === \"prototype\") && $212e5b7e1daff425$var$has.call(object, name)) theKeys.push(String(name));\n }\n if ($212e5b7e1daff425$var$hasDontEnumBug) {\n var skipConstructor = $212e5b7e1daff425$var$equalsConstructorPrototypeIfNotBuggy(object);\n for(var k = 0; k < $212e5b7e1daff425$var$dontEnums.length; ++k)if (!(skipConstructor && $212e5b7e1daff425$var$dontEnums[k] === \"constructor\") && $212e5b7e1daff425$var$has.call(object, $212e5b7e1daff425$var$dontEnums[k])) theKeys.push($212e5b7e1daff425$var$dontEnums[k]);\n }\n return theKeys;\n };\n}\nmodule.exports = $212e5b7e1daff425$var$keysShim;\n\n});\n\n\n\n\nparcelRegister(\"bxl1N\", function(module, exports) {\n\"use strict\";\n\nvar $bX2ce = parcelRequire(\"bX2ce\");\nmodule.exports = function getPolyfill() {\n return typeof Object.is === \"function\" ? Object.is : $bX2ce;\n};\n\n});\nparcelRegister(\"bX2ce\", function(module, exports) {\n\"use strict\";\nvar $8b36e887b63475ea$var$numberIsNaN = function(value) {\n return value !== value;\n};\nmodule.exports = function is(a, b) {\n if (a === 0 && b === 0) return 1 / a === 1 / b;\n if (a === b) return true;\n if ($8b36e887b63475ea$var$numberIsNaN(a) && $8b36e887b63475ea$var$numberIsNaN(b)) return true;\n return false;\n};\n\n});\n\n\nparcelRegister(\"2DPC6\", function(module, exports) {\n// Currently in sync with Node.js lib/internal/util/comparisons.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\"use strict\";\nfunction $1ec742ad58c16dc0$var$_slicedToArray(arr, i) {\n return $1ec742ad58c16dc0$var$_arrayWithHoles(arr) || $1ec742ad58c16dc0$var$_iterableToArrayLimit(arr, i) || $1ec742ad58c16dc0$var$_unsupportedIterableToArray(arr, i) || $1ec742ad58c16dc0$var$_nonIterableRest();\n}\nfunction $1ec742ad58c16dc0$var$_nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction $1ec742ad58c16dc0$var$_unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return $1ec742ad58c16dc0$var$_arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $1ec742ad58c16dc0$var$_arrayLikeToArray(o, minLen);\n}\nfunction $1ec742ad58c16dc0$var$_arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction $1ec742ad58c16dc0$var$_iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e, n, i, u, a = [], f = !0, o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for(; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally{\n try {\n if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n } finally{\n if (o) throw n;\n }\n }\n return a;\n }\n}\nfunction $1ec742ad58c16dc0$var$_arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction $1ec742ad58c16dc0$var$_typeof(o) {\n \"@babel/helpers - typeof\";\n return $1ec742ad58c16dc0$var$_typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n return typeof o;\n } : function(o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, $1ec742ad58c16dc0$var$_typeof(o);\n}\nvar $1ec742ad58c16dc0$var$regexFlagsSupported = /a/g.flags !== undefined;\nvar $1ec742ad58c16dc0$var$arrayFromSet = function arrayFromSet(set) {\n var array = [];\n set.forEach(function(value) {\n return array.push(value);\n });\n return array;\n};\nvar $1ec742ad58c16dc0$var$arrayFromMap = function arrayFromMap(map) {\n var array = [];\n map.forEach(function(value, key) {\n return array.push([\n key,\n value\n ]);\n });\n return array;\n};\n\nvar $1ec742ad58c16dc0$var$objectIs = Object.is ? Object.is : (parcelRequire(\"fREgm\"));\nvar $1ec742ad58c16dc0$var$objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function() {\n return [];\n};\n\nvar $1ec742ad58c16dc0$var$numberIsNaN = Number.isNaN ? Number.isNaN : (parcelRequire(\"1SiBw\"));\nfunction $1ec742ad58c16dc0$var$uncurryThis(f) {\n return f.call.bind(f);\n}\nvar $1ec742ad58c16dc0$var$hasOwnProperty = $1ec742ad58c16dc0$var$uncurryThis(Object.prototype.hasOwnProperty);\nvar $1ec742ad58c16dc0$var$propertyIsEnumerable = $1ec742ad58c16dc0$var$uncurryThis(Object.prototype.propertyIsEnumerable);\nvar $1ec742ad58c16dc0$var$objectToString = $1ec742ad58c16dc0$var$uncurryThis(Object.prototype.toString);\n\nvar $gQylu = parcelRequire(\"gQylu\");\nvar $1ec742ad58c16dc0$require$_require$types = $gQylu.types;\nvar $1ec742ad58c16dc0$var$isAnyArrayBuffer = $1ec742ad58c16dc0$require$_require$types.isAnyArrayBuffer, $1ec742ad58c16dc0$var$isArrayBufferView = $1ec742ad58c16dc0$require$_require$types.isArrayBufferView, $1ec742ad58c16dc0$var$isDate = $1ec742ad58c16dc0$require$_require$types.isDate, $1ec742ad58c16dc0$var$isMap = $1ec742ad58c16dc0$require$_require$types.isMap, $1ec742ad58c16dc0$var$isRegExp = $1ec742ad58c16dc0$require$_require$types.isRegExp, $1ec742ad58c16dc0$var$isSet = $1ec742ad58c16dc0$require$_require$types.isSet, $1ec742ad58c16dc0$var$isNativeError = $1ec742ad58c16dc0$require$_require$types.isNativeError, $1ec742ad58c16dc0$var$isBoxedPrimitive = $1ec742ad58c16dc0$require$_require$types.isBoxedPrimitive, $1ec742ad58c16dc0$var$isNumberObject = $1ec742ad58c16dc0$require$_require$types.isNumberObject, $1ec742ad58c16dc0$var$isStringObject = $1ec742ad58c16dc0$require$_require$types.isStringObject, $1ec742ad58c16dc0$var$isBooleanObject = $1ec742ad58c16dc0$require$_require$types.isBooleanObject, $1ec742ad58c16dc0$var$isBigIntObject = $1ec742ad58c16dc0$require$_require$types.isBigIntObject, $1ec742ad58c16dc0$var$isSymbolObject = $1ec742ad58c16dc0$require$_require$types.isSymbolObject, $1ec742ad58c16dc0$var$isFloat32Array = $1ec742ad58c16dc0$require$_require$types.isFloat32Array, $1ec742ad58c16dc0$var$isFloat64Array = $1ec742ad58c16dc0$require$_require$types.isFloat64Array;\nfunction $1ec742ad58c16dc0$var$isNonIndex(key) {\n if (key.length === 0 || key.length > 10) return true;\n for(var i = 0; i < key.length; i++){\n var code = key.charCodeAt(i);\n if (code < 48 || code > 57) return true;\n }\n // The maximum size for an array is 2 ** 32 -1.\n return key.length === 10 && key >= Math.pow(2, 32);\n}\nfunction $1ec742ad58c16dc0$var$getOwnNonIndexProperties(value) {\n return Object.keys(value).filter($1ec742ad58c16dc0$var$isNonIndex).concat($1ec742ad58c16dc0$var$objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));\n}\n// Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */ function $1ec742ad58c16dc0$var$compare(a, b) {\n if (a === b) return 0;\n var x = a.length;\n var y = b.length;\n for(var i = 0, len = Math.min(x, y); i < len; ++i)if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n}\nvar $1ec742ad58c16dc0$var$ONLY_ENUMERABLE = undefined;\nvar $1ec742ad58c16dc0$var$kStrict = true;\nvar $1ec742ad58c16dc0$var$kLoose = false;\nvar $1ec742ad58c16dc0$var$kNoIterator = 0;\nvar $1ec742ad58c16dc0$var$kIsArray = 1;\nvar $1ec742ad58c16dc0$var$kIsSet = 2;\nvar $1ec742ad58c16dc0$var$kIsMap = 3;\n// Check if they have the same source and flags\nfunction $1ec742ad58c16dc0$var$areSimilarRegExps(a, b) {\n return $1ec742ad58c16dc0$var$regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);\n}\nfunction $1ec742ad58c16dc0$var$areSimilarFloatArrays(a, b) {\n if (a.byteLength !== b.byteLength) return false;\n for(var offset = 0; offset < a.byteLength; offset++){\n if (a[offset] !== b[offset]) return false;\n }\n return true;\n}\nfunction $1ec742ad58c16dc0$var$areSimilarTypedArrays(a, b) {\n if (a.byteLength !== b.byteLength) return false;\n return $1ec742ad58c16dc0$var$compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;\n}\nfunction $1ec742ad58c16dc0$var$areEqualArrayBuffers(buf1, buf2) {\n return buf1.byteLength === buf2.byteLength && $1ec742ad58c16dc0$var$compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;\n}\nfunction $1ec742ad58c16dc0$var$isEqualBoxedPrimitive(val1, val2) {\n if ($1ec742ad58c16dc0$var$isNumberObject(val1)) return $1ec742ad58c16dc0$var$isNumberObject(val2) && $1ec742ad58c16dc0$var$objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));\n if ($1ec742ad58c16dc0$var$isStringObject(val1)) return $1ec742ad58c16dc0$var$isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);\n if ($1ec742ad58c16dc0$var$isBooleanObject(val1)) return $1ec742ad58c16dc0$var$isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);\n if ($1ec742ad58c16dc0$var$isBigIntObject(val1)) return $1ec742ad58c16dc0$var$isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);\n return $1ec742ad58c16dc0$var$isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);\n}\n// Notes: Type tags are historical [[Class]] properties that can be set by\n// FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS\n// and retrieved using Object.prototype.toString.call(obj) in JS\n// See https://tc39.github.io/ecma262/#sec-object.prototype.tostring\n// for a list of tags pre-defined in the spec.\n// There are some unspecified tags in the wild too (e.g. typed array tags).\n// Since tags can be altered, they only serve fast failures\n//\n// Typed arrays and buffers are checked by comparing the content in their\n// underlying ArrayBuffer. This optimization requires that it's\n// reasonable to interpret their underlying memory in the same way,\n// which is checked by comparing their type tags.\n// (e.g. a Uint8Array and a Uint16Array with the same memory content\n// could still be different because they will be interpreted differently).\n//\n// For strict comparison, objects should have\n// a) The same built-in type tags\n// b) The same prototypes.\nfunction $1ec742ad58c16dc0$var$innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? $1ec742ad58c16dc0$var$objectIs(val1, val2) : true;\n }\n // Check more closely if val1 and val2 are equal.\n if (strict) {\n if ($1ec742ad58c16dc0$var$_typeof(val1) !== \"object\") return typeof val1 === \"number\" && $1ec742ad58c16dc0$var$numberIsNaN(val1) && $1ec742ad58c16dc0$var$numberIsNaN(val2);\n if ($1ec742ad58c16dc0$var$_typeof(val2) !== \"object\" || val1 === null || val2 === null) return false;\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) return false;\n } else {\n if (val1 === null || $1ec742ad58c16dc0$var$_typeof(val1) !== \"object\") {\n if (val2 === null || $1ec742ad58c16dc0$var$_typeof(val2) !== \"object\") // eslint-disable-next-line eqeqeq\n return val1 == val2;\n return false;\n }\n if (val2 === null || $1ec742ad58c16dc0$var$_typeof(val2) !== \"object\") return false;\n }\n var val1Tag = $1ec742ad58c16dc0$var$objectToString(val1);\n var val2Tag = $1ec742ad58c16dc0$var$objectToString(val2);\n if (val1Tag !== val2Tag) return false;\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) return false;\n var keys1 = $1ec742ad58c16dc0$var$getOwnNonIndexProperties(val1, $1ec742ad58c16dc0$var$ONLY_ENUMERABLE);\n var keys2 = $1ec742ad58c16dc0$var$getOwnNonIndexProperties(val2, $1ec742ad58c16dc0$var$ONLY_ENUMERABLE);\n if (keys1.length !== keys2.length) return false;\n return $1ec742ad58c16dc0$var$keyCheck(val1, val2, strict, memos, $1ec742ad58c16dc0$var$kIsArray, keys1);\n }\n // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n if (val1Tag === \"[object Object]\") {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!$1ec742ad58c16dc0$var$isMap(val1) && $1ec742ad58c16dc0$var$isMap(val2) || !$1ec742ad58c16dc0$var$isSet(val1) && $1ec742ad58c16dc0$var$isSet(val2)) return false;\n }\n if ($1ec742ad58c16dc0$var$isDate(val1)) {\n if (!$1ec742ad58c16dc0$var$isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) return false;\n } else if ($1ec742ad58c16dc0$var$isRegExp(val1)) {\n if (!$1ec742ad58c16dc0$var$isRegExp(val2) || !$1ec742ad58c16dc0$var$areSimilarRegExps(val1, val2)) return false;\n } else if ($1ec742ad58c16dc0$var$isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) return false;\n } else if ($1ec742ad58c16dc0$var$isArrayBufferView(val1)) {\n if (!strict && ($1ec742ad58c16dc0$var$isFloat32Array(val1) || $1ec742ad58c16dc0$var$isFloat64Array(val1))) {\n if (!$1ec742ad58c16dc0$var$areSimilarFloatArrays(val1, val2)) return false;\n } else if (!$1ec742ad58c16dc0$var$areSimilarTypedArrays(val1, val2)) return false;\n // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n var _keys = $1ec742ad58c16dc0$var$getOwnNonIndexProperties(val1, $1ec742ad58c16dc0$var$ONLY_ENUMERABLE);\n var _keys2 = $1ec742ad58c16dc0$var$getOwnNonIndexProperties(val2, $1ec742ad58c16dc0$var$ONLY_ENUMERABLE);\n if (_keys.length !== _keys2.length) return false;\n return $1ec742ad58c16dc0$var$keyCheck(val1, val2, strict, memos, $1ec742ad58c16dc0$var$kNoIterator, _keys);\n } else if ($1ec742ad58c16dc0$var$isSet(val1)) {\n if (!$1ec742ad58c16dc0$var$isSet(val2) || val1.size !== val2.size) return false;\n return $1ec742ad58c16dc0$var$keyCheck(val1, val2, strict, memos, $1ec742ad58c16dc0$var$kIsSet);\n } else if ($1ec742ad58c16dc0$var$isMap(val1)) {\n if (!$1ec742ad58c16dc0$var$isMap(val2) || val1.size !== val2.size) return false;\n return $1ec742ad58c16dc0$var$keyCheck(val1, val2, strict, memos, $1ec742ad58c16dc0$var$kIsMap);\n } else if ($1ec742ad58c16dc0$var$isAnyArrayBuffer(val1)) {\n if (!$1ec742ad58c16dc0$var$areEqualArrayBuffers(val1, val2)) return false;\n } else if ($1ec742ad58c16dc0$var$isBoxedPrimitive(val1) && !$1ec742ad58c16dc0$var$isEqualBoxedPrimitive(val1, val2)) return false;\n return $1ec742ad58c16dc0$var$keyCheck(val1, val2, strict, memos, $1ec742ad58c16dc0$var$kNoIterator);\n}\nfunction $1ec742ad58c16dc0$var$getEnumerables(val, keys) {\n return keys.filter(function(k) {\n return $1ec742ad58c16dc0$var$propertyIsEnumerable(val, k);\n });\n}\nfunction $1ec742ad58c16dc0$var$keyCheck(val1, val2, strict, memos, iterationType, aKeys) {\n // For all remaining Object pairs, including Array, objects and Maps,\n // equivalence is determined by having:\n // a) The same number of owned enumerable properties\n // b) The same set of keys/indexes (although not necessarily the same order)\n // c) Equivalent values for every corresponding key/index\n // d) For Sets and Maps, equal contents\n // Note: this accounts for both named and indexed properties on Arrays.\n if (arguments.length === 5) {\n aKeys = Object.keys(val1);\n var bKeys = Object.keys(val2);\n // The pair must have the same number of owned properties.\n if (aKeys.length !== bKeys.length) return false;\n }\n // Cheap key test\n var i = 0;\n for(; i < aKeys.length; i++){\n if (!$1ec742ad58c16dc0$var$hasOwnProperty(val2, aKeys[i])) return false;\n }\n if (strict && arguments.length === 5) {\n var symbolKeysA = $1ec742ad58c16dc0$var$objectGetOwnPropertySymbols(val1);\n if (symbolKeysA.length !== 0) {\n var count = 0;\n for(i = 0; i < symbolKeysA.length; i++){\n var key = symbolKeysA[i];\n if ($1ec742ad58c16dc0$var$propertyIsEnumerable(val1, key)) {\n if (!$1ec742ad58c16dc0$var$propertyIsEnumerable(val2, key)) return false;\n aKeys.push(key);\n count++;\n } else if ($1ec742ad58c16dc0$var$propertyIsEnumerable(val2, key)) return false;\n }\n var symbolKeysB = $1ec742ad58c16dc0$var$objectGetOwnPropertySymbols(val2);\n if (symbolKeysA.length !== symbolKeysB.length && $1ec742ad58c16dc0$var$getEnumerables(val2, symbolKeysB).length !== count) return false;\n } else {\n var _symbolKeysB = $1ec742ad58c16dc0$var$objectGetOwnPropertySymbols(val2);\n if (_symbolKeysB.length !== 0 && $1ec742ad58c16dc0$var$getEnumerables(val2, _symbolKeysB).length !== 0) return false;\n }\n }\n if (aKeys.length === 0 && (iterationType === $1ec742ad58c16dc0$var$kNoIterator || iterationType === $1ec742ad58c16dc0$var$kIsArray && val1.length === 0 || val1.size === 0)) return true;\n // Use memos to handle cycles.\n if (memos === undefined) memos = {\n val1: new Map(),\n val2: new Map(),\n position: 0\n };\n else {\n // We prevent up to two map.has(x) calls by directly retrieving the value\n // and checking for undefined. The map can only contain numbers, so it is\n // safe to check for undefined only.\n var val2MemoA = memos.val1.get(val1);\n if (val2MemoA !== undefined) {\n var val2MemoB = memos.val2.get(val2);\n if (val2MemoB !== undefined) return val2MemoA === val2MemoB;\n }\n memos.position++;\n }\n memos.val1.set(val1, memos.position);\n memos.val2.set(val2, memos.position);\n var areEq = $1ec742ad58c16dc0$var$objEquiv(val1, val2, strict, aKeys, memos, iterationType);\n memos.val1.delete(val1);\n memos.val2.delete(val2);\n return areEq;\n}\nfunction $1ec742ad58c16dc0$var$setHasEqualElement(set, val1, strict, memo) {\n // Go looking.\n var setValues = $1ec742ad58c16dc0$var$arrayFromSet(set);\n for(var i = 0; i < setValues.length; i++){\n var val2 = setValues[i];\n if ($1ec742ad58c16dc0$var$innerDeepEqual(val1, val2, strict, memo)) {\n // Remove the matching element to make sure we do not check that again.\n set.delete(val2);\n return true;\n }\n }\n return false;\n}\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using\n// Sadly it is not possible to detect corresponding values properly in case the\n// type is a string, number, bigint or boolean. The reason is that those values\n// can match lots of different string values (e.g., 1n == '+00001').\nfunction $1ec742ad58c16dc0$var$findLooseMatchingPrimitives(prim) {\n switch($1ec742ad58c16dc0$var$_typeof(prim)){\n case \"undefined\":\n return null;\n case \"object\":\n // Only pass in null as object!\n return undefined;\n case \"symbol\":\n return false;\n case \"string\":\n prim = +prim;\n // Loose equal entries exist only if the string is possible to convert to\n // a regular number and not NaN.\n // Fall through\n case \"number\":\n if ($1ec742ad58c16dc0$var$numberIsNaN(prim)) return false;\n }\n return true;\n}\nfunction $1ec742ad58c16dc0$var$setMightHaveLoosePrim(a, b, prim) {\n var altValue = $1ec742ad58c16dc0$var$findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n return b.has(altValue) && !a.has(altValue);\n}\nfunction $1ec742ad58c16dc0$var$mapMightHaveLoosePrim(a, b, prim, item, memo) {\n var altValue = $1ec742ad58c16dc0$var$findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n var curB = b.get(altValue);\n if (curB === undefined && !b.has(altValue) || !$1ec742ad58c16dc0$var$innerDeepEqual(item, curB, false, memo)) return false;\n return !a.has(altValue) && $1ec742ad58c16dc0$var$innerDeepEqual(item, curB, false, memo);\n}\nfunction $1ec742ad58c16dc0$var$setEquiv(a, b, strict, memo) {\n // This is a lazily initiated Set of entries which have to be compared\n // pairwise.\n var set = null;\n var aValues = $1ec742ad58c16dc0$var$arrayFromSet(a);\n for(var i = 0; i < aValues.length; i++){\n var val = aValues[i];\n // Note: Checking for the objects first improves the performance for object\n // heavy sets but it is a minor slow down for primitives. As they are fast\n // to check this improves the worst case scenario instead.\n if ($1ec742ad58c16dc0$var$_typeof(val) === \"object\" && val !== null) {\n if (set === null) set = new Set();\n // If the specified value doesn't exist in the second set its an not null\n // object (or non strict only: a not matching primitive) we'll need to go\n // hunting for something thats deep-(strict-)equal to it. To make this\n // O(n log n) complexity we have to copy these values in a new set first.\n set.add(val);\n } else if (!b.has(val)) {\n if (strict) return false;\n // Fast path to detect missing string, symbol, undefined and null values.\n if (!$1ec742ad58c16dc0$var$setMightHaveLoosePrim(a, b, val)) return false;\n if (set === null) set = new Set();\n set.add(val);\n }\n }\n if (set !== null) {\n var bValues = $1ec742ad58c16dc0$var$arrayFromSet(b);\n for(var _i = 0; _i < bValues.length; _i++){\n var _val = bValues[_i];\n // We have to check if a primitive value is already\n // matching and only if it's not, go hunting for it.\n if ($1ec742ad58c16dc0$var$_typeof(_val) === \"object\" && _val !== null) {\n if (!$1ec742ad58c16dc0$var$setHasEqualElement(set, _val, strict, memo)) return false;\n } else if (!strict && !a.has(_val) && !$1ec742ad58c16dc0$var$setHasEqualElement(set, _val, strict, memo)) return false;\n }\n return set.size === 0;\n }\n return true;\n}\nfunction $1ec742ad58c16dc0$var$mapHasEqualEntry(set, map, key1, item1, strict, memo) {\n // To be able to handle cases like:\n // Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']])\n // ... we need to consider *all* matching keys, not just the first we find.\n var setValues = $1ec742ad58c16dc0$var$arrayFromSet(set);\n for(var i = 0; i < setValues.length; i++){\n var key2 = setValues[i];\n if ($1ec742ad58c16dc0$var$innerDeepEqual(key1, key2, strict, memo) && $1ec742ad58c16dc0$var$innerDeepEqual(item1, map.get(key2), strict, memo)) {\n set.delete(key2);\n return true;\n }\n }\n return false;\n}\nfunction $1ec742ad58c16dc0$var$mapEquiv(a, b, strict, memo) {\n var set = null;\n var aEntries = $1ec742ad58c16dc0$var$arrayFromMap(a);\n for(var i = 0; i < aEntries.length; i++){\n var _aEntries$i = $1ec742ad58c16dc0$var$_slicedToArray(aEntries[i], 2), key = _aEntries$i[0], item1 = _aEntries$i[1];\n if ($1ec742ad58c16dc0$var$_typeof(key) === \"object\" && key !== null) {\n if (set === null) set = new Set();\n set.add(key);\n } else {\n // By directly retrieving the value we prevent another b.has(key) check in\n // almost all possible cases.\n var item2 = b.get(key);\n if (item2 === undefined && !b.has(key) || !$1ec742ad58c16dc0$var$innerDeepEqual(item1, item2, strict, memo)) {\n if (strict) return false;\n // Fast path to detect missing string, symbol, undefined and null\n // keys.\n if (!$1ec742ad58c16dc0$var$mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;\n if (set === null) set = new Set();\n set.add(key);\n }\n }\n }\n if (set !== null) {\n var bEntries = $1ec742ad58c16dc0$var$arrayFromMap(b);\n for(var _i2 = 0; _i2 < bEntries.length; _i2++){\n var _bEntries$_i = $1ec742ad58c16dc0$var$_slicedToArray(bEntries[_i2], 2), _key = _bEntries$_i[0], item = _bEntries$_i[1];\n if ($1ec742ad58c16dc0$var$_typeof(_key) === \"object\" && _key !== null) {\n if (!$1ec742ad58c16dc0$var$mapHasEqualEntry(set, a, _key, item, strict, memo)) return false;\n } else if (!strict && (!a.has(_key) || !$1ec742ad58c16dc0$var$innerDeepEqual(a.get(_key), item, false, memo)) && !$1ec742ad58c16dc0$var$mapHasEqualEntry(set, a, _key, item, false, memo)) return false;\n }\n return set.size === 0;\n }\n return true;\n}\nfunction $1ec742ad58c16dc0$var$objEquiv(a, b, strict, keys, memos, iterationType) {\n // Sets and maps don't have their entries accessible via normal object\n // properties.\n var i = 0;\n if (iterationType === $1ec742ad58c16dc0$var$kIsSet) {\n if (!$1ec742ad58c16dc0$var$setEquiv(a, b, strict, memos)) return false;\n } else if (iterationType === $1ec742ad58c16dc0$var$kIsMap) {\n if (!$1ec742ad58c16dc0$var$mapEquiv(a, b, strict, memos)) return false;\n } else if (iterationType === $1ec742ad58c16dc0$var$kIsArray) for(; i < a.length; i++){\n if ($1ec742ad58c16dc0$var$hasOwnProperty(a, i)) {\n if (!$1ec742ad58c16dc0$var$hasOwnProperty(b, i) || !$1ec742ad58c16dc0$var$innerDeepEqual(a[i], b[i], strict, memos)) return false;\n } else if ($1ec742ad58c16dc0$var$hasOwnProperty(b, i)) return false;\n else {\n // Array is sparse.\n var keysA = Object.keys(a);\n for(; i < keysA.length; i++){\n var key = keysA[i];\n if (!$1ec742ad58c16dc0$var$hasOwnProperty(b, key) || !$1ec742ad58c16dc0$var$innerDeepEqual(a[key], b[key], strict, memos)) return false;\n }\n if (keysA.length !== Object.keys(b).length) return false;\n return true;\n }\n }\n // The pair must have equivalent values for every corresponding key.\n // Possibly expensive deep test:\n for(i = 0; i < keys.length; i++){\n var _key2 = keys[i];\n if (!$1ec742ad58c16dc0$var$innerDeepEqual(a[_key2], b[_key2], strict, memos)) return false;\n }\n return true;\n}\nfunction $1ec742ad58c16dc0$var$isDeepEqual(val1, val2) {\n return $1ec742ad58c16dc0$var$innerDeepEqual(val1, val2, $1ec742ad58c16dc0$var$kLoose);\n}\nfunction $1ec742ad58c16dc0$var$isDeepStrictEqual(val1, val2) {\n return $1ec742ad58c16dc0$var$innerDeepEqual(val1, val2, $1ec742ad58c16dc0$var$kStrict);\n}\nmodule.exports = {\n isDeepEqual: $1ec742ad58c16dc0$var$isDeepEqual,\n isDeepStrictEqual: $1ec742ad58c16dc0$var$isDeepStrictEqual\n};\n\n});\nparcelRegister(\"fREgm\", function(module, exports) {\n\"use strict\";\n\nvar $8VOI3 = parcelRequire(\"8VOI3\");\n\nvar $70X2U = parcelRequire(\"70X2U\");\n\nvar $bX2ce = parcelRequire(\"bX2ce\");\n\nvar $bxl1N = parcelRequire(\"bxl1N\");\n\nvar $ePB6U = parcelRequire(\"ePB6U\");\nvar $b8cb099cb9d2d4c2$var$polyfill = $70X2U($bxl1N(), Object);\n$8VOI3($b8cb099cb9d2d4c2$var$polyfill, {\n getPolyfill: $bxl1N,\n implementation: $bX2ce,\n shim: $ePB6U\n});\nmodule.exports = $b8cb099cb9d2d4c2$var$polyfill;\n\n});\nparcelRegister(\"8VOI3\", function(module, exports) {\n\"use strict\";\n\nvar $gK6Se = parcelRequire(\"gK6Se\");\nvar $680afb7864027f81$var$hasSymbols = typeof Symbol === \"function\" && typeof Symbol(\"foo\") === \"symbol\";\nvar $680afb7864027f81$var$toStr = Object.prototype.toString;\nvar $680afb7864027f81$var$concat = Array.prototype.concat;\n\nvar $eHoge = parcelRequire(\"eHoge\");\nvar $680afb7864027f81$var$isFunction = function(fn) {\n return typeof fn === \"function\" && $680afb7864027f81$var$toStr.call(fn) === \"[object Function]\";\n};\n\nvar $680afb7864027f81$var$supportsDescriptors = (parcelRequire(\"gkTZB\"))();\nvar $680afb7864027f81$var$defineProperty = function(object, name, value, predicate) {\n if (name in object) {\n if (predicate === true) {\n if (object[name] === value) return;\n } else if (!$680afb7864027f81$var$isFunction(predicate) || !predicate()) return;\n }\n if ($680afb7864027f81$var$supportsDescriptors) $eHoge(object, name, value, true);\n else $eHoge(object, name, value);\n};\nvar $680afb7864027f81$var$defineProperties = function(object, map) {\n var predicates = arguments.length > 2 ? arguments[2] : {};\n var props = $gK6Se(map);\n if ($680afb7864027f81$var$hasSymbols) props = $680afb7864027f81$var$concat.call(props, Object.getOwnPropertySymbols(map));\n for(var i = 0; i < props.length; i += 1)$680afb7864027f81$var$defineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n};\n$680afb7864027f81$var$defineProperties.supportsDescriptors = !!$680afb7864027f81$var$supportsDescriptors;\nmodule.exports = $680afb7864027f81$var$defineProperties;\n\n});\n\nparcelRegister(\"ePB6U\", function(module, exports) {\n\"use strict\";\n\nvar $bxl1N = parcelRequire(\"bxl1N\");\n\nvar $8VOI3 = parcelRequire(\"8VOI3\");\nmodule.exports = function shimObjectIs() {\n var polyfill = $bxl1N();\n $8VOI3(Object, {\n is: polyfill\n }, {\n is: function testObjectIs() {\n return Object.is !== polyfill;\n }\n });\n return polyfill;\n};\n\n});\n\n\nparcelRegister(\"1SiBw\", function(module, exports) {\n\"use strict\";\n\nvar $70X2U = parcelRequire(\"70X2U\");\n\nvar $8VOI3 = parcelRequire(\"8VOI3\");\n\nvar $aS0hY = parcelRequire(\"aS0hY\");\n\nvar $03yTy = parcelRequire(\"03yTy\");\n\nvar $hK2wk = parcelRequire(\"hK2wk\");\nvar $15d943fc9df10d4c$var$polyfill = $70X2U($03yTy(), Number);\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ $8VOI3($15d943fc9df10d4c$var$polyfill, {\n getPolyfill: $03yTy,\n implementation: $aS0hY,\n shim: $hK2wk\n});\nmodule.exports = $15d943fc9df10d4c$var$polyfill;\n\n});\nparcelRegister(\"aS0hY\", function(module, exports) {\n\"use strict\";\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function isNaN(value) {\n return value !== value;\n};\n\n});\n\nparcelRegister(\"03yTy\", function(module, exports) {\n\"use strict\";\n\nvar $aS0hY = parcelRequire(\"aS0hY\");\nmodule.exports = function getPolyfill() {\n if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN(\"a\")) return Number.isNaN;\n return $aS0hY;\n};\n\n});\n\nparcelRegister(\"hK2wk\", function(module, exports) {\n\"use strict\";\n\nvar $8VOI3 = parcelRequire(\"8VOI3\");\n\nvar $03yTy = parcelRequire(\"03yTy\");\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function shimNumberIsNaN() {\n var polyfill = $03yTy();\n $8VOI3(Number, {\n isNaN: polyfill\n }, {\n isNaN: function testIsNaN() {\n return Number.isNaN !== polyfill;\n }\n });\n return polyfill;\n};\n\n});\n\n\n\n\n\nvar $cgw1K = parcelRequire(\"cgw1K\");\n/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */ function $d732417b6401265c$export$1e71eb4bef00f6b0(obj, key, value) {\n if (key in obj) Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n else obj[key] = value;\n return obj;\n}\n\n\n/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */ /*!\n * @kurkle/color v0.3.2\n * https://github.com/kurkle/color#readme\n * (c) 2023 Jukka Kurkela\n * Released under the MIT License\n */ function $96d3e3c23d8fed31$export$2077e0241d6afd3c(v) {\n return v + 0.5 | 0;\n}\nconst $96d3e3c23d8fed31$export$837ba5c449269406 = (v, l, h)=>Math.max(Math.min(v, h), l);\nfunction $96d3e3c23d8fed31$export$bcc6e673dfa14d36(v) {\n return $96d3e3c23d8fed31$export$837ba5c449269406($96d3e3c23d8fed31$export$2077e0241d6afd3c(v * 2.55), 0, 255);\n}\nfunction $96d3e3c23d8fed31$export$869b26d4e1bbdb63(v) {\n return $96d3e3c23d8fed31$export$837ba5c449269406($96d3e3c23d8fed31$export$2077e0241d6afd3c(v / 2.55), 0, 100);\n}\nfunction $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6(v) {\n return $96d3e3c23d8fed31$export$837ba5c449269406($96d3e3c23d8fed31$export$2077e0241d6afd3c(v * 255), 0, 255);\n}\nfunction $96d3e3c23d8fed31$export$dbf961a8d278dbef(v) {\n return $96d3e3c23d8fed31$export$837ba5c449269406($96d3e3c23d8fed31$export$2077e0241d6afd3c(v / 2.55) / 100, 0, 1);\n}\nfunction $96d3e3c23d8fed31$export$aa35ef1f24408ab9(v) {\n return $96d3e3c23d8fed31$export$837ba5c449269406($96d3e3c23d8fed31$export$2077e0241d6afd3c(v * 100), 0, 100);\n}\nconst $96d3e3c23d8fed31$var$map$1 = {\n 0: 0,\n 1: 1,\n 2: 2,\n 3: 3,\n 4: 4,\n 5: 5,\n 6: 6,\n 7: 7,\n 8: 8,\n 9: 9,\n A: 10,\n B: 11,\n C: 12,\n D: 13,\n E: 14,\n F: 15,\n a: 10,\n b: 11,\n c: 12,\n d: 13,\n e: 14,\n f: 15\n};\nconst $96d3e3c23d8fed31$var$hex = [\n ...\"0123456789ABCDEF\"\n];\nconst $96d3e3c23d8fed31$var$h1 = (b)=>$96d3e3c23d8fed31$var$hex[b & 0xF];\nconst $96d3e3c23d8fed31$var$h2 = (b)=>$96d3e3c23d8fed31$var$hex[(b & 0xF0) >> 4] + $96d3e3c23d8fed31$var$hex[b & 0xF];\nconst $96d3e3c23d8fed31$var$eq = (b)=>(b & 0xF0) >> 4 === (b & 0xF);\nconst $96d3e3c23d8fed31$var$isShort = (v)=>$96d3e3c23d8fed31$var$eq(v.r) && $96d3e3c23d8fed31$var$eq(v.g) && $96d3e3c23d8fed31$var$eq(v.b) && $96d3e3c23d8fed31$var$eq(v.a);\nfunction $96d3e3c23d8fed31$export$625a38b961e8b5e9(str) {\n var len = str.length;\n var ret;\n if (str[0] === \"#\") {\n if (len === 4 || len === 5) ret = {\n r: 255 & $96d3e3c23d8fed31$var$map$1[str[1]] * 17,\n g: 255 & $96d3e3c23d8fed31$var$map$1[str[2]] * 17,\n b: 255 & $96d3e3c23d8fed31$var$map$1[str[3]] * 17,\n a: len === 5 ? $96d3e3c23d8fed31$var$map$1[str[4]] * 17 : 255\n };\n else if (len === 7 || len === 9) ret = {\n r: $96d3e3c23d8fed31$var$map$1[str[1]] << 4 | $96d3e3c23d8fed31$var$map$1[str[2]],\n g: $96d3e3c23d8fed31$var$map$1[str[3]] << 4 | $96d3e3c23d8fed31$var$map$1[str[4]],\n b: $96d3e3c23d8fed31$var$map$1[str[5]] << 4 | $96d3e3c23d8fed31$var$map$1[str[6]],\n a: len === 9 ? $96d3e3c23d8fed31$var$map$1[str[7]] << 4 | $96d3e3c23d8fed31$var$map$1[str[8]] : 255\n };\n }\n return ret;\n}\nconst $96d3e3c23d8fed31$var$alpha = (a, f)=>a < 255 ? f(a) : \"\";\nfunction $96d3e3c23d8fed31$export$1b06654353ef9f67(v) {\n var f = $96d3e3c23d8fed31$var$isShort(v) ? $96d3e3c23d8fed31$var$h1 : $96d3e3c23d8fed31$var$h2;\n return v ? \"#\" + f(v.r) + f(v.g) + f(v.b) + $96d3e3c23d8fed31$var$alpha(v.a, f) : undefined;\n}\nconst $96d3e3c23d8fed31$var$HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction $96d3e3c23d8fed31$var$hsl2rgbn(h, s, l) {\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12)=>l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [\n f(0),\n f(8),\n f(4)\n ];\n}\nfunction $96d3e3c23d8fed31$var$hsv2rgbn(h, s, v) {\n const f = (n, k = (n + h / 60) % 6)=>v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n return [\n f(5),\n f(3),\n f(1)\n ];\n}\nfunction $96d3e3c23d8fed31$var$hwb2rgbn(h, w, b) {\n const rgb = $96d3e3c23d8fed31$var$hsl2rgbn(h, 1, 0.5);\n let i;\n if (w + b > 1) {\n i = 1 / (w + b);\n w *= i;\n b *= i;\n }\n for(i = 0; i < 3; i++){\n rgb[i] *= 1 - w - b;\n rgb[i] += w;\n }\n return rgb;\n}\nfunction $96d3e3c23d8fed31$var$hueValue(r, g, b, d, max) {\n if (r === max) return (g - b) / d + (g < b ? 6 : 0);\n if (g === max) return (b - r) / d + 2;\n return (r - g) / d + 4;\n}\nfunction $96d3e3c23d8fed31$export$b5ba70b240f8f7f(v) {\n const range = 255;\n const r = v.r / range;\n const g = v.g / range;\n const b = v.b / range;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s, d;\n if (max !== min) {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = $96d3e3c23d8fed31$var$hueValue(r, g, b, d, max);\n h = h * 60 + 0.5;\n }\n return [\n h | 0,\n s || 0,\n l\n ];\n}\nfunction $96d3e3c23d8fed31$var$calln(f, a, b, c) {\n return (Array.isArray(a) ? f(a[0], a[1], a[2]) : f(a, b, c)).map($96d3e3c23d8fed31$export$ed9bd8dcaeba14f6);\n}\nfunction $96d3e3c23d8fed31$export$4c15bd42559b811d(h, s, l) {\n return $96d3e3c23d8fed31$var$calln($96d3e3c23d8fed31$var$hsl2rgbn, h, s, l);\n}\nfunction $96d3e3c23d8fed31$export$e2710022c70fc9ee(h, w, b) {\n return $96d3e3c23d8fed31$var$calln($96d3e3c23d8fed31$var$hwb2rgbn, h, w, b);\n}\nfunction $96d3e3c23d8fed31$export$b785a357c84e4a04(h, s, v) {\n return $96d3e3c23d8fed31$var$calln($96d3e3c23d8fed31$var$hsv2rgbn, h, s, v);\n}\nfunction $96d3e3c23d8fed31$var$hue(h) {\n return (h % 360 + 360) % 360;\n}\nfunction $96d3e3c23d8fed31$export$5e91288c399be4f9(str) {\n const m = $96d3e3c23d8fed31$var$HUE_RE.exec(str);\n let a = 255;\n let v;\n if (!m) return;\n if (m[5] !== v) a = m[6] ? $96d3e3c23d8fed31$export$bcc6e673dfa14d36(+m[5]) : $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6(+m[5]);\n const h = $96d3e3c23d8fed31$var$hue(+m[2]);\n const p1 = +m[3] / 100;\n const p2 = +m[4] / 100;\n if (m[1] === \"hwb\") v = $96d3e3c23d8fed31$export$e2710022c70fc9ee(h, p1, p2);\n else if (m[1] === \"hsv\") v = $96d3e3c23d8fed31$export$b785a357c84e4a04(h, p1, p2);\n else v = $96d3e3c23d8fed31$export$4c15bd42559b811d(h, p1, p2);\n return {\n r: v[0],\n g: v[1],\n b: v[2],\n a: a\n };\n}\nfunction $96d3e3c23d8fed31$export$bb628a54ab399bc9(v, deg) {\n var h = $96d3e3c23d8fed31$export$b5ba70b240f8f7f(v);\n h[0] = $96d3e3c23d8fed31$var$hue(h[0] + deg);\n h = $96d3e3c23d8fed31$export$4c15bd42559b811d(h);\n v.r = h[0];\n v.g = h[1];\n v.b = h[2];\n}\nfunction $96d3e3c23d8fed31$export$a197af1c58e6260c(v) {\n if (!v) return;\n const a = $96d3e3c23d8fed31$export$b5ba70b240f8f7f(v);\n const h = a[0];\n const s = $96d3e3c23d8fed31$export$aa35ef1f24408ab9(a[1]);\n const l = $96d3e3c23d8fed31$export$aa35ef1f24408ab9(a[2]);\n return v.a < 255 ? `hsla(${h}, ${s}%, ${l}%, ${$96d3e3c23d8fed31$export$dbf961a8d278dbef(v.a)})` : `hsl(${h}, ${s}%, ${l}%)`;\n}\nconst $96d3e3c23d8fed31$var$map = {\n x: \"dark\",\n Z: \"light\",\n Y: \"re\",\n X: \"blu\",\n W: \"gr\",\n V: \"medium\",\n U: \"slate\",\n A: \"ee\",\n T: \"ol\",\n S: \"or\",\n B: \"ra\",\n C: \"lateg\",\n D: \"ights\",\n R: \"in\",\n Q: \"turquois\",\n E: \"hi\",\n P: \"ro\",\n O: \"al\",\n N: \"le\",\n M: \"de\",\n L: \"yello\",\n F: \"en\",\n K: \"ch\",\n G: \"arks\",\n H: \"ea\",\n I: \"ightg\",\n J: \"wh\"\n};\nconst $96d3e3c23d8fed31$var$names$1 = {\n OiceXe: \"f0f8ff\",\n antiquewEte: \"faebd7\",\n aqua: \"ffff\",\n aquamarRe: \"7fffd4\",\n azuY: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"0\",\n blanKedOmond: \"ffebcd\",\n Xe: \"ff\",\n XeviTet: \"8a2be2\",\n bPwn: \"a52a2a\",\n burlywood: \"deb887\",\n caMtXe: \"5f9ea0\",\n KartYuse: \"7fff00\",\n KocTate: \"d2691e\",\n cSO: \"ff7f50\",\n cSnflowerXe: \"6495ed\",\n cSnsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"ffff\",\n xXe: \"8b\",\n xcyan: \"8b8b\",\n xgTMnPd: \"b8860b\",\n xWay: \"a9a9a9\",\n xgYF: \"6400\",\n xgYy: \"a9a9a9\",\n xkhaki: \"bdb76b\",\n xmagFta: \"8b008b\",\n xTivegYF: \"556b2f\",\n xSange: \"ff8c00\",\n xScEd: \"9932cc\",\n xYd: \"8b0000\",\n xsOmon: \"e9967a\",\n xsHgYF: \"8fbc8f\",\n xUXe: \"483d8b\",\n xUWay: \"2f4f4f\",\n xUgYy: \"2f4f4f\",\n xQe: \"ced1\",\n xviTet: \"9400d3\",\n dAppRk: \"ff1493\",\n dApskyXe: \"bfff\",\n dimWay: \"696969\",\n dimgYy: \"696969\",\n dodgerXe: \"1e90ff\",\n fiYbrick: \"b22222\",\n flSOwEte: \"fffaf0\",\n foYstWAn: \"228b22\",\n fuKsia: \"ff00ff\",\n gaRsbSo: \"dcdcdc\",\n ghostwEte: \"f8f8ff\",\n gTd: \"ffd700\",\n gTMnPd: \"daa520\",\n Way: \"808080\",\n gYF: \"8000\",\n gYFLw: \"adff2f\",\n gYy: \"808080\",\n honeyMw: \"f0fff0\",\n hotpRk: \"ff69b4\",\n RdianYd: \"cd5c5c\",\n Rdigo: \"4b0082\",\n ivSy: \"fffff0\",\n khaki: \"f0e68c\",\n lavFMr: \"e6e6fa\",\n lavFMrXsh: \"fff0f5\",\n lawngYF: \"7cfc00\",\n NmoncEffon: \"fffacd\",\n ZXe: \"add8e6\",\n ZcSO: \"f08080\",\n Zcyan: \"e0ffff\",\n ZgTMnPdLw: \"fafad2\",\n ZWay: \"d3d3d3\",\n ZgYF: \"90ee90\",\n ZgYy: \"d3d3d3\",\n ZpRk: \"ffb6c1\",\n ZsOmon: \"ffa07a\",\n ZsHgYF: \"20b2aa\",\n ZskyXe: \"87cefa\",\n ZUWay: \"778899\",\n ZUgYy: \"778899\",\n ZstAlXe: \"b0c4de\",\n ZLw: \"ffffe0\",\n lime: \"ff00\",\n limegYF: \"32cd32\",\n lRF: \"faf0e6\",\n magFta: \"ff00ff\",\n maPon: \"800000\",\n VaquamarRe: \"66cdaa\",\n VXe: \"cd\",\n VScEd: \"ba55d3\",\n VpurpN: \"9370db\",\n VsHgYF: \"3cb371\",\n VUXe: \"7b68ee\",\n VsprRggYF: \"fa9a\",\n VQe: \"48d1cc\",\n VviTetYd: \"c71585\",\n midnightXe: \"191970\",\n mRtcYam: \"f5fffa\",\n mistyPse: \"ffe4e1\",\n moccasR: \"ffe4b5\",\n navajowEte: \"ffdead\",\n navy: \"80\",\n Tdlace: \"fdf5e6\",\n Tive: \"808000\",\n TivedBb: \"6b8e23\",\n Sange: \"ffa500\",\n SangeYd: \"ff4500\",\n ScEd: \"da70d6\",\n pOegTMnPd: \"eee8aa\",\n pOegYF: \"98fb98\",\n pOeQe: \"afeeee\",\n pOeviTetYd: \"db7093\",\n papayawEp: \"ffefd5\",\n pHKpuff: \"ffdab9\",\n peru: \"cd853f\",\n pRk: \"ffc0cb\",\n plum: \"dda0dd\",\n powMrXe: \"b0e0e6\",\n purpN: \"800080\",\n YbeccapurpN: \"663399\",\n Yd: \"ff0000\",\n Psybrown: \"bc8f8f\",\n PyOXe: \"4169e1\",\n saddNbPwn: \"8b4513\",\n sOmon: \"fa8072\",\n sandybPwn: \"f4a460\",\n sHgYF: \"2e8b57\",\n sHshell: \"fff5ee\",\n siFna: \"a0522d\",\n silver: \"c0c0c0\",\n skyXe: \"87ceeb\",\n UXe: \"6a5acd\",\n UWay: \"708090\",\n UgYy: \"708090\",\n snow: \"fffafa\",\n sprRggYF: \"ff7f\",\n stAlXe: \"4682b4\",\n tan: \"d2b48c\",\n teO: \"8080\",\n tEstN: \"d8bfd8\",\n tomato: \"ff6347\",\n Qe: \"40e0d0\",\n viTet: \"ee82ee\",\n JHt: \"f5deb3\",\n wEte: \"ffffff\",\n wEtesmoke: \"f5f5f5\",\n Lw: \"ffff00\",\n LwgYF: \"9acd32\"\n};\nfunction $96d3e3c23d8fed31$var$unpack() {\n const unpacked = {};\n const keys = Object.keys($96d3e3c23d8fed31$var$names$1);\n const tkeys = Object.keys($96d3e3c23d8fed31$var$map);\n let i, j, k, ok, nk;\n for(i = 0; i < keys.length; i++){\n ok = nk = keys[i];\n for(j = 0; j < tkeys.length; j++){\n k = tkeys[j];\n nk = nk.replace(k, $96d3e3c23d8fed31$var$map[k]);\n }\n k = parseInt($96d3e3c23d8fed31$var$names$1[ok], 16);\n unpacked[nk] = [\n k >> 16 & 0xFF,\n k >> 8 & 0xFF,\n k & 0xFF\n ];\n }\n return unpacked;\n}\nlet $96d3e3c23d8fed31$var$names;\nfunction $96d3e3c23d8fed31$export$b2f06b640faad956(str) {\n if (!$96d3e3c23d8fed31$var$names) {\n $96d3e3c23d8fed31$var$names = $96d3e3c23d8fed31$var$unpack();\n $96d3e3c23d8fed31$var$names.transparent = [\n 0,\n 0,\n 0,\n 0\n ];\n }\n const a = $96d3e3c23d8fed31$var$names[str.toLowerCase()];\n return a && {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length === 4 ? a[3] : 255\n };\n}\nconst $96d3e3c23d8fed31$var$RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction $96d3e3c23d8fed31$export$91aedb20f296e541(str) {\n const m = $96d3e3c23d8fed31$var$RGB_RE.exec(str);\n let a = 255;\n let r, g, b;\n if (!m) return;\n if (m[7] !== r) {\n const v = +m[7];\n a = m[8] ? $96d3e3c23d8fed31$export$bcc6e673dfa14d36(v) : $96d3e3c23d8fed31$export$837ba5c449269406(v * 255, 0, 255);\n }\n r = +m[1];\n g = +m[3];\n b = +m[5];\n r = 255 & (m[2] ? $96d3e3c23d8fed31$export$bcc6e673dfa14d36(r) : $96d3e3c23d8fed31$export$837ba5c449269406(r, 0, 255));\n g = 255 & (m[4] ? $96d3e3c23d8fed31$export$bcc6e673dfa14d36(g) : $96d3e3c23d8fed31$export$837ba5c449269406(g, 0, 255));\n b = 255 & (m[6] ? $96d3e3c23d8fed31$export$bcc6e673dfa14d36(b) : $96d3e3c23d8fed31$export$837ba5c449269406(b, 0, 255));\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\nfunction $96d3e3c23d8fed31$export$9595423f22cf925a(v) {\n return v && (v.a < 255 ? `rgba(${v.r}, ${v.g}, ${v.b}, ${$96d3e3c23d8fed31$export$dbf961a8d278dbef(v.a)})` : `rgb(${v.r}, ${v.g}, ${v.b})`);\n}\nconst $96d3e3c23d8fed31$var$to = (v)=>v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst $96d3e3c23d8fed31$var$from = (v)=>v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction $96d3e3c23d8fed31$var$interpolate(rgb1, rgb2, t) {\n const r = $96d3e3c23d8fed31$var$from($96d3e3c23d8fed31$export$dbf961a8d278dbef(rgb1.r));\n const g = $96d3e3c23d8fed31$var$from($96d3e3c23d8fed31$export$dbf961a8d278dbef(rgb1.g));\n const b = $96d3e3c23d8fed31$var$from($96d3e3c23d8fed31$export$dbf961a8d278dbef(rgb1.b));\n return {\n r: $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6($96d3e3c23d8fed31$var$to(r + t * ($96d3e3c23d8fed31$var$from($96d3e3c23d8fed31$export$dbf961a8d278dbef(rgb2.r)) - r))),\n g: $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6($96d3e3c23d8fed31$var$to(g + t * ($96d3e3c23d8fed31$var$from($96d3e3c23d8fed31$export$dbf961a8d278dbef(rgb2.g)) - g))),\n b: $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6($96d3e3c23d8fed31$var$to(b + t * ($96d3e3c23d8fed31$var$from($96d3e3c23d8fed31$export$dbf961a8d278dbef(rgb2.b)) - b))),\n a: rgb1.a + t * (rgb2.a - rgb1.a)\n };\n}\nfunction $96d3e3c23d8fed31$var$modHSL(v, i, ratio) {\n if (v) {\n let tmp = $96d3e3c23d8fed31$export$b5ba70b240f8f7f(v);\n tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n tmp = $96d3e3c23d8fed31$export$4c15bd42559b811d(tmp);\n v.r = tmp[0];\n v.g = tmp[1];\n v.b = tmp[2];\n }\n}\nfunction $96d3e3c23d8fed31$var$clone(v, proto) {\n return v ? Object.assign(proto || {}, v) : v;\n}\nfunction $96d3e3c23d8fed31$var$fromObject(input) {\n var v = {\n r: 0,\n g: 0,\n b: 0,\n a: 255\n };\n if (Array.isArray(input)) {\n if (input.length >= 3) {\n v = {\n r: input[0],\n g: input[1],\n b: input[2],\n a: 255\n };\n if (input.length > 3) v.a = $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6(input[3]);\n }\n } else {\n v = $96d3e3c23d8fed31$var$clone(input, {\n r: 0,\n g: 0,\n b: 0,\n a: 1\n });\n v.a = $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6(v.a);\n }\n return v;\n}\nfunction $96d3e3c23d8fed31$var$functionParse(str) {\n if (str.charAt(0) === \"r\") return $96d3e3c23d8fed31$export$91aedb20f296e541(str);\n return $96d3e3c23d8fed31$export$5e91288c399be4f9(str);\n}\nclass $96d3e3c23d8fed31$export$892596cec99bc70e {\n get valid() {\n return this._valid;\n }\n get rgb() {\n var v = $96d3e3c23d8fed31$var$clone(this._rgb);\n if (v) v.a = $96d3e3c23d8fed31$export$dbf961a8d278dbef(v.a);\n return v;\n }\n set rgb(obj) {\n this._rgb = $96d3e3c23d8fed31$var$fromObject(obj);\n }\n rgbString() {\n return this._valid ? $96d3e3c23d8fed31$export$9595423f22cf925a(this._rgb) : undefined;\n }\n hexString() {\n return this._valid ? $96d3e3c23d8fed31$export$1b06654353ef9f67(this._rgb) : undefined;\n }\n hslString() {\n return this._valid ? $96d3e3c23d8fed31$export$a197af1c58e6260c(this._rgb) : undefined;\n }\n mix(color, weight) {\n if (color) {\n const c1 = this.rgb;\n const c2 = color.rgb;\n let w2;\n const p = weight === w2 ? 0.5 : weight;\n const w = 2 * p - 1;\n const a = c1.a - c2.a;\n const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n w2 = 1 - w1;\n c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n c1.a = p * c1.a + (1 - p) * c2.a;\n this.rgb = c1;\n }\n return this;\n }\n interpolate(color, t) {\n if (color) this._rgb = $96d3e3c23d8fed31$var$interpolate(this._rgb, color._rgb, t);\n return this;\n }\n clone() {\n return new $96d3e3c23d8fed31$export$892596cec99bc70e(this.rgb);\n }\n alpha(a) {\n this._rgb.a = $96d3e3c23d8fed31$export$ed9bd8dcaeba14f6(a);\n return this;\n }\n clearer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 - ratio;\n return this;\n }\n greyscale() {\n const rgb = this._rgb;\n const val = $96d3e3c23d8fed31$export$2077e0241d6afd3c(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n rgb.r = rgb.g = rgb.b = val;\n return this;\n }\n opaquer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 + ratio;\n return this;\n }\n negate() {\n const v = this._rgb;\n v.r = 255 - v.r;\n v.g = 255 - v.g;\n v.b = 255 - v.b;\n return this;\n }\n lighten(ratio) {\n $96d3e3c23d8fed31$var$modHSL(this._rgb, 2, ratio);\n return this;\n }\n darken(ratio) {\n $96d3e3c23d8fed31$var$modHSL(this._rgb, 2, -ratio);\n return this;\n }\n saturate(ratio) {\n $96d3e3c23d8fed31$var$modHSL(this._rgb, 1, ratio);\n return this;\n }\n desaturate(ratio) {\n $96d3e3c23d8fed31$var$modHSL(this._rgb, 1, -ratio);\n return this;\n }\n rotate(deg) {\n $96d3e3c23d8fed31$export$bb628a54ab399bc9(this._rgb, deg);\n return this;\n }\n constructor(input){\n if (input instanceof $96d3e3c23d8fed31$export$892596cec99bc70e) return input;\n const type = typeof input;\n let v;\n if (type === \"object\") v = $96d3e3c23d8fed31$var$fromObject(input);\n else if (type === \"string\") v = $96d3e3c23d8fed31$export$625a38b961e8b5e9(input) || $96d3e3c23d8fed31$export$b2f06b640faad956(input) || $96d3e3c23d8fed31$var$functionParse(input);\n this._rgb = v;\n this._valid = !!v;\n }\n}\nfunction $96d3e3c23d8fed31$export$2e2bcd8739ae039(input) {\n return new $96d3e3c23d8fed31$export$892596cec99bc70e(input);\n}\n\n\n/**\n * @namespace Chart.helpers\n */ /**\n * An empty function that can be used, for example, for optional callback.\n */ function $02b6f511cc6c123c$export$cf2f7c5792f80b46() {\n/* noop */ }\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */ const $02b6f511cc6c123c$export$2219238a014317b0 = (()=>{\n let id = 0;\n return ()=>id++;\n})();\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function $02b6f511cc6c123c$export$342063e11d6c3cad(value) {\n return value === null || typeof value === \"undefined\";\n}\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */ function $02b6f511cc6c123c$export$8b22cf2602fb60ce(value) {\n if (Array.isArray && Array.isArray(value)) return true;\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === \"[object\" && type.slice(-6) === \"Array]\") return true;\n return false;\n}\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function $02b6f511cc6c123c$export$23f2a1d2818174ef(value) {\n return value !== null && Object.prototype.toString.call(value) === \"[object Object]\";\n}\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */ function $02b6f511cc6c123c$export$39b482c5e57630a8(value) {\n return (typeof value === \"number\" || value instanceof Number) && isFinite(+value);\n}\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */ function $02b6f511cc6c123c$export$c4ce752e73470fba(value, defaultValue) {\n return $02b6f511cc6c123c$export$39b482c5e57630a8(value) ? value : defaultValue;\n}\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */ function $02b6f511cc6c123c$export$90a7f3efeed30595(value, defaultValue) {\n return typeof value === \"undefined\" ? defaultValue : value;\n}\nconst $02b6f511cc6c123c$export$953cecd6e717a553 = (value, dimension)=>typeof value === \"string\" && value.endsWith(\"%\") ? parseFloat(value) / 100 : +value / dimension;\nconst $02b6f511cc6c123c$export$7ccc53e8f1e7dfc5 = (value, dimension)=>typeof value === \"string\" && value.endsWith(\"%\") ? parseFloat(value) / 100 * dimension : +value;\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */ function $02b6f511cc6c123c$export$3722cfe417b6ed86(fn, args, thisArg) {\n if (fn && typeof fn.call === \"function\") return fn.apply(thisArg, args);\n}\nfunction $02b6f511cc6c123c$export$d66501df72047452(loopable, fn, thisArg, reverse) {\n let i, len, keys;\n if ($02b6f511cc6c123c$export$8b22cf2602fb60ce(loopable)) {\n len = loopable.length;\n if (reverse) for(i = len - 1; i >= 0; i--)fn.call(thisArg, loopable[i], i);\n else for(i = 0; i < len; i++)fn.call(thisArg, loopable[i], i);\n } else if ($02b6f511cc6c123c$export$23f2a1d2818174ef(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for(i = 0; i < len; i++)fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n}\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */ function $02b6f511cc6c123c$export$995eb9fca571757(a0, a1) {\n let i, ilen, v0, v1;\n if (!a0 || !a1 || a0.length !== a1.length) return false;\n for(i = 0, ilen = a0.length; i < ilen; ++i){\n v0 = a0[i];\n v1 = a1[i];\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) return false;\n }\n return true;\n}\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */ function $02b6f511cc6c123c$export$d377dcb2b61d6c4e(source) {\n if ($02b6f511cc6c123c$export$8b22cf2602fb60ce(source)) return source.map($02b6f511cc6c123c$export$d377dcb2b61d6c4e);\n if ($02b6f511cc6c123c$export$23f2a1d2818174ef(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n for(; k < klen; ++k)target[keys[k]] = $02b6f511cc6c123c$export$d377dcb2b61d6c4e(source[keys[k]]);\n return target;\n }\n return source;\n}\nfunction $02b6f511cc6c123c$var$isValidKey(key) {\n return [\n \"__proto__\",\n \"prototype\",\n \"constructor\"\n ].indexOf(key) === -1;\n}\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */ function $02b6f511cc6c123c$export$667d3bf0c5f83305(key, target, source, options) {\n if (!$02b6f511cc6c123c$var$isValidKey(key)) return;\n const tval = target[key];\n const sval = source[key];\n if ($02b6f511cc6c123c$export$23f2a1d2818174ef(tval) && $02b6f511cc6c123c$export$23f2a1d2818174ef(sval)) // eslint-disable-next-line @typescript-eslint/no-use-before-define\n $02b6f511cc6c123c$export$efca4cbe5dd06740(tval, sval, options);\n else target[key] = $02b6f511cc6c123c$export$d377dcb2b61d6c4e(sval);\n}\nfunction $02b6f511cc6c123c$export$efca4cbe5dd06740(target, source, options) {\n const sources = $02b6f511cc6c123c$export$8b22cf2602fb60ce(source) ? source : [\n source\n ];\n const ilen = sources.length;\n if (!$02b6f511cc6c123c$export$23f2a1d2818174ef(target)) return target;\n options = options || {};\n const merger = options.merger || $02b6f511cc6c123c$export$667d3bf0c5f83305;\n let current;\n for(let i = 0; i < ilen; ++i){\n current = sources[i];\n if (!$02b6f511cc6c123c$export$23f2a1d2818174ef(current)) continue;\n const keys = Object.keys(current);\n for(let k = 0, klen = keys.length; k < klen; ++k)merger(keys[k], target, current, options);\n }\n return target;\n}\nfunction $02b6f511cc6c123c$export$555508cbc6add439(target, source) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return $02b6f511cc6c123c$export$efca4cbe5dd06740(target, source, {\n merger: $02b6f511cc6c123c$export$317a3d46287192d8\n });\n}\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */ function $02b6f511cc6c123c$export$317a3d46287192d8(key, target, source) {\n if (!$02b6f511cc6c123c$var$isValidKey(key)) return;\n const tval = target[key];\n const sval = source[key];\n if ($02b6f511cc6c123c$export$23f2a1d2818174ef(tval) && $02b6f511cc6c123c$export$23f2a1d2818174ef(sval)) $02b6f511cc6c123c$export$555508cbc6add439(tval, sval);\n else if (!Object.prototype.hasOwnProperty.call(target, key)) target[key] = $02b6f511cc6c123c$export$d377dcb2b61d6c4e(sval);\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$1ee57be6f6687d2c(scope, value, previous, current) {\n if (value !== undefined) console.warn(scope + ': \"' + previous + '\" is deprecated. Please use \"' + current + '\" instead');\n}\n// resolveObjectKey resolver cache\nconst $02b6f511cc6c123c$var$keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n \"\": (v)=>v,\n // default resolvers\n x: (o)=>o.x,\n y: (o)=>o.y\n};\n/**\n * @private\n */ function $02b6f511cc6c123c$export$9d0e2d13d04f7070(key) {\n const parts = key.split(\".\");\n const keys = [];\n let tmp = \"\";\n for (const part of parts){\n tmp += part;\n if (tmp.endsWith(\"\\\\\")) tmp = tmp.slice(0, -1) + \".\";\n else {\n keys.push(tmp);\n tmp = \"\";\n }\n }\n return keys;\n}\nfunction $02b6f511cc6c123c$var$_getKeyResolver(key) {\n const keys = $02b6f511cc6c123c$export$9d0e2d13d04f7070(key);\n return (obj)=>{\n for (const k of keys){\n if (k === \"\") break;\n obj = obj && obj[k];\n }\n return obj;\n };\n}\nfunction $02b6f511cc6c123c$export$2d1720544b23b823(obj, key) {\n const resolver = $02b6f511cc6c123c$var$keyResolvers[key] || ($02b6f511cc6c123c$var$keyResolvers[key] = $02b6f511cc6c123c$var$_getKeyResolver(key));\n return resolver(obj);\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$a8550f7dbe79f93a(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst $02b6f511cc6c123c$export$dda1d9f60106f0e9 = (value)=>typeof value !== \"undefined\";\nconst $02b6f511cc6c123c$export$a93c5207d687da10 = (value)=>typeof value === \"function\";\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nconst $02b6f511cc6c123c$export$ee7c8ad385a60b7b = (a, b)=>{\n if (a.size !== b.size) return false;\n for (const item of a){\n if (!b.has(item)) return false;\n }\n return true;\n};\n/**\n * @param e - The event\n * @private\n */ function $02b6f511cc6c123c$export$f38c853ae54ed474(e) {\n return e.type === \"mouseup\" || e.type === \"click\" || e.type === \"contextmenu\";\n}\n/**\n * @alias Chart.helpers.math\n * @namespace\n */ const $02b6f511cc6c123c$export$56c0d5a1e737357d = Math.PI;\nconst $02b6f511cc6c123c$export$971d5caa766a69d7 = 2 * $02b6f511cc6c123c$export$56c0d5a1e737357d;\nconst $02b6f511cc6c123c$export$d29e374196577086 = $02b6f511cc6c123c$export$971d5caa766a69d7 + $02b6f511cc6c123c$export$56c0d5a1e737357d;\nconst $02b6f511cc6c123c$export$2ec5befb9e6c97d4 = Number.POSITIVE_INFINITY;\nconst $02b6f511cc6c123c$export$53c86fa97d611818 = $02b6f511cc6c123c$export$56c0d5a1e737357d / 180;\nconst $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd = $02b6f511cc6c123c$export$56c0d5a1e737357d / 2;\nconst $02b6f511cc6c123c$export$39c1cc7c062529d4 = $02b6f511cc6c123c$export$56c0d5a1e737357d / 4;\nconst $02b6f511cc6c123c$export$7a0bdf7d4a91ea88 = $02b6f511cc6c123c$export$56c0d5a1e737357d * 2 / 3;\nconst $02b6f511cc6c123c$export$9f4f30ee63539e24 = Math.log10;\nconst $02b6f511cc6c123c$export$2408f22a0fab9ae5 = Math.sign;\nfunction $02b6f511cc6c123c$export$a05254e7c3aeba6e(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n}\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */ function $02b6f511cc6c123c$export$a33b77bbdbb8366c(range) {\n const roundedRange = Math.round(range);\n range = $02b6f511cc6c123c$export$a05254e7c3aeba6e(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor($02b6f511cc6c123c$export$9f4f30ee63539e24(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */ function $02b6f511cc6c123c$export$a07804094c3ecf2d(value) {\n const result = [];\n const sqrt = Math.sqrt(value);\n let i;\n for(i = 1; i < sqrt; i++)if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n if (sqrt === (sqrt | 0)) result.push(sqrt);\n result.sort((a, b)=>a - b).pop();\n return result;\n}\nfunction $02b6f511cc6c123c$export$d141bba7fdc215a3(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction $02b6f511cc6c123c$export$b9a6b53f9be3734(x, epsilon) {\n const rounded = Math.round(x);\n return rounded - epsilon <= x && rounded + epsilon >= x;\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$53a70dd1ebbae346(array, target, property) {\n let i, ilen, value;\n for(i = 0, ilen = array.length; i < ilen; i++){\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\nfunction $02b6f511cc6c123c$export$625550452a3fa3ec(degrees) {\n return degrees * ($02b6f511cc6c123c$export$56c0d5a1e737357d / 180);\n}\nfunction $02b6f511cc6c123c$export$3a6d5c9ae78a2c08(radians) {\n return radians * (180 / $02b6f511cc6c123c$export$56c0d5a1e737357d);\n}\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */ function $02b6f511cc6c123c$export$23ebac1979863676(x) {\n if (!$02b6f511cc6c123c$export$39b482c5e57630a8(x)) return;\n let e = 1;\n let p = 0;\n while(Math.round(x * e) / e !== x){\n e *= 10;\n p++;\n }\n return p;\n}\n// Gets the angle from vertical upright to the point about a centre.\nfunction $02b6f511cc6c123c$export$96f57966bedc81b4(centrePoint, anglePoint) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n if (angle < -0.5 * $02b6f511cc6c123c$export$56c0d5a1e737357d) angle += $02b6f511cc6c123c$export$971d5caa766a69d7; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n return {\n angle: angle,\n distance: radialDistanceFromCenter\n };\n}\nfunction $02b6f511cc6c123c$export$158acd800e1ef08b(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */ function $02b6f511cc6c123c$export$c18d01048907ea92(a, b) {\n return (a - b + $02b6f511cc6c123c$export$d29e374196577086) % $02b6f511cc6c123c$export$971d5caa766a69d7 - $02b6f511cc6c123c$export$56c0d5a1e737357d;\n}\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */ function $02b6f511cc6c123c$export$28f7fcd39efa255(a) {\n return (a % $02b6f511cc6c123c$export$971d5caa766a69d7 + $02b6f511cc6c123c$export$971d5caa766a69d7) % $02b6f511cc6c123c$export$971d5caa766a69d7;\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$ffb5f4729a158638(angle, start, end, sameAngleIsFullCircle) {\n const a = $02b6f511cc6c123c$export$28f7fcd39efa255(angle);\n const s = $02b6f511cc6c123c$export$28f7fcd39efa255(start);\n const e = $02b6f511cc6c123c$export$28f7fcd39efa255(end);\n const angleToStart = $02b6f511cc6c123c$export$28f7fcd39efa255(s - a);\n const angleToEnd = $02b6f511cc6c123c$export$28f7fcd39efa255(e - a);\n const startToAngle = $02b6f511cc6c123c$export$28f7fcd39efa255(a - s);\n const endToAngle = $02b6f511cc6c123c$export$28f7fcd39efa255(a - e);\n return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle;\n}\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */ function $02b6f511cc6c123c$export$25ce5a424b770e84(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n/**\n * @param {number} value\n * @private\n */ function $02b6f511cc6c123c$export$71cec2538cb2c617(value) {\n return $02b6f511cc6c123c$export$25ce5a424b770e84(value, -32768, 32767);\n}\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */ function $02b6f511cc6c123c$export$3b513254972cfc9c(value, start, end, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\nfunction $02b6f511cc6c123c$export$2ed0fc6709e59212(table, value, cmp) {\n cmp = cmp || ((index)=>table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid;\n while(hi - lo > 1){\n mid = lo + hi >> 1;\n if (cmp(mid)) lo = mid;\n else hi = mid;\n }\n return {\n lo: lo,\n hi: hi\n };\n}\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */ const $02b6f511cc6c123c$export$ef35774e6d314e91 = (table, key, value, last)=>$02b6f511cc6c123c$export$2ed0fc6709e59212(table, value, last ? (index)=>{\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n } : (index)=>table[index][key] < value);\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */ const $02b6f511cc6c123c$export$ebd11618f299a286 = (table, key, value)=>$02b6f511cc6c123c$export$2ed0fc6709e59212(table, value, (index)=>table[index][key] >= value);\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */ function $02b6f511cc6c123c$export$c03999cb2f36933f(values, min, max) {\n let start = 0;\n let end = values.length;\n while(start < end && values[start] < min)start++;\n while(end > start && values[end - 1] > max)end--;\n return start > 0 || end < values.length ? values.slice(start, end) : values;\n}\nconst $02b6f511cc6c123c$var$arrayEvents = [\n \"push\",\n \"pop\",\n \"shift\",\n \"splice\",\n \"unshift\"\n];\nfunction $02b6f511cc6c123c$export$882b5998b3b9117c(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n Object.defineProperty(array, \"_chartjs\", {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [\n listener\n ]\n }\n });\n $02b6f511cc6c123c$var$arrayEvents.forEach((key)=>{\n const method = \"_onData\" + $02b6f511cc6c123c$export$a8550f7dbe79f93a(key);\n const base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value (...args) {\n const res = base.apply(this, args);\n array._chartjs.listeners.forEach((object)=>{\n if (typeof object[method] === \"function\") object[method](...args);\n });\n return res;\n }\n });\n });\n}\nfunction $02b6f511cc6c123c$export$3b14a55fb2447963(array, listener) {\n const stub = array._chartjs;\n if (!stub) return;\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) listeners.splice(index, 1);\n if (listeners.length > 0) return;\n $02b6f511cc6c123c$var$arrayEvents.forEach((key)=>{\n delete array[key];\n });\n delete array._chartjs;\n}\n/**\n * @param items\n */ function $02b6f511cc6c123c$export$71511d61b312f219(items) {\n const set = new Set(items);\n if (set.size === items.length) return items;\n return Array.from(set);\n}\nfunction $02b6f511cc6c123c$export$fef3dfd9bad05307(pixelSize, fontStyle, fontFamily) {\n return fontStyle + \" \" + pixelSize + \"px \" + fontFamily;\n}\n/**\n* Request animation polyfill\n*/ const $02b6f511cc6c123c$export$43caf9889c228507 = function() {\n if (typeof window === \"undefined\") return function(callback) {\n return callback();\n };\n return window.requestAnimationFrame;\n}();\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */ function $02b6f511cc6c123c$export$61196ced6d74a310(fn, thisArg) {\n let argsToUse = [];\n let ticking = false;\n return function(...args) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n $02b6f511cc6c123c$export$43caf9889c228507.call(window, ()=>{\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n/**\n * Debounces calling `fn` for `delay` ms\n */ function $02b6f511cc6c123c$export$4c3d22f3d993c33f(fn, delay) {\n let timeout;\n return function(...args) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else fn.apply(this, args);\n return delay;\n };\n}\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */ const $02b6f511cc6c123c$export$3c2fa207a37baaea = (align)=>align === \"start\" ? \"left\" : align === \"end\" ? \"right\" : \"center\";\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */ const $02b6f511cc6c123c$export$ce26c07117d59d6a = (align, start, end)=>align === \"start\" ? start : align === \"end\" ? end : (start + end) / 2;\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */ const $02b6f511cc6c123c$export$9d398bebfec1c039 = (align, left, right, rtl)=>{\n const check = rtl ? \"left\" : \"right\";\n return align === check ? right : align === \"center\" ? (left + right) / 2 : left;\n};\n/**\n * Return start and count of visible points.\n * @private\n */ function $02b6f511cc6c123c$export$9e5f44173e64f162(meta, points, animationsDisabled) {\n const pointCount = points.length;\n let start = 0;\n let count = pointCount;\n if (meta._sorted) {\n const { iScale: iScale, _parsed: _parsed } = meta;\n const axis = iScale.axis;\n const { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = iScale.getUserBounds();\n if (minDefined) start = $02b6f511cc6c123c$export$25ce5a424b770e84(Math.min($02b6f511cc6c123c$export$ef35774e6d314e91(_parsed, axis, min).lo, animationsDisabled ? pointCount : $02b6f511cc6c123c$export$ef35774e6d314e91(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1);\n if (maxDefined) count = $02b6f511cc6c123c$export$25ce5a424b770e84(Math.max($02b6f511cc6c123c$export$ef35774e6d314e91(_parsed, iScale.axis, max, true).hi + 1, animationsDisabled ? 0 : $02b6f511cc6c123c$export$ef35774e6d314e91(points, axis, iScale.getPixelForValue(max), true).hi + 1), start, pointCount) - start;\n else count = pointCount - start;\n }\n return {\n start: start,\n count: count\n };\n}\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */ function $02b6f511cc6c123c$export$efccba1c4a2ef57b(meta) {\n const { xScale: xScale, yScale: yScale, _scaleRanges: _scaleRanges } = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\nconst $02b6f511cc6c123c$var$atEdge = (t)=>t === 0 || t === 1;\nconst $02b6f511cc6c123c$var$elasticIn = (t, s, p)=>-(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * $02b6f511cc6c123c$export$971d5caa766a69d7 / p));\nconst $02b6f511cc6c123c$var$elasticOut = (t, s, p)=>Math.pow(2, -10 * t) * Math.sin((t - s) * $02b6f511cc6c123c$export$971d5caa766a69d7 / p) + 1;\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */ const $02b6f511cc6c123c$export$f1e1789686576879 = {\n linear: (t)=>t,\n easeInQuad: (t)=>t * t,\n easeOutQuad: (t)=>-t * (t - 2),\n easeInOutQuad: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1),\n easeInCubic: (t)=>t * t * t,\n easeOutCubic: (t)=>(t -= 1) * t * t + 1,\n easeInOutCubic: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2),\n easeInQuart: (t)=>t * t * t * t,\n easeOutQuart: (t)=>-((t -= 1) * t * t * t - 1),\n easeInOutQuart: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2),\n easeInQuint: (t)=>t * t * t * t * t,\n easeOutQuint: (t)=>(t -= 1) * t * t * t * t + 1,\n easeInOutQuint: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2),\n easeInSine: (t)=>-Math.cos(t * $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd) + 1,\n easeOutSine: (t)=>Math.sin(t * $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd),\n easeInOutSine: (t)=>-0.5 * (Math.cos($02b6f511cc6c123c$export$56c0d5a1e737357d * t) - 1),\n easeInExpo: (t)=>t === 0 ? 0 : Math.pow(2, 10 * (t - 1)),\n easeOutExpo: (t)=>t === 1 ? 1 : -Math.pow(2, -10 * t) + 1,\n easeInOutExpo: (t)=>$02b6f511cc6c123c$var$atEdge(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n easeInCirc: (t)=>t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1),\n easeOutCirc: (t)=>Math.sqrt(1 - (t -= 1) * t),\n easeInOutCirc: (t)=>(t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n easeInElastic: (t)=>$02b6f511cc6c123c$var$atEdge(t) ? t : $02b6f511cc6c123c$var$elasticIn(t, 0.075, 0.3),\n easeOutElastic: (t)=>$02b6f511cc6c123c$var$atEdge(t) ? t : $02b6f511cc6c123c$var$elasticOut(t, 0.075, 0.3),\n easeInOutElastic (t) {\n const s = 0.1125;\n const p = 0.45;\n return $02b6f511cc6c123c$var$atEdge(t) ? t : t < 0.5 ? 0.5 * $02b6f511cc6c123c$var$elasticIn(t * 2, s, p) : 0.5 + 0.5 * $02b6f511cc6c123c$var$elasticOut(t * 2 - 1, s, p);\n },\n easeInBack (t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n easeOutBack (t) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n easeInOutBack (t) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s));\n return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);\n },\n easeInBounce: (t)=>1 - $02b6f511cc6c123c$export$f1e1789686576879.easeOutBounce(1 - t),\n easeOutBounce (t) {\n const m = 7.5625;\n const d = 2.75;\n if (t < 1 / d) return m * t * t;\n if (t < 2 / d) return m * (t -= 1.5 / d) * t + 0.75;\n if (t < 2.5 / d) return m * (t -= 2.25 / d) * t + 0.9375;\n return m * (t -= 2.625 / d) * t + 0.984375;\n },\n easeInOutBounce: (t)=>t < 0.5 ? $02b6f511cc6c123c$export$f1e1789686576879.easeInBounce(t * 2) * 0.5 : $02b6f511cc6c123c$export$f1e1789686576879.easeOutBounce(t * 2 - 1) * 0.5 + 0.5\n};\nfunction $02b6f511cc6c123c$export$f96d196f7728bb5(value) {\n if (value && typeof value === \"object\") {\n const type = value.toString();\n return type === \"[object CanvasPattern]\" || type === \"[object CanvasGradient]\";\n }\n return false;\n}\nfunction $02b6f511cc6c123c$export$db3b6bfb95261072(value) {\n return $02b6f511cc6c123c$export$f96d196f7728bb5(value) ? value : new (0, $96d3e3c23d8fed31$export$892596cec99bc70e)(value);\n}\nfunction $02b6f511cc6c123c$export$738ab4df8bf92ae9(value) {\n return $02b6f511cc6c123c$export$f96d196f7728bb5(value) ? value : new (0, $96d3e3c23d8fed31$export$892596cec99bc70e)(value).saturate(0.5).darken(0.1).hexString();\n}\nconst $02b6f511cc6c123c$var$numbers = [\n \"x\",\n \"y\",\n \"borderWidth\",\n \"radius\",\n \"tension\"\n];\nconst $02b6f511cc6c123c$var$colors = [\n \"color\",\n \"borderColor\",\n \"backgroundColor\"\n];\nfunction $02b6f511cc6c123c$var$applyAnimationsDefaults(defaults) {\n defaults.set(\"animation\", {\n delay: undefined,\n duration: 1000,\n easing: \"easeOutQuart\",\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined\n });\n defaults.describe(\"animation\", {\n _fallback: false,\n _indexable: false,\n _scriptable: (name)=>name !== \"onProgress\" && name !== \"onComplete\" && name !== \"fn\"\n });\n defaults.set(\"animations\", {\n colors: {\n type: \"color\",\n properties: $02b6f511cc6c123c$var$colors\n },\n numbers: {\n type: \"number\",\n properties: $02b6f511cc6c123c$var$numbers\n }\n });\n defaults.describe(\"animations\", {\n _fallback: \"animation\"\n });\n defaults.set(\"transitions\", {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: \"transparent\"\n },\n visible: {\n type: \"boolean\",\n duration: 0\n }\n }\n },\n hide: {\n animations: {\n colors: {\n to: \"transparent\"\n },\n visible: {\n type: \"boolean\",\n easing: \"linear\",\n fn: (v)=>v | 0\n }\n }\n }\n });\n}\nfunction $02b6f511cc6c123c$var$applyLayoutsDefaults(defaults) {\n defaults.set(\"layout\", {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\nconst $02b6f511cc6c123c$var$intlCache = new Map();\nfunction $02b6f511cc6c123c$var$getNumberFormat(locale, options) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = $02b6f511cc6c123c$var$intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n $02b6f511cc6c123c$var$intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\nfunction $02b6f511cc6c123c$export$ae1af26003f05816(num, locale, options) {\n return $02b6f511cc6c123c$var$getNumberFormat(locale, options).format(num);\n}\nconst $02b6f511cc6c123c$var$formatters = {\n values (value) {\n return $02b6f511cc6c123c$export$8b22cf2602fb60ce(value) ? value : \"\" + value;\n },\n numeric (tickValue, index, ticks) {\n if (tickValue === 0) return \"0\";\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue;\n if (ticks.length > 1) {\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) notation = \"scientific\";\n delta = $02b6f511cc6c123c$var$calculateDelta(tickValue, ticks);\n }\n const logDelta = $02b6f511cc6c123c$export$9f4f30ee63539e24(Math.abs(delta));\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n const options = {\n notation: notation,\n minimumFractionDigits: numDecimal,\n maximumFractionDigits: numDecimal\n };\n Object.assign(options, this.options.ticks.format);\n return $02b6f511cc6c123c$export$ae1af26003f05816(tickValue, locale, options);\n },\n logarithmic (tickValue, index, ticks) {\n if (tickValue === 0) return \"0\";\n const remain = ticks[index].significand || tickValue / Math.pow(10, Math.floor($02b6f511cc6c123c$export$9f4f30ee63539e24(tickValue)));\n if ([\n 1,\n 2,\n 3,\n 5,\n 10,\n 15\n ].includes(remain) || index > 0.8 * ticks.length) return $02b6f511cc6c123c$var$formatters.numeric.call(this, tickValue, index, ticks);\n return \"\";\n }\n};\nfunction $02b6f511cc6c123c$var$calculateDelta(tickValue, ticks) {\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) delta = tickValue - Math.floor(tickValue);\n return delta;\n}\nvar $02b6f511cc6c123c$export$91477dc880baac21 = {\n formatters: $02b6f511cc6c123c$var$formatters\n};\nfunction $02b6f511cc6c123c$var$applyScaleDefaults(defaults) {\n defaults.set(\"scale\", {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n bounds: \"ticks\",\n clip: true,\n grace: 0,\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options)=>options.lineWidth,\n tickColor: (_ctx, options)=>options.color,\n offset: false\n },\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n title: {\n display: false,\n text: \"\",\n padding: {\n top: 4,\n bottom: 4\n }\n },\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: \"\",\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n callback: $02b6f511cc6c123c$export$91477dc880baac21.formatters.values,\n minor: {},\n major: {},\n align: \"center\",\n crossAlign: \"near\",\n showLabelBackdrop: false,\n backdropColor: \"rgba(255, 255, 255, 0.75)\",\n backdropPadding: 2\n }\n });\n defaults.route(\"scale.ticks\", \"color\", \"\", \"color\");\n defaults.route(\"scale.grid\", \"color\", \"\", \"borderColor\");\n defaults.route(\"scale.border\", \"color\", \"\", \"borderColor\");\n defaults.route(\"scale.title\", \"color\", \"\", \"color\");\n defaults.describe(\"scale\", {\n _fallback: false,\n _scriptable: (name)=>!name.startsWith(\"before\") && !name.startsWith(\"after\") && name !== \"callback\" && name !== \"parser\",\n _indexable: (name)=>name !== \"borderDash\" && name !== \"tickBorderDash\" && name !== \"dash\"\n });\n defaults.describe(\"scales\", {\n _fallback: \"scale\"\n });\n defaults.describe(\"scale.ticks\", {\n _scriptable: (name)=>name !== \"backdropPadding\" && name !== \"callback\",\n _indexable: (name)=>name !== \"backdropPadding\"\n });\n}\nconst $02b6f511cc6c123c$export$6559d589eb85fbb6 = Object.create(null);\nconst $02b6f511cc6c123c$export$2e2af4578d910ddf = Object.create(null);\nfunction $02b6f511cc6c123c$var$getScope$1(node, key) {\n if (!key) return node;\n const keys = key.split(\".\");\n for(let i = 0, n = keys.length; i < n; ++i){\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\nfunction $02b6f511cc6c123c$var$set(root, scope, values) {\n if (typeof scope === \"string\") return $02b6f511cc6c123c$export$efca4cbe5dd06740($02b6f511cc6c123c$var$getScope$1(root, scope), values);\n return $02b6f511cc6c123c$export$efca4cbe5dd06740($02b6f511cc6c123c$var$getScope$1(root, \"\"), scope);\n}\nclass $02b6f511cc6c123c$var$Defaults {\n set(scope, values) {\n return $02b6f511cc6c123c$var$set(this, scope, values);\n }\n get(scope) {\n return $02b6f511cc6c123c$var$getScope$1(this, scope);\n }\n describe(scope, values) {\n return $02b6f511cc6c123c$var$set($02b6f511cc6c123c$export$2e2af4578d910ddf, scope, values);\n }\n override(scope, values) {\n return $02b6f511cc6c123c$var$set($02b6f511cc6c123c$export$6559d589eb85fbb6, scope, values);\n }\n route(scope, name, targetScope, targetName) {\n const scopeObject = $02b6f511cc6c123c$var$getScope$1(this, scope);\n const targetScopeObject = $02b6f511cc6c123c$var$getScope$1(this, targetScope);\n const privateName = \"_\" + name;\n Object.defineProperties(scopeObject, {\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n [name]: {\n enumerable: true,\n get () {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if ($02b6f511cc6c123c$export$23f2a1d2818174ef(local)) return Object.assign({}, target, local);\n return $02b6f511cc6c123c$export$90a7f3efeed30595(local, target);\n },\n set (value) {\n this[privateName] = value;\n }\n }\n });\n }\n apply(appliers) {\n appliers.forEach((apply)=>apply(this));\n }\n constructor(_descriptors, _appliers){\n this.animation = undefined;\n this.backgroundColor = \"rgba(0,0,0,0.1)\";\n this.borderColor = \"rgba(0,0,0,0.1)\";\n this.color = \"#666\";\n this.datasets = {};\n this.devicePixelRatio = (context)=>context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n \"mousemove\",\n \"mouseout\",\n \"click\",\n \"touchstart\",\n \"touchmove\"\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: \"normal\",\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options)=>$02b6f511cc6c123c$export$738ab4df8bf92ae9(options.backgroundColor);\n this.hoverBorderColor = (ctx, options)=>$02b6f511cc6c123c$export$738ab4df8bf92ae9(options.borderColor);\n this.hoverColor = (ctx, options)=>$02b6f511cc6c123c$export$738ab4df8bf92ae9(options.color);\n this.indexAxis = \"x\";\n this.interaction = {\n mode: \"nearest\",\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n}\nvar $02b6f511cc6c123c$export$4368d992c4eafac0 = /* #__PURE__ */ new $02b6f511cc6c123c$var$Defaults({\n _scriptable: (name)=>!name.startsWith(\"on\"),\n _indexable: (name)=>name !== \"events\",\n hover: {\n _fallback: \"interaction\"\n },\n interaction: {\n _scriptable: false,\n _indexable: false\n }\n}, [\n $02b6f511cc6c123c$var$applyAnimationsDefaults,\n $02b6f511cc6c123c$var$applyLayoutsDefaults,\n $02b6f511cc6c123c$var$applyScaleDefaults\n]);\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */ function $02b6f511cc6c123c$export$1a8f5705751d8277(font) {\n if (!font || $02b6f511cc6c123c$export$342063e11d6c3cad(font.size) || $02b6f511cc6c123c$export$342063e11d6c3cad(font.family)) return null;\n return (font.style ? font.style + \" \" : \"\") + (font.weight ? font.weight + \" \" : \"\") + font.size + \"px \" + font.family;\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$e7c866399fa523f5(ctx, data, gc, longest, string) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) longest = textWidth;\n return longest;\n}\n/**\n * @private\n */ // eslint-disable-next-line complexity\nfunction $02b6f511cc6c123c$export$faec65b429be379(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n ctx.save();\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i, j, jlen, thing, nestedThing;\n for(i = 0; i < ilen; i++){\n thing = arrayOfThings[i];\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !$02b6f511cc6c123c$export$8b22cf2602fb60ce(thing)) longest = $02b6f511cc6c123c$export$e7c866399fa523f5(ctx, data, gc, longest, thing);\n else if ($02b6f511cc6c123c$export$8b22cf2602fb60ce(thing)) // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for(j = 0, jlen = thing.length; j < jlen; j++){\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !$02b6f511cc6c123c$export$8b22cf2602fb60ce(nestedThing)) longest = $02b6f511cc6c123c$export$e7c866399fa523f5(ctx, data, gc, longest, nestedThing);\n }\n }\n ctx.restore();\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for(i = 0; i < gcLen; i++)delete data[gc[i]];\n gc.splice(0, gcLen);\n }\n return longest;\n}\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */ function $02b6f511cc6c123c$export$78acf4525d8a74c4(chart, pixel, width) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n/**\n * Clears the entire canvas.\n */ function $02b6f511cc6c123c$export$c9170ad7d4cd7e57(canvas, ctx) {\n ctx = ctx || canvas.getContext(\"2d\");\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\nfunction $02b6f511cc6c123c$export$493d36ec626b6698(ctx, options, x, y) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n $02b6f511cc6c123c$export$24baa2b76016ce0e(ctx, options, x, y, null);\n}\n// eslint-disable-next-line complexity\nfunction $02b6f511cc6c123c$export$24baa2b76016ce0e(ctx, options, x, y, w) {\n let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * $02b6f511cc6c123c$export$53c86fa97d611818;\n if (style && typeof style === \"object\") {\n type = style.toString();\n if (type === \"[object HTMLImageElement]\" || type === \"[object HTMLCanvasElement]\") {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n if (isNaN(radius) || radius <= 0) return;\n ctx.beginPath();\n switch(style){\n // Default includes circle\n default:\n if (w) ctx.ellipse(x, y, w / 2, radius, 0, 0, $02b6f511cc6c123c$export$971d5caa766a69d7);\n else ctx.arc(x, y, radius, 0, $02b6f511cc6c123c$export$971d5caa766a69d7);\n ctx.closePath();\n break;\n case \"triangle\":\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += $02b6f511cc6c123c$export$7a0bdf7d4a91ea88;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += $02b6f511cc6c123c$export$7a0bdf7d4a91ea88;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case \"rectRounded\":\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + $02b6f511cc6c123c$export$39c1cc7c062529d4) * size;\n xOffsetW = Math.cos(rad + $02b6f511cc6c123c$export$39c1cc7c062529d4) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + $02b6f511cc6c123c$export$39c1cc7c062529d4) * size;\n yOffsetW = Math.sin(rad + $02b6f511cc6c123c$export$39c1cc7c062529d4) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - $02b6f511cc6c123c$export$56c0d5a1e737357d, rad - $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd, rad + $02b6f511cc6c123c$export$56c0d5a1e737357d);\n ctx.closePath();\n break;\n case \"rect\":\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += $02b6f511cc6c123c$export$39c1cc7c062529d4;\n /* falls through */ case \"rectRot\":\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case \"crossRot\":\n rad += $02b6f511cc6c123c$export$39c1cc7c062529d4;\n /* falls through */ case \"cross\":\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case \"star\":\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += $02b6f511cc6c123c$export$39c1cc7c062529d4;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case \"line\":\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case \"dash\":\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n ctx.fill();\n if (options.borderWidth > 0) ctx.stroke();\n}\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */ function $02b6f511cc6c123c$export$e7094788287c5e9b(point, area, margin) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;\n}\nfunction $02b6f511cc6c123c$export$8743009a87fcb00f(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\nfunction $02b6f511cc6c123c$export$3d8c2f653ac9d0b9(ctx) {\n ctx.restore();\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$d24c54395ce0c509(ctx, previous, target, flip, mode) {\n if (!previous) return ctx.lineTo(target.x, target.y);\n if (mode === \"middle\") {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === \"after\" !== !!flip) ctx.lineTo(previous.x, target.y);\n else ctx.lineTo(target.x, previous.y);\n ctx.lineTo(target.x, target.y);\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$6554612db691658e(ctx, previous, target, flip) {\n if (!previous) return ctx.lineTo(target.x, target.y);\n ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y);\n}\nfunction $02b6f511cc6c123c$var$setRenderOpts(ctx, opts) {\n if (opts.translation) ctx.translate(opts.translation[0], opts.translation[1]);\n if (!$02b6f511cc6c123c$export$342063e11d6c3cad(opts.rotation)) ctx.rotate(opts.rotation);\n if (opts.color) ctx.fillStyle = opts.color;\n if (opts.textAlign) ctx.textAlign = opts.textAlign;\n if (opts.textBaseline) ctx.textBaseline = opts.textBaseline;\n}\nfunction $02b6f511cc6c123c$var$decorateText(ctx, x, y, line, opts) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */ const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\nfunction $02b6f511cc6c123c$var$drawBackdrop(ctx, opts) {\n const oldColor = ctx.fillStyle;\n ctx.fillStyle = opts.color;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n/**\n * Render text onto the canvas\n */ function $02b6f511cc6c123c$export$dc98b0b04f4c7758(ctx, text, x, y, font, opts = {}) {\n const lines = $02b6f511cc6c123c$export$8b22cf2602fb60ce(text) ? text : [\n text\n ];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== \"\";\n let i, line;\n ctx.save();\n ctx.font = font.string;\n $02b6f511cc6c123c$var$setRenderOpts(ctx, opts);\n for(i = 0; i < lines.length; ++i){\n line = lines[i];\n if (opts.backdrop) $02b6f511cc6c123c$var$drawBackdrop(ctx, opts.backdrop);\n if (stroke) {\n if (opts.strokeColor) ctx.strokeStyle = opts.strokeColor;\n if (!$02b6f511cc6c123c$export$342063e11d6c3cad(opts.strokeWidth)) ctx.lineWidth = opts.strokeWidth;\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n ctx.fillText(line, x, y, opts.maxWidth);\n $02b6f511cc6c123c$var$decorateText(ctx, x, y, line, opts);\n y += Number(font.lineHeight);\n }\n ctx.restore();\n}\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */ function $02b6f511cc6c123c$export$1fbe638ecf81657e(ctx, rect) {\n const { x: x, y: y, w: w, h: h, radius: radius } = rect;\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * $02b6f511cc6c123c$export$56c0d5a1e737357d, $02b6f511cc6c123c$export$56c0d5a1e737357d, true);\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, $02b6f511cc6c123c$export$56c0d5a1e737357d, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd, true);\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd, 0, true);\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -$02b6f511cc6c123c$export$7f8ddf7c7c20b3cd, true);\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\nconst $02b6f511cc6c123c$var$LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst $02b6f511cc6c123c$var$FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n/**\n * @alias Chart.helpers.options\n * @namespace\n */ /**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */ function $02b6f511cc6c123c$export$8c78c7c36408ea29(value, size) {\n const matches = (\"\" + value).match($02b6f511cc6c123c$var$LINE_HEIGHT);\n if (!matches || matches[1] === \"normal\") return size * 1.2;\n value = +matches[2];\n switch(matches[3]){\n case \"px\":\n return value;\n case \"%\":\n value /= 100;\n break;\n }\n return size * value;\n}\nconst $02b6f511cc6c123c$var$numberOrZero = (v)=>+v || 0;\nfunction $02b6f511cc6c123c$export$21579262ef46735b(value, props) {\n const ret = {};\n const objProps = $02b6f511cc6c123c$export$23f2a1d2818174ef(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = $02b6f511cc6c123c$export$23f2a1d2818174ef(value) ? objProps ? (prop)=>$02b6f511cc6c123c$export$90a7f3efeed30595(value[prop], value[props[prop]]) : (prop)=>value[prop] : ()=>value;\n for (const prop of keys)ret[prop] = $02b6f511cc6c123c$var$numberOrZero(read(prop));\n return ret;\n}\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */ function $02b6f511cc6c123c$export$d66dc83d8cfc8dd(value) {\n return $02b6f511cc6c123c$export$21579262ef46735b(value, {\n top: \"y\",\n right: \"x\",\n bottom: \"y\",\n left: \"x\"\n });\n}\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */ function $02b6f511cc6c123c$export$92108d983e8ee699(value) {\n return $02b6f511cc6c123c$export$21579262ef46735b(value, [\n \"topLeft\",\n \"topRight\",\n \"bottomLeft\",\n \"bottomRight\"\n ]);\n}\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */ function $02b6f511cc6c123c$export$a9c23c6ac3fc3eca(value) {\n const obj = $02b6f511cc6c123c$export$d66dc83d8cfc8dd(value);\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n return obj;\n}\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */ function $02b6f511cc6c123c$export$34aec0b863436764(options, fallback) {\n options = options || {};\n fallback = fallback || $02b6f511cc6c123c$export$4368d992c4eafac0.font;\n let size = $02b6f511cc6c123c$export$90a7f3efeed30595(options.size, fallback.size);\n if (typeof size === \"string\") size = parseInt(size, 10);\n let style = $02b6f511cc6c123c$export$90a7f3efeed30595(options.style, fallback.style);\n if (style && !(\"\" + style).match($02b6f511cc6c123c$var$FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n const font = {\n family: $02b6f511cc6c123c$export$90a7f3efeed30595(options.family, fallback.family),\n lineHeight: $02b6f511cc6c123c$export$8c78c7c36408ea29($02b6f511cc6c123c$export$90a7f3efeed30595(options.lineHeight, fallback.lineHeight), size),\n size: size,\n style: style,\n weight: $02b6f511cc6c123c$export$90a7f3efeed30595(options.weight, fallback.weight),\n string: \"\"\n };\n font.string = $02b6f511cc6c123c$export$1a8f5705751d8277(font);\n return font;\n}\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */ function $02b6f511cc6c123c$export$407448d2b89b1813(inputs, context, index, info) {\n let cacheable = true;\n let i, ilen, value;\n for(i = 0, ilen = inputs.length; i < ilen; ++i){\n value = inputs[i];\n if (value === undefined) continue;\n if (context !== undefined && typeof value === \"function\") {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && $02b6f511cc6c123c$export$8b22cf2602fb60ce(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) info.cacheable = false;\n return value;\n }\n }\n}\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */ function $02b6f511cc6c123c$export$db202ddc8be9136(minmax, grace, beginAtZero) {\n const { min: min, max: max } = minmax;\n const change = $02b6f511cc6c123c$export$7ccc53e8f1e7dfc5(grace, (max - min) / 2);\n const keepZero = (value, add)=>beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\nfunction $02b6f511cc6c123c$export$35e795649ee09318(parentContext, context) {\n return Object.assign(Object.create(parentContext), context);\n}\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */ function $02b6f511cc6c123c$export$a9c996f45e5784d0(scopes, prefixes = [\n \"\"\n], rootScopes, fallback, getTarget = ()=>scopes[0]) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === \"undefined\") fallback = $02b6f511cc6c123c$var$_resolve(\"_fallback\", scopes);\n const cache = {\n [Symbol.toStringTag]: \"Object\",\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope)=>$02b6f511cc6c123c$export$a9c996f45e5784d0([\n scope,\n ...scopes\n ], prefixes, finalRootScopes, fallback)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop) {\n return $02b6f511cc6c123c$var$_cached(target, prop, ()=>$02b6f511cc6c123c$var$_resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return $02b6f511cc6c123c$var$getKeysFromAllScopes(target).includes(prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys (target) {\n return $02b6f511cc6c123c$var$getKeysFromAllScopes(target);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n });\n}\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */ function $02b6f511cc6c123c$export$c3950d9923825c02(proxy, context, subProxy, descriptorDefaults) {\n const cache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: $02b6f511cc6c123c$export$7910e0436ed8d1de(proxy, descriptorDefaults),\n setContext: (ctx)=>$02b6f511cc6c123c$export$c3950d9923825c02(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope)=>$02b6f511cc6c123c$export$c3950d9923825c02(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop, receiver) {\n return $02b6f511cc6c123c$var$_cached(target, prop, ()=>$02b6f511cc6c123c$var$_resolveWithContext(target, prop, receiver));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? {\n enumerable: true,\n configurable: true\n } : undefined : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(proxy);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return Reflect.has(proxy, prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys () {\n return Reflect.ownKeys(proxy);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n });\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$7910e0436ed8d1de(proxy, defaults = {\n scriptable: true,\n indexable: true\n}) {\n const { _scriptable: _scriptable = defaults.scriptable, _indexable: _indexable = defaults.indexable, _allKeys: _allKeys = defaults.allKeys } = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: $02b6f511cc6c123c$export$a93c5207d687da10(_scriptable) ? _scriptable : ()=>_scriptable,\n isIndexable: $02b6f511cc6c123c$export$a93c5207d687da10(_indexable) ? _indexable : ()=>_indexable\n };\n}\nconst $02b6f511cc6c123c$var$readKey = (prefix, name)=>prefix ? prefix + $02b6f511cc6c123c$export$a8550f7dbe79f93a(name) : name;\nconst $02b6f511cc6c123c$var$needsSubResolver = (prop, value)=>$02b6f511cc6c123c$export$23f2a1d2818174ef(value) && prop !== \"adapters\" && (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction $02b6f511cc6c123c$var$_cached(target, prop, resolve) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) return target[prop];\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\nfunction $02b6f511cc6c123c$var$_resolveWithContext(target, prop, receiver) {\n const { _proxy: _proxy, _context: _context, _subProxy: _subProxy, _descriptors: descriptors } = target;\n let value = _proxy[prop]; // resolve from proxy\n // resolve with context\n if ($02b6f511cc6c123c$export$a93c5207d687da10(value) && descriptors.isScriptable(prop)) value = $02b6f511cc6c123c$var$_resolveScriptable(prop, value, target, receiver);\n if ($02b6f511cc6c123c$export$8b22cf2602fb60ce(value) && value.length) value = $02b6f511cc6c123c$var$_resolveArray(prop, value, target, descriptors.isIndexable);\n if ($02b6f511cc6c123c$var$needsSubResolver(prop, value)) // if the resolved value is an object, create a sub resolver for it\n value = $02b6f511cc6c123c$export$c3950d9923825c02(value, _context, _subProxy && _subProxy[prop], descriptors);\n return value;\n}\nfunction $02b6f511cc6c123c$var$_resolveScriptable(prop, getValue, target, receiver) {\n const { _proxy: _proxy, _context: _context, _subProxy: _subProxy, _stack: _stack } = target;\n if (_stack.has(prop)) throw new Error(\"Recursion detected: \" + Array.from(_stack).join(\"->\") + \"->\" + prop);\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if ($02b6f511cc6c123c$var$needsSubResolver(prop, value)) // When scriptable option returns an object, create a resolver on that.\n value = $02b6f511cc6c123c$var$createSubResolver(_proxy._scopes, _proxy, prop, value);\n return value;\n}\nfunction $02b6f511cc6c123c$var$_resolveArray(prop, value, target, isIndexable) {\n const { _proxy: _proxy, _context: _context, _subProxy: _subProxy, _descriptors: descriptors } = target;\n if (typeof _context.index !== \"undefined\" && isIndexable(prop)) return value[_context.index % value.length];\n else if ($02b6f511cc6c123c$export$23f2a1d2818174ef(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter((s)=>s !== arr);\n value = [];\n for (const item of arr){\n const resolver = $02b6f511cc6c123c$var$createSubResolver(scopes, _proxy, prop, item);\n value.push($02b6f511cc6c123c$export$c3950d9923825c02(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\nfunction $02b6f511cc6c123c$var$resolveFallback(fallback, prop, value) {\n return $02b6f511cc6c123c$export$a93c5207d687da10(fallback) ? fallback(prop, value) : fallback;\n}\nconst $02b6f511cc6c123c$var$getScope = (key, parent)=>key === true ? parent : typeof key === \"string\" ? $02b6f511cc6c123c$export$2d1720544b23b823(parent, key) : undefined;\nfunction $02b6f511cc6c123c$var$addScopes(set, parentScopes, key, parentFallback, value) {\n for (const parent of parentScopes){\n const scope = $02b6f511cc6c123c$var$getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = $02b6f511cc6c123c$var$resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== \"undefined\" && fallback !== key && fallback !== parentFallback) // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n } else if (scope === false && typeof parentFallback !== \"undefined\" && key !== parentFallback) // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n return false;\n}\nfunction $02b6f511cc6c123c$var$createSubResolver(parentScopes, resolver, prop, value) {\n const rootScopes = resolver._rootScopes;\n const fallback = $02b6f511cc6c123c$var$resolveFallback(resolver._fallback, prop, value);\n const allScopes = [\n ...parentScopes,\n ...rootScopes\n ];\n const set = new Set();\n set.add(value);\n let key = $02b6f511cc6c123c$var$addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) return false;\n if (typeof fallback !== \"undefined\" && fallback !== prop) {\n key = $02b6f511cc6c123c$var$addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) return false;\n }\n return $02b6f511cc6c123c$export$a9c996f45e5784d0(Array.from(set), [\n \"\"\n ], rootScopes, fallback, ()=>$02b6f511cc6c123c$var$subGetTarget(resolver, prop, value));\n}\nfunction $02b6f511cc6c123c$var$addScopesFromKey(set, allScopes, key, fallback, item) {\n while(key)key = $02b6f511cc6c123c$var$addScopes(set, allScopes, key, fallback, item);\n return key;\n}\nfunction $02b6f511cc6c123c$var$subGetTarget(resolver, prop, value) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) parent[prop] = {};\n const target = parent[prop];\n if ($02b6f511cc6c123c$export$8b22cf2602fb60ce(target) && $02b6f511cc6c123c$export$23f2a1d2818174ef(value)) // For array of objects, the object is used to store updated values\n return value;\n return target || {};\n}\nfunction $02b6f511cc6c123c$var$_resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n let value;\n for (const prefix of prefixes){\n value = $02b6f511cc6c123c$var$_resolve($02b6f511cc6c123c$var$readKey(prefix, prop), scopes);\n if (typeof value !== \"undefined\") return $02b6f511cc6c123c$var$needsSubResolver(prop, value) ? $02b6f511cc6c123c$var$createSubResolver(scopes, proxy, prop, value) : value;\n }\n}\nfunction $02b6f511cc6c123c$var$_resolve(key, scopes) {\n for (const scope of scopes){\n if (!scope) continue;\n const value = scope[key];\n if (typeof value !== \"undefined\") return value;\n }\n}\nfunction $02b6f511cc6c123c$var$getKeysFromAllScopes(target) {\n let keys = target._keys;\n if (!keys) keys = target._keys = $02b6f511cc6c123c$var$resolveKeysFromAllScopes(target._scopes);\n return keys;\n}\nfunction $02b6f511cc6c123c$var$resolveKeysFromAllScopes(scopes) {\n const set = new Set();\n for (const scope of scopes)for (const key of Object.keys(scope).filter((k)=>!k.startsWith(\"_\")))set.add(key);\n return Array.from(set);\n}\nfunction $02b6f511cc6c123c$export$4a5767248b18ef41(meta, data, start, count) {\n const { iScale: iScale } = meta;\n const { key: key = \"r\" } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse($02b6f511cc6c123c$export$2d1720544b23b823(item, key), index)\n };\n }\n return parsed;\n}\nconst $02b6f511cc6c123c$var$EPSILON = Number.EPSILON || 1e-14;\nconst $02b6f511cc6c123c$var$getPoint = (points, i)=>i < points.length && !points[i].skip && points[i];\nconst $02b6f511cc6c123c$var$getValueAxis = (indexAxis)=>indexAxis === \"x\" ? \"y\" : \"x\";\nfunction $02b6f511cc6c123c$export$e171bab687b50e0(firstPoint, middlePoint, afterPoint, t) {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n // This function must also respect \"skipped\" points\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = $02b6f511cc6c123c$export$158acd800e1ef08b(current, previous);\n const d12 = $02b6f511cc6c123c$export$158acd800e1ef08b(next, current);\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n/**\n * Adjust tangents to ensure monotonic properties\n */ function $02b6f511cc6c123c$var$monotoneAdjust(points, deltaK, mK) {\n const pointsLen = points.length;\n let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n let pointAfter = $02b6f511cc6c123c$var$getPoint(points, 0);\n for(let i = 0; i < pointsLen - 1; ++i){\n pointCurrent = pointAfter;\n pointAfter = $02b6f511cc6c123c$var$getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) continue;\n if ($02b6f511cc6c123c$export$a05254e7c3aeba6e(deltaK[i], 0, $02b6f511cc6c123c$var$EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) continue;\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\nfunction $02b6f511cc6c123c$var$monotoneCompute(points, mK, indexAxis = \"x\") {\n const valueAxis = $02b6f511cc6c123c$var$getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta, pointBefore, pointCurrent;\n let pointAfter = $02b6f511cc6c123c$var$getPoint(points, 0);\n for(let i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = $02b6f511cc6c123c$var$getPoint(points, i + 1);\n if (!pointCurrent) continue;\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */ function $02b6f511cc6c123c$export$527e9aa3390079e9(points, indexAxis = \"x\") {\n const valueAxis = $02b6f511cc6c123c$var$getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK = Array(pointsLen).fill(0);\n const mK = Array(pointsLen);\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore, pointCurrent;\n let pointAfter = $02b6f511cc6c123c$var$getPoint(points, 0);\n for(i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = $02b6f511cc6c123c$var$getPoint(points, i + 1);\n if (!pointCurrent) continue;\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : $02b6f511cc6c123c$export$2408f22a0fab9ae5(deltaK[i - 1]) !== $02b6f511cc6c123c$export$2408f22a0fab9ae5(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n $02b6f511cc6c123c$var$monotoneAdjust(points, deltaK, mK);\n $02b6f511cc6c123c$var$monotoneCompute(points, mK, indexAxis);\n}\nfunction $02b6f511cc6c123c$var$capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n}\nfunction $02b6f511cc6c123c$var$capBezierPoints(points, area) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = $02b6f511cc6c123c$export$e7094788287c5e9b(points[0], area);\n for(i = 0, ilen = points.length; i < ilen; ++i){\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && $02b6f511cc6c123c$export$e7094788287c5e9b(points[i + 1], area);\n if (!inArea) continue;\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = $02b6f511cc6c123c$var$capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = $02b6f511cc6c123c$var$capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = $02b6f511cc6c123c$var$capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = $02b6f511cc6c123c$var$capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$ab83b03e4111b1d0(points, options, area, loop, indexAxis) {\n let i, ilen, point, controlPoints;\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) points = points.filter((pt)=>!pt.skip);\n if (options.cubicInterpolationMode === \"monotone\") $02b6f511cc6c123c$export$527e9aa3390079e9(points, indexAxis);\n else {\n let prev = loop ? points[points.length - 1] : points[0];\n for(i = 0, ilen = points.length; i < ilen; ++i){\n point = points[i];\n controlPoints = $02b6f511cc6c123c$export$e171bab687b50e0(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension);\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n if (options.capBezierPoints) $02b6f511cc6c123c$var$capBezierPoints(points, area);\n}\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */ /**\n * @private\n */ function $02b6f511cc6c123c$export$3a1a48c8f6ef640e() {\n return typeof window !== \"undefined\" && typeof document !== \"undefined\";\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$9bb611d729802a56(domNode) {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === \"[object ShadowRoot]\") parent = parent.host;\n return parent;\n}\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */ function $02b6f511cc6c123c$var$parseMaxStyle(styleValue, node, parentProperty) {\n let valueInPixels;\n if (typeof styleValue === \"string\") {\n valueInPixels = parseInt(styleValue, 10);\n if (styleValue.indexOf(\"%\") !== -1) // percentage * size in dimension\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n } else valueInPixels = styleValue;\n return valueInPixels;\n}\nconst $02b6f511cc6c123c$var$getComputedStyle = (element)=>element.ownerDocument.defaultView.getComputedStyle(element, null);\nfunction $02b6f511cc6c123c$export$a17c37559e1db147(el, property) {\n return $02b6f511cc6c123c$var$getComputedStyle(el).getPropertyValue(property);\n}\nconst $02b6f511cc6c123c$var$positions = [\n \"top\",\n \"right\",\n \"bottom\",\n \"left\"\n];\nfunction $02b6f511cc6c123c$var$getPositionedStyle(styles, style, suffix) {\n const result = {};\n suffix = suffix ? \"-\" + suffix : \"\";\n for(let i = 0; i < 4; i++){\n const pos = $02b6f511cc6c123c$var$positions[i];\n result[pos] = parseFloat(styles[style + \"-\" + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\nconst $02b6f511cc6c123c$var$useOffsetPos = (x, y, target)=>(x > 0 || y > 0) && (!target || !target.shadowRoot);\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */ function $02b6f511cc6c123c$var$getCanvasPosition(e, canvas) {\n const touches = e.touches;\n const source = touches && touches.length ? touches[0] : e;\n const { offsetX: offsetX, offsetY: offsetY } = source;\n let box = false;\n let x, y;\n if ($02b6f511cc6c123c$var$useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {\n x: x,\n y: y,\n box: box\n };\n}\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */ function $02b6f511cc6c123c$export$df995fae86a55f06(event, chart) {\n if (\"native\" in event) return event;\n const { canvas: canvas, currentDevicePixelRatio: currentDevicePixelRatio } = chart;\n const style = $02b6f511cc6c123c$var$getComputedStyle(canvas);\n const borderBox = style.boxSizing === \"border-box\";\n const paddings = $02b6f511cc6c123c$var$getPositionedStyle(style, \"padding\");\n const borders = $02b6f511cc6c123c$var$getPositionedStyle(style, \"border\", \"width\");\n const { x: x, y: y, box: box } = $02b6f511cc6c123c$var$getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n let { width: width, height: height } = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\nfunction $02b6f511cc6c123c$var$getContainerSize(canvas, width, height) {\n let maxWidth, maxHeight;\n if (width === undefined || height === undefined) {\n const container = $02b6f511cc6c123c$export$9bb611d729802a56(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = $02b6f511cc6c123c$var$getComputedStyle(container);\n const containerBorder = $02b6f511cc6c123c$var$getPositionedStyle(containerStyle, \"border\", \"width\");\n const containerPadding = $02b6f511cc6c123c$var$getPositionedStyle(containerStyle, \"padding\");\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = $02b6f511cc6c123c$var$parseMaxStyle(containerStyle.maxWidth, container, \"clientWidth\");\n maxHeight = $02b6f511cc6c123c$var$parseMaxStyle(containerStyle.maxHeight, container, \"clientHeight\");\n }\n }\n return {\n width: width,\n height: height,\n maxWidth: maxWidth || $02b6f511cc6c123c$export$2ec5befb9e6c97d4,\n maxHeight: maxHeight || $02b6f511cc6c123c$export$2ec5befb9e6c97d4\n };\n}\nconst $02b6f511cc6c123c$var$round1 = (v)=>Math.round(v * 10) / 10;\n// eslint-disable-next-line complexity\nfunction $02b6f511cc6c123c$export$2329c99376c9d0a4(canvas, bbWidth, bbHeight, aspectRatio) {\n const style = $02b6f511cc6c123c$var$getComputedStyle(canvas);\n const margins = $02b6f511cc6c123c$var$getPositionedStyle(style, \"margin\");\n const maxWidth = $02b6f511cc6c123c$var$parseMaxStyle(style.maxWidth, canvas, \"clientWidth\") || $02b6f511cc6c123c$export$2ec5befb9e6c97d4;\n const maxHeight = $02b6f511cc6c123c$var$parseMaxStyle(style.maxHeight, canvas, \"clientHeight\") || $02b6f511cc6c123c$export$2ec5befb9e6c97d4;\n const containerSize = $02b6f511cc6c123c$var$getContainerSize(canvas, bbWidth, bbHeight);\n let { width: width, height: height } = containerSize;\n if (style.boxSizing === \"content-box\") {\n const borders = $02b6f511cc6c123c$var$getPositionedStyle(style, \"border\", \"width\");\n const paddings = $02b6f511cc6c123c$var$getPositionedStyle(style, \"padding\");\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = $02b6f511cc6c123c$var$round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = $02b6f511cc6c123c$var$round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = $02b6f511cc6c123c$var$round1(width / 2);\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = $02b6f511cc6c123c$var$round1(Math.floor(height * aspectRatio));\n }\n return {\n width: width,\n height: height\n };\n}\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */ function $02b6f511cc6c123c$export$f787f51d84a910ad(chart, forceRatio, forceStyle) {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n const canvas = chart.canvas;\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */ const $02b6f511cc6c123c$export$3466f893ebf79586 = function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive () {\n passiveSupported = true;\n return false;\n }\n };\n window.addEventListener(\"test\", null, options);\n window.removeEventListener(\"test\", null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}();\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */ function $02b6f511cc6c123c$export$b4171a6734a65d42(element, property) {\n const value = $02b6f511cc6c123c$export$a17c37559e1db147(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$8a5498727ef6be21(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$7a38258bbe170828(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === \"middle\" ? t < 0.5 ? p1.y : p2.y : mode === \"after\" ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y\n };\n}\n/**\n * @private\n */ function $02b6f511cc6c123c$export$2f6ca3d3b1f80bf5(p1, p2, t, mode) {\n const cp1 = {\n x: p1.cp2x,\n y: p1.cp2y\n };\n const cp2 = {\n x: p2.cp1x,\n y: p2.cp1y\n };\n const a = $02b6f511cc6c123c$export$8a5498727ef6be21(p1, cp1, t);\n const b = $02b6f511cc6c123c$export$8a5498727ef6be21(cp1, cp2, t);\n const c = $02b6f511cc6c123c$export$8a5498727ef6be21(cp2, p2, t);\n const d = $02b6f511cc6c123c$export$8a5498727ef6be21(a, b, t);\n const e = $02b6f511cc6c123c$export$8a5498727ef6be21(b, c, t);\n return $02b6f511cc6c123c$export$8a5498727ef6be21(d, e, t);\n}\nconst $02b6f511cc6c123c$var$getRightToLeftAdapter = function(rectX, width) {\n return {\n x (x) {\n return rectX + rectX + width - x;\n },\n setWidth (w) {\n width = w;\n },\n textAlign (align) {\n if (align === \"center\") return align;\n return align === \"right\" ? \"left\" : \"right\";\n },\n xPlus (x, value) {\n return x - value;\n },\n leftForLtr (x, itemWidth) {\n return x - itemWidth;\n }\n };\n};\nconst $02b6f511cc6c123c$var$getLeftToRightAdapter = function() {\n return {\n x (x) {\n return x;\n },\n setWidth (w) {},\n textAlign (align) {\n return align;\n },\n xPlus (x, value) {\n return x + value;\n },\n leftForLtr (x, _itemWidth) {\n return x;\n }\n };\n};\nfunction $02b6f511cc6c123c$export$3d12bd131bb975d1(rtl, rectX, width) {\n return rtl ? $02b6f511cc6c123c$var$getRightToLeftAdapter(rectX, width) : $02b6f511cc6c123c$var$getLeftToRightAdapter();\n}\nfunction $02b6f511cc6c123c$export$91c6e00c14e7e6fd(ctx, direction) {\n let style, original;\n if (direction === \"ltr\" || direction === \"rtl\") {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue(\"direction\"),\n style.getPropertyPriority(\"direction\")\n ];\n style.setProperty(\"direction\", direction, \"important\");\n ctx.prevTextDirection = original;\n }\n}\nfunction $02b6f511cc6c123c$export$890c4ad488842ce7(ctx, original) {\n if (original !== undefined) {\n delete ctx.prevTextDirection;\n ctx.canvas.style.setProperty(\"direction\", original[0], original[1]);\n }\n}\nfunction $02b6f511cc6c123c$var$propertyFn(property) {\n if (property === \"angle\") return {\n between: $02b6f511cc6c123c$export$ffb5f4729a158638,\n compare: $02b6f511cc6c123c$export$c18d01048907ea92,\n normalize: $02b6f511cc6c123c$export$28f7fcd39efa255\n };\n return {\n between: $02b6f511cc6c123c$export$3b513254972cfc9c,\n compare: (a, b)=>a - b,\n normalize: (x)=>x\n };\n}\nfunction $02b6f511cc6c123c$var$normalizeSegment({ start: start, end: end, count: count, loop: loop, style: style }) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style: style\n };\n}\nfunction $02b6f511cc6c123c$var$getSegment(segment, points, bounds) {\n const { property: property, start: startBound, end: endBound } = bounds;\n const { between: between, normalize: normalize } = $02b6f511cc6c123c$var$propertyFn(property);\n const count = points.length;\n let { start: start, end: end, loop: loop } = segment;\n let i, ilen;\n if (loop) {\n start += count;\n end += count;\n for(i = 0, ilen = count; i < ilen; ++i){\n if (!between(normalize(points[start % count][property]), startBound, endBound)) break;\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n if (end < start) end += count;\n return {\n start: start,\n end: end,\n loop: loop,\n style: segment.style\n };\n}\nfunction $02b6f511cc6c123c$export$9fa96a7d116ea3ce(segment, points, bounds) {\n if (!bounds) return [\n segment\n ];\n const { property: property, start: startBound, end: endBound } = bounds;\n const count = points.length;\n const { compare: compare, between: between, normalize: normalize } = $02b6f511cc6c123c$var$propertyFn(property);\n const { start: start, end: end, loop: loop, style: style } = $02b6f511cc6c123c$var$getSegment(segment, points, bounds);\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n const startIsBefore = ()=>between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = ()=>compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = ()=>inside || startIsBefore();\n const shouldStop = ()=>!inside || endIsBefore();\n for(let i = start, prev = start; i <= end; ++i){\n point = points[i % count];\n if (point.skip) continue;\n value = normalize(point[property]);\n if (value === prevValue) continue;\n inside = between(value, startBound, endBound);\n if (subStart === null && shouldStart()) subStart = compare(value, startBound) === 0 ? i : prev;\n if (subStart !== null && shouldStop()) {\n result.push($02b6f511cc6c123c$var$normalizeSegment({\n start: subStart,\n end: i,\n loop: loop,\n count: count,\n style: style\n }));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n if (subStart !== null) result.push($02b6f511cc6c123c$var$normalizeSegment({\n start: subStart,\n end: end,\n loop: loop,\n count: count,\n style: style\n }));\n return result;\n}\nfunction $02b6f511cc6c123c$export$306ddfe3a8403e2(line, bounds) {\n const result = [];\n const segments = line.segments;\n for(let i = 0; i < segments.length; i++){\n const sub = $02b6f511cc6c123c$export$9fa96a7d116ea3ce(segments[i], line.points, bounds);\n if (sub.length) result.push(...sub);\n }\n return result;\n}\nfunction $02b6f511cc6c123c$var$findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n if (loop && !spanGaps) while(start < count && !points[start].skip)start++;\n while(start < count && points[start].skip)start++;\n start %= count;\n if (loop) end += start;\n while(end > start && points[end % count].skip)end--;\n end %= count;\n return {\n start: start,\n end: end\n };\n}\nfunction $02b6f511cc6c123c$var$solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n for(end = start + 1; end <= max; ++end){\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({\n start: start % count,\n end: (end - 1) % count,\n loop: loop\n });\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) start = end;\n }\n prev = cur;\n }\n if (last !== null) result.push({\n start: start % count,\n end: last % count,\n loop: loop\n });\n return result;\n}\nfunction $02b6f511cc6c123c$export$1a82df3d29112e01(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n if (!count) return [];\n const loop = !!line._loop;\n const { start: start, end: end } = $02b6f511cc6c123c$var$findStartAndEnd(points, count, loop, spanGaps);\n if (spanGaps === true) return $02b6f511cc6c123c$var$splitByStyles(line, [\n {\n start: start,\n end: end,\n loop: loop\n }\n ], points, segmentOptions);\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return $02b6f511cc6c123c$var$splitByStyles(line, $02b6f511cc6c123c$var$solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\nfunction $02b6f511cc6c123c$var$splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) return segments;\n return $02b6f511cc6c123c$var$doSplitByStyles(line, segments, points, segmentOptions);\n}\nfunction $02b6f511cc6c123c$var$doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = $02b6f511cc6c123c$var$readStyle(line.options);\n const { _datasetIndex: datasetIndex, options: { spanGaps: spanGaps } } = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) return;\n s += count;\n while(points[s % count].skip)s -= dir;\n while(points[e % count].skip)e += dir;\n if (s % count !== e % count) {\n result.push({\n start: s % count,\n end: e % count,\n loop: l,\n style: st\n });\n prevStyle = st;\n start = e % count;\n }\n }\n for (const segment of segments){\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for(i = start + 1; i <= segment.end; i++){\n const pt = points[i % count];\n style = $02b6f511cc6c123c$var$readStyle(segmentOptions.setContext($02b6f511cc6c123c$export$35e795649ee09318(chartContext, {\n type: \"segment\",\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex: datasetIndex\n })));\n if ($02b6f511cc6c123c$var$styleChanged(style, prevStyle)) addStyle(start, i - 1, segment.loop, prevStyle);\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) addStyle(start, i - 1, segment.loop, prevStyle);\n }\n return result;\n}\nfunction $02b6f511cc6c123c$var$readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\nfunction $02b6f511cc6c123c$var$styleChanged(style, prevStyle) {\n if (!prevStyle) return false;\n const cache = [];\n const replacer = function(key, value) {\n if (!$02b6f511cc6c123c$export$f96d196f7728bb5(value)) return value;\n if (!cache.includes(value)) cache.push(value);\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n\n\n\nclass $77dc20320068f1ee$var$Animator {\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n callbacks.forEach((fn)=>fn({\n chart: chart,\n initial: anims.initial,\n numSteps: numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n _refresh() {\n if (this._request) return;\n this._running = true;\n this._request = (0, $02b6f511cc6c123c$export$43caf9889c228507).call(window, ()=>{\n this._update();\n this._request = null;\n if (this._running) this._refresh();\n });\n }\n _update(date = Date.now()) {\n let remaining = 0;\n this._charts.forEach((anims, chart)=>{\n if (!anims.running || !anims.items.length) return;\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n for(; i >= 0; --i){\n item = items[i];\n if (item._active) {\n if (item._total > anims.duration) anims.duration = item._total;\n item.tick(date);\n draw = true;\n } else {\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, \"progress\");\n }\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, \"complete\");\n anims.initial = false;\n }\n remaining += items.length;\n });\n this._lastDate = date;\n if (remaining === 0) this._running = false;\n }\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n add(chart, items) {\n if (!items || !items.length) return;\n this._getAnims(chart).items.push(...items);\n }\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) return;\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur)=>Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n running(chart) {\n if (!this._running) return false;\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) return false;\n return true;\n }\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) return;\n const items = anims.items;\n let i = items.length - 1;\n for(; i >= 0; --i)items[i].cancel();\n anims.items = [];\n this._notify(chart, anims, Date.now(), \"complete\");\n }\n remove(chart) {\n return this._charts.delete(chart);\n }\n constructor(){\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n}\nvar $77dc20320068f1ee$export$a424a0aa8f687495 = /* #__PURE__ */ new $77dc20320068f1ee$var$Animator();\nconst $77dc20320068f1ee$var$transparent = \"transparent\";\nconst $77dc20320068f1ee$var$interpolators = {\n boolean (from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n color (from, to, factor) {\n const c0 = (0, $02b6f511cc6c123c$export$db3b6bfb95261072)(from || $77dc20320068f1ee$var$transparent);\n const c1 = c0.valid && (0, $02b6f511cc6c123c$export$db3b6bfb95261072)(to || $77dc20320068f1ee$var$transparent);\n return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to;\n },\n number (from, to, factor) {\n return from + (to - from) * factor;\n }\n};\nclass $77dc20320068f1ee$export$c35d437ae5945fcd {\n active() {\n return this._active;\n }\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = (0, $02b6f511cc6c123c$export$407448d2b89b1813)([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n this._from = (0, $02b6f511cc6c123c$export$407448d2b89b1813)([\n cfg.from,\n currentValue,\n to\n ]);\n }\n }\n cancel() {\n if (this._active) {\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n this._active = from !== to && (loop || elapsed < duration);\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n factor = elapsed / duration % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n this._target[prop] = this._fn(from, to, factor);\n }\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej)=>{\n promises.push({\n res: res,\n rej: rej\n });\n });\n }\n _notify(resolved) {\n const method = resolved ? \"res\" : \"rej\";\n const promises = this._promises || [];\n for(let i = 0; i < promises.length; i++)promises[i][method]();\n }\n constructor(cfg, target, prop, to){\n const currentValue = target[prop];\n to = (0, $02b6f511cc6c123c$export$407448d2b89b1813)([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n const from = (0, $02b6f511cc6c123c$export$407448d2b89b1813)([\n cfg.from,\n currentValue,\n to\n ]);\n this._active = true;\n this._fn = cfg.fn || $77dc20320068f1ee$var$interpolators[cfg.type || typeof from];\n this._easing = (0, $02b6f511cc6c123c$export$f1e1789686576879)[cfg.easing] || (0, $02b6f511cc6c123c$export$f1e1789686576879).linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n}\nclass $77dc20320068f1ee$export$8ab227dac26677d {\n configure(config) {\n if (!(0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(config)) return;\n const animationOptions = Object.keys((0, $02b6f511cc6c123c$export$4368d992c4eafac0).animation);\n const animatedProps = this._properties;\n Object.getOwnPropertyNames(config).forEach((key)=>{\n const cfg = config[key];\n if (!(0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(cfg)) return;\n const resolved = {};\n for (const option of animationOptions)resolved[option] = cfg[option];\n ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(cfg.properties) && cfg.properties || [\n key\n ]).forEach((prop)=>{\n if (prop === key || !animatedProps.has(prop)) animatedProps.set(prop, resolved);\n });\n });\n }\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = $77dc20320068f1ee$var$resolveTargetOptions(target, newOptions);\n if (!options) return [];\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) $77dc20320068f1ee$var$awaitAll(target.options.$animations, newOptions).then(()=>{\n target.options = newOptions;\n }, ()=>{});\n return animations;\n }\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n for(i = props.length - 1; i >= 0; --i){\n const prop = props[i];\n if (prop.charAt(0) === \"$\") continue;\n if (prop === \"options\") {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n if (animation) {\n if (cfg && animation.active()) {\n animation.update(cfg, value, date);\n continue;\n } else animation.cancel();\n }\n if (!cfg || !cfg.duration) {\n target[prop] = value;\n continue;\n }\n running[prop] = animation = new $77dc20320068f1ee$export$c35d437ae5945fcd(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n update(target, values) {\n if (this._properties.size === 0) {\n Object.assign(target, values);\n return;\n }\n const animations = this._createAnimations(target, values);\n if (animations.length) {\n $77dc20320068f1ee$export$a424a0aa8f687495.add(this._chart, animations);\n return true;\n }\n }\n constructor(chart, config){\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n}\nfunction $77dc20320068f1ee$var$awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for(let i = 0; i < keys.length; i++){\n const anim = animations[keys[i]];\n if (anim && anim.active()) running.push(anim.wait());\n }\n return Promise.all(running);\n}\nfunction $77dc20320068f1ee$var$resolveTargetOptions(target, newOptions) {\n if (!newOptions) return;\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) target.options = options = Object.assign({}, options, {\n $shared: false,\n $animations: {}\n });\n return options;\n}\nfunction $77dc20320068f1ee$var$scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\nfunction $77dc20320068f1ee$var$defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) return false;\n const x = $77dc20320068f1ee$var$scaleClip(xScale, allowedOverflow);\n const y = $77dc20320068f1ee$var$scaleClip(yScale, allowedOverflow);\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\nfunction $77dc20320068f1ee$var$toClip(value) {\n let t, r, b, l;\n if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else t = r = b = l = value;\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\nfunction $77dc20320068f1ee$var$getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i)keys.push(metasets[i].index);\n return keys;\n}\nfunction $77dc20320068f1ee$var$applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === \"single\";\n let i, ilen, datasetIndex, otherValue;\n if (value === null) return;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) continue;\n break;\n }\n otherValue = stack.values[datasetIndex];\n if ((0, $02b6f511cc6c123c$export$39b482c5e57630a8)(otherValue) && (singleMode || value === 0 || (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(value) === (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(otherValue))) value += otherValue;\n }\n return value;\n}\nfunction $77dc20320068f1ee$var$convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\nfunction $77dc20320068f1ee$var$isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || stacked === undefined && meta.stack !== undefined;\n}\nfunction $77dc20320068f1ee$var$getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction $77dc20320068f1ee$var$getUserBounds(scale) {\n const { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\nfunction $77dc20320068f1ee$var$getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction $77dc20320068f1ee$var$getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()){\n const value = stack[meta.index];\n if (positive && value > 0 || !positive && value < 0) return meta.index;\n }\n return null;\n}\nfunction $77dc20320068f1ee$var$updateStacks(controller, parsed) {\n const { chart: chart, _cachedMeta: meta } = controller;\n const stacks = chart._stacks || (chart._stacks = {});\n const { iScale: iScale, vScale: vScale, index: datasetIndex } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = $77dc20320068f1ee$var$getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n for(let i = 0; i < ilen; ++i){\n const item = parsed[i];\n const { [iAxis]: index, [vAxis]: value } = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = $77dc20320068f1ee$var$getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n stack._top = $77dc20320068f1ee$var$getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = $77dc20320068f1ee$var$getLastIndexInStack(stack, vScale, false, meta.type);\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\nfunction $77dc20320068f1ee$var$getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter((key)=>scales[key].axis === axis).shift();\n}\nfunction $77dc20320068f1ee$var$createDatasetContext(parent, index) {\n return (0, $02b6f511cc6c123c$export$35e795649ee09318)(parent, {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index: index,\n mode: \"default\",\n type: \"dataset\"\n });\n}\nfunction $77dc20320068f1ee$var$createDataContext(parent, index, element) {\n return (0, $02b6f511cc6c123c$export$35e795649ee09318)(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element: element,\n index: index,\n mode: \"default\",\n type: \"data\"\n });\n}\nfunction $77dc20320068f1ee$var$clearStacks(meta, items) {\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) return;\n items = items || meta._parsed;\n for (const parsed of items){\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) return;\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) delete stacks[axis]._visualValues[datasetIndex];\n }\n}\nconst $77dc20320068f1ee$var$isDirectUpdateMode = (mode)=>mode === \"reset\" || mode === \"none\";\nconst $77dc20320068f1ee$var$cloneIfNotShared = (cached, shared)=>shared ? cached : Object.assign({}, cached);\nconst $77dc20320068f1ee$var$createStack = (canStack, meta, chart)=>canStack && !meta.hidden && meta._stacked && {\n keys: $77dc20320068f1ee$var$getSortedDatasetIndices(chart, true),\n values: null\n };\nclass $77dc20320068f1ee$export$75572ec5c55b4048 {\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = $77dc20320068f1ee$var$isStacked(meta.vScale, meta);\n this.addElements();\n if (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\");\n }\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) $77dc20320068f1ee$var$clearStacks(this._cachedMeta);\n this.index = datasetIndex;\n }\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n const chooseId = (axis, x, y, r)=>axis === \"x\" ? x : axis === \"r\" ? r : y;\n const xid = meta.xAxisID = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(dataset.xAxisID, $77dc20320068f1ee$var$getFirstScaleId(chart, \"x\"));\n const yid = meta.yAxisID = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(dataset.yAxisID, $77dc20320068f1ee$var$getFirstScaleId(chart, \"y\"));\n const rid = meta.rAxisID = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(dataset.rAxisID, $77dc20320068f1ee$var$getFirstScaleId(chart, \"r\"));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale ? meta.vScale : meta.iScale;\n }\n reset() {\n this._update(\"reset\");\n }\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) (0, $02b6f511cc6c123c$export$3b14a55fb2447963)(this._data, this);\n if (meta._stacked) $77dc20320068f1ee$var$clearStacks(meta);\n }\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(data)) this._data = $77dc20320068f1ee$var$convertObjectDataToArray(data);\n else if (_data !== data) {\n if (_data) {\n (0, $02b6f511cc6c123c$export$3b14a55fb2447963)(_data, this);\n const meta = this._cachedMeta;\n $77dc20320068f1ee$var$clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) (0, $02b6f511cc6c123c$export$882b5998b3b9117c)(data, this);\n this._syncList = [];\n this._data = data;\n }\n }\n addElements() {\n const meta = this._cachedMeta;\n this._dataCheck();\n if (this.datasetElementType) meta.dataset = new this.datasetElementType();\n }\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n this._dataCheck();\n const oldStacked = meta._stacked;\n meta._stacked = $77dc20320068f1ee$var$isStacked(meta.vScale, meta);\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n $77dc20320068f1ee$var$clearStacks(meta);\n meta.stack = dataset.stack;\n }\n this._resyncElements(resetNewElements);\n if (stackChanged || oldStacked !== meta._stacked) $77dc20320068f1ee$var$updateStacks(this, meta._parsed);\n }\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n parse(start, count) {\n const { _cachedMeta: meta, _data: data } = this;\n const { iScale: iScale, _stacked: _stacked } = meta;\n const iAxis = iScale.axis;\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(data[start])) parsed = this.parseArrayData(meta, data, start, count);\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(data[start])) parsed = this.parseObjectData(meta, data, start, count);\n else parsed = this.parsePrimitiveData(meta, data, start, count);\n const isNotInOrderComparedToPrev = ()=>cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];\n for(i = 0; i < count; ++i){\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) sorted = false;\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n if (_stacked) $77dc20320068f1ee$var$updateStacks(this, parsed);\n }\n parsePrimitiveData(meta, data, start, count) {\n const { iScale: iScale, vScale: vScale } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const { xScale: xScale, yScale: yScale } = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const { xScale: xScale, yScale: yScale } = meta;\n const { xAxisKey: xAxisKey = \"x\", yAxisKey: yAxisKey = \"y\" } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse((0, $02b6f511cc6c123c$export$2d1720544b23b823)(item, xAxisKey), index),\n y: yScale.parse((0, $02b6f511cc6c123c$export$2d1720544b23b823)(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: $77dc20320068f1ee$var$getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return $77dc20320068f1ee$var$applyStack(stack, value, meta.index, {\n mode: mode\n });\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = $77dc20320068f1ee$var$applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = $77dc20320068f1ee$var$createStack(canStack, meta, this.chart);\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n const { min: otherMin, max: otherMax } = $77dc20320068f1ee$var$getUserBounds(otherScale);\n let i, parsed;\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !(0, $02b6f511cc6c123c$export$39b482c5e57630a8)(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n for(i = 0; i < ilen; ++i){\n if (_skip()) continue;\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) break;\n }\n if (sorted) for(i = ilen - 1; i >= 0; --i){\n if (_skip()) continue;\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n return range;\n }\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n for(i = 0, ilen = parsed.length; i < ilen; ++i){\n value = parsed[i][scale.axis];\n if ((0, $02b6f511cc6c123c$export$39b482c5e57630a8)(value)) values.push(value);\n }\n return values;\n }\n getMaxOverflow() {\n return false;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? \"\" + iScale.getLabelForValue(parsed[iScale.axis]) : \"\",\n value: vScale ? \"\" + vScale.getLabelForValue(parsed[vScale.axis]) : \"\"\n };\n }\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || \"default\");\n meta._clip = $77dc20320068f1ee$var$toClip((0, $02b6f511cc6c123c$export$90a7f3efeed30595)(this.options.clip, $77dc20320068f1ee$var$defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n update(mode) {}\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || elements.length - start;\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n if (meta.dataset) meta.dataset.draw(ctx, area, start, count);\n for(i = start; i < start + count; ++i){\n const element = elements[i];\n if (element.hidden) continue;\n if (element.active && drawActiveElementsOnTop) active.push(element);\n else element.draw(ctx, area);\n }\n for(i = 0; i < active.length; ++i)active[i].draw(ctx, area);\n }\n getStyle(index, active) {\n const mode = active ? \"active\" : \"default\";\n return index === undefined && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index || 0, mode);\n }\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context || (element.$context = $77dc20320068f1ee$var$createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context || (this.$context = $77dc20320068f1ee$var$createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n _resolveElementOptions(elementType, mode = \"default\", index) {\n const active = mode === \"active\";\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + \"-\" + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && (0, $02b6f511cc6c123c$export$dda1d9f60106f0e9)(index);\n if (cached) return $77dc20320068f1ee$var$cloneIfNotShared(cached, sharing);\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [\n `${elementType}Hover`,\n \"hover\",\n elementType,\n \"\"\n ] : [\n elementType,\n \"\"\n ];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys((0, $02b6f511cc6c123c$export$4368d992c4eafac0).elements[elementType]);\n const context = ()=>this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n if (values.$shared) {\n values.$shared = sharing;\n cache[cacheKey] = Object.freeze($77dc20320068f1ee$var$cloneIfNotShared(values, sharing));\n }\n return values;\n }\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) return cached;\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new $77dc20320068f1ee$export$8ab227dac26677d(chart, options && options.animations);\n if (options && options._cacheable) cache[cacheKey] = Object.freeze(animations);\n return animations;\n }\n getSharedOptions(options) {\n if (!options.$shared) return;\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || $77dc20320068f1ee$var$isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions;\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {\n sharedOptions: sharedOptions,\n includeOptions: includeOptions\n };\n }\n updateElement(element, index, properties, mode) {\n if ($77dc20320068f1ee$var$isDirectUpdateMode(mode)) Object.assign(element, properties);\n else this._resolveAnimations(index, mode).update(element, properties);\n }\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !$77dc20320068f1ee$var$isDirectUpdateMode(mode)) this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n options: !active && this.getSharedOptions(options) || options\n });\n }\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, \"active\", false);\n }\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, \"active\", true);\n }\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) this._setStyle(element, undefined, \"active\", false);\n }\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) this._setStyle(element, undefined, \"active\", true);\n }\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n for (const [method, arg1, arg2] of this._syncList)this[method](arg1, arg2);\n this._syncList = [];\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n if (count) this.parse(0, count);\n if (numData > numMeta) this._insertElements(numMeta, numData - numMeta, resetNewElements);\n else if (numData < numMeta) this._removeElements(numData, numMeta - numData);\n }\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n const move = (arr)=>{\n arr.length += count;\n for(i = arr.length - 1; i >= end; i--)arr[i] = arr[i - count];\n };\n move(data);\n for(i = start; i < end; ++i)data[i] = new this.dataElementType();\n if (this._parsing) move(meta._parsed);\n this.parse(start, count);\n if (resetNewElements) this.updateElements(data, start, count, \"reset\");\n }\n updateElements(element, start, count, mode) {}\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) $77dc20320068f1ee$var$clearStacks(meta, removed);\n }\n meta.data.splice(start, count);\n }\n _sync(args) {\n if (this._parsing) this._syncList.push(args);\n else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([\n this.index,\n ...args\n ]);\n }\n _onDataPush() {\n const count = arguments.length;\n this._sync([\n \"_insertElements\",\n this.getDataset().data.length - count,\n count\n ]);\n }\n _onDataPop() {\n this._sync([\n \"_removeElements\",\n this._cachedMeta.data.length - 1,\n 1\n ]);\n }\n _onDataShift() {\n this._sync([\n \"_removeElements\",\n 0,\n 1\n ]);\n }\n _onDataSplice(start, count) {\n if (count) this._sync([\n \"_removeElements\",\n start,\n count\n ]);\n const newCount = arguments.length - 2;\n if (newCount) this._sync([\n \"_insertElements\",\n start,\n newCount\n ]);\n }\n _onDataUnshift() {\n this._sync([\n \"_insertElements\",\n 0,\n arguments.length\n ]);\n }\n constructor(chart, datasetIndex){\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n this.initialize();\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$75572ec5c55b4048, \"defaults\", {});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$75572ec5c55b4048, \"datasetElementType\", null);\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$75572ec5c55b4048, \"dataElementType\", null);\nfunction $77dc20320068f1ee$var$getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n for(let i = 0, ilen = visibleMetas.length; i < ilen; i++)values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n scale._cache.$bar = (0, $02b6f511cc6c123c$export$71511d61b312f219)(values.sort((a, b)=>a - b));\n }\n return scale._cache.$bar;\n}\nfunction $77dc20320068f1ee$var$computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = $77dc20320068f1ee$var$getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = ()=>{\n if (curr === 32767 || curr === -32768) return;\n if ((0, $02b6f511cc6c123c$export$dda1d9f60106f0e9)(prev)) min = Math.min(min, Math.abs(curr - prev) || min);\n prev = curr;\n };\n for(i = 0, ilen = values.length; i < ilen; ++i){\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n prev = undefined;\n for(i = 0, ilen = scale.ticks.length; i < ilen; ++i){\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n return min;\n}\nfunction $77dc20320068f1ee$var$computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n size = thickness * stackCount;\n ratio = 1;\n }\n return {\n chunk: size / stackCount,\n ratio: ratio,\n start: ruler.pixels[index] - size / 2\n };\n}\nfunction $77dc20320068f1ee$var$computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n if (prev === null) prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n if (next === null) next = curr + curr - prev;\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start: start\n };\n}\nfunction $77dc20320068f1ee$var$parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n item[vScale.axis] = barEnd;\n item._custom = {\n barStart: barStart,\n barEnd: barEnd,\n start: startValue,\n end: endValue,\n min: min,\n max: max\n };\n}\nfunction $77dc20320068f1ee$var$parseValue(entry, item, vScale, i) {\n if ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(entry)) $77dc20320068f1ee$var$parseFloatBar(entry, item, vScale, i);\n else item[vScale.axis] = vScale.parse(entry, i);\n return item;\n}\nfunction $77dc20320068f1ee$var$parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n for(i = start, ilen = start + count; i < ilen; ++i){\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push($77dc20320068f1ee$var$parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\nfunction $77dc20320068f1ee$var$isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction $77dc20320068f1ee$var$barSign(size, vScale, actualBase) {\n if (size !== 0) return (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(size);\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction $77dc20320068f1ee$var$borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = \"left\";\n end = \"right\";\n } else {\n reverse = properties.base < properties.y;\n start = \"bottom\";\n end = \"top\";\n }\n if (reverse) {\n top = \"end\";\n bottom = \"start\";\n } else {\n top = \"start\";\n bottom = \"end\";\n }\n return {\n start: start,\n end: end,\n reverse: reverse,\n top: top,\n bottom: bottom\n };\n}\nfunction $77dc20320068f1ee$var$setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n if (edge === true) {\n properties.borderSkipped = {\n top: true,\n right: true,\n bottom: true,\n left: true\n };\n return;\n }\n const { start: start, end: end, reverse: reverse, top: top, bottom: bottom } = $77dc20320068f1ee$var$borderProps(properties);\n if (edge === \"middle\" && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) edge = top;\n else if ((stack._bottom || 0) === index) edge = bottom;\n else {\n res[$77dc20320068f1ee$var$parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n res[$77dc20320068f1ee$var$parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\nfunction $77dc20320068f1ee$var$parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = $77dc20320068f1ee$var$swap(edge, a, b);\n edge = $77dc20320068f1ee$var$startEnd(edge, b, a);\n } else edge = $77dc20320068f1ee$var$startEnd(edge, a, b);\n return edge;\n}\nfunction $77dc20320068f1ee$var$swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction $77dc20320068f1ee$var$startEnd(v, start, end) {\n return v === \"start\" ? start : v === \"end\" ? end : v;\n}\nfunction $77dc20320068f1ee$var$setInflateAmount(properties, { inflateAmount: inflateAmount }, ratio) {\n properties.inflateAmount = inflateAmount === \"auto\" ? ratio === 1 ? 0.33 : 0 : inflateAmount;\n}\nclass $77dc20320068f1ee$export$e97d5dc64e999004 extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n parsePrimitiveData(meta, data, start, count) {\n return $77dc20320068f1ee$var$parseArrayOrPrimitive(meta, data, start, count);\n }\n parseArrayData(meta, data, start, count) {\n return $77dc20320068f1ee$var$parseArrayOrPrimitive(meta, data, start, count);\n }\n parseObjectData(meta, data, start, count) {\n const { iScale: iScale, vScale: vScale } = meta;\n const { xAxisKey: xAxisKey = \"x\", yAxisKey: yAxisKey = \"y\" } = this._parsing;\n const iAxisKey = iScale.axis === \"x\" ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === \"x\" ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for(i = start, ilen = start + count; i < ilen; ++i){\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse((0, $02b6f511cc6c123c$export$2d1720544b23b823)(obj, iAxisKey), i);\n parsed.push($77dc20320068f1ee$var$parseValue((0, $02b6f511cc6c123c$export$2d1720544b23b823)(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n getMaxOverflow() {\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const { iScale: iScale, vScale: vScale } = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = $77dc20320068f1ee$var$isFloatBar(custom) ? \"[\" + custom.start + \", \" + custom.end + \"]\" : \"\" + vScale.getLabelForValue(parsed[vScale.axis]);\n return {\n label: \"\" + iScale.getLabelForValue(parsed[iScale.axis]),\n value: value\n };\n }\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n updateElements(bars, start, count, mode) {\n const reset = mode === \"reset\";\n const { index: index, _cachedMeta: { vScale: vScale } } = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n for(let i = start; i < start + count; i++){\n const parsed = this.getParsed(i);\n const vpixels = reset || (0, $02b6f511cc6c123c$export$342063e11d6c3cad)(parsed[vScale.axis]) ? {\n base: base,\n head: base\n } : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n const properties = {\n horizontal: horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || $77dc20320068f1ee$var$isFloatBar(parsed._custom) || index === stack._top || index === stack._bottom,\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? \"active\" : mode);\n const options = properties.options || bars[i].options;\n $77dc20320068f1ee$var$setBorderSkipped(properties, options, stack, index);\n $77dc20320068f1ee$var$setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n _getStacks(last, dataIndex) {\n const { iScale: iScale } = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const skipNull = (meta)=>{\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(val) || isNaN(val)) return true;\n };\n for (const meta of metasets){\n if (dataIndex !== undefined && skipNull(meta)) continue;\n if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === undefined && meta.stack === undefined) stacks.push(meta.stack);\n if (meta.index === last) break;\n }\n if (!stacks.length) stacks.push(undefined);\n return stacks;\n }\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = name !== undefined ? stacks.indexOf(name) : -1;\n return index === -1 ? stacks.length - 1 : index;\n }\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n for(i = 0, ilen = meta.data.length; i < ilen; ++i)pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n const barThickness = opts.barThickness;\n const min = barThickness || $77dc20320068f1ee$var$computeMinSampleSize(meta);\n return {\n min: min,\n pixels: pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n _calculateBarValuePixels(index) {\n const { _cachedMeta: { vScale: vScale, _stacked: _stacked, index: datasetIndex }, options: { base: baseValue, minBarLength: minBarLength } } = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = $77dc20320068f1ee$var$isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n if (length !== value) {\n start = length - value;\n length = value;\n }\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n if (value !== 0 && (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(value) !== (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(custom.barEnd)) start = 0;\n start += value;\n }\n const startValue = !(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n if (this.chart.getDataVisibility(index)) head = vScale.getPixelForValue(start + length);\n else head = base;\n size = head - base;\n if (Math.abs(size) < minBarLength) {\n size = $77dc20320068f1ee$var$barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) base -= size / 2;\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n if (_stacked && !floating) parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n return {\n size: size,\n base: base,\n head: head,\n center: head + size / 2\n };\n }\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === \"flex\" ? $77dc20320068f1ee$var$computeFlexCategoryTraits(index, ruler, options, stackCount) : $77dc20320068f1ee$var$computeFitCategoryTraits(index, ruler, options, stackCount);\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + range.chunk * stackIndex + range.chunk / 2;\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n return {\n base: center - size / 2,\n head: center + size / 2,\n center: center,\n size: size\n };\n }\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n for(; i < ilen; ++i)if (this.getParsed(i)[vScale.axis] !== null) rects[i].draw(this._ctx);\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e97d5dc64e999004, \"id\", \"bar\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e97d5dc64e999004, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"bar\",\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"base\",\n \"width\",\n \"height\"\n ]\n }\n }\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e97d5dc64e999004, \"overrides\", {\n scales: {\n _index_: {\n type: \"category\",\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: \"linear\",\n beginAtZero: true\n }\n }\n});\nclass $77dc20320068f1ee$export$19b5c4773f17abe extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++)parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i)max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n return max > 0 && max;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale: xScale, yScale: yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n return {\n label: labels[index] || \"\",\n value: \"(\" + x + \", \" + y + (r ? \", \" + r : \"\") + \")\"\n };\n }\n update(mode) {\n const points = this._cachedMeta.data;\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === \"reset\";\n const { iScale: iScale, vScale: vScale } = this._cachedMeta;\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n if (reset) properties.options.radius = 0;\n }\n this.updateElement(point, i, properties, mode);\n }\n }\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n if (values.$shared) values = Object.assign({}, values, {\n $shared: false\n });\n const radius = values.radius;\n if (mode !== \"active\") values.radius = 0;\n values.radius += (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(parsed && parsed._custom, radius);\n return values;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$19b5c4773f17abe, \"id\", \"bubble\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$19b5c4773f17abe, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"point\",\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"borderWidth\",\n \"radius\"\n ]\n }\n }\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$19b5c4773f17abe, \"overrides\", {\n scales: {\n x: {\n type: \"linear\"\n },\n y: {\n type: \"linear\"\n }\n }\n});\nfunction $77dc20320068f1ee$var$getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n if (circumference < (0, $02b6f511cc6c123c$export$971d5caa766a69d7)) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b)=>(0, $02b6f511cc6c123c$export$ffb5f4729a158638)(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b)=>(0, $02b6f511cc6c123c$export$ffb5f4729a158638)(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax((0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd), startY, endY);\n const minX = calcMin((0, $02b6f511cc6c123c$export$56c0d5a1e737357d), startX, endX);\n const minY = calcMin((0, $02b6f511cc6c123c$export$56c0d5a1e737357d) + (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd), startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {\n ratioX: ratioX,\n ratioY: ratioY,\n offsetX: offsetX,\n offsetY: offsetY\n };\n}\nclass $77dc20320068f1ee$export$e04603e7d8b77172 extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n linkScales() {}\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n if (this._parsing === false) meta._parsed = data;\n else {\n let getter = (i)=>+data[i];\n if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(data[start])) {\n const { key: key = \"value\" } = this._parsing;\n getter = (i)=>+(0, $02b6f511cc6c123c$export$2d1720544b23b823)(data[i], key);\n }\n let i, ilen;\n for(i = start, ilen = start + count; i < ilen; ++i)meta._parsed[i] = getter(i);\n }\n }\n _getRotation() {\n return (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.options.rotation - 90);\n }\n _getCircumference() {\n return (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.options.circumference);\n }\n _getRotationExtents() {\n let min = (0, $02b6f511cc6c123c$export$971d5caa766a69d7);\n let max = -(0, $02b6f511cc6c123c$export$971d5caa766a69d7);\n for(let i = 0; i < this.chart.data.datasets.length; ++i)if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n return {\n rotation: min,\n circumference: max - min\n };\n }\n update(mode) {\n const chart = this.chart;\n const { chartArea: chartArea } = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min((0, $02b6f511cc6c123c$export$953cecd6e717a553)(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n const { circumference: circumference, rotation: rotation } = this._getRotationExtents();\n const { ratioX: ratioX, ratioY: ratioY, offsetX: offsetX, offsetY: offsetY } = $77dc20320068f1ee$var$getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = (0, $02b6f511cc6c123c$export$7ccc53e8f1e7dfc5)(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n meta.total = this.calculateTotal();\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) return 0;\n return this.calculateCircumference(meta._parsed[i] * circumference / (0, $02b6f511cc6c123c$export$971d5caa766a69d7));\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === \"reset\";\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n for(i = 0; i < start; ++i)startAngle += this._circumference(i, reset);\n for(i = start; i < start + count; ++i){\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle: startAngle,\n endAngle: startAngle + circumference,\n circumference: circumference,\n outerRadius: outerRadius,\n innerRadius: innerRadius\n };\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? \"active\" : mode);\n startAngle += circumference;\n this.updateElement(arc, i, properties, mode);\n }\n }\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n for(i = 0; i < metaData.length; i++){\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) total += Math.abs(value);\n }\n return total;\n }\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) return (0, $02b6f511cc6c123c$export$971d5caa766a69d7) * (Math.abs(value) / total);\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = (0, $02b6f511cc6c123c$export$ae1af26003f05816)(meta._parsed[index], chart.options.locale);\n return {\n label: labels[index] || \"\",\n value: value\n };\n }\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n if (!arcs) {\n for(i = 0, ilen = chart.data.datasets.length; i < ilen; ++i)if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n if (!arcs) return 0;\n for(i = 0, ilen = arcs.length; i < ilen; ++i){\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== \"inner\") max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n return max;\n }\n getMaxOffset(arcs) {\n let max = 0;\n for(let i = 0, ilen = arcs.length; i < ilen; ++i){\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n for(let i = 0; i < datasetIndex; ++i)if (this.chart.isDatasetVisible(i)) ringWeightOffset += this._getRingWeight(i);\n return ringWeightOffset;\n }\n _getRingWeight(datasetIndex) {\n return Math.max((0, $02b6f511cc6c123c$export$90a7f3efeed30595)(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e04603e7d8b77172, \"id\", \"doughnut\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e04603e7d8b77172, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"arc\",\n animation: {\n animateRotate: true,\n animateScale: false\n },\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"circumference\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\",\n \"startAngle\",\n \"x\",\n \"y\",\n \"offset\",\n \"borderWidth\",\n \"spacing\"\n ]\n }\n },\n cutout: \"50%\",\n rotation: 0,\n circumference: 360,\n radius: \"100%\",\n spacing: 0,\n indexAxis: \"r\"\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e04603e7d8b77172, \"descriptors\", {\n _scriptable: (name)=>name !== \"spacing\",\n _indexable: (name)=>name !== \"spacing\" && !name.startsWith(\"borderDash\") && !name.startsWith(\"hoverBorderDash\")\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e04603e7d8b77172, \"overrides\", {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle: pointStyle, color: color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n});\nclass $77dc20320068f1ee$export$3c9b5d28c11cbfd0 extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { dataset: line, data: points = [], _dataset: _dataset } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start: start, count: count } = (0, $02b6f511cc6c123c$export$9e5f44173e64f162)(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if ((0, $02b6f511cc6c123c$export$efccba1c4a2ef57b)(meta)) {\n start = 0;\n count = points.length;\n }\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) options.borderWidth = 0;\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options: options\n }, mode);\n this.updateElements(points, start, count, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === \"reset\";\n const { iScale: iScale, vScale: vScale, _stacked: _stacked, _dataset: _dataset } = this._cachedMeta;\n const { sharedOptions: sharedOptions, includeOptions: includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps: spanGaps, segment: segment } = this.options;\n const maxGapLength = (0, $02b6f511cc6c123c$export$d141bba7fdc215a3)(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === \"none\";\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = 0; i < pointsCount; ++i){\n const point = points[i];\n const properties = directUpdate ? point : {};\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n const parsed = this.getParsed(i);\n const nullData = (0, $02b6f511cc6c123c$export$342063e11d6c3cad)(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n if (!directUpdate) this.updateElement(point, i, properties, mode);\n prevParsed = parsed;\n }\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) return border;\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$3c9b5d28c11cbfd0, \"id\", \"line\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$3c9b5d28c11cbfd0, \"defaults\", {\n datasetElementType: \"line\",\n dataElementType: \"point\",\n showLine: true,\n spanGaps: false\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$3c9b5d28c11cbfd0, \"overrides\", {\n scales: {\n _index_: {\n type: \"category\"\n },\n _value_: {\n type: \"linear\"\n }\n }\n});\nclass $77dc20320068f1ee$export$2a270b3a0d973c85 extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = (0, $02b6f511cc6c123c$export$ae1af26003f05816)(meta._parsed[index].r, chart.options.locale);\n return {\n label: labels[index] || \"\",\n value: value\n };\n }\n parseObjectData(meta, data, start, count) {\n return (0, $02b6f511cc6c123c$export$4a5767248b18ef41).bind(this)(meta, data, start, count);\n }\n update(mode) {\n const arcs = this._cachedMeta.data;\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n meta.data.forEach((element, index)=>{\n const parsed = this.getParsed(index).r;\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) range.min = parsed;\n if (parsed > range.max) range.max = parsed;\n }\n });\n return range;\n }\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n this.outerRadius = outerRadius - radiusLength * this.index;\n this.innerRadius = this.outerRadius - radiusLength;\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === \"reset\";\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * (0, $02b6f511cc6c123c$export$56c0d5a1e737357d);\n let angle = datasetStartAngle;\n let i;\n const defaultAngle = 360 / this.countVisibleElements();\n for(i = 0; i < start; ++i)angle += this._computeAngle(i, mode, defaultAngle);\n for(i = start; i < start + count; i++){\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n if (reset) {\n if (animationOpts.animateScale) outerRadius = 0;\n if (animationOpts.animateRotate) startAngle = endAngle = datasetStartAngle;\n }\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius: outerRadius,\n startAngle: startAngle,\n endAngle: endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? \"active\" : mode)\n };\n this.updateElement(arc, i, properties, mode);\n }\n }\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n meta.data.forEach((element, index)=>{\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) count++;\n });\n return count;\n }\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index) ? (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.resolveDataElementOptions(index, mode).angle || defaultAngle) : 0;\n }\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$2a270b3a0d973c85, \"id\", \"polarArea\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$2a270b3a0d973c85, \"defaults\", {\n dataElementType: \"arc\",\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\"\n ]\n }\n },\n indexAxis: \"r\",\n startAngle: 0\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$2a270b3a0d973c85, \"overrides\", {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle: pointStyle, color: color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n scales: {\n r: {\n type: \"radialLinear\",\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n});\nclass $77dc20320068f1ee$export$b21a3f1286706191 extends $77dc20320068f1ee$export$e04603e7d8b77172 {\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$b21a3f1286706191, \"id\", \"pie\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$b21a3f1286706191, \"defaults\", {\n cutout: 0,\n rotation: 0,\n circumference: 360,\n radius: \"100%\"\n});\nclass $77dc20320068f1ee$export$48dbc6ac651bf8be extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: vScale.getLabels()[index],\n value: \"\" + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n parseObjectData(meta, data, start, count) {\n return (0, $02b6f511cc6c123c$export$4a5767248b18ef41).bind(this)(meta, data, start, count);\n }\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n line.points = points;\n if (mode !== \"resize\") {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) options.borderWidth = 0;\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options: options\n };\n this.updateElement(line, undefined, properties, mode);\n }\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === \"reset\";\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n const properties = {\n x: x,\n y: y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options: options\n };\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$48dbc6ac651bf8be, \"id\", \"radar\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$48dbc6ac651bf8be, \"defaults\", {\n datasetElementType: \"line\",\n dataElementType: \"point\",\n indexAxis: \"r\",\n showLine: true,\n elements: {\n line: {\n fill: \"start\"\n }\n }\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$48dbc6ac651bf8be, \"overrides\", {\n aspectRatio: 1,\n scales: {\n r: {\n type: \"radialLinear\"\n }\n }\n});\nclass $77dc20320068f1ee$export$b2f2bae6713db87 extends $77dc20320068f1ee$export$75572ec5c55b4048 {\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale: xScale, yScale: yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n return {\n label: labels[index] || \"\",\n value: \"(\" + x + \", \" + y + \")\"\n };\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { data: points = [] } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start: start, count: count } = (0, $02b6f511cc6c123c$export$9e5f44173e64f162)(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if ((0, $02b6f511cc6c123c$export$efccba1c4a2ef57b)(meta)) {\n start = 0;\n count = points.length;\n }\n if (this.options.showLine) {\n if (!this.datasetElementType) this.addElements();\n const { dataset: line, _dataset: _dataset } = meta;\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options: options\n }, mode);\n } else if (this.datasetElementType) {\n delete meta.dataset;\n this.datasetElementType = false;\n }\n this.updateElements(points, start, count, mode);\n }\n addElements() {\n const { showLine: showLine } = this.options;\n if (!this.datasetElementType && showLine) this.datasetElementType = this.chart.registry.getElement(\"line\");\n super.addElements();\n }\n updateElements(points, start, count, mode) {\n const reset = mode === \"reset\";\n const { iScale: iScale, vScale: vScale, _stacked: _stacked, _dataset: _dataset } = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps: spanGaps, segment: segment } = this.options;\n const maxGapLength = (0, $02b6f511cc6c123c$export$d141bba7fdc215a3)(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === \"none\";\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = start; i < start + count; ++i){\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = (0, $02b6f511cc6c123c$export$342063e11d6c3cad)(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n if (!directUpdate) this.updateElement(point, i, properties, mode);\n prevParsed = parsed;\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n if (!this.options.showLine) {\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i)max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n return max > 0 && max;\n }\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n if (!data.length) return border;\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$b2f2bae6713db87, \"id\", \"scatter\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$b2f2bae6713db87, \"defaults\", {\n datasetElementType: false,\n dataElementType: \"point\",\n showLine: false,\n fill: false\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$b2f2bae6713db87, \"overrides\", {\n interaction: {\n mode: \"point\"\n },\n scales: {\n x: {\n type: \"linear\"\n },\n y: {\n type: \"linear\"\n }\n }\n});\nvar $77dc20320068f1ee$export$a6506504f799c5d5 = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n BarController: $77dc20320068f1ee$export$e97d5dc64e999004,\n BubbleController: $77dc20320068f1ee$export$19b5c4773f17abe,\n DoughnutController: $77dc20320068f1ee$export$e04603e7d8b77172,\n LineController: $77dc20320068f1ee$export$3c9b5d28c11cbfd0,\n PieController: $77dc20320068f1ee$export$b21a3f1286706191,\n PolarAreaController: $77dc20320068f1ee$export$2a270b3a0d973c85,\n RadarController: $77dc20320068f1ee$export$48dbc6ac651bf8be,\n ScatterController: $77dc20320068f1ee$export$b2f2bae6713db87\n});\n/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */ function $77dc20320068f1ee$var$abstract() {\n throw new Error(\"This method is not implemented: Check that a complete date adapter is provided.\");\n}\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */ class $77dc20320068f1ee$var$DateAdapterBase {\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */ static override(members) {\n Object.assign($77dc20320068f1ee$var$DateAdapterBase.prototype, members);\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n formats() {\n return $77dc20320068f1ee$var$abstract();\n }\n parse() {\n return $77dc20320068f1ee$var$abstract();\n }\n format() {\n return $77dc20320068f1ee$var$abstract();\n }\n add() {\n return $77dc20320068f1ee$var$abstract();\n }\n diff() {\n return $77dc20320068f1ee$var$abstract();\n }\n startOf() {\n return $77dc20320068f1ee$var$abstract();\n }\n endOf() {\n return $77dc20320068f1ee$var$abstract();\n }\n constructor(options){\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"options\", void 0);\n this.options = options || {};\n }\n}\nvar $77dc20320068f1ee$export$f32766ea09ec8bc4 = {\n _date: $77dc20320068f1ee$var$DateAdapterBase\n};\nfunction $77dc20320068f1ee$var$binarySearch(metaset, axis, value, intersect) {\n const { controller: controller, data: data, _sorted: _sorted } = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== \"r\" && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? (0, $02b6f511cc6c123c$export$ebd11618f299a286) : (0, $02b6f511cc6c123c$export$ef35774e6d314e91);\n if (!intersect) return lookupMethod(data, axis, value);\n else if (controller._sharedOptions) {\n const el = data[0];\n const range = typeof el.getRange === \"function\" && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {\n lo: start.lo,\n hi: end.hi\n };\n }\n }\n }\n return {\n lo: 0,\n hi: data.length - 1\n };\n}\nfunction $77dc20320068f1ee$var$evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for(let i = 0, ilen = metasets.length; i < ilen; ++i){\n const { index: index, data: data } = metasets[i];\n const { lo: lo, hi: hi } = $77dc20320068f1ee$var$binarySearch(metasets[i], axis, value, intersect);\n for(let j = lo; j <= hi; ++j){\n const element = data[j];\n if (!element.skip) handler(element, index, j);\n }\n }\n}\nfunction $77dc20320068f1ee$var$getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf(\"x\") !== -1;\n const useY = axis.indexOf(\"y\") !== -1;\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\nfunction $77dc20320068f1ee$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n if (!includeInvisible && !chart.isPointInArea(position)) return items;\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !(0, $02b6f511cc6c123c$export$e7094788287c5e9b)(element, chart.chartArea, 0)) return;\n if (element.inRange(position.x, position.y, useFinalPosition)) items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n };\n $77dc20320068f1ee$var$evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\nfunction $77dc20320068f1ee$var$getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n function evaluationFunc(element, datasetIndex, index) {\n const { startAngle: startAngle, endAngle: endAngle } = element.getProps([\n \"startAngle\",\n \"endAngle\"\n ], useFinalPosition);\n const { angle: angle } = (0, $02b6f511cc6c123c$export$96f57966bedc81b4)(element, {\n x: position.x,\n y: position.y\n });\n if ((0, $02b6f511cc6c123c$export$ffb5f4729a158638)(angle, startAngle, endAngle)) items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n }\n $77dc20320068f1ee$var$evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\nfunction $77dc20320068f1ee$var$getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = $77dc20320068f1ee$var$getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) return;\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) return;\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [\n {\n element: element,\n datasetIndex: datasetIndex,\n index: index\n }\n ];\n minDistance = distance;\n } else if (distance === minDistance) items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n }\n $77dc20320068f1ee$var$evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\nfunction $77dc20320068f1ee$var$getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) return [];\n return axis === \"r\" && !intersect ? $77dc20320068f1ee$var$getNearestRadialItems(chart, position, axis, useFinalPosition) : $77dc20320068f1ee$var$getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\nfunction $77dc20320068f1ee$var$getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === \"x\" ? \"inXRange\" : \"inYRange\";\n let intersectsItem = false;\n $77dc20320068f1ee$var$evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index)=>{\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({\n element: element,\n datasetIndex: datasetIndex,\n index: index\n });\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n if (intersect && !intersectsItem) return [];\n return items;\n}\nvar $77dc20320068f1ee$export$a13296960cae0384 = {\n evaluateInteractionItems: $77dc20320068f1ee$var$evaluateInteractionItems,\n modes: {\n index (chart, e, options, useFinalPosition) {\n const position = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"x\";\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect ? $77dc20320068f1ee$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : $77dc20320068f1ee$var$getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n if (!items.length) return [];\n chart.getSortedVisibleDatasetMetas().forEach((meta)=>{\n const index = items[0].index;\n const element = meta.data[index];\n if (element && !element.skip) elements.push({\n element: element,\n datasetIndex: meta.index,\n index: index\n });\n });\n return elements;\n },\n dataset (chart, e, options, useFinalPosition) {\n const position = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"xy\";\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect ? $77dc20320068f1ee$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : $77dc20320068f1ee$var$getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for(let i = 0; i < data.length; ++i)items.push({\n element: data[i],\n datasetIndex: datasetIndex,\n index: i\n });\n }\n return items;\n },\n point (chart, e, options, useFinalPosition) {\n const position = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"xy\";\n const includeInvisible = options.includeInvisible || false;\n return $77dc20320068f1ee$var$getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n nearest (chart, e, options, useFinalPosition) {\n const position = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(e, chart);\n const axis = options.axis || \"xy\";\n const includeInvisible = options.includeInvisible || false;\n return $77dc20320068f1ee$var$getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n x (chart, e, options, useFinalPosition) {\n const position = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(e, chart);\n return $77dc20320068f1ee$var$getAxisItems(chart, position, \"x\", options.intersect, useFinalPosition);\n },\n y (chart, e, options, useFinalPosition) {\n const position = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(e, chart);\n return $77dc20320068f1ee$var$getAxisItems(chart, position, \"y\", options.intersect, useFinalPosition);\n }\n }\n};\nconst $77dc20320068f1ee$var$STATIC_POSITIONS = [\n \"left\",\n \"top\",\n \"right\",\n \"bottom\"\n];\nfunction $77dc20320068f1ee$var$filterByPosition(array, position) {\n return array.filter((v)=>v.pos === position);\n}\nfunction $77dc20320068f1ee$var$filterDynamicPositionByAxis(array, axis) {\n return array.filter((v)=>$77dc20320068f1ee$var$STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction $77dc20320068f1ee$var$sortByWeight(array, reverse) {\n return array.sort((a, b)=>{\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;\n });\n}\nfunction $77dc20320068f1ee$var$wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n for(i = 0, ilen = (boxes || []).length; i < ilen; ++i){\n box = boxes[i];\n ({ position: pos, options: { stack: stack, stackWeight: stackWeight = 1 } } = box);\n layoutBoxes.push({\n index: i,\n box: box,\n pos: pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && pos + stack,\n stackWeight: stackWeight\n });\n }\n return layoutBoxes;\n}\nfunction $77dc20320068f1ee$var$buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts){\n const { stack: stack, pos: pos, stackWeight: stackWeight } = wrap;\n if (!stack || !$77dc20320068f1ee$var$STATIC_POSITIONS.includes(pos)) continue;\n const _stack = stacks[stack] || (stacks[stack] = {\n count: 0,\n placed: 0,\n weight: 0,\n size: 0\n });\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\nfunction $77dc20320068f1ee$var$setLayoutDims(layouts, params) {\n const stacks = $77dc20320068f1ee$var$buildStacks(layouts);\n const { vBoxMaxWidth: vBoxMaxWidth, hBoxMaxHeight: hBoxMaxHeight } = params;\n let i, ilen, layout;\n for(i = 0, ilen = layouts.length; i < ilen; ++i){\n layout = layouts[i];\n const { fullSize: fullSize } = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\nfunction $77dc20320068f1ee$var$buildLayoutBoxes(boxes) {\n const layoutBoxes = $77dc20320068f1ee$var$wrapBoxes(boxes);\n const fullSize = $77dc20320068f1ee$var$sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize), true);\n const left = $77dc20320068f1ee$var$sortByWeight($77dc20320068f1ee$var$filterByPosition(layoutBoxes, \"left\"), true);\n const right = $77dc20320068f1ee$var$sortByWeight($77dc20320068f1ee$var$filterByPosition(layoutBoxes, \"right\"));\n const top = $77dc20320068f1ee$var$sortByWeight($77dc20320068f1ee$var$filterByPosition(layoutBoxes, \"top\"), true);\n const bottom = $77dc20320068f1ee$var$sortByWeight($77dc20320068f1ee$var$filterByPosition(layoutBoxes, \"bottom\"));\n const centerHorizontal = $77dc20320068f1ee$var$filterDynamicPositionByAxis(layoutBoxes, \"x\");\n const centerVertical = $77dc20320068f1ee$var$filterDynamicPositionByAxis(layoutBoxes, \"y\");\n return {\n fullSize: fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: $77dc20320068f1ee$var$filterByPosition(layoutBoxes, \"chartArea\"),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\nfunction $77dc20320068f1ee$var$getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction $77dc20320068f1ee$var$updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction $77dc20320068f1ee$var$updateDims(chartArea, params, layout, stacks) {\n const { pos: pos, box: box } = layout;\n const maxPadding = chartArea.maxPadding;\n if (!(0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(pos)) {\n if (layout.size) chartArea[pos] -= layout.size;\n const stack = stacks[layout.stack] || {\n size: 0,\n count: 1\n };\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n if (box.getPadding) $77dc20320068f1ee$var$updateMaxPadding(maxPadding, box.getPadding());\n const newWidth = Math.max(0, params.outerWidth - $77dc20320068f1ee$var$getCombinedMax(maxPadding, chartArea, \"left\", \"right\"));\n const newHeight = Math.max(0, params.outerHeight - $77dc20320068f1ee$var$getCombinedMax(maxPadding, chartArea, \"top\", \"bottom\"));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n return layout.horizontal ? {\n same: widthChanged,\n other: heightChanged\n } : {\n same: heightChanged,\n other: widthChanged\n };\n}\nfunction $77dc20320068f1ee$var$handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos(\"top\");\n chartArea.x += updatePos(\"left\");\n updatePos(\"right\");\n updatePos(\"bottom\");\n}\nfunction $77dc20320068f1ee$var$getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n function marginForPositions(positions) {\n const margin = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n positions.forEach((pos)=>{\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n return horizontal ? marginForPositions([\n \"left\",\n \"right\"\n ]) : marginForPositions([\n \"top\",\n \"bottom\"\n ]);\n}\nfunction $77dc20320068f1ee$var$fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n for(i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i){\n layout = boxes[i];\n box = layout.box;\n box.update(layout.width || chartArea.w, layout.height || chartArea.h, $77dc20320068f1ee$var$getMargins(layout.horizontal, chartArea));\n const { same: same, other: other } = $77dc20320068f1ee$var$updateDims(chartArea, params, layout, stacks);\n refit |= same && refitBoxes.length;\n changed = changed || other;\n if (!box.fullSize) refitBoxes.push(layout);\n }\n return refit && $77dc20320068f1ee$var$fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction $77dc20320068f1ee$var$setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\nfunction $77dc20320068f1ee$var$placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let { x: x, y: y } = chartArea;\n for (const layout of boxes){\n const box = layout.box;\n const stack = stacks[layout.stack] || {\n count: 1,\n placed: 0,\n weight: 1\n };\n const weight = layout.stackWeight / stack.weight || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if ((0, $02b6f511cc6c123c$export$dda1d9f60106f0e9)(stack.start)) y = stack.start;\n if (box.fullSize) $77dc20320068f1ee$var$setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n else $77dc20320068f1ee$var$setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if ((0, $02b6f511cc6c123c$export$dda1d9f60106f0e9)(stack.start)) x = stack.start;\n if (box.fullSize) $77dc20320068f1ee$var$setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n else $77dc20320068f1ee$var$setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n chartArea.x = x;\n chartArea.y = y;\n}\nvar $77dc20320068f1ee$export$1ecca0613f5e56d2 = {\n addBox (chart, item) {\n if (!chart.boxes) chart.boxes = [];\n item.fullSize = item.fullSize || false;\n item.position = item.position || \"top\";\n item.weight = item.weight || 0;\n item._layers = item._layers || function() {\n return [\n {\n z: 0,\n draw (chartArea) {\n item.draw(chartArea);\n }\n }\n ];\n };\n chart.boxes.push(item);\n },\n removeBox (chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) chart.boxes.splice(index, 1);\n },\n configure (chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n update (chart, width, height, minPadding) {\n if (!chart) return;\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = $77dc20320068f1ee$var$buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(chart.boxes, (box)=>{\n if (typeof box.beforeLayout === \"function\") box.beforeLayout();\n });\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap)=>wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding: padding,\n availableWidth: availableWidth,\n availableHeight: availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n $77dc20320068f1ee$var$updateMaxPadding(maxPadding, (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(minPadding));\n const chartArea = Object.assign({\n maxPadding: maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n const stacks = $77dc20320068f1ee$var$setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n $77dc20320068f1ee$var$fitBoxes(boxes.fullSize, chartArea, params, stacks);\n $77dc20320068f1ee$var$fitBoxes(verticalBoxes, chartArea, params, stacks);\n if ($77dc20320068f1ee$var$fitBoxes(horizontalBoxes, chartArea, params, stacks)) $77dc20320068f1ee$var$fitBoxes(verticalBoxes, chartArea, params, stacks);\n $77dc20320068f1ee$var$handleMaxPadding(chartArea);\n $77dc20320068f1ee$var$placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n $77dc20320068f1ee$var$placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w\n };\n (0, $02b6f511cc6c123c$export$d66501df72047452)(boxes.chartArea, (layout)=>{\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n });\n });\n }\n};\nclass $77dc20320068f1ee$export$7b1aeb87f31f7da8 {\n acquireContext(canvas, aspectRatio) {}\n releaseContext(context) {\n return false;\n }\n addEventListener(chart, type, listener) {}\n removeEventListener(chart, type, listener) {}\n getDevicePixelRatio() {\n return 1;\n }\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width: width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n isAttached(canvas) {\n return true;\n }\n updateConfig(config) {}\n}\nclass $77dc20320068f1ee$export$a40a96b24b46cf35 extends $77dc20320068f1ee$export$7b1aeb87f31f7da8 {\n acquireContext(item) {\n return item && item.getContext && item.getContext(\"2d\") || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\nconst $77dc20320068f1ee$var$EXPANDO_KEY = \"$chartjs\";\nconst $77dc20320068f1ee$var$EVENT_TYPES = {\n touchstart: \"mousedown\",\n touchmove: \"mousemove\",\n touchend: \"mouseup\",\n pointerenter: \"mouseenter\",\n pointerdown: \"mousedown\",\n pointermove: \"mousemove\",\n pointerup: \"mouseup\",\n pointerleave: \"mouseout\",\n pointerout: \"mouseout\"\n};\nconst $77dc20320068f1ee$var$isNullOrEmpty = (value)=>value === null || value === \"\";\nfunction $77dc20320068f1ee$var$initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n const renderHeight = canvas.getAttribute(\"height\");\n const renderWidth = canvas.getAttribute(\"width\");\n canvas[$77dc20320068f1ee$var$EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n style.display = style.display || \"block\";\n style.boxSizing = style.boxSizing || \"border-box\";\n if ($77dc20320068f1ee$var$isNullOrEmpty(renderWidth)) {\n const displayWidth = (0, $02b6f511cc6c123c$export$b4171a6734a65d42)(canvas, \"width\");\n if (displayWidth !== undefined) canvas.width = displayWidth;\n }\n if ($77dc20320068f1ee$var$isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === \"\") canvas.height = canvas.width / (aspectRatio || 2);\n else {\n const displayHeight = (0, $02b6f511cc6c123c$export$b4171a6734a65d42)(canvas, \"height\");\n if (displayHeight !== undefined) canvas.height = displayHeight;\n }\n }\n return canvas;\n}\nconst $77dc20320068f1ee$var$eventListenerOptions = (0, $02b6f511cc6c123c$export$3466f893ebf79586) ? {\n passive: true\n} : false;\nfunction $77dc20320068f1ee$var$addListener(node, type, listener) {\n node.addEventListener(type, listener, $77dc20320068f1ee$var$eventListenerOptions);\n}\nfunction $77dc20320068f1ee$var$removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, $77dc20320068f1ee$var$eventListenerOptions);\n}\nfunction $77dc20320068f1ee$var$fromNativeEvent(event, chart) {\n const type = $77dc20320068f1ee$var$EVENT_TYPES[event.type] || event.type;\n const { x: x, y: y } = (0, $02b6f511cc6c123c$export$df995fae86a55f06)(event, chart);\n return {\n type: type,\n chart: chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null\n };\n}\nfunction $77dc20320068f1ee$var$nodeListContains(nodeList, canvas) {\n for (const node of nodeList){\n if (node === canvas || node.contains(canvas)) return true;\n }\n}\nfunction $77dc20320068f1ee$var$createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || $77dc20320068f1ee$var$nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !$77dc20320068f1ee$var$nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) listener();\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nfunction $77dc20320068f1ee$var$createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || $77dc20320068f1ee$var$nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !$77dc20320068f1ee$var$nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) listener();\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nconst $77dc20320068f1ee$var$drpListeningCharts = new Map();\nlet $77dc20320068f1ee$var$oldDevicePixelRatio = 0;\nfunction $77dc20320068f1ee$var$onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === $77dc20320068f1ee$var$oldDevicePixelRatio) return;\n $77dc20320068f1ee$var$oldDevicePixelRatio = dpr;\n $77dc20320068f1ee$var$drpListeningCharts.forEach((resize, chart)=>{\n if (chart.currentDevicePixelRatio !== dpr) resize();\n });\n}\nfunction $77dc20320068f1ee$var$listenDevicePixelRatioChanges(chart, resize) {\n if (!$77dc20320068f1ee$var$drpListeningCharts.size) window.addEventListener(\"resize\", $77dc20320068f1ee$var$onWindowResize);\n $77dc20320068f1ee$var$drpListeningCharts.set(chart, resize);\n}\nfunction $77dc20320068f1ee$var$unlistenDevicePixelRatioChanges(chart) {\n $77dc20320068f1ee$var$drpListeningCharts.delete(chart);\n if (!$77dc20320068f1ee$var$drpListeningCharts.size) window.removeEventListener(\"resize\", $77dc20320068f1ee$var$onWindowResize);\n}\nfunction $77dc20320068f1ee$var$createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && (0, $02b6f511cc6c123c$export$9bb611d729802a56)(canvas);\n if (!container) return;\n const resize = (0, $02b6f511cc6c123c$export$61196ced6d74a310)((width, height)=>{\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) listener();\n }, window);\n const observer = new ResizeObserver((entries)=>{\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n if (width === 0 && height === 0) return;\n resize(width, height);\n });\n observer.observe(container);\n $77dc20320068f1ee$var$listenDevicePixelRatioChanges(chart, resize);\n return observer;\n}\nfunction $77dc20320068f1ee$var$releaseObserver(chart, type, observer) {\n if (observer) observer.disconnect();\n if (type === \"resize\") $77dc20320068f1ee$var$unlistenDevicePixelRatioChanges(chart);\n}\nfunction $77dc20320068f1ee$var$createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = (0, $02b6f511cc6c123c$export$61196ced6d74a310)((event)=>{\n if (chart.ctx !== null) listener($77dc20320068f1ee$var$fromNativeEvent(event, chart));\n }, chart);\n $77dc20320068f1ee$var$addListener(canvas, type, proxy);\n return proxy;\n}\nclass $77dc20320068f1ee$export$f02da7f882cf6b2e extends $77dc20320068f1ee$export$7b1aeb87f31f7da8 {\n acquireContext(canvas, aspectRatio) {\n const context = canvas && canvas.getContext && canvas.getContext(\"2d\");\n if (context && context.canvas === canvas) {\n $77dc20320068f1ee$var$initCanvas(canvas, aspectRatio);\n return context;\n }\n return null;\n }\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[$77dc20320068f1ee$var$EXPANDO_KEY]) return false;\n const initial = canvas[$77dc20320068f1ee$var$EXPANDO_KEY].initial;\n [\n \"height\",\n \"width\"\n ].forEach((prop)=>{\n const value = initial[prop];\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(value)) canvas.removeAttribute(prop);\n else canvas.setAttribute(prop, value);\n });\n const style = initial.style || {};\n Object.keys(style).forEach((key)=>{\n canvas.style[key] = style[key];\n });\n canvas.width = canvas.width;\n delete canvas[$77dc20320068f1ee$var$EXPANDO_KEY];\n return true;\n }\n addEventListener(chart, type, listener) {\n this.removeEventListener(chart, type);\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: $77dc20320068f1ee$var$createAttachObserver,\n detach: $77dc20320068f1ee$var$createDetachObserver,\n resize: $77dc20320068f1ee$var$createResizeObserver\n };\n const handler = handlers[type] || $77dc20320068f1ee$var$createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n if (!proxy) return;\n const handlers = {\n attach: $77dc20320068f1ee$var$releaseObserver,\n detach: $77dc20320068f1ee$var$releaseObserver,\n resize: $77dc20320068f1ee$var$releaseObserver\n };\n const handler = handlers[type] || $77dc20320068f1ee$var$removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n getMaximumSize(canvas, width, height, aspectRatio) {\n return (0, $02b6f511cc6c123c$export$2329c99376c9d0a4)(canvas, width, height, aspectRatio);\n }\n isAttached(canvas) {\n const container = (0, $02b6f511cc6c123c$export$9bb611d729802a56)(canvas);\n return !!(container && container.isConnected);\n }\n}\nfunction $77dc20320068f1ee$export$72cd9e67b1b784f9(canvas) {\n if (!(0, $02b6f511cc6c123c$export$3a1a48c8f6ef640e)() || typeof OffscreenCanvas !== \"undefined\" && canvas instanceof OffscreenCanvas) return $77dc20320068f1ee$export$a40a96b24b46cf35;\n return $77dc20320068f1ee$export$f02da7f882cf6b2e;\n}\nclass $77dc20320068f1ee$export$db77ccec0bb4ccac {\n tooltipPosition(useFinalPosition) {\n const { x: x, y: y } = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n return {\n x: x,\n y: y\n };\n }\n hasValue() {\n return (0, $02b6f511cc6c123c$export$d141bba7fdc215a3)(this.x) && (0, $02b6f511cc6c123c$export$d141bba7fdc215a3)(this.y);\n }\n getProps(props, final) {\n const anims = this.$animations;\n if (!final || !anims) // let's not create an object, if not needed\n return this;\n const ret = {};\n props.forEach((prop)=>{\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n });\n return ret;\n }\n constructor(){\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"x\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"y\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"active\", false);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"options\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"$animations\", void 0);\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$db77ccec0bb4ccac, \"defaults\", {});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$db77ccec0bb4ccac, \"defaultRoutes\", undefined);\nfunction $77dc20320068f1ee$var$autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = $77dc20320068f1ee$var$determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? $77dc20320068f1ee$var$getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n if (numMajorIndices > ticksLimit) {\n $77dc20320068f1ee$var$skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n const spacing = $77dc20320068f1ee$var$calculateSpacing(majorIndices, ticks, ticksLimit);\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n $77dc20320068f1ee$var$skip(ticks, newTicks, spacing, (0, $02b6f511cc6c123c$export$342063e11d6c3cad)(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for(i = 0, ilen = numMajorIndices - 1; i < ilen; i++)$77dc20320068f1ee$var$skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n $77dc20320068f1ee$var$skip(ticks, newTicks, spacing, last, (0, $02b6f511cc6c123c$export$342063e11d6c3cad)(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n $77dc20320068f1ee$var$skip(ticks, newTicks, spacing);\n return newTicks;\n}\nfunction $77dc20320068f1ee$var$determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\nfunction $77dc20320068f1ee$var$calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = $77dc20320068f1ee$var$getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n if (!evenMajorSpacing) return Math.max(spacing, 1);\n const factors = (0, $02b6f511cc6c123c$export$a07804094c3ecf2d)(evenMajorSpacing);\n for(let i = 0, ilen = factors.length - 1; i < ilen; i++){\n const factor = factors[i];\n if (factor > spacing) return factor;\n }\n return Math.max(spacing, 1);\n}\nfunction $77dc20320068f1ee$var$getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++)if (ticks[i].major) result.push(i);\n return result;\n}\nfunction $77dc20320068f1ee$var$skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n spacing = Math.ceil(spacing);\n for(i = 0; i < ticks.length; i++)if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n}\nfunction $77dc20320068f1ee$var$skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(majorStart, 0);\n const end = Math.min((0, $02b6f511cc6c123c$export$90a7f3efeed30595)(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n next = start;\n while(next < 0){\n count++;\n next = Math.round(start + count * spacing);\n }\n for(i = Math.max(start, 0); i < end; i++)if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n}\nfunction $77dc20320068f1ee$var$getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n if (len < 2) return false;\n for(diff = arr[0], i = 1; i < len; ++i){\n if (arr[i] - arr[i - 1] !== diff) return false;\n }\n return diff;\n}\nconst $77dc20320068f1ee$var$reverseAlign = (align)=>align === \"left\" ? \"right\" : align === \"right\" ? \"left\" : align;\nconst $77dc20320068f1ee$var$offsetFromEdge = (scale, edge, offset)=>edge === \"top\" || edge === \"left\" ? scale[edge] + offset : scale[edge] - offset;\nconst $77dc20320068f1ee$var$getTicksLimit = (ticksLength, maxTicksLimit)=>Math.min(maxTicksLimit || ticksLength, ticksLength);\nfunction $77dc20320068f1ee$var$sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n for(; i < len; i += increment)result.push(arr[Math.floor(i)]);\n return result;\n}\nfunction $77dc20320068f1ee$var$getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6;\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n if (offsetGridLines) {\n if (length === 1) offset = Math.max(lineValue - start, end - lineValue);\n else if (index === 0) offset = (scale.getPixelForTick(1) - lineValue) / 2;\n else offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n lineValue += validIndex < index ? offset : -offset;\n if (lineValue < start - epsilon || lineValue > end + epsilon) return;\n }\n return lineValue;\n}\nfunction $77dc20320068f1ee$var$garbageCollect(caches, length) {\n (0, $02b6f511cc6c123c$export$d66501df72047452)(caches, (cache)=>{\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for(i = 0; i < gcLen; ++i)delete cache.data[gc[i]];\n gc.splice(0, gcLen);\n }\n });\n}\nfunction $77dc20320068f1ee$var$getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\nfunction $77dc20320068f1ee$var$getTitleHeight(options, fallback) {\n if (!options.display) return 0;\n const font = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.font, fallback);\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(options.padding);\n const lines = (0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(options.text) ? options.text.length : 1;\n return lines * font.lineHeight + padding.height;\n}\nfunction $77dc20320068f1ee$var$createScaleContext(parent, scale) {\n return (0, $02b6f511cc6c123c$export$35e795649ee09318)(parent, {\n scale: scale,\n type: \"scale\"\n });\n}\nfunction $77dc20320068f1ee$var$createTickContext(parent, index, tick) {\n return (0, $02b6f511cc6c123c$export$35e795649ee09318)(parent, {\n tick: tick,\n index: index,\n type: \"tick\"\n });\n}\nfunction $77dc20320068f1ee$var$titleAlign(align, position, reverse) {\n let ret = (0, $02b6f511cc6c123c$export$3c2fa207a37baaea)(align);\n if (reverse && position !== \"right\" || !reverse && position === \"right\") ret = $77dc20320068f1ee$var$reverseAlign(ret);\n return ret;\n}\nfunction $77dc20320068f1ee$var$titleArgs(scale, offset, position, align) {\n const { top: top, left: left, bottom: bottom, right: right, chart: chart } = scale;\n const { chartArea: chartArea, scales: scales } = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n if (scale.isHorizontal()) {\n titleX = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, left, right);\n if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === \"center\") titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n else titleY = $77dc20320068f1ee$var$offsetFromEdge(scale, position, offset);\n maxWidth = right - left;\n } else {\n if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === \"center\") titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n else titleX = $77dc20320068f1ee$var$offsetFromEdge(scale, position, offset);\n titleY = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, bottom, top);\n rotation = position === \"left\" ? -(0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd) : (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd);\n }\n return {\n titleX: titleX,\n titleY: titleY,\n maxWidth: maxWidth,\n rotation: rotation\n };\n}\nclass $77dc20320068f1ee$export$d60cfc58d3c358b6 extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n init(options) {\n this.options = options.setContext(this.getContext());\n this.axis = options.axis;\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n parse(raw, index) {\n return raw;\n }\n getUserBounds() {\n let { _userMin: _userMin, _userMax: _userMax, _suggestedMin: _suggestedMin, _suggestedMax: _suggestedMax } = this;\n _userMin = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(_userMin, Number.POSITIVE_INFINITY);\n _userMax = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(_userMin, _suggestedMin),\n max: (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(_userMax, _suggestedMax),\n minDefined: (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(_userMin),\n maxDefined: (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(_userMax)\n };\n }\n getMinMax(canStack) {\n let { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let range;\n if (minDefined && maxDefined) return {\n min: min,\n max: max\n };\n const metas = this.getMatchingVisibleMetas();\n for(let i = 0, ilen = metas.length; i < ilen; ++i){\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) min = Math.min(min, range.min);\n if (!maxDefined) max = Math.max(max, range.max);\n }\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n return {\n min: (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(min, (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(max, min)),\n max: (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(max, (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(min, max))\n };\n }\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n getTicks() {\n return this.ticks;\n }\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n beforeUpdate() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.beforeUpdate, [\n this\n ]);\n }\n update(maxWidth, maxHeight, margins) {\n const { beginAtZero: beginAtZero, grace: grace, ticks: tickOpts } = this.options;\n const sampleSize = tickOpts.sampleSize;\n this.beforeUpdate();\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = (0, $02b6f511cc6c123c$export$db202ddc8be9136)(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n this.beforeBuildTicks();\n this.ticks = this.buildTicks() || [];\n this.afterBuildTicks();\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? $77dc20320068f1ee$var$sample(this.ticks, sampleSize) : this.ticks);\n this.configure();\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation();\n this.afterCalculateLabelRotation();\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === \"auto\")) {\n this.ticks = $77dc20320068f1ee$var$autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n if (samplingEnabled) this._convertTicksToLabels(this.ticks);\n this.beforeFit();\n this.fit();\n this.afterFit();\n this.afterUpdate();\n }\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n afterUpdate() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.afterUpdate, [\n this\n ]);\n }\n beforeSetDimensions() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.beforeSetDimensions, [\n this\n ]);\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = 0;\n this.bottom = this.height;\n }\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.afterSetDimensions, [\n this\n ]);\n }\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options[name], [\n this\n ]);\n }\n beforeDataLimits() {\n this._callHooks(\"beforeDataLimits\");\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks(\"afterDataLimits\");\n }\n beforeBuildTicks() {\n this._callHooks(\"beforeBuildTicks\");\n }\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks(\"afterBuildTicks\");\n }\n beforeTickToLabelConversion() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.beforeTickToLabelConversion, [\n this\n ]);\n }\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n tick = ticks[i];\n tick.label = (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(tickOpts.callback, [\n tick.value,\n i,\n ticks\n ], this);\n }\n }\n afterTickToLabelConversion() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.afterTickToLabelConversion, [\n this\n ]);\n }\n beforeCalculateLabelRotation() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.beforeCalculateLabelRotation, [\n this\n ]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = $77dc20320068f1ee$var$getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n const maxWidth = (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - $77dc20320068f1ee$var$getTickMarkLength(options.grid) - tickOpts.padding - $77dc20320068f1ee$var$getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = (0, $02b6f511cc6c123c$export$3a6d5c9ae78a2c08)(Math.min(Math.asin((0, $02b6f511cc6c123c$export$25ce5a424b770e84)((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin((0, $02b6f511cc6c123c$export$25ce5a424b770e84)(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin((0, $02b6f511cc6c123c$export$25ce5a424b770e84)(maxLabelHeight / maxLabelDiagonal, -1, 1))));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.afterCalculateLabelRotation, [\n this\n ]);\n }\n afterAutoSkip() {}\n beforeFit() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.beforeFit, [\n this\n ]);\n }\n fit() {\n const minSize = {\n width: 0,\n height: 0\n };\n const { chart: chart, options: { ticks: tickOpts, title: titleOpts, grid: gridOpts } } = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n if (display) {\n const titleHeight = $77dc20320068f1ee$var$getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = $77dc20320068f1ee$var$getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight;\n minSize.width = $77dc20320068f1ee$var$getTickMarkLength(gridOpts) + titleHeight;\n }\n if (tickOpts.display && this.ticks.length) {\n const { first: first, last: last, widest: widest, highest: highest } = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n if (isHorizontal) {\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n this._handleMargins();\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n _calculatePadding(first, last, sin, cos) {\n const { ticks: { align: align, padding: padding }, position: position } = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== \"top\" && this.axis === \"x\";\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === \"start\") paddingRight = last.width;\n else if (align === \"end\") paddingLeft = first.width;\n else if (align !== \"inner\") {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n if (align === \"start\") {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === \"end\") {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n afterFit() {\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.afterFit, [\n this\n ]);\n }\n isHorizontal() {\n const { axis: axis, position: position } = this.options;\n return position === \"top\" || position === \"bottom\" || axis === \"x\";\n }\n isFullSize() {\n return this.options.fullSize;\n }\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n this.generateTickLabels(ticks);\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++)if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n this.afterTickToLabelConversion();\n }\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) ticks = $77dc20320068f1ee$var$sample(ticks, sampleSize);\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n return labelSizes;\n }\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const { ctx: ctx, _longestTextCache: caches } = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / $77dc20320068f1ee$var$getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n for(i = 0; i < length; i += increment){\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {\n data: {},\n gc: []\n };\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(label) && !(0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(label)) {\n width = (0, $02b6f511cc6c123c$export$e7c866399fa523f5)(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(label)) for(j = 0, jlen = label.length; j < jlen; ++j){\n nestedLabel = label[j];\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(nestedLabel) && !(0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(nestedLabel)) {\n width = (0, $02b6f511cc6c123c$export$e7c866399fa523f5)(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n $77dc20320068f1ee$var$garbageCollect(caches, length);\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n const valueAt = (idx)=>({\n width: widths[idx] || 0,\n height: heights[idx] || 0\n });\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths: widths,\n heights: heights\n };\n }\n getLabelForValue(value) {\n return value;\n }\n getPixelForValue(value, index) {\n return NaN;\n }\n getValueForPixel(pixel) {}\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) return null;\n return this.getPixelForValue(ticks[index].value);\n }\n getPixelForDecimal(decimal) {\n if (this._reversePixels) decimal = 1 - decimal;\n const pixel = this._startPixel + decimal * this._length;\n return (0, $02b6f511cc6c123c$export$71cec2538cb2c617)(this._alignToPixels ? (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(this.chart, pixel, 0) : pixel);\n }\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n getBaseValue() {\n const { min: min, max: max } = this;\n return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0;\n }\n getContext(index) {\n const ticks = this.ticks || [];\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context || (tick.$context = $77dc20320068f1ee$var$createTickContext(this.getContext(), index, tick));\n }\n return this.$context || (this.$context = $77dc20320068f1ee$var$createScaleContext(this.chart.getContext(), this));\n }\n _tickSize() {\n const optionTicks = this.options.ticks;\n const rot = (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin;\n }\n _isVisible() {\n const display = this.options.display;\n if (display !== \"auto\") return !!display;\n return this.getMatchingVisibleMetas().length > 0;\n }\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const { grid: grid, position: position, border: border } = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = $77dc20320068f1ee$var$getTickMarkLength(grid);\n const items = [];\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n if (position === \"top\") {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === \"bottom\") {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === \"left\") {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === \"right\") {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === \"x\") {\n if (position === \"center\") borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === \"y\") {\n if (position === \"center\") borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n const limit = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for(i = 0; i < ticksLength; i += step){\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n lineValue = $77dc20320068f1ee$var$getPixelForGridLine(this, i, offset);\n if (lineValue === undefined) continue;\n alignedLineValue = (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(chart, lineValue, lineWidth);\n if (isHorizontal) tx1 = tx2 = x1 = x2 = alignedLineValue;\n else ty1 = ty2 = y1 = y2 = alignedLineValue;\n items.push({\n tx1: tx1,\n ty1: ty1,\n tx2: tx2,\n ty2: ty2,\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n width: lineWidth,\n color: lineColor,\n borderDash: borderDash,\n borderDashOffset: borderDashOffset,\n tickWidth: tickWidth,\n tickColor: tickColor,\n tickBorderDash: tickBorderDash,\n tickBorderDashOffset: tickBorderDashOffset\n });\n }\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n return items;\n }\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const { position: position, ticks: optionTicks } = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const { align: align, crossAlign: crossAlign, padding: padding, mirror: mirror } = optionTicks;\n const tl = $77dc20320068f1ee$var$getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -(0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = \"middle\";\n if (position === \"top\") {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === \"bottom\") {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === \"left\") {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === \"right\") {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === \"x\") {\n if (position === \"center\") y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === \"y\") {\n if (position === \"center\") x = (chartArea.left + chartArea.right) / 2 - tickAndPadding;\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n if (axis === \"y\") {\n if (align === \"start\") textBaseline = \"top\";\n else if (align === \"end\") textBaseline = \"bottom\";\n }\n const labelSizes = this._getLabelSizes();\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n label = tick.label;\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = (0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n if (isHorizontal) {\n x = pixel;\n if (textAlign === \"inner\") {\n if (i === ilen - 1) tickTextAlign = !this.options.reverse ? \"right\" : \"left\";\n else if (i === 0) tickTextAlign = !this.options.reverse ? \"left\" : \"right\";\n else tickTextAlign = \"center\";\n }\n if (position === \"top\") {\n if (crossAlign === \"near\" || rotation !== 0) textOffset = -lineCount * lineHeight + lineHeight / 2;\n else if (crossAlign === \"center\") textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n else textOffset = -labelSizes.highest.height + lineHeight / 2;\n } else {\n if (crossAlign === \"near\" || rotation !== 0) textOffset = lineHeight / 2;\n else if (crossAlign === \"center\") textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n else textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n if (mirror) textOffset *= -1;\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) x += lineHeight / 2 * Math.sin(rotation);\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n let backdrop;\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n switch(textBaseline){\n case \"middle\":\n top -= height / 2;\n break;\n case \"bottom\":\n top -= height;\n break;\n }\n switch(textAlign){\n case \"center\":\n left -= width / 2;\n break;\n case \"right\":\n left -= width;\n break;\n }\n backdrop = {\n left: left,\n top: top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n color: optsAtIndex.backdropColor\n };\n }\n items.push({\n label: label,\n font: font,\n textOffset: textOffset,\n options: {\n rotation: rotation,\n color: color,\n strokeColor: strokeColor,\n strokeWidth: strokeWidth,\n textAlign: tickTextAlign,\n textBaseline: textBaseline,\n translation: [\n x,\n y\n ],\n backdrop: backdrop\n }\n });\n }\n return items;\n }\n _getXAxisLabelAlignment() {\n const { position: position, ticks: ticks } = this.options;\n const rotation = -(0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.labelRotation);\n if (rotation) return position === \"top\" ? \"left\" : \"right\";\n let align = \"center\";\n if (ticks.align === \"start\") align = \"left\";\n else if (ticks.align === \"end\") align = \"right\";\n else if (ticks.align === \"inner\") align = \"inner\";\n return align;\n }\n _getYAxisLabelAlignment(tl) {\n const { position: position, ticks: { crossAlign: crossAlign, mirror: mirror, padding: padding } } = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n let textAlign;\n let x;\n if (position === \"left\") {\n if (mirror) {\n x = this.right + padding;\n if (crossAlign === \"near\") textAlign = \"left\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x += widest / 2;\n } else {\n textAlign = \"right\";\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n if (crossAlign === \"near\") textAlign = \"right\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x -= widest / 2;\n } else {\n textAlign = \"left\";\n x = this.left;\n }\n }\n } else if (position === \"right\") {\n if (mirror) {\n x = this.left + padding;\n if (crossAlign === \"near\") textAlign = \"right\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x -= widest / 2;\n } else {\n textAlign = \"left\";\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n if (crossAlign === \"near\") textAlign = \"left\";\n else if (crossAlign === \"center\") {\n textAlign = \"center\";\n x += widest / 2;\n } else {\n textAlign = \"right\";\n x = this.right;\n }\n }\n } else textAlign = \"right\";\n return {\n textAlign: textAlign,\n x: x\n };\n }\n _computeLabelArea() {\n if (this.options.ticks.mirror) return;\n const chart = this.chart;\n const position = this.options.position;\n if (position === \"left\" || position === \"right\") return {\n top: 0,\n left: this.left,\n bottom: chart.height,\n right: this.right\n };\n if (position === \"top\" || position === \"bottom\") return {\n top: this.top,\n left: 0,\n bottom: this.bottom,\n right: chart.width\n };\n }\n drawBackground() {\n const { ctx: ctx, options: { backgroundColor: backgroundColor }, left: left, top: top, width: width, height: height } = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) return 0;\n const ticks = this.ticks;\n const index = ticks.findIndex((t)=>t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n const drawLine = (p1, p2, style)=>{\n if (!style.width || !style.color) return;\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n if (grid.display) for(i = 0, ilen = items.length; i < ilen; ++i){\n const item = items[i];\n if (grid.drawOnChartArea) drawLine({\n x: item.x1,\n y: item.y1\n }, {\n x: item.x2,\n y: item.y2\n }, item);\n if (grid.drawTicks) drawLine({\n x: item.tx1,\n y: item.ty1\n }, {\n x: item.tx2,\n y: item.ty2\n }, {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n });\n }\n }\n drawBorder() {\n const { chart: chart, ctx: ctx, options: { border: border, grid: grid } } = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) return;\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n if (this.isHorizontal()) {\n x1 = (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = (0, $02b6f511cc6c123c$export$78acf4525d8a74c4)(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.restore();\n }\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n if (!optionTicks.display) return;\n const ctx = this.ctx;\n const area = this._computeLabelArea();\n if (area) (0, $02b6f511cc6c123c$export$8743009a87fcb00f)(ctx, area);\n const items = this.getLabelItems(chartArea);\n for (const item of items){\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n if (area) (0, $02b6f511cc6c123c$export$3d8c2f653ac9d0b9)(ctx);\n }\n drawTitle() {\n const { ctx: ctx, options: { position: position, title: title, reverse: reverse } } = this;\n if (!title.display) return;\n const font = (0, $02b6f511cc6c123c$export$34aec0b863436764)(title.font);\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n if (position === \"bottom\" || position === \"center\" || (0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(position)) {\n offset += padding.bottom;\n if ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(title.text)) offset += font.lineHeight * (title.text.length - 1);\n } else offset += padding.top;\n const { titleX: titleX, titleY: titleY, maxWidth: maxWidth, rotation: rotation } = $77dc20320068f1ee$var$titleArgs(this, offset, position, align);\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth: maxWidth,\n rotation: rotation,\n textAlign: $77dc20320068f1ee$var$titleAlign(align, position, reverse),\n textBaseline: \"middle\",\n translation: [\n titleX,\n titleY\n ]\n });\n }\n draw(chartArea) {\n if (!this._isVisible()) return;\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(opts.grid && opts.grid.z, -1);\n const bz = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(opts.border && opts.border.z, 0);\n if (!this._isVisible() || this.draw !== $77dc20320068f1ee$export$d60cfc58d3c358b6.prototype.draw) return [\n {\n z: tz,\n draw: (chartArea)=>{\n this.draw(chartArea);\n }\n }\n ];\n return [\n {\n z: gz,\n draw: (chartArea)=>{\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n },\n {\n z: bz,\n draw: ()=>{\n this.drawBorder();\n }\n },\n {\n z: tz,\n draw: (chartArea)=>{\n this.drawLabels(chartArea);\n }\n }\n ];\n }\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + \"AxisID\";\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) result.push(meta);\n }\n return result;\n }\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return (0, $02b6f511cc6c123c$export$34aec0b863436764)(opts.font);\n }\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n constructor(cfg){\n super();\n this.id = cfg.id;\n this.type = cfg.type;\n this.options = undefined;\n this.ctx = cfg.ctx;\n this.chart = cfg.chart;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.paddingTop = undefined;\n this.paddingBottom = undefined;\n this.paddingLeft = undefined;\n this.paddingRight = undefined;\n this.axis = undefined;\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n this.ticks = [];\n this._gridLineItems = null;\n this._labelItems = null;\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n this._startPixel = undefined;\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n}\nclass $77dc20320068f1ee$var$TypedRegistry {\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n if ($77dc20320068f1ee$var$isIChartComponent(proto)) parentScope = this.register(proto);\n const items = this.items;\n const id = item.id;\n const scope = this.scope + \".\" + id;\n if (!id) throw new Error(\"class does not have id: \" + item);\n if (id in items) return scope;\n items[id] = item;\n $77dc20320068f1ee$var$registerDefaults(item, scope, parentScope);\n if (this.override) (0, $02b6f511cc6c123c$export$4368d992c4eafac0).override(item.id, item.overrides);\n return scope;\n }\n get(id) {\n return this.items[id];\n }\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n if (id in items) delete items[id];\n if (scope && id in (0, $02b6f511cc6c123c$export$4368d992c4eafac0)[scope]) {\n delete (0, $02b6f511cc6c123c$export$4368d992c4eafac0)[scope][id];\n if (this.override) delete (0, $02b6f511cc6c123c$export$6559d589eb85fbb6)[id];\n }\n }\n constructor(type, scope, override){\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n}\nfunction $77dc20320068f1ee$var$registerDefaults(item, scope, parentScope) {\n const itemDefaults = (0, $02b6f511cc6c123c$export$efca4cbe5dd06740)(Object.create(null), [\n parentScope ? (0, $02b6f511cc6c123c$export$4368d992c4eafac0).get(parentScope) : {},\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0).get(scope),\n item.defaults\n ]);\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0).set(scope, itemDefaults);\n if (item.defaultRoutes) $77dc20320068f1ee$var$routeDefaults(scope, item.defaultRoutes);\n if (item.descriptors) (0, $02b6f511cc6c123c$export$4368d992c4eafac0).describe(scope, item.descriptors);\n}\nfunction $77dc20320068f1ee$var$routeDefaults(scope, routes) {\n Object.keys(routes).forEach((property)=>{\n const propertyParts = property.split(\".\");\n const sourceName = propertyParts.pop();\n const sourceScope = [\n scope\n ].concat(propertyParts).join(\".\");\n const parts = routes[property].split(\".\");\n const targetName = parts.pop();\n const targetScope = parts.join(\".\");\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0).route(sourceScope, sourceName, targetScope, targetName);\n });\n}\nfunction $77dc20320068f1ee$var$isIChartComponent(proto) {\n return \"id\" in proto && \"defaults\" in proto;\n}\nclass $77dc20320068f1ee$var$Registry {\n add(...args) {\n this._each(\"register\", args);\n }\n remove(...args) {\n this._each(\"unregister\", args);\n }\n addControllers(...args) {\n this._each(\"register\", args, this.controllers);\n }\n addElements(...args) {\n this._each(\"register\", args, this.elements);\n }\n addPlugins(...args) {\n this._each(\"register\", args, this.plugins);\n }\n addScales(...args) {\n this._each(\"register\", args, this.scales);\n }\n getController(id) {\n return this._get(id, this.controllers, \"controller\");\n }\n getElement(id) {\n return this._get(id, this.elements, \"element\");\n }\n getPlugin(id) {\n return this._get(id, this.plugins, \"plugin\");\n }\n getScale(id) {\n return this._get(id, this.scales, \"scale\");\n }\n removeControllers(...args) {\n this._each(\"unregister\", args, this.controllers);\n }\n removeElements(...args) {\n this._each(\"unregister\", args, this.elements);\n }\n removePlugins(...args) {\n this._each(\"unregister\", args, this.plugins);\n }\n removeScales(...args) {\n this._each(\"unregister\", args, this.scales);\n }\n _each(method, args, typedRegistry) {\n [\n ...args\n ].forEach((arg)=>{\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) this._exec(method, reg, arg);\n else (0, $02b6f511cc6c123c$export$d66501df72047452)(arg, (item)=>{\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n });\n }\n _exec(method, registry, component) {\n const camelMethod = (0, $02b6f511cc6c123c$export$a8550f7dbe79f93a)(method);\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(component[\"before\" + camelMethod], [], component);\n registry[method](component);\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(component[\"after\" + camelMethod], [], component);\n }\n _getRegistryForType(type) {\n for(let i = 0; i < this._typedRegistries.length; i++){\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) return reg;\n }\n return this.plugins;\n }\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) throw new Error('\"' + id + '\" is not a registered ' + type + \".\");\n return item;\n }\n constructor(){\n this.controllers = new $77dc20320068f1ee$var$TypedRegistry($77dc20320068f1ee$export$75572ec5c55b4048, \"datasets\", true);\n this.elements = new $77dc20320068f1ee$var$TypedRegistry($77dc20320068f1ee$export$db77ccec0bb4ccac, \"elements\");\n this.plugins = new $77dc20320068f1ee$var$TypedRegistry(Object, \"plugins\");\n this.scales = new $77dc20320068f1ee$var$TypedRegistry($77dc20320068f1ee$export$d60cfc58d3c358b6, \"scales\");\n this._typedRegistries = [\n this.controllers,\n this.scales,\n this.elements\n ];\n }\n}\nvar $77dc20320068f1ee$export$4bb7493d241fd8a5 = /* #__PURE__ */ new $77dc20320068f1ee$var$Registry();\nclass $77dc20320068f1ee$var$PluginService {\n notify(chart, hook, args, filter) {\n if (hook === \"beforeInit\") {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, \"install\");\n }\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n if (hook === \"afterDestroy\") {\n this._notify(descriptors, chart, \"stop\");\n this._notify(this._init, chart, \"uninstall\");\n }\n return result;\n }\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors){\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [\n chart,\n args,\n descriptor.options\n ];\n if ((0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(method, params, plugin) === false && args.cancelable) return false;\n }\n return true;\n }\n invalidate() {\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n _descriptors(chart) {\n if (this._cache) return this._cache;\n const descriptors = this._cache = this._createDescriptors(chart);\n this._notifyStateChanges(chart);\n return descriptors;\n }\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(config.options && config.options.plugins, {});\n const plugins = $77dc20320068f1ee$var$allPlugins(config);\n return options === false && !all ? [] : $77dc20320068f1ee$var$createDescriptors(chart, plugins, options, all);\n }\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, \"stop\");\n this._notify(diff(descriptors, previousDescriptors), chart, \"start\");\n }\n constructor(){\n this._init = [];\n }\n}\nfunction $77dc20320068f1ee$var$allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys($77dc20320068f1ee$export$4bb7493d241fd8a5.plugins.items);\n for(let i = 0; i < keys.length; i++)plugins.push($77dc20320068f1ee$export$4bb7493d241fd8a5.getPlugin(keys[i]));\n const local = config.plugins || [];\n for(let i = 0; i < local.length; i++){\n const plugin = local[i];\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n return {\n plugins: plugins,\n localIds: localIds\n };\n}\nfunction $77dc20320068f1ee$var$getOpts(options, all) {\n if (!all && options === false) return null;\n if (options === true) return {};\n return options;\n}\nfunction $77dc20320068f1ee$var$createDescriptors(chart, { plugins: plugins, localIds: localIds }, options, all) {\n const result = [];\n const context = chart.getContext();\n for (const plugin of plugins){\n const id = plugin.id;\n const opts = $77dc20320068f1ee$var$getOpts(options[id], all);\n if (opts === null) continue;\n result.push({\n plugin: plugin,\n options: $77dc20320068f1ee$var$pluginOpts(chart.config, {\n plugin: plugin,\n local: localIds[id]\n }, opts, context)\n });\n }\n return result;\n}\nfunction $77dc20320068f1ee$var$pluginOpts(config, { plugin: plugin, local: local }, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) scopes.push(plugin.defaults);\n return config.createResolver(scopes, context, [\n \"\"\n ], {\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\nfunction $77dc20320068f1ee$var$getIndexAxis(type, options) {\n const datasetDefaults = (0, $02b6f511cc6c123c$export$4368d992c4eafac0).datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || \"x\";\n}\nfunction $77dc20320068f1ee$var$getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === \"_index_\") axis = indexAxis;\n else if (id === \"_value_\") axis = indexAxis === \"x\" ? \"y\" : \"x\";\n return axis;\n}\nfunction $77dc20320068f1ee$var$getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? \"_index_\" : \"_value_\";\n}\nfunction $77dc20320068f1ee$var$idMatchesAxis(id) {\n if (id === \"x\" || id === \"y\" || id === \"r\") return id;\n}\nfunction $77dc20320068f1ee$var$axisFromPosition(position) {\n if (position === \"top\" || position === \"bottom\") return \"x\";\n if (position === \"left\" || position === \"right\") return \"y\";\n}\nfunction $77dc20320068f1ee$var$determineAxis(id, ...scaleOptions) {\n if ($77dc20320068f1ee$var$idMatchesAxis(id)) return id;\n for (const opts of scaleOptions){\n const axis = opts.axis || $77dc20320068f1ee$var$axisFromPosition(opts.position) || id.length > 1 && $77dc20320068f1ee$var$idMatchesAxis(id[0].toLowerCase());\n if (axis) return axis;\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\nfunction $77dc20320068f1ee$var$getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + \"AxisID\"] === id) return {\n axis: axis\n };\n}\nfunction $77dc20320068f1ee$var$retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d)=>d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) return $77dc20320068f1ee$var$getAxisFromDataset(id, \"x\", boundDs[0]) || $77dc20320068f1ee$var$getAxisFromDataset(id, \"y\", boundDs[0]);\n }\n return {};\n}\nfunction $77dc20320068f1ee$var$mergeScaleConfig(config, options) {\n const chartDefaults = (0, $02b6f511cc6c123c$export$6559d589eb85fbb6)[config.type] || {\n scales: {}\n };\n const configScales = options.scales || {};\n const chartIndexAxis = $77dc20320068f1ee$var$getIndexAxis(config.type, options);\n const scales = Object.create(null);\n Object.keys(configScales).forEach((id)=>{\n const scaleConf = configScales[id];\n if (!(0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(scaleConf)) return console.error(`Invalid scale configuration for scale: ${id}`);\n if (scaleConf._proxy) return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n const axis = $77dc20320068f1ee$var$determineAxis(id, scaleConf, $77dc20320068f1ee$var$retrieveAxisFromDatasets(id, config), (0, $02b6f511cc6c123c$export$4368d992c4eafac0).scales[scaleConf.type]);\n const defaultId = $77dc20320068f1ee$var$getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = (0, $02b6f511cc6c123c$export$555508cbc6add439)(Object.create(null), [\n {\n axis: axis\n },\n scaleConf,\n defaultScaleOptions[axis],\n defaultScaleOptions[defaultId]\n ]);\n });\n config.data.datasets.forEach((dataset)=>{\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || $77dc20320068f1ee$var$getIndexAxis(type, options);\n const datasetDefaults = (0, $02b6f511cc6c123c$export$6559d589eb85fbb6)[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach((defaultID)=>{\n const axis = $77dc20320068f1ee$var$getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + \"AxisID\"] || axis;\n scales[id] = scales[id] || Object.create(null);\n (0, $02b6f511cc6c123c$export$555508cbc6add439)(scales[id], [\n {\n axis: axis\n },\n configScales[id],\n defaultScaleOptions[defaultID]\n ]);\n });\n });\n Object.keys(scales).forEach((key)=>{\n const scale = scales[key];\n (0, $02b6f511cc6c123c$export$555508cbc6add439)(scale, [\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0).scales[scale.type],\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0).scale\n ]);\n });\n return scales;\n}\nfunction $77dc20320068f1ee$var$initOptions(config) {\n const options = config.options || (config.options = {});\n options.plugins = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(options.plugins, {});\n options.scales = $77dc20320068f1ee$var$mergeScaleConfig(config, options);\n}\nfunction $77dc20320068f1ee$var$initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\nfunction $77dc20320068f1ee$var$initConfig(config) {\n config = config || {};\n config.data = $77dc20320068f1ee$var$initData(config.data);\n $77dc20320068f1ee$var$initOptions(config);\n return config;\n}\nconst $77dc20320068f1ee$var$keyCache = new Map();\nconst $77dc20320068f1ee$var$keysCached = new Set();\nfunction $77dc20320068f1ee$var$cachedKeys(cacheKey, generate) {\n let keys = $77dc20320068f1ee$var$keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n $77dc20320068f1ee$var$keyCache.set(cacheKey, keys);\n $77dc20320068f1ee$var$keysCached.add(keys);\n }\n return keys;\n}\nconst $77dc20320068f1ee$var$addIfFound = (set, obj, key)=>{\n const opts = (0, $02b6f511cc6c123c$export$2d1720544b23b823)(obj, key);\n if (opts !== undefined) set.add(opts);\n};\nclass $77dc20320068f1ee$var$Config {\n get platform() {\n return this._config.platform;\n }\n get type() {\n return this._config.type;\n }\n set type(type) {\n this._config.type = type;\n }\n get data() {\n return this._config.data;\n }\n set data(data) {\n this._config.data = $77dc20320068f1ee$var$initData(data);\n }\n get options() {\n return this._config.options;\n }\n set options(options) {\n this._config.options = options;\n }\n get plugins() {\n return this._config.plugins;\n }\n update() {\n const config = this._config;\n this.clearCache();\n $77dc20320068f1ee$var$initOptions(config);\n }\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n datasetScopeKeys(datasetType) {\n return $77dc20320068f1ee$var$cachedKeys(datasetType, ()=>[\n [\n `datasets.${datasetType}`,\n \"\"\n ]\n ]);\n }\n datasetAnimationScopeKeys(datasetType, transition) {\n return $77dc20320068f1ee$var$cachedKeys(`${datasetType}.transition.${transition}`, ()=>[\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`\n ],\n [\n `datasets.${datasetType}`,\n \"\"\n ]\n ]);\n }\n datasetElementScopeKeys(datasetType, elementType) {\n return $77dc20320068f1ee$var$cachedKeys(`${datasetType}-${elementType}`, ()=>[\n [\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n \"\"\n ]\n ]);\n }\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return $77dc20320068f1ee$var$cachedKeys(`${type}-plugin-${id}`, ()=>[\n [\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || []\n ]\n ]);\n }\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n getOptionScopes(mainScope, keyLists, resetCache) {\n const { options: options, type: type } = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) return cached;\n const scopes = new Set();\n keyLists.forEach((keys)=>{\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach((key)=>$77dc20320068f1ee$var$addIfFound(scopes, mainScope, key));\n }\n keys.forEach((key)=>$77dc20320068f1ee$var$addIfFound(scopes, options, key));\n keys.forEach((key)=>$77dc20320068f1ee$var$addIfFound(scopes, (0, $02b6f511cc6c123c$export$6559d589eb85fbb6)[type] || {}, key));\n keys.forEach((key)=>$77dc20320068f1ee$var$addIfFound(scopes, (0, $02b6f511cc6c123c$export$4368d992c4eafac0), key));\n keys.forEach((key)=>$77dc20320068f1ee$var$addIfFound(scopes, (0, $02b6f511cc6c123c$export$2e2af4578d910ddf), key));\n });\n const array = Array.from(scopes);\n if (array.length === 0) array.push(Object.create(null));\n if ($77dc20320068f1ee$var$keysCached.has(keyLists)) cache.set(keyLists, array);\n return array;\n }\n chartOptionScopes() {\n const { options: options, type: type } = this;\n return [\n options,\n (0, $02b6f511cc6c123c$export$6559d589eb85fbb6)[type] || {},\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0).datasets[type] || {},\n {\n type: type\n },\n (0, $02b6f511cc6c123c$export$4368d992c4eafac0),\n (0, $02b6f511cc6c123c$export$2e2af4578d910ddf)\n ];\n }\n resolveNamedOptions(scopes, names, context, prefixes = [\n \"\"\n ]) {\n const result = {\n $shared: true\n };\n const { resolver: resolver, subPrefixes: subPrefixes } = $77dc20320068f1ee$var$getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if ($77dc20320068f1ee$var$needContext(resolver, names)) {\n result.$shared = false;\n context = (0, $02b6f511cc6c123c$export$a93c5207d687da10)(context) ? context() : context;\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = (0, $02b6f511cc6c123c$export$c3950d9923825c02)(resolver, context, subResolver);\n }\n for (const prop of names)result[prop] = options[prop];\n return result;\n }\n createResolver(scopes, context, prefixes = [\n \"\"\n ], descriptorDefaults) {\n const { resolver: resolver } = $77dc20320068f1ee$var$getResolver(this._resolverCache, scopes, prefixes);\n return (0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(context) ? (0, $02b6f511cc6c123c$export$c3950d9923825c02)(resolver, context, undefined, descriptorDefaults) : resolver;\n }\n constructor(config){\n this._config = $77dc20320068f1ee$var$initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n}\nfunction $77dc20320068f1ee$var$getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = (0, $02b6f511cc6c123c$export$a9c996f45e5784d0)(scopes, prefixes);\n cached = {\n resolver: resolver,\n subPrefixes: prefixes.filter((p)=>!p.toLowerCase().includes(\"hover\"))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\nconst $77dc20320068f1ee$var$hasFunction = (value)=>(0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(value) && Object.getOwnPropertyNames(value).reduce((acc, key)=>acc || (0, $02b6f511cc6c123c$export$a93c5207d687da10)(value[key]), false);\nfunction $77dc20320068f1ee$var$needContext(proxy, names) {\n const { isScriptable: isScriptable, isIndexable: isIndexable } = (0, $02b6f511cc6c123c$export$7910e0436ed8d1de)(proxy);\n for (const prop of names){\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if (scriptable && ((0, $02b6f511cc6c123c$export$a93c5207d687da10)(value) || $77dc20320068f1ee$var$hasFunction(value)) || indexable && (0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(value)) return true;\n }\n return false;\n}\nvar $77dc20320068f1ee$var$version = \"4.4.0\";\nconst $77dc20320068f1ee$var$KNOWN_POSITIONS = [\n \"top\",\n \"bottom\",\n \"left\",\n \"right\",\n \"chartArea\"\n];\nfunction $77dc20320068f1ee$var$positionIsHorizontal(position, axis) {\n return position === \"top\" || position === \"bottom\" || $77dc20320068f1ee$var$KNOWN_POSITIONS.indexOf(position) === -1 && axis === \"x\";\n}\nfunction $77dc20320068f1ee$var$compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1];\n };\n}\nfunction $77dc20320068f1ee$var$onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n chart.notifyPlugins(\"afterRender\");\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(animationOptions && animationOptions.onComplete, [\n context\n ], chart);\n}\nfunction $77dc20320068f1ee$var$onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(animationOptions && animationOptions.onProgress, [\n context\n ], chart);\n}\nfunction $77dc20320068f1ee$var$getCanvas(item) {\n if ((0, $02b6f511cc6c123c$export$3a1a48c8f6ef640e)() && typeof item === \"string\") item = document.getElementById(item);\n else if (item && item.length) item = item[0];\n if (item && item.canvas) item = item.canvas;\n return item;\n}\nconst $77dc20320068f1ee$var$instances = {};\nconst $77dc20320068f1ee$var$getChart = (key)=>{\n const canvas = $77dc20320068f1ee$var$getCanvas(key);\n return Object.values($77dc20320068f1ee$var$instances).filter((c)=>c.canvas === canvas).pop();\n};\nfunction $77dc20320068f1ee$var$moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys){\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) obj[intKey + move] = value;\n }\n }\n}\nfunction $77dc20320068f1ee$var$determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === \"mouseout\") return null;\n if (isClick) return lastEvent;\n return e;\n}\nfunction $77dc20320068f1ee$var$getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\nfunction $77dc20320068f1ee$var$getDatasetArea(meta, chartArea) {\n const { xScale: xScale, yScale: yScale } = meta;\n if (xScale && yScale) return {\n left: $77dc20320068f1ee$var$getSizeForArea(xScale, chartArea, \"left\"),\n right: $77dc20320068f1ee$var$getSizeForArea(xScale, chartArea, \"right\"),\n top: $77dc20320068f1ee$var$getSizeForArea(yScale, chartArea, \"top\"),\n bottom: $77dc20320068f1ee$var$getSizeForArea(yScale, chartArea, \"bottom\")\n };\n return chartArea;\n}\nclass $77dc20320068f1ee$export$acaa6426d77a227e {\n static register(...items) {\n $77dc20320068f1ee$export$4bb7493d241fd8a5.add(...items);\n $77dc20320068f1ee$var$invalidatePlugins();\n }\n static unregister(...items) {\n $77dc20320068f1ee$export$4bb7493d241fd8a5.remove(...items);\n $77dc20320068f1ee$var$invalidatePlugins();\n }\n get aspectRatio() {\n const { options: { aspectRatio: aspectRatio, maintainAspectRatio: maintainAspectRatio }, width: width, height: height, _aspectRatio: _aspectRatio } = this;\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(aspectRatio)) return aspectRatio;\n if (maintainAspectRatio && _aspectRatio) return _aspectRatio;\n return height ? width / height : null;\n }\n get data() {\n return this.config.data;\n }\n set data(data) {\n this.config.data = data;\n }\n get options() {\n return this._options;\n }\n set options(options) {\n this.config.options = options;\n }\n get registry() {\n return $77dc20320068f1ee$export$4bb7493d241fd8a5;\n }\n _initialize() {\n this.notifyPlugins(\"beforeInit\");\n if (this.options.responsive) this.resize();\n else (0, $02b6f511cc6c123c$export$f787f51d84a910ad)(this, this.options.devicePixelRatio);\n this.bindEvents();\n this.notifyPlugins(\"afterInit\");\n return this;\n }\n clear() {\n (0, $02b6f511cc6c123c$export$c9170ad7d4cd7e57)(this.canvas, this.ctx);\n return this;\n }\n stop() {\n $77dc20320068f1ee$export$a424a0aa8f687495.stop(this);\n return this;\n }\n resize(width, height) {\n if (!$77dc20320068f1ee$export$a424a0aa8f687495.running(this)) this._resize(width, height);\n else this._resizeBeforeDraw = {\n width: width,\n height: height\n };\n }\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? \"resize\" : \"attach\";\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!(0, $02b6f511cc6c123c$export$f787f51d84a910ad)(this, newRatio, true)) return;\n this.notifyPlugins(\"resize\", {\n size: newSize\n });\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(options.onResize, [\n this,\n newSize\n ], this);\n if (this.attached) {\n if (this._doResize(mode)) this.render();\n }\n }\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n (0, $02b6f511cc6c123c$export$d66501df72047452)(scalesOptions, (axisOptions, axisID)=>{\n axisOptions.id = axisID;\n });\n }\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id)=>{\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n if (scaleOpts) items = items.concat(Object.keys(scaleOpts).map((id)=>{\n const scaleOptions = scaleOpts[id];\n const axis = $77dc20320068f1ee$var$determineAxis(id, scaleOptions);\n const isRadial = axis === \"r\";\n const isHorizontal = axis === \"x\";\n return {\n options: scaleOptions,\n dposition: isRadial ? \"chartArea\" : isHorizontal ? \"bottom\" : \"left\",\n dtype: isRadial ? \"radialLinear\" : isHorizontal ? \"category\" : \"linear\"\n };\n }));\n (0, $02b6f511cc6c123c$export$d66501df72047452)(items, (item)=>{\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = $77dc20320068f1ee$var$determineAxis(id, scaleOptions);\n const scaleType = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(scaleOptions.type, item.dtype);\n if (scaleOptions.position === undefined || $77dc20320068f1ee$var$positionIsHorizontal(scaleOptions.position, axis) !== $77dc20320068f1ee$var$positionIsHorizontal(item.dposition)) scaleOptions.position = item.dposition;\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) scale = scales[id];\n else {\n const scaleClass = $77dc20320068f1ee$export$4bb7493d241fd8a5.getScale(scaleType);\n scale = new scaleClass({\n id: id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n scale.init(scaleOptions, options);\n });\n (0, $02b6f511cc6c123c$export$d66501df72047452)(updated, (hasUpdated, id)=>{\n if (!hasUpdated) delete scales[id];\n });\n (0, $02b6f511cc6c123c$export$d66501df72047452)(scales, (scale)=>{\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(this, scale, scale.options);\n $77dc20320068f1ee$export$1ecca0613f5e56d2.addBox(this, scale);\n });\n }\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n metasets.sort((a, b)=>a.index - b.index);\n if (numMeta > numData) {\n for(let i = numData; i < numMeta; ++i)this._destroyDatasetMeta(i);\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort($77dc20320068f1ee$var$compare2Level(\"order\", \"index\"));\n }\n _removeUnreferencedMetasets() {\n const { _metasets: metasets, data: { datasets: datasets } } = this;\n if (metasets.length > datasets.length) delete this._stacks;\n metasets.forEach((meta, index)=>{\n if (datasets.filter((x)=>x === meta._dataset).length === 0) this._destroyDatasetMeta(index);\n });\n }\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n this._removeUnreferencedMetasets();\n for(i = 0, ilen = datasets.length; i < ilen; i++){\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || $77dc20320068f1ee$var$getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = \"\" + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = $77dc20320068f1ee$export$4bb7493d241fd8a5.getController(type);\n const { datasetElementType: datasetElementType, dataElementType: dataElementType } = (0, $02b6f511cc6c123c$export$4368d992c4eafac0).datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: $77dc20320068f1ee$export$4bb7493d241fd8a5.getElement(dataElementType),\n datasetElementType: datasetElementType && $77dc20320068f1ee$export$4bb7493d241fd8a5.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n this._updateMetasets();\n return newControllers;\n }\n _resetElements() {\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this.data.datasets, (dataset, datasetIndex)=>{\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n reset() {\n this._resetElements();\n this.notifyPlugins(\"reset\");\n }\n update(mode) {\n const config = this.config;\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n this._plugins.invalidate();\n if (this.notifyPlugins(\"beforeUpdate\", {\n mode: mode,\n cancelable: true\n }) === false) return;\n const newControllers = this.buildOrUpdateControllers();\n this.notifyPlugins(\"beforeElementsUpdate\");\n let minPadding = 0;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; i++){\n const { controller: controller } = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n if (!animsDisabled) (0, $02b6f511cc6c123c$export$d66501df72047452)(newControllers, (controller)=>{\n controller.reset();\n });\n this._updateDatasets(mode);\n this.notifyPlugins(\"afterUpdate\", {\n mode: mode\n });\n this._layers.sort($77dc20320068f1ee$var$compare2Level(\"z\", \"_idx\"));\n const { _active: _active, _lastEvent: _lastEvent } = this;\n if (_lastEvent) this._eventHandler(_lastEvent, true);\n else if (_active.length) this._updateHoverStyles(_active, _active, true);\n this.render();\n }\n _updateScales() {\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this.scales, (scale)=>{\n $77dc20320068f1ee$export$1ecca0613f5e56d2.removeBox(this, scale);\n });\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n if (!(0, $02b6f511cc6c123c$export$ee7c8ad385a60b7b)(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n this.unbindEvents();\n this.bindEvents();\n }\n }\n _updateHiddenIndices() {\n const { _hiddenIndices: _hiddenIndices } = this;\n const changes = this._getUniformDataChanges() || [];\n for (const { method: method, start: start, count: count } of changes){\n const move = method === \"_removeElements\" ? -count : count;\n $77dc20320068f1ee$var$moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) return;\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx)=>new Set(_dataChanges.filter((c)=>c[0] === idx).map((c, i)=>i + \",\" + c.splice(1).join(\",\")));\n const changeSet = makeSet(0);\n for(let i = 1; i < datasetCount; i++){\n if (!(0, $02b6f511cc6c123c$export$ee7c8ad385a60b7b)(changeSet, makeSet(i))) return;\n }\n return Array.from(changeSet).map((c)=>c.split(\",\")).map((a)=>({\n method: a[1],\n start: +a[2],\n count: +a[3]\n }));\n }\n _updateLayout(minPadding) {\n if (this.notifyPlugins(\"beforeLayout\", {\n cancelable: true\n }) === false) return;\n $77dc20320068f1ee$export$1ecca0613f5e56d2.update(this, this.width, this.height, minPadding);\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n this._layers = [];\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this.boxes, (box)=>{\n if (noArea && box.position === \"chartArea\") return;\n if (box.configure) box.configure();\n this._layers.push(...box._layers());\n }, this);\n this._layers.forEach((item, index)=>{\n item._idx = index;\n });\n this.notifyPlugins(\"afterLayout\");\n }\n _updateDatasets(mode) {\n if (this.notifyPlugins(\"beforeDatasetsUpdate\", {\n mode: mode,\n cancelable: true\n }) === false) return;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i)this.getDatasetMeta(i).controller.configure();\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i)this._updateDataset(i, (0, $02b6f511cc6c123c$export$a93c5207d687da10)(mode) ? mode({\n datasetIndex: i\n }) : mode);\n this.notifyPlugins(\"afterDatasetsUpdate\", {\n mode: mode\n });\n }\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {\n meta: meta,\n index: index,\n mode: mode,\n cancelable: true\n };\n if (this.notifyPlugins(\"beforeDatasetUpdate\", args) === false) return;\n meta.controller._update(mode);\n args.cancelable = false;\n this.notifyPlugins(\"afterDatasetUpdate\", args);\n }\n render() {\n if (this.notifyPlugins(\"beforeRender\", {\n cancelable: true\n }) === false) return;\n if ($77dc20320068f1ee$export$a424a0aa8f687495.has(this)) {\n if (this.attached && !$77dc20320068f1ee$export$a424a0aa8f687495.running(this)) $77dc20320068f1ee$export$a424a0aa8f687495.start(this);\n } else {\n this.draw();\n $77dc20320068f1ee$var$onAnimationsComplete({\n chart: this\n });\n }\n }\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const { width: width, height: height } = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n if (this.width <= 0 || this.height <= 0) return;\n if (this.notifyPlugins(\"beforeDraw\", {\n cancelable: true\n }) === false) return;\n const layers = this._layers;\n for(i = 0; i < layers.length && layers[i].z <= 0; ++i)layers[i].draw(this.chartArea);\n this._drawDatasets();\n for(; i < layers.length; ++i)layers[i].draw(this.chartArea);\n this.notifyPlugins(\"afterDraw\");\n }\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n const meta = metasets[i];\n if (!filterVisible || meta.visible) result.push(meta);\n }\n return result;\n }\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n _drawDatasets() {\n if (this.notifyPlugins(\"beforeDatasetsDraw\", {\n cancelable: true\n }) === false) return;\n const metasets = this.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i)this._drawDataset(metasets[i]);\n this.notifyPlugins(\"afterDatasetsDraw\");\n }\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = $77dc20320068f1ee$var$getDatasetArea(meta, this.chartArea);\n const args = {\n meta: meta,\n index: meta.index,\n cancelable: true\n };\n if (this.notifyPlugins(\"beforeDatasetDraw\", args) === false) return;\n if (useClip) (0, $02b6f511cc6c123c$export$8743009a87fcb00f)(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n meta.controller.draw();\n if (useClip) (0, $02b6f511cc6c123c$export$3d8c2f653ac9d0b9)(ctx);\n args.cancelable = false;\n this.notifyPlugins(\"afterDatasetDraw\", args);\n }\n isPointInArea(point) {\n return (0, $02b6f511cc6c123c$export$e7094788287c5e9b)(point, this.chartArea, this._minPadding);\n }\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = $77dc20320068f1ee$export$a13296960cae0384.modes[mode];\n if (typeof method === \"function\") return method(this, e, options, useFinalPosition);\n return [];\n }\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter((x)=>x && x._dataset === dataset).pop();\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n return meta;\n }\n getContext() {\n return this.$context || (this.$context = (0, $02b6f511cc6c123c$export$35e795649ee09318)(null, {\n chart: this,\n type: \"chart\"\n }));\n }\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) return false;\n const meta = this.getDatasetMeta(datasetIndex);\n return typeof meta.hidden === \"boolean\" ? !meta.hidden : !dataset.hidden;\n }\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? \"show\" : \"hide\";\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n if ((0, $02b6f511cc6c123c$export$dda1d9f60106f0e9)(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n anims.update(meta, {\n visible: visible\n });\n this.update((ctx)=>ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) meta.controller._destroy();\n delete this._metasets[datasetIndex];\n }\n _stop() {\n let i, ilen;\n this.stop();\n $77dc20320068f1ee$export$a424a0aa8f687495.remove(this);\n for(i = 0, ilen = this.data.datasets.length; i < ilen; ++i)this._destroyDatasetMeta(i);\n }\n destroy() {\n this.notifyPlugins(\"beforeDestroy\");\n const { canvas: canvas, ctx: ctx } = this;\n this._stop();\n this.config.clearCache();\n if (canvas) {\n this.unbindEvents();\n (0, $02b6f511cc6c123c$export$c9170ad7d4cd7e57)(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n delete $77dc20320068f1ee$var$instances[this.id];\n this.notifyPlugins(\"afterDestroy\");\n }\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) this.bindResponsiveEvents();\n else this.attached = true;\n }\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const listener = (e, x, y)=>{\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this.options.events, (type)=>_add(type, listener));\n }\n bindResponsiveEvents() {\n if (!this._responsiveListeners) this._responsiveListeners = {};\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener)=>{\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n const listener = (width, height)=>{\n if (this.canvas) this.resize(width, height);\n };\n let detached;\n const attached = ()=>{\n _remove(\"attach\", attached);\n this.attached = true;\n this.resize();\n _add(\"resize\", listener);\n _add(\"detach\", detached);\n };\n detached = ()=>{\n this.attached = false;\n _remove(\"resize\", listener);\n this._stop();\n this._resize(0, 0);\n _add(\"attach\", attached);\n };\n if (platform.isAttached(this.canvas)) attached();\n else detached();\n }\n unbindEvents() {\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this._listeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this._responsiveListeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? \"set\" : \"remove\";\n let meta, item, i, ilen;\n if (mode === \"dataset\") {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller[\"_\" + prefix + \"DatasetHoverStyle\"]();\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) controller[prefix + \"HoverStyle\"](item.element, item.datasetIndex, item.index);\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({ datasetIndex: datasetIndex, index: index })=>{\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) throw new Error(\"No dataset found at index \" + datasetIndex);\n return {\n datasetIndex: datasetIndex,\n element: meta.data[index],\n index: index\n };\n });\n const changed = !(0, $02b6f511cc6c123c$export$995eb9fca571757)(active, lastActive);\n if (changed) {\n this._active = active;\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter((p)=>p.plugin.id === pluginId).length === 1;\n }\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n if (deactivated.length) this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n if (activated.length && hoverOptions.mode) this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay: replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin)=>(plugin.options.events || this.options.events).includes(e.native.type);\n if (this.notifyPlugins(\"beforeEvent\", args, eventFilter) === false) return;\n const changed = this._handleEvent(e, replay, args.inChartArea);\n args.cancelable = false;\n this.notifyPlugins(\"afterEvent\", args, eventFilter);\n if (changed || args.changed) this.render();\n return this;\n }\n _handleEvent(e, replay, inChartArea) {\n const { _active: lastActive = [], options: options } = this;\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = (0, $02b6f511cc6c123c$export$f38c853ae54ed474)(e);\n const lastEvent = $77dc20320068f1ee$var$determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n if (inChartArea) {\n this._lastEvent = null;\n (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(options.onHover, [\n e,\n active,\n this\n ], this);\n if (isClick) (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(options.onClick, [\n e,\n active,\n this\n ], this);\n }\n const changed = !(0, $02b6f511cc6c123c$export$995eb9fca571757)(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n this._lastEvent = lastEvent;\n return changed;\n }\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === \"mouseout\") return [];\n if (!inChartArea) return lastActive;\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n constructor(item, userConfig){\n const config = this.config = new $77dc20320068f1ee$var$Config(userConfig);\n const initialCanvas = $77dc20320068f1ee$var$getCanvas(item);\n const existingChart = $77dc20320068f1ee$var$getChart(initialCanvas);\n if (existingChart) throw new Error(\"Canvas is already in use. Chart with ID '\" + existingChart.id + \"'\" + \" must be destroyed before the canvas with ID '\" + existingChart.canvas.id + \"' can be reused.\");\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n this.platform = new (config.platform || $77dc20320068f1ee$export$72cd9e67b1b784f9(initialCanvas))();\n this.platform.updateConfig(config);\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n this.id = (0, $02b6f511cc6c123c$export$2219238a014317b0)();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new $77dc20320068f1ee$var$PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = (0, $02b6f511cc6c123c$export$4c3d22f3d993c33f)((mode)=>this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n $77dc20320068f1ee$var$instances[this.id] = this;\n if (!context || !canvas) {\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n $77dc20320068f1ee$export$a424a0aa8f687495.listen(this, \"complete\", $77dc20320068f1ee$var$onAnimationsComplete);\n $77dc20320068f1ee$export$a424a0aa8f687495.listen(this, \"progress\", $77dc20320068f1ee$var$onAnimationProgress);\n this._initialize();\n if (this.attached) this.update();\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$acaa6426d77a227e, \"defaults\", (0, $02b6f511cc6c123c$export$4368d992c4eafac0));\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$acaa6426d77a227e, \"instances\", $77dc20320068f1ee$var$instances);\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$acaa6426d77a227e, \"overrides\", (0, $02b6f511cc6c123c$export$6559d589eb85fbb6));\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$acaa6426d77a227e, \"registry\", $77dc20320068f1ee$export$4bb7493d241fd8a5);\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$acaa6426d77a227e, \"version\", $77dc20320068f1ee$var$version);\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$acaa6426d77a227e, \"getChart\", $77dc20320068f1ee$var$getChart);\nfunction $77dc20320068f1ee$var$invalidatePlugins() {\n return (0, $02b6f511cc6c123c$export$d66501df72047452)($77dc20320068f1ee$export$acaa6426d77a227e.instances, (chart)=>chart._plugins.invalidate());\n}\nfunction $77dc20320068f1ee$var$clipArc(ctx, element, endAngle) {\n const { startAngle: startAngle, pixelMargin: pixelMargin, x: x, y: y, outerRadius: outerRadius, innerRadius: innerRadius } = element;\n let angleMargin = pixelMargin / outerRadius;\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else ctx.arc(x, y, pixelMargin, endAngle + (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd), startAngle - (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd));\n ctx.closePath();\n ctx.clip();\n}\nfunction $77dc20320068f1ee$var$toRadiusCorners(value) {\n return (0, $02b6f511cc6c123c$export$21579262ef46735b)(value, [\n \"outerStart\",\n \"outerEnd\",\n \"innerStart\",\n \"innerEnd\"\n ]);\n}\n/**\n * Parse border radius from the provided options\n */ function $77dc20320068f1ee$var$parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n const o = $77dc20320068f1ee$var$toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val)=>{\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(o.innerStart, 0, innerLimit),\n innerEnd: (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(o.innerEnd, 0, innerLimit)\n };\n}\n/**\n * Convert (r, 𝜃) to (x, y)\n */ function $77dc20320068f1ee$var$rThetaToXY(r, theta, x, y) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta)\n };\n}\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */ function $77dc20320068f1ee$var$pathArc(ctx, element, offset, spacing, end, circular) {\n const { x: x, y: y, startAngle: start, pixelMargin: pixelMargin, innerRadius: innerR } = element;\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n let spacingOffset = 0;\n const alpha = end - start;\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n const beta = Math.max(0.001, alpha * outerRadius - offset / (0, $02b6f511cc6c123c$export$56c0d5a1e737357d)) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const { outerStart: outerStart, outerEnd: outerEnd, innerStart: innerStart, innerEnd: innerEnd } = $77dc20320068f1ee$var$parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n ctx.beginPath();\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = $77dc20320068f1ee$var$rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd));\n }\n // The line from point 3 to point 4\n const p4 = $77dc20320068f1ee$var$rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = $77dc20320068f1ee$var$rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd), innerEndAdjustedAngle + Math.PI);\n }\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2;\n ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true);\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = $77dc20320068f1ee$var$rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd));\n }\n // The line from point 7 to point 8\n const p8 = $77dc20320068f1ee$var$rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = $77dc20320068f1ee$var$rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd), outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n ctx.closePath();\n}\nfunction $77dc20320068f1ee$var$drawArc(ctx, element, offset, spacing, circular) {\n const { fullCircles: fullCircles, startAngle: startAngle, circumference: circumference } = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n $77dc20320068f1ee$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i)ctx.fill();\n if (!isNaN(circumference)) endAngle = startAngle + (circumference % (0, $02b6f511cc6c123c$export$971d5caa766a69d7) || (0, $02b6f511cc6c123c$export$971d5caa766a69d7));\n }\n $77dc20320068f1ee$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\nfunction $77dc20320068f1ee$var$drawBorder(ctx, element, offset, spacing, circular) {\n const { fullCircles: fullCircles, startAngle: startAngle, circumference: circumference, options: options } = element;\n const { borderWidth: borderWidth, borderJoinStyle: borderJoinStyle, borderDash: borderDash, borderDashOffset: borderDashOffset } = options;\n const inner = options.borderAlign === \"inner\";\n if (!borderWidth) return;\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || \"round\";\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || \"bevel\";\n }\n let endAngle = element.endAngle;\n if (fullCircles) {\n $77dc20320068f1ee$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i)ctx.stroke();\n if (!isNaN(circumference)) endAngle = startAngle + (circumference % (0, $02b6f511cc6c123c$export$971d5caa766a69d7) || (0, $02b6f511cc6c123c$export$971d5caa766a69d7));\n }\n if (inner) $77dc20320068f1ee$var$clipArc(ctx, element, endAngle);\n if (!fullCircles) {\n $77dc20320068f1ee$var$pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\nclass $77dc20320068f1ee$export$d48203c759d6a1fc extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n inRange(chartX, chartY, useFinalPosition) {\n const point = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n const { angle: angle, distance: distance } = (0, $02b6f511cc6c123c$export$96f57966bedc81b4)(point, {\n x: chartX,\n y: chartY\n });\n const { startAngle: startAngle, endAngle: endAngle, innerRadius: innerRadius, outerRadius: outerRadius, circumference: circumference } = this.getProps([\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\",\n \"circumference\"\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= (0, $02b6f511cc6c123c$export$971d5caa766a69d7) || (0, $02b6f511cc6c123c$export$ffb5f4729a158638)(angle, startAngle, endAngle);\n const withinRadius = (0, $02b6f511cc6c123c$export$3b513254972cfc9c)(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n return betweenAngles && withinRadius;\n }\n getCenterPoint(useFinalPosition) {\n const { x: x, y: y, startAngle: startAngle, endAngle: endAngle, innerRadius: innerRadius, outerRadius: outerRadius } = this.getProps([\n \"x\",\n \"y\",\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\"\n ], useFinalPosition);\n const { offset: offset, spacing: spacing } = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n tooltipPosition(useFinalPosition) {\n return this.getCenterPoint(useFinalPosition);\n }\n draw(ctx) {\n const { options: options, circumference: circumference } = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = options.borderAlign === \"inner\" ? 0.33 : 0;\n this.fullCircles = circumference > (0, $02b6f511cc6c123c$export$971d5caa766a69d7) ? Math.floor(circumference / (0, $02b6f511cc6c123c$export$971d5caa766a69d7)) : 0;\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) return;\n ctx.save();\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min((0, $02b6f511cc6c123c$export$56c0d5a1e737357d), circumference || 0));\n const radiusOffset = offset * fix;\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n $77dc20320068f1ee$var$drawArc(ctx, this, radiusOffset, spacing, circular);\n $77dc20320068f1ee$var$drawBorder(ctx, this, radiusOffset, spacing, circular);\n ctx.restore();\n }\n constructor(cfg){\n super();\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"circumference\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"endAngle\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"fullCircles\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"innerRadius\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"outerRadius\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"pixelMargin\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"startAngle\", void 0);\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$d48203c759d6a1fc, \"id\", \"arc\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$d48203c759d6a1fc, \"defaults\", {\n borderAlign: \"center\",\n borderColor: \"#fff\",\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$d48203c759d6a1fc, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\"\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$d48203c759d6a1fc, \"descriptors\", {\n _scriptable: true,\n _indexable: (name)=>name !== \"borderDash\"\n});\nfunction $77dc20320068f1ee$var$setStyle(ctx, options, style = options) {\n ctx.lineCap = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash((0, $02b6f511cc6c123c$export$90a7f3efeed30595)(style.borderDash, options.borderDash));\n ctx.lineDashOffset = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(style.borderColor, options.borderColor);\n}\nfunction $77dc20320068f1ee$var$lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\nfunction $77dc20320068f1ee$var$getLineMethod(options) {\n if (options.stepped) return 0, $02b6f511cc6c123c$export$d24c54395ce0c509;\n if (options.tension || options.cubicInterpolationMode === \"monotone\") return 0, $02b6f511cc6c123c$export$6554612db691658e;\n return $77dc20320068f1ee$var$lineTo;\n}\nfunction $77dc20320068f1ee$var$pathVars(points, segment, params = {}) {\n const count = points.length;\n const { start: paramsStart = 0, end: paramsEnd = count - 1 } = params;\n const { start: segmentStart, end: segmentEnd } = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n return {\n count: count,\n start: start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\nfunction $77dc20320068f1ee$var$pathSegment(ctx, line, segment, params) {\n const { points: points, options: options } = line;\n const { count: count, start: start, loop: loop, ilen: ilen } = $77dc20320068f1ee$var$pathVars(points, segment, params);\n const lineMethod = $77dc20320068f1ee$var$getLineMethod(options);\n let { move: move = true, reverse: reverse } = params || {};\n let i, point, prev;\n for(i = 0; i <= ilen; ++i){\n point = points[(start + (reverse ? ilen - i : i)) % count];\n if (point.skip) continue;\n else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else lineMethod(ctx, prev, point, reverse, options.stepped);\n prev = point;\n }\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n return !!loop;\n}\nfunction $77dc20320068f1ee$var$fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const { count: count, start: start, ilen: ilen } = $77dc20320068f1ee$var$pathVars(points, segment, params);\n const { move: move = true, reverse: reverse } = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n const pointIndex = (index)=>(start + (reverse ? ilen - index : index)) % count;\n const drawX = ()=>{\n if (minY !== maxY) {\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n ctx.lineTo(avgX, lastY);\n }\n };\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n for(i = 0; i <= ilen; ++i){\n point = points[pointIndex(i)];\n if (point.skip) continue;\n const x = point.x;\n const y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) minY = y;\n else if (y > maxY) maxY = y;\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n ctx.lineTo(x, y);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n lastY = y;\n }\n drawX();\n}\nfunction $77dc20320068f1ee$var$_getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== \"monotone\" && !opts.stepped && !borderDash;\n return useFastPath ? $77dc20320068f1ee$var$fastPathSegment : $77dc20320068f1ee$var$pathSegment;\n}\nfunction $77dc20320068f1ee$var$_getInterpolationMethod(options) {\n if (options.stepped) return 0, $02b6f511cc6c123c$export$7a38258bbe170828;\n if (options.tension || options.cubicInterpolationMode === \"monotone\") return 0, $02b6f511cc6c123c$export$2f6ca3d3b1f80bf5;\n return 0, $02b6f511cc6c123c$export$8a5498727ef6be21;\n}\nfunction $77dc20320068f1ee$var$strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) path.closePath();\n }\n $77dc20320068f1ee$var$setStyle(ctx, line.options);\n ctx.stroke(path);\n}\nfunction $77dc20320068f1ee$var$strokePathDirect(ctx, line, start, count) {\n const { segments: segments, options: options } = line;\n const segmentMethod = $77dc20320068f1ee$var$_getSegmentMethod(line);\n for (const segment of segments){\n $77dc20320068f1ee$var$setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {\n start: start,\n end: start + count - 1\n })) ctx.closePath();\n ctx.stroke();\n }\n}\nconst $77dc20320068f1ee$var$usePath2D = typeof Path2D === \"function\";\nfunction $77dc20320068f1ee$var$draw(ctx, line, start, count) {\n if ($77dc20320068f1ee$var$usePath2D && !line.options.segment) $77dc20320068f1ee$var$strokePathWithCache(ctx, line, start, count);\n else $77dc20320068f1ee$var$strokePathDirect(ctx, line, start, count);\n}\nclass $77dc20320068f1ee$export$55e463fa7bcd3469 extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === \"monotone\") && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n (0, $02b6f511cc6c123c$export$ab83b03e4111b1d0)(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n get points() {\n return this._points;\n }\n get segments() {\n return this._segments || (this._segments = (0, $02b6f511cc6c123c$export$1a82df3d29112e01)(this, this.options.segment));\n }\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = (0, $02b6f511cc6c123c$export$306ddfe3a8403e2)(this, {\n property: property,\n start: value,\n end: value\n });\n if (!segments.length) return;\n const result = [];\n const _interpolate = $77dc20320068f1ee$var$_getInterpolationMethod(options);\n let i, ilen;\n for(i = 0, ilen = segments.length; i < ilen; ++i){\n const { start: start, end: end } = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n pathSegment(ctx, segment, params) {\n const segmentMethod = $77dc20320068f1ee$var$_getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = $77dc20320068f1ee$var$_getSegmentMethod(this);\n let loop = this._loop;\n start = start || 0;\n count = count || this.points.length - start;\n for (const segment of segments)loop &= segmentMethod(ctx, this, segment, {\n start: start,\n end: start + count - 1\n });\n return !!loop;\n }\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n if (points.length && options.borderWidth) {\n ctx.save();\n $77dc20320068f1ee$var$draw(ctx, this, start, count);\n ctx.restore();\n }\n if (this.animated) {\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n constructor(cfg){\n super();\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$55e463fa7bcd3469, \"id\", \"line\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$55e463fa7bcd3469, \"defaults\", {\n borderCapStyle: \"butt\",\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: \"miter\",\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: \"default\",\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$55e463fa7bcd3469, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\",\n borderColor: \"borderColor\"\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$55e463fa7bcd3469, \"descriptors\", {\n _scriptable: true,\n _indexable: (name)=>name !== \"borderDash\" && name !== \"fill\"\n});\nfunction $77dc20320068f1ee$var$inRange$1(el, pos, axis, useFinalPosition) {\n const options = el.options;\n const { [axis]: value } = el.getProps([\n axis\n ], useFinalPosition);\n return Math.abs(pos - value) < options.radius + options.hitRadius;\n}\nclass $77dc20320068f1ee$export$bd159b522b230b7a extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n inRange(mouseX, mouseY, useFinalPosition) {\n const options = this.options;\n const { x: x, y: y } = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2);\n }\n inXRange(mouseX, useFinalPosition) {\n return $77dc20320068f1ee$var$inRange$1(this, mouseX, \"x\", useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return $77dc20320068f1ee$var$inRange$1(this, mouseY, \"y\", useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x: x, y: y } = this.getProps([\n \"x\",\n \"y\"\n ], useFinalPosition);\n return {\n x: x,\n y: y\n };\n }\n size(options) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n draw(ctx, area) {\n const options = this.options;\n if (this.skip || options.radius < 0.1 || !(0, $02b6f511cc6c123c$export$e7094788287c5e9b)(this, area, this.size(options) / 2)) return;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n (0, $02b6f511cc6c123c$export$493d36ec626b6698)(ctx, options, this.x, this.y);\n }\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n constructor(cfg){\n super();\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"parsed\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"skip\", void 0);\n (0, $d732417b6401265c$export$1e71eb4bef00f6b0)(this, \"stop\", void 0);\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$bd159b522b230b7a, \"id\", \"point\");\n/**\n * @type {any}\n */ (0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$bd159b522b230b7a, \"defaults\", {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: \"circle\",\n radius: 3,\n rotation: 0\n});\n/**\n * @type {any}\n */ (0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$bd159b522b230b7a, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\",\n borderColor: \"borderColor\"\n});\nfunction $77dc20320068f1ee$var$getBarBounds(bar, useFinalPosition) {\n const { x: x, y: y, base: base, width: width, height: height } = bar.getProps([\n \"x\",\n \"y\",\n \"base\",\n \"width\",\n \"height\"\n ], useFinalPosition);\n let left, right, top, bottom, half;\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n return {\n left: left,\n top: top,\n right: right,\n bottom: bottom\n };\n}\nfunction $77dc20320068f1ee$var$skipOrLimit(skip, value, min, max) {\n return skip ? 0 : (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(value, min, max);\n}\nfunction $77dc20320068f1ee$var$parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = (0, $02b6f511cc6c123c$export$d66dc83d8cfc8dd)(value);\n return {\n t: $77dc20320068f1ee$var$skipOrLimit(skip.top, o.top, 0, maxH),\n r: $77dc20320068f1ee$var$skipOrLimit(skip.right, o.right, 0, maxW),\n b: $77dc20320068f1ee$var$skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: $77dc20320068f1ee$var$skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\nfunction $77dc20320068f1ee$var$parseBorderRadius(bar, maxW, maxH) {\n const { enableBorderRadius: enableBorderRadius } = bar.getProps([\n \"enableBorderRadius\"\n ]);\n const value = bar.options.borderRadius;\n const o = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n const enableBorder = enableBorderRadius || (0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(value);\n return {\n topLeft: $77dc20320068f1ee$var$skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: $77dc20320068f1ee$var$skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: $77dc20320068f1ee$var$skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: $77dc20320068f1ee$var$skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\nfunction $77dc20320068f1ee$var$boundingRects(bar) {\n const bounds = $77dc20320068f1ee$var$getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = $77dc20320068f1ee$var$parseBorderWidth(bar, width / 2, height / 2);\n const radius = $77dc20320068f1ee$var$parseBorderRadius(bar, width / 2, height / 2);\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius: radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))\n }\n }\n };\n}\nfunction $77dc20320068f1ee$var$inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && $77dc20320068f1ee$var$getBarBounds(bar, useFinalPosition);\n return bounds && (skipX || (0, $02b6f511cc6c123c$export$3b513254972cfc9c)(x, bounds.left, bounds.right)) && (skipY || (0, $02b6f511cc6c123c$export$3b513254972cfc9c)(y, bounds.top, bounds.bottom));\n}\nfunction $77dc20320068f1ee$var$hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\nfunction $77dc20320068f1ee$var$addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction $77dc20320068f1ee$var$inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\nclass $77dc20320068f1ee$export$a16ed71bf4b07672 extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n draw(ctx) {\n const { inflateAmount: inflateAmount, options: { borderColor: borderColor, backgroundColor: backgroundColor } } = this;\n const { inner: inner, outer: outer } = $77dc20320068f1ee$var$boundingRects(this);\n const addRectPath = $77dc20320068f1ee$var$hasRadius(outer.radius) ? (0, $02b6f511cc6c123c$export$1fbe638ecf81657e) : $77dc20320068f1ee$var$addNormalRectPath;\n ctx.save();\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, $77dc20320068f1ee$var$inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, $77dc20320068f1ee$var$inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill(\"evenodd\");\n }\n ctx.beginPath();\n addRectPath(ctx, $77dc20320068f1ee$var$inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n return $77dc20320068f1ee$var$inRange(this, mouseX, mouseY, useFinalPosition);\n }\n inXRange(mouseX, useFinalPosition) {\n return $77dc20320068f1ee$var$inRange(this, mouseX, null, useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return $77dc20320068f1ee$var$inRange(this, null, mouseY, useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x: x, y: y, base: base, horizontal: horizontal } = this.getProps([\n \"x\",\n \"y\",\n \"base\",\n \"horizontal\"\n ], useFinalPosition);\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n getRange(axis) {\n return axis === \"x\" ? this.width / 2 : this.height / 2;\n }\n constructor(cfg){\n super();\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n if (cfg) Object.assign(this, cfg);\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$a16ed71bf4b07672, \"id\", \"bar\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$a16ed71bf4b07672, \"defaults\", {\n borderSkipped: \"start\",\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: \"auto\",\n pointStyle: undefined\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$a16ed71bf4b07672, \"defaultRoutes\", {\n backgroundColor: \"backgroundColor\",\n borderColor: \"borderColor\"\n});\nvar $77dc20320068f1ee$export$7a5d735b2ab6389d = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n ArcElement: $77dc20320068f1ee$export$d48203c759d6a1fc,\n BarElement: $77dc20320068f1ee$export$a16ed71bf4b07672,\n LineElement: $77dc20320068f1ee$export$55e463fa7bcd3469,\n PointElement: $77dc20320068f1ee$export$bd159b522b230b7a\n});\nconst $77dc20320068f1ee$var$BORDER_COLORS = [\n \"rgb(54, 162, 235)\",\n \"rgb(255, 99, 132)\",\n \"rgb(255, 159, 64)\",\n \"rgb(255, 205, 86)\",\n \"rgb(75, 192, 192)\",\n \"rgb(153, 102, 255)\",\n \"rgb(201, 203, 207)\" // grey\n];\n// Border colors with 50% transparency\nconst $77dc20320068f1ee$var$BACKGROUND_COLORS = /* #__PURE__ */ $77dc20320068f1ee$var$BORDER_COLORS.map((color)=>color.replace(\"rgb(\", \"rgba(\").replace(\")\", \", 0.5)\"));\nfunction $77dc20320068f1ee$var$getBorderColor(i) {\n return $77dc20320068f1ee$var$BORDER_COLORS[i % $77dc20320068f1ee$var$BORDER_COLORS.length];\n}\nfunction $77dc20320068f1ee$var$getBackgroundColor(i) {\n return $77dc20320068f1ee$var$BACKGROUND_COLORS[i % $77dc20320068f1ee$var$BACKGROUND_COLORS.length];\n}\nfunction $77dc20320068f1ee$var$colorizeDefaultDataset(dataset, i) {\n dataset.borderColor = $77dc20320068f1ee$var$getBorderColor(i);\n dataset.backgroundColor = $77dc20320068f1ee$var$getBackgroundColor(i);\n return ++i;\n}\nfunction $77dc20320068f1ee$var$colorizeDoughnutDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>$77dc20320068f1ee$var$getBorderColor(i++));\n return i;\n}\nfunction $77dc20320068f1ee$var$colorizePolarAreaDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>$77dc20320068f1ee$var$getBackgroundColor(i++));\n return i;\n}\nfunction $77dc20320068f1ee$var$getColorizer(chart) {\n let i = 0;\n return (dataset, datasetIndex)=>{\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n if (controller instanceof $77dc20320068f1ee$export$e04603e7d8b77172) i = $77dc20320068f1ee$var$colorizeDoughnutDataset(dataset, i);\n else if (controller instanceof $77dc20320068f1ee$export$2a270b3a0d973c85) i = $77dc20320068f1ee$var$colorizePolarAreaDataset(dataset, i);\n else if (controller) i = $77dc20320068f1ee$var$colorizeDefaultDataset(dataset, i);\n };\n}\nfunction $77dc20320068f1ee$var$containsColorsDefinitions(descriptors) {\n let k;\n for(k in descriptors){\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) return true;\n }\n return false;\n}\nfunction $77dc20320068f1ee$var$containsColorsDefinition(descriptor) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\nvar $77dc20320068f1ee$export$c537fa0d021d010b = {\n id: \"colors\",\n defaults: {\n enabled: true,\n forceOverride: false\n },\n beforeLayout (chart, _args, options) {\n if (!options.enabled) return;\n const { data: { datasets: datasets }, options: chartOptions } = chart.config;\n const { elements: elements } = chartOptions;\n if (!options.forceOverride && ($77dc20320068f1ee$var$containsColorsDefinitions(datasets) || $77dc20320068f1ee$var$containsColorsDefinition(chartOptions) || elements && $77dc20320068f1ee$var$containsColorsDefinitions(elements))) return;\n const colorizer = $77dc20320068f1ee$var$getColorizer(chart);\n datasets.forEach(colorizer);\n }\n};\nfunction $77dc20320068f1ee$var$lttbDecimation(data, start, count, availableWidth, options) {\n const samples = options.samples || availableWidth;\n if (samples >= count) return data.slice(start, start + count);\n const decimated = [];\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n decimated[sampledIndex++] = data[a];\n for(i = 0; i < samples - 2; i++){\n let avgX = 0;\n let avgY = 0;\n let j;\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n for(j = avgRangeStart; j < avgRangeEnd; j++){\n avgX += data[j].x;\n avgY += data[j].y;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const { x: pointAx, y: pointAy } = data[a];\n maxArea = area = -1;\n for(j = rangeOffs; j < rangeTo; j++){\n area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy));\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n decimated[sampledIndex++] = data[endIndex];\n return decimated;\n}\nfunction $77dc20320068f1ee$var$minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n for(i = start; i < start + count; ++i){\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n const lastIndex = i - 1;\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(minIndex) && !(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(maxIndex)) {\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) decimated.push({\n ...data[intermediateIndex1],\n x: avgX\n });\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n if (i > 0 && lastIndex !== startIndex) decimated.push(data[lastIndex]);\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n return decimated;\n}\nfunction $77dc20320068f1ee$var$cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, \"data\", {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data\n });\n }\n}\nfunction $77dc20320068f1ee$var$cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset)=>{\n $77dc20320068f1ee$var$cleanDecimatedDataset(dataset);\n });\n}\nfunction $77dc20320068f1ee$var$getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n let start = 0;\n let count;\n const { iScale: iScale } = meta;\n const { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = iScale.getUserBounds();\n if (minDefined) start = (0, $02b6f511cc6c123c$export$25ce5a424b770e84)((0, $02b6f511cc6c123c$export$ef35774e6d314e91)(points, iScale.axis, min).lo, 0, pointCount - 1);\n if (maxDefined) count = (0, $02b6f511cc6c123c$export$25ce5a424b770e84)((0, $02b6f511cc6c123c$export$ef35774e6d314e91)(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n else count = pointCount - start;\n return {\n start: start,\n count: count\n };\n}\nvar $77dc20320068f1ee$export$be17f937e9aa7533 = {\n id: \"decimation\",\n defaults: {\n algorithm: \"min-max\",\n enabled: false\n },\n beforeElementsUpdate: (chart, args, options)=>{\n if (!options.enabled) {\n $77dc20320068f1ee$var$cleanDecimatedData(chart);\n return;\n }\n const availableWidth = chart.width;\n chart.data.datasets.forEach((dataset, datasetIndex)=>{\n const { _data: _data, indexAxis: indexAxis } = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n if ((0, $02b6f511cc6c123c$export$407448d2b89b1813)([\n indexAxis,\n chart.options.indexAxis\n ]) === \"y\") return;\n if (!meta.controller.supportsDecimation) return;\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== \"linear\" && xAxis.type !== \"time\") return;\n if (chart.options.parsing) return;\n let { start: start, count: count } = $77dc20320068f1ee$var$getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n $77dc20320068f1ee$var$cleanDecimatedDataset(dataset);\n return;\n }\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(_data)) {\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, \"data\", {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n let decimated;\n switch(options.algorithm){\n case \"lttb\":\n decimated = $77dc20320068f1ee$var$lttbDecimation(data, start, count, availableWidth, options);\n break;\n case \"min-max\":\n decimated = $77dc20320068f1ee$var$minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n dataset._decimated = decimated;\n });\n },\n destroy (chart) {\n $77dc20320068f1ee$var$cleanDecimatedData(chart);\n }\n};\nfunction $77dc20320068f1ee$var$_segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n for (const segment of segments){\n let { start: start, end: end } = segment;\n end = $77dc20320068f1ee$var$_findSegmentEnd(start, end, points);\n const bounds = $77dc20320068f1ee$var$_getBounds(property, points[start], points[end], segment.loop);\n if (!target.segments) {\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n const targetSegments = (0, $02b6f511cc6c123c$export$306ddfe3a8403e2)(target, bounds);\n for (const tgt of targetSegments){\n const subBounds = $77dc20320068f1ee$var$_getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = (0, $02b6f511cc6c123c$export$9fa96a7d116ea3ce)(segment, points, subBounds);\n for (const fillSource of fillSources)parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: $77dc20320068f1ee$var$_getEdge(bounds, subBounds, \"start\", Math.max)\n },\n end: {\n [property]: $77dc20320068f1ee$var$_getEdge(bounds, subBounds, \"end\", Math.min)\n }\n });\n }\n }\n return parts;\n}\nfunction $77dc20320068f1ee$var$_getBounds(property, first, last, loop) {\n if (loop) return;\n let start = first[property];\n let end = last[property];\n if (property === \"angle\") {\n start = (0, $02b6f511cc6c123c$export$28f7fcd39efa255)(start);\n end = (0, $02b6f511cc6c123c$export$28f7fcd39efa255)(end);\n }\n return {\n property: property,\n start: start,\n end: end\n };\n}\nfunction $77dc20320068f1ee$var$_pointsFromSegments(boundary, line) {\n const { x: x = null, y: y = null } = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({ start: start, end: end })=>{\n end = $77dc20320068f1ee$var$_findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({\n x: first.x,\n y: y\n });\n points.push({\n x: last.x,\n y: y\n });\n } else if (x !== null) {\n points.push({\n x: x,\n y: first.y\n });\n points.push({\n x: x,\n y: last.y\n });\n }\n });\n return points;\n}\nfunction $77dc20320068f1ee$var$_findSegmentEnd(start, end, points) {\n for(; end > start; end--){\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) break;\n }\n return end;\n}\nfunction $77dc20320068f1ee$var$_getEdge(a, b, prop, fn) {\n if (a && b) return fn(a[prop], b[prop]);\n return a ? a[prop] : b ? b[prop] : 0;\n}\nfunction $77dc20320068f1ee$var$_createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n if ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(boundary)) {\n _loop = true;\n points = boundary;\n } else points = $77dc20320068f1ee$var$_pointsFromSegments(boundary, line);\n return points.length ? new $77dc20320068f1ee$export$55e463fa7bcd3469({\n points: points,\n options: {\n tension: 0\n },\n _loop: _loop,\n _fullLoop: _loop\n }) : null;\n}\nfunction $77dc20320068f1ee$var$_shouldApplyFill(source) {\n return source && source.fill !== false;\n}\nfunction $77dc20320068f1ee$var$_resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [\n index\n ];\n let target;\n if (!propagate) return fill;\n while(fill !== false && visited.indexOf(fill) === -1){\n if (!(0, $02b6f511cc6c123c$export$39b482c5e57630a8)(fill)) return fill;\n target = sources[fill];\n if (!target) return false;\n if (target.visible) return fill;\n visited.push(fill);\n fill = target.fill;\n }\n return false;\n}\nfunction $77dc20320068f1ee$var$_decodeFill(line, index, count) {\n const fill = $77dc20320068f1ee$var$parseFillOption(line);\n if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(fill)) return isNaN(fill.value) ? false : fill;\n let target = parseFloat(fill);\n if ((0, $02b6f511cc6c123c$export$39b482c5e57630a8)(target) && Math.floor(target) === target) return $77dc20320068f1ee$var$decodeTargetIndex(fill[0], index, target, count);\n return [\n \"origin\",\n \"start\",\n \"end\",\n \"stack\",\n \"shape\"\n ].indexOf(fill) >= 0 && fill;\n}\nfunction $77dc20320068f1ee$var$decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === \"-\" || firstCh === \"+\") target = index + target;\n if (target === index || target < 0 || target >= count) return false;\n return target;\n}\nfunction $77dc20320068f1ee$var$_getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === \"start\") pixel = scale.bottom;\n else if (fill === \"end\") pixel = scale.top;\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(fill)) pixel = scale.getPixelForValue(fill.value);\n else if (scale.getBasePixel) pixel = scale.getBasePixel();\n return pixel;\n}\nfunction $77dc20320068f1ee$var$_getTargetValue(fill, scale, startValue) {\n let value;\n if (fill === \"start\") value = startValue;\n else if (fill === \"end\") value = scale.options.reverse ? scale.min : scale.max;\n else if ((0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(fill)) value = fill.value;\n else value = scale.getBaseValue();\n return value;\n}\nfunction $77dc20320068f1ee$var$parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(fillOption && fillOption.target, fillOption);\n if (fill === undefined) fill = !!options.backgroundColor;\n if (fill === false || fill === null) return false;\n if (fill === true) return \"origin\";\n return fill;\n}\nfunction $77dc20320068f1ee$var$_buildStackLine(source) {\n const { scale: scale, index: index, line: line } = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = $77dc20320068f1ee$var$getLinesBelow(scale, index);\n linesBelow.push($77dc20320068f1ee$var$_createBoundaryLine({\n x: null,\n y: scale.bottom\n }, line));\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n for(let j = segment.start; j <= segment.end; j++)$77dc20320068f1ee$var$addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n return new $77dc20320068f1ee$export$55e463fa7bcd3469({\n points: points,\n options: {}\n });\n}\nfunction $77dc20320068f1ee$var$getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas(\"line\");\n for(let i = 0; i < metas.length; i++){\n const meta = metas[i];\n if (meta.index === index) break;\n if (!meta.hidden) below.unshift(meta.dataset);\n }\n return below;\n}\nfunction $77dc20320068f1ee$var$addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for(let j = 0; j < linesBelow.length; j++){\n const line = linesBelow[j];\n const { first: first, last: last, point: point } = $77dc20320068f1ee$var$findPoint(line, sourcePoint, \"x\");\n if (!point || first && last) continue;\n if (first) postponed.unshift(point);\n else {\n points.push(point);\n if (!last) break;\n }\n }\n points.push(...postponed);\n}\nfunction $77dc20320068f1ee$var$findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) return {};\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if ((0, $02b6f511cc6c123c$export$3b513254972cfc9c)(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {\n first: first,\n last: last,\n point: point\n };\n}\nclass $77dc20320068f1ee$var$simpleArc {\n pathSegment(ctx, bounds, opts) {\n const { x: x, y: y, radius: radius } = this;\n bounds = bounds || {\n start: 0,\n end: (0, $02b6f511cc6c123c$export$971d5caa766a69d7)\n };\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n interpolate(point) {\n const { x: x, y: y, radius: radius } = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle: angle\n };\n }\n constructor(opts){\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n}\nfunction $77dc20320068f1ee$var$_getTarget(source) {\n const { chart: chart, fill: fill, line: line } = source;\n if ((0, $02b6f511cc6c123c$export$39b482c5e57630a8)(fill)) return $77dc20320068f1ee$var$getLineByIndex(chart, fill);\n if (fill === \"stack\") return $77dc20320068f1ee$var$_buildStackLine(source);\n if (fill === \"shape\") return true;\n const boundary = $77dc20320068f1ee$var$computeBoundary(source);\n if (boundary instanceof $77dc20320068f1ee$var$simpleArc) return boundary;\n return $77dc20320068f1ee$var$_createBoundaryLine(boundary, line);\n}\nfunction $77dc20320068f1ee$var$getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\nfunction $77dc20320068f1ee$var$computeBoundary(source) {\n const scale = source.scale || {};\n if (scale.getPointPositionForValue) return $77dc20320068f1ee$var$computeCircularBoundary(source);\n return $77dc20320068f1ee$var$computeLinearBoundary(source);\n}\nfunction $77dc20320068f1ee$var$computeLinearBoundary(source) {\n const { scale: scale = {}, fill: fill } = source;\n const pixel = $77dc20320068f1ee$var$_getTargetPixel(fill, scale);\n if ((0, $02b6f511cc6c123c$export$39b482c5e57630a8)(pixel)) {\n const horizontal = scale.isHorizontal();\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n return null;\n}\nfunction $77dc20320068f1ee$var$computeCircularBoundary(source) {\n const { scale: scale, fill: fill } = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = $77dc20320068f1ee$var$_getTargetValue(fill, scale, start);\n const target = [];\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new $77dc20320068f1ee$var$simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n for(let i = 0; i < length; ++i)target.push(scale.getPointPositionForValue(i, value));\n return target;\n}\nfunction $77dc20320068f1ee$var$_drawfill(ctx, source, area) {\n const target = $77dc20320068f1ee$var$_getTarget(source);\n const { line: line, scale: scale, axis: axis } = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const { above: above = color, below: below = color } = fillOption || {};\n if (target && line.points.length) {\n (0, $02b6f511cc6c123c$export$8743009a87fcb00f)(ctx, area);\n $77dc20320068f1ee$var$doFill(ctx, {\n line: line,\n target: target,\n above: above,\n below: below,\n area: area,\n scale: scale,\n axis: axis\n });\n (0, $02b6f511cc6c123c$export$3d8c2f653ac9d0b9)(ctx);\n }\n}\nfunction $77dc20320068f1ee$var$doFill(ctx, cfg) {\n const { line: line, target: target, above: above, below: below, area: area, scale: scale } = cfg;\n const property = line._loop ? \"angle\" : cfg.axis;\n ctx.save();\n if (property === \"x\" && below !== above) {\n $77dc20320068f1ee$var$clipVertical(ctx, target, area.top);\n $77dc20320068f1ee$var$fill(ctx, {\n line: line,\n target: target,\n color: above,\n scale: scale,\n property: property\n });\n ctx.restore();\n ctx.save();\n $77dc20320068f1ee$var$clipVertical(ctx, target, area.bottom);\n }\n $77dc20320068f1ee$var$fill(ctx, {\n line: line,\n target: target,\n color: below,\n scale: scale,\n property: property\n });\n ctx.restore();\n}\nfunction $77dc20320068f1ee$var$clipVertical(ctx, target, clipY) {\n const { segments: segments, points: points } = target;\n let first = true;\n let lineLoop = false;\n ctx.beginPath();\n for (const segment of segments){\n const { start: start, end: end } = segment;\n const firstPoint = points[start];\n const lastPoint = points[$77dc20320068f1ee$var$_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {\n move: lineLoop\n });\n if (lineLoop) ctx.closePath();\n else ctx.lineTo(lastPoint.x, clipY);\n }\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\nfunction $77dc20320068f1ee$var$fill(ctx, cfg) {\n const { line: line, target: target, property: property, color: color, scale: scale } = cfg;\n const segments = $77dc20320068f1ee$var$_segments(line, target, property);\n for (const { source: src, target: tgt, start: start, end: end } of segments){\n const { style: { backgroundColor: backgroundColor = color } = {} } = src;\n const notShape = target !== true;\n ctx.save();\n ctx.fillStyle = backgroundColor;\n $77dc20320068f1ee$var$clipBounds(ctx, scale, notShape && $77dc20320068f1ee$var$_getBounds(property, start, end));\n ctx.beginPath();\n const lineLoop = !!line.pathSegment(ctx, src);\n let loop;\n if (notShape) {\n if (lineLoop) ctx.closePath();\n else $77dc20320068f1ee$var$interpolatedLineTo(ctx, target, end, property);\n const targetLoop = !!target.pathSegment(ctx, tgt, {\n move: lineLoop,\n reverse: true\n });\n loop = lineLoop && targetLoop;\n if (!loop) $77dc20320068f1ee$var$interpolatedLineTo(ctx, target, start, property);\n }\n ctx.closePath();\n ctx.fill(loop ? \"evenodd\" : \"nonzero\");\n ctx.restore();\n }\n}\nfunction $77dc20320068f1ee$var$clipBounds(ctx, scale, bounds) {\n const { top: top, bottom: bottom } = scale.chart.chartArea;\n const { property: property, start: start, end: end } = bounds || {};\n if (property === \"x\") {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\nfunction $77dc20320068f1ee$var$interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n}\nvar $77dc20320068f1ee$export$d19ba4d812bed757 = {\n id: \"filler\",\n afterDatasetsUpdate (chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n for(i = 0; i < count; ++i){\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n if (line && line.options && line instanceof $77dc20320068f1ee$export$55e463fa7bcd3469) source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: $77dc20320068f1ee$var$_decodeFill(line, i, count),\n chart: chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line: line\n };\n meta.$filler = source;\n sources.push(source);\n }\n for(i = 0; i < count; ++i){\n source = sources[i];\n if (!source || source.fill === false) continue;\n source.fill = $77dc20320068f1ee$var$_resolveTarget(sources, i, options.propagate);\n }\n },\n beforeDraw (chart, _args, options) {\n const draw = options.drawTime === \"beforeDraw\";\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (!source) continue;\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) $77dc20320068f1ee$var$_drawfill(chart.ctx, source, area);\n }\n },\n beforeDatasetsDraw (chart, _args, options) {\n if (options.drawTime !== \"beforeDatasetsDraw\") return;\n const metasets = chart.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if ($77dc20320068f1ee$var$_shouldApplyFill(source)) $77dc20320068f1ee$var$_drawfill(chart.ctx, source, chart.chartArea);\n }\n },\n beforeDatasetDraw (chart, args, options) {\n const source = args.meta.$filler;\n if (!$77dc20320068f1ee$var$_shouldApplyFill(source) || options.drawTime !== \"beforeDatasetDraw\") return;\n $77dc20320068f1ee$var$_drawfill(chart.ctx, source, chart.chartArea);\n },\n defaults: {\n propagate: true,\n drawTime: \"beforeDatasetDraw\"\n }\n};\nconst $77dc20320068f1ee$var$getBoxSize = (labelOpts, fontSize)=>{\n let { boxHeight: boxHeight = fontSize, boxWidth: boxWidth = fontSize } = labelOpts;\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n return {\n boxWidth: boxWidth,\n boxHeight: boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\nconst $77dc20320068f1ee$var$itemsEqual = (a, b)=>a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass $77dc20320068f1ee$var$Legend extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(labelOpts.generateLabels, [\n this.chart\n ], this) || [];\n if (labelOpts.filter) legendItems = legendItems.filter((item)=>labelOpts.filter(item, this.chart.data));\n if (labelOpts.sort) legendItems = legendItems.sort((a, b)=>labelOpts.sort(a, b, this.chart.data));\n if (this.options.reverse) legendItems.reverse();\n this.legendItems = legendItems;\n }\n fit() {\n const { options: options, ctx: ctx } = this;\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n const labelOpts = options.labels;\n const labelFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const { boxWidth: boxWidth, itemHeight: itemHeight } = $77dc20320068f1ee$var$getBoxSize(labelOpts, fontSize);\n let width, height;\n ctx.font = labelFont.string;\n if (this.isHorizontal()) {\n width = this.maxWidth;\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight;\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const { ctx: ctx, maxWidth: maxWidth, options: { labels: { padding: padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const lineWidths = this.lineWidths = [\n 0\n ];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i)=>{\n const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n hitboxes[i] = {\n left: 0,\n top: top,\n row: row,\n width: itemWidth,\n height: itemHeight\n };\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n return totalHeight;\n }\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const { ctx: ctx, maxHeight: maxHeight, options: { labels: { padding: padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n let left = 0;\n let col = 0;\n this.legendItems.forEach((legendItem, i)=>{\n const { itemWidth: itemWidth, itemHeight: itemHeight } = $77dc20320068f1ee$var$calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n hitboxes[i] = {\n left: left,\n top: currentColHeight,\n col: col,\n width: itemWidth,\n height: itemHeight\n };\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n totalWidth += currentColWidth;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n return totalWidth;\n }\n adjustHitBoxes() {\n if (!this.options.display) return;\n const titleHeight = this._computeTitleHeight();\n const { legendHitBoxes: hitboxes, options: { align: align, labels: { padding: padding }, rtl: rtl } } = this;\n const rtlHelper = (0, $02b6f511cc6c123c$export$3d12bd131bb975d1)(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes){\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes){\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n isHorizontal() {\n return this.options.position === \"top\" || this.options.position === \"bottom\";\n }\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n (0, $02b6f511cc6c123c$export$8743009a87fcb00f)(ctx, this);\n this._draw();\n (0, $02b6f511cc6c123c$export$3d8c2f653ac9d0b9)(ctx);\n }\n }\n _draw() {\n const { options: opts, columnSizes: columnSizes, lineWidths: lineWidths, ctx: ctx } = this;\n const { align: align, labels: labelOpts } = opts;\n const defaultColor = (0, $02b6f511cc6c123c$export$4368d992c4eafac0).color;\n const rtlHelper = (0, $02b6f511cc6c123c$export$3d12bd131bb975d1)(opts.rtl, this.left, this.width);\n const labelFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(labelOpts.font);\n const { padding: padding } = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n this.drawTitle();\n ctx.textAlign = rtlHelper.textAlign(\"left\");\n ctx.textBaseline = \"middle\";\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n const { boxWidth: boxWidth, boxHeight: boxHeight, itemHeight: itemHeight } = $77dc20320068f1ee$var$getBoxSize(labelOpts, fontSize);\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) return;\n ctx.save();\n const lineWidth = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.lineWidth, 1);\n ctx.fillStyle = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.fillStyle, defaultColor);\n ctx.lineCap = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.lineCap, \"butt\");\n ctx.lineDashOffset = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.lineDashOffset, 0);\n ctx.lineJoin = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.lineJoin, \"miter\");\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.strokeStyle, defaultColor);\n ctx.setLineDash((0, $02b6f511cc6c123c$export$90a7f3efeed30595)(legendItem.lineDash, []));\n if (labelOpts.usePointStyle) {\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n (0, $02b6f511cc6c123c$export$24baa2b76016ce0e)(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(legendItem.borderRadius);\n ctx.beginPath();\n if (Object.values(borderRadius).some((v)=>v !== 0)) (0, $02b6f511cc6c123c$export$1fbe638ecf81657e)(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n else ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n ctx.fill();\n if (lineWidth !== 0) ctx.stroke();\n }\n ctx.restore();\n };\n const fillText = function(x, y, legendItem) {\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) cursor = {\n x: (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n else cursor = {\n x: this.left + padding,\n y: (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n (0, $02b6f511cc6c123c$export$91c6e00c14e7e6fd)(this.ctx, opts.textDirection);\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i)=>{\n ctx.strokeStyle = legendItem.fontColor;\n ctx.fillStyle = legendItem.fontColor;\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n rtlHelper.setWidth(this.width);\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n const realX = rtlHelper.x(x);\n drawLegendBox(realX, y, legendItem);\n x = (0, $02b6f511cc6c123c$export$9d398bebfec1c039)(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n fillText(rtlHelper.x(x), y, legendItem);\n if (isHorizontal) cursor.x += width + padding;\n else if (typeof legendItem.text !== \"string\") {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += $77dc20320068f1ee$var$calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else cursor.y += lineHeight;\n });\n (0, $02b6f511cc6c123c$export$890c4ad488842ce7)(this.ctx, opts.textDirection);\n }\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(titleOpts.font);\n const titlePadding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(titleOpts.padding);\n if (!titleOpts.display) return;\n const rtlHelper = (0, $02b6f511cc6c123c$export$3d12bd131bb975d1)(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n let left = this.left;\n let maxWidth = this.width;\n if (this.isHorizontal()) {\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(opts.align, left, this.right - maxWidth);\n } else {\n const maxHeight = this.columnSizes.reduce((acc, size)=>Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n const x = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(position, left, left + maxWidth);\n ctx.textAlign = rtlHelper.textAlign((0, $02b6f511cc6c123c$export$3c2fa207a37baaea)(position));\n ctx.textBaseline = \"middle\";\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, titleOpts.text, x, y, titleFont);\n }\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(titleOpts.font);\n const titlePadding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n if ((0, $02b6f511cc6c123c$export$3b513254972cfc9c)(x, this.left, this.right) && (0, $02b6f511cc6c123c$export$3b513254972cfc9c)(y, this.top, this.bottom)) {\n lh = this.legendHitBoxes;\n for(i = 0; i < lh.length; ++i){\n hitBox = lh[i];\n if ((0, $02b6f511cc6c123c$export$3b513254972cfc9c)(x, hitBox.left, hitBox.left + hitBox.width) && (0, $02b6f511cc6c123c$export$3b513254972cfc9c)(y, hitBox.top, hitBox.top + hitBox.height)) return this.legendItems[i];\n }\n }\n return null;\n }\n handleEvent(e) {\n const opts = this.options;\n if (!$77dc20320068f1ee$var$isListened(e.type, opts)) return;\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n if (e.type === \"mousemove\" || e.type === \"mouseout\") {\n const previous = this._hoveredItem;\n const sameItem = $77dc20320068f1ee$var$itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(opts.onLeave, [\n e,\n previous,\n this\n ], this);\n this._hoveredItem = hoveredItem;\n if (hoveredItem && !sameItem) (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(opts.onHover, [\n e,\n hoveredItem,\n this\n ], this);\n } else if (hoveredItem) (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(opts.onClick, [\n e,\n hoveredItem,\n this\n ], this);\n }\n constructor(config){\n super();\n this._added = false;\n this.legendHitBoxes = [];\n this._hoveredItem = null;\n this.doughnutMode = false;\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n}\nfunction $77dc20320068f1ee$var$calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = $77dc20320068f1ee$var$calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = $77dc20320068f1ee$var$calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {\n itemWidth: itemWidth,\n itemHeight: itemHeight\n };\n}\nfunction $77dc20320068f1ee$var$calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== \"string\") legendItemText = legendItemText.reduce((a, b)=>a.length > b.length ? a : b);\n return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width;\n}\nfunction $77dc20320068f1ee$var$calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== \"string\") itemHeight = $77dc20320068f1ee$var$calculateLegendItemHeight(legendItem, fontLineHeight);\n return itemHeight;\n}\nfunction $77dc20320068f1ee$var$calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\nfunction $77dc20320068f1ee$var$isListened(type, opts) {\n if ((type === \"mousemove\" || type === \"mouseout\") && (opts.onHover || opts.onLeave)) return true;\n if (opts.onClick && (type === \"click\" || type === \"mouseup\")) return true;\n return false;\n}\nvar $77dc20320068f1ee$export$ed247974535929c7 = {\n id: \"legend\",\n _element: $77dc20320068f1ee$var$Legend,\n start (chart, _args, options) {\n const legend = chart.legend = new $77dc20320068f1ee$var$Legend({\n ctx: chart.ctx,\n options: options,\n chart: chart\n });\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(chart, legend, options);\n $77dc20320068f1ee$export$1ecca0613f5e56d2.addBox(chart, legend);\n },\n stop (chart) {\n $77dc20320068f1ee$export$1ecca0613f5e56d2.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n beforeUpdate (chart, _args, options) {\n const legend = chart.legend;\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(chart, legend, options);\n legend.options = options;\n },\n afterUpdate (chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n afterEvent (chart, args) {\n if (!args.replay) chart.legend.handleEvent(args.event);\n },\n defaults: {\n display: true,\n position: \"top\",\n align: \"center\",\n fullSize: true,\n reverse: false,\n weight: 1000,\n onClick (e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n onHover: null,\n onLeave: null,\n labels: {\n color: (ctx)=>ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n generateLabels (chart) {\n const datasets = chart.data.datasets;\n const { labels: { usePointStyle: usePointStyle, pointStyle: pointStyle, textAlign: textAlign, color: color, useBorderRadius: useBorderRadius, borderRadius: borderRadius } } = chart.legend.options;\n return chart._getSortedDatasetMetas().map((meta)=>{\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(style.borderWidth);\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n title: {\n color: (ctx)=>ctx.chart.options.color,\n display: false,\n position: \"center\",\n text: \"\"\n }\n },\n descriptors: {\n _scriptable: (name)=>!name.startsWith(\"on\"),\n labels: {\n _scriptable: (name)=>![\n \"generateLabels\",\n \"filter\",\n \"sort\"\n ].includes(name)\n }\n }\n};\nclass $77dc20320068f1ee$var$Title extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n update(maxWidth, maxHeight) {\n const opts = this.options;\n this.left = 0;\n this.top = 0;\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n const lineCount = (0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(opts.text) ? opts.text.length : 1;\n this._padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(opts.padding);\n const textSize = lineCount * (0, $02b6f511cc6c123c$export$34aec0b863436764)(opts.font).lineHeight + this._padding.height;\n if (this.isHorizontal()) this.height = textSize;\n else this.width = textSize;\n }\n isHorizontal() {\n const pos = this.options.position;\n return pos === \"top\" || pos === \"bottom\";\n }\n _drawArgs(offset) {\n const { top: top, left: left, bottom: bottom, right: right, options: options } = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n if (this.isHorizontal()) {\n titleX = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === \"left\") {\n titleX = left + offset;\n titleY = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, bottom, top);\n rotation = (0, $02b6f511cc6c123c$export$56c0d5a1e737357d) * -0.5;\n } else {\n titleX = right - offset;\n titleY = (0, $02b6f511cc6c123c$export$ce26c07117d59d6a)(align, top, bottom);\n rotation = (0, $02b6f511cc6c123c$export$56c0d5a1e737357d) * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {\n titleX: titleX,\n titleY: titleY,\n maxWidth: maxWidth,\n rotation: rotation\n };\n }\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n if (!opts.display) return;\n const fontOpts = (0, $02b6f511cc6c123c$export$34aec0b863436764)(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const { titleX: titleX, titleY: titleY, maxWidth: maxWidth, rotation: rotation } = this._drawArgs(offset);\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth: maxWidth,\n rotation: rotation,\n textAlign: (0, $02b6f511cc6c123c$export$3c2fa207a37baaea)(opts.align),\n textBaseline: \"middle\",\n translation: [\n titleX,\n titleY\n ]\n });\n }\n constructor(config){\n super();\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n}\nfunction $77dc20320068f1ee$var$createTitle(chart, titleOpts) {\n const title = new $77dc20320068f1ee$var$Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart: chart\n });\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(chart, title, titleOpts);\n $77dc20320068f1ee$export$1ecca0613f5e56d2.addBox(chart, title);\n chart.titleBlock = title;\n}\nvar $77dc20320068f1ee$export$f99233281efd08a0 = {\n id: \"title\",\n _element: $77dc20320068f1ee$var$Title,\n start (chart, _args, options) {\n $77dc20320068f1ee$var$createTitle(chart, options);\n },\n stop (chart) {\n const titleBlock = chart.titleBlock;\n $77dc20320068f1ee$export$1ecca0613f5e56d2.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n beforeUpdate (chart, _args, options) {\n const title = chart.titleBlock;\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: \"center\",\n display: false,\n font: {\n weight: \"bold\"\n },\n fullSize: true,\n padding: 10,\n position: \"top\",\n text: \"\",\n weight: 2000\n },\n defaultRoutes: {\n color: \"color\"\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\nconst $77dc20320068f1ee$var$map = new WeakMap();\nvar $77dc20320068f1ee$export$d5c56664638992a4 = {\n id: \"subtitle\",\n start (chart, _args, options) {\n const title = new $77dc20320068f1ee$var$Title({\n ctx: chart.ctx,\n options: options,\n chart: chart\n });\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(chart, title, options);\n $77dc20320068f1ee$export$1ecca0613f5e56d2.addBox(chart, title);\n $77dc20320068f1ee$var$map.set(chart, title);\n },\n stop (chart) {\n $77dc20320068f1ee$export$1ecca0613f5e56d2.removeBox(chart, $77dc20320068f1ee$var$map.get(chart));\n $77dc20320068f1ee$var$map.delete(chart);\n },\n beforeUpdate (chart, _args, options) {\n const title = $77dc20320068f1ee$var$map.get(chart);\n $77dc20320068f1ee$export$1ecca0613f5e56d2.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: \"center\",\n display: false,\n font: {\n weight: \"normal\"\n },\n fullSize: true,\n padding: 0,\n position: \"top\",\n text: \"\",\n weight: 1500\n },\n defaultRoutes: {\n color: \"color\"\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\nconst $77dc20320068f1ee$var$positioners = {\n average (items) {\n if (!items.length) return false;\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n return {\n x: x / count,\n y: y / count\n };\n },\n nearest (items, eventPosition) {\n if (!items.length) return false;\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = (0, $02b6f511cc6c123c$export$158acd800e1ef08b)(eventPosition, center);\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n return {\n x: x,\n y: y\n };\n }\n};\nfunction $77dc20320068f1ee$var$pushOrConcat(base, toPush) {\n if (toPush) {\n if ((0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(toPush)) Array.prototype.push.apply(base, toPush);\n else base.push(toPush);\n }\n return base;\n}\nfunction $77dc20320068f1ee$var$splitNewlines(str) {\n if ((typeof str === \"string\" || str instanceof String) && str.indexOf(\"\\n\") > -1) return str.split(\"\\n\");\n return str;\n}\nfunction $77dc20320068f1ee$var$createTooltipItem(chart, item) {\n const { element: element, datasetIndex: datasetIndex, index: index } = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const { label: label, value: value } = controller.getLabelAndValue(index);\n return {\n chart: chart,\n label: label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex: datasetIndex,\n element: element\n };\n}\nfunction $77dc20320068f1ee$var$getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const { body: body, footer: footer, title: title } = tooltip;\n const { boxWidth: boxWidth, boxHeight: boxHeight } = options;\n const bodyFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.bodyFont);\n const titleFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.titleFont);\n const footerFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(options.padding);\n let height = padding.height;\n let width = 0;\n let combinedBodyLength = body.reduce((count, bodyItem)=>count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n if (titleLineCount) height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;\n if (combinedBodyLength) {\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n ctx.save();\n ctx.font = titleFont.string;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(tooltip.title, maxLineWidth);\n ctx.font = bodyFont.string;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(body, (bodyItem)=>{\n (0, $02b6f511cc6c123c$export$d66501df72047452)(bodyItem.before, maxLineWidth);\n (0, $02b6f511cc6c123c$export$d66501df72047452)(bodyItem.lines, maxLineWidth);\n (0, $02b6f511cc6c123c$export$d66501df72047452)(bodyItem.after, maxLineWidth);\n });\n widthPadding = 0;\n ctx.font = footerFont.string;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(tooltip.footer, maxLineWidth);\n ctx.restore();\n width += padding.width;\n return {\n width: width,\n height: height\n };\n}\nfunction $77dc20320068f1ee$var$determineYAlign(chart, size) {\n const { y: y, height: height } = size;\n if (y < height / 2) return \"top\";\n else if (y > chart.height - height / 2) return \"bottom\";\n return \"center\";\n}\nfunction $77dc20320068f1ee$var$doesNotFitWithAlign(xAlign, chart, options, size) {\n const { x: x, width: width } = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === \"left\" && x + width + caret > chart.width) return true;\n if (xAlign === \"right\" && x - width - caret < 0) return true;\n}\nfunction $77dc20320068f1ee$var$determineXAlign(chart, options, size, yAlign) {\n const { x: x, width: width } = size;\n const { width: chartWidth, chartArea: { left: left, right: right } } = chart;\n let xAlign = \"center\";\n if (yAlign === \"center\") xAlign = x <= (left + right) / 2 ? \"left\" : \"right\";\n else if (x <= width / 2) xAlign = \"left\";\n else if (x >= chartWidth - width / 2) xAlign = \"right\";\n if ($77dc20320068f1ee$var$doesNotFitWithAlign(xAlign, chart, options, size)) xAlign = \"center\";\n return xAlign;\n}\nfunction $77dc20320068f1ee$var$determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || $77dc20320068f1ee$var$determineYAlign(chart, size);\n return {\n xAlign: size.xAlign || options.xAlign || $77dc20320068f1ee$var$determineXAlign(chart, options, size, yAlign),\n yAlign: yAlign\n };\n}\nfunction $77dc20320068f1ee$var$alignX(size, xAlign) {\n let { x: x, width: width } = size;\n if (xAlign === \"right\") x -= width;\n else if (xAlign === \"center\") x -= width / 2;\n return x;\n}\nfunction $77dc20320068f1ee$var$alignY(size, yAlign, paddingAndSize) {\n let { y: y, height: height } = size;\n if (yAlign === \"top\") y += paddingAndSize;\n else if (yAlign === \"bottom\") y -= height + paddingAndSize;\n else y -= height / 2;\n return y;\n}\nfunction $77dc20320068f1ee$var$getBackgroundPoint(options, size, alignment, chart) {\n const { caretSize: caretSize, caretPadding: caretPadding, cornerRadius: cornerRadius } = options;\n const { xAlign: xAlign, yAlign: yAlign } = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const { topLeft: topLeft, topRight: topRight, bottomLeft: bottomLeft, bottomRight: bottomRight } = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(cornerRadius);\n let x = $77dc20320068f1ee$var$alignX(size, xAlign);\n const y = $77dc20320068f1ee$var$alignY(size, yAlign, paddingAndSize);\n if (yAlign === \"center\") {\n if (xAlign === \"left\") x += paddingAndSize;\n else if (xAlign === \"right\") x -= paddingAndSize;\n } else if (xAlign === \"left\") x -= Math.max(topLeft, bottomLeft) + caretSize;\n else if (xAlign === \"right\") x += Math.max(topRight, bottomRight) + caretSize;\n return {\n x: (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(x, 0, chart.width - size.width),\n y: (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(y, 0, chart.height - size.height)\n };\n}\nfunction $77dc20320068f1ee$var$getAlignedX(tooltip, align, options) {\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(options.padding);\n return align === \"center\" ? tooltip.x + tooltip.width / 2 : align === \"right\" ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;\n}\nfunction $77dc20320068f1ee$var$getBeforeAfterBodyLines(callback) {\n return $77dc20320068f1ee$var$pushOrConcat([], $77dc20320068f1ee$var$splitNewlines(callback));\n}\nfunction $77dc20320068f1ee$var$createTooltipContext(parent, tooltip, tooltipItems) {\n return (0, $02b6f511cc6c123c$export$35e795649ee09318)(parent, {\n tooltip: tooltip,\n tooltipItems: tooltipItems,\n type: \"tooltip\"\n });\n}\nfunction $77dc20320068f1ee$var$overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\nconst $77dc20320068f1ee$var$defaultCallbacks = {\n beforeTitle: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n title (tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n if (this && this.options && this.options.mode === \"dataset\") return item.dataset.label || \"\";\n else if (item.label) return item.label;\n else if (labelCount > 0 && item.dataIndex < labelCount) return labels[item.dataIndex];\n }\n return \"\";\n },\n afterTitle: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n beforeBody: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n beforeLabel: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n label (tooltipItem) {\n if (this && this.options && this.options.mode === \"dataset\") return tooltipItem.label + \": \" + tooltipItem.formattedValue || tooltipItem.formattedValue;\n let label = tooltipItem.dataset.label || \"\";\n if (label) label += \": \";\n const value = tooltipItem.formattedValue;\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(value)) label += value;\n return label;\n },\n labelColor (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0\n };\n },\n labelTextColor () {\n return this.options.bodyColor;\n },\n labelPointStyle (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation\n };\n },\n afterLabel: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n afterBody: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n beforeFooter: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n footer: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46),\n afterFooter: (0, $02b6f511cc6c123c$export$cf2f7c5792f80b46)\n};\nfunction $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n if (typeof result === \"undefined\") return $77dc20320068f1ee$var$defaultCallbacks[name].call(ctx, arg);\n return result;\n}\nclass $77dc20320068f1ee$var$Tooltip extends $77dc20320068f1ee$export$db77ccec0bb4ccac {\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n if (cached) return cached;\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new $77dc20320068f1ee$export$8ab227dac26677d(this.chart, opts);\n if (opts._cacheable) this._cachedAnimations = Object.freeze(animations);\n return animations;\n }\n getContext() {\n return this.$context || (this.$context = $77dc20320068f1ee$var$createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n getTitle(context, options) {\n const { callbacks: callbacks } = options;\n const beforeTitle = $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, \"beforeTitle\", this, context);\n const title = $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, \"title\", this, context);\n const afterTitle = $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, \"afterTitle\", this, context);\n let lines = [];\n lines = $77dc20320068f1ee$var$pushOrConcat(lines, $77dc20320068f1ee$var$splitNewlines(beforeTitle));\n lines = $77dc20320068f1ee$var$pushOrConcat(lines, $77dc20320068f1ee$var$splitNewlines(title));\n lines = $77dc20320068f1ee$var$pushOrConcat(lines, $77dc20320068f1ee$var$splitNewlines(afterTitle));\n return lines;\n }\n getBeforeBody(tooltipItems, options) {\n return $77dc20320068f1ee$var$getBeforeAfterBodyLines($77dc20320068f1ee$var$invokeCallbackWithFallback(options.callbacks, \"beforeBody\", this, tooltipItems));\n }\n getBody(tooltipItems, options) {\n const { callbacks: callbacks } = options;\n const bodyItems = [];\n (0, $02b6f511cc6c123c$export$d66501df72047452)(tooltipItems, (context)=>{\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = $77dc20320068f1ee$var$overrideCallbacks(callbacks, context);\n $77dc20320068f1ee$var$pushOrConcat(bodyItem.before, $77dc20320068f1ee$var$splitNewlines($77dc20320068f1ee$var$invokeCallbackWithFallback(scoped, \"beforeLabel\", this, context)));\n $77dc20320068f1ee$var$pushOrConcat(bodyItem.lines, $77dc20320068f1ee$var$invokeCallbackWithFallback(scoped, \"label\", this, context));\n $77dc20320068f1ee$var$pushOrConcat(bodyItem.after, $77dc20320068f1ee$var$splitNewlines($77dc20320068f1ee$var$invokeCallbackWithFallback(scoped, \"afterLabel\", this, context)));\n bodyItems.push(bodyItem);\n });\n return bodyItems;\n }\n getAfterBody(tooltipItems, options) {\n return $77dc20320068f1ee$var$getBeforeAfterBodyLines($77dc20320068f1ee$var$invokeCallbackWithFallback(options.callbacks, \"afterBody\", this, tooltipItems));\n }\n getFooter(tooltipItems, options) {\n const { callbacks: callbacks } = options;\n const beforeFooter = $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, \"beforeFooter\", this, tooltipItems);\n const footer = $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, \"footer\", this, tooltipItems);\n const afterFooter = $77dc20320068f1ee$var$invokeCallbackWithFallback(callbacks, \"afterFooter\", this, tooltipItems);\n let lines = [];\n lines = $77dc20320068f1ee$var$pushOrConcat(lines, $77dc20320068f1ee$var$splitNewlines(beforeFooter));\n lines = $77dc20320068f1ee$var$pushOrConcat(lines, $77dc20320068f1ee$var$splitNewlines(footer));\n lines = $77dc20320068f1ee$var$pushOrConcat(lines, $77dc20320068f1ee$var$splitNewlines(afterFooter));\n return lines;\n }\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n for(i = 0, len = active.length; i < len; ++i)tooltipItems.push($77dc20320068f1ee$var$createTooltipItem(this.chart, active[i]));\n if (options.filter) tooltipItems = tooltipItems.filter((element, index, array)=>options.filter(element, index, array, data));\n if (options.itemSort) tooltipItems = tooltipItems.sort((a, b)=>options.itemSort(a, b, data));\n (0, $02b6f511cc6c123c$export$d66501df72047452)(tooltipItems, (context)=>{\n const scoped = $77dc20320068f1ee$var$overrideCallbacks(options.callbacks, context);\n labelColors.push($77dc20320068f1ee$var$invokeCallbackWithFallback(scoped, \"labelColor\", this, context));\n labelPointStyles.push($77dc20320068f1ee$var$invokeCallbackWithFallback(scoped, \"labelPointStyle\", this, context));\n labelTextColors.push($77dc20320068f1ee$var$invokeCallbackWithFallback(scoped, \"labelTextColor\", this, context));\n });\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n if (!active.length) {\n if (this.opacity !== 0) properties = {\n opacity: 0\n };\n } else {\n const position = $77dc20320068f1ee$var$positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n const size = this._size = $77dc20320068f1ee$var$getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = $77dc20320068f1ee$var$determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = $77dc20320068f1ee$var$getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n if (properties) this._resolveAnimations().update(this, properties);\n if (changed && options.external) options.external.call(this, {\n chart: this.chart,\n tooltip: this,\n replay: replay\n });\n }\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n getCaretPosition(tooltipPoint, size, options) {\n const { xAlign: xAlign, yAlign: yAlign } = this;\n const { caretSize: caretSize, cornerRadius: cornerRadius } = options;\n const { topLeft: topLeft, topRight: topRight, bottomLeft: bottomLeft, bottomRight: bottomRight } = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(cornerRadius);\n const { x: ptX, y: ptY } = tooltipPoint;\n const { width: width, height: height } = size;\n let x1, x2, x3, y1, y2, y3;\n if (yAlign === \"center\") {\n y2 = ptY + height / 2;\n if (xAlign === \"left\") {\n x1 = ptX;\n x2 = x1 - caretSize;\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n x3 = x1;\n } else {\n if (xAlign === \"left\") x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize;\n else if (xAlign === \"right\") x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n else x2 = this.caretX;\n if (yAlign === \"top\") {\n y1 = ptY;\n y2 = y1 - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {\n x1: x1,\n x2: x2,\n x3: x3,\n y1: y1,\n y2: y2,\n y3: y3\n };\n }\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n if (length) {\n const rtlHelper = (0, $02b6f511cc6c123c$export$3d12bd131bb975d1)(options.rtl, this.x, this.width);\n pt.x = $77dc20320068f1ee$var$getAlignedX(this, options.titleAlign, options);\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = \"middle\";\n titleFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.titleFont);\n titleSpacing = options.titleSpacing;\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing;\n if (i + 1 === length) pt.y += options.titleMarginBottom - titleSpacing;\n }\n }\n }\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const { boxHeight: boxHeight, boxWidth: boxWidth } = options;\n const bodyFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.bodyFont);\n const colorX = $77dc20320068f1ee$var$getAlignedX(this, \"left\", options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2,\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n (0, $02b6f511cc6c123c$export$493d36ec626b6698)(ctx, drawOptions, centerX, centerY);\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n (0, $02b6f511cc6c123c$export$493d36ec626b6698)(ctx, drawOptions, centerX, centerY);\n } else {\n ctx.lineWidth = (0, $02b6f511cc6c123c$export$23f2a1d2818174ef)(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1;\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(labelColor.borderRadius);\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n (0, $02b6f511cc6c123c$export$1fbe638ecf81657e)(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n (0, $02b6f511cc6c123c$export$1fbe638ecf81657e)(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n ctx.fillStyle = this.labelTextColors[i];\n }\n drawBody(pt, ctx, options) {\n const { body: body } = this;\n const { bodySpacing: bodySpacing, bodyAlign: bodyAlign, displayColors: displayColors, boxHeight: boxHeight, boxWidth: boxWidth, boxPadding: boxPadding } = options;\n const bodyFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n const rtlHelper = (0, $02b6f511cc6c123c$export$3d12bd131bb975d1)(options.rtl, this.x, this.width);\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = \"middle\";\n ctx.font = bodyFont.string;\n pt.x = $77dc20320068f1ee$var$getAlignedX(this, bodyAlignForCalculation, options);\n ctx.fillStyle = options.bodyColor;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this.beforeBody, fillLineOfText);\n xLinePadding = displayColors && bodyAlignForCalculation !== \"right\" ? bodyAlign === \"center\" ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;\n for(i = 0, ilen = body.length; i < ilen; ++i){\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n ctx.fillStyle = textColor;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(bodyItem.before, fillLineOfText);\n lines = bodyItem.lines;\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n for(j = 0, jlen = lines.length; j < jlen; ++j){\n fillLineOfText(lines[j]);\n bodyLineHeight = bodyFont.lineHeight;\n }\n (0, $02b6f511cc6c123c$export$d66501df72047452)(bodyItem.after, fillLineOfText);\n }\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n (0, $02b6f511cc6c123c$export$d66501df72047452)(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing;\n }\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n if (length) {\n const rtlHelper = (0, $02b6f511cc6c123c$export$3d12bd131bb975d1)(options.rtl, this.x, this.width);\n pt.x = $77dc20320068f1ee$var$getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = \"middle\";\n footerFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(options.footerFont);\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n drawBackground(pt, ctx, tooltipSize, options) {\n const { xAlign: xAlign, yAlign: yAlign } = this;\n const { x: x, y: y } = pt;\n const { width: width, height: height } = tooltipSize;\n const { topLeft: topLeft, topRight: topRight, bottomLeft: bottomLeft, bottomRight: bottomRight } = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(options.cornerRadius);\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === \"top\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === \"center\" && xAlign === \"right\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === \"bottom\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === \"center\" && xAlign === \"left\") this.drawCaret(pt, ctx, tooltipSize, options);\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n ctx.fill();\n if (options.borderWidth > 0) ctx.stroke();\n }\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = $77dc20320068f1ee$var$positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) return;\n const size = this._size = $77dc20320068f1ee$var$getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = $77dc20320068f1ee$var$determineAlignment(chart, options, positionAndSize);\n const point = $77dc20320068f1ee$var$getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n _willRender() {\n return !!this.opacity;\n }\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n if (!opacity) return;\n this._updateAnimationTarget(options);\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(options.padding);\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n this.drawBackground(pt, ctx, tooltipSize, options);\n (0, $02b6f511cc6c123c$export$91c6e00c14e7e6fd)(ctx, options.textDirection);\n pt.y += padding.top;\n this.drawTitle(pt, ctx, options);\n this.drawBody(pt, ctx, options);\n this.drawFooter(pt, ctx, options);\n (0, $02b6f511cc6c123c$export$890c4ad488842ce7)(ctx, options.textDirection);\n ctx.restore();\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({ datasetIndex: datasetIndex, index: index })=>{\n const meta = this.chart.getDatasetMeta(datasetIndex);\n if (!meta) throw new Error(\"Cannot find a dataset at index \" + datasetIndex);\n return {\n datasetIndex: datasetIndex,\n element: meta.data[index],\n index: index\n };\n });\n const changed = !(0, $02b6f511cc6c123c$export$995eb9fca571757)(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) return false;\n this._ignoreReplayEvents = false;\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n const positionChanged = this._positionChanged(active, e);\n const changed = replay || !(0, $02b6f511cc6c123c$export$995eb9fca571757)(active, lastActive) || positionChanged;\n if (changed) {\n this._active = active;\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n this.update(true, replay);\n }\n }\n return changed;\n }\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n if (e.type === \"mouseout\") return [];\n if (!inChartArea) return lastActive;\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n if (options.reverse) active.reverse();\n return active;\n }\n _positionChanged(active, e) {\n const { caretX: caretX, caretY: caretY, options: options } = this;\n const position = $77dc20320068f1ee$var$positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n constructor(config){\n super();\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$var$Tooltip, \"positioners\", $77dc20320068f1ee$var$positioners);\nvar $77dc20320068f1ee$export$28c660c63b792dea = {\n id: \"tooltip\",\n _element: $77dc20320068f1ee$var$Tooltip,\n positioners: $77dc20320068f1ee$var$positioners,\n afterInit (chart, _args, options) {\n if (options) chart.tooltip = new $77dc20320068f1ee$var$Tooltip({\n chart: chart,\n options: options\n });\n },\n beforeUpdate (chart, _args, options) {\n if (chart.tooltip) chart.tooltip.initialize(options);\n },\n reset (chart, _args, options) {\n if (chart.tooltip) chart.tooltip.initialize(options);\n },\n afterDraw (chart) {\n const tooltip = chart.tooltip;\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip: tooltip\n };\n if (chart.notifyPlugins(\"beforeTooltipDraw\", {\n ...args,\n cancelable: true\n }) === false) return;\n tooltip.draw(chart.ctx);\n chart.notifyPlugins(\"afterTooltipDraw\", args);\n }\n },\n afterEvent (chart, args) {\n if (chart.tooltip) {\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) args.changed = true;\n }\n },\n defaults: {\n enabled: true,\n external: null,\n position: \"average\",\n backgroundColor: \"rgba(0,0,0,0.8)\",\n titleColor: \"#fff\",\n titleFont: {\n weight: \"bold\"\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: \"left\",\n bodyColor: \"#fff\",\n bodySpacing: 2,\n bodyFont: {},\n bodyAlign: \"left\",\n footerColor: \"#fff\",\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: \"bold\"\n },\n footerAlign: \"left\",\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts)=>opts.bodyFont.size,\n boxWidth: (ctx, opts)=>opts.bodyFont.size,\n multiKeyBackground: \"#fff\",\n displayColors: true,\n boxPadding: 0,\n borderColor: \"rgba(0,0,0,0)\",\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: \"easeOutQuart\"\n },\n animations: {\n numbers: {\n type: \"number\",\n properties: [\n \"x\",\n \"y\",\n \"width\",\n \"height\",\n \"caretX\",\n \"caretY\"\n ]\n },\n opacity: {\n easing: \"linear\",\n duration: 200\n }\n },\n callbacks: $77dc20320068f1ee$var$defaultCallbacks\n },\n defaultRoutes: {\n bodyFont: \"font\",\n footerFont: \"font\",\n titleFont: \"font\"\n },\n descriptors: {\n _scriptable: (name)=>name !== \"filter\" && name !== \"itemSort\" && name !== \"external\",\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: \"animation\"\n }\n },\n additionalOptionScopes: [\n \"interaction\"\n ]\n};\nvar $77dc20320068f1ee$export$8b3ca321c77fdea6 = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n Colors: $77dc20320068f1ee$export$c537fa0d021d010b,\n Decimation: $77dc20320068f1ee$export$be17f937e9aa7533,\n Filler: $77dc20320068f1ee$export$d19ba4d812bed757,\n Legend: $77dc20320068f1ee$export$ed247974535929c7,\n SubTitle: $77dc20320068f1ee$export$d5c56664638992a4,\n Title: $77dc20320068f1ee$export$f99233281efd08a0,\n Tooltip: $77dc20320068f1ee$export$28c660c63b792dea\n});\nconst $77dc20320068f1ee$var$addIfString = (labels, raw, index, addedLabels)=>{\n if (typeof raw === \"string\") {\n index = labels.push(raw) - 1;\n addedLabels.unshift({\n index: index,\n label: raw\n });\n } else if (isNaN(raw)) index = null;\n return index;\n};\nfunction $77dc20320068f1ee$var$findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) return $77dc20320068f1ee$var$addIfString(labels, raw, index, addedLabels);\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\nconst $77dc20320068f1ee$var$validIndex = (index, max)=>index === null ? null : (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(Math.round(index), 0, max);\nfunction $77dc20320068f1ee$var$_getLabelForValue(value) {\n const labels = this.getLabels();\n if (value >= 0 && value < labels.length) return labels[value];\n return value;\n}\nclass $77dc20320068f1ee$export$29e663ba4d09fe7 extends $77dc20320068f1ee$export$d60cfc58d3c358b6 {\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const { index: index, label: label } of added)if (labels[index] === label) labels.splice(index, 1);\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n parse(raw, index) {\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(raw)) return null;\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index : $77dc20320068f1ee$var$findOrAddLabel(labels, raw, (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(index, raw), this._addedLabels);\n return $77dc20320068f1ee$var$validIndex(index, labels.length - 1);\n }\n determineDataLimits() {\n const { minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let { min: min, max: max } = this.getMinMax(true);\n if (this.options.bounds === \"ticks\") {\n if (!minDefined) min = 0;\n if (!maxDefined) max = this.getLabels().length - 1;\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1);\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n for(let value = min; value <= max; value++)ticks.push({\n value: value\n });\n return ticks;\n }\n getLabelForValue(value) {\n return $77dc20320068f1ee$var$_getLabelForValue.call(this, value);\n }\n configure() {\n super.configure();\n if (!this.isHorizontal()) this._reversePixels = !this._reversePixels;\n }\n getPixelForValue(value) {\n if (typeof value !== \"number\") value = this.parse(value);\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) return null;\n return this.getPixelForValue(ticks[index].value);\n }\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n getBasePixel() {\n return this.bottom;\n }\n constructor(cfg){\n super(cfg);\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$29e663ba4d09fe7, \"id\", \"category\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$29e663ba4d09fe7, \"defaults\", {\n ticks: {\n callback: $77dc20320068f1ee$var$_getLabelForValue\n }\n});\nfunction $77dc20320068f1ee$var$generateTicks$1(generationOptions, dataRange) {\n const ticks = [];\n const MIN_SPACING = 1e-14;\n const { bounds: bounds, step: step, min: min, max: max, precision: precision, count: count, maxTicks: maxTicks, maxDigits: maxDigits, includeBounds: includeBounds } = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const { min: rmin, max: rmax } = dataRange;\n const minDefined = !(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(min);\n const maxDefined = !(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(max);\n const countDefined = !(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = (0, $02b6f511cc6c123c$export$a33b77bbdbb8366c)((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) return [\n {\n value: rmin\n },\n {\n value: rmax\n }\n ];\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) spacing = (0, $02b6f511cc6c123c$export$a33b77bbdbb8366c)(numSpaces * spacing / maxSpaces / unit) * unit;\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(precision)) {\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n if (bounds === \"ticks\") {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n if (minDefined && maxDefined && step && (0, $02b6f511cc6c123c$export$b9a6b53f9be3734)((max - min) / step, spacing / 1000)) {\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n numSpaces = (niceMax - niceMin) / spacing;\n if ((0, $02b6f511cc6c123c$export$a05254e7c3aeba6e)(numSpaces, Math.round(numSpaces), spacing / 1000)) numSpaces = Math.round(numSpaces);\n else numSpaces = Math.ceil(numSpaces);\n }\n const decimalPlaces = Math.max((0, $02b6f511cc6c123c$export$23ebac1979863676)(spacing), (0, $02b6f511cc6c123c$export$23ebac1979863676)(niceMin));\n factor = Math.pow(10, (0, $02b6f511cc6c123c$export$342063e11d6c3cad)(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({\n value: min\n });\n if (niceMin < min) j++;\n if ((0, $02b6f511cc6c123c$export$a05254e7c3aeba6e)(Math.round((niceMin + j * spacing) * factor) / factor, min, $77dc20320068f1ee$var$relativeLabelSize(min, minSpacing, generationOptions))) j++;\n } else if (niceMin < min) j++;\n }\n for(; j < numSpaces; ++j){\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) break;\n ticks.push({\n value: tickValue\n });\n }\n if (maxDefined && includeBounds && niceMax !== max) {\n if (ticks.length && (0, $02b6f511cc6c123c$export$a05254e7c3aeba6e)(ticks[ticks.length - 1].value, max, $77dc20320068f1ee$var$relativeLabelSize(max, minSpacing, generationOptions))) ticks[ticks.length - 1].value = max;\n else ticks.push({\n value: max\n });\n } else if (!maxDefined || niceMax === max) ticks.push({\n value: niceMax\n });\n return ticks;\n}\nfunction $77dc20320068f1ee$var$relativeLabelSize(value, minSpacing, { horizontal: horizontal, minRotation: minRotation }) {\n const rad = (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * (\"\" + value).length;\n return Math.min(minSpacing / ratio, length);\n}\nclass $77dc20320068f1ee$var$LinearScaleBase extends $77dc20320068f1ee$export$d60cfc58d3c358b6 {\n parse(raw, index) {\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(raw)) return null;\n if ((typeof raw === \"number\" || raw instanceof Number) && !isFinite(+raw)) return null;\n return +raw;\n }\n handleTickRangeOptions() {\n const { beginAtZero: beginAtZero } = this.options;\n const { minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let { min: min, max: max } = this;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (beginAtZero) {\n const minSign = (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(min);\n const maxSign = (0, $02b6f511cc6c123c$export$2408f22a0fab9ae5)(max);\n if (minSign < 0 && maxSign < 0) setMax(0);\n else if (minSign > 0 && maxSign > 0) setMin(0);\n }\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n setMax(max + offset);\n if (!beginAtZero) setMin(min - offset);\n }\n this.min = min;\n this.max = max;\n }\n getTickLimit() {\n const tickOpts = this.options.ticks;\n let { maxTicksLimit: maxTicksLimit, stepSize: stepSize } = tickOpts;\n let maxTicks;\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n if (maxTicksLimit) maxTicks = Math.min(maxTicksLimit, maxTicks);\n return maxTicks;\n }\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n const numericGeneratorOptions = {\n maxTicks: maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = $77dc20320068f1ee$var$generateTicks$1(numericGeneratorOptions, dataRange);\n if (opts.bounds === \"ticks\") (0, $02b6f511cc6c123c$export$53a70dd1ebbae346)(ticks, this, \"value\");\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n super.configure();\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n getLabelForValue(value) {\n return (0, $02b6f511cc6c123c$export$ae1af26003f05816)(value, this.chart.options.locale, this.options.ticks.format);\n }\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._endValue = undefined;\n this._valueRange = 0;\n }\n}\nclass $77dc20320068f1ee$export$e7f4e5e8656f0b93 extends $77dc20320068f1ee$var$LinearScaleBase {\n determineDataLimits() {\n const { min: min, max: max } = this.getMinMax(true);\n this.min = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(min) ? min : 0;\n this.max = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(max) ? max : 1;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e7f4e5e8656f0b93, \"id\", \"linear\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$e7f4e5e8656f0b93, \"defaults\", {\n ticks: {\n callback: (0, $02b6f511cc6c123c$export$91477dc880baac21).formatters.numeric\n }\n});\nconst $77dc20320068f1ee$var$log10Floor = (v)=>Math.floor((0, $02b6f511cc6c123c$export$9f4f30ee63539e24)(v));\nconst $77dc20320068f1ee$var$changeExponent = (v, m)=>Math.pow(10, $77dc20320068f1ee$var$log10Floor(v) + m);\nfunction $77dc20320068f1ee$var$isMajor(tickVal) {\n const remain = tickVal / Math.pow(10, $77dc20320068f1ee$var$log10Floor(tickVal));\n return remain === 1;\n}\nfunction $77dc20320068f1ee$var$steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\nfunction $77dc20320068f1ee$var$startExp(min, max) {\n const range = max - min;\n let rangeExp = $77dc20320068f1ee$var$log10Floor(range);\n while($77dc20320068f1ee$var$steps(min, max, rangeExp) > 10)rangeExp++;\n while($77dc20320068f1ee$var$steps(min, max, rangeExp) < 10)rangeExp--;\n return Math.min(rangeExp, $77dc20320068f1ee$var$log10Floor(min));\n}\nfunction $77dc20320068f1ee$var$generateTicks(generationOptions, { min: min, max: max }) {\n min = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(generationOptions.min, min);\n const ticks = [];\n const minExp = $77dc20320068f1ee$var$log10Floor(min);\n let exp = $77dc20320068f1ee$var$startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while(value < max){\n ticks.push({\n value: value,\n major: $77dc20320068f1ee$var$isMajor(value),\n significand: significand\n });\n if (significand >= 10) significand = significand < 15 ? 15 : 20;\n else significand++;\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = (0, $02b6f511cc6c123c$export$c4ce752e73470fba)(generationOptions.max, value);\n ticks.push({\n value: lastTick,\n major: $77dc20320068f1ee$var$isMajor(lastTick),\n significand: significand\n });\n return ticks;\n}\nclass $77dc20320068f1ee$export$85295eaf7cb3ac3e extends $77dc20320068f1ee$export$d60cfc58d3c358b6 {\n parse(raw, index) {\n const value = $77dc20320068f1ee$var$LinearScaleBase.prototype.parse.apply(this, [\n raw,\n index\n ]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(value) && value > 0 ? value : null;\n }\n determineDataLimits() {\n const { min: min, max: max } = this.getMinMax(true);\n this.min = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(min) ? Math.max(0, min) : null;\n this.max = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(max) ? Math.max(0, max) : null;\n if (this.options.beginAtZero) this._zero = true;\n if (this._zero && this.min !== this._suggestedMin && !(0, $02b6f511cc6c123c$export$39b482c5e57630a8)(this._userMin)) this.min = min === $77dc20320068f1ee$var$changeExponent(this.min, 0) ? $77dc20320068f1ee$var$changeExponent(this.min, -1) : $77dc20320068f1ee$var$changeExponent(this.min, 0);\n this.handleTickRangeOptions();\n }\n handleTickRangeOptions() {\n const { minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (min === max) {\n if (min <= 0) {\n setMin(1);\n setMax(10);\n } else {\n setMin($77dc20320068f1ee$var$changeExponent(min, -1));\n setMax($77dc20320068f1ee$var$changeExponent(max, 1));\n }\n }\n if (min <= 0) setMin($77dc20320068f1ee$var$changeExponent(max, -1));\n if (max <= 0) setMax($77dc20320068f1ee$var$changeExponent(min, 1));\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const opts = this.options;\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = $77dc20320068f1ee$var$generateTicks(generationOptions, this);\n if (opts.bounds === \"ticks\") (0, $02b6f511cc6c123c$export$53a70dd1ebbae346)(ticks, this, \"value\");\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n getLabelForValue(value) {\n return value === undefined ? \"0\" : (0, $02b6f511cc6c123c$export$ae1af26003f05816)(value, this.chart.options.locale, this.options.ticks.format);\n }\n configure() {\n const start = this.min;\n super.configure();\n this._startValue = (0, $02b6f511cc6c123c$export$9f4f30ee63539e24)(start);\n this._valueRange = (0, $02b6f511cc6c123c$export$9f4f30ee63539e24)(this.max) - (0, $02b6f511cc6c123c$export$9f4f30ee63539e24)(start);\n }\n getPixelForValue(value) {\n if (value === undefined || value === 0) value = this.min;\n if (value === null || isNaN(value)) return NaN;\n return this.getPixelForDecimal(value === this.min ? 0 : ((0, $02b6f511cc6c123c$export$9f4f30ee63539e24)(value) - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._valueRange = 0;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$85295eaf7cb3ac3e, \"id\", \"logarithmic\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$85295eaf7cb3ac3e, \"defaults\", {\n ticks: {\n callback: (0, $02b6f511cc6c123c$export$91477dc880baac21).formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n});\nfunction $77dc20320068f1ee$var$getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n if (tickOpts.display && opts.display) {\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(tickOpts.backdropPadding);\n return (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(tickOpts.font && tickOpts.font.size, (0, $02b6f511cc6c123c$export$4368d992c4eafac0).font.size) + padding.height;\n }\n return 0;\n}\nfunction $77dc20320068f1ee$var$measureLabelSize(ctx, font, label) {\n label = (0, $02b6f511cc6c123c$export$8b22cf2602fb60ce)(label) ? label : [\n label\n ];\n return {\n w: (0, $02b6f511cc6c123c$export$faec65b429be379)(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\nfunction $77dc20320068f1ee$var$determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) return {\n start: pos - size / 2,\n end: pos + size / 2\n };\n else if (angle < min || angle > max) return {\n start: pos - size,\n end: pos\n };\n return {\n start: pos,\n end: pos + size\n };\n}\nfunction $77dc20320068f1ee$var$fitWithPointLabels(scale) {\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? (0, $02b6f511cc6c123c$export$56c0d5a1e737357d) / valueCount : 0;\n for(let i = 0; i < valueCount; i++){\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(opts.font);\n const textSize = $77dc20320068f1ee$var$measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n const angleRadians = (0, $02b6f511cc6c123c$export$28f7fcd39efa255)(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round((0, $02b6f511cc6c123c$export$3a6d5c9ae78a2c08)(angleRadians));\n const hLimits = $77dc20320068f1ee$var$determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = $77dc20320068f1ee$var$determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n $77dc20320068f1ee$var$updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b);\n scale._pointLabelItems = $77dc20320068f1ee$var$buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction $77dc20320068f1ee$var$updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\nfunction $77dc20320068f1ee$var$createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const { extra: extra, additionalAngle: additionalAngle, padding: padding, size: size } = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round((0, $02b6f511cc6c123c$export$3a6d5c9ae78a2c08)((0, $02b6f511cc6c123c$export$28f7fcd39efa255)(pointLabelPosition.angle + (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd))));\n const y = $77dc20320068f1ee$var$yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = $77dc20320068f1ee$var$getTextAlignForAngle(angle);\n const left = $77dc20320068f1ee$var$leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n visible: true,\n x: pointLabelPosition.x,\n y: y,\n textAlign: textAlign,\n left: left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\nfunction $77dc20320068f1ee$var$isNotOverlapped(item, area) {\n if (!area) return true;\n const { left: left, top: top, right: right, bottom: bottom } = item;\n const apexesInArea = (0, $02b6f511cc6c123c$export$e7094788287c5e9b)({\n x: left,\n y: top\n }, area) || (0, $02b6f511cc6c123c$export$e7094788287c5e9b)({\n x: left,\n y: bottom\n }, area) || (0, $02b6f511cc6c123c$export$e7094788287c5e9b)({\n x: right,\n y: top\n }, area) || (0, $02b6f511cc6c123c$export$e7094788287c5e9b)({\n x: right,\n y: bottom\n }, area);\n return !apexesInArea;\n}\nfunction $77dc20320068f1ee$var$buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const { centerPointLabels: centerPointLabels, display: display } = opts.pointLabels;\n const itemOpts = {\n extra: $77dc20320068f1ee$var$getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? (0, $02b6f511cc6c123c$export$56c0d5a1e737357d) / valueCount : 0\n };\n let area;\n for(let i = 0; i < valueCount; i++){\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n const item = $77dc20320068f1ee$var$createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === \"auto\") {\n item.visible = $77dc20320068f1ee$var$isNotOverlapped(item, area);\n if (item.visible) area = item;\n }\n }\n return items;\n}\nfunction $77dc20320068f1ee$var$getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) return \"center\";\n else if (angle < 180) return \"left\";\n return \"right\";\n}\nfunction $77dc20320068f1ee$var$leftForTextAlign(x, w, align) {\n if (align === \"right\") x -= w;\n else if (align === \"center\") x -= w / 2;\n return x;\n}\nfunction $77dc20320068f1ee$var$yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) y -= h / 2;\n else if (angle > 270 || angle < 90) y -= h;\n return y;\n}\nfunction $77dc20320068f1ee$var$drawPointLabelBox(ctx, opts, item) {\n const { left: left, top: top, right: right, bottom: bottom } = item;\n const { backdropColor: backdropColor } = opts;\n if (!(0, $02b6f511cc6c123c$export$342063e11d6c3cad)(backdropColor)) {\n const borderRadius = (0, $02b6f511cc6c123c$export$92108d983e8ee699)(opts.borderRadius);\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n (0, $02b6f511cc6c123c$export$1fbe638ecf81657e)(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius\n });\n ctx.fill();\n } else ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n}\nfunction $77dc20320068f1ee$var$drawPointLabels(scale, labelCount) {\n const { ctx: ctx, options: { pointLabels: pointLabels } } = scale;\n for(let i = labelCount - 1; i >= 0; i--){\n const item = scale._pointLabelItems[i];\n if (!item.visible) continue;\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n $77dc20320068f1ee$var$drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(optsAtIndex.font);\n const { x: x, y: y, textAlign: textAlign } = item;\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: \"middle\"\n });\n }\n}\nfunction $77dc20320068f1ee$var$pathRadiusLine(scale, radius, circular, labelCount) {\n const { ctx: ctx } = scale;\n if (circular) ctx.arc(scale.xCenter, scale.yCenter, radius, 0, (0, $02b6f511cc6c123c$export$971d5caa766a69d7));\n else {\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n for(let i = 1; i < labelCount; i++){\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\nfunction $77dc20320068f1ee$var$drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n const { color: color, lineWidth: lineWidth } = gridLineOpts;\n if (!circular && !labelCount || !color || !lineWidth || radius < 0) return;\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n ctx.beginPath();\n $77dc20320068f1ee$var$pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\nfunction $77dc20320068f1ee$var$createPointLabelContext(parent, index, label) {\n return (0, $02b6f511cc6c123c$export$35e795649ee09318)(parent, {\n label: label,\n index: index,\n type: \"pointLabel\"\n });\n}\nclass $77dc20320068f1ee$export$cfafc36d95386d38 extends $77dc20320068f1ee$var$LinearScaleBase {\n setDimensions() {\n const padding = this._padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)($77dc20320068f1ee$var$getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n determineDataLimits() {\n const { min: min, max: max } = this.getMinMax(false);\n this.min = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(min) && !isNaN(min) ? min : 0;\n this.max = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(max) && !isNaN(max) ? max : 0;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n return Math.ceil(this.drawingArea / $77dc20320068f1ee$var$getTickBackdropHeight(this.options));\n }\n generateTickLabels(ticks) {\n $77dc20320068f1ee$var$LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n this._pointLabels = this.getLabels().map((value, index)=>{\n const label = (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(this.options.pointLabels.callback, [\n value,\n index\n ], this);\n return label || label === 0 ? label : \"\";\n }).filter((v, i)=>this.chart.getDataVisibility(i));\n }\n fit() {\n const opts = this.options;\n if (opts.display && opts.pointLabels.display) $77dc20320068f1ee$var$fitWithPointLabels(this);\n else this.setCenterPoint(0, 0, 0, 0);\n }\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n getIndexAngle(index) {\n const angleMultiplier = (0, $02b6f511cc6c123c$export$971d5caa766a69d7) / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n return (0, $02b6f511cc6c123c$export$28f7fcd39efa255)(index * angleMultiplier + (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(startAngle));\n }\n getDistanceFromCenterForValue(value) {\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(value)) return NaN;\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) return (this.max - value) * scalingFactor;\n return (value - this.min) * scalingFactor;\n }\n getValueForDistanceFromCenter(distance) {\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(distance)) return NaN;\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return $77dc20320068f1ee$var$createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - (0, $02b6f511cc6c123c$export$7f8ddf7c7c20b3cd) + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle: angle\n };\n }\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n getPointLabelPosition(index) {\n const { left: left, top: top, right: right, bottom: bottom } = this._pointLabelItems[index];\n return {\n left: left,\n top: top,\n right: right,\n bottom: bottom\n };\n }\n drawBackground() {\n const { backgroundColor: backgroundColor, grid: { circular: circular } } = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n $77dc20320068f1ee$var$pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const { angleLines: angleLines, grid: grid, border: border } = opts;\n const labelCount = this._pointLabels.length;\n let i, offset, position;\n if (opts.pointLabels.display) $77dc20320068f1ee$var$drawPointLabels(this, labelCount);\n if (grid.display) this.ticks.forEach((tick, index)=>{\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n $77dc20320068f1ee$var$drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n if (angleLines.display) {\n ctx.save();\n for(i = labelCount - 1; i >= 0; i--){\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const { color: color, lineWidth: lineWidth } = optsAtIndex;\n if (!lineWidth || !color) continue;\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n ctx.restore();\n }\n }\n drawBorder() {}\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n if (!tickOpts.display) return;\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n this.ticks.forEach((tick, index)=>{\n if (index === 0 && !opts.reverse) return;\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = (0, $02b6f511cc6c123c$export$34aec0b863436764)(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n const padding = (0, $02b6f511cc6c123c$export$a9c23c6ac3fc3eca)(optsAtIndex.backdropPadding);\n ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height);\n }\n (0, $02b6f511cc6c123c$export$dc98b0b04f4c7758)(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth\n });\n });\n ctx.restore();\n }\n drawTitle() {}\n constructor(cfg){\n super(cfg);\n this.xCenter = undefined;\n this.yCenter = undefined;\n this.drawingArea = undefined;\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$cfafc36d95386d38, \"id\", \"radialLinear\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$cfafc36d95386d38, \"defaults\", {\n display: true,\n animate: true,\n position: \"chartArea\",\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n grid: {\n circular: false\n },\n startAngle: 0,\n ticks: {\n showLabelBackdrop: true,\n callback: (0, $02b6f511cc6c123c$export$91477dc880baac21).formatters.numeric\n },\n pointLabels: {\n backdropColor: undefined,\n backdropPadding: 2,\n display: true,\n font: {\n size: 10\n },\n callback (label) {\n return label;\n },\n padding: 5,\n centerPointLabels: false\n }\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$cfafc36d95386d38, \"defaultRoutes\", {\n \"angleLines.color\": \"borderColor\",\n \"pointLabels.color\": \"color\",\n \"ticks.color\": \"color\"\n});\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$cfafc36d95386d38, \"descriptors\", {\n angleLines: {\n _fallback: \"grid\"\n }\n});\nconst $77dc20320068f1ee$var$INTERVALS = {\n millisecond: {\n common: true,\n size: 1,\n steps: 1000\n },\n second: {\n common: true,\n size: 1000,\n steps: 60\n },\n minute: {\n common: true,\n size: 60000,\n steps: 60\n },\n hour: {\n common: true,\n size: 3600000,\n steps: 24\n },\n day: {\n common: true,\n size: 86400000,\n steps: 30\n },\n week: {\n common: false,\n size: 604800000,\n steps: 4\n },\n month: {\n common: true,\n size: 2.628e9,\n steps: 12\n },\n quarter: {\n common: false,\n size: 7.884e9,\n steps: 4\n },\n year: {\n common: true,\n size: 3.154e10\n }\n};\nconst $77dc20320068f1ee$var$UNITS = /* #__PURE__ */ Object.keys($77dc20320068f1ee$var$INTERVALS);\nfunction $77dc20320068f1ee$var$sorter(a, b) {\n return a - b;\n}\nfunction $77dc20320068f1ee$var$parse(scale, input) {\n if ((0, $02b6f511cc6c123c$export$342063e11d6c3cad)(input)) return null;\n const adapter = scale._adapter;\n const { parser: parser, round: round, isoWeekday: isoWeekday } = scale._parseOpts;\n let value = input;\n if (typeof parser === \"function\") value = parser(value);\n if (!(0, $02b6f511cc6c123c$export$39b482c5e57630a8)(value)) value = typeof parser === \"string\" ? adapter.parse(value, parser) : adapter.parse(value);\n if (value === null) return null;\n if (round) value = round === \"week\" && ((0, $02b6f511cc6c123c$export$d141bba7fdc215a3)(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, \"isoWeek\", isoWeekday) : adapter.startOf(value, round);\n return +value;\n}\nfunction $77dc20320068f1ee$var$determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = $77dc20320068f1ee$var$UNITS.length;\n for(let i = $77dc20320068f1ee$var$UNITS.indexOf(minUnit); i < ilen - 1; ++i){\n const interval = $77dc20320068f1ee$var$INTERVALS[$77dc20320068f1ee$var$UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) return $77dc20320068f1ee$var$UNITS[i];\n }\n return $77dc20320068f1ee$var$UNITS[ilen - 1];\n}\nfunction $77dc20320068f1ee$var$determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for(let i = $77dc20320068f1ee$var$UNITS.length - 1; i >= $77dc20320068f1ee$var$UNITS.indexOf(minUnit); i--){\n const unit = $77dc20320068f1ee$var$UNITS[i];\n if ($77dc20320068f1ee$var$INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) return unit;\n }\n return $77dc20320068f1ee$var$UNITS[minUnit ? $77dc20320068f1ee$var$UNITS.indexOf(minUnit) : 0];\n}\nfunction $77dc20320068f1ee$var$determineMajorUnit(unit) {\n for(let i = $77dc20320068f1ee$var$UNITS.indexOf(unit) + 1, ilen = $77dc20320068f1ee$var$UNITS.length; i < ilen; ++i){\n if ($77dc20320068f1ee$var$INTERVALS[$77dc20320068f1ee$var$UNITS[i]].common) return $77dc20320068f1ee$var$UNITS[i];\n }\n}\nfunction $77dc20320068f1ee$var$addTick(ticks, time, timestamps) {\n if (!timestamps) ticks[time] = true;\n else if (timestamps.length) {\n const { lo: lo, hi: hi } = (0, $02b6f511cc6c123c$export$2ed0fc6709e59212)(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\nfunction $77dc20320068f1ee$var$setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n for(major = first; major <= last; major = +adapter.add(major, 1, majorUnit)){\n index = map[major];\n if (index >= 0) ticks[index].major = true;\n }\n return ticks;\n}\nfunction $77dc20320068f1ee$var$ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n const map = {};\n const ilen = values.length;\n let i, value;\n for(i = 0; i < ilen; ++i){\n value = values[i];\n map[value] = i;\n ticks.push({\n value: value,\n major: false\n });\n }\n return ilen === 0 || !majorUnit ? ticks : $77dc20320068f1ee$var$setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass $77dc20320068f1ee$export$a894c72689ff3ec extends $77dc20320068f1ee$export$d60cfc58d3c358b6 {\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n const adapter = this._adapter = new $77dc20320068f1ee$export$f32766ea09ec8bc4._date(scaleOpts.adapters.date);\n adapter.init(opts);\n (0, $02b6f511cc6c123c$export$555508cbc6add439)(time.displayFormats, adapter.formats());\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n super.init(scaleOpts);\n this._normalized = opts.normalized;\n }\n parse(raw, index) {\n if (raw === undefined) return null;\n return $77dc20320068f1ee$var$parse(this, raw);\n }\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || \"day\";\n let { min: min, max: max, minDefined: minDefined, maxDefined: maxDefined } = this.getUserBounds();\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) min = Math.min(min, bounds.min);\n if (!maxDefined && !isNaN(bounds.max)) max = Math.max(max, bounds.max);\n }\n if (!minDefined || !maxDefined) {\n _applyBounds(this._getLabelBounds());\n if (options.bounds !== \"ticks\" || options.ticks.source !== \"labels\") _applyBounds(this.getMinMax(false));\n }\n min = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = (0, $02b6f511cc6c123c$export$39b482c5e57630a8)(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {\n min: min,\n max: max\n };\n }\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === \"labels\" ? this.getLabelTimestamps() : this._generate();\n if (options.bounds === \"ticks\" && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n const min = this.min;\n const max = this.max;\n const ticks = (0, $02b6f511cc6c123c$export$c03999cb2f36933f)(timestamps, min, max);\n this._unit = timeOpts.unit || (tickOpts.autoSkip ? $77dc20320068f1ee$var$determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : $77dc20320068f1ee$var$determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === \"year\" ? undefined : $77dc20320068f1ee$var$determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n if (options.reverse) ticks.reverse();\n return $77dc20320068f1ee$var$ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n afterAutoSkip() {\n if (this.options.offsetAfterAutoskip) this.initOffsets(this.ticks.map((tick)=>+tick.value));\n }\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) start = 1 - first;\n else start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) end = last;\n else end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(start, 0, limit);\n end = (0, $02b6f511cc6c123c$export$25ce5a424b770e84)(end, 0, limit);\n this._offsets = {\n start: start,\n end: end,\n factor: 1 / (start + 1 + end)\n };\n }\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n const minor = timeOpts.unit || $77dc20320068f1ee$var$determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = (0, $02b6f511cc6c123c$export$90a7f3efeed30595)(options.ticks.stepSize, 1);\n const weekday = minor === \"week\" ? timeOpts.isoWeekday : false;\n const hasWeekday = (0, $02b6f511cc6c123c$export$d141bba7fdc215a3)(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n if (hasWeekday) first = +adapter.startOf(first, \"isoWeek\", weekday);\n first = +adapter.startOf(first, hasWeekday ? \"day\" : minor);\n if (adapter.diff(max, min, minor) > 100000 * stepSize) throw new Error(min + \" and \" + max + \" are too far apart with stepSize of \" + stepSize + \" \" + minor);\n const timestamps = options.ticks.source === \"data\" && this.getDataTimestamps();\n for(time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++)$77dc20320068f1ee$var$addTick(ticks, time, timestamps);\n if (time === max || options.bounds === \"ticks\" || count === 1) $77dc20320068f1ee$var$addTick(ticks, time, timestamps);\n return Object.keys(ticks).sort($77dc20320068f1ee$var$sorter).map((x)=>+x);\n }\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n if (timeOpts.tooltipFormat) return adapter.format(value, timeOpts.tooltipFormat);\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n if (formatter) return (0, $02b6f511cc6c123c$export$3722cfe417b6ed86)(formatter, [\n time,\n index,\n ticks\n ], this);\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n generateTickLabels(ticks) {\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = (0, $02b6f511cc6c123c$export$625550452a3fa3ec)(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n return {\n w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,\n h: tickLabelWidth * sinRotation + tickFontSize * cosRotation\n };\n }\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, $77dc20320068f1ee$var$ticksFromTimestamps(this, [\n exampleTime\n ], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n if (timestamps.length) return timestamps;\n const metas = this.getMatchingVisibleMetas();\n if (this._normalized && metas.length) return this._cache.data = metas[0].controller.getAllParsedValues(this);\n for(i = 0, ilen = metas.length; i < ilen; ++i)timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n return this._cache.data = this.normalize(timestamps);\n }\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n if (timestamps.length) return timestamps;\n const labels = this.getLabels();\n for(i = 0, ilen = labels.length; i < ilen; ++i)timestamps.push($77dc20320068f1ee$var$parse(this, labels[i]));\n return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);\n }\n normalize(values) {\n return (0, $02b6f511cc6c123c$export$71511d61b312f219)(values.sort($77dc20320068f1ee$var$sorter));\n }\n constructor(props){\n super(props);\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n this._unit = \"day\";\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$a894c72689ff3ec, \"id\", \"time\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$a894c72689ff3ec, \"defaults\", {\n bounds: \"data\",\n adapters: {},\n time: {\n parser: false,\n unit: false,\n round: false,\n isoWeekday: false,\n minUnit: \"millisecond\",\n displayFormats: {}\n },\n ticks: {\n source: \"auto\",\n callback: false,\n major: {\n enabled: false\n }\n }\n});\nfunction $77dc20320068f1ee$var$interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) ({ lo: lo, hi: hi } = (0, $02b6f511cc6c123c$export$ef35774e6d314e91)(table, \"pos\", val));\n ({ pos: prevSource, time: prevTarget } = table[lo]);\n ({ pos: nextSource, time: nextTarget } = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) ({ lo: lo, hi: hi } = (0, $02b6f511cc6c123c$export$ef35774e6d314e91)(table, \"time\", val));\n ({ time: prevSource, pos: prevTarget } = table[lo]);\n ({ time: nextSource, pos: nextTarget } = table[hi]);\n }\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass $77dc20320068f1ee$export$85df64a8eb6dc986 extends $77dc20320068f1ee$export$a894c72689ff3ec {\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = $77dc20320068f1ee$var$interpolate(table, this.min);\n this._tableRange = $77dc20320068f1ee$var$interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n buildLookupTable(timestamps) {\n const { min: min, max: max } = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n for(i = 0, ilen = timestamps.length; i < ilen; ++i){\n curr = timestamps[i];\n if (curr >= min && curr <= max) items.push(curr);\n }\n if (items.length < 2) return [\n {\n time: min,\n pos: 0\n },\n {\n time: max,\n pos: 1\n }\n ];\n for(i = 0, ilen = items.length; i < ilen; ++i){\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n if (Math.round((next + prev) / 2) !== curr) table.push({\n time: curr,\n pos: i / (ilen - 1)\n });\n }\n return table;\n }\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) timestamps.splice(0, 0, min);\n if (!timestamps.includes(max) || timestamps.length === 1) timestamps.push(max);\n return timestamps.sort((a, b)=>a - b);\n }\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n if (timestamps.length) return timestamps;\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) timestamps = this.normalize(data.concat(label));\n else timestamps = data.length ? data : label;\n timestamps = this._cache.all = timestamps;\n return timestamps;\n }\n getDecimalForValue(value) {\n return ($77dc20320068f1ee$var$interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return $77dc20320068f1ee$var$interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n constructor(props){\n super(props);\n this._table = [];\n this._minPos = undefined;\n this._tableRange = undefined;\n }\n}\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$85df64a8eb6dc986, \"id\", \"timeseries\");\n(0, $d732417b6401265c$export$1e71eb4bef00f6b0)($77dc20320068f1ee$export$85df64a8eb6dc986, \"defaults\", $77dc20320068f1ee$export$a894c72689ff3ec.defaults);\nvar $77dc20320068f1ee$export$bcac1c16f1530ec2 = /*#__PURE__*/ Object.freeze({\n __proto__: null,\n CategoryScale: $77dc20320068f1ee$export$29e663ba4d09fe7,\n LinearScale: $77dc20320068f1ee$export$e7f4e5e8656f0b93,\n LogarithmicScale: $77dc20320068f1ee$export$85295eaf7cb3ac3e,\n RadialLinearScale: $77dc20320068f1ee$export$cfafc36d95386d38,\n TimeScale: $77dc20320068f1ee$export$a894c72689ff3ec,\n TimeSeriesScale: $77dc20320068f1ee$export$85df64a8eb6dc986\n});\nconst $77dc20320068f1ee$export$e8959e79e3af550f = [\n $77dc20320068f1ee$export$a6506504f799c5d5,\n $77dc20320068f1ee$export$7a5d735b2ab6389d,\n $77dc20320068f1ee$export$8b3ca321c77fdea6,\n $77dc20320068f1ee$export$bcac1c16f1530ec2\n];\n\n\n(0, $77dc20320068f1ee$export$acaa6426d77a227e).register(...(0, $77dc20320068f1ee$export$e8959e79e3af550f));\nvar $8b0f4f5753bf297d$export$2e2bcd8739ae039 = (0, $77dc20320068f1ee$export$acaa6426d77a227e);\n\n\n/**!\n * Sortable 1.15.1\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */ function $3bc6321cdb0e9401$var$ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function(sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction $3bc6321cdb0e9401$var$_objectSpread2(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) $3bc6321cdb0e9401$var$ownKeys(Object(source), true).forEach(function(key) {\n $3bc6321cdb0e9401$var$_defineProperty(target, key, source[key]);\n });\n else if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n else $3bc6321cdb0e9401$var$ownKeys(Object(source)).forEach(function(key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\n}\nfunction $3bc6321cdb0e9401$var$_typeof(obj) {\n \"@babel/helpers - typeof\";\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") $3bc6321cdb0e9401$var$_typeof = function(obj) {\n return typeof obj;\n };\n else $3bc6321cdb0e9401$var$_typeof = function(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n return $3bc6321cdb0e9401$var$_typeof(obj);\n}\nfunction $3bc6321cdb0e9401$var$_defineProperty(obj, key, value) {\n if (key in obj) Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n else obj[key] = value;\n return obj;\n}\nfunction $3bc6321cdb0e9401$var$_extends() {\n $3bc6321cdb0e9401$var$_extends = Object.assign || function(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i];\n for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];\n }\n return target;\n };\n return $3bc6321cdb0e9401$var$_extends.apply(this, arguments);\n}\nfunction $3bc6321cdb0e9401$var$_objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for(i = 0; i < sourceKeys.length; i++){\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction $3bc6321cdb0e9401$var$_objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = $3bc6321cdb0e9401$var$_objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for(i = 0; i < sourceSymbolKeys.length; i++){\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction $3bc6321cdb0e9401$var$_toConsumableArray(arr) {\n return $3bc6321cdb0e9401$var$_arrayWithoutHoles(arr) || $3bc6321cdb0e9401$var$_iterableToArray(arr) || $3bc6321cdb0e9401$var$_unsupportedIterableToArray(arr) || $3bc6321cdb0e9401$var$_nonIterableSpread();\n}\nfunction $3bc6321cdb0e9401$var$_arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return $3bc6321cdb0e9401$var$_arrayLikeToArray(arr);\n}\nfunction $3bc6321cdb0e9401$var$_iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction $3bc6321cdb0e9401$var$_unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return $3bc6321cdb0e9401$var$_arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $3bc6321cdb0e9401$var$_arrayLikeToArray(o, minLen);\n}\nfunction $3bc6321cdb0e9401$var$_arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction $3bc6321cdb0e9401$var$_nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nvar $3bc6321cdb0e9401$var$version = \"1.15.1\";\nfunction $3bc6321cdb0e9401$var$userAgent(pattern) {\n if (typeof window !== \"undefined\" && window.navigator) return !!/*@__PURE__*/ navigator.userAgent.match(pattern);\n}\nvar $3bc6321cdb0e9401$var$IE11OrLess = $3bc6321cdb0e9401$var$userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar $3bc6321cdb0e9401$var$Edge = $3bc6321cdb0e9401$var$userAgent(/Edge/i);\nvar $3bc6321cdb0e9401$var$FireFox = $3bc6321cdb0e9401$var$userAgent(/firefox/i);\nvar $3bc6321cdb0e9401$var$Safari = $3bc6321cdb0e9401$var$userAgent(/safari/i) && !$3bc6321cdb0e9401$var$userAgent(/chrome/i) && !$3bc6321cdb0e9401$var$userAgent(/android/i);\nvar $3bc6321cdb0e9401$var$IOS = $3bc6321cdb0e9401$var$userAgent(/iP(ad|od|hone)/i);\nvar $3bc6321cdb0e9401$var$ChromeForAndroid = $3bc6321cdb0e9401$var$userAgent(/chrome/i) && $3bc6321cdb0e9401$var$userAgent(/android/i);\nvar $3bc6321cdb0e9401$var$captureMode = {\n capture: false,\n passive: false\n};\nfunction $3bc6321cdb0e9401$var$on(el, event, fn) {\n el.addEventListener(event, fn, !$3bc6321cdb0e9401$var$IE11OrLess && $3bc6321cdb0e9401$var$captureMode);\n}\nfunction $3bc6321cdb0e9401$var$off(el, event, fn) {\n el.removeEventListener(event, fn, !$3bc6321cdb0e9401$var$IE11OrLess && $3bc6321cdb0e9401$var$captureMode);\n}\nfunction $3bc6321cdb0e9401$var$matches(/**HTMLElement*/ el, /**String*/ selector) {\n if (!selector) return;\n selector[0] === \">\" && (selector = selector.substring(1));\n if (el) try {\n if (el.matches) return el.matches(selector);\n else if (el.msMatchesSelector) return el.msMatchesSelector(selector);\n else if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);\n } catch (_) {\n return false;\n }\n return false;\n}\nfunction $3bc6321cdb0e9401$var$getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction $3bc6321cdb0e9401$var$closest(/**HTMLElement*/ el, /**String*/ selector, /**HTMLElement*/ ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === \">\" ? el.parentNode === ctx && $3bc6321cdb0e9401$var$matches(el, selector) : $3bc6321cdb0e9401$var$matches(el, selector)) || includeCTX && el === ctx) return el;\n if (el === ctx) break;\n /* jshint boss:true */ }while (el = $3bc6321cdb0e9401$var$getParentOrHost(el));\n }\n return null;\n}\nvar $3bc6321cdb0e9401$var$R_SPACE = /\\s+/g;\nfunction $3bc6321cdb0e9401$var$toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) el.classList[state ? \"add\" : \"remove\"](name);\n else {\n var className = (\" \" + el.className + \" \").replace($3bc6321cdb0e9401$var$R_SPACE, \" \").replace(\" \" + name + \" \", \" \");\n el.className = (className + (state ? \" \" + name : \"\")).replace($3bc6321cdb0e9401$var$R_SPACE, \" \");\n }\n }\n}\nfunction $3bc6321cdb0e9401$var$css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) val = document.defaultView.getComputedStyle(el, \"\");\n else if (el.currentStyle) val = el.currentStyle;\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf(\"webkit\") === -1) prop = \"-webkit-\" + prop;\n style[prop] = val + (typeof val === \"string\" ? \"\" : \"px\");\n }\n }\n}\nfunction $3bc6321cdb0e9401$var$matrix(el, selfOnly) {\n var appliedTransforms = \"\";\n if (typeof el === \"string\") appliedTransforms = el;\n else do {\n var transform = $3bc6321cdb0e9401$var$css(el, \"transform\");\n if (transform && transform !== \"none\") appliedTransforms = transform + \" \" + appliedTransforms;\n /* jshint boss:true */ }while (!selfOnly && (el = el.parentNode));\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */ return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction $3bc6321cdb0e9401$var$find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length;\n if (iterator) for(; i < n; i++)iterator(list[i], i);\n return list;\n }\n return [];\n}\nfunction $3bc6321cdb0e9401$var$getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) return scrollingElement;\n else return document.documentElement;\n}\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */ function $3bc6321cdb0e9401$var$getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== $3bc6321cdb0e9401$var$getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!$3bc6321cdb0e9401$var$IE11OrLess) {\n do if (container && container.getBoundingClientRect && ($3bc6321cdb0e9401$var$css(container, \"transform\") !== \"none\" || relativeToNonStaticParent && $3bc6321cdb0e9401$var$css(container, \"position\") !== \"static\")) {\n var containerRect = container.getBoundingClientRect();\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt($3bc6321cdb0e9401$var$css(container, \"border-top-width\"));\n left -= containerRect.left + parseInt($3bc6321cdb0e9401$var$css(container, \"border-left-width\"));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = $3bc6321cdb0e9401$var$matrix(container || el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\r\n * Returns the content rect of the element (bounding rect minus border and padding)\r\n * @param {HTMLElement} el \r\n */ function $3bc6321cdb0e9401$var$getContentRect(el) {\n var rect = $3bc6321cdb0e9401$var$getRect(el);\n var paddingLeft = parseInt($3bc6321cdb0e9401$var$css(el, \"padding-left\")), paddingTop = parseInt($3bc6321cdb0e9401$var$css(el, \"padding-top\")), paddingRight = parseInt($3bc6321cdb0e9401$var$css(el, \"padding-right\")), paddingBottom = parseInt($3bc6321cdb0e9401$var$css(el, \"padding-bottom\"));\n rect.top += paddingTop + parseInt($3bc6321cdb0e9401$var$css(el, \"border-top-width\"));\n rect.left += paddingLeft + parseInt($3bc6321cdb0e9401$var$css(el, \"border-left-width\"));\n // Client Width/Height includes padding only\n rect.width = el.clientWidth - paddingLeft - paddingRight;\n rect.height = el.clientHeight - paddingTop - paddingBottom;\n rect.bottom = rect.top + rect.height;\n rect.right = rect.left + rect.width;\n return rect;\n}\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */ function $3bc6321cdb0e9401$var$isScrolledPast(el, elSide, parentSide) {\n var parent = $3bc6321cdb0e9401$var$getParentAutoScrollElement(el, true), elSideVal = $3bc6321cdb0e9401$var$getRect(el)[elSide];\n /* jshint boss:true */ while(parent){\n var parentSideVal = $3bc6321cdb0e9401$var$getRect(parent)[parentSide], visible = void 0;\n if (parentSide === \"top\" || parentSide === \"left\") visible = elSideVal >= parentSideVal;\n else visible = elSideVal <= parentSideVal;\n if (!visible) return parent;\n if (parent === $3bc6321cdb0e9401$var$getWindowScrollingElement()) break;\n parent = $3bc6321cdb0e9401$var$getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */ function $3bc6321cdb0e9401$var$getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0, i = 0, children = el.children;\n while(i < children.length){\n if (children[i].style.display !== \"none\" && children[i] !== $3bc6321cdb0e9401$export$31b3ca70d8f57423.ghost && (includeDragEl || children[i] !== $3bc6321cdb0e9401$export$31b3ca70d8f57423.dragged) && $3bc6321cdb0e9401$var$closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) return children[i];\n currentChild++;\n }\n i++;\n }\n return null;\n}\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */ function $3bc6321cdb0e9401$var$lastChild(el, selector) {\n var last = el.lastElementChild;\n while(last && (last === $3bc6321cdb0e9401$export$31b3ca70d8f57423.ghost || $3bc6321cdb0e9401$var$css(last, \"display\") === \"none\" || selector && !$3bc6321cdb0e9401$var$matches(last, selector)))last = last.previousElementSibling;\n return last || null;\n}\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */ function $3bc6321cdb0e9401$var$index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) return -1;\n /* jshint boss:true */ while(el = el.previousElementSibling)if (el.nodeName.toUpperCase() !== \"TEMPLATE\" && el !== $3bc6321cdb0e9401$export$31b3ca70d8f57423.clone && (!selector || $3bc6321cdb0e9401$var$matches(el, selector))) index++;\n return index;\n}\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */ function $3bc6321cdb0e9401$var$getRelativeScrollOffset(el) {\n var offsetLeft = 0, offsetTop = 0, winScroller = $3bc6321cdb0e9401$var$getWindowScrollingElement();\n if (el) do {\n var elMatrix = $3bc6321cdb0e9401$var$matrix(el), scaleX = elMatrix.a, scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n }while (el !== winScroller && (el = el.parentNode));\n return [\n offsetLeft,\n offsetTop\n ];\n}\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */ function $3bc6321cdb0e9401$var$indexOfObject(arr, obj) {\n for(var i in arr){\n if (!arr.hasOwnProperty(i)) continue;\n for(var key in obj){\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction $3bc6321cdb0e9401$var$getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return $3bc6321cdb0e9401$var$getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = $3bc6321cdb0e9401$var$css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == \"auto\" || elemCSS.overflowX == \"scroll\") || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == \"auto\" || elemCSS.overflowY == \"scroll\")) {\n if (!elem.getBoundingClientRect || elem === document.body) return $3bc6321cdb0e9401$var$getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n while (elem = elem.parentNode);\n return $3bc6321cdb0e9401$var$getWindowScrollingElement();\n}\nfunction $3bc6321cdb0e9401$var$extend(dst, src) {\n if (dst && src) {\n for(var key in src)if (src.hasOwnProperty(key)) dst[key] = src[key];\n }\n return dst;\n}\nfunction $3bc6321cdb0e9401$var$isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar $3bc6321cdb0e9401$var$_throttleTimeout;\nfunction $3bc6321cdb0e9401$var$throttle(callback, ms) {\n return function() {\n if (!$3bc6321cdb0e9401$var$_throttleTimeout) {\n var args = arguments, _this = this;\n if (args.length === 1) callback.call(_this, args[0]);\n else callback.apply(_this, args);\n $3bc6321cdb0e9401$var$_throttleTimeout = setTimeout(function() {\n $3bc6321cdb0e9401$var$_throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction $3bc6321cdb0e9401$var$cancelThrottle() {\n clearTimeout($3bc6321cdb0e9401$var$_throttleTimeout);\n $3bc6321cdb0e9401$var$_throttleTimeout = void 0;\n}\nfunction $3bc6321cdb0e9401$var$scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction $3bc6321cdb0e9401$var$clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) return Polymer.dom(el).cloneNode(true);\n else if ($) return $(el).clone(true)[0];\n else return el.cloneNode(true);\n}\nfunction $3bc6321cdb0e9401$var$setRect(el, rect) {\n $3bc6321cdb0e9401$var$css(el, \"position\", \"absolute\");\n $3bc6321cdb0e9401$var$css(el, \"top\", rect.top);\n $3bc6321cdb0e9401$var$css(el, \"left\", rect.left);\n $3bc6321cdb0e9401$var$css(el, \"width\", rect.width);\n $3bc6321cdb0e9401$var$css(el, \"height\", rect.height);\n}\nfunction $3bc6321cdb0e9401$var$unsetRect(el) {\n $3bc6321cdb0e9401$var$css(el, \"position\", \"\");\n $3bc6321cdb0e9401$var$css(el, \"top\", \"\");\n $3bc6321cdb0e9401$var$css(el, \"left\", \"\");\n $3bc6321cdb0e9401$var$css(el, \"width\", \"\");\n $3bc6321cdb0e9401$var$css(el, \"height\", \"\");\n}\nvar $3bc6321cdb0e9401$var$expando = \"Sortable\" + new Date().getTime();\nfunction $3bc6321cdb0e9401$var$AnimationStateManager() {\n var animationStates = [], animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function(child) {\n if ($3bc6321cdb0e9401$var$css(child, \"display\") === \"none\" || child === $3bc6321cdb0e9401$export$31b3ca70d8f57423.ghost) return;\n animationStates.push({\n target: child,\n rect: $3bc6321cdb0e9401$var$getRect(child)\n });\n var fromRect = $3bc6321cdb0e9401$var$_objectSpread2({}, animationStates[animationStates.length - 1].rect);\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = $3bc6321cdb0e9401$var$matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice($3bc6321cdb0e9401$var$indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === \"function\") callback();\n return;\n }\n var animating = false, animationTime = 0;\n animationStates.forEach(function(state) {\n var time = 0, target = state.target, fromRect = target.fromRect, toRect = $3bc6321cdb0e9401$var$getRect(target), prevFromRect = target.prevFromRect, prevToRect = target.prevToRect, animatingRect = state.rect, targetMatrix = $3bc6321cdb0e9401$var$matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) // Could also check if animatingRect is between fromRect and toRect\n {\n if ($3bc6321cdb0e9401$var$isRectEqual(prevFromRect, toRect) && !$3bc6321cdb0e9401$var$isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) // If returning to same place as started from animation and on same axis\n time = $3bc6321cdb0e9401$var$calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n // if fromRect != toRect: animate\n if (!$3bc6321cdb0e9401$var$isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) time = _this.options.animation;\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function() {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === \"function\") callback();\n } else animationCallbackId = setTimeout(function() {\n if (typeof callback === \"function\") callback();\n }, animationTime);\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n $3bc6321cdb0e9401$var$css(target, \"transition\", \"\");\n $3bc6321cdb0e9401$var$css(target, \"transform\", \"\");\n var elMatrix = $3bc6321cdb0e9401$var$matrix(this.el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d, translateX = (currentRect.left - toRect.left) / (scaleX || 1), translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n $3bc6321cdb0e9401$var$css(target, \"transform\", \"translate3d(\" + translateX + \"px,\" + translateY + \"px,0)\");\n this.forRepaintDummy = $3bc6321cdb0e9401$var$repaint(target); // repaint\n $3bc6321cdb0e9401$var$css(target, \"transition\", \"transform \" + duration + \"ms\" + (this.options.easing ? \" \" + this.options.easing : \"\"));\n $3bc6321cdb0e9401$var$css(target, \"transform\", \"translate3d(0,0,0)\");\n typeof target.animated === \"number\" && clearTimeout(target.animated);\n target.animated = setTimeout(function() {\n $3bc6321cdb0e9401$var$css(target, \"transition\", \"\");\n $3bc6321cdb0e9401$var$css(target, \"transform\", \"\");\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction $3bc6321cdb0e9401$var$repaint(target) {\n return target.offsetWidth;\n}\nfunction $3bc6321cdb0e9401$var$calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\nvar $3bc6321cdb0e9401$var$plugins = [];\nvar $3bc6321cdb0e9401$var$defaults = {\n initializeByDefault: true\n};\nvar $3bc6321cdb0e9401$var$PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for(var option in $3bc6321cdb0e9401$var$defaults)if ($3bc6321cdb0e9401$var$defaults.hasOwnProperty(option) && !(option in plugin)) plugin[option] = $3bc6321cdb0e9401$var$defaults[option];\n $3bc6321cdb0e9401$var$plugins.forEach(function(p) {\n if (p.pluginName === plugin.pluginName) throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n });\n $3bc6321cdb0e9401$var$plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function() {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + \"Global\";\n $3bc6321cdb0e9401$var$plugins.forEach(function(plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) sortable[plugin.pluginName][eventNameGlobal]($3bc6321cdb0e9401$var$_objectSpread2({\n sortable: sortable\n }, evt));\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) sortable[plugin.pluginName][eventName]($3bc6321cdb0e9401$var$_objectSpread2({\n sortable: sortable\n }, evt));\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n $3bc6321cdb0e9401$var$plugins.forEach(function(plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n // Add default options from plugin\n $3bc6321cdb0e9401$var$_extends(defaults, initialized.defaults);\n });\n for(var option in sortable.options){\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== \"undefined\") sortable.options[option] = modified;\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n $3bc6321cdb0e9401$var$plugins.forEach(function(plugin) {\n if (typeof plugin.eventProperties !== \"function\") return;\n $3bc6321cdb0e9401$var$_extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n $3bc6321cdb0e9401$var$plugins.forEach(function(plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === \"function\") modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n });\n return modifiedValue;\n }\n};\nfunction $3bc6321cdb0e9401$var$dispatchEvent(_ref) {\n var sortable = _ref.sortable, rootEl = _ref.rootEl, name = _ref.name, targetEl = _ref.targetEl, cloneEl = _ref.cloneEl, toEl = _ref.toEl, fromEl = _ref.fromEl, oldIndex = _ref.oldIndex, newIndex = _ref.newIndex, oldDraggableIndex = _ref.oldDraggableIndex, newDraggableIndex = _ref.newDraggableIndex, originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[$3bc6321cdb0e9401$var$expando];\n if (!sortable) return;\n var evt, options = sortable.options, onName = \"on\" + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !$3bc6321cdb0e9401$var$IE11OrLess && !$3bc6321cdb0e9401$var$Edge) evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n else {\n evt = document.createEvent(\"Event\");\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = $3bc6321cdb0e9401$var$_objectSpread2($3bc6321cdb0e9401$var$_objectSpread2({}, extraEventProperties), $3bc6321cdb0e9401$var$PluginManager.getEventProperties(name, sortable));\n for(var option in allEventProperties)evt[option] = allEventProperties[option];\n if (rootEl) rootEl.dispatchEvent(evt);\n if (options[onName]) options[onName].call(sortable, evt);\n}\nvar $3bc6321cdb0e9401$var$_excluded = [\n \"evt\"\n];\nvar $3bc6321cdb0e9401$var$pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, originalEvent = _ref.evt, data = $3bc6321cdb0e9401$var$_objectWithoutProperties(_ref, $3bc6321cdb0e9401$var$_excluded);\n $3bc6321cdb0e9401$var$PluginManager.pluginEvent.bind($3bc6321cdb0e9401$export$31b3ca70d8f57423)(eventName, sortable, $3bc6321cdb0e9401$var$_objectSpread2({\n dragEl: $3bc6321cdb0e9401$var$dragEl,\n parentEl: $3bc6321cdb0e9401$var$parentEl,\n ghostEl: $3bc6321cdb0e9401$var$ghostEl,\n rootEl: $3bc6321cdb0e9401$var$rootEl,\n nextEl: $3bc6321cdb0e9401$var$nextEl,\n lastDownEl: $3bc6321cdb0e9401$var$lastDownEl,\n cloneEl: $3bc6321cdb0e9401$var$cloneEl,\n cloneHidden: $3bc6321cdb0e9401$var$cloneHidden,\n dragStarted: $3bc6321cdb0e9401$var$moved,\n putSortable: $3bc6321cdb0e9401$var$putSortable,\n activeSortable: $3bc6321cdb0e9401$export$31b3ca70d8f57423.active,\n originalEvent: originalEvent,\n oldIndex: $3bc6321cdb0e9401$var$oldIndex,\n oldDraggableIndex: $3bc6321cdb0e9401$var$oldDraggableIndex,\n newIndex: $3bc6321cdb0e9401$var$newIndex,\n newDraggableIndex: $3bc6321cdb0e9401$var$newDraggableIndex,\n hideGhostForTarget: $3bc6321cdb0e9401$var$_hideGhostForTarget,\n unhideGhostForTarget: $3bc6321cdb0e9401$var$_unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n $3bc6321cdb0e9401$var$cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n $3bc6321cdb0e9401$var$cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction $3bc6321cdb0e9401$var$_dispatchEvent(info) {\n $3bc6321cdb0e9401$var$dispatchEvent($3bc6321cdb0e9401$var$_objectSpread2({\n putSortable: $3bc6321cdb0e9401$var$putSortable,\n cloneEl: $3bc6321cdb0e9401$var$cloneEl,\n targetEl: $3bc6321cdb0e9401$var$dragEl,\n rootEl: $3bc6321cdb0e9401$var$rootEl,\n oldIndex: $3bc6321cdb0e9401$var$oldIndex,\n oldDraggableIndex: $3bc6321cdb0e9401$var$oldDraggableIndex,\n newIndex: $3bc6321cdb0e9401$var$newIndex,\n newDraggableIndex: $3bc6321cdb0e9401$var$newDraggableIndex\n }, info));\n}\nvar $3bc6321cdb0e9401$var$dragEl, $3bc6321cdb0e9401$var$parentEl, $3bc6321cdb0e9401$var$ghostEl, $3bc6321cdb0e9401$var$rootEl, $3bc6321cdb0e9401$var$nextEl, $3bc6321cdb0e9401$var$lastDownEl, $3bc6321cdb0e9401$var$cloneEl, $3bc6321cdb0e9401$var$cloneHidden, $3bc6321cdb0e9401$var$oldIndex, $3bc6321cdb0e9401$var$newIndex, $3bc6321cdb0e9401$var$oldDraggableIndex, $3bc6321cdb0e9401$var$newDraggableIndex, $3bc6321cdb0e9401$var$activeGroup, $3bc6321cdb0e9401$var$putSortable, $3bc6321cdb0e9401$var$awaitingDragStarted = false, $3bc6321cdb0e9401$var$ignoreNextClick = false, $3bc6321cdb0e9401$var$sortables = [], $3bc6321cdb0e9401$var$tapEvt, $3bc6321cdb0e9401$var$touchEvt, $3bc6321cdb0e9401$var$lastDx, $3bc6321cdb0e9401$var$lastDy, $3bc6321cdb0e9401$var$tapDistanceLeft, $3bc6321cdb0e9401$var$tapDistanceTop, $3bc6321cdb0e9401$var$moved, $3bc6321cdb0e9401$var$lastTarget, $3bc6321cdb0e9401$var$lastDirection, $3bc6321cdb0e9401$var$pastFirstInvertThresh = false, $3bc6321cdb0e9401$var$isCircumstantialInvert = false, $3bc6321cdb0e9401$var$targetMoveDistance, // For positioning ghost absolutely\n$3bc6321cdb0e9401$var$ghostRelativeParent, $3bc6321cdb0e9401$var$ghostRelativeParentInitialScroll = [], // (left, top)\n$3bc6321cdb0e9401$var$_silent = false, $3bc6321cdb0e9401$var$savedInputChecked = [];\n/** @const */ var $3bc6321cdb0e9401$var$documentExists = typeof document !== \"undefined\", $3bc6321cdb0e9401$var$PositionGhostAbsolutely = $3bc6321cdb0e9401$var$IOS, $3bc6321cdb0e9401$var$CSSFloatProperty = $3bc6321cdb0e9401$var$Edge || $3bc6321cdb0e9401$var$IE11OrLess ? \"cssFloat\" : \"float\", // This will not pass for IE9, because IE9 DnD only works on anchors\n$3bc6321cdb0e9401$var$supportDraggable = $3bc6321cdb0e9401$var$documentExists && !$3bc6321cdb0e9401$var$ChromeForAndroid && !$3bc6321cdb0e9401$var$IOS && \"draggable\" in document.createElement(\"div\"), $3bc6321cdb0e9401$var$supportCssPointerEvents = function() {\n if (!$3bc6321cdb0e9401$var$documentExists) return;\n // false when <= IE11\n if ($3bc6321cdb0e9401$var$IE11OrLess) return false;\n var el = document.createElement(\"x\");\n el.style.cssText = \"pointer-events:auto\";\n return el.style.pointerEvents === \"auto\";\n}(), $3bc6321cdb0e9401$var$_detectDirection = function _detectDirection(el, options) {\n var elCSS = $3bc6321cdb0e9401$var$css(el), elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth), child1 = $3bc6321cdb0e9401$var$getChild(el, 0, options), child2 = $3bc6321cdb0e9401$var$getChild(el, 1, options), firstChildCSS = child1 && $3bc6321cdb0e9401$var$css(child1), secondChildCSS = child2 && $3bc6321cdb0e9401$var$css(child2), firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + $3bc6321cdb0e9401$var$getRect(child1).width, secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + $3bc6321cdb0e9401$var$getRect(child2).width;\n if (elCSS.display === \"flex\") return elCSS.flexDirection === \"column\" || elCSS.flexDirection === \"column-reverse\" ? \"vertical\" : \"horizontal\";\n if (elCSS.display === \"grid\") return elCSS.gridTemplateColumns.split(\" \").length <= 1 ? \"vertical\" : \"horizontal\";\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== \"none\") {\n var touchingSideChild2 = firstChildCSS[\"float\"] === \"left\" ? \"left\" : \"right\";\n return child2 && (secondChildCSS.clear === \"both\" || secondChildCSS.clear === touchingSideChild2) ? \"vertical\" : \"horizontal\";\n }\n return child1 && (firstChildCSS.display === \"block\" || firstChildCSS.display === \"flex\" || firstChildCSS.display === \"table\" || firstChildCSS.display === \"grid\" || firstChildWidth >= elWidth && elCSS[$3bc6321cdb0e9401$var$CSSFloatProperty] === \"none\" || child2 && elCSS[$3bc6321cdb0e9401$var$CSSFloatProperty] === \"none\" && firstChildWidth + secondChildWidth > elWidth) ? \"vertical\" : \"horizontal\";\n}, $3bc6321cdb0e9401$var$_dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top, dragElS2Opp = vertical ? dragRect.right : dragRect.bottom, dragElOppLength = vertical ? dragRect.width : dragRect.height, targetS1Opp = vertical ? targetRect.left : targetRect.top, targetS2Opp = vertical ? targetRect.right : targetRect.bottom, targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n}, /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */ $3bc6321cdb0e9401$var$_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n $3bc6321cdb0e9401$var$sortables.some(function(sortable) {\n var threshold = sortable[$3bc6321cdb0e9401$var$expando].options.emptyInsertThreshold;\n if (!threshold || $3bc6321cdb0e9401$var$lastChild(sortable)) return;\n var rect = $3bc6321cdb0e9401$var$getRect(sortable), insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) return ret = sortable;\n });\n return ret;\n}, $3bc6321cdb0e9401$var$_prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function(to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) // Default pull value\n // Default pull and put value if same group\n return true;\n else if (value == null || value === false) return false;\n else if (pull && value === \"clone\") return value;\n else if (typeof value === \"function\") return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === \"string\" && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || $3bc6321cdb0e9401$var$_typeof(originalGroup) != \"object\") originalGroup = {\n name: originalGroup\n };\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n}, $3bc6321cdb0e9401$var$_hideGhostForTarget = function _hideGhostForTarget() {\n if (!$3bc6321cdb0e9401$var$supportCssPointerEvents && $3bc6321cdb0e9401$var$ghostEl) $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"display\", \"none\");\n}, $3bc6321cdb0e9401$var$_unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!$3bc6321cdb0e9401$var$supportCssPointerEvents && $3bc6321cdb0e9401$var$ghostEl) $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"display\", \"\");\n};\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif ($3bc6321cdb0e9401$var$documentExists && !$3bc6321cdb0e9401$var$ChromeForAndroid) document.addEventListener(\"click\", function(evt) {\n if ($3bc6321cdb0e9401$var$ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n $3bc6321cdb0e9401$var$ignoreNextClick = false;\n return false;\n }\n}, true);\nvar $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if ($3bc6321cdb0e9401$var$dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = $3bc6321cdb0e9401$var$_detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for(var i in evt)if (evt.hasOwnProperty(i)) event[i] = evt[i];\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[$3bc6321cdb0e9401$var$expando]._onDragOver(event);\n }\n }\n};\nvar $3bc6321cdb0e9401$var$_checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if ($3bc6321cdb0e9401$var$dragEl) $3bc6321cdb0e9401$var$dragEl.parentNode[$3bc6321cdb0e9401$var$expando]._isOutsideThisEl(evt.target);\n};\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */ function $3bc6321cdb0e9401$export$31b3ca70d8f57423(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) throw \"Sortable: `el` must be an HTMLElement, not \".concat(({}).toString.call(el));\n this.el = el; // root element\n this.options = options = $3bc6321cdb0e9401$var$_extends({}, options);\n // Export instance\n el[$3bc6321cdb0e9401$var$expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? \">li\" : \">*\",\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return $3bc6321cdb0e9401$var$_detectDirection(el, this.options);\n },\n ghostClass: \"sortable-ghost\",\n chosenClass: \"sortable-chosen\",\n dragClass: \"sortable-drag\",\n ignore: \"a, img\",\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData(\"Text\", dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: \"data-id\",\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: \"sortable-fallback\",\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: $3bc6321cdb0e9401$export$31b3ca70d8f57423.supportPointer !== false && \"PointerEvent\" in window && !$3bc6321cdb0e9401$var$Safari,\n emptyInsertThreshold: 5\n };\n $3bc6321cdb0e9401$var$PluginManager.initializePlugins(this, el, defaults);\n // Set default options\n for(var name in defaults)!(name in options) && (options[name] = defaults[name]);\n $3bc6321cdb0e9401$var$_prepareGroup(options);\n // Bind all private methods\n for(var fn in this)if (fn.charAt(0) === \"_\" && typeof this[fn] === \"function\") this[fn] = this[fn].bind(this);\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : $3bc6321cdb0e9401$var$supportDraggable;\n if (this.nativeDraggable) // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n // Bind events\n if (options.supportPointer) $3bc6321cdb0e9401$var$on(el, \"pointerdown\", this._onTapStart);\n else {\n $3bc6321cdb0e9401$var$on(el, \"mousedown\", this._onTapStart);\n $3bc6321cdb0e9401$var$on(el, \"touchstart\", this._onTapStart);\n }\n if (this.nativeDraggable) {\n $3bc6321cdb0e9401$var$on(el, \"dragover\", this);\n $3bc6321cdb0e9401$var$on(el, \"dragenter\", this);\n }\n $3bc6321cdb0e9401$var$sortables.push(this.el);\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n // Add animation state manager\n $3bc6321cdb0e9401$var$_extends(this, $3bc6321cdb0e9401$var$AnimationStateManager());\n}\n$3bc6321cdb0e9401$export$31b3ca70d8f57423.prototype = /** @lends Sortable.prototype */ {\n constructor: $3bc6321cdb0e9401$export$31b3ca70d8f57423,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) $3bc6321cdb0e9401$var$lastTarget = null;\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === \"function\" ? this.options.direction.call(this, evt, target, $3bc6321cdb0e9401$var$dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(/** Event|TouchEvent */ evt) {\n if (!evt.cancelable) return;\n var _this = this, el = this.el, options = this.options, preventOnFilter = options.preventOnFilter, type = evt.type, touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === \"touch\" && evt, target = (touch || evt).target, originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, filter = options.filter;\n $3bc6321cdb0e9401$var$_saveInputCheckedState(el);\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if ($3bc6321cdb0e9401$var$dragEl) return;\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) return; // only left button and enabled\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) return;\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && $3bc6321cdb0e9401$var$Safari && target && target.tagName.toUpperCase() === \"SELECT\") return;\n target = $3bc6321cdb0e9401$var$closest(target, options.draggable, el, false);\n if (target && target.animated) return;\n if ($3bc6321cdb0e9401$var$lastDownEl === target) // Ignoring duplicate `down`\n return;\n // Get the index of the dragged element within its parent\n $3bc6321cdb0e9401$var$oldIndex = $3bc6321cdb0e9401$var$index(target);\n $3bc6321cdb0e9401$var$oldDraggableIndex = $3bc6321cdb0e9401$var$index(target, options.draggable);\n // Check filter\n if (typeof filter === \"function\") {\n if (filter.call(this, evt, target, this)) {\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: \"filter\",\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n $3bc6321cdb0e9401$var$pluginEvent(\"filter\", _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(\",\").some(function(criteria) {\n criteria = $3bc6321cdb0e9401$var$closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: \"filter\",\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n $3bc6321cdb0e9401$var$pluginEvent(\"filter\", _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !$3bc6321cdb0e9401$var$closest(originalTarget, options.handle, el, false)) return;\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(/** Event */ evt, /** Touch */ touch, /** HTMLElement */ target) {\n var _this = this, el = _this.el, options = _this.options, ownerDocument = el.ownerDocument, dragStartFn;\n if (target && !$3bc6321cdb0e9401$var$dragEl && target.parentNode === el) {\n var dragRect = $3bc6321cdb0e9401$var$getRect(target);\n $3bc6321cdb0e9401$var$rootEl = el;\n $3bc6321cdb0e9401$var$dragEl = target;\n $3bc6321cdb0e9401$var$parentEl = $3bc6321cdb0e9401$var$dragEl.parentNode;\n $3bc6321cdb0e9401$var$nextEl = $3bc6321cdb0e9401$var$dragEl.nextSibling;\n $3bc6321cdb0e9401$var$lastDownEl = target;\n $3bc6321cdb0e9401$var$activeGroup = options.group;\n $3bc6321cdb0e9401$export$31b3ca70d8f57423.dragged = $3bc6321cdb0e9401$var$dragEl;\n $3bc6321cdb0e9401$var$tapEvt = {\n target: $3bc6321cdb0e9401$var$dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n $3bc6321cdb0e9401$var$tapDistanceLeft = $3bc6321cdb0e9401$var$tapEvt.clientX - dragRect.left;\n $3bc6321cdb0e9401$var$tapDistanceTop = $3bc6321cdb0e9401$var$tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n $3bc6321cdb0e9401$var$dragEl.style[\"will-change\"] = \"all\";\n dragStartFn = function dragStartFn() {\n $3bc6321cdb0e9401$var$pluginEvent(\"delayEnded\", _this, {\n evt: evt\n });\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!$3bc6321cdb0e9401$var$FireFox && _this.nativeDraggable) $3bc6321cdb0e9401$var$dragEl.draggable = true;\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n // Drag start event\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: _this,\n name: \"choose\",\n originalEvent: evt\n });\n // Chosen item\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, options.chosenClass, true);\n };\n // Disable \"draggable\"\n options.ignore.split(\",\").forEach(function(criteria) {\n $3bc6321cdb0e9401$var$find($3bc6321cdb0e9401$var$dragEl, criteria.trim(), $3bc6321cdb0e9401$var$_disableDraggable);\n });\n $3bc6321cdb0e9401$var$on(ownerDocument, \"dragover\", $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"mousemove\", $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"touchmove\", $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"mouseup\", _this._onDrop);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"touchend\", _this._onDrop);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"touchcancel\", _this._onDrop);\n // Make dragEl draggable (must be before delay for FireFox)\n if ($3bc6321cdb0e9401$var$FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n $3bc6321cdb0e9401$var$dragEl.draggable = true;\n }\n $3bc6321cdb0e9401$var$pluginEvent(\"delayStart\", this, {\n evt: evt\n });\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !($3bc6321cdb0e9401$var$Edge || $3bc6321cdb0e9401$var$IE11OrLess))) {\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n $3bc6321cdb0e9401$var$on(ownerDocument, \"mouseup\", _this._disableDelayedDrag);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"touchend\", _this._disableDelayedDrag);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"touchcancel\", _this._disableDelayedDrag);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"mousemove\", _this._delayedDragTouchMoveHandler);\n $3bc6321cdb0e9401$var$on(ownerDocument, \"touchmove\", _this._delayedDragTouchMoveHandler);\n options.supportPointer && $3bc6321cdb0e9401$var$on(ownerDocument, \"pointermove\", _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else dragStartFn();\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(/** TouchEvent|PointerEvent **/ e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) this._disableDelayedDrag();\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n $3bc6321cdb0e9401$var$dragEl && $3bc6321cdb0e9401$var$_disableDraggable($3bc6321cdb0e9401$var$dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n $3bc6321cdb0e9401$var$off(ownerDocument, \"mouseup\", this._disableDelayedDrag);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"touchend\", this._disableDelayedDrag);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"touchcancel\", this._disableDelayedDrag);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"mousemove\", this._delayedDragTouchMoveHandler);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"touchmove\", this._delayedDragTouchMoveHandler);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"pointermove\", this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(/** Event */ evt, /** Touch */ touch) {\n touch = touch || evt.pointerType == \"touch\" && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) $3bc6321cdb0e9401$var$on(document, \"pointermove\", this._onTouchMove);\n else if (touch) $3bc6321cdb0e9401$var$on(document, \"touchmove\", this._onTouchMove);\n else $3bc6321cdb0e9401$var$on(document, \"mousemove\", this._onTouchMove);\n } else {\n $3bc6321cdb0e9401$var$on($3bc6321cdb0e9401$var$dragEl, \"dragend\", this);\n $3bc6321cdb0e9401$var$on($3bc6321cdb0e9401$var$rootEl, \"dragstart\", this._onDragStart);\n }\n try {\n if (document.selection) // Timeout neccessary for IE9\n $3bc6321cdb0e9401$var$_nextTick(function() {\n document.selection.empty();\n });\n else window.getSelection().removeAllRanges();\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n $3bc6321cdb0e9401$var$awaitingDragStarted = false;\n if ($3bc6321cdb0e9401$var$rootEl && $3bc6321cdb0e9401$var$dragEl) {\n $3bc6321cdb0e9401$var$pluginEvent(\"dragStarted\", this, {\n evt: evt\n });\n if (this.nativeDraggable) $3bc6321cdb0e9401$var$on(document, \"dragover\", $3bc6321cdb0e9401$var$_checkOutsideTargetEl);\n var options = this.options;\n // Apply effect\n !fallback && $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, options.dragClass, false);\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, options.ghostClass, true);\n $3bc6321cdb0e9401$export$31b3ca70d8f57423.active = this;\n fallback && this._appendGhost();\n // Drag start event\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"start\",\n originalEvent: evt\n });\n } else this._nulling();\n },\n _emulateDragOver: function _emulateDragOver() {\n if ($3bc6321cdb0e9401$var$touchEvt) {\n this._lastX = $3bc6321cdb0e9401$var$touchEvt.clientX;\n this._lastY = $3bc6321cdb0e9401$var$touchEvt.clientY;\n $3bc6321cdb0e9401$var$_hideGhostForTarget();\n var target = document.elementFromPoint($3bc6321cdb0e9401$var$touchEvt.clientX, $3bc6321cdb0e9401$var$touchEvt.clientY);\n var parent = target;\n while(target && target.shadowRoot){\n target = target.shadowRoot.elementFromPoint($3bc6321cdb0e9401$var$touchEvt.clientX, $3bc6321cdb0e9401$var$touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n $3bc6321cdb0e9401$var$dragEl.parentNode[$3bc6321cdb0e9401$var$expando]._isOutsideThisEl(target);\n if (parent) do {\n if (parent[$3bc6321cdb0e9401$var$expando]) {\n var inserted = void 0;\n inserted = parent[$3bc6321cdb0e9401$var$expando]._onDragOver({\n clientX: $3bc6321cdb0e9401$var$touchEvt.clientX,\n clientY: $3bc6321cdb0e9401$var$touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) break;\n }\n target = parent; // store last element\n }while (parent = parent.parentNode);\n $3bc6321cdb0e9401$var$_unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(/**TouchEvent*/ evt) {\n if ($3bc6321cdb0e9401$var$tapEvt) {\n var options = this.options, fallbackTolerance = options.fallbackTolerance, fallbackOffset = options.fallbackOffset, touch = evt.touches ? evt.touches[0] : evt, ghostMatrix = $3bc6321cdb0e9401$var$ghostEl && $3bc6321cdb0e9401$var$matrix($3bc6321cdb0e9401$var$ghostEl, true), scaleX = $3bc6321cdb0e9401$var$ghostEl && ghostMatrix && ghostMatrix.a, scaleY = $3bc6321cdb0e9401$var$ghostEl && ghostMatrix && ghostMatrix.d, relativeScrollOffset = $3bc6321cdb0e9401$var$PositionGhostAbsolutely && $3bc6321cdb0e9401$var$ghostRelativeParent && $3bc6321cdb0e9401$var$getRelativeScrollOffset($3bc6321cdb0e9401$var$ghostRelativeParent), dx = (touch.clientX - $3bc6321cdb0e9401$var$tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - $3bc6321cdb0e9401$var$ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1), dy = (touch.clientY - $3bc6321cdb0e9401$var$tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - $3bc6321cdb0e9401$var$ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n // only set the status to dragging, when we are actually dragging\n if (!$3bc6321cdb0e9401$export$31b3ca70d8f57423.active && !$3bc6321cdb0e9401$var$awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) return;\n this._onDragStart(evt, true);\n }\n if ($3bc6321cdb0e9401$var$ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - ($3bc6321cdb0e9401$var$lastDx || 0);\n ghostMatrix.f += dy - ($3bc6321cdb0e9401$var$lastDy || 0);\n } else ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"webkitTransform\", cssMatrix);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"mozTransform\", cssMatrix);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"msTransform\", cssMatrix);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"transform\", cssMatrix);\n $3bc6321cdb0e9401$var$lastDx = dx;\n $3bc6321cdb0e9401$var$lastDy = dy;\n $3bc6321cdb0e9401$var$touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!$3bc6321cdb0e9401$var$ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : $3bc6321cdb0e9401$var$rootEl, rect = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$dragEl, true, $3bc6321cdb0e9401$var$PositionGhostAbsolutely, true, container), options = this.options;\n // Position absolutely\n if ($3bc6321cdb0e9401$var$PositionGhostAbsolutely) {\n // Get relatively positioned parent\n $3bc6321cdb0e9401$var$ghostRelativeParent = container;\n while($3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostRelativeParent, \"position\") === \"static\" && $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostRelativeParent, \"transform\") === \"none\" && $3bc6321cdb0e9401$var$ghostRelativeParent !== document)$3bc6321cdb0e9401$var$ghostRelativeParent = $3bc6321cdb0e9401$var$ghostRelativeParent.parentNode;\n if ($3bc6321cdb0e9401$var$ghostRelativeParent !== document.body && $3bc6321cdb0e9401$var$ghostRelativeParent !== document.documentElement) {\n if ($3bc6321cdb0e9401$var$ghostRelativeParent === document) $3bc6321cdb0e9401$var$ghostRelativeParent = $3bc6321cdb0e9401$var$getWindowScrollingElement();\n rect.top += $3bc6321cdb0e9401$var$ghostRelativeParent.scrollTop;\n rect.left += $3bc6321cdb0e9401$var$ghostRelativeParent.scrollLeft;\n } else $3bc6321cdb0e9401$var$ghostRelativeParent = $3bc6321cdb0e9401$var$getWindowScrollingElement();\n $3bc6321cdb0e9401$var$ghostRelativeParentInitialScroll = $3bc6321cdb0e9401$var$getRelativeScrollOffset($3bc6321cdb0e9401$var$ghostRelativeParent);\n }\n $3bc6321cdb0e9401$var$ghostEl = $3bc6321cdb0e9401$var$dragEl.cloneNode(true);\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$ghostEl, options.ghostClass, false);\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$ghostEl, options.fallbackClass, true);\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$ghostEl, options.dragClass, true);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"transition\", \"\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"transform\", \"\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"box-sizing\", \"border-box\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"margin\", 0);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"top\", rect.top);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"left\", rect.left);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"width\", rect.width);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"height\", rect.height);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"opacity\", \"0.8\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"position\", $3bc6321cdb0e9401$var$PositionGhostAbsolutely ? \"absolute\" : \"fixed\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"zIndex\", \"100000\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"pointerEvents\", \"none\");\n $3bc6321cdb0e9401$export$31b3ca70d8f57423.ghost = $3bc6321cdb0e9401$var$ghostEl;\n container.appendChild($3bc6321cdb0e9401$var$ghostEl);\n // Set transform-origin\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$ghostEl, \"transform-origin\", $3bc6321cdb0e9401$var$tapDistanceLeft / parseInt($3bc6321cdb0e9401$var$ghostEl.style.width) * 100 + \"% \" + $3bc6321cdb0e9401$var$tapDistanceTop / parseInt($3bc6321cdb0e9401$var$ghostEl.style.height) * 100 + \"%\");\n }\n },\n _onDragStart: function _onDragStart(/**Event*/ evt, /**boolean*/ fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n $3bc6321cdb0e9401$var$pluginEvent(\"dragStart\", this, {\n evt: evt\n });\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) {\n this._onDrop();\n return;\n }\n $3bc6321cdb0e9401$var$pluginEvent(\"setupClone\", this);\n if (!$3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) {\n $3bc6321cdb0e9401$var$cloneEl = $3bc6321cdb0e9401$var$clone($3bc6321cdb0e9401$var$dragEl);\n $3bc6321cdb0e9401$var$cloneEl.removeAttribute(\"id\");\n $3bc6321cdb0e9401$var$cloneEl.draggable = false;\n $3bc6321cdb0e9401$var$cloneEl.style[\"will-change\"] = \"\";\n this._hideClone();\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$cloneEl, this.options.chosenClass, false);\n $3bc6321cdb0e9401$export$31b3ca70d8f57423.clone = $3bc6321cdb0e9401$var$cloneEl;\n }\n // #1143: IFrame support workaround\n _this.cloneId = $3bc6321cdb0e9401$var$_nextTick(function() {\n $3bc6321cdb0e9401$var$pluginEvent(\"clone\", _this);\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) $3bc6321cdb0e9401$var$rootEl.insertBefore($3bc6321cdb0e9401$var$cloneEl, $3bc6321cdb0e9401$var$dragEl);\n _this._hideClone();\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: _this,\n name: \"clone\"\n });\n });\n !fallback && $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, options.dragClass, true);\n // Set proper drop events\n if (fallback) {\n $3bc6321cdb0e9401$var$ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n $3bc6321cdb0e9401$var$off(document, \"mouseup\", _this._onDrop);\n $3bc6321cdb0e9401$var$off(document, \"touchend\", _this._onDrop);\n $3bc6321cdb0e9401$var$off(document, \"touchcancel\", _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = \"move\";\n options.setData && options.setData.call(_this, dataTransfer, $3bc6321cdb0e9401$var$dragEl);\n }\n $3bc6321cdb0e9401$var$on(document, \"drop\", _this);\n // #1276 fix:\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$dragEl, \"transform\", \"translateZ(0)\");\n }\n $3bc6321cdb0e9401$var$awaitingDragStarted = true;\n _this._dragStartId = $3bc6321cdb0e9401$var$_nextTick(_this._dragStarted.bind(_this, fallback, evt));\n $3bc6321cdb0e9401$var$on(document, \"selectstart\", _this);\n $3bc6321cdb0e9401$var$moved = true;\n if ($3bc6321cdb0e9401$var$Safari) $3bc6321cdb0e9401$var$css(document.body, \"user-select\", \"none\");\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(/**Event*/ evt) {\n var el = this.el, target = evt.target, dragRect, targetRect, revert, options = this.options, group = options.group, activeSortable = $3bc6321cdb0e9401$export$31b3ca70d8f57423.active, isOwner = $3bc6321cdb0e9401$var$activeGroup === group, canSort = options.sort, fromSortable = $3bc6321cdb0e9401$var$putSortable || activeSortable, vertical, _this = this, completedFired = false;\n if ($3bc6321cdb0e9401$var$_silent) return;\n function dragOverEvent(name, extra) {\n $3bc6321cdb0e9401$var$pluginEvent(name, _this, $3bc6321cdb0e9401$var$_objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? \"vertical\" : \"horizontal\",\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return $3bc6321cdb0e9401$var$_onMove($3bc6321cdb0e9401$var$rootEl, el, $3bc6321cdb0e9401$var$dragEl, dragRect, target, $3bc6321cdb0e9401$var$getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n // Capture animation state\n function capture() {\n dragOverEvent(\"dragOverAnimationCapture\");\n _this.captureAnimationState();\n if (_this !== fromSortable) fromSortable.captureAnimationState();\n }\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent(\"dragOverCompleted\", {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) activeSortable._hideClone();\n else activeSortable._showClone(_this);\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, $3bc6321cdb0e9401$var$putSortable ? $3bc6321cdb0e9401$var$putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, options.ghostClass, true);\n }\n if ($3bc6321cdb0e9401$var$putSortable !== _this && _this !== $3bc6321cdb0e9401$export$31b3ca70d8f57423.active) $3bc6321cdb0e9401$var$putSortable = _this;\n else if (_this === $3bc6321cdb0e9401$export$31b3ca70d8f57423.active && $3bc6321cdb0e9401$var$putSortable) $3bc6321cdb0e9401$var$putSortable = null;\n // Animation\n if (fromSortable === _this) _this._ignoreWhileAnimating = target;\n _this.animateAll(function() {\n dragOverEvent(\"dragOverAnimationComplete\");\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n // Null lastTarget if it is not inside a previously swapped element\n if (target === $3bc6321cdb0e9401$var$dragEl && !$3bc6321cdb0e9401$var$dragEl.animated || target === el && !target.animated) $3bc6321cdb0e9401$var$lastTarget = null;\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n $3bc6321cdb0e9401$var$dragEl.parentNode[$3bc6321cdb0e9401$var$expando]._isOutsideThisEl(evt.target);\n // Do not detect for empty insert if already inserted\n !insertion && $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n // Call when dragEl has been inserted\n function changed() {\n $3bc6321cdb0e9401$var$newIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl);\n $3bc6321cdb0e9401$var$newDraggableIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl, options.draggable);\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: _this,\n name: \"change\",\n toEl: el,\n newIndex: $3bc6321cdb0e9401$var$newIndex,\n newDraggableIndex: $3bc6321cdb0e9401$var$newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) evt.cancelable && evt.preventDefault();\n target = $3bc6321cdb0e9401$var$closest(target, options.draggable, el, true);\n dragOverEvent(\"dragOver\");\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) return completedFired;\n if ($3bc6321cdb0e9401$var$dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) return completed(false);\n $3bc6321cdb0e9401$var$ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = $3bc6321cdb0e9401$var$parentEl !== $3bc6321cdb0e9401$var$rootEl // Reverting item into the original list\n ) : $3bc6321cdb0e9401$var$putSortable === this || (this.lastPutMode = $3bc6321cdb0e9401$var$activeGroup.checkPull(this, activeSortable, $3bc6321cdb0e9401$var$dragEl, evt)) && group.checkPut(this, activeSortable, $3bc6321cdb0e9401$var$dragEl, evt))) {\n vertical = this._getDirection(evt, target) === \"vertical\";\n dragRect = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$dragEl);\n dragOverEvent(\"dragOverValid\");\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) return completedFired;\n if (revert) {\n $3bc6321cdb0e9401$var$parentEl = $3bc6321cdb0e9401$var$rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent(\"revert\");\n if (!$3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) {\n if ($3bc6321cdb0e9401$var$nextEl) $3bc6321cdb0e9401$var$rootEl.insertBefore($3bc6321cdb0e9401$var$dragEl, $3bc6321cdb0e9401$var$nextEl);\n else $3bc6321cdb0e9401$var$rootEl.appendChild($3bc6321cdb0e9401$var$dragEl);\n }\n return completed(true);\n }\n var elLastChild = $3bc6321cdb0e9401$var$lastChild(el, options.draggable);\n if (!elLastChild || $3bc6321cdb0e9401$var$_ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n // If already at end of list: Do not insert\n if (elLastChild === $3bc6321cdb0e9401$var$dragEl) return completed(false);\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) target = elLastChild;\n if (target) targetRect = $3bc6321cdb0e9401$var$getRect(target);\n if ($3bc6321cdb0e9401$var$_onMove($3bc6321cdb0e9401$var$rootEl, el, $3bc6321cdb0e9401$var$dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) // the last draggable element is not the last node\n el.insertBefore($3bc6321cdb0e9401$var$dragEl, elLastChild.nextSibling);\n else el.appendChild($3bc6321cdb0e9401$var$dragEl);\n $3bc6321cdb0e9401$var$parentEl = el; // actualization\n changed();\n return completed(true);\n }\n } else if (elLastChild && $3bc6321cdb0e9401$var$_ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = $3bc6321cdb0e9401$var$getChild(el, 0, options, true);\n if (firstChild === $3bc6321cdb0e9401$var$dragEl) return completed(false);\n target = firstChild;\n targetRect = $3bc6321cdb0e9401$var$getRect(target);\n if ($3bc6321cdb0e9401$var$_onMove($3bc6321cdb0e9401$var$rootEl, el, $3bc6321cdb0e9401$var$dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore($3bc6321cdb0e9401$var$dragEl, firstChild);\n $3bc6321cdb0e9401$var$parentEl = el; // actualization\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = $3bc6321cdb0e9401$var$getRect(target);\n var direction = 0, targetBeforeFirstSwap, differentLevel = $3bc6321cdb0e9401$var$dragEl.parentNode !== el, differentRowCol = !$3bc6321cdb0e9401$var$_dragElInRowColumn($3bc6321cdb0e9401$var$dragEl.animated && $3bc6321cdb0e9401$var$dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical), side1 = vertical ? \"top\" : \"left\", scrolledPastTop = $3bc6321cdb0e9401$var$isScrolledPast(target, \"top\", \"top\") || $3bc6321cdb0e9401$var$isScrolledPast($3bc6321cdb0e9401$var$dragEl, \"top\", \"top\"), scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if ($3bc6321cdb0e9401$var$lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n $3bc6321cdb0e9401$var$pastFirstInvertThresh = false;\n $3bc6321cdb0e9401$var$isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = $3bc6321cdb0e9401$var$_getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, $3bc6321cdb0e9401$var$isCircumstantialInvert, $3bc6321cdb0e9401$var$lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl);\n do {\n dragIndex -= direction;\n sibling = $3bc6321cdb0e9401$var$parentEl.children[dragIndex];\n }while (sibling && ($3bc6321cdb0e9401$var$css(sibling, \"display\") === \"none\" || sibling === $3bc6321cdb0e9401$var$ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) return completed(false);\n $3bc6321cdb0e9401$var$lastTarget = target;\n $3bc6321cdb0e9401$var$lastDirection = direction;\n var nextSibling = target.nextElementSibling, after = false;\n after = direction === 1;\n var moveVector = $3bc6321cdb0e9401$var$_onMove($3bc6321cdb0e9401$var$rootEl, el, $3bc6321cdb0e9401$var$dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) after = moveVector === 1;\n $3bc6321cdb0e9401$var$_silent = true;\n setTimeout($3bc6321cdb0e9401$var$_unsilent, 30);\n capture();\n if (after && !nextSibling) el.appendChild($3bc6321cdb0e9401$var$dragEl);\n else target.parentNode.insertBefore($3bc6321cdb0e9401$var$dragEl, after ? nextSibling : target);\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) $3bc6321cdb0e9401$var$scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n $3bc6321cdb0e9401$var$parentEl = $3bc6321cdb0e9401$var$dragEl.parentNode; // actualization\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !$3bc6321cdb0e9401$var$isCircumstantialInvert) $3bc6321cdb0e9401$var$targetMoveDistance = Math.abs(targetBeforeFirstSwap - $3bc6321cdb0e9401$var$getRect(target)[side1]);\n changed();\n return completed(true);\n }\n }\n if (el.contains($3bc6321cdb0e9401$var$dragEl)) return completed(false);\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n $3bc6321cdb0e9401$var$off(document, \"mousemove\", this._onTouchMove);\n $3bc6321cdb0e9401$var$off(document, \"touchmove\", this._onTouchMove);\n $3bc6321cdb0e9401$var$off(document, \"pointermove\", this._onTouchMove);\n $3bc6321cdb0e9401$var$off(document, \"dragover\", $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent);\n $3bc6321cdb0e9401$var$off(document, \"mousemove\", $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent);\n $3bc6321cdb0e9401$var$off(document, \"touchmove\", $3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n $3bc6321cdb0e9401$var$off(ownerDocument, \"mouseup\", this._onDrop);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"touchend\", this._onDrop);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"pointerup\", this._onDrop);\n $3bc6321cdb0e9401$var$off(ownerDocument, \"touchcancel\", this._onDrop);\n $3bc6321cdb0e9401$var$off(document, \"selectstart\", this);\n },\n _onDrop: function _onDrop(/**Event*/ evt) {\n var el = this.el, options = this.options;\n // Get the index of the dragged element within its parent\n $3bc6321cdb0e9401$var$newIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl);\n $3bc6321cdb0e9401$var$newDraggableIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl, options.draggable);\n $3bc6321cdb0e9401$var$pluginEvent(\"drop\", this, {\n evt: evt\n });\n $3bc6321cdb0e9401$var$parentEl = $3bc6321cdb0e9401$var$dragEl && $3bc6321cdb0e9401$var$dragEl.parentNode;\n // Get again after plugin event\n $3bc6321cdb0e9401$var$newIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl);\n $3bc6321cdb0e9401$var$newDraggableIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl, options.draggable);\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) {\n this._nulling();\n return;\n }\n $3bc6321cdb0e9401$var$awaitingDragStarted = false;\n $3bc6321cdb0e9401$var$isCircumstantialInvert = false;\n $3bc6321cdb0e9401$var$pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n $3bc6321cdb0e9401$var$_cancelNextTick(this.cloneId);\n $3bc6321cdb0e9401$var$_cancelNextTick(this._dragStartId);\n // Unbind events\n if (this.nativeDraggable) {\n $3bc6321cdb0e9401$var$off(document, \"drop\", this);\n $3bc6321cdb0e9401$var$off(el, \"dragstart\", this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if ($3bc6321cdb0e9401$var$Safari) $3bc6321cdb0e9401$var$css(document.body, \"user-select\", \"\");\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$dragEl, \"transform\", \"\");\n if (evt) {\n if ($3bc6321cdb0e9401$var$moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n $3bc6321cdb0e9401$var$ghostEl && $3bc6321cdb0e9401$var$ghostEl.parentNode && $3bc6321cdb0e9401$var$ghostEl.parentNode.removeChild($3bc6321cdb0e9401$var$ghostEl);\n if ($3bc6321cdb0e9401$var$rootEl === $3bc6321cdb0e9401$var$parentEl || $3bc6321cdb0e9401$var$putSortable && $3bc6321cdb0e9401$var$putSortable.lastPutMode !== \"clone\") // Remove clone(s)\n $3bc6321cdb0e9401$var$cloneEl && $3bc6321cdb0e9401$var$cloneEl.parentNode && $3bc6321cdb0e9401$var$cloneEl.parentNode.removeChild($3bc6321cdb0e9401$var$cloneEl);\n if ($3bc6321cdb0e9401$var$dragEl) {\n if (this.nativeDraggable) $3bc6321cdb0e9401$var$off($3bc6321cdb0e9401$var$dragEl, \"dragend\", this);\n $3bc6321cdb0e9401$var$_disableDraggable($3bc6321cdb0e9401$var$dragEl);\n $3bc6321cdb0e9401$var$dragEl.style[\"will-change\"] = \"\";\n // Remove classes\n // ghostClass is added in dragStarted\n if ($3bc6321cdb0e9401$var$moved && !$3bc6321cdb0e9401$var$awaitingDragStarted) $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, $3bc6321cdb0e9401$var$putSortable ? $3bc6321cdb0e9401$var$putSortable.options.ghostClass : this.options.ghostClass, false);\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl, this.options.chosenClass, false);\n // Drag stop event\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"unchoose\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if ($3bc6321cdb0e9401$var$rootEl !== $3bc6321cdb0e9401$var$parentEl) {\n if ($3bc6321cdb0e9401$var$newIndex >= 0) {\n // Add event\n $3bc6321cdb0e9401$var$_dispatchEvent({\n rootEl: $3bc6321cdb0e9401$var$parentEl,\n name: \"add\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n fromEl: $3bc6321cdb0e9401$var$rootEl,\n originalEvent: evt\n });\n // Remove event\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"remove\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n originalEvent: evt\n });\n // drag from one list and drop into another\n $3bc6321cdb0e9401$var$_dispatchEvent({\n rootEl: $3bc6321cdb0e9401$var$parentEl,\n name: \"sort\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n fromEl: $3bc6321cdb0e9401$var$rootEl,\n originalEvent: evt\n });\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"sort\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n originalEvent: evt\n });\n }\n $3bc6321cdb0e9401$var$putSortable && $3bc6321cdb0e9401$var$putSortable.save();\n } else {\n if ($3bc6321cdb0e9401$var$newIndex !== $3bc6321cdb0e9401$var$oldIndex) {\n if ($3bc6321cdb0e9401$var$newIndex >= 0) {\n // drag & drop within the same list\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"update\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n originalEvent: evt\n });\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"sort\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.active) {\n /* jshint eqnull:true */ if ($3bc6321cdb0e9401$var$newIndex == null || $3bc6321cdb0e9401$var$newIndex === -1) {\n $3bc6321cdb0e9401$var$newIndex = $3bc6321cdb0e9401$var$oldIndex;\n $3bc6321cdb0e9401$var$newDraggableIndex = $3bc6321cdb0e9401$var$oldDraggableIndex;\n }\n $3bc6321cdb0e9401$var$_dispatchEvent({\n sortable: this,\n name: \"end\",\n toEl: $3bc6321cdb0e9401$var$parentEl,\n originalEvent: evt\n });\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n $3bc6321cdb0e9401$var$pluginEvent(\"nulling\", this);\n $3bc6321cdb0e9401$var$rootEl = $3bc6321cdb0e9401$var$dragEl = $3bc6321cdb0e9401$var$parentEl = $3bc6321cdb0e9401$var$ghostEl = $3bc6321cdb0e9401$var$nextEl = $3bc6321cdb0e9401$var$cloneEl = $3bc6321cdb0e9401$var$lastDownEl = $3bc6321cdb0e9401$var$cloneHidden = $3bc6321cdb0e9401$var$tapEvt = $3bc6321cdb0e9401$var$touchEvt = $3bc6321cdb0e9401$var$moved = $3bc6321cdb0e9401$var$newIndex = $3bc6321cdb0e9401$var$newDraggableIndex = $3bc6321cdb0e9401$var$oldIndex = $3bc6321cdb0e9401$var$oldDraggableIndex = $3bc6321cdb0e9401$var$lastTarget = $3bc6321cdb0e9401$var$lastDirection = $3bc6321cdb0e9401$var$putSortable = $3bc6321cdb0e9401$var$activeGroup = $3bc6321cdb0e9401$export$31b3ca70d8f57423.dragged = $3bc6321cdb0e9401$export$31b3ca70d8f57423.ghost = $3bc6321cdb0e9401$export$31b3ca70d8f57423.clone = $3bc6321cdb0e9401$export$31b3ca70d8f57423.active = null;\n $3bc6321cdb0e9401$var$savedInputChecked.forEach(function(el) {\n el.checked = true;\n });\n $3bc6321cdb0e9401$var$savedInputChecked.length = $3bc6321cdb0e9401$var$lastDx = $3bc6321cdb0e9401$var$lastDy = 0;\n },\n handleEvent: function handleEvent(/**Event*/ evt) {\n switch(evt.type){\n case \"drop\":\n case \"dragend\":\n this._onDrop(evt);\n break;\n case \"dragenter\":\n case \"dragover\":\n if ($3bc6321cdb0e9401$var$dragEl) {\n this._onDragOver(evt);\n $3bc6321cdb0e9401$var$_globalDragOver(evt);\n }\n break;\n case \"selectstart\":\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */ toArray: function toArray() {\n var order = [], el, children = this.el.children, i = 0, n = children.length, options = this.options;\n for(; i < n; i++){\n el = children[i];\n if ($3bc6321cdb0e9401$var$closest(el, options.draggable, this.el, false)) order.push(el.getAttribute(options.dataIdAttr) || $3bc6321cdb0e9401$var$_generateId(el));\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */ sort: function sort(order, useAnimation) {\n var items = {}, rootEl = this.el;\n this.toArray().forEach(function(id, i) {\n var el = rootEl.children[i];\n if ($3bc6321cdb0e9401$var$closest(el, this.options.draggable, rootEl, false)) items[id] = el;\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function(id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */ save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */ closest: function closest$1(el, selector) {\n return $3bc6321cdb0e9401$var$closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */ option: function option(name, value) {\n var options = this.options;\n if (value === void 0) return options[name];\n else {\n var modifiedValue = $3bc6321cdb0e9401$var$PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== \"undefined\") options[name] = modifiedValue;\n else options[name] = value;\n if (name === \"group\") $3bc6321cdb0e9401$var$_prepareGroup(options);\n }\n },\n /**\r\n * Destroy\r\n */ destroy: function destroy() {\n $3bc6321cdb0e9401$var$pluginEvent(\"destroy\", this);\n var el = this.el;\n el[$3bc6321cdb0e9401$var$expando] = null;\n $3bc6321cdb0e9401$var$off(el, \"mousedown\", this._onTapStart);\n $3bc6321cdb0e9401$var$off(el, \"touchstart\", this._onTapStart);\n $3bc6321cdb0e9401$var$off(el, \"pointerdown\", this._onTapStart);\n if (this.nativeDraggable) {\n $3bc6321cdb0e9401$var$off(el, \"dragover\", this);\n $3bc6321cdb0e9401$var$off(el, \"dragenter\", this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll(\"[draggable]\"), function(el) {\n el.removeAttribute(\"draggable\");\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n $3bc6321cdb0e9401$var$sortables.splice($3bc6321cdb0e9401$var$sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!$3bc6321cdb0e9401$var$cloneHidden) {\n $3bc6321cdb0e9401$var$pluginEvent(\"hideClone\", this);\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) return;\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$cloneEl, \"display\", \"none\");\n if (this.options.removeCloneOnHide && $3bc6321cdb0e9401$var$cloneEl.parentNode) $3bc6321cdb0e9401$var$cloneEl.parentNode.removeChild($3bc6321cdb0e9401$var$cloneEl);\n $3bc6321cdb0e9401$var$cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== \"clone\") {\n this._hideClone();\n return;\n }\n if ($3bc6321cdb0e9401$var$cloneHidden) {\n $3bc6321cdb0e9401$var$pluginEvent(\"showClone\", this);\n if ($3bc6321cdb0e9401$export$31b3ca70d8f57423.eventCanceled) return;\n // show clone at dragEl or original position\n if ($3bc6321cdb0e9401$var$dragEl.parentNode == $3bc6321cdb0e9401$var$rootEl && !this.options.group.revertClone) $3bc6321cdb0e9401$var$rootEl.insertBefore($3bc6321cdb0e9401$var$cloneEl, $3bc6321cdb0e9401$var$dragEl);\n else if ($3bc6321cdb0e9401$var$nextEl) $3bc6321cdb0e9401$var$rootEl.insertBefore($3bc6321cdb0e9401$var$cloneEl, $3bc6321cdb0e9401$var$nextEl);\n else $3bc6321cdb0e9401$var$rootEl.appendChild($3bc6321cdb0e9401$var$cloneEl);\n if (this.options.group.revertClone) this.animate($3bc6321cdb0e9401$var$dragEl, $3bc6321cdb0e9401$var$cloneEl);\n $3bc6321cdb0e9401$var$css($3bc6321cdb0e9401$var$cloneEl, \"display\", \"\");\n $3bc6321cdb0e9401$var$cloneHidden = false;\n }\n }\n};\nfunction $3bc6321cdb0e9401$var$_globalDragOver(/**Event*/ evt) {\n if (evt.dataTransfer) evt.dataTransfer.dropEffect = \"move\";\n evt.cancelable && evt.preventDefault();\n}\nfunction $3bc6321cdb0e9401$var$_onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt, sortable = fromEl[$3bc6321cdb0e9401$var$expando], onMoveFn = sortable.options.onMove, retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !$3bc6321cdb0e9401$var$IE11OrLess && !$3bc6321cdb0e9401$var$Edge) evt = new CustomEvent(\"move\", {\n bubbles: true,\n cancelable: true\n });\n else {\n evt = document.createEvent(\"Event\");\n evt.initEvent(\"move\", true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || $3bc6321cdb0e9401$var$getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) retVal = onMoveFn.call(sortable, evt, originalEvent);\n return retVal;\n}\nfunction $3bc6321cdb0e9401$var$_disableDraggable(el) {\n el.draggable = false;\n}\nfunction $3bc6321cdb0e9401$var$_unsilent() {\n $3bc6321cdb0e9401$var$_silent = false;\n}\nfunction $3bc6321cdb0e9401$var$_ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$getChild(sortable.el, 0, sortable.options, true));\n var sortableContentRect = $3bc6321cdb0e9401$var$getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX < sortableContentRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < sortableContentRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction $3bc6321cdb0e9401$var$_ghostIsLast(evt, vertical, sortable) {\n var lastElRect = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$lastChild(sortable.el, sortable.options.draggable));\n var sortableContentRect = $3bc6321cdb0e9401$var$getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX > sortableContentRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > sortableContentRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction $3bc6321cdb0e9401$var$_getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX, targetLength = vertical ? targetRect.height : targetRect.width, targetS1 = vertical ? targetRect.top : targetRect.left, targetS2 = vertical ? targetRect.bottom : targetRect.right, invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && $3bc6321cdb0e9401$var$targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!$3bc6321cdb0e9401$var$pastFirstInvertThresh && ($3bc6321cdb0e9401$var$lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n $3bc6321cdb0e9401$var$pastFirstInvertThresh = true;\n if (!$3bc6321cdb0e9401$var$pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if ($3bc6321cdb0e9401$var$lastDirection === 1 ? mouseOnAxis < targetS1 + $3bc6321cdb0e9401$var$targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - $3bc6321cdb0e9401$var$targetMoveDistance) return -$3bc6321cdb0e9401$var$lastDirection;\n } else invert = true;\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) return $3bc6321cdb0e9401$var$_getInsertDirection(target);\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n return 0;\n}\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */ function $3bc6321cdb0e9401$var$_getInsertDirection(target) {\n if ($3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl) < $3bc6321cdb0e9401$var$index(target)) return 1;\n else return -1;\n}\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */ function $3bc6321cdb0e9401$var$_generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent, i = str.length, sum = 0;\n while(i--)sum += str.charCodeAt(i);\n return sum.toString(36);\n}\nfunction $3bc6321cdb0e9401$var$_saveInputCheckedState(root) {\n $3bc6321cdb0e9401$var$savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName(\"input\");\n var idx = inputs.length;\n while(idx--){\n var el = inputs[idx];\n el.checked && $3bc6321cdb0e9401$var$savedInputChecked.push(el);\n }\n}\nfunction $3bc6321cdb0e9401$var$_nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction $3bc6321cdb0e9401$var$_cancelNextTick(id) {\n return clearTimeout(id);\n}\n// Fixed #973:\nif ($3bc6321cdb0e9401$var$documentExists) $3bc6321cdb0e9401$var$on(document, \"touchmove\", function(evt) {\n if (($3bc6321cdb0e9401$export$31b3ca70d8f57423.active || $3bc6321cdb0e9401$var$awaitingDragStarted) && evt.cancelable) evt.preventDefault();\n});\n// Export utils\n$3bc6321cdb0e9401$export$31b3ca70d8f57423.utils = {\n on: $3bc6321cdb0e9401$var$on,\n off: $3bc6321cdb0e9401$var$off,\n css: $3bc6321cdb0e9401$var$css,\n find: $3bc6321cdb0e9401$var$find,\n is: function is(el, selector) {\n return !!$3bc6321cdb0e9401$var$closest(el, selector, el, false);\n },\n extend: $3bc6321cdb0e9401$var$extend,\n throttle: $3bc6321cdb0e9401$var$throttle,\n closest: $3bc6321cdb0e9401$var$closest,\n toggleClass: $3bc6321cdb0e9401$var$toggleClass,\n clone: $3bc6321cdb0e9401$var$clone,\n index: $3bc6321cdb0e9401$var$index,\n nextTick: $3bc6321cdb0e9401$var$_nextTick,\n cancelNextTick: $3bc6321cdb0e9401$var$_cancelNextTick,\n detectDirection: $3bc6321cdb0e9401$var$_detectDirection,\n getChild: $3bc6321cdb0e9401$var$getChild\n};\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */ $3bc6321cdb0e9401$export$31b3ca70d8f57423.get = function(element) {\n return element[$3bc6321cdb0e9401$var$expando];\n};\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */ $3bc6321cdb0e9401$export$31b3ca70d8f57423.mount = function() {\n for(var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++)plugins[_key] = arguments[_key];\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function(plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) throw \"Sortable: Mounted plugin must be a constructor function, not \".concat(({}).toString.call(plugin));\n if (plugin.utils) $3bc6321cdb0e9401$export$31b3ca70d8f57423.utils = $3bc6321cdb0e9401$var$_objectSpread2($3bc6321cdb0e9401$var$_objectSpread2({}, $3bc6321cdb0e9401$export$31b3ca70d8f57423.utils), plugin.utils);\n $3bc6321cdb0e9401$var$PluginManager.mount(plugin);\n });\n};\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */ $3bc6321cdb0e9401$export$31b3ca70d8f57423.create = function(el, options) {\n return new $3bc6321cdb0e9401$export$31b3ca70d8f57423(el, options);\n};\n// Export\n$3bc6321cdb0e9401$export$31b3ca70d8f57423.version = $3bc6321cdb0e9401$var$version;\nvar $3bc6321cdb0e9401$var$autoScrolls = [], $3bc6321cdb0e9401$var$scrollEl, $3bc6321cdb0e9401$var$scrollRootEl, $3bc6321cdb0e9401$var$scrolling = false, $3bc6321cdb0e9401$var$lastAutoScrollX, $3bc6321cdb0e9401$var$lastAutoScrollY, $3bc6321cdb0e9401$var$touchEvt$1, $3bc6321cdb0e9401$var$pointerElemChangedInterval;\nfunction $3bc6321cdb0e9401$var$AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n // Bind all private methods\n for(var fn in this)if (fn.charAt(0) === \"_\" && typeof this[fn] === \"function\") this[fn] = this[fn].bind(this);\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) $3bc6321cdb0e9401$var$on(document, \"dragover\", this._handleAutoScroll);\n else {\n if (this.options.supportPointer) $3bc6321cdb0e9401$var$on(document, \"pointermove\", this._handleFallbackAutoScroll);\n else if (originalEvent.touches) $3bc6321cdb0e9401$var$on(document, \"touchmove\", this._handleFallbackAutoScroll);\n else $3bc6321cdb0e9401$var$on(document, \"mousemove\", this._handleFallbackAutoScroll);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) this._handleAutoScroll(originalEvent);\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) $3bc6321cdb0e9401$var$off(document, \"dragover\", this._handleAutoScroll);\n else {\n $3bc6321cdb0e9401$var$off(document, \"pointermove\", this._handleFallbackAutoScroll);\n $3bc6321cdb0e9401$var$off(document, \"touchmove\", this._handleFallbackAutoScroll);\n $3bc6321cdb0e9401$var$off(document, \"mousemove\", this._handleFallbackAutoScroll);\n }\n $3bc6321cdb0e9401$var$clearPointerElemChangedInterval();\n $3bc6321cdb0e9401$var$clearAutoScrolls();\n $3bc6321cdb0e9401$var$cancelThrottle();\n },\n nulling: function nulling() {\n $3bc6321cdb0e9401$var$touchEvt$1 = $3bc6321cdb0e9401$var$scrollRootEl = $3bc6321cdb0e9401$var$scrollEl = $3bc6321cdb0e9401$var$scrolling = $3bc6321cdb0e9401$var$pointerElemChangedInterval = $3bc6321cdb0e9401$var$lastAutoScrollX = $3bc6321cdb0e9401$var$lastAutoScrollY = null;\n $3bc6321cdb0e9401$var$autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, elem = document.elementFromPoint(x, y);\n $3bc6321cdb0e9401$var$touchEvt$1 = evt;\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || $3bc6321cdb0e9401$var$Edge || $3bc6321cdb0e9401$var$IE11OrLess || $3bc6321cdb0e9401$var$Safari) {\n $3bc6321cdb0e9401$var$autoScroll(evt, this.options, elem, fallback);\n // Listener for pointer element change\n var ogElemScroller = $3bc6321cdb0e9401$var$getParentAutoScrollElement(elem, true);\n if ($3bc6321cdb0e9401$var$scrolling && (!$3bc6321cdb0e9401$var$pointerElemChangedInterval || x !== $3bc6321cdb0e9401$var$lastAutoScrollX || y !== $3bc6321cdb0e9401$var$lastAutoScrollY)) {\n $3bc6321cdb0e9401$var$pointerElemChangedInterval && $3bc6321cdb0e9401$var$clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n $3bc6321cdb0e9401$var$pointerElemChangedInterval = setInterval(function() {\n var newElem = $3bc6321cdb0e9401$var$getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n $3bc6321cdb0e9401$var$clearAutoScrolls();\n }\n $3bc6321cdb0e9401$var$autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n $3bc6321cdb0e9401$var$lastAutoScrollX = x;\n $3bc6321cdb0e9401$var$lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || $3bc6321cdb0e9401$var$getParentAutoScrollElement(elem, true) === $3bc6321cdb0e9401$var$getWindowScrollingElement()) {\n $3bc6321cdb0e9401$var$clearAutoScrolls();\n return;\n }\n $3bc6321cdb0e9401$var$autoScroll(evt, this.options, $3bc6321cdb0e9401$var$getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return $3bc6321cdb0e9401$var$_extends(AutoScroll, {\n pluginName: \"scroll\",\n initializeByDefault: true\n });\n}\nfunction $3bc6321cdb0e9401$var$clearAutoScrolls() {\n $3bc6321cdb0e9401$var$autoScrolls.forEach(function(autoScroll) {\n clearInterval(autoScroll.pid);\n });\n $3bc6321cdb0e9401$var$autoScrolls = [];\n}\nfunction $3bc6321cdb0e9401$var$clearPointerElemChangedInterval() {\n clearInterval($3bc6321cdb0e9401$var$pointerElemChangedInterval);\n}\nvar $3bc6321cdb0e9401$var$autoScroll = $3bc6321cdb0e9401$var$throttle(function(evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, sens = options.scrollSensitivity, speed = options.scrollSpeed, winScroller = $3bc6321cdb0e9401$var$getWindowScrollingElement();\n var scrollThisInstance = false, scrollCustomFn;\n // New scroll root, set scrollEl\n if ($3bc6321cdb0e9401$var$scrollRootEl !== rootEl) {\n $3bc6321cdb0e9401$var$scrollRootEl = rootEl;\n $3bc6321cdb0e9401$var$clearAutoScrolls();\n $3bc6321cdb0e9401$var$scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if ($3bc6321cdb0e9401$var$scrollEl === true) $3bc6321cdb0e9401$var$scrollEl = $3bc6321cdb0e9401$var$getParentAutoScrollElement(rootEl, true);\n }\n var layersOut = 0;\n var currentParent = $3bc6321cdb0e9401$var$scrollEl;\n do {\n var el = currentParent, rect = $3bc6321cdb0e9401$var$getRect(el), top = rect.top, bottom = rect.bottom, left = rect.left, right = rect.right, width = rect.width, height = rect.height, canScrollX = void 0, canScrollY = void 0, scrollWidth = el.scrollWidth, scrollHeight = el.scrollHeight, elCSS = $3bc6321cdb0e9401$var$css(el), scrollPosX = el.scrollLeft, scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === \"auto\" || elCSS.overflowX === \"scroll\" || elCSS.overflowX === \"visible\");\n canScrollY = height < scrollHeight && (elCSS.overflowY === \"auto\" || elCSS.overflowY === \"scroll\" || elCSS.overflowY === \"visible\");\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === \"auto\" || elCSS.overflowX === \"scroll\");\n canScrollY = height < scrollHeight && (elCSS.overflowY === \"auto\" || elCSS.overflowY === \"scroll\");\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!$3bc6321cdb0e9401$var$autoScrolls[layersOut]) {\n for(var i = 0; i <= layersOut; i++)if (!$3bc6321cdb0e9401$var$autoScrolls[i]) $3bc6321cdb0e9401$var$autoScrolls[i] = {};\n }\n if ($3bc6321cdb0e9401$var$autoScrolls[layersOut].vx != vx || $3bc6321cdb0e9401$var$autoScrolls[layersOut].vy != vy || $3bc6321cdb0e9401$var$autoScrolls[layersOut].el !== el) {\n $3bc6321cdb0e9401$var$autoScrolls[layersOut].el = el;\n $3bc6321cdb0e9401$var$autoScrolls[layersOut].vx = vx;\n $3bc6321cdb0e9401$var$autoScrolls[layersOut].vy = vy;\n clearInterval($3bc6321cdb0e9401$var$autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */ $3bc6321cdb0e9401$var$autoScrolls[layersOut].pid = setInterval((function() {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) $3bc6321cdb0e9401$export$31b3ca70d8f57423.active._onTouchMove($3bc6321cdb0e9401$var$touchEvt$1); // To move ghost if it is positioned absolutely\n var scrollOffsetY = $3bc6321cdb0e9401$var$autoScrolls[this.layer].vy ? $3bc6321cdb0e9401$var$autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = $3bc6321cdb0e9401$var$autoScrolls[this.layer].vx ? $3bc6321cdb0e9401$var$autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === \"function\") {\n if (scrollCustomFn.call($3bc6321cdb0e9401$export$31b3ca70d8f57423.dragged.parentNode[$3bc6321cdb0e9401$var$expando], scrollOffsetX, scrollOffsetY, evt, $3bc6321cdb0e9401$var$touchEvt$1, $3bc6321cdb0e9401$var$autoScrolls[this.layer].el) !== \"continue\") return;\n }\n $3bc6321cdb0e9401$var$scrollBy($3bc6321cdb0e9401$var$autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }).bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n }while (options.bubbleScroll && currentParent !== winScroller && (currentParent = $3bc6321cdb0e9401$var$getParentAutoScrollElement(currentParent, false)));\n $3bc6321cdb0e9401$var$scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\nvar $3bc6321cdb0e9401$var$drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, dragEl = _ref.dragEl, activeSortable = _ref.activeSortable, dispatchSortableEvent = _ref.dispatchSortableEvent, hideGhostForTarget = _ref.hideGhostForTarget, unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent(\"spill\");\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction $3bc6321cdb0e9401$var$Revert() {}\n$3bc6321cdb0e9401$var$Revert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl, putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) putSortable.captureAnimationState();\n var nextSibling = $3bc6321cdb0e9401$var$getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) this.sortable.el.insertBefore(dragEl, nextSibling);\n else this.sortable.el.appendChild(dragEl);\n this.sortable.animateAll();\n if (putSortable) putSortable.animateAll();\n },\n drop: $3bc6321cdb0e9401$var$drop\n};\n$3bc6321cdb0e9401$var$_extends($3bc6321cdb0e9401$var$Revert, {\n pluginName: \"revertOnSpill\"\n});\nfunction $3bc6321cdb0e9401$var$Remove() {}\n$3bc6321cdb0e9401$var$Remove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl, putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: $3bc6321cdb0e9401$var$drop\n};\n$3bc6321cdb0e9401$var$_extends($3bc6321cdb0e9401$var$Remove, {\n pluginName: \"removeOnSpill\"\n});\nvar $3bc6321cdb0e9401$var$lastSwapEl;\nfunction $3bc6321cdb0e9401$export$bdb5f0a1b77546f4() {\n function Swap() {\n this.defaults = {\n swapClass: \"sortable-swap-highlight\"\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n $3bc6321cdb0e9401$var$lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed, target = _ref2.target, onMove = _ref2.onMove, activeSortable = _ref2.activeSortable, changed = _ref2.changed, cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el, options = this.options;\n if (target && target !== el) {\n var prevSwapEl = $3bc6321cdb0e9401$var$lastSwapEl;\n if (onMove(target) !== false) {\n $3bc6321cdb0e9401$var$toggleClass(target, options.swapClass, true);\n $3bc6321cdb0e9401$var$lastSwapEl = target;\n } else $3bc6321cdb0e9401$var$lastSwapEl = null;\n if (prevSwapEl && prevSwapEl !== $3bc6321cdb0e9401$var$lastSwapEl) $3bc6321cdb0e9401$var$toggleClass(prevSwapEl, options.swapClass, false);\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable, putSortable = _ref3.putSortable, dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n $3bc6321cdb0e9401$var$lastSwapEl && $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$lastSwapEl, options.swapClass, false);\n if ($3bc6321cdb0e9401$var$lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== $3bc6321cdb0e9401$var$lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n $3bc6321cdb0e9401$var$swapNodes(dragEl, $3bc6321cdb0e9401$var$lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n $3bc6321cdb0e9401$var$lastSwapEl = null;\n }\n };\n return $3bc6321cdb0e9401$var$_extends(Swap, {\n pluginName: \"swap\",\n eventProperties: function eventProperties() {\n return {\n swapItem: $3bc6321cdb0e9401$var$lastSwapEl\n };\n }\n });\n}\nfunction $3bc6321cdb0e9401$var$swapNodes(n1, n2) {\n var p1 = n1.parentNode, p2 = n2.parentNode, i1, i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = $3bc6321cdb0e9401$var$index(n1);\n i2 = $3bc6321cdb0e9401$var$index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) i2++;\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\nvar $3bc6321cdb0e9401$var$multiDragElements = [], $3bc6321cdb0e9401$var$multiDragClones = [], $3bc6321cdb0e9401$var$lastMultiDragSelect, // for selection with modifier key down (SHIFT)\n$3bc6321cdb0e9401$var$multiDragSortable, $3bc6321cdb0e9401$var$initialFolding = false, // Initial multi-drag fold when drag started\n$3bc6321cdb0e9401$var$folding = false, // Folding any other time\n$3bc6321cdb0e9401$var$dragStarted = false, $3bc6321cdb0e9401$var$dragEl$1, $3bc6321cdb0e9401$var$clonesFromRect, $3bc6321cdb0e9401$var$clonesHidden;\nfunction $3bc6321cdb0e9401$export$18e5d2a5d1df842d() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for(var fn in this)if (fn.charAt(0) === \"_\" && typeof this[fn] === \"function\") this[fn] = this[fn].bind(this);\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) $3bc6321cdb0e9401$var$on(document, \"pointerup\", this._deselectMultiDrag);\n else {\n $3bc6321cdb0e9401$var$on(document, \"mouseup\", this._deselectMultiDrag);\n $3bc6321cdb0e9401$var$on(document, \"touchend\", this._deselectMultiDrag);\n }\n }\n $3bc6321cdb0e9401$var$on(document, \"keydown\", this._checkKeyDown);\n $3bc6321cdb0e9401$var$on(document, \"keyup\", this._checkKeyUp);\n this.defaults = {\n selectedClass: \"sortable-selected\",\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = \"\";\n if ($3bc6321cdb0e9401$var$multiDragElements.length && $3bc6321cdb0e9401$var$multiDragSortable === sortable) $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement, i) {\n data += (!i ? \"\" : \", \") + multiDragElement.textContent;\n });\n else data = dragEl.textContent;\n dataTransfer.setData(\"Text\", data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n $3bc6321cdb0e9401$var$dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~$3bc6321cdb0e9401$var$multiDragElements.indexOf($3bc6321cdb0e9401$var$dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable, cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for(var i = 0; i < $3bc6321cdb0e9401$var$multiDragElements.length; i++){\n $3bc6321cdb0e9401$var$multiDragClones.push($3bc6321cdb0e9401$var$clone($3bc6321cdb0e9401$var$multiDragElements[i]));\n $3bc6321cdb0e9401$var$multiDragClones[i].sortableIndex = $3bc6321cdb0e9401$var$multiDragElements[i].sortableIndex;\n $3bc6321cdb0e9401$var$multiDragClones[i].draggable = false;\n $3bc6321cdb0e9401$var$multiDragClones[i].style[\"will-change\"] = \"\";\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$multiDragClones[i], this.options.selectedClass, false);\n $3bc6321cdb0e9401$var$multiDragElements[i] === $3bc6321cdb0e9401$var$dragEl$1 && $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable, rootEl = _ref3.rootEl, dispatchSortableEvent = _ref3.dispatchSortableEvent, cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if ($3bc6321cdb0e9401$var$multiDragElements.length && $3bc6321cdb0e9401$var$multiDragSortable === sortable) {\n $3bc6321cdb0e9401$var$insertMultiDragClones(true, rootEl);\n dispatchSortableEvent(\"clone\");\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown, rootEl = _ref4.rootEl, cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n $3bc6321cdb0e9401$var$insertMultiDragClones(false, rootEl);\n $3bc6321cdb0e9401$var$multiDragClones.forEach(function(clone) {\n $3bc6321cdb0e9401$var$css(clone, \"display\", \"\");\n });\n cloneNowShown();\n $3bc6321cdb0e9401$var$clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable, cloneNowHidden = _ref5.cloneNowHidden, cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n $3bc6321cdb0e9401$var$multiDragClones.forEach(function(clone) {\n $3bc6321cdb0e9401$var$css(clone, \"display\", \"none\");\n if (_this.options.removeCloneOnHide && clone.parentNode) clone.parentNode.removeChild(clone);\n });\n cloneNowHidden();\n $3bc6321cdb0e9401$var$clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && $3bc6321cdb0e9401$var$multiDragSortable) $3bc6321cdb0e9401$var$multiDragSortable.multiDrag._deselectMultiDrag();\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n multiDragElement.sortableIndex = $3bc6321cdb0e9401$var$index(multiDragElement);\n });\n // Sort multi-drag elements\n $3bc6321cdb0e9401$var$multiDragElements = $3bc6321cdb0e9401$var$multiDragElements.sort(function(a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n $3bc6321cdb0e9401$var$dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n sortable.captureAnimationState();\n if (this.options.animation) {\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $3bc6321cdb0e9401$var$dragEl$1) return;\n $3bc6321cdb0e9401$var$css(multiDragElement, \"position\", \"absolute\");\n });\n var dragRect = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$dragEl$1, false, true, true);\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $3bc6321cdb0e9401$var$dragEl$1) return;\n $3bc6321cdb0e9401$var$setRect(multiDragElement, dragRect);\n });\n $3bc6321cdb0e9401$var$folding = true;\n $3bc6321cdb0e9401$var$initialFolding = true;\n }\n }\n sortable.animateAll(function() {\n $3bc6321cdb0e9401$var$folding = false;\n $3bc6321cdb0e9401$var$initialFolding = false;\n if (_this2.options.animation) $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n $3bc6321cdb0e9401$var$unsetRect(multiDragElement);\n });\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) $3bc6321cdb0e9401$var$removeMultiDragElements();\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target, completed = _ref8.completed, cancel = _ref8.cancel;\n if ($3bc6321cdb0e9401$var$folding && ~$3bc6321cdb0e9401$var$multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable, rootEl = _ref9.rootEl, sortable = _ref9.sortable, dragRect = _ref9.dragRect;\n if ($3bc6321cdb0e9401$var$multiDragElements.length > 1) {\n // Setup unfold animation\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: $3bc6321cdb0e9401$var$folding ? $3bc6321cdb0e9401$var$getRect(multiDragElement) : dragRect\n });\n $3bc6321cdb0e9401$var$unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n $3bc6321cdb0e9401$var$folding = false;\n $3bc6321cdb0e9401$var$insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable, isOwner = _ref10.isOwner, insertion = _ref10.insertion, activeSortable = _ref10.activeSortable, parentEl = _ref10.parentEl, putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) activeSortable._hideClone();\n $3bc6321cdb0e9401$var$initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && $3bc6321cdb0e9401$var$multiDragElements.length > 1 && ($3bc6321cdb0e9401$var$folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$dragEl$1, false, true, true);\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $3bc6321cdb0e9401$var$dragEl$1) return;\n $3bc6321cdb0e9401$var$setRect(multiDragElement, dragRectAbsolute);\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n $3bc6321cdb0e9401$var$folding = true;\n }\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!$3bc6321cdb0e9401$var$folding) $3bc6321cdb0e9401$var$removeMultiDragElements();\n if ($3bc6321cdb0e9401$var$multiDragElements.length > 1) {\n var clonesHiddenBefore = $3bc6321cdb0e9401$var$clonesHidden;\n activeSortable._showClone(sortable);\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !$3bc6321cdb0e9401$var$clonesHidden && clonesHiddenBefore) $3bc6321cdb0e9401$var$multiDragClones.forEach(function(clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: $3bc6321cdb0e9401$var$clonesFromRect\n });\n clone.fromRect = $3bc6321cdb0e9401$var$clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n } else activeSortable._showClone(sortable);\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect, isOwner = _ref11.isOwner, activeSortable = _ref11.activeSortable;\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n $3bc6321cdb0e9401$var$clonesFromRect = $3bc6321cdb0e9401$var$_extends({}, dragRect);\n var dragMatrix = $3bc6321cdb0e9401$var$matrix($3bc6321cdb0e9401$var$dragEl$1, true);\n $3bc6321cdb0e9401$var$clonesFromRect.top -= dragMatrix.f;\n $3bc6321cdb0e9401$var$clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if ($3bc6321cdb0e9401$var$folding) {\n $3bc6321cdb0e9401$var$folding = false;\n $3bc6321cdb0e9401$var$removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent, rootEl = _ref12.rootEl, parentEl = _ref12.parentEl, sortable = _ref12.sortable, dispatchSortableEvent = _ref12.dispatchSortableEvent, oldIndex = _ref12.oldIndex, putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options, children = parentEl.children;\n // Multi-drag selection\n if (!$3bc6321cdb0e9401$var$dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) this._deselectMultiDrag();\n $3bc6321cdb0e9401$var$toggleClass($3bc6321cdb0e9401$var$dragEl$1, options.selectedClass, !~$3bc6321cdb0e9401$var$multiDragElements.indexOf($3bc6321cdb0e9401$var$dragEl$1));\n if (!~$3bc6321cdb0e9401$var$multiDragElements.indexOf($3bc6321cdb0e9401$var$dragEl$1)) {\n $3bc6321cdb0e9401$var$multiDragElements.push($3bc6321cdb0e9401$var$dragEl$1);\n $3bc6321cdb0e9401$var$dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: \"select\",\n targetEl: $3bc6321cdb0e9401$var$dragEl$1,\n originalEvent: evt\n });\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && $3bc6321cdb0e9401$var$lastMultiDragSelect && sortable.el.contains($3bc6321cdb0e9401$var$lastMultiDragSelect)) {\n var lastIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$lastMultiDragSelect), currentIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n for(; i < n; i++){\n if (~$3bc6321cdb0e9401$var$multiDragElements.indexOf(children[i])) continue;\n $3bc6321cdb0e9401$var$toggleClass(children[i], options.selectedClass, true);\n $3bc6321cdb0e9401$var$multiDragElements.push(children[i]);\n $3bc6321cdb0e9401$var$dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: \"select\",\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else $3bc6321cdb0e9401$var$lastMultiDragSelect = $3bc6321cdb0e9401$var$dragEl$1;\n $3bc6321cdb0e9401$var$multiDragSortable = toSortable;\n } else {\n $3bc6321cdb0e9401$var$multiDragElements.splice($3bc6321cdb0e9401$var$multiDragElements.indexOf($3bc6321cdb0e9401$var$dragEl$1), 1);\n $3bc6321cdb0e9401$var$lastMultiDragSelect = null;\n $3bc6321cdb0e9401$var$dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: \"deselect\",\n targetEl: $3bc6321cdb0e9401$var$dragEl$1,\n originalEvent: evt\n });\n }\n }\n // Multi-drag drop\n if ($3bc6321cdb0e9401$var$dragStarted && this.isMultiDrag) {\n $3bc6321cdb0e9401$var$folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[$3bc6321cdb0e9401$var$expando].options.sort || parentEl !== rootEl) && $3bc6321cdb0e9401$var$multiDragElements.length > 1) {\n var dragRect = $3bc6321cdb0e9401$var$getRect($3bc6321cdb0e9401$var$dragEl$1), multiDragIndex = $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl$1, \":not(.\" + this.options.selectedClass + \")\");\n if (!$3bc6321cdb0e9401$var$initialFolding && options.animation) $3bc6321cdb0e9401$var$dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!$3bc6321cdb0e9401$var$initialFolding) {\n if (options.animation) {\n $3bc6321cdb0e9401$var$dragEl$1.fromRect = dragRect;\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== $3bc6321cdb0e9401$var$dragEl$1) {\n var rect = $3bc6321cdb0e9401$var$folding ? $3bc6321cdb0e9401$var$getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n $3bc6321cdb0e9401$var$removeMultiDragElements();\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n if (children[multiDragIndex]) parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n else parentEl.appendChild(multiDragElement);\n multiDragIndex++;\n });\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === $3bc6321cdb0e9401$var$index($3bc6321cdb0e9401$var$dragEl$1)) {\n var update = false;\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement.sortableIndex !== $3bc6321cdb0e9401$var$index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent(\"update\");\n dispatchSortableEvent(\"sort\");\n }\n }\n }\n // Must be done after capturing individual rects (scroll bar)\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n $3bc6321cdb0e9401$var$unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n $3bc6321cdb0e9401$var$multiDragSortable = toSortable;\n }\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== \"clone\") $3bc6321cdb0e9401$var$multiDragClones.forEach(function(clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = $3bc6321cdb0e9401$var$dragStarted = false;\n $3bc6321cdb0e9401$var$multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n $3bc6321cdb0e9401$var$off(document, \"pointerup\", this._deselectMultiDrag);\n $3bc6321cdb0e9401$var$off(document, \"mouseup\", this._deselectMultiDrag);\n $3bc6321cdb0e9401$var$off(document, \"touchend\", this._deselectMultiDrag);\n $3bc6321cdb0e9401$var$off(document, \"keydown\", this._checkKeyDown);\n $3bc6321cdb0e9401$var$off(document, \"keyup\", this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof $3bc6321cdb0e9401$var$dragStarted !== \"undefined\" && $3bc6321cdb0e9401$var$dragStarted) return;\n // Only deselect if selection is in this sortable\n if ($3bc6321cdb0e9401$var$multiDragSortable !== this.sortable) return;\n // Only deselect if target is not item in this sortable\n if (evt && $3bc6321cdb0e9401$var$closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while($3bc6321cdb0e9401$var$multiDragElements.length){\n var el = $3bc6321cdb0e9401$var$multiDragElements[0];\n $3bc6321cdb0e9401$var$toggleClass(el, this.options.selectedClass, false);\n $3bc6321cdb0e9401$var$multiDragElements.shift();\n $3bc6321cdb0e9401$var$dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: \"deselect\",\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) this.multiDragKeyDown = true;\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) this.multiDragKeyDown = false;\n }\n };\n return $3bc6321cdb0e9401$var$_extends(MultiDrag, {\n // Static methods & properties\n pluginName: \"multiDrag\",\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */ select: function select(el) {\n var sortable = el.parentNode[$3bc6321cdb0e9401$var$expando];\n if (!sortable || !sortable.options.multiDrag || ~$3bc6321cdb0e9401$var$multiDragElements.indexOf(el)) return;\n if ($3bc6321cdb0e9401$var$multiDragSortable && $3bc6321cdb0e9401$var$multiDragSortable !== sortable) {\n $3bc6321cdb0e9401$var$multiDragSortable.multiDrag._deselectMultiDrag();\n $3bc6321cdb0e9401$var$multiDragSortable = sortable;\n }\n $3bc6321cdb0e9401$var$toggleClass(el, sortable.options.selectedClass, true);\n $3bc6321cdb0e9401$var$multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */ deselect: function deselect(el) {\n var sortable = el.parentNode[$3bc6321cdb0e9401$var$expando], index = $3bc6321cdb0e9401$var$multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n $3bc6321cdb0e9401$var$toggleClass(el, sortable.options.selectedClass, false);\n $3bc6321cdb0e9401$var$multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [], newIndicies = [];\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n // multiDragElements will already be sorted if folding\n var newIndex;\n if ($3bc6321cdb0e9401$var$folding && multiDragElement !== $3bc6321cdb0e9401$var$dragEl$1) newIndex = -1;\n else if ($3bc6321cdb0e9401$var$folding) newIndex = $3bc6321cdb0e9401$var$index(multiDragElement, \":not(.\" + _this3.options.selectedClass + \")\");\n else newIndex = $3bc6321cdb0e9401$var$index(multiDragElement);\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: $3bc6321cdb0e9401$var$_toConsumableArray($3bc6321cdb0e9401$var$multiDragElements),\n clones: [].concat($3bc6321cdb0e9401$var$multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === \"ctrl\") key = \"Control\";\n else if (key.length > 1) key = key.charAt(0).toUpperCase() + key.substr(1);\n return key;\n }\n }\n });\n}\nfunction $3bc6321cdb0e9401$var$insertMultiDragElements(clonesInserted, rootEl) {\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) rootEl.insertBefore(multiDragElement, target);\n else rootEl.appendChild(multiDragElement);\n });\n}\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */ function $3bc6321cdb0e9401$var$insertMultiDragClones(elementsInserted, rootEl) {\n $3bc6321cdb0e9401$var$multiDragClones.forEach(function(clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) rootEl.insertBefore(clone, target);\n else rootEl.appendChild(clone);\n });\n}\nfunction $3bc6321cdb0e9401$var$removeMultiDragElements() {\n $3bc6321cdb0e9401$var$multiDragElements.forEach(function(multiDragElement) {\n if (multiDragElement === $3bc6321cdb0e9401$var$dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n$3bc6321cdb0e9401$export$31b3ca70d8f57423.mount(new $3bc6321cdb0e9401$var$AutoScrollPlugin());\n$3bc6321cdb0e9401$export$31b3ca70d8f57423.mount($3bc6321cdb0e9401$var$Remove, $3bc6321cdb0e9401$var$Revert);\nvar $3bc6321cdb0e9401$export$2e2bcd8739ae039 = $3bc6321cdb0e9401$export$31b3ca70d8f57423;\n\n\nasync function $48e8ed6252738c92$export$1402cba6a733f33a() {\n return new Promise((resolve)=>{\n requestAnimationFrame(resolve);\n });\n}\n\n\nfunction $6a8d624098efe915$export$dc799133ea41435b(y, x, h, derivatives) {\n const n = y.length;\n const dydx = derivatives(y, x);\n const yTemp = dydx; // Reuse array for result to avoid allocation and GC\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h * dydx[i];\n return yTemp;\n}\nfunction $6a8d624098efe915$export$926181dbdeb3ce30(y, x, h, derivatives) {\n const n = y.length;\n const dydx = derivatives(y, x);\n const yTemp = new Array(n);\n const h2 = h / 2.0;\n const h6 = h / 6.0;\n const xhh = x + h2;\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h2 * dydx[i];\n let dydxTemp = derivatives(yTemp, xhh);\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h2 * dydxTemp[i];\n const dydxM = derivatives(yTemp, xhh);\n for(let i = 0; i < n; i += 1){\n yTemp[i] = y[i] + h * dydxM[i];\n dydxM[i] += dydxTemp[i];\n }\n dydxTemp = derivatives(yTemp, x + h);\n for(let i = 0; i < n; i += 1)yTemp[i] = y[i] + h6 * (dydx[i] + dydxTemp[i] + 2.0 * dydxM[i]);\n return yTemp;\n}\n\n\nfunction $867aa247f14d8746$export$35d34bc0ed591a92(stocksAtT, t, h, getFlows, integrator = (0, $6a8d624098efe915$export$926181dbdeb3ce30)) {\n return integrator(stocksAtT, t, h, getFlows);\n}\nfunction $867aa247f14d8746$export$342c33653c71264(stocksAtT, t, h, getFlows, criterion, integrator = (0, $6a8d624098efe915$export$926181dbdeb3ce30)) {\n let iterations = 0;\n let { userdata: userdata, done: done } = criterion(stocksAtT, t, undefined, iterations);\n if (!done) {\n let newT = t;\n let newStocks;\n do {\n newStocks = integrator(newStocks !== null && newStocks !== void 0 ? newStocks : stocksAtT, newT, h, getFlows);\n newT += h;\n iterations += 1;\n ({ userdata: userdata, done: done } = criterion(newStocks, newT, userdata, iterations));\n }while (!done);\n }\n return userdata;\n}\n\n\nfunction $c7f17e22947729fa$var$step5(stocksAtT, t, h, computeFlows, integrator) {\n return (0, $867aa247f14d8746$export$35d34bc0ed591a92)(stocksAtT, t, h, computeFlows, integrator);\n}\nfunction $c7f17e22947729fa$var$step6(stocksAtT, flowsAtT, t, h, computeFlows, integrator) {\n const mutableFlowsAtT = [\n ...flowsAtT\n ];\n const getFlows = (y, x)=>x === t ? mutableFlowsAtT : computeFlows(y, x);\n return (0, $867aa247f14d8746$export$35d34bc0ed591a92)(stocksAtT, t, h, getFlows, integrator);\n}\nfunction $c7f17e22947729fa$export$35d34bc0ed591a92(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrIntegrator, integrator) {\n if (typeof tOrFlowsAtT === \"number\") return $c7f17e22947729fa$var$step5(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrIntegrator);\n return $c7f17e22947729fa$var$step6(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrIntegrator, integrator);\n}\nfunction $c7f17e22947729fa$var$converge6(stocksAtT, t, h, computeFlows, criterion, integrator) {\n return (0, $867aa247f14d8746$export$342c33653c71264)(stocksAtT, t, h, computeFlows, criterion, integrator);\n}\nfunction $c7f17e22947729fa$var$converge7(stocksAtT, flowsAtT, t, h, computeFlows, criterion, integrator) {\n const mutableFlowsAtT = [\n ...flowsAtT\n ];\n const getFlows = (y, x)=>x === t ? mutableFlowsAtT : computeFlows(y, x);\n return (0, $867aa247f14d8746$export$342c33653c71264)(stocksAtT, t, h, getFlows, criterion, integrator);\n}\nfunction $c7f17e22947729fa$export$342c33653c71264(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrCriterion, criterionOrIntegrator, integrator) {\n if (typeof tOrFlowsAtT === \"number\") return $c7f17e22947729fa$var$converge6(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrCriterion, criterionOrIntegrator);\n return $c7f17e22947729fa$var$converge7(stocksAtT, tOrFlowsAtT, tOrH, hOrComputeFlows, computeFlowsOrCriterion, criterionOrIntegrator, integrator);\n}\n\n\nclass $84b4e0427207f64e$export$a1edc412be3e1841 {\n static elementObjectToArray(ids, object) {\n return ids.map((id)=>object[id]);\n }\n static arrayToElementObject(ids, array) {\n const result = {};\n for(let i = 0; i < ids.length; i += 1){\n const id = ids[i];\n result[id] = array[i];\n }\n return result;\n }\n stocksToStockArray(stocks) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.elementObjectToArray(this.stockIds, stocks);\n }\n stockArrayToStocks(stockArray) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.arrayToElementObject(this.stockIds, stockArray);\n }\n flowsToFlowArray(flows) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.elementObjectToArray(this.flowIds, flows);\n }\n flowArrayToFlows(flowArray) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.arrayToElementObject(this.flowIds, flowArray);\n }\n variablesToVariableArray(variables) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.elementObjectToArray(this.variableIds, variables);\n }\n variableArrayToVariables(variableArray) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.arrayToElementObject(this.variableIds, variableArray);\n }\n parametersToParameterArray(parameters) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.elementObjectToArray(this.parameterIds, parameters);\n }\n parameterArrayToParameters(parameterArray) {\n return $84b4e0427207f64e$export$a1edc412be3e1841.arrayToElementObject(this.parameterIds, parameterArray);\n }\n evaluateFlowPerStock(stocks, parameters, t) {\n const { flows: flows } = this.evaluate(stocks, parameters, t);\n return this.accumulateFlowsPerStock(flows);\n }\n createFlowEvaluator(parameters) {\n const result = (stocksArray, t)=>{\n const stocks = this.stockArrayToStocks(stocksArray);\n const flowsPerStock = this.evaluateFlowPerStock(stocks, parameters, t);\n const flowPerStockArray = this.stocksToStockArray(flowsPerStock);\n return flowPerStockArray;\n };\n return result;\n }\n step(stocks, t, h, flowEvaluator) {\n const stocksArray = this.stocksToStockArray(stocks);\n const newStocksArray = (0, $c7f17e22947729fa$export$35d34bc0ed591a92)(stocksArray, t, h, flowEvaluator);\n return this.stockArrayToStocks(newStocksArray);\n }\n constructor(stocksIds, flowIds, variableIds, parameterIds){\n this.stockIds = stocksIds;\n this.flowIds = flowIds;\n this.variableIds = variableIds;\n this.parameterIds = parameterIds;\n }\n}\n$84b4e0427207f64e$export$a1edc412be3e1841.elementIds = [\n \"stocks\",\n \"parameters\",\n \"variables\",\n \"flows\"\n];\n\n\nconst $921d098521bb0b85$var$stockIds = [\n \"capacityOfNewlyProducedPhones\",\n \"capacityOfRecycledMaterials\",\n \"capacityOfRefurbishedPhones\",\n \"capacityOfRepairedPhones\",\n \"phonesInUse\",\n \"supplyOfBrokenPhones\",\n \"supplyOfDisposedPhones\",\n \"supplyOfHibernatingPhones\",\n \"supplyOfNewlyProducedPhones\",\n \"supplyOfRecycledMaterials\",\n \"supplyOfRefurbishedPhones\",\n \"supplyOfRepairedPhones\"\n];\nconst $921d098521bb0b85$var$flowIds = [\n \"abandon\",\n \"acquireNewlyProduced\",\n \"acquireRefurbished\",\n \"acquireRepaired\",\n \"acquireUsed\",\n \"capacityOfNewlyProducedPhonesAdjustment\",\n \"capacityOfRecycledMaterialsAdjustment\",\n \"capacityOfRefurbishedPhonesAdjustment\",\n \"disposeBroken\",\n \"disposeHibernating\",\n \"goBroken\",\n \"landfill\",\n \"produceFromNaturalResources\",\n \"produceFromRecycledMaterials\",\n \"recycle\",\n \"refurbish\",\n \"repair\",\n \"repairShopCapcityAdjustment\"\n];\nconst $921d098521bb0b85$var$variableIds = [\n \"demandForNaturalResources\",\n \"demandForNewlyProducedPhones\",\n \"demandForPhones\",\n \"demandForRecycledMaterials\",\n \"demandForRefurbishedPhones\",\n \"demandForRefurbishment\",\n \"demandForRepairedPhones\",\n \"demandForReusedPhones\",\n \"inflowIncentiveSumForPhonesInUse\",\n \"phoneGoal\",\n \"phonesInUseExcess\",\n \"recycleDemand\",\n \"repairDemand\",\n \"resourceDemand\",\n \"supplyOfBrokenPhonesForDisposal\",\n \"supplyOfBrokenPhonesForRepair\",\n \"supplyOfDisposedPhonesForLandfilling\",\n \"supplyOfDisposedPhonesForRecycling\"\n];\nconst $921d098521bb0b85$var$parameterIds = [\n \"abandonExcessRate\",\n \"abandonRate\",\n \"acquireRate\",\n \"breakRate\",\n \"capacityAdjustmentRate\",\n \"disposeIncentive\",\n \"disposeRate\",\n \"durability\",\n \"landfillIncentive\",\n \"landfillRate\",\n \"naturalResourcesIncentive\",\n \"newPhoneProductionRate\",\n \"newlyProducedPhoneIncentive\",\n \"numberOfUsers\",\n \"phonesPerUserGoal\",\n \"recycleRate\",\n \"recyclingIncentive\",\n \"refurbishmentIncentive\",\n \"refurbishmentRate\",\n \"repairIncentive\",\n \"repairRate\",\n \"reuseIncentive\"\n];\nclass $921d098521bb0b85$var$CircularEconomyModel extends (0, $84b4e0427207f64e$export$a1edc412be3e1841) {\n // eslint-disable-next-line class-methods-use-this\n evaluate(stocks, parameters, t) {\n const { capacityOfNewlyProducedPhones: capacityOfNewlyProducedPhones, capacityOfRecycledMaterials: capacityOfRecycledMaterials, capacityOfRefurbishedPhones: capacityOfRefurbishedPhones, capacityOfRepairedPhones: capacityOfRepairedPhones, phonesInUse: phonesInUse, supplyOfBrokenPhones: supplyOfBrokenPhones, supplyOfDisposedPhones: supplyOfDisposedPhones, supplyOfHibernatingPhones: supplyOfHibernatingPhones, supplyOfNewlyProducedPhones: supplyOfNewlyProducedPhones, supplyOfRecycledMaterials: supplyOfRecycledMaterials, supplyOfRefurbishedPhones: supplyOfRefurbishedPhones, supplyOfRepairedPhones: supplyOfRepairedPhones } = stocks;\n const { abandonExcessRate: abandonExcessRate, abandonRate: abandonRate, acquireRate: acquireRate, breakRate: breakRate, capacityAdjustmentRate: capacityAdjustmentRate, disposeIncentive: disposeIncentive, disposeRate: disposeRate, durability: durability, landfillIncentive: landfillIncentive, landfillRate: landfillRate, naturalResourcesIncentive: naturalResourcesIncentive, newPhoneProductionRate: newPhoneProductionRate, newlyProducedPhoneIncentive: newlyProducedPhoneIncentive, numberOfUsers: numberOfUsers, phonesPerUserGoal: phonesPerUserGoal, recycleRate: recycleRate, recyclingIncentive: recyclingIncentive, refurbishmentIncentive: refurbishmentIncentive, refurbishmentRate: refurbishmentRate, repairIncentive: repairIncentive, repairRate: repairRate, reuseIncentive: reuseIncentive } = parameters;\n const phoneGoal = numberOfUsers * phonesPerUserGoal;\n const phonesInUseExcess = Math.max(phonesInUse - phoneGoal, 0);\n const abandon = abandonRate * phonesInUse + abandonExcessRate * phonesInUseExcess;\n const inflowIncentiveSumForPhonesInUse = reuseIncentive + repairIncentive + refurbishmentIncentive + newlyProducedPhoneIncentive;\n const demandForPhones = Math.max(0, phoneGoal - phonesInUse);\n const demandForNewlyProducedPhones = newlyProducedPhoneIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireNewlyProduced = acquireRate * Math.min(supplyOfNewlyProducedPhones, demandForNewlyProducedPhones);\n const demandForRefurbishedPhones = refurbishmentIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireRefurbished = acquireRate * Math.min(demandForRefurbishedPhones, supplyOfRefurbishedPhones);\n const demandForRepairedPhones = repairIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireRepaired = acquireRate * Math.min(demandForRepairedPhones, supplyOfRepairedPhones);\n const demandForReusedPhones = reuseIncentive / inflowIncentiveSumForPhonesInUse * demandForPhones;\n const acquireUsed = acquireRate * Math.min(supplyOfHibernatingPhones, demandForReusedPhones);\n const capacityOfNewlyProducedPhonesAdjustment = capacityAdjustmentRate * (demandForNewlyProducedPhones - capacityOfNewlyProducedPhones);\n const resourceDemand = Math.max(capacityOfNewlyProducedPhones - supplyOfNewlyProducedPhones, 0);\n const demandForRecycledMaterials = recyclingIncentive / (naturalResourcesIncentive + recyclingIncentive) * resourceDemand;\n const capacityOfRecycledMaterialsAdjustment = capacityAdjustmentRate * (demandForRecycledMaterials - capacityOfRecycledMaterials);\n const capacityOfRefurbishedPhonesAdjustment = capacityAdjustmentRate * (demandForRefurbishedPhones - capacityOfRefurbishedPhones);\n const supplyOfBrokenPhonesForDisposal = disposeIncentive / (repairIncentive + disposeIncentive) * supplyOfBrokenPhones;\n const disposeBroken = disposeRate * supplyOfBrokenPhonesForDisposal;\n const disposeHibernating = disposeRate * supplyOfHibernatingPhones;\n const goBroken = breakRate / durability * phonesInUse;\n const supplyOfDisposedPhonesForLandfilling = landfillIncentive / (recyclingIncentive + landfillIncentive) * supplyOfDisposedPhones;\n const landfill = landfillRate * supplyOfDisposedPhonesForLandfilling;\n const demandForNaturalResources = naturalResourcesIncentive / (naturalResourcesIncentive + recyclingIncentive) * resourceDemand;\n const produceFromNaturalResources = newPhoneProductionRate * demandForNaturalResources;\n const produceFromRecycledMaterials = newPhoneProductionRate * Math.min(demandForRecycledMaterials, supplyOfRecycledMaterials);\n const supplyOfDisposedPhonesForRecycling = recyclingIncentive / (recyclingIncentive + landfillIncentive) * supplyOfDisposedPhones;\n const recycleDemand = Math.max(capacityOfRecycledMaterials - supplyOfRecycledMaterials, 0);\n const recycle = recycleRate * Math.min(supplyOfDisposedPhonesForRecycling, recycleDemand);\n const demandForRefurbishment = Math.max(capacityOfRefurbishedPhones - supplyOfRefurbishedPhones, 0);\n const refurbish = refurbishmentRate * Math.min(supplyOfHibernatingPhones, demandForRefurbishment);\n const repairDemand = Math.max(capacityOfRepairedPhones - supplyOfRepairedPhones, 0);\n const repair = repairRate * Math.min(supplyOfBrokenPhones, repairDemand);\n const repairShopCapcityAdjustment = capacityAdjustmentRate * (demandForRepairedPhones - capacityOfRepairedPhones);\n const supplyOfBrokenPhonesForRepair = repairIncentive / (repairIncentive + disposeIncentive) * supplyOfBrokenPhones;\n const variables = {\n demandForNaturalResources: demandForNaturalResources,\n demandForNewlyProducedPhones: demandForNewlyProducedPhones,\n demandForPhones: demandForPhones,\n demandForRecycledMaterials: demandForRecycledMaterials,\n demandForRefurbishedPhones: demandForRefurbishedPhones,\n demandForRefurbishment: demandForRefurbishment,\n demandForRepairedPhones: demandForRepairedPhones,\n demandForReusedPhones: demandForReusedPhones,\n inflowIncentiveSumForPhonesInUse: inflowIncentiveSumForPhonesInUse,\n phoneGoal: phoneGoal,\n phonesInUseExcess: phonesInUseExcess,\n recycleDemand: recycleDemand,\n repairDemand: repairDemand,\n resourceDemand: resourceDemand,\n supplyOfBrokenPhonesForDisposal: supplyOfBrokenPhonesForDisposal,\n supplyOfBrokenPhonesForRepair: supplyOfBrokenPhonesForRepair,\n supplyOfDisposedPhonesForLandfilling: supplyOfDisposedPhonesForLandfilling,\n supplyOfDisposedPhonesForRecycling: supplyOfDisposedPhonesForRecycling\n };\n const flows = {\n abandon: abandon,\n acquireNewlyProduced: acquireNewlyProduced,\n acquireRefurbished: acquireRefurbished,\n acquireRepaired: acquireRepaired,\n acquireUsed: acquireUsed,\n capacityOfNewlyProducedPhonesAdjustment: capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterialsAdjustment: capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhonesAdjustment: capacityOfRefurbishedPhonesAdjustment,\n disposeBroken: disposeBroken,\n disposeHibernating: disposeHibernating,\n goBroken: goBroken,\n landfill: landfill,\n produceFromNaturalResources: produceFromNaturalResources,\n produceFromRecycledMaterials: produceFromRecycledMaterials,\n recycle: recycle,\n refurbish: refurbish,\n repair: repair,\n repairShopCapcityAdjustment: repairShopCapcityAdjustment\n };\n return {\n t: t,\n stocks: stocks,\n parameters: parameters,\n variables: variables,\n flows: flows\n };\n }\n // eslint-disable-next-line class-methods-use-this\n accumulateFlowsPerStock(flows) {\n const { abandon: abandon, acquireNewlyProduced: acquireNewlyProduced, acquireRefurbished: acquireRefurbished, acquireRepaired: acquireRepaired, acquireUsed: acquireUsed, capacityOfNewlyProducedPhonesAdjustment: capacityOfNewlyProducedPhonesAdjustment, capacityOfRecycledMaterialsAdjustment: capacityOfRecycledMaterialsAdjustment, capacityOfRefurbishedPhonesAdjustment: capacityOfRefurbishedPhonesAdjustment, disposeBroken: disposeBroken, disposeHibernating: disposeHibernating, goBroken: goBroken, landfill: landfill, produceFromNaturalResources: produceFromNaturalResources, produceFromRecycledMaterials: produceFromRecycledMaterials, recycle: recycle, refurbish: refurbish, repair: repair, repairShopCapcityAdjustment: repairShopCapcityAdjustment } = flows;\n const flowPerStock = {\n capacityOfNewlyProducedPhones: capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterials: capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhones: capacityOfRefurbishedPhonesAdjustment,\n capacityOfRepairedPhones: repairShopCapcityAdjustment,\n phonesInUse: acquireNewlyProduced + acquireRefurbished + acquireRepaired + acquireUsed - (abandon + goBroken),\n supplyOfBrokenPhones: goBroken - (disposeBroken + repair),\n supplyOfDisposedPhones: disposeBroken + disposeHibernating - (landfill + recycle),\n supplyOfHibernatingPhones: abandon - (acquireUsed + disposeHibernating + refurbish),\n supplyOfNewlyProducedPhones: produceFromNaturalResources + produceFromRecycledMaterials - acquireNewlyProduced,\n supplyOfRecycledMaterials: recycle - produceFromRecycledMaterials,\n supplyOfRefurbishedPhones: refurbish - acquireRefurbished,\n supplyOfRepairedPhones: repair - acquireRepaired\n };\n return flowPerStock;\n }\n constructor(){\n super($921d098521bb0b85$var$stockIds, $921d098521bb0b85$var$flowIds, $921d098521bb0b85$var$variableIds, $921d098521bb0b85$var$parameterIds);\n }\n}\n$921d098521bb0b85$var$CircularEconomyModel.initialStocks = {\n capacityOfNewlyProducedPhones: 0,\n capacityOfRecycledMaterials: 0,\n capacityOfRefurbishedPhones: 0,\n capacityOfRepairedPhones: 0,\n phonesInUse: 0,\n supplyOfBrokenPhones: 0,\n supplyOfDisposedPhones: 0,\n supplyOfHibernatingPhones: 0,\n supplyOfNewlyProducedPhones: 0,\n supplyOfRecycledMaterials: 0,\n supplyOfRefurbishedPhones: 0,\n supplyOfRepairedPhones: 0\n};\n$921d098521bb0b85$var$CircularEconomyModel.defaultParameters = {\n abandonExcessRate: 0.5,\n abandonRate: 0.1,\n acquireRate: 1,\n breakRate: 0.1,\n capacityAdjustmentRate: 0.1,\n disposeIncentive: 0.5,\n disposeRate: 0.5,\n durability: 1,\n landfillIncentive: 0.5,\n landfillRate: 1,\n naturalResourcesIncentive: 0.5,\n newPhoneProductionRate: 0.5,\n newlyProducedPhoneIncentive: 0.82,\n numberOfUsers: 1000000,\n phonesPerUserGoal: 1,\n recycleRate: 1,\n recyclingIncentive: 0.89,\n refurbishmentIncentive: 0.5,\n refurbishmentRate: 1,\n repairIncentive: 0.5,\n repairRate: 1,\n reuseIncentive: 0.86\n};\nvar $921d098521bb0b85$export$2e2bcd8739ae039 = $921d098521bb0b85$var$CircularEconomyModel;\n\n\nclass $106ba4e13cc3399a$var$ModelSimulator {\n evaluateFlowPerStockWithCache(stockArray, t) {\n if (this.flowPerStockCache !== null && this.flowPerStockCache.t === t) return [\n ...this.flowPerStockCache.value\n ];\n return this.flowEvaluator(stockArray, t);\n }\n step() {\n const { stocks: stocks, parameters: parameters, t: t } = this.record;\n const newStocks = this.model.step(stocks, t, this.h, this.flowEvaluatorWithCache);\n const newRecord = this.model.evaluate(newStocks, parameters, t + this.h);\n this.flowPerStockCache = {\n t: newRecord.t,\n value: this.model.stocksToStockArray(this.model.accumulateFlowsPerStock(newRecord.flows))\n };\n this.record = newRecord;\n return newRecord;\n }\n constructor(model, stocks, parameters, t, h){\n this.model = model;\n this.parameters = parameters;\n this.flowPerStockCache = null;\n this.record = this.model.evaluate(stocks, parameters, t);\n this.h = h;\n this.flowEvaluator = this.model.createFlowEvaluator(parameters);\n this.flowEvaluatorWithCache = this.evaluateFlowPerStockWithCache.bind(this);\n }\n}\nvar $106ba4e13cc3399a$export$2e2bcd8739ae039 = $106ba4e13cc3399a$var$ModelSimulator;\n\n\nvar $1e97a6829bac4722$exports = {};\nvar $3213226c6f6709d1$exports = {};\nvar $4f1a1606e7098a1b$exports = {};\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */ function $4f1a1606e7098a1b$var$arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1, length = array == null ? 0 : array.length;\n if (initAccum && length) accumulator = array[++index];\n while(++index < length)accumulator = iteratee(accumulator, array[index], index, array);\n return accumulator;\n}\n$4f1a1606e7098a1b$exports = $4f1a1606e7098a1b$var$arrayReduce;\n\n\nvar $36afe5eae89b9d7e$exports = {};\nvar $b1b879fc8198071f$exports = {};\nvar $f2e9e481daee7666$exports = {};\n/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */ function $f2e9e481daee7666$var$basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n$f2e9e481daee7666$exports = $f2e9e481daee7666$var$basePropertyOf;\n\n\n/** Used to map Latin Unicode letters to basic Latin letters. */ var $b1b879fc8198071f$var$deburredLetters = {\n // Latin-1 Supplement block.\n \"\\xc0\": \"A\",\n \"\\xc1\": \"A\",\n \"\\xc2\": \"A\",\n \"\\xc3\": \"A\",\n \"\\xc4\": \"A\",\n \"\\xc5\": \"A\",\n \"\\xe0\": \"a\",\n \"\\xe1\": \"a\",\n \"\\xe2\": \"a\",\n \"\\xe3\": \"a\",\n \"\\xe4\": \"a\",\n \"\\xe5\": \"a\",\n \"\\xc7\": \"C\",\n \"\\xe7\": \"c\",\n \"\\xd0\": \"D\",\n \"\\xf0\": \"d\",\n \"\\xc8\": \"E\",\n \"\\xc9\": \"E\",\n \"\\xca\": \"E\",\n \"\\xcb\": \"E\",\n \"\\xe8\": \"e\",\n \"\\xe9\": \"e\",\n \"\\xea\": \"e\",\n \"\\xeb\": \"e\",\n \"\\xcc\": \"I\",\n \"\\xcd\": \"I\",\n \"\\xce\": \"I\",\n \"\\xcf\": \"I\",\n \"\\xec\": \"i\",\n \"\\xed\": \"i\",\n \"\\xee\": \"i\",\n \"\\xef\": \"i\",\n \"\\xd1\": \"N\",\n \"\\xf1\": \"n\",\n \"\\xd2\": \"O\",\n \"\\xd3\": \"O\",\n \"\\xd4\": \"O\",\n \"\\xd5\": \"O\",\n \"\\xd6\": \"O\",\n \"\\xd8\": \"O\",\n \"\\xf2\": \"o\",\n \"\\xf3\": \"o\",\n \"\\xf4\": \"o\",\n \"\\xf5\": \"o\",\n \"\\xf6\": \"o\",\n \"\\xf8\": \"o\",\n \"\\xd9\": \"U\",\n \"\\xda\": \"U\",\n \"\\xdb\": \"U\",\n \"\\xdc\": \"U\",\n \"\\xf9\": \"u\",\n \"\\xfa\": \"u\",\n \"\\xfb\": \"u\",\n \"\\xfc\": \"u\",\n \"\\xdd\": \"Y\",\n \"\\xfd\": \"y\",\n \"\\xff\": \"y\",\n \"\\xc6\": \"Ae\",\n \"\\xe6\": \"ae\",\n \"\\xde\": \"Th\",\n \"\\xfe\": \"th\",\n \"\\xdf\": \"ss\",\n // Latin Extended-A block.\n \"\\u0100\": \"A\",\n \"\\u0102\": \"A\",\n \"\\u0104\": \"A\",\n \"\\u0101\": \"a\",\n \"\\u0103\": \"a\",\n \"\\u0105\": \"a\",\n \"\\u0106\": \"C\",\n \"\\u0108\": \"C\",\n \"\\u010A\": \"C\",\n \"\\u010C\": \"C\",\n \"\\u0107\": \"c\",\n \"\\u0109\": \"c\",\n \"\\u010B\": \"c\",\n \"\\u010D\": \"c\",\n \"\\u010E\": \"D\",\n \"\\u0110\": \"D\",\n \"\\u010F\": \"d\",\n \"\\u0111\": \"d\",\n \"\\u0112\": \"E\",\n \"\\u0114\": \"E\",\n \"\\u0116\": \"E\",\n \"\\u0118\": \"E\",\n \"\\u011A\": \"E\",\n \"\\u0113\": \"e\",\n \"\\u0115\": \"e\",\n \"\\u0117\": \"e\",\n \"\\u0119\": \"e\",\n \"\\u011B\": \"e\",\n \"\\u011C\": \"G\",\n \"\\u011E\": \"G\",\n \"\\u0120\": \"G\",\n \"\\u0122\": \"G\",\n \"\\u011D\": \"g\",\n \"\\u011F\": \"g\",\n \"\\u0121\": \"g\",\n \"\\u0123\": \"g\",\n \"\\u0124\": \"H\",\n \"\\u0126\": \"H\",\n \"\\u0125\": \"h\",\n \"\\u0127\": \"h\",\n \"\\u0128\": \"I\",\n \"\\u012A\": \"I\",\n \"\\u012C\": \"I\",\n \"\\u012E\": \"I\",\n \"\\u0130\": \"I\",\n \"\\u0129\": \"i\",\n \"\\u012B\": \"i\",\n \"\\u012D\": \"i\",\n \"\\u012F\": \"i\",\n \"\\u0131\": \"i\",\n \"\\u0134\": \"J\",\n \"\\u0135\": \"j\",\n \"\\u0136\": \"K\",\n \"\\u0137\": \"k\",\n \"\\u0138\": \"k\",\n \"\\u0139\": \"L\",\n \"\\u013B\": \"L\",\n \"\\u013D\": \"L\",\n \"\\u013F\": \"L\",\n \"\\u0141\": \"L\",\n \"\\u013A\": \"l\",\n \"\\u013C\": \"l\",\n \"\\u013E\": \"l\",\n \"\\u0140\": \"l\",\n \"\\u0142\": \"l\",\n \"\\u0143\": \"N\",\n \"\\u0145\": \"N\",\n \"\\u0147\": \"N\",\n \"\\u014A\": \"N\",\n \"\\u0144\": \"n\",\n \"\\u0146\": \"n\",\n \"\\u0148\": \"n\",\n \"\\u014B\": \"n\",\n \"\\u014C\": \"O\",\n \"\\u014E\": \"O\",\n \"\\u0150\": \"O\",\n \"\\u014D\": \"o\",\n \"\\u014F\": \"o\",\n \"\\u0151\": \"o\",\n \"\\u0154\": \"R\",\n \"\\u0156\": \"R\",\n \"\\u0158\": \"R\",\n \"\\u0155\": \"r\",\n \"\\u0157\": \"r\",\n \"\\u0159\": \"r\",\n \"\\u015A\": \"S\",\n \"\\u015C\": \"S\",\n \"\\u015E\": \"S\",\n \"\\u0160\": \"S\",\n \"\\u015B\": \"s\",\n \"\\u015D\": \"s\",\n \"\\u015F\": \"s\",\n \"\\u0161\": \"s\",\n \"\\u0162\": \"T\",\n \"\\u0164\": \"T\",\n \"\\u0166\": \"T\",\n \"\\u0163\": \"t\",\n \"\\u0165\": \"t\",\n \"\\u0167\": \"t\",\n \"\\u0168\": \"U\",\n \"\\u016A\": \"U\",\n \"\\u016C\": \"U\",\n \"\\u016E\": \"U\",\n \"\\u0170\": \"U\",\n \"\\u0172\": \"U\",\n \"\\u0169\": \"u\",\n \"\\u016B\": \"u\",\n \"\\u016D\": \"u\",\n \"\\u016F\": \"u\",\n \"\\u0171\": \"u\",\n \"\\u0173\": \"u\",\n \"\\u0174\": \"W\",\n \"\\u0175\": \"w\",\n \"\\u0176\": \"Y\",\n \"\\u0177\": \"y\",\n \"\\u0178\": \"Y\",\n \"\\u0179\": \"Z\",\n \"\\u017B\": \"Z\",\n \"\\u017D\": \"Z\",\n \"\\u017A\": \"z\",\n \"\\u017C\": \"z\",\n \"\\u017E\": \"z\",\n \"\\u0132\": \"IJ\",\n \"\\u0133\": \"ij\",\n \"\\u0152\": \"Oe\",\n \"\\u0153\": \"oe\",\n \"\\u0149\": \"'n\",\n \"\\u017F\": \"s\"\n};\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */ var $b1b879fc8198071f$var$deburrLetter = $f2e9e481daee7666$exports($b1b879fc8198071f$var$deburredLetters);\n$b1b879fc8198071f$exports = $b1b879fc8198071f$var$deburrLetter;\n\n\nvar $76c6dc58ca6da032$exports = {};\nvar $1879420c2201e4f5$exports = {};\nvar $16a1c88c6274b89e$exports = {};\nvar $967238627eb0c90e$exports = {};\nvar $99453366d0047353$exports = {};\n/** Detect free variable `global` from Node.js. */ var $99453366d0047353$var$freeGlobal = typeof $parcel$global == \"object\" && $parcel$global && $parcel$global.Object === Object && $parcel$global;\n$99453366d0047353$exports = $99453366d0047353$var$freeGlobal;\n\n\n/** Detect free variable `self`. */ var $967238627eb0c90e$var$freeSelf = typeof self == \"object\" && self && self.Object === Object && self;\n/** Used as a reference to the global object. */ var $967238627eb0c90e$var$root = $99453366d0047353$exports || $967238627eb0c90e$var$freeSelf || Function(\"return this\")();\n$967238627eb0c90e$exports = $967238627eb0c90e$var$root;\n\n\n/** Built-in value references. */ var $16a1c88c6274b89e$var$Symbol = $967238627eb0c90e$exports.Symbol;\n$16a1c88c6274b89e$exports = $16a1c88c6274b89e$var$Symbol;\n\n\nvar $eee618309e39ba8f$exports = {};\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */ function $eee618309e39ba8f$var$arrayMap(array, iteratee) {\n var index = -1, length = array == null ? 0 : array.length, result = Array(length);\n while(++index < length)result[index] = iteratee(array[index], index, array);\n return result;\n}\n$eee618309e39ba8f$exports = $eee618309e39ba8f$var$arrayMap;\n\n\nvar $ac048cd2ac6bb018$exports = {};\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */ var $ac048cd2ac6bb018$var$isArray = Array.isArray;\n$ac048cd2ac6bb018$exports = $ac048cd2ac6bb018$var$isArray;\n\n\nvar $558e04b299841d71$exports = {};\nvar $49a2e995e5c6b149$exports = {};\n\nvar $4a7cc576fba0dac1$exports = {};\n\n/** Used for built-in method references. */ var $4a7cc576fba0dac1$var$objectProto = Object.prototype;\n/** Used to check objects for own properties. */ var $4a7cc576fba0dac1$var$hasOwnProperty = $4a7cc576fba0dac1$var$objectProto.hasOwnProperty;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */ var $4a7cc576fba0dac1$var$nativeObjectToString = $4a7cc576fba0dac1$var$objectProto.toString;\n/** Built-in value references. */ var $4a7cc576fba0dac1$var$symToStringTag = $16a1c88c6274b89e$exports ? $16a1c88c6274b89e$exports.toStringTag : undefined;\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */ function $4a7cc576fba0dac1$var$getRawTag(value) {\n var isOwn = $4a7cc576fba0dac1$var$hasOwnProperty.call(value, $4a7cc576fba0dac1$var$symToStringTag), tag = value[$4a7cc576fba0dac1$var$symToStringTag];\n try {\n value[$4a7cc576fba0dac1$var$symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n var result = $4a7cc576fba0dac1$var$nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) value[$4a7cc576fba0dac1$var$symToStringTag] = tag;\n else delete value[$4a7cc576fba0dac1$var$symToStringTag];\n }\n return result;\n}\n$4a7cc576fba0dac1$exports = $4a7cc576fba0dac1$var$getRawTag;\n\n\nvar $04062fd85b2020b2$exports = {};\n/** Used for built-in method references. */ var $04062fd85b2020b2$var$objectProto = Object.prototype;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */ var $04062fd85b2020b2$var$nativeObjectToString = $04062fd85b2020b2$var$objectProto.toString;\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */ function $04062fd85b2020b2$var$objectToString(value) {\n return $04062fd85b2020b2$var$nativeObjectToString.call(value);\n}\n$04062fd85b2020b2$exports = $04062fd85b2020b2$var$objectToString;\n\n\n/** `Object#toString` result references. */ var $49a2e995e5c6b149$var$nullTag = \"[object Null]\", $49a2e995e5c6b149$var$undefinedTag = \"[object Undefined]\";\n/** Built-in value references. */ var $49a2e995e5c6b149$var$symToStringTag = $16a1c88c6274b89e$exports ? $16a1c88c6274b89e$exports.toStringTag : undefined;\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */ function $49a2e995e5c6b149$var$baseGetTag(value) {\n if (value == null) return value === undefined ? $49a2e995e5c6b149$var$undefinedTag : $49a2e995e5c6b149$var$nullTag;\n return $49a2e995e5c6b149$var$symToStringTag && $49a2e995e5c6b149$var$symToStringTag in Object(value) ? $4a7cc576fba0dac1$exports(value) : $04062fd85b2020b2$exports(value);\n}\n$49a2e995e5c6b149$exports = $49a2e995e5c6b149$var$baseGetTag;\n\n\nvar $ba1663caad3bd751$exports = {};\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */ function $ba1663caad3bd751$var$isObjectLike(value) {\n return value != null && typeof value == \"object\";\n}\n$ba1663caad3bd751$exports = $ba1663caad3bd751$var$isObjectLike;\n\n\n/** `Object#toString` result references. */ var $558e04b299841d71$var$symbolTag = \"[object Symbol]\";\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */ function $558e04b299841d71$var$isSymbol(value) {\n return typeof value == \"symbol\" || $ba1663caad3bd751$exports(value) && $49a2e995e5c6b149$exports(value) == $558e04b299841d71$var$symbolTag;\n}\n$558e04b299841d71$exports = $558e04b299841d71$var$isSymbol;\n\n\n/** Used as references for various `Number` constants. */ var $1879420c2201e4f5$var$INFINITY = 1 / 0;\n/** Used to convert symbols to primitives and strings. */ var $1879420c2201e4f5$var$symbolProto = $16a1c88c6274b89e$exports ? $16a1c88c6274b89e$exports.prototype : undefined, $1879420c2201e4f5$var$symbolToString = $1879420c2201e4f5$var$symbolProto ? $1879420c2201e4f5$var$symbolProto.toString : undefined;\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */ function $1879420c2201e4f5$var$baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == \"string\") return value;\n if ($ac048cd2ac6bb018$exports(value)) // Recursively convert values (susceptible to call stack limits).\n return $eee618309e39ba8f$exports(value, $1879420c2201e4f5$var$baseToString) + \"\";\n if ($558e04b299841d71$exports(value)) return $1879420c2201e4f5$var$symbolToString ? $1879420c2201e4f5$var$symbolToString.call(value) : \"\";\n var result = value + \"\";\n return result == \"0\" && 1 / value == -$1879420c2201e4f5$var$INFINITY ? \"-0\" : result;\n}\n$1879420c2201e4f5$exports = $1879420c2201e4f5$var$baseToString;\n\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */ function $76c6dc58ca6da032$var$toString(value) {\n return value == null ? \"\" : $1879420c2201e4f5$exports(value);\n}\n$76c6dc58ca6da032$exports = $76c6dc58ca6da032$var$toString;\n\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */ var $36afe5eae89b9d7e$var$reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n/** Used to compose unicode character classes. */ var $36afe5eae89b9d7e$var$rsComboMarksRange = \"\\\\u0300-\\\\u036f\", $36afe5eae89b9d7e$var$reComboHalfMarksRange = \"\\\\ufe20-\\\\ufe2f\", $36afe5eae89b9d7e$var$rsComboSymbolsRange = \"\\\\u20d0-\\\\u20ff\", $36afe5eae89b9d7e$var$rsComboRange = $36afe5eae89b9d7e$var$rsComboMarksRange + $36afe5eae89b9d7e$var$reComboHalfMarksRange + $36afe5eae89b9d7e$var$rsComboSymbolsRange;\n/** Used to compose unicode capture groups. */ var $36afe5eae89b9d7e$var$rsCombo = \"[\" + $36afe5eae89b9d7e$var$rsComboRange + \"]\";\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */ var $36afe5eae89b9d7e$var$reComboMark = RegExp($36afe5eae89b9d7e$var$rsCombo, \"g\");\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */ function $36afe5eae89b9d7e$var$deburr(string) {\n string = $76c6dc58ca6da032$exports(string);\n return string && string.replace($36afe5eae89b9d7e$var$reLatin, $b1b879fc8198071f$exports).replace($36afe5eae89b9d7e$var$reComboMark, \"\");\n}\n$36afe5eae89b9d7e$exports = $36afe5eae89b9d7e$var$deburr;\n\n\nvar $ab91531510e64339$exports = {};\nvar $3b3532336f4ee99d$exports = {};\n/** Used to match words composed of alphanumeric characters. */ var $3b3532336f4ee99d$var$reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */ function $3b3532336f4ee99d$var$asciiWords(string) {\n return string.match($3b3532336f4ee99d$var$reAsciiWord) || [];\n}\n$3b3532336f4ee99d$exports = $3b3532336f4ee99d$var$asciiWords;\n\n\nvar $a612d359136754bd$exports = {};\n/** Used to detect strings that need a more robust regexp to match words. */ var $a612d359136754bd$var$reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */ function $a612d359136754bd$var$hasUnicodeWord(string) {\n return $a612d359136754bd$var$reHasUnicodeWord.test(string);\n}\n$a612d359136754bd$exports = $a612d359136754bd$var$hasUnicodeWord;\n\n\n\nvar $cdffef05f24fe61a$exports = {};\n/** Used to compose unicode character classes. */ var $cdffef05f24fe61a$var$rsAstralRange = \"\\ud800-\\udfff\", $cdffef05f24fe61a$var$rsComboMarksRange = \"\\\\u0300-\\\\u036f\", $cdffef05f24fe61a$var$reComboHalfMarksRange = \"\\\\ufe20-\\\\ufe2f\", $cdffef05f24fe61a$var$rsComboSymbolsRange = \"\\\\u20d0-\\\\u20ff\", $cdffef05f24fe61a$var$rsComboRange = $cdffef05f24fe61a$var$rsComboMarksRange + $cdffef05f24fe61a$var$reComboHalfMarksRange + $cdffef05f24fe61a$var$rsComboSymbolsRange, $cdffef05f24fe61a$var$rsDingbatRange = \"\\\\u2700-\\\\u27bf\", $cdffef05f24fe61a$var$rsLowerRange = \"a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff\", $cdffef05f24fe61a$var$rsMathOpRange = \"\\\\xac\\\\xb1\\\\xd7\\\\xf7\", $cdffef05f24fe61a$var$rsNonCharRange = \"\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\", $cdffef05f24fe61a$var$rsPunctuationRange = \"\\\\u2000-\\\\u206f\", $cdffef05f24fe61a$var$rsSpaceRange = \" \\\\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\", $cdffef05f24fe61a$var$rsUpperRange = \"A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde\", $cdffef05f24fe61a$var$rsVarRange = \"\\\\ufe0e\\\\ufe0f\", $cdffef05f24fe61a$var$rsBreakRange = $cdffef05f24fe61a$var$rsMathOpRange + $cdffef05f24fe61a$var$rsNonCharRange + $cdffef05f24fe61a$var$rsPunctuationRange + $cdffef05f24fe61a$var$rsSpaceRange;\n/** Used to compose unicode capture groups. */ var $cdffef05f24fe61a$var$rsApos = \"['\\u2019]\", $cdffef05f24fe61a$var$rsBreak = \"[\" + $cdffef05f24fe61a$var$rsBreakRange + \"]\", $cdffef05f24fe61a$var$rsCombo = \"[\" + $cdffef05f24fe61a$var$rsComboRange + \"]\", $cdffef05f24fe61a$var$rsDigits = \"\\\\d+\", $cdffef05f24fe61a$var$rsDingbat = \"[\" + $cdffef05f24fe61a$var$rsDingbatRange + \"]\", $cdffef05f24fe61a$var$rsLower = \"[\" + $cdffef05f24fe61a$var$rsLowerRange + \"]\", $cdffef05f24fe61a$var$rsMisc = \"[^\" + $cdffef05f24fe61a$var$rsAstralRange + $cdffef05f24fe61a$var$rsBreakRange + $cdffef05f24fe61a$var$rsDigits + $cdffef05f24fe61a$var$rsDingbatRange + $cdffef05f24fe61a$var$rsLowerRange + $cdffef05f24fe61a$var$rsUpperRange + \"]\", $cdffef05f24fe61a$var$rsFitz = \"\\ud83c[\\udffb-\\udfff]\", $cdffef05f24fe61a$var$rsModifier = \"(?:\" + $cdffef05f24fe61a$var$rsCombo + \"|\" + $cdffef05f24fe61a$var$rsFitz + \")\", $cdffef05f24fe61a$var$rsNonAstral = \"[^\" + $cdffef05f24fe61a$var$rsAstralRange + \"]\", $cdffef05f24fe61a$var$rsRegional = \"(?:\\ud83c[\\udde6-\\uddff]){2}\", $cdffef05f24fe61a$var$rsSurrPair = \"[\\ud800-\\udbff][\\udc00-\\udfff]\", $cdffef05f24fe61a$var$rsUpper = \"[\" + $cdffef05f24fe61a$var$rsUpperRange + \"]\", $cdffef05f24fe61a$var$rsZWJ = \"\\\\u200d\";\n/** Used to compose unicode regexes. */ var $cdffef05f24fe61a$var$rsMiscLower = \"(?:\" + $cdffef05f24fe61a$var$rsLower + \"|\" + $cdffef05f24fe61a$var$rsMisc + \")\", $cdffef05f24fe61a$var$rsMiscUpper = \"(?:\" + $cdffef05f24fe61a$var$rsUpper + \"|\" + $cdffef05f24fe61a$var$rsMisc + \")\", $cdffef05f24fe61a$var$rsOptContrLower = \"(?:\" + $cdffef05f24fe61a$var$rsApos + \"(?:d|ll|m|re|s|t|ve))?\", $cdffef05f24fe61a$var$rsOptContrUpper = \"(?:\" + $cdffef05f24fe61a$var$rsApos + \"(?:D|LL|M|RE|S|T|VE))?\", $cdffef05f24fe61a$var$reOptMod = $cdffef05f24fe61a$var$rsModifier + \"?\", $cdffef05f24fe61a$var$rsOptVar = \"[\" + $cdffef05f24fe61a$var$rsVarRange + \"]?\", $cdffef05f24fe61a$var$rsOptJoin = \"(?:\" + $cdffef05f24fe61a$var$rsZWJ + \"(?:\" + [\n $cdffef05f24fe61a$var$rsNonAstral,\n $cdffef05f24fe61a$var$rsRegional,\n $cdffef05f24fe61a$var$rsSurrPair\n].join(\"|\") + \")\" + $cdffef05f24fe61a$var$rsOptVar + $cdffef05f24fe61a$var$reOptMod + \")*\", $cdffef05f24fe61a$var$rsOrdLower = \"\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])\", $cdffef05f24fe61a$var$rsOrdUpper = \"\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])\", $cdffef05f24fe61a$var$rsSeq = $cdffef05f24fe61a$var$rsOptVar + $cdffef05f24fe61a$var$reOptMod + $cdffef05f24fe61a$var$rsOptJoin, $cdffef05f24fe61a$var$rsEmoji = \"(?:\" + [\n $cdffef05f24fe61a$var$rsDingbat,\n $cdffef05f24fe61a$var$rsRegional,\n $cdffef05f24fe61a$var$rsSurrPair\n].join(\"|\") + \")\" + $cdffef05f24fe61a$var$rsSeq;\n/** Used to match complex or compound words. */ var $cdffef05f24fe61a$var$reUnicodeWord = RegExp([\n $cdffef05f24fe61a$var$rsUpper + \"?\" + $cdffef05f24fe61a$var$rsLower + \"+\" + $cdffef05f24fe61a$var$rsOptContrLower + \"(?=\" + [\n $cdffef05f24fe61a$var$rsBreak,\n $cdffef05f24fe61a$var$rsUpper,\n \"$\"\n ].join(\"|\") + \")\",\n $cdffef05f24fe61a$var$rsMiscUpper + \"+\" + $cdffef05f24fe61a$var$rsOptContrUpper + \"(?=\" + [\n $cdffef05f24fe61a$var$rsBreak,\n $cdffef05f24fe61a$var$rsUpper + $cdffef05f24fe61a$var$rsMiscLower,\n \"$\"\n ].join(\"|\") + \")\",\n $cdffef05f24fe61a$var$rsUpper + \"?\" + $cdffef05f24fe61a$var$rsMiscLower + \"+\" + $cdffef05f24fe61a$var$rsOptContrLower,\n $cdffef05f24fe61a$var$rsUpper + \"+\" + $cdffef05f24fe61a$var$rsOptContrUpper,\n $cdffef05f24fe61a$var$rsOrdUpper,\n $cdffef05f24fe61a$var$rsOrdLower,\n $cdffef05f24fe61a$var$rsDigits,\n $cdffef05f24fe61a$var$rsEmoji\n].join(\"|\"), \"g\");\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */ function $cdffef05f24fe61a$var$unicodeWords(string) {\n return string.match($cdffef05f24fe61a$var$reUnicodeWord) || [];\n}\n$cdffef05f24fe61a$exports = $cdffef05f24fe61a$var$unicodeWords;\n\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */ function $ab91531510e64339$var$words(string, pattern, guard) {\n string = $76c6dc58ca6da032$exports(string);\n pattern = guard ? undefined : pattern;\n if (pattern === undefined) return $a612d359136754bd$exports(string) ? $cdffef05f24fe61a$exports(string) : $3b3532336f4ee99d$exports(string);\n return string.match(pattern) || [];\n}\n$ab91531510e64339$exports = $ab91531510e64339$var$words;\n\n\n/** Used to compose unicode capture groups. */ var $3213226c6f6709d1$var$rsApos = \"['\\u2019]\";\n/** Used to match apostrophes. */ var $3213226c6f6709d1$var$reApos = RegExp($3213226c6f6709d1$var$rsApos, \"g\");\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */ function $3213226c6f6709d1$var$createCompounder(callback) {\n return function(string) {\n return $4f1a1606e7098a1b$exports($ab91531510e64339$exports($36afe5eae89b9d7e$exports(string).replace($3213226c6f6709d1$var$reApos, \"\")), callback, \"\");\n };\n}\n$3213226c6f6709d1$exports = $3213226c6f6709d1$var$createCompounder;\n\n\n/**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */ var $1e97a6829bac4722$var$kebabCase = $3213226c6f6709d1$exports(function(result, word, index) {\n return result + (index ? \"-\" : \"\") + word.toLowerCase();\n});\n$1e97a6829bac4722$exports = $1e97a6829bac4722$var$kebabCase;\n\n\n/**\n * Loads an external SVG file and returns the DOM tree of its first element.\n *\n * @param {string|URL} uri\n * @param {boolean} clearStyles\n * If true removes the style elements from the file\n * @return {Promise}\n */ async function $9209478113a893f2$export$b6a2e78b63791dfa(uri, clearStyles = true) {\n var _svgDoc_querySelectorAll;\n const response = await fetch(uri);\n if (response.status < 200 || response.status >= 300) throw new Error(`Server returned status ${response.status} (${response.statusText}) loading ${new URL(uri).href}.`);\n const svgText = await response.text();\n const div = document.createElement(\"div\");\n div.innerHTML = svgText;\n const svgDoc = div.querySelector(\"svg\");\n if (svgDoc === null) throw new Error(`No SVG element found in ${new URL(uri).href}.`);\n if (clearStyles) (_svgDoc_querySelectorAll = svgDoc.querySelectorAll(\"style\")) === null || _svgDoc_querySelectorAll === void 0 ? void 0 : _svgDoc_querySelectorAll.forEach((s)=>s.remove());\n return svgDoc;\n}\n\n\nfunction $7b1f0afa5e19a5a4$export$99496351b147462(elem, selector, type) {\n const result = elem.querySelector(selector);\n if (result === null) throw new Error(`No element found matching selector ${selector}.`);\n if (!(result instanceof type)) throw new Error(`Element matching selector ${selector} has the wrong type.`);\n return result;\n}\nfunction $7b1f0afa5e19a5a4$export$65a5d093667c64b6(elem, selector, type) {\n const results = elem.querySelectorAll(selector);\n results.forEach((result)=>{\n if (!(result instanceof type)) throw new Error(`An element matching selector ${selector} has the wrong type.`);\n });\n return results;\n}\n\n\nvar $dac2d623b8646eea$exports = {};\n\n$dac2d623b8646eea$exports = (parcelRequire(\"c93e5\")).getBundleURL(\"c39XQ\") + \"model.f8e270f6.svg\";\n\n\nconst $f48791a249d3586b$var$svgUrl = new URL($dac2d623b8646eea$exports);\nconst $f48791a249d3586b$var$mainFlowIds = [\n \"abandon\",\n \"acquireNewlyProduced\",\n \"acquireRefurbished\",\n \"acquireRepaired\",\n \"acquireUsed\",\n \"disposeBroken\",\n \"disposeHibernating\",\n \"goBroken\",\n \"landfill\",\n \"produceFromNaturalResources\",\n \"produceFromRecycledMaterials\",\n \"recycle\",\n \"refurbish\",\n \"repair\"\n];\nconst $f48791a249d3586b$var$flowVizSigns = {\n abandon: 1,\n acquireNewlyProduced: -1,\n acquireRefurbished: -1,\n acquireRepaired: -1,\n acquireUsed: -1,\n disposeBroken: -1,\n disposeHibernating: -1,\n goBroken: -1,\n landfill: -1,\n produceFromNaturalResources: -1,\n produceFromRecycledMaterials: -1,\n recycle: -1,\n refurbish: -1,\n repair: -1\n};\nclass $f48791a249d3586b$export$2e2bcd8739ae039 {\n updateSvgFlows(deltaMs, record) {\n const { flows: flows } = record;\n const flowVizScale = 5.0 / record.parameters.numberOfUsers;\n const dashGap = 20;\n $f48791a249d3586b$var$mainFlowIds.forEach((id)=>{\n const flow = flows[id];\n const flowVizSign = $f48791a249d3586b$var$flowVizSigns[id];\n const elementId = `${(0, (/*@__PURE__*/$parcel$interopDefault($1e97a6829bac4722$exports)))(id)}-flow`;\n const element = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(this.svg, `#${elementId}`, SVGPathElement);\n var _element_getAttribute;\n const lastDashOffset = parseFloat((_element_getAttribute = element.getAttribute(\"stroke-dashoffset\")) !== null && _element_getAttribute !== void 0 ? _element_getAttribute : \"0\");\n // The dash offset step must not be small compared to the dash gap.\n // Otherwise, the flow animation may appear to move backwards.\n const dashOffsetStep = Math.max(-0.3 * dashGap, Math.min(flowVizSign * (deltaMs * flow) * flowVizScale, 0.1 * dashGap));\n const dashOffset = (Number.isNaN(lastDashOffset) ? 0 : lastDashOffset) + dashOffsetStep;\n element.setAttribute(\"stroke-dashoffset\", `${dashOffset}`);\n element.setAttribute(\"stroke-dasharray\", `0 ${dashGap}`);\n });\n }\n updateSvgStocks(deltaMs, record) {\n const { stocks: stocks } = record;\n const stockVizScale = 50000.0 / record.parameters.numberOfUsers;\n this.model.stockIds.forEach((id)=>{\n const elementId = (0, (/*@__PURE__*/$parcel$interopDefault($1e97a6829bac4722$exports)))(id);\n const element = this.svg.getElementById(elementId);\n if (element === null) throw new Error(`SVG element with id ${elementId} for stock ${id} not found.`);\n if (!(element instanceof SVGCircleElement)) throw new Error(`Stock element for stock ${id} with id ${elementId} is not an SVG circle element.`);\n const stock = stocks[id];\n const radius = Math.sqrt(stock * stockVizScale / Math.PI);\n element.setAttribute(\"r\", `${radius}`);\n });\n }\n updateSvg(deltaMs, record) {\n this.updateSvgFlows(deltaMs, record);\n this.updateSvgStocks(deltaMs, record);\n }\n update(deltaMs, record) {\n this.updateSvg(deltaMs, record);\n }\n static prepareSvg(model, svg) {\n const createSVGElement = (tagName)=>svg.ownerDocument.createElementNS(\"http://www.w3.org/2000/svg\", tagName);\n svg.classList.add(\"model-visualization\");\n svg.querySelectorAll(\"circle, rect, path, text\").forEach((element)=>{\n element.removeAttribute(\"style\");\n });\n const elementsToRemove = [\n ...svg.children\n ];\n const labelLayer = createSVGElement(\"g\");\n labelLayer.classList.add(\"labels\");\n const supplyLayer = createSVGElement(\"g\");\n supplyLayer.classList.add(\"supplies\");\n const capacityLayer = createSVGElement(\"g\");\n capacityLayer.classList.add(\"capacities\");\n const flowLayer = createSVGElement(\"g\");\n flowLayer.classList.add(\"flows\");\n svg.append(capacityLayer, flowLayer, supplyLayer, labelLayer);\n svg.querySelectorAll(\"text\").forEach((baseElement)=>{\n const clone = baseElement.cloneNode(true);\n clone.classList.add(\"label\");\n labelLayer.append(clone);\n });\n svg.querySelectorAll(\"rect\").forEach((baseElement)=>{\n const clone = baseElement.cloneNode(false);\n clone.classList.add(\"capacity\");\n capacityLayer.append(clone);\n });\n model.stockIds.filter((id)=>id.startsWith(\"supplyOf\")).forEach((id)=>{\n const baseElementId = (0, (/*@__PURE__*/$parcel$interopDefault($1e97a6829bac4722$exports)))(id.replace(/^supplyOf/, \"\"));\n const baseElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(svg, `#${baseElementId}`, SVGGeometryElement);\n const clone = baseElement.cloneNode(false);\n clone.id = `supply-of-${baseElement.id}`;\n clone.classList.add(\"stock\", \"supply\");\n supplyLayer.append(clone);\n });\n const phonesInUse = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(svg, \"#phones-in-use\", SVGGeometryElement);\n const phonesInUseClone = phonesInUse.cloneNode(false);\n supplyLayer.append(phonesInUseClone);\n model.stockIds.filter((id)=>id.startsWith(\"capacityOf\")).forEach((id)=>{\n const baseElementId = (0, (/*@__PURE__*/$parcel$interopDefault($1e97a6829bac4722$exports)))(id.replace(/^capacityOf/, \"\"));\n const baseElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(svg, `#${baseElementId}`, SVGGeometryElement);\n const clone = baseElement.cloneNode(false);\n clone.id = `capacity-of-${baseElementId}`;\n clone.classList.add(\"stock\", \"capacity\");\n capacityLayer.append(clone);\n });\n $f48791a249d3586b$var$mainFlowIds.forEach((id)=>{\n const baseElementId = (0, (/*@__PURE__*/$parcel$interopDefault($1e97a6829bac4722$exports)))(id);\n const baseElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(svg, `#${baseElementId}`, SVGGeometryElement);\n const edge = baseElement.cloneNode(false);\n edge.id = `${baseElementId}-edge`;\n edge.removeAttribute(\"style\");\n edge.classList.add(\"flow\", \"edge\");\n flowLayer.append(edge);\n const flow = baseElement.cloneNode(false);\n flow.id = `${baseElementId}-flow`;\n flow.removeAttribute(\"style\");\n flow.classList.add(\"flow\", \"anim-edge\");\n flowLayer.append(flow);\n });\n elementsToRemove.forEach((element)=>element.remove());\n }\n static async create(model) {\n const svg = await (0, $9209478113a893f2$export$b6a2e78b63791dfa)($f48791a249d3586b$var$svgUrl);\n this.prepareSvg(model, svg);\n return new $f48791a249d3586b$export$2e2bcd8739ae039(model, svg);\n }\n constructor(model, svg){\n this.model = model;\n this.svg = svg;\n this.element = document.createElement(\"div\");\n this.element.append(this.svg);\n }\n}\n\n\nasync function $e412526fc10a648a$export$3e2b244719956741() {\n return new Promise((resolve)=>{\n const state = document.readyState;\n if (state === \"complete\" || state === \"interactive\") setTimeout(resolve, 0);\n document.addEventListener(\"DOMContentLoaded\", ()=>resolve());\n });\n}\n\n\n\nfunction $486e7c314fe88235$export$2e2bcd8739ae039(str) {\n if (typeof str !== \"string\") return false;\n if (str.trim() !== str) return false;\n if (str.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/) === null) return false;\n return true;\n}\n\n\nclass $30abf6595c867a38$export$2e2bcd8739ae039 {\n constructor(i18nKey){\n this.i18nKey = i18nKey;\n }\n}\n\n\nclass $4af93babe4ef46c3$export$2e2bcd8739ae039 extends (0, $30abf6595c867a38$export$2e2bcd8739ae039) {\n applyTo(parameters) {\n this.callable(parameters);\n return parameters;\n }\n constructor(i18nKey, callable){\n super(i18nKey);\n this.callable = callable;\n }\n}\n\n\nclass $5023ecf4320e7a5e$export$2e2bcd8739ae039 extends (0, $4af93babe4ef46c3$export$2e2bcd8739ae039) {\n static createFunction(parameterIds, script) {\n parameterIds.forEach((parameterId)=>{\n if (!(0, $486e7c314fe88235$export$2e2bcd8739ae039)(parameterId)) throw new Error(`Parameter name '${parameterId}' can not be used as a variable`);\n });\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const wrappedScript = new Function(script).toString();\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const func = new Function(`{ ${parameterIds.join(\", \")} }`, `(${wrappedScript})(); return { ${parameterIds.join(\", \")} }`);\n return (parameters)=>{\n const transformedParameters = func(parameters);\n Object.assign(parameters, transformedParameters);\n return parameters;\n };\n }\n constructor(i18nKey, parameterIds, script){\n super(i18nKey, $5023ecf4320e7a5e$export$2e2bcd8739ae039.createFunction(parameterIds, script));\n this.script = script;\n }\n}\n\n\nasync function $0bf1d6c4c7fae0ba$var$init() {\n const model = new (0, $921d098521bb0b85$export$2e2bcd8739ae039)();\n const modelSimulator = new (0, $106ba4e13cc3399a$export$2e2bcd8739ae039)(model, // FIXME: It should be possible to pass CircularEconomyModel.initialStocks directly, but TypeScript does not complain.\n {\n ...(0, $921d098521bb0b85$export$2e2bcd8739ae039).initialStocks\n }, // FIXME: It should be possible to pass CircularEconomyModel.defaultParameters directly, but TypeScript does not complain.\n {\n ...(0, $921d098521bb0b85$export$2e2bcd8739ae039).defaultParameters\n }, 0.0, 0.01);\n const availableParameterTransformsContainer = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#parameter-transforms .available\", HTMLElement);\n const activeParameterTransformsContainer = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#parameter-transforms .active\", HTMLElement);\n const availableParameterTransforms = new Map();\n function getDistinctParameters(p1, p2) {\n const result = {};\n model.parameterIds.forEach((id)=>{\n if (p1[id] !== p2[id]) result[id] = p2[id];\n });\n return result;\n }\n function updateParameters() {\n const parameters = {\n ...(0, $921d098521bb0b85$export$2e2bcd8739ae039).defaultParameters\n };\n [\n ...activeParameterTransformsContainer.children\n ].forEach((e)=>{\n (0, $cgw1K.strict)(e instanceof HTMLElement);\n const id = e.getAttribute(\"data-id\");\n (0, $cgw1K.strict)(id !== null);\n const parameterTransform = availableParameterTransforms.get(id);\n (0, $cgw1K.strict)(parameterTransform !== undefined);\n const backupParameters = {\n ...parameters\n };\n parameterTransform.applyTo(parameters);\n const distinctParameters = getDistinctParameters(backupParameters, parameters);\n e.title = `${parameterTransform.script}\\n\\n${JSON.stringify(distinctParameters, null, 2)}\\n\\n${JSON.stringify(parameters, null, 2)}`;\n });\n Object.assign(modelSimulator.parameters, parameters);\n }\n (0, $3bc6321cdb0e9401$export$2e2bcd8739ae039).create(availableParameterTransformsContainer, {\n group: {\n name: \"sharedParameterTransforms\",\n pull: \"clone\",\n put: false\n }\n });\n (0, $3bc6321cdb0e9401$export$2e2bcd8739ae039).create(activeParameterTransformsContainer, {\n group: {\n name: \"sharedParameterTransforms\"\n },\n removeOnSpill: true,\n onSort: ()=>updateParameters(),\n onSpill: (event)=>{\n event.item.remove();\n updateParameters();\n }\n });\n const parameterTransforms = {\n create: (id, script)=>{\n if (availableParameterTransforms.has(id)) throw new Error(`Parameter transform with id '${id}' already exists`);\n availableParameterTransforms.set(id, new (0, $5023ecf4320e7a5e$export$2e2bcd8739ae039)(\"none\", model.parameterIds, script));\n const dummyElement = document.createElement(\"div\");\n dummyElement.innerHTML = `

${id}
`;\n const parameterTransformElement = dummyElement.firstChild;\n (0, $cgw1K.strict)(parameterTransformElement !== null);\n availableParameterTransformsContainer.append(parameterTransformElement);\n },\n destroy: (id)=>{\n availableParameterTransforms.delete(id);\n }\n };\n (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#add-parameter-transform\", HTMLElement).addEventListener(\"click\", ()=>{\n const idElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#parameter-transform-id\", HTMLInputElement);\n const id = idElement.value;\n const scriptElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#parameter-transform-script\", HTMLTextAreaElement);\n const script = scriptElement.value;\n parameterTransforms.create(id, script);\n });\n let circularityIndex = 0;\n const circularityIndexElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#circularity-index\", HTMLElement);\n let userSatisfaction = 0;\n const userSatisfactionElement = (0, $7b1f0afa5e19a5a4$export$99496351b147462)(document, \"#user-satisfaction\", HTMLElement);\n const visualization = await (0, $f48791a249d3586b$export$2e2bcd8739ae039).create(model);\n document.body.prepend(visualization.element);\n function toChartRecord(record) {\n return (0, $921d098521bb0b85$export$2e2bcd8739ae039).elementIds.map((key)=>Object.entries(record[key]).map(([id, value])=>({\n id: id,\n value: value\n }))).reduce((cur, acc)=>[\n ...cur,\n ...acc\n ], []);\n }\n const initialChartRecord = toChartRecord(modelSimulator.record);\n const chartCanvas = document.getElementById(\"chart\");\n (0, $cgw1K.strict)(chartCanvas !== null, \"chart element not found\");\n const chart = new (0, $8b0f4f5753bf297d$export$2e2bcd8739ae039)(chartCanvas, {\n type: \"bar\",\n data: {\n labels: initialChartRecord.map((row)=>row.id),\n datasets: [\n {\n label: \"Values\",\n data: initialChartRecord.map((row)=>row.value)\n }\n ]\n },\n options: {\n animation: false\n }\n });\n function updateIndices(record) {\n const smoothingFactor = 0.5;\n const { phonesInUse: phonesInUse } = record.stocks;\n const { produceFromNaturalResources: produceFromNaturalResources, acquireNewlyProduced: acquireNewlyProduced, acquireUsed: acquireUsed, acquireRepaired: acquireRepaired, acquireRefurbished: acquireRefurbished, disposeHibernating: disposeHibernating, disposeBroken: disposeBroken, landfill: landfill } = record.flows;\n const { phoneGoal: phoneGoal } = record.variables;\n const naturalResourcesShare = Math.min(1.0, produceFromNaturalResources / (acquireNewlyProduced + acquireUsed + acquireRepaired + acquireRefurbished));\n const landfillShare = Math.min(1.0, landfill / (disposeHibernating + disposeBroken));\n const circularityIndexTarget = Math.min(1.0 - naturalResourcesShare, 1.0 - landfillShare);\n circularityIndex += (circularityIndexTarget - circularityIndex) * smoothingFactor;\n circularityIndexElement.innerText = `${(circularityIndex * 100).toFixed(2)}%`;\n const userSatisfactionTarget = phonesInUse < phoneGoal ? phonesInUse / phoneGoal : phoneGoal / phonesInUse;\n userSatisfaction += (userSatisfactionTarget - userSatisfaction) * smoothingFactor;\n userSatisfactionElement.innerText = `${(userSatisfaction * 100).toFixed(2)}%`;\n }\n function stepSimulation(deltaMs) {\n // TODO: pass deltaMs to modelSimulator.step()\n const record = modelSimulator.step();\n updateIndices(record);\n const chartRecord = toChartRecord(record);\n // console.log(chartRecord);\n chart.data.datasets[0].data = chartRecord.map((row)=>row.value);\n chart.update();\n visualization.update(deltaMs, record);\n }\n let running = false;\n const runCheckBox = document.getElementById(\"run\");\n (0, $cgw1K.strict)(runCheckBox !== null, \"run checkbox not found\");\n async function loopSimulation() {\n running = true;\n let lastTimeMs = null;\n while(runCheckBox.checked){\n // eslint-disable-next-line no-await-in-loop\n const currentTimeMs = await (0, $48e8ed6252738c92$export$1402cba6a733f33a)();\n const deltaMs = lastTimeMs === null ? 0 : currentTimeMs - lastTimeMs;\n stepSimulation(deltaMs);\n lastTimeMs = currentTimeMs;\n }\n running = false;\n }\n runCheckBox.addEventListener(\"input\", ()=>{\n if (!running) loopSimulation().catch((err)=>{\n throw err;\n });\n });\n stepSimulation(0);\n const circularEconomyApi = {\n model: model,\n modelSimulator: modelSimulator,\n parameterTransforms: parameterTransforms\n };\n return circularEconomyApi;\n}\nwindow.circularEconomy = (0, $e412526fc10a648a$export$3e2b244719956741)().then($0bf1d6c4c7fae0ba$var$init);\n\n})();\n//# sourceMappingURL=index.a403ea04.js.map\n","// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b\n\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nvar _require = require('./internal/errors'),\n _require$codes = _require.codes,\n ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE,\n ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;\nvar AssertionError = require('./internal/assert/assertion_error');\nvar _require2 = require('util/'),\n inspect = _require2.inspect;\nvar _require$types = require('util/').types,\n isPromise = _require$types.isPromise,\n isRegExp = _require$types.isRegExp;\nvar objectAssign = require('object.assign/polyfill')();\nvar objectIs = require('object-is/polyfill')();\nvar RegExpPrototypeTest = require('call-bind/callBound')('RegExp.prototype.test');\nvar errorCache = new Map();\nvar isDeepEqual;\nvar isDeepStrictEqual;\nvar parseExpressionAt;\nvar findNodeAround;\nvar decoder;\nfunction lazyLoadComparison() {\n var comparison = require('./internal/util/comparisons');\n isDeepEqual = comparison.isDeepEqual;\n isDeepStrictEqual = comparison.isDeepStrictEqual;\n}\n\n// Escape control characters but not \\n and \\t to keep the line breaks and\n// indentation intact.\n// eslint-disable-next-line no-control-regex\nvar escapeSequencesRegExp = /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/g;\nvar meta = [\"\\\\u0000\", \"\\\\u0001\", \"\\\\u0002\", \"\\\\u0003\", \"\\\\u0004\", \"\\\\u0005\", \"\\\\u0006\", \"\\\\u0007\", '\\\\b', '', '', \"\\\\u000b\", '\\\\f', '', \"\\\\u000e\", \"\\\\u000f\", \"\\\\u0010\", \"\\\\u0011\", \"\\\\u0012\", \"\\\\u0013\", \"\\\\u0014\", \"\\\\u0015\", \"\\\\u0016\", \"\\\\u0017\", \"\\\\u0018\", \"\\\\u0019\", \"\\\\u001a\", \"\\\\u001b\", \"\\\\u001c\", \"\\\\u001d\", \"\\\\u001e\", \"\\\\u001f\"];\nvar escapeFn = function escapeFn(str) {\n return meta[str.charCodeAt(0)];\n};\nvar warned = false;\n\n// The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\nvar NO_EXCEPTION_SENTINEL = {};\n\n// All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction innerFail(obj) {\n if (obj.message instanceof Error) throw obj.message;\n throw new AssertionError(obj);\n}\nfunction fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length;\n var internalMessage;\n if (argsLen === 0) {\n internalMessage = 'Failed';\n } else if (argsLen === 1) {\n message = actual;\n actual = undefined;\n } else {\n if (warned === false) {\n warned = true;\n var warn = process.emitWarning ? process.emitWarning : console.warn.bind(console);\n warn('assert.fail() with more than one argument is deprecated. ' + 'Please use assert.strictEqual() instead or only pass a message.', 'DeprecationWarning', 'DEP0094');\n }\n if (argsLen === 2) operator = '!=';\n }\n if (message instanceof Error) throw message;\n var errArgs = {\n actual: actual,\n expected: expected,\n operator: operator === undefined ? 'fail' : operator,\n stackStartFn: stackStartFn || fail\n };\n if (message !== undefined) {\n errArgs.message = message;\n }\n var err = new AssertionError(errArgs);\n if (internalMessage) {\n err.message = internalMessage;\n err.generatedMessage = true;\n }\n throw err;\n}\nassert.fail = fail;\n\n// The AssertionError is defined in internal/error.\nassert.AssertionError = AssertionError;\nfunction innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = false;\n if (argLen === 0) {\n generatedMessage = true;\n message = 'No value argument passed to `assert.ok()`';\n } else if (message instanceof Error) {\n throw message;\n }\n var err = new AssertionError({\n actual: value,\n expected: true,\n message: message,\n operator: '==',\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\n\n// Pure assertion tests whether a value is truthy, as determined\n// by !!value.\nfunction ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n innerOk.apply(void 0, [ok, args.length].concat(args));\n}\nassert.ok = ok;\n\n// The equality assertion tests shallow, coercive equality with ==.\n/* eslint-disable no-restricted-properties */\nassert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n // eslint-disable-next-line eqeqeq\n if (actual != expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '==',\n stackStartFn: equal\n });\n }\n};\n\n// The non-equality assertion tests for whether two objects are not\n// equal with !=.\nassert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n // eslint-disable-next-line eqeqeq\n if (actual == expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '!=',\n stackStartFn: notEqual\n });\n }\n};\n\n// The equivalence assertion tests a deep equality relation.\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (!isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepEqual',\n stackStartFn: deepEqual\n });\n }\n};\n\n// The non-equivalence assertion tests for any deep inequality.\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepEqual',\n stackStartFn: notDeepEqual\n });\n }\n};\n/* eslint-enable */\n\nassert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (!isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepStrictEqual',\n stackStartFn: deepStrictEqual\n });\n }\n};\nassert.notDeepStrictEqual = notDeepStrictEqual;\nfunction notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n if (isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepStrictEqual',\n stackStartFn: notDeepStrictEqual\n });\n }\n}\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (!objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'strictEqual',\n stackStartFn: strictEqual\n });\n }\n};\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n if (objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notStrictEqual',\n stackStartFn: notStrictEqual\n });\n }\n};\nvar Comparison = /*#__PURE__*/_createClass(function Comparison(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison);\n keys.forEach(function (key) {\n if (key in obj) {\n if (actual !== undefined && typeof actual[key] === 'string' && isRegExp(obj[key]) && RegExpPrototypeTest(obj[key], actual[key])) {\n _this[key] = actual[key];\n } else {\n _this[key] = obj[key];\n }\n }\n });\n});\nfunction compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) {\n if (!message) {\n // Create placeholder objects to create a nice output.\n var a = new Comparison(actual, keys);\n var b = new Comparison(expected, keys, actual);\n var err = new AssertionError({\n actual: a,\n expected: b,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.actual = actual;\n err.expected = expected;\n err.operator = fn.name;\n throw err;\n }\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n}\nfunction expectedException(actual, expected, msg, fn) {\n if (typeof expected !== 'function') {\n if (isRegExp(expected)) return RegExpPrototypeTest(expected, actual);\n // assert.doesNotThrow does not accept objects.\n if (arguments.length === 2) {\n throw new ERR_INVALID_ARG_TYPE('expected', ['Function', 'RegExp'], expected);\n }\n\n // Handle primitives properly.\n if (_typeof(actual) !== 'object' || actual === null) {\n var err = new AssertionError({\n actual: actual,\n expected: expected,\n message: msg,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.operator = fn.name;\n throw err;\n }\n var keys = Object.keys(expected);\n // Special handle errors to make sure the name and the message are compared\n // as well.\n if (expected instanceof Error) {\n keys.push('name', 'message');\n } else if (keys.length === 0) {\n throw new ERR_INVALID_ARG_VALUE('error', expected, 'may not be an empty object');\n }\n if (isDeepEqual === undefined) lazyLoadComparison();\n keys.forEach(function (key) {\n if (typeof actual[key] === 'string' && isRegExp(expected[key]) && RegExpPrototypeTest(expected[key], actual[key])) {\n return;\n }\n compareExceptionKey(actual, expected, key, msg, keys, fn);\n });\n return true;\n }\n // Guard instanceof against arrow functions as they don't have a prototype.\n if (expected.prototype !== undefined && actual instanceof expected) {\n return true;\n }\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n return expected.call({}, actual) === true;\n}\nfunction getActual(fn) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', 'Function', fn);\n }\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n}\nfunction checkIsPromise(obj) {\n // Accept native ES6 promises and promises that are implemented in a similar\n // way. Do not accept thenables that use a function as `obj` and that have no\n // `catch` handler.\n\n // TODO: thenables are checked up until they have the correct methods,\n // but according to documentation, the `then` method should receive\n // the `fulfill` and `reject` arguments as well or it may be never resolved.\n\n return isPromise(obj) || obj !== null && _typeof(obj) === 'object' && typeof obj.then === 'function' && typeof obj.catch === 'function';\n}\nfunction waitForActual(promiseFn) {\n return Promise.resolve().then(function () {\n var resultPromise;\n if (typeof promiseFn === 'function') {\n // Return a rejected promise if `promiseFn` throws synchronously.\n resultPromise = promiseFn();\n // Fail in case no promise is returned.\n if (!checkIsPromise(resultPromise)) {\n throw new ERR_INVALID_RETURN_VALUE('instance of Promise', 'promiseFn', resultPromise);\n }\n } else if (checkIsPromise(promiseFn)) {\n resultPromise = promiseFn;\n } else {\n throw new ERR_INVALID_ARG_TYPE('promiseFn', ['Function', 'Promise'], promiseFn);\n }\n return Promise.resolve().then(function () {\n return resultPromise;\n }).then(function () {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function (e) {\n return e;\n });\n });\n}\nfunction expectsError(stackStartFn, actual, error, message) {\n if (typeof error === 'string') {\n if (arguments.length === 4) {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n if (_typeof(actual) === 'object' && actual !== null) {\n if (actual.message === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error message \\\"\".concat(actual.message, \"\\\" is identical to the message.\"));\n }\n } else if (actual === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error \\\"\".concat(actual, \"\\\" is identical to the message.\"));\n }\n message = error;\n error = undefined;\n } else if (error != null && _typeof(error) !== 'object' && typeof error !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = '';\n if (error && error.name) {\n details += \" (\".concat(error.name, \")\");\n }\n details += message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'rejects' ? 'rejection' : 'exception';\n innerFail({\n actual: undefined,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn: stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn)) {\n throw actual;\n }\n}\nfunction expectsNoError(stackStartFn, actual, error, message) {\n if (actual === NO_EXCEPTION_SENTINEL) return;\n if (typeof error === 'string') {\n message = error;\n error = undefined;\n }\n if (!error || expectedException(actual, error)) {\n var details = message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'doesNotReject' ? 'rejection' : 'exception';\n innerFail({\n actual: actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, \"\\n\") + \"Actual message: \\\"\".concat(actual && actual.message, \"\\\"\"),\n stackStartFn: stackStartFn\n });\n }\n throw actual;\n}\nassert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n};\nassert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n return waitForActual(promiseFn).then(function (result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n};\nassert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n};\nassert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {\n args[_key5 - 1] = arguments[_key5];\n }\n return waitForActual(fn).then(function (result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n};\nassert.ifError = function ifError(err) {\n if (err !== null && err !== undefined) {\n var message = 'ifError got unwanted exception: ';\n if (_typeof(err) === 'object' && typeof err.message === 'string') {\n if (err.message.length === 0 && err.constructor) {\n message += err.constructor.name;\n } else {\n message += err.message;\n }\n } else {\n message += inspect(err);\n }\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: 'ifError',\n message: message,\n stackStartFn: ifError\n });\n\n // Make sure we actually have a stack trace!\n var origStack = err.stack;\n if (typeof origStack === 'string') {\n // This will remove any duplicated frames from the error frames taken\n // from within `ifError` and add the original error frames to the newly\n // created ones.\n var tmp2 = origStack.split('\\n');\n tmp2.shift();\n // Filter all frames existing in err.stack.\n var tmp1 = newErr.stack.split('\\n');\n for (var i = 0; i < tmp2.length; i++) {\n // Find the first occurrence of the frame.\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n // Only keep new frames.\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join('\\n'), \"\\n\").concat(tmp2.join('\\n'));\n }\n throw newErr;\n }\n};\n\n// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a871df3dfb8ea663ef5e1f8f62701ec51384ecb\nfunction internalMatch(string, regexp, message, fn, fnName) {\n if (!isRegExp(regexp)) {\n throw new ERR_INVALID_ARG_TYPE('regexp', 'RegExp', regexp);\n }\n var match = fnName === 'match';\n if (typeof string !== 'string' || RegExpPrototypeTest(regexp, string) !== match) {\n if (message instanceof Error) {\n throw message;\n }\n var generatedMessage = !message;\n\n // 'The input was expected to not match the regular expression ' +\n message = message || (typeof string !== 'string' ? 'The \"string\" argument must be of type string. Received type ' + \"\".concat(_typeof(string), \" (\").concat(inspect(string), \")\") : (match ? 'The input did not match the regular expression ' : 'The input was expected to not match the regular expression ') + \"\".concat(inspect(regexp), \". Input:\\n\\n\").concat(inspect(string), \"\\n\"));\n var err = new AssertionError({\n actual: string,\n expected: regexp,\n message: message,\n operator: fnName,\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n}\nassert.match = function match(string, regexp, message) {\n internalMatch(string, regexp, message, match, 'match');\n};\nassert.doesNotMatch = function doesNotMatch(string, regexp, message) {\n internalMatch(string, regexp, message, doesNotMatch, 'doesNotMatch');\n};\n\n// Expose a strict only variant of assert\nfunction strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n innerOk.apply(void 0, [strict, args.length].concat(args));\n}\nassert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n});\nassert.strict.strict = assert.strict;","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","// Currently in sync with Node.js lib/internal/errors.js\n// https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f\n\n/* eslint node-core/documented-errors: \"error\" */\n/* eslint node-core/alphabetize-errors: \"error\" */\n/* eslint node-core/prefer-util-format-errors: \"error\" */\n\n'use strict';\n\n// The whole point behind this internal module is to allow Node.js to no\n// longer be forced to treat every error message change as a semver-major\n// change. The NodeError classes here all expose a `code` property whose\n// value statically and permanently identifies the error. While the error\n// message may change, the code should not.\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar codes = {};\n\n// Lazy loaded\nvar assert;\nvar util;\nfunction createErrorType(code, message, Base) {\n if (!Base) {\n Base = Error;\n }\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === 'string') {\n return message;\n } else {\n return message(arg1, arg2, arg3);\n }\n }\n var NodeError = /*#__PURE__*/function (_Base) {\n _inherits(NodeError, _Base);\n var _super = _createSuper(NodeError);\n function NodeError(arg1, arg2, arg3) {\n var _this;\n _classCallCheck(this, NodeError);\n _this = _super.call(this, getMessage(arg1, arg2, arg3));\n _this.code = code;\n return _this;\n }\n return _createClass(NodeError);\n }(Base);\n codes[code] = NodeError;\n}\n\n// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\nfunction oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function (i) {\n return String(i);\n });\n if (len > 2) {\n return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(', '), \", or \") + expected[len - 1];\n } else if (len === 2) {\n return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n } else {\n return \"of \".concat(thing, \" \").concat(expected[0]);\n }\n } else {\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\nfunction startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n return str.substring(this_len - search.length, this_len) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\nfunction includes(str, search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n if (start + search.length > str.length) {\n return false;\n } else {\n return str.indexOf(search, start) !== -1;\n }\n}\ncreateErrorType('ERR_AMBIGUOUS_ARGUMENT', 'The \"%s\" argument is ambiguous. %s', TypeError);\ncreateErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {\n if (assert === undefined) assert = require('../assert');\n assert(typeof name === 'string', \"'name' must be a string\");\n\n // determiner: 'must be' or 'must not be'\n var determiner;\n if (typeof expected === 'string' && startsWith(expected, 'not ')) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n } else {\n determiner = 'must be';\n }\n var msg;\n if (endsWith(name, ' argument')) {\n // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } else {\n var type = includes(name, '.') ? 'property' : 'argument';\n msg = \"The \\\"\".concat(name, \"\\\" \").concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n }\n\n // TODO(BridgeAR): Improve the output by showing `null` and similar.\n msg += \". Received type \".concat(_typeof(actual));\n return msg;\n}, TypeError);\ncreateErrorType('ERR_INVALID_ARG_VALUE', function (name, value) {\n var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'is invalid';\n if (util === undefined) util = require('util/');\n var inspected = util.inspect(value);\n if (inspected.length > 128) {\n inspected = \"\".concat(inspected.slice(0, 128), \"...\");\n }\n return \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n}, TypeError, RangeError);\ncreateErrorType('ERR_INVALID_RETURN_VALUE', function (input, name, value) {\n var type;\n if (value && value.constructor && value.constructor.name) {\n type = \"instance of \".concat(value.constructor.name);\n } else {\n type = \"type \".concat(_typeof(value));\n }\n return \"Expected \".concat(input, \" to be returned from the \\\"\").concat(name, \"\\\"\") + \" function but got \".concat(type, \".\");\n}, TypeError);\ncreateErrorType('ERR_MISSING_ARGS', function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (assert === undefined) assert = require('../assert');\n assert(args.length > 0, 'At least one arg needs to be specified');\n var msg = 'The ';\n var len = args.length;\n args = args.map(function (a) {\n return \"\\\"\".concat(a, \"\\\"\");\n });\n switch (len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(', ');\n msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n}, TypeError);\nmodule.exports.codes = codes;","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||\n function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for (var i = 0; i < keys.length; i++) {\n descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n }\n return descriptors;\n };\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n if (typeof process !== 'undefined' && process.noDeprecation === true) {\n return fn;\n }\n\n // Allow for deprecating things in the process of starting up.\n if (typeof process === 'undefined') {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnvRegex = /^$/;\n\nif (process.env.NODE_DEBUG) {\n var debugEnv = process.env.NODE_DEBUG;\n debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+?.]/g, '\\\\$&')\n .replace(/\\*/g, '.*')\n .replace(/,/g, '$|^')\n .toUpperCase();\n debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i');\n}\nexports.debuglog = function(set) {\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').slice(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.slice(1, -1);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexports.types = require('./support/types');\n\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\nexports.types.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\nexports.types.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\nexports.types.isNativeError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nvar kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;\n\nexports.promisify = function promisify(original) {\n if (typeof original !== 'function')\n throw new TypeError('The \"original\" argument must be of type Function');\n\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== 'function') {\n throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n }\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return fn;\n }\n\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function (resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n args.push(function (err, value) {\n if (err) {\n promiseReject(err);\n } else {\n promiseResolve(value);\n }\n });\n\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n\n return promise;\n }\n\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n\n if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return Object.defineProperties(\n fn,\n getOwnPropertyDescriptors(original)\n );\n}\n\nexports.promisify.custom = kCustomPromisifiedSymbol\n\nfunction callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error('Promise was rejected with a falsy value');\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\n\nfunction callbackify(original) {\n if (typeof original !== 'function') {\n throw new TypeError('The \"original\" argument must be of type Function');\n }\n\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args)\n .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) },\n function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) });\n }\n\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified,\n getOwnPropertyDescriptors(original));\n return callbackified;\n}\nexports.callbackify = callbackify;\n","// Currently in sync with Node.js lib/internal/util/types.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\n'use strict';\n\nvar isArgumentsObject = require('is-arguments');\nvar isGeneratorFunction = require('is-generator-function');\nvar whichTypedArray = require('which-typed-array');\nvar isTypedArray = require('is-typed-array');\n\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\n\nvar BigIntSupported = typeof BigInt !== 'undefined';\nvar SymbolSupported = typeof Symbol !== 'undefined';\n\nvar ObjectToString = uncurryThis(Object.prototype.toString);\n\nvar numberValue = uncurryThis(Number.prototype.valueOf);\nvar stringValue = uncurryThis(String.prototype.valueOf);\nvar booleanValue = uncurryThis(Boolean.prototype.valueOf);\n\nif (BigIntSupported) {\n var bigIntValue = uncurryThis(BigInt.prototype.valueOf);\n}\n\nif (SymbolSupported) {\n var symbolValue = uncurryThis(Symbol.prototype.valueOf);\n}\n\nfunction checkBoxedPrimitive(value, prototypeValueOf) {\n if (typeof value !== 'object') {\n return false;\n }\n try {\n prototypeValueOf(value);\n return true;\n } catch(e) {\n return false;\n }\n}\n\nexports.isArgumentsObject = isArgumentsObject;\nexports.isGeneratorFunction = isGeneratorFunction;\nexports.isTypedArray = isTypedArray;\n\n// Taken from here and modified for better browser support\n// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js\nfunction isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}\nexports.isPromise = isPromise;\n\nfunction isArrayBufferView(value) {\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n return ArrayBuffer.isView(value);\n }\n\n return (\n isTypedArray(value) ||\n isDataView(value)\n );\n}\nexports.isArrayBufferView = isArrayBufferView;\n\n\nfunction isUint8Array(value) {\n return whichTypedArray(value) === 'Uint8Array';\n}\nexports.isUint8Array = isUint8Array;\n\nfunction isUint8ClampedArray(value) {\n return whichTypedArray(value) === 'Uint8ClampedArray';\n}\nexports.isUint8ClampedArray = isUint8ClampedArray;\n\nfunction isUint16Array(value) {\n return whichTypedArray(value) === 'Uint16Array';\n}\nexports.isUint16Array = isUint16Array;\n\nfunction isUint32Array(value) {\n return whichTypedArray(value) === 'Uint32Array';\n}\nexports.isUint32Array = isUint32Array;\n\nfunction isInt8Array(value) {\n return whichTypedArray(value) === 'Int8Array';\n}\nexports.isInt8Array = isInt8Array;\n\nfunction isInt16Array(value) {\n return whichTypedArray(value) === 'Int16Array';\n}\nexports.isInt16Array = isInt16Array;\n\nfunction isInt32Array(value) {\n return whichTypedArray(value) === 'Int32Array';\n}\nexports.isInt32Array = isInt32Array;\n\nfunction isFloat32Array(value) {\n return whichTypedArray(value) === 'Float32Array';\n}\nexports.isFloat32Array = isFloat32Array;\n\nfunction isFloat64Array(value) {\n return whichTypedArray(value) === 'Float64Array';\n}\nexports.isFloat64Array = isFloat64Array;\n\nfunction isBigInt64Array(value) {\n return whichTypedArray(value) === 'BigInt64Array';\n}\nexports.isBigInt64Array = isBigInt64Array;\n\nfunction isBigUint64Array(value) {\n return whichTypedArray(value) === 'BigUint64Array';\n}\nexports.isBigUint64Array = isBigUint64Array;\n\nfunction isMapToString(value) {\n return ObjectToString(value) === '[object Map]';\n}\nisMapToString.working = (\n typeof Map !== 'undefined' &&\n isMapToString(new Map())\n);\n\nfunction isMap(value) {\n if (typeof Map === 'undefined') {\n return false;\n }\n\n return isMapToString.working\n ? isMapToString(value)\n : value instanceof Map;\n}\nexports.isMap = isMap;\n\nfunction isSetToString(value) {\n return ObjectToString(value) === '[object Set]';\n}\nisSetToString.working = (\n typeof Set !== 'undefined' &&\n isSetToString(new Set())\n);\nfunction isSet(value) {\n if (typeof Set === 'undefined') {\n return false;\n }\n\n return isSetToString.working\n ? isSetToString(value)\n : value instanceof Set;\n}\nexports.isSet = isSet;\n\nfunction isWeakMapToString(value) {\n return ObjectToString(value) === '[object WeakMap]';\n}\nisWeakMapToString.working = (\n typeof WeakMap !== 'undefined' &&\n isWeakMapToString(new WeakMap())\n);\nfunction isWeakMap(value) {\n if (typeof WeakMap === 'undefined') {\n return false;\n }\n\n return isWeakMapToString.working\n ? isWeakMapToString(value)\n : value instanceof WeakMap;\n}\nexports.isWeakMap = isWeakMap;\n\nfunction isWeakSetToString(value) {\n return ObjectToString(value) === '[object WeakSet]';\n}\nisWeakSetToString.working = (\n typeof WeakSet !== 'undefined' &&\n isWeakSetToString(new WeakSet())\n);\nfunction isWeakSet(value) {\n return isWeakSetToString(value);\n}\nexports.isWeakSet = isWeakSet;\n\nfunction isArrayBufferToString(value) {\n return ObjectToString(value) === '[object ArrayBuffer]';\n}\nisArrayBufferToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n isArrayBufferToString(new ArrayBuffer())\n);\nfunction isArrayBuffer(value) {\n if (typeof ArrayBuffer === 'undefined') {\n return false;\n }\n\n return isArrayBufferToString.working\n ? isArrayBufferToString(value)\n : value instanceof ArrayBuffer;\n}\nexports.isArrayBuffer = isArrayBuffer;\n\nfunction isDataViewToString(value) {\n return ObjectToString(value) === '[object DataView]';\n}\nisDataViewToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n typeof DataView !== 'undefined' &&\n isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1))\n);\nfunction isDataView(value) {\n if (typeof DataView === 'undefined') {\n return false;\n }\n\n return isDataViewToString.working\n ? isDataViewToString(value)\n : value instanceof DataView;\n}\nexports.isDataView = isDataView;\n\n// Store a copy of SharedArrayBuffer in case it's deleted elsewhere\nvar SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined;\nfunction isSharedArrayBufferToString(value) {\n return ObjectToString(value) === '[object SharedArrayBuffer]';\n}\nfunction isSharedArrayBuffer(value) {\n if (typeof SharedArrayBufferCopy === 'undefined') {\n return false;\n }\n\n if (typeof isSharedArrayBufferToString.working === 'undefined') {\n isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());\n }\n\n return isSharedArrayBufferToString.working\n ? isSharedArrayBufferToString(value)\n : value instanceof SharedArrayBufferCopy;\n}\nexports.isSharedArrayBuffer = isSharedArrayBuffer;\n\nfunction isAsyncFunction(value) {\n return ObjectToString(value) === '[object AsyncFunction]';\n}\nexports.isAsyncFunction = isAsyncFunction;\n\nfunction isMapIterator(value) {\n return ObjectToString(value) === '[object Map Iterator]';\n}\nexports.isMapIterator = isMapIterator;\n\nfunction isSetIterator(value) {\n return ObjectToString(value) === '[object Set Iterator]';\n}\nexports.isSetIterator = isSetIterator;\n\nfunction isGeneratorObject(value) {\n return ObjectToString(value) === '[object Generator]';\n}\nexports.isGeneratorObject = isGeneratorObject;\n\nfunction isWebAssemblyCompiledModule(value) {\n return ObjectToString(value) === '[object WebAssembly.Module]';\n}\nexports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;\n\nfunction isNumberObject(value) {\n return checkBoxedPrimitive(value, numberValue);\n}\nexports.isNumberObject = isNumberObject;\n\nfunction isStringObject(value) {\n return checkBoxedPrimitive(value, stringValue);\n}\nexports.isStringObject = isStringObject;\n\nfunction isBooleanObject(value) {\n return checkBoxedPrimitive(value, booleanValue);\n}\nexports.isBooleanObject = isBooleanObject;\n\nfunction isBigIntObject(value) {\n return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);\n}\nexports.isBigIntObject = isBigIntObject;\n\nfunction isSymbolObject(value) {\n return SymbolSupported && checkBoxedPrimitive(value, symbolValue);\n}\nexports.isSymbolObject = isSymbolObject;\n\nfunction isBoxedPrimitive(value) {\n return (\n isNumberObject(value) ||\n isStringObject(value) ||\n isBooleanObject(value) ||\n isBigIntObject(value) ||\n isSymbolObject(value)\n );\n}\nexports.isBoxedPrimitive = isBoxedPrimitive;\n\nfunction isAnyArrayBuffer(value) {\n return typeof Uint8Array !== 'undefined' && (\n isArrayBuffer(value) ||\n isSharedArrayBuffer(value)\n );\n}\nexports.isAnyArrayBuffer = isAnyArrayBuffer;\n\n['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) {\n Object.defineProperty(exports, method, {\n enumerable: false,\n value: function() {\n throw new Error(method + ' is not supported in userland');\n }\n });\n});\n","'use strict';\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\n\nvar isStandardArguments = function isArguments(value) {\n\tif (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {\n\t\treturn false;\n\t}\n\treturn $toString(value) === '[object Arguments]';\n};\n\nvar isLegacyArguments = function isArguments(value) {\n\tif (isStandardArguments(value)) {\n\t\treturn true;\n\t}\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.length === 'number' &&\n\t\tvalue.length >= 0 &&\n\t\t$toString(value) !== '[object Array]' &&\n\t\t$toString(value.callee) === '[object Function]';\n};\n\nvar supportsStandardArguments = (function () {\n\treturn isStandardArguments(arguments);\n}());\n\nisStandardArguments.isLegacyArguments = isLegacyArguments; // for tests\n\nmodule.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('hasown');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = require('function-bind');\n\n/** @type {(o: {}, p: PropertyKey) => p is keyof o} */\nmodule.exports = bind.call(call, $hasOwn);\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\nvar setFunctionLength = require('set-function-length');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tif (typeof originalFunction !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\tvar func = $reflectApply(bind, $call, arguments);\n\treturn setFunctionLength(\n\t\tfunc,\n\t\t1 + $max(0, originalFunction.length - (arguments.length - 1)),\n\t\ttrue\n\t);\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar gOPD = require('gopd');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $floor = GetIntrinsic('%Math.floor%');\n\nmodule.exports = function setFunctionLength(fn, length) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tif (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {\n\t\tthrow new $TypeError('`length` must be a positive 32-bit integer');\n\t}\n\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\n\tvar functionLengthIsConfigurable = true;\n\tvar functionLengthIsWritable = true;\n\tif ('length' in fn && gOPD) {\n\t\tvar desc = gOPD(fn, 'length');\n\t\tif (desc && !desc.configurable) {\n\t\t\tfunctionLengthIsConfigurable = false;\n\t\t}\n\t\tif (desc && !desc.writable) {\n\t\t\tfunctionLengthIsWritable = false;\n\t\t}\n\t}\n\n\tif (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(fn, 'length', length, true, true);\n\t\t} else {\n\t\t\tdefine(fn, 'length', length);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors')();\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar gopd = require('gopd');\n\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\tif ($defineProperty) {\n\t\ttry {\n\t\t\t$defineProperty({}, 'a', { value: 1 });\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\t// IE 8 has a broken defineProperty\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!hasPropertyDescriptors()) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar fnToStr = Function.prototype.toString;\nvar isFnRegex = /^\\s*(?:function)?\\*/;\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar getProto = Object.getPrototypeOf;\nvar getGeneratorFunc = function () { // eslint-disable-line consistent-return\n\tif (!hasToStringTag) {\n\t\treturn false;\n\t}\n\ttry {\n\t\treturn Function('return function*() {}')();\n\t} catch (e) {\n\t}\n};\nvar GeneratorFunction;\n\nmodule.exports = function isGeneratorFunction(fn) {\n\tif (typeof fn !== 'function') {\n\t\treturn false;\n\t}\n\tif (isFnRegex.test(fnToStr.call(fn))) {\n\t\treturn true;\n\t}\n\tif (!hasToStringTag) {\n\t\tvar str = toStr.call(fn);\n\t\treturn str === '[object GeneratorFunction]';\n\t}\n\tif (!getProto) {\n\t\treturn false;\n\t}\n\tif (typeof GeneratorFunction === 'undefined') {\n\t\tvar generatorFunc = getGeneratorFunc();\n\t\tGeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;\n\t}\n\treturn getProto(fn) === GeneratorFunction;\n};\n","'use strict';\n\nvar forEach = require('for-each');\nvar availableTypedArrays = require('available-typed-arrays');\nvar callBind = require('call-bind');\nvar callBound = require('call-bind/callBound');\nvar gOPD = require('gopd');\n\nvar $toString = callBound('Object.prototype.toString');\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\nvar typedArrays = availableTypedArrays();\n\nvar $slice = callBound('String.prototype.slice');\nvar getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\n\nvar $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tif (array[i] === value) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n};\nvar cache = { __proto__: null };\nif (hasToStringTag && gOPD && getPrototypeOf) {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new g[typedArray]();\n\t\tif (Symbol.toStringTag in arr) {\n\t\t\tvar proto = getPrototypeOf(arr);\n\t\t\tvar descriptor = gOPD(proto, Symbol.toStringTag);\n\t\t\tif (!descriptor) {\n\t\t\t\tvar superProto = getPrototypeOf(proto);\n\t\t\t\tdescriptor = gOPD(superProto, Symbol.toStringTag);\n\t\t\t}\n\t\t\tcache['$' + typedArray] = callBind(descriptor.get);\n\t\t}\n\t});\n} else {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new g[typedArray]();\n\t\tvar fn = arr.slice || arr.set;\n\t\tif (fn) {\n\t\t\tcache['$' + typedArray] = callBind(fn);\n\t\t}\n\t});\n}\n\nvar tryTypedArrays = function tryAllTypedArrays(value) {\n\tvar found = false;\n\tforEach(cache, function (getter, typedArray) {\n\t\tif (!found) {\n\t\t\ttry {\n\t\t\t\tif ('$' + getter(value) === typedArray) {\n\t\t\t\t\tfound = $slice(typedArray, 1);\n\t\t\t\t}\n\t\t\t} catch (e) { /**/ }\n\t\t}\n\t});\n\treturn found;\n};\n\nvar trySlices = function tryAllSlices(value) {\n\tvar found = false;\n\tforEach(cache, function (getter, name) {\n\t\tif (!found) {\n\t\t\ttry {\n\t\t\t\tgetter(value);\n\t\t\t\tfound = $slice(name, 1);\n\t\t\t} catch (e) { /**/ }\n\t\t}\n\t});\n\treturn found;\n};\n\nmodule.exports = function whichTypedArray(value) {\n\tif (!value || typeof value !== 'object') { return false; }\n\tif (!hasToStringTag) {\n\t\tvar tag = $slice($toString(value), 8, -1);\n\t\tif ($indexOf(typedArrays, tag) > -1) {\n\t\t\treturn tag;\n\t\t}\n\t\tif (tag !== 'Object') {\n\t\t\treturn false;\n\t\t}\n\t\t// node < 0.6 hits here on real Typed Arrays\n\t\treturn trySlices(value);\n\t}\n\tif (!gOPD) { return null; } // unknown engine\n\treturn tryTypedArrays(value);\n};\n","'use strict';\n\nvar isCallable = require('is-callable');\n\nvar toStr = Object.prototype.toString;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar forEachArray = function forEachArray(array, iterator, receiver) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (hasOwnProperty.call(array, i)) {\n if (receiver == null) {\n iterator(array[i], i, array);\n } else {\n iterator.call(receiver, array[i], i, array);\n }\n }\n }\n};\n\nvar forEachString = function forEachString(string, iterator, receiver) {\n for (var i = 0, len = string.length; i < len; i++) {\n // no such thing as a sparse string.\n if (receiver == null) {\n iterator(string.charAt(i), i, string);\n } else {\n iterator.call(receiver, string.charAt(i), i, string);\n }\n }\n};\n\nvar forEachObject = function forEachObject(object, iterator, receiver) {\n for (var k in object) {\n if (hasOwnProperty.call(object, k)) {\n if (receiver == null) {\n iterator(object[k], k, object);\n } else {\n iterator.call(receiver, object[k], k, object);\n }\n }\n }\n};\n\nvar forEach = function forEach(list, iterator, thisArg) {\n if (!isCallable(iterator)) {\n throw new TypeError('iterator must be a function');\n }\n\n var receiver;\n if (arguments.length >= 3) {\n receiver = thisArg;\n }\n\n if (toStr.call(list) === '[object Array]') {\n forEachArray(list, iterator, receiver);\n } else if (typeof list === 'string') {\n forEachString(list, iterator, receiver);\n } else {\n forEachObject(list, iterator, receiver);\n }\n};\n\nmodule.exports = forEach;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar possibleNames = [\n\t'BigInt64Array',\n\t'BigUint64Array',\n\t'Float32Array',\n\t'Float64Array',\n\t'Int16Array',\n\t'Int32Array',\n\t'Int8Array',\n\t'Uint16Array',\n\t'Uint32Array',\n\t'Uint8Array',\n\t'Uint8ClampedArray'\n];\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\n\nmodule.exports = function availableTypedArrays() {\n\tvar out = [];\n\tfor (var i = 0; i < possibleNames.length; i++) {\n\t\tif (typeof g[possibleNames[i]] === 'function') {\n\t\t\tout[out.length] = possibleNames[i];\n\t\t}\n\t}\n\treturn out;\n};\n","'use strict';\n\nvar whichTypedArray = require('which-typed-array');\n\nmodule.exports = function isTypedArray(value) {\n\treturn !!whichTypedArray(value);\n};\n","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","// Currently in sync with Node.js lib/internal/assert/assertion_error.js\n// https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c\n\n'use strict';\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _require = require('util/'),\n inspect = _require.inspect;\nvar _require2 = require('../errors'),\n ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n return str.substring(this_len - search.length, this_len) === search;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\nfunction repeat(str, count) {\n count = Math.floor(count);\n if (str.length == 0 || count == 0) return '';\n var maxCount = str.length * count;\n count = Math.floor(Math.log(count) / Math.log(2));\n while (count) {\n str += str;\n count--;\n }\n str += str.substring(0, maxCount - str.length);\n return str;\n}\nvar blue = '';\nvar green = '';\nvar red = '';\nvar white = '';\nvar kReadableOperator = {\n deepStrictEqual: 'Expected values to be strictly deep-equal:',\n strictEqual: 'Expected values to be strictly equal:',\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: 'Expected values to be loosely deep-equal:',\n equal: 'Expected values to be loosely equal:',\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: 'Values identical but not reference-equal:'\n};\n\n// Comparing short primitives should just show === / !== instead of using the\n// diff.\nvar kMaxShortLength = 10;\nfunction copyError(source) {\n var keys = Object.keys(source);\n var target = Object.create(Object.getPrototypeOf(source));\n keys.forEach(function (key) {\n target[key] = source[key];\n });\n Object.defineProperty(target, 'message', {\n value: source.message\n });\n return target;\n}\nfunction inspectValue(val) {\n // The util.inspect default values could be changed. This makes sure the\n // error messages contain the necessary information nevertheless.\n return inspect(val, {\n compact: false,\n customInspect: false,\n depth: 1000,\n maxArrayLength: Infinity,\n // Assert compares only enumerable properties (with a few exceptions).\n showHidden: false,\n // Having a long line as error is better than wrapping the line for\n // comparison for now.\n // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we\n // have meta information about the inspected properties (i.e., know where\n // in what line the property starts and ends).\n breakLength: Infinity,\n // Assert does not detect proxies currently.\n showProxy: false,\n sorted: true,\n // Inspect getters as we also check them when comparing entries.\n getters: true\n });\n}\nfunction createErrDiff(actual, expected, operator) {\n var other = '';\n var res = '';\n var lastPos = 0;\n var end = '';\n var skipped = false;\n var actualInspected = inspectValue(actual);\n var actualLines = actualInspected.split('\\n');\n var expectedLines = inspectValue(expected).split('\\n');\n var i = 0;\n var indicator = '';\n\n // In case both values are objects explicitly mark them as not reference equal\n // for the `strictEqual` operator.\n if (operator === 'strictEqual' && _typeof(actual) === 'object' && _typeof(expected) === 'object' && actual !== null && expected !== null) {\n operator = 'strictEqualObject';\n }\n\n // If \"actual\" and \"expected\" fit on a single line and they are not strictly\n // equal, check further special handling.\n if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n // If the character length of \"actual\" and \"expected\" together is less than\n // kMaxShortLength and if neither is an object and at least one of them is\n // not `zero`, use the strict equal comparison to visualize the output.\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== 'object' || actual === null) && (_typeof(expected) !== 'object' || expected === null) && (actual !== 0 || expected !== 0)) {\n // -0 === +0\n return \"\".concat(kReadableOperator[operator], \"\\n\\n\") + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], \"\\n\");\n }\n } else if (operator !== 'strictEqualObject') {\n // If the stderr is a tty and the input length is lower than the current\n // columns per line, add a mismatch indicator below the output. If it is\n // not a tty, use a default value of 80 characters.\n var maxLength = process.stderr && process.stderr.isTTY ? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n while (actualLines[0][i] === expectedLines[0][i]) {\n i++;\n }\n // Ignore the first characters.\n if (i > 2) {\n // Add position indicator for the first mismatch in case it is a\n // single line and the input length is less than the column length.\n indicator = \"\\n \".concat(repeat(' ', i), \"^\");\n i = 0;\n }\n }\n }\n }\n\n // Remove all ending lines that match (this optimizes the output for\n // readability by reducing the number of total changed lines).\n var a = actualLines[actualLines.length - 1];\n var b = expectedLines[expectedLines.length - 1];\n while (a === b) {\n if (i++ < 2) {\n end = \"\\n \".concat(a).concat(end);\n } else {\n other = a;\n }\n actualLines.pop();\n expectedLines.pop();\n if (actualLines.length === 0 || expectedLines.length === 0) break;\n a = actualLines[actualLines.length - 1];\n b = expectedLines[expectedLines.length - 1];\n }\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n // Strict equal with identical objects that are not identical by reference.\n // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() })\n if (maxLines === 0) {\n // We have to get the result again. The lines were all removed before.\n var _actualLines = actualInspected.split('\\n');\n\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (_actualLines.length > 30) {\n _actualLines[26] = \"\".concat(blue, \"...\").concat(white);\n while (_actualLines.length > 27) {\n _actualLines.pop();\n }\n }\n return \"\".concat(kReadableOperator.notIdentical, \"\\n\\n\").concat(_actualLines.join('\\n'), \"\\n\");\n }\n if (i > 3) {\n end = \"\\n\".concat(blue, \"...\").concat(white).concat(end);\n skipped = true;\n }\n if (other !== '') {\n end = \"\\n \".concat(other).concat(end);\n other = '';\n }\n var printedLines = 0;\n var msg = kReadableOperator[operator] + \"\\n\".concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white);\n var skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0; i < maxLines; i++) {\n // Only extra expected lines exist\n var cur = i - lastPos;\n if (actualLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(expectedLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(expectedLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the expected line to the cache.\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]);\n printedLines++;\n // Only extra actual lines exist\n } else if (expectedLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result.\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLines[i]);\n printedLines++;\n // Lines diverge\n } else {\n var expectedLine = expectedLines[i];\n var actualLine = actualLines[i];\n // If the lines diverge, specifically check for lines that only diverge by\n // a trailing comma. In that case it is actually identical and we should\n // mark it as such.\n var divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, ',') || actualLine.slice(0, -1) !== expectedLine);\n // If the expected line has a trailing comma but is otherwise identical,\n // add a comma at the end of the actual line. Otherwise the output could\n // look weird as in:\n //\n // [\n // 1 // No comma at the end!\n // + 2\n // ]\n //\n if (divergingLines && endsWith(expectedLine, ',') && expectedLine.slice(0, -1) === actualLine) {\n divergingLines = false;\n actualLine += ',';\n }\n if (divergingLines) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n }\n // Mark the current line as the last diverging one.\n lastPos = i;\n // Add the actual line to the result and cache the expected diverging\n // line so consecutive diverging lines show up as +++--- and not +-+-+-.\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLine);\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLine);\n printedLines += 2;\n // Lines are identical\n } else {\n // Add all cached information to the result before adding other things\n // and reset the cache.\n res += other;\n other = '';\n // If the last diverging line is exactly one line above or if it is the\n // very first line, add the line to the result.\n if (cur === 1 || i === 0) {\n res += \"\\n \".concat(actualLine);\n printedLines++;\n }\n }\n }\n // Inspected object to big (Show ~20 rows max)\n if (printedLines > 20 && i < maxLines - 2) {\n return \"\".concat(msg).concat(skippedMsg, \"\\n\").concat(res, \"\\n\").concat(blue, \"...\").concat(white).concat(other, \"\\n\") + \"\".concat(blue, \"...\").concat(white);\n }\n }\n return \"\".concat(msg).concat(skipped ? skippedMsg : '', \"\\n\").concat(res).concat(other).concat(end).concat(indicator);\n}\nvar AssertionError = /*#__PURE__*/function (_Error, _inspect$custom) {\n _inherits(AssertionError, _Error);\n var _super = _createSuper(AssertionError);\n function AssertionError(options) {\n var _this;\n _classCallCheck(this, AssertionError);\n if (_typeof(options) !== 'object' || options === null) {\n throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);\n }\n var message = options.message,\n operator = options.operator,\n stackStartFn = options.stackStartFn;\n var actual = options.actual,\n expected = options.expected;\n var limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n if (message != null) {\n _this = _super.call(this, String(message));\n } else {\n if (process.stderr && process.stderr.isTTY) {\n // Reset on each call to make sure we handle dynamically set environment\n // variables correct.\n if (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1) {\n blue = \"\\x1B[34m\";\n green = \"\\x1B[32m\";\n white = \"\\x1B[39m\";\n red = \"\\x1B[31m\";\n } else {\n blue = '';\n green = '';\n white = '';\n red = '';\n }\n }\n // Prevent the error stack from being visible by duplicating the error\n // in a very close way to the original in case both sides are actually\n // instances of Error.\n if (_typeof(actual) === 'object' && actual !== null && _typeof(expected) === 'object' && expected !== null && 'stack' in actual && actual instanceof Error && 'stack' in expected && expected instanceof Error) {\n actual = copyError(actual);\n expected = copyError(expected);\n }\n if (operator === 'deepStrictEqual' || operator === 'strictEqual') {\n _this = _super.call(this, createErrDiff(actual, expected, operator));\n } else if (operator === 'notDeepStrictEqual' || operator === 'notStrictEqual') {\n // In case the objects are equal but the operator requires unequal, show\n // the first object and say A equals B\n var base = kReadableOperator[operator];\n var res = inspectValue(actual).split('\\n');\n\n // In case \"actual\" is an object, it should not be reference equal.\n if (operator === 'notStrictEqual' && _typeof(actual) === 'object' && actual !== null) {\n base = kReadableOperator.notStrictEqualObject;\n }\n\n // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n if (res.length > 30) {\n res[26] = \"\".concat(blue, \"...\").concat(white);\n while (res.length > 27) {\n res.pop();\n }\n }\n\n // Only print a single input.\n if (res.length === 1) {\n _this = _super.call(this, \"\".concat(base, \" \").concat(res[0]));\n } else {\n _this = _super.call(this, \"\".concat(base, \"\\n\\n\").concat(res.join('\\n'), \"\\n\"));\n }\n } else {\n var _res = inspectValue(actual);\n var other = '';\n var knownOperators = kReadableOperator[operator];\n if (operator === 'notDeepEqual' || operator === 'notEqual') {\n _res = \"\".concat(kReadableOperator[operator], \"\\n\\n\").concat(_res);\n if (_res.length > 1024) {\n _res = \"\".concat(_res.slice(0, 1021), \"...\");\n }\n } else {\n other = \"\".concat(inspectValue(expected));\n if (_res.length > 512) {\n _res = \"\".concat(_res.slice(0, 509), \"...\");\n }\n if (other.length > 512) {\n other = \"\".concat(other.slice(0, 509), \"...\");\n }\n if (operator === 'deepEqual' || operator === 'equal') {\n _res = \"\".concat(knownOperators, \"\\n\\n\").concat(_res, \"\\n\\nshould equal\\n\\n\");\n } else {\n other = \" \".concat(operator, \" \").concat(other);\n }\n }\n _this = _super.call(this, \"\".concat(_res).concat(other));\n }\n }\n Error.stackTraceLimit = limit;\n _this.generatedMessage = !message;\n Object.defineProperty(_assertThisInitialized(_this), 'name', {\n value: 'AssertionError [ERR_ASSERTION]',\n enumerable: false,\n writable: true,\n configurable: true\n });\n _this.code = 'ERR_ASSERTION';\n _this.actual = actual;\n _this.expected = expected;\n _this.operator = operator;\n if (Error.captureStackTrace) {\n // eslint-disable-next-line no-restricted-syntax\n Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn);\n }\n // Create error message including the error code in the name.\n _this.stack;\n // Reset the name.\n _this.name = 'AssertionError';\n return _possibleConstructorReturn(_this);\n }\n _createClass(AssertionError, [{\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n }, {\n key: _inspect$custom,\n value: function value(recurseTimes, ctx) {\n // This limits the `actual` and `expected` property default inspection to\n // the minimum depth. Otherwise those values would be too verbose compared\n // to the actual error message which contains a combined view of these two\n // input values.\n return inspect(this, _objectSpread(_objectSpread({}, ctx), {}, {\n customInspect: false,\n depth: 0\n }));\n }\n }]);\n return AssertionError;\n}( /*#__PURE__*/_wrapNativeSuper(Error), inspect.custom);\nmodule.exports = AssertionError;","'use strict';\n\nvar implementation = require('./implementation');\n\nvar lacksProperEnumerationOrder = function () {\n\tif (!Object.assign) {\n\t\treturn false;\n\t}\n\t/*\n\t * v8, specifically in node 4.x, has a bug with incorrect property enumeration order\n\t * note: this does not detect the bug unless there's 20 characters\n\t */\n\tvar str = 'abcdefghijklmnopqrst';\n\tvar letters = str.split('');\n\tvar map = {};\n\tfor (var i = 0; i < letters.length; ++i) {\n\t\tmap[letters[i]] = letters[i];\n\t}\n\tvar obj = Object.assign({}, map);\n\tvar actual = '';\n\tfor (var k in obj) {\n\t\tactual += k;\n\t}\n\treturn str !== actual;\n};\n\nvar assignHasPendingExceptions = function () {\n\tif (!Object.assign || !Object.preventExtensions) {\n\t\treturn false;\n\t}\n\t/*\n\t * Firefox 37 still has \"pending exception\" logic in its Object.assign implementation,\n\t * which is 72% slower than our shim, and Firefox 40's native implementation.\n\t */\n\tvar thrower = Object.preventExtensions({ 1: 2 });\n\ttry {\n\t\tObject.assign(thrower, 'xy');\n\t} catch (e) {\n\t\treturn thrower[1] === 'y';\n\t}\n\treturn false;\n};\n\nmodule.exports = function getPolyfill() {\n\tif (!Object.assign) {\n\t\treturn implementation;\n\t}\n\tif (lacksProperEnumerationOrder()) {\n\t\treturn implementation;\n\t}\n\tif (assignHasPendingExceptions()) {\n\t\treturn implementation;\n\t}\n\treturn Object.assign;\n};\n","'use strict';\n\n// modified from https://github.com/es-shims/es6-shim\nvar objectKeys = require('object-keys');\nvar hasSymbols = require('has-symbols/shams')();\nvar callBound = require('call-bind/callBound');\nvar toObject = Object;\nvar $push = callBound('Array.prototype.push');\nvar $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');\nvar originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;\n\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function assign(target, source1) {\n\tif (target == null) { throw new TypeError('target must be an object'); }\n\tvar to = toObject(target); // step 1\n\tif (arguments.length === 1) {\n\t\treturn to; // step 2\n\t}\n\tfor (var s = 1; s < arguments.length; ++s) {\n\t\tvar from = toObject(arguments[s]); // step 3.a.i\n\n\t\t// step 3.a.ii:\n\t\tvar keys = objectKeys(from);\n\t\tvar getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);\n\t\tif (getSymbols) {\n\t\t\tvar syms = getSymbols(from);\n\t\t\tfor (var j = 0; j < syms.length; ++j) {\n\t\t\t\tvar key = syms[j];\n\t\t\t\tif ($propIsEnumerable(from, key)) {\n\t\t\t\t\t$push(keys, key);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// step 3.a.iii:\n\t\tfor (var i = 0; i < keys.length; ++i) {\n\t\t\tvar nextKey = keys[i];\n\t\t\tif ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2\n\t\t\t\tvar propValue = from[nextKey]; // step 3.a.iii.2.a\n\t\t\t\tto[nextKey] = propValue; // step 3.a.iii.2.b\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to; // step 4\n};\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\treturn typeof Object.is === 'function' ? Object.is : implementation;\n};\n","'use strict';\n\nvar numberIsNaN = function (value) {\n\treturn value !== value;\n};\n\nmodule.exports = function is(a, b) {\n\tif (a === 0 && b === 0) {\n\t\treturn 1 / a === 1 / b;\n\t}\n\tif (a === b) {\n\t\treturn true;\n\t}\n\tif (numberIsNaN(a) && numberIsNaN(b)) {\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n","// Currently in sync with Node.js lib/internal/util/comparisons.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\n'use strict';\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar regexFlagsSupported = /a/g.flags !== undefined;\nvar arrayFromSet = function arrayFromSet(set) {\n var array = [];\n set.forEach(function (value) {\n return array.push(value);\n });\n return array;\n};\nvar arrayFromMap = function arrayFromMap(map) {\n var array = [];\n map.forEach(function (value, key) {\n return array.push([key, value]);\n });\n return array;\n};\nvar objectIs = Object.is ? Object.is : require('object-is');\nvar objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function () {\n return [];\n};\nvar numberIsNaN = Number.isNaN ? Number.isNaN : require('is-nan');\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\nvar hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);\nvar propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable);\nvar objectToString = uncurryThis(Object.prototype.toString);\nvar _require$types = require('util/').types,\n isAnyArrayBuffer = _require$types.isAnyArrayBuffer,\n isArrayBufferView = _require$types.isArrayBufferView,\n isDate = _require$types.isDate,\n isMap = _require$types.isMap,\n isRegExp = _require$types.isRegExp,\n isSet = _require$types.isSet,\n isNativeError = _require$types.isNativeError,\n isBoxedPrimitive = _require$types.isBoxedPrimitive,\n isNumberObject = _require$types.isNumberObject,\n isStringObject = _require$types.isStringObject,\n isBooleanObject = _require$types.isBooleanObject,\n isBigIntObject = _require$types.isBigIntObject,\n isSymbolObject = _require$types.isSymbolObject,\n isFloat32Array = _require$types.isFloat32Array,\n isFloat64Array = _require$types.isFloat64Array;\nfunction isNonIndex(key) {\n if (key.length === 0 || key.length > 10) return true;\n for (var i = 0; i < key.length; i++) {\n var code = key.charCodeAt(i);\n if (code < 48 || code > 57) return true;\n }\n // The maximum size for an array is 2 ** 32 -1.\n return key.length === 10 && key >= Math.pow(2, 32);\n}\nfunction getOwnNonIndexProperties(value) {\n return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));\n}\n\n// Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n var x = a.length;\n var y = b.length;\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}\nvar ONLY_ENUMERABLE = undefined;\nvar kStrict = true;\nvar kLoose = false;\nvar kNoIterator = 0;\nvar kIsArray = 1;\nvar kIsSet = 2;\nvar kIsMap = 3;\n\n// Check if they have the same source and flags\nfunction areSimilarRegExps(a, b) {\n return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);\n}\nfunction areSimilarFloatArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n for (var offset = 0; offset < a.byteLength; offset++) {\n if (a[offset] !== b[offset]) {\n return false;\n }\n }\n return true;\n}\nfunction areSimilarTypedArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n return compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;\n}\nfunction areEqualArrayBuffers(buf1, buf2) {\n return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;\n}\nfunction isEqualBoxedPrimitive(val1, val2) {\n if (isNumberObject(val1)) {\n return isNumberObject(val2) && objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));\n }\n if (isStringObject(val1)) {\n return isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);\n }\n if (isBooleanObject(val1)) {\n return isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);\n }\n if (isBigIntObject(val1)) {\n return isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);\n }\n return isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);\n}\n\n// Notes: Type tags are historical [[Class]] properties that can be set by\n// FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS\n// and retrieved using Object.prototype.toString.call(obj) in JS\n// See https://tc39.github.io/ecma262/#sec-object.prototype.tostring\n// for a list of tags pre-defined in the spec.\n// There are some unspecified tags in the wild too (e.g. typed array tags).\n// Since tags can be altered, they only serve fast failures\n//\n// Typed arrays and buffers are checked by comparing the content in their\n// underlying ArrayBuffer. This optimization requires that it's\n// reasonable to interpret their underlying memory in the same way,\n// which is checked by comparing their type tags.\n// (e.g. a Uint8Array and a Uint16Array with the same memory content\n// could still be different because they will be interpreted differently).\n//\n// For strict comparison, objects should have\n// a) The same built-in type tags\n// b) The same prototypes.\n\nfunction innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? objectIs(val1, val2) : true;\n }\n\n // Check more closely if val1 and val2 are equal.\n if (strict) {\n if (_typeof(val1) !== 'object') {\n return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2);\n }\n if (_typeof(val2) !== 'object' || val1 === null || val2 === null) {\n return false;\n }\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) {\n return false;\n }\n } else {\n if (val1 === null || _typeof(val1) !== 'object') {\n if (val2 === null || _typeof(val2) !== 'object') {\n // eslint-disable-next-line eqeqeq\n return val1 == val2;\n }\n return false;\n }\n if (val2 === null || _typeof(val2) !== 'object') {\n return false;\n }\n }\n var val1Tag = objectToString(val1);\n var val2Tag = objectToString(val2);\n if (val1Tag !== val2Tag) {\n return false;\n }\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) {\n return false;\n }\n var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n if (keys1.length !== keys2.length) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kIsArray, keys1);\n }\n // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n if (val1Tag === '[object Object]') {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) {\n return false;\n }\n }\n if (isDate(val1)) {\n if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) {\n return false;\n }\n } else if (isRegExp(val1)) {\n if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) {\n return false;\n }\n } else if (isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) {\n return false;\n }\n } else if (isArrayBufferView(val1)) {\n if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {\n if (!areSimilarFloatArrays(val1, val2)) {\n return false;\n }\n } else if (!areSimilarTypedArrays(val1, val2)) {\n return false;\n }\n // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n if (_keys.length !== _keys2.length) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);\n } else if (isSet(val1)) {\n if (!isSet(val2) || val1.size !== val2.size) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kIsSet);\n } else if (isMap(val1)) {\n if (!isMap(val2) || val1.size !== val2.size) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kIsMap);\n } else if (isAnyArrayBuffer(val1)) {\n if (!areEqualArrayBuffers(val1, val2)) {\n return false;\n }\n } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {\n return false;\n }\n return keyCheck(val1, val2, strict, memos, kNoIterator);\n}\nfunction getEnumerables(val, keys) {\n return keys.filter(function (k) {\n return propertyIsEnumerable(val, k);\n });\n}\nfunction keyCheck(val1, val2, strict, memos, iterationType, aKeys) {\n // For all remaining Object pairs, including Array, objects and Maps,\n // equivalence is determined by having:\n // a) The same number of owned enumerable properties\n // b) The same set of keys/indexes (although not necessarily the same order)\n // c) Equivalent values for every corresponding key/index\n // d) For Sets and Maps, equal contents\n // Note: this accounts for both named and indexed properties on Arrays.\n if (arguments.length === 5) {\n aKeys = Object.keys(val1);\n var bKeys = Object.keys(val2);\n\n // The pair must have the same number of owned properties.\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n }\n\n // Cheap key test\n var i = 0;\n for (; i < aKeys.length; i++) {\n if (!hasOwnProperty(val2, aKeys[i])) {\n return false;\n }\n }\n if (strict && arguments.length === 5) {\n var symbolKeysA = objectGetOwnPropertySymbols(val1);\n if (symbolKeysA.length !== 0) {\n var count = 0;\n for (i = 0; i < symbolKeysA.length; i++) {\n var key = symbolKeysA[i];\n if (propertyIsEnumerable(val1, key)) {\n if (!propertyIsEnumerable(val2, key)) {\n return false;\n }\n aKeys.push(key);\n count++;\n } else if (propertyIsEnumerable(val2, key)) {\n return false;\n }\n }\n var symbolKeysB = objectGetOwnPropertySymbols(val2);\n if (symbolKeysA.length !== symbolKeysB.length && getEnumerables(val2, symbolKeysB).length !== count) {\n return false;\n }\n } else {\n var _symbolKeysB = objectGetOwnPropertySymbols(val2);\n if (_symbolKeysB.length !== 0 && getEnumerables(val2, _symbolKeysB).length !== 0) {\n return false;\n }\n }\n }\n if (aKeys.length === 0 && (iterationType === kNoIterator || iterationType === kIsArray && val1.length === 0 || val1.size === 0)) {\n return true;\n }\n\n // Use memos to handle cycles.\n if (memos === undefined) {\n memos = {\n val1: new Map(),\n val2: new Map(),\n position: 0\n };\n } else {\n // We prevent up to two map.has(x) calls by directly retrieving the value\n // and checking for undefined. The map can only contain numbers, so it is\n // safe to check for undefined only.\n var val2MemoA = memos.val1.get(val1);\n if (val2MemoA !== undefined) {\n var val2MemoB = memos.val2.get(val2);\n if (val2MemoB !== undefined) {\n return val2MemoA === val2MemoB;\n }\n }\n memos.position++;\n }\n memos.val1.set(val1, memos.position);\n memos.val2.set(val2, memos.position);\n var areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType);\n memos.val1.delete(val1);\n memos.val2.delete(val2);\n return areEq;\n}\nfunction setHasEqualElement(set, val1, strict, memo) {\n // Go looking.\n var setValues = arrayFromSet(set);\n for (var i = 0; i < setValues.length; i++) {\n var val2 = setValues[i];\n if (innerDeepEqual(val1, val2, strict, memo)) {\n // Remove the matching element to make sure we do not check that again.\n set.delete(val2);\n return true;\n }\n }\n return false;\n}\n\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using\n// Sadly it is not possible to detect corresponding values properly in case the\n// type is a string, number, bigint or boolean. The reason is that those values\n// can match lots of different string values (e.g., 1n == '+00001').\nfunction findLooseMatchingPrimitives(prim) {\n switch (_typeof(prim)) {\n case 'undefined':\n return null;\n case 'object':\n // Only pass in null as object!\n return undefined;\n case 'symbol':\n return false;\n case 'string':\n prim = +prim;\n // Loose equal entries exist only if the string is possible to convert to\n // a regular number and not NaN.\n // Fall through\n case 'number':\n if (numberIsNaN(prim)) {\n return false;\n }\n }\n return true;\n}\nfunction setMightHaveLoosePrim(a, b, prim) {\n var altValue = findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n return b.has(altValue) && !a.has(altValue);\n}\nfunction mapMightHaveLoosePrim(a, b, prim, item, memo) {\n var altValue = findLooseMatchingPrimitives(prim);\n if (altValue != null) {\n return altValue;\n }\n var curB = b.get(altValue);\n if (curB === undefined && !b.has(altValue) || !innerDeepEqual(item, curB, false, memo)) {\n return false;\n }\n return !a.has(altValue) && innerDeepEqual(item, curB, false, memo);\n}\nfunction setEquiv(a, b, strict, memo) {\n // This is a lazily initiated Set of entries which have to be compared\n // pairwise.\n var set = null;\n var aValues = arrayFromSet(a);\n for (var i = 0; i < aValues.length; i++) {\n var val = aValues[i];\n // Note: Checking for the objects first improves the performance for object\n // heavy sets but it is a minor slow down for primitives. As they are fast\n // to check this improves the worst case scenario instead.\n if (_typeof(val) === 'object' && val !== null) {\n if (set === null) {\n set = new Set();\n }\n // If the specified value doesn't exist in the second set its an not null\n // object (or non strict only: a not matching primitive) we'll need to go\n // hunting for something thats deep-(strict-)equal to it. To make this\n // O(n log n) complexity we have to copy these values in a new set first.\n set.add(val);\n } else if (!b.has(val)) {\n if (strict) return false;\n\n // Fast path to detect missing string, symbol, undefined and null values.\n if (!setMightHaveLoosePrim(a, b, val)) {\n return false;\n }\n if (set === null) {\n set = new Set();\n }\n set.add(val);\n }\n }\n if (set !== null) {\n var bValues = arrayFromSet(b);\n for (var _i = 0; _i < bValues.length; _i++) {\n var _val = bValues[_i];\n // We have to check if a primitive value is already\n // matching and only if it's not, go hunting for it.\n if (_typeof(_val) === 'object' && _val !== null) {\n if (!setHasEqualElement(set, _val, strict, memo)) return false;\n } else if (!strict && !a.has(_val) && !setHasEqualElement(set, _val, strict, memo)) {\n return false;\n }\n }\n return set.size === 0;\n }\n return true;\n}\nfunction mapHasEqualEntry(set, map, key1, item1, strict, memo) {\n // To be able to handle cases like:\n // Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']])\n // ... we need to consider *all* matching keys, not just the first we find.\n var setValues = arrayFromSet(set);\n for (var i = 0; i < setValues.length; i++) {\n var key2 = setValues[i];\n if (innerDeepEqual(key1, key2, strict, memo) && innerDeepEqual(item1, map.get(key2), strict, memo)) {\n set.delete(key2);\n return true;\n }\n }\n return false;\n}\nfunction mapEquiv(a, b, strict, memo) {\n var set = null;\n var aEntries = arrayFromMap(a);\n for (var i = 0; i < aEntries.length; i++) {\n var _aEntries$i = _slicedToArray(aEntries[i], 2),\n key = _aEntries$i[0],\n item1 = _aEntries$i[1];\n if (_typeof(key) === 'object' && key !== null) {\n if (set === null) {\n set = new Set();\n }\n set.add(key);\n } else {\n // By directly retrieving the value we prevent another b.has(key) check in\n // almost all possible cases.\n var item2 = b.get(key);\n if (item2 === undefined && !b.has(key) || !innerDeepEqual(item1, item2, strict, memo)) {\n if (strict) return false;\n // Fast path to detect missing string, symbol, undefined and null\n // keys.\n if (!mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;\n if (set === null) {\n set = new Set();\n }\n set.add(key);\n }\n }\n }\n if (set !== null) {\n var bEntries = arrayFromMap(b);\n for (var _i2 = 0; _i2 < bEntries.length; _i2++) {\n var _bEntries$_i = _slicedToArray(bEntries[_i2], 2),\n _key = _bEntries$_i[0],\n item = _bEntries$_i[1];\n if (_typeof(_key) === 'object' && _key !== null) {\n if (!mapHasEqualEntry(set, a, _key, item, strict, memo)) return false;\n } else if (!strict && (!a.has(_key) || !innerDeepEqual(a.get(_key), item, false, memo)) && !mapHasEqualEntry(set, a, _key, item, false, memo)) {\n return false;\n }\n }\n return set.size === 0;\n }\n return true;\n}\nfunction objEquiv(a, b, strict, keys, memos, iterationType) {\n // Sets and maps don't have their entries accessible via normal object\n // properties.\n var i = 0;\n if (iterationType === kIsSet) {\n if (!setEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsMap) {\n if (!mapEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsArray) {\n for (; i < a.length; i++) {\n if (hasOwnProperty(a, i)) {\n if (!hasOwnProperty(b, i) || !innerDeepEqual(a[i], b[i], strict, memos)) {\n return false;\n }\n } else if (hasOwnProperty(b, i)) {\n return false;\n } else {\n // Array is sparse.\n var keysA = Object.keys(a);\n for (; i < keysA.length; i++) {\n var key = keysA[i];\n if (!hasOwnProperty(b, key) || !innerDeepEqual(a[key], b[key], strict, memos)) {\n return false;\n }\n }\n if (keysA.length !== Object.keys(b).length) {\n return false;\n }\n return true;\n }\n }\n }\n\n // The pair must have equivalent values for every corresponding key.\n // Possibly expensive deep test:\n for (i = 0; i < keys.length; i++) {\n var _key2 = keys[i];\n if (!innerDeepEqual(a[_key2], b[_key2], strict, memos)) {\n return false;\n }\n }\n return true;\n}\nfunction isDeepEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kLoose);\n}\nfunction isDeepStrictEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kStrict);\n}\nmodule.exports = {\n isDeepEqual: isDeepEqual,\n isDeepStrictEqual: isDeepStrictEqual\n};","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Object);\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar defineDataProperty = require('define-data-property');\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar supportsDescriptors = require('has-property-descriptors')();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object) {\n\t\tif (predicate === true) {\n\t\t\tif (object[name] === value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (!isFunction(predicate) || !predicate()) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (supportsDescriptors) {\n\t\tdefineDataProperty(object, name, value, true);\n\t} else {\n\t\tdefineDataProperty(object, name, value);\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","'use strict';\n\nvar getPolyfill = require('./polyfill');\nvar define = require('define-properties');\n\nmodule.exports = function shimObjectIs() {\n\tvar polyfill = getPolyfill();\n\tdefine(Object, { is: polyfill }, {\n\t\tis: function testObjectIs() {\n\t\t\treturn Object.is !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Number);\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\nmodule.exports = function isNaN(value) {\n\treturn value !== value;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) {\n\t\treturn Number.isNaN;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\nmodule.exports = function shimNumberIsNaN() {\n\tvar polyfill = getPolyfill();\n\tdefine(Number, { isNaN: polyfill }, {\n\t\tisNaN: function testIsNaN() {\n\t\t\treturn Number.isNaN !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","import { strict as assert } from 'assert';\nimport Chart from 'chart.js/auto';\nimport Sortable from 'sortablejs';\n\nimport { animationFrame } from './util/animation-frame';\nimport type {\n StockIds,\n FlowIds,\n VariableIds,\n ParameterIds,\n} from './circular-economy-model';\nimport CircularEconomyModel, {\n Parameters,\n Record,\n} from './circular-economy-model';\nimport ModelSimulator from './model-simulator';\nimport Visualization from './visualization';\nimport { documentReady } from './util/document-ready';\nimport { guardedQuerySelector } from './util/guarded-query-selectors';\nimport ScriptedParameterTransform from './parameter-transform/scripted-parameter-transform';\n\ntype CircularEconomyModelSimulator = ModelSimulator<\n StockIds,\n FlowIds,\n VariableIds,\n ParameterIds\n>;\n\ntype ScriptCircularEconomyParameterTransform =\n ScriptedParameterTransform;\n\ntype CircularEconomyApi = {\n model: CircularEconomyModel;\n modelSimulator: CircularEconomyModelSimulator;\n parameterTransforms: {\n create: (id: string, script: string) => void;\n destroy: (id: string) => void;\n };\n};\n\nasync function init(): Promise {\n const model = new CircularEconomyModel();\n const modelSimulator = new ModelSimulator(\n model,\n // FIXME: It should be possible to pass CircularEconomyModel.initialStocks directly, but TypeScript does not complain.\n { ...CircularEconomyModel.initialStocks },\n // FIXME: It should be possible to pass CircularEconomyModel.defaultParameters directly, but TypeScript does not complain.\n { ...CircularEconomyModel.defaultParameters },\n 0.0,\n 0.01,\n );\n\n const availableParameterTransformsContainer = guardedQuerySelector(\n document,\n '#parameter-transforms .available',\n HTMLElement,\n );\n const activeParameterTransformsContainer = guardedQuerySelector(\n document,\n '#parameter-transforms .active',\n HTMLElement,\n );\n\n const availableParameterTransforms = new Map<\n string,\n ScriptCircularEconomyParameterTransform\n >();\n\n function getDistinctParameters(\n p1: Parameters,\n p2: Parameters,\n ): Partial {\n const result: Partial = {};\n model.parameterIds.forEach((id) => {\n if (p1[id] !== p2[id]) {\n result[id] = p2[id];\n }\n });\n return result;\n }\n\n function updateParameters() {\n const parameters = { ...CircularEconomyModel.defaultParameters };\n [...activeParameterTransformsContainer.children].forEach((e) => {\n assert(e instanceof HTMLElement);\n const id = e.getAttribute('data-id');\n assert(id !== null);\n const parameterTransform = availableParameterTransforms.get(id);\n assert(parameterTransform !== undefined);\n const backupParameters = { ...parameters };\n parameterTransform.applyTo(parameters);\n const distinctParameters = getDistinctParameters(\n backupParameters,\n parameters,\n );\n e.title = `${parameterTransform.script}\\n\\n${JSON.stringify(\n distinctParameters,\n null,\n 2,\n )}\\n\\n${JSON.stringify(parameters, null, 2)}`;\n });\n Object.assign(modelSimulator.parameters, parameters);\n }\n\n Sortable.create(availableParameterTransformsContainer, {\n group: {\n name: 'sharedParameterTransforms',\n pull: 'clone',\n put: false, // Do not allow items to be put into this list\n },\n });\n Sortable.create(activeParameterTransformsContainer, {\n group: { name: 'sharedParameterTransforms' },\n removeOnSpill: true,\n onSort: () => updateParameters(),\n onSpill: (event) => {\n event.item.remove();\n updateParameters();\n },\n });\n const parameterTransforms = {\n create: (id: string, script: string) => {\n if (availableParameterTransforms.has(id))\n throw new Error(`Parameter transform with id '${id}' already exists`);\n availableParameterTransforms.set(\n id,\n new ScriptedParameterTransform(\n 'none',\n model.parameterIds,\n script,\n ),\n );\n const dummyElement = document.createElement('div');\n dummyElement.innerHTML = `
${id}
`;\n const parameterTransformElement = dummyElement.firstChild;\n assert(parameterTransformElement !== null);\n availableParameterTransformsContainer.append(parameterTransformElement);\n },\n destroy: (id: string) => {\n availableParameterTransforms.delete(id);\n },\n };\n\n guardedQuerySelector(\n document,\n '#add-parameter-transform',\n HTMLElement,\n ).addEventListener('click', () => {\n const idElement = guardedQuerySelector(\n document,\n '#parameter-transform-id',\n HTMLInputElement,\n );\n const id = idElement.value;\n const scriptElement = guardedQuerySelector(\n document,\n '#parameter-transform-script',\n HTMLTextAreaElement,\n );\n const script = scriptElement.value;\n parameterTransforms.create(id, script);\n });\n\n let circularityIndex = 0;\n const circularityIndexElement = guardedQuerySelector(\n document,\n '#circularity-index',\n HTMLElement,\n );\n\n let userSatisfaction = 0;\n const userSatisfactionElement = guardedQuerySelector(\n document,\n '#user-satisfaction',\n HTMLElement,\n );\n\n const visualization = await Visualization.create(model);\n document.body.prepend(visualization.element);\n\n function toChartRecord(record: Record) {\n return CircularEconomyModel.elementIds\n .map((key) =>\n Object.entries(record[key]).map(([id, value]) => ({ id, value })),\n )\n .reduce((cur, acc) => [...cur, ...acc], []);\n }\n\n const initialChartRecord = toChartRecord(modelSimulator.record);\n\n const chartCanvas = document.getElementById('chart') as HTMLCanvasElement;\n assert(chartCanvas !== null, 'chart element not found');\n const chart = new Chart(chartCanvas, {\n type: 'bar',\n data: {\n labels: initialChartRecord.map((row) => row.id),\n datasets: [\n {\n label: 'Values',\n data: initialChartRecord.map((row) => row.value),\n },\n ],\n },\n options: { animation: false },\n });\n\n function updateIndices(record: Record) {\n const smoothingFactor = 0.5;\n\n const { phonesInUse } = record.stocks;\n const {\n produceFromNaturalResources,\n acquireNewlyProduced,\n acquireUsed,\n acquireRepaired,\n acquireRefurbished,\n disposeHibernating,\n disposeBroken,\n landfill,\n } = record.flows;\n const { phoneGoal } = record.variables;\n\n const naturalResourcesShare = Math.min(\n 1.0,\n produceFromNaturalResources /\n (acquireNewlyProduced +\n acquireUsed +\n acquireRepaired +\n acquireRefurbished),\n );\n const landfillShare = Math.min(\n 1.0,\n landfill / (disposeHibernating + disposeBroken),\n );\n const circularityIndexTarget = Math.min(\n 1.0 - naturalResourcesShare,\n 1.0 - landfillShare,\n );\n\n circularityIndex +=\n (circularityIndexTarget - circularityIndex) * smoothingFactor;\n circularityIndexElement.innerText = `${(circularityIndex * 100).toFixed(\n 2,\n )}%`;\n\n const userSatisfactionTarget =\n phonesInUse < phoneGoal\n ? phonesInUse / phoneGoal\n : phoneGoal / phonesInUse;\n userSatisfaction +=\n (userSatisfactionTarget - userSatisfaction) * smoothingFactor;\n userSatisfactionElement.innerText = `${(userSatisfaction * 100).toFixed(\n 2,\n )}%`;\n }\n\n function stepSimulation(deltaMs: number) {\n // TODO: pass deltaMs to modelSimulator.step()\n const record = modelSimulator.step();\n\n updateIndices(record);\n\n const chartRecord = toChartRecord(record);\n // console.log(chartRecord);\n chart.data.datasets[0].data = chartRecord.map((row) => row.value);\n\n chart.update();\n\n visualization.update(deltaMs, record);\n }\n\n let running = false;\n const runCheckBox = document.getElementById('run') as HTMLInputElement;\n assert(runCheckBox !== null, 'run checkbox not found');\n\n async function loopSimulation() {\n running = true;\n let lastTimeMs: DOMHighResTimeStamp | null = null;\n\n while (runCheckBox.checked) {\n // eslint-disable-next-line no-await-in-loop\n const currentTimeMs = await animationFrame();\n const deltaMs = lastTimeMs === null ? 0 : currentTimeMs - lastTimeMs;\n stepSimulation(deltaMs);\n lastTimeMs = currentTimeMs;\n }\n running = false;\n }\n\n runCheckBox.addEventListener('input', () => {\n if (!running)\n loopSimulation().catch((err) => {\n throw err;\n });\n });\n\n stepSimulation(0);\n\n const circularEconomyApi: CircularEconomyApi = {\n model,\n modelSimulator,\n parameterTransforms,\n };\n\n return circularEconomyApi;\n}\n\ndeclare global {\n interface Window {\n circularEconomy: Promise;\n }\n}\n\nwindow.circularEconomy = documentReady().then(init);\n","import {Chart, registerables} from '../dist/chart.js';\n\nChart.register(...registerables);\n\nexport * from '../dist/chart.js';\nexport default Chart;\n","/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */\nimport { r as requestAnimFrame, a as resolve, e as effects, c as color, i as isObject, d as defaults, b as isArray, v as valueOrDefault, u as unlistenArrayEvents, l as listenArrayEvents, f as resolveObjectKey, g as isNumberFinite, h as defined, s as sign, j as createContext, k as isNullOrUndef, _ as _arrayUnique, t as toRadians, m as toPercentage, n as toDimension, T as TAU, o as formatNumber, p as _angleBetween, H as HALF_PI, P as PI, q as _getStartAndCountOfVisiblePoints, w as _scaleRangesChanged, x as isNumber, y as _parseObjectDataRadialScale, z as getRelativePosition, A as _rlookupByKey, B as _lookupByKey, C as _isPointInArea, D as getAngleFromPoint, E as toPadding, F as each, G as getMaximumSize, I as _getParentNode, J as readUsedSize, K as supportsEventListenerOptions, L as throttled, M as _isDomSupported, N as _factorize, O as finiteOrDefault, Q as callback, R as _addGrace, S as _limitValue, U as toDegrees, V as _measureText, W as _int16Range, X as _alignPixel, Y as clipArea, Z as renderText, $ as unclipArea, a0 as toFont, a1 as _toLeftRightCenter, a2 as _alignStartEnd, a3 as overrides, a4 as merge, a5 as _capitalize, a6 as descriptors, a7 as isFunction, a8 as _attachContext, a9 as _createResolver, aa as _descriptors, ab as mergeIf, ac as uid, ad as debounce, ae as retinaScale, af as clearCanvas, ag as setsEqual, ah as _elementsEqual, ai as _isClickEvent, aj as _isBetween, ak as _readValueToProps, al as _updateBezierControlPoints, am as _computeSegments, an as _boundSegments, ao as _steppedInterpolation, ap as _bezierInterpolation, aq as _pointInLine, ar as _steppedLineTo, as as _bezierCurveTo, at as drawPoint, au as addRoundedRectPath, av as toTRBL, aw as toTRBLCorners, ax as _boundSegment, ay as _normalizeAngle, az as getRtlAdapter, aA as overrideTextDirection, aB as _textX, aC as restoreTextDirection, aD as drawPointLegend, aE as distanceBetweenPoints, aF as noop, aG as _setMinAndMaxByKey, aH as niceNum, aI as almostWhole, aJ as almostEquals, aK as _decimalPlaces, aL as Ticks, aM as log10, aN as _longestText, aO as _filterBetween, aP as _lookup } from './chunks/helpers.segment.js';\nimport '@kurkle/color';\n\nclass Animator {\n constructor(){\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n callbacks.forEach((fn)=>fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n this._request = requestAnimFrame.call(window, ()=>{\n this._update();\n this._request = null;\n if (this._running) {\n this._refresh();\n }\n });\n }\n _update(date = Date.now()) {\n let remaining = 0;\n this._charts.forEach((anims, chart)=>{\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n for(; i >= 0; --i){\n item = items[i];\n if (item._active) {\n if (item._total > anims.duration) {\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n remaining += items.length;\n });\n this._lastDate = date;\n if (remaining === 0) {\n this._running = false;\n }\n }\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur)=>Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n for(; i >= 0; --i){\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\nvar animator = /* #__PURE__ */ new Animator();\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean (from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n color (from, to, factor) {\n const c0 = color(from || transparent);\n const c1 = c0.valid && color(to || transparent);\n return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to;\n },\n number (from, to, factor) {\n return from + (to - from) * factor;\n }\n};\nclass Animation {\n constructor(cfg, target, prop, to){\n const currentValue = target[prop];\n to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n const from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n active() {\n return this._active;\n }\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n this._from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n }\n }\n cancel() {\n if (this._active) {\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n this._active = from !== to && (loop || elapsed < duration);\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n factor = elapsed / duration % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n this._target[prop] = this._fn(from, to, factor);\n }\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej)=>{\n promises.push({\n res,\n rej\n });\n });\n }\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for(let i = 0; i < promises.length; i++){\n promises[i][method]();\n }\n }\n}\n\nclass Animations {\n constructor(chart, config){\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n Object.getOwnPropertyNames(config).forEach((key)=>{\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions){\n resolved[option] = cfg[option];\n }\n (isArray(cfg.properties) && cfg.properties || [\n key\n ]).forEach((prop)=>{\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n awaitAll(target.options.$animations, newOptions).then(()=>{\n target.options = newOptions;\n }, ()=>{\n });\n }\n return animations;\n }\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n for(i = props.length - 1; i >= 0; --i){\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n if (animation) {\n if (cfg && animation.active()) {\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n target[prop] = value;\n continue;\n }\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n update(target, values) {\n if (this._properties.size === 0) {\n Object.assign(target, values);\n return;\n }\n const animations = this._createAnimations(target, values);\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for(let i = 0; i < keys.length; i++){\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n return Promise.all(running);\n}\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n target.options = options = Object.assign({}, options, {\n $shared: false,\n $animations: {}\n });\n }\n return options;\n}\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\nfunction toClip(value) {\n let t, r, b, l;\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n keys.push(metasets[i].index);\n }\n return keys;\n}\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n if (value === null) {\n return;\n }\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isNumberFinite(otherValue) && (singleMode || value === 0 || sign(value) === sign(otherValue))) {\n value += otherValue;\n }\n }\n return value;\n}\nfunction convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || stacked === undefined && meta.stack !== undefined;\n}\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction getUserBounds(scale) {\n const { min , max , minDefined , maxDefined } = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()){\n const value = stack[meta.index];\n if (positive && value > 0 || !positive && value < 0) {\n return meta.index;\n }\n }\n return null;\n}\nfunction updateStacks(controller, parsed) {\n const { chart , _cachedMeta: meta } = controller;\n const stacks = chart._stacks || (chart._stacks = {});\n const { iScale , vScale , index: datasetIndex } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n for(let i = 0; i < ilen; ++i){\n const item = parsed[i];\n const { [iAxis]: index , [vAxis]: value } = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter((key)=>scales[key].axis === axis).shift();\n}\nfunction createDatasetContext(parent, index) {\n return createContext(parent, {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n });\n}\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\nfunction clearStacks(meta, items) {\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n items = items || meta._parsed;\n for (const parsed of items){\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n delete stacks[axis]._visualValues[datasetIndex];\n }\n }\n}\nconst isDirectUpdateMode = (mode)=>mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared)=>shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart)=>canStack && !meta.hidden && meta._stacked && {\n keys: getSortedDatasetIndices(chart, true),\n values: null\n };\nclass DatasetController {\n static defaults = {};\n static datasetElementType = null;\n static dataElementType = null;\n constructor(chart, datasetIndex){\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n this.initialize();\n }\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n 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\");\n }\n }\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n const chooseId = (axis, x, y, r)=>axis === 'x' ? x : axis === 'r' ? r : y;\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale ? meta.vScale : meta.iScale;\n }\n reset() {\n this._update('reset');\n }\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n if (isObject(data)) {\n this._data = convertObjectDataToArray(data);\n } else if (_data !== data) {\n if (_data) {\n unlistenArrayEvents(_data, this);\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n addElements() {\n const meta = this._cachedMeta;\n this._dataCheck();\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n this._dataCheck();\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n this._resyncElements(resetNewElements);\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n }\n }\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n parse(start, count) {\n const { _cachedMeta: meta , _data: data } = this;\n const { iScale , _stacked } = meta;\n const iAxis = iScale.axis;\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n const isNotInOrderComparedToPrev = ()=>cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];\n for(i = 0; i < count; ++i){\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n parsePrimitiveData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return applyStack(stack, value, meta.index, {\n mode\n });\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n const { min: otherMin , max: otherMax } = getUserBounds(otherScale);\n let i, parsed;\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n for(i = 0; i < ilen; ++i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n break;\n }\n }\n if (sorted) {\n for(i = ilen - 1; i >= 0; --i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n for(i = 0, ilen = parsed.length; i < ilen; ++i){\n value = parsed[i][scale.axis];\n if (isNumberFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n getMaxOverflow() {\n return false;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n update(mode) {}\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || elements.length - start;\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n for(i = start; i < start + count; ++i){\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n for(i = 0; i < active.length; ++i){\n active[i].draw(ctx, area);\n }\n }\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index || 0, mode);\n }\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context || (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [\n `${elementType}Hover`,\n 'hover',\n elementType,\n ''\n ] : [\n elementType,\n ''\n ];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n const context = ()=>this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n if (values.$shared) {\n values.$shared = sharing;\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n return values;\n }\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions;\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {\n sharedOptions,\n includeOptions\n };\n }\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n options: !active && this.getSharedOptions(options) || options\n });\n }\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n for (const [method, arg1, arg2] of this._syncList){\n this[method](arg1, arg2);\n }\n this._syncList = [];\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n if (count) {\n this.parse(0, count);\n }\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n const move = (arr)=>{\n arr.length += count;\n for(i = arr.length - 1; i >= end; i--){\n arr[i] = arr[i - count];\n }\n };\n move(data);\n for(i = start; i < end; ++i){\n data[i] = new this.dataElementType();\n }\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n updateElements(element, start, count, mode) {}\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([\n this.index,\n ...args\n ]);\n }\n _onDataPush() {\n const count = arguments.length;\n this._sync([\n '_insertElements',\n this.getDataset().data.length - count,\n count\n ]);\n }\n _onDataPop() {\n this._sync([\n '_removeElements',\n this._cachedMeta.data.length - 1,\n 1\n ]);\n }\n _onDataShift() {\n this._sync([\n '_removeElements',\n 0,\n 1\n ]);\n }\n _onDataSplice(start, count) {\n if (count) {\n this._sync([\n '_removeElements',\n start,\n count\n ]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync([\n '_insertElements',\n start,\n newCount\n ]);\n }\n }\n _onDataUnshift() {\n this._sync([\n '_insertElements',\n 0,\n arguments.length\n ]);\n }\n}\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n for(let i = 0, ilen = visibleMetas.length; i < ilen; i++){\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b)=>a - b));\n }\n return scale._cache.$bar;\n}\n function computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = ()=>{\n if (curr === 32767 || curr === -32768) {\n return;\n }\n if (defined(prev)) {\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n for(i = 0, ilen = values.length; i < ilen; ++i){\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n prev = undefined;\n for(i = 0, ilen = scale.ticks.length; i < ilen; ++i){\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n return min;\n}\n function computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n size = thickness * stackCount;\n ratio = 1;\n }\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - size / 2\n };\n}\n function computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n if (prev === null) {\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n if (next === null) {\n next = curr + curr - prev;\n }\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n item[vScale.axis] = barEnd;\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n for(i = start, ilen = start + count; i < ilen; ++i){\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {\n start,\n end,\n reverse,\n top,\n bottom\n };\n}\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n if (edge === true) {\n properties.borderSkipped = {\n top: true,\n right: true,\n bottom: true,\n left: true\n };\n return;\n }\n const { start , end , reverse , top , bottom } = borderProps(properties);\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\nfunction setInflateAmount(properties, { inflateAmount }, ratio) {\n properties.inflateAmount = inflateAmount === 'auto' ? ratio === 1 ? 0.33 : 0 : inflateAmount;\n}\nclass BarController extends DatasetController {\n static id = 'bar';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true\n }\n }\n };\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseObjectData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for(i = start, ilen = start + count; i < ilen; ++i){\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n getMaxOverflow() {\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const { iScale , vScale } = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom) ? '[' + custom.start + ', ' + custom.end + ']' : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const { index , _cachedMeta: { vScale } } = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n for(let i = start; i < start + count; i++){\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {\n base,\n head: base\n } : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || index === stack._top || index === stack._bottom,\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n _getStacks(last, dataIndex) {\n const { iScale } = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const skipNull = (meta)=>{\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n for (const meta of metasets){\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === undefined && meta.stack === undefined) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n if (!stacks.length) {\n stacks.push(undefined);\n }\n return stacks;\n }\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = name !== undefined ? stacks.indexOf(name) : -1;\n return index === -1 ? stacks.length - 1 : index;\n }\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n for(i = 0, ilen = meta.data.length; i < ilen; ++i){\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n _calculateBarValuePixels(index) {\n const { _cachedMeta: { vScale , _stacked , index: datasetIndex } , options: { base: baseValue , minBarLength } } = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n if (length !== value) {\n start = length - value;\n length = value;\n }\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n head = base;\n }\n size = head - base;\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n if (_stacked && !floating) {\n parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n }\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex' ? computeFlexCategoryTraits(index, ruler, options, stackCount) : computeFitCategoryTraits(index, ruler, options, stackCount);\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + range.chunk * stackIndex + range.chunk / 2;\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n for(; i < ilen; ++i){\n if (this.getParsed(i)[vScale.axis] !== null) {\n rects[i].draw(this._ctx);\n }\n }\n }\n}\n\nclass BubbleController extends DatasetController {\n static id = 'bubble';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'borderWidth',\n 'radius'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n update(mode) {\n const points = this._cachedMeta.data;\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n if (reset) {\n properties.options.radius = 0;\n }\n }\n this.updateElement(point, i, properties, mode);\n }\n }\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n if (values.$shared) {\n values = Object.assign({}, values, {\n $shared: false\n });\n }\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n return values;\n }\n}\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {\n ratioX,\n ratioY,\n offsetX,\n offsetY\n };\n}\nclass DoughnutController extends DatasetController {\n static id = 'doughnut';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'circumference',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'startAngle',\n 'x',\n 'y',\n 'offset',\n 'borderWidth',\n 'spacing'\n ]\n }\n },\n cutout: '50%',\n rotation: 0,\n circumference: 360,\n radius: '100%',\n spacing: 0,\n indexAxis: 'r'\n };\n static descriptors = {\n _scriptable: (name)=>name !== 'spacing',\n _indexable: (name)=>name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash')\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n linkScales() {}\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i)=>+data[i];\n if (isObject(data[start])) {\n const { key ='value' } = this._parsing;\n getter = (i)=>+resolveObjectKey(data[i], key);\n }\n let i, ilen;\n for(i = start, ilen = start + count; i < ilen; ++i){\n meta._parsed[i] = getter(i);\n }\n }\n }\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n for(let i = 0; i < this.chart.data.datasets.length; ++i){\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n return {\n rotation: min,\n circumference: max - min\n };\n }\n update(mode) {\n const chart = this.chart;\n const { chartArea } = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n const { circumference , rotation } = this._getRotationExtents();\n const { ratioX , ratioY , offsetX , offsetY } = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n meta.total = this.calculateTotal();\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n for(i = 0; i < start; ++i){\n startAngle += this._circumference(i, reset);\n }\n for(i = start; i < start + count; ++i){\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n this.updateElement(arc, i, properties, mode);\n }\n }\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n for(i = 0; i < metaData.length; i++){\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n return total;\n }\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n if (!arcs) {\n for(i = 0, ilen = chart.data.datasets.length; i < ilen; ++i){\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n if (!arcs) {\n return 0;\n }\n for(i = 0, ilen = arcs.length; i < ilen; ++i){\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n getMaxOffset(arcs) {\n let max = 0;\n for(let i = 0, ilen = arcs.length; i < ilen; ++i){\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n for(let i = 0; i < datasetIndex; ++i){\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n return ringWeightOffset;\n }\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n\nclass LineController extends DatasetController {\n static id = 'line';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n showLine: true,\n spanGaps: false\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category'\n },\n _value_: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { dataset: line , data: points = [] , _dataset } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n this.updateElements(points, start, count, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = 0; i < pointsCount; ++i){\n const point = points[i];\n const properties = directUpdate ? point : {};\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n\nclass PolarAreaController extends DatasetController {\n static id = 'polarArea';\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ]\n }\n },\n indexAxis: 'r',\n startAngle: 0\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const arcs = this._cachedMeta.data;\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n meta.data.forEach((element, index)=>{\n const parsed = this.getParsed(index).r;\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n return range;\n }\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n this.outerRadius = outerRadius - radiusLength * this.index;\n this.innerRadius = this.outerRadius - radiusLength;\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n const defaultAngle = 360 / this.countVisibleElements();\n for(i = 0; i < start; ++i){\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for(i = start; i < start + count; i++){\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n this.updateElement(arc, i, properties, mode);\n }\n }\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n meta.data.forEach((element, index)=>{\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n return count;\n }\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index) ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle) : 0;\n }\n}\n\nclass PieController extends DoughnutController {\n static id = 'pie';\n static defaults = {\n cutout: 0,\n rotation: 0,\n circumference: 360,\n radius: '100%'\n };\n}\n\nclass RadarController extends DatasetController {\n static id = 'radar';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n }\n };\n static overrides = {\n aspectRatio: 1,\n scales: {\n r: {\n type: 'radialLinear'\n }\n }\n };\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n line.points = points;\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n this.updateElement(line, undefined, properties, mode);\n }\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n\nclass ScatterController extends DatasetController {\n static id = 'scatter';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n static overrides = {\n interaction: {\n mode: 'point'\n },\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { data: points = [] } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n if (this.options.showLine) {\n if (!this.datasetElementType) {\n this.addElements();\n }\n const { dataset: line , _dataset } = meta;\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n } else if (this.datasetElementType) {\n delete meta.dataset;\n this.datasetElementType = false;\n }\n this.updateElements(points, start, count, mode);\n }\n addElements() {\n const { showLine } = this.options;\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n super.addElements();\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = start; i < start + count; ++i){\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n if (!this.options.showLine) {\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n\nvar controllers = /*#__PURE__*/Object.freeze({\n__proto__: null,\nBarController: BarController,\nBubbleController: BubbleController,\nDoughnutController: DoughnutController,\nLineController: LineController,\nPieController: PieController,\nPolarAreaController: PolarAreaController,\nRadarController: RadarController,\nScatterController: ScatterController\n});\n\n/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */ function abstract() {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */ class DateAdapterBase {\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */ static override(members) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n options;\n constructor(options){\n this.options = options || {};\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n formats() {\n return abstract();\n }\n parse() {\n return abstract();\n }\n format() {\n return abstract();\n }\n add() {\n return abstract();\n }\n diff() {\n return abstract();\n }\n startOf() {\n return abstract();\n }\n endOf() {\n return abstract();\n }\n}\nvar adapters = {\n _date: DateAdapterBase\n};\n\nfunction binarySearch(metaset, axis, value, intersect) {\n const { controller , data , _sorted } = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {\n lo: start.lo,\n hi: end.hi\n };\n }\n }\n }\n return {\n lo: 0,\n hi: data.length - 1\n };\n}\n function evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for(let i = 0, ilen = metasets.length; i < ilen; ++i){\n const { index , data } = metasets[i];\n const { lo , hi } = binarySearch(metasets[i], axis, value, intersect);\n for(let j = lo; j <= hi; ++j){\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n function getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n function getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n };\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n function getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n function evaluationFunc(element, datasetIndex, index) {\n const { startAngle , endAngle } = element.getProps([\n 'startAngle',\n 'endAngle'\n ], useFinalPosition);\n const { angle } = getAngleFromPoint(element, {\n x: position.x,\n y: position.y\n });\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [\n {\n element,\n datasetIndex,\n index\n }\n ];\n minDistance = distance;\n } else if (distance === minDistance) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n return axis === 'r' && !intersect ? getNearestRadialItems(chart, position, axis, useFinalPosition) : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n function getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index)=>{\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n var Interaction = {\n evaluateInteractionItems,\n modes: {\n index (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n if (!items.length) {\n return [];\n }\n chart.getSortedVisibleDatasetMetas().forEach((meta)=>{\n const index = items[0].index;\n const element = meta.data[index];\n if (element && !element.skip) {\n elements.push({\n element,\n datasetIndex: meta.index,\n index\n });\n }\n });\n return elements;\n },\n dataset (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for(let i = 0; i < data.length; ++i){\n items.push({\n element: data[i],\n datasetIndex,\n index: i\n });\n }\n }\n return items;\n },\n point (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n nearest (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n x (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n y (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n\nconst STATIC_POSITIONS = [\n 'left',\n 'top',\n 'right',\n 'bottom'\n];\nfunction filterByPosition(array, position) {\n return array.filter((v)=>v.pos === position);\n}\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter((v)=>STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b)=>{\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;\n });\n}\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n for(i = 0, ilen = (boxes || []).length; i < ilen; ++i){\n box = boxes[i];\n ({ position: pos , options: { stack , stackWeight =1 } } = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && pos + stack,\n stackWeight\n });\n }\n return layoutBoxes;\n}\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts){\n const { stack , pos , stackWeight } = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {\n count: 0,\n placed: 0,\n weight: 0,\n size: 0\n });\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n function setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const { vBoxMaxWidth , hBoxMaxHeight } = params;\n let i, ilen, layout;\n for(i = 0, ilen = layouts.length; i < ilen; ++i){\n layout = layouts[i];\n const { fullSize } = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction updateDims(chartArea, params, layout, stacks) {\n const { pos , box } = layout;\n const maxPadding = chartArea.maxPadding;\n if (!isObject(pos)) {\n if (layout.size) {\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {\n size: 0,\n count: 1\n };\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n return layout.horizontal ? {\n same: widthChanged,\n other: heightChanged\n } : {\n same: heightChanged,\n other: widthChanged\n };\n}\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n function marginForPositions(positions) {\n const margin = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n positions.forEach((pos)=>{\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n return horizontal ? marginForPositions([\n 'left',\n 'right'\n ]) : marginForPositions([\n 'top',\n 'bottom'\n ]);\n}\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n for(i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i){\n layout = boxes[i];\n box = layout.box;\n box.update(layout.width || chartArea.w, layout.height || chartArea.h, getMargins(layout.horizontal, chartArea));\n const { same , other } = updateDims(chartArea, params, layout, stacks);\n refit |= same && refitBoxes.length;\n changed = changed || other;\n if (!box.fullSize) {\n refitBoxes.push(layout);\n }\n }\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let { x , y } = chartArea;\n for (const layout of boxes){\n const box = layout.box;\n const stack = stacks[layout.stack] || {\n count: 1,\n placed: 0,\n weight: 1\n };\n const weight = layout.stackWeight / stack.weight || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n chartArea.x = x;\n chartArea.y = y;\n}\nvar layouts = {\n addBox (chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n item._layers = item._layers || function() {\n return [\n {\n z: 0,\n draw (chartArea) {\n item.draw(chartArea);\n }\n }\n ];\n };\n chart.boxes.push(item);\n },\n removeBox (chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n configure (chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n update (chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n each(chart.boxes, (box)=>{\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap)=>wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n handleMaxPadding(chartArea);\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w\n };\n each(boxes.chartArea, (layout)=>{\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n });\n });\n }\n};\n\nclass BasePlatform {\n acquireContext(canvas, aspectRatio) {}\n releaseContext(context) {\n return false;\n }\n addEventListener(chart, type, listener) {}\n removeEventListener(chart, type, listener) {}\n getDevicePixelRatio() {\n return 1;\n }\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n isAttached(canvas) {\n return true;\n }\n updateConfig(config) {\n }\n}\n\nclass BasicPlatform extends BasePlatform {\n acquireContext(item) {\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n\nconst EXPANDO_KEY = '$chartjs';\n const EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\nconst isNullOrEmpty = (value)=>value === null || value === '';\n function initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n style.display = style.display || 'block';\n style.boxSizing = style.boxSizing || 'border-box';\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n return canvas;\n}\nconst eventListenerOptions = supportsEventListenerOptions ? {\n passive: true\n} : false;\nfunction addListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n}\nfunction removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const { x , y } = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null\n };\n}\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList){\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart)=>{\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height)=>{\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n listener();\n }\n }, window);\n const observer = new ResizeObserver((entries)=>{\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n return observer;\n}\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event)=>{\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n addListener(canvas, type, proxy);\n return proxy;\n}\n class DomPlatform extends BasePlatform {\n acquireContext(canvas, aspectRatio) {\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n if (context && context.canvas === canvas) {\n initCanvas(canvas, aspectRatio);\n return context;\n }\n return null;\n }\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n const initial = canvas[EXPANDO_KEY].initial;\n [\n 'height',\n 'width'\n ].forEach((prop)=>{\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n const style = initial.style || {};\n Object.keys(style).forEach((key)=>{\n canvas.style[key] = style[key];\n });\n canvas.width = canvas.width;\n delete canvas[EXPANDO_KEY];\n return true;\n }\n addEventListener(chart, type, listener) {\n this.removeEventListener(chart, type);\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n if (!proxy) {\n return;\n }\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n isAttached(canvas) {\n const container = _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n\nfunction _detectPlatform(canvas) {\n if (!_isDomSupported() || typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nclass Element {\n static defaults = {};\n static defaultRoutes = undefined;\n x;\n y;\n active = false;\n options;\n $animations;\n tooltipPosition(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n getProps(props, final) {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this;\n }\n const ret = {};\n props.forEach((prop)=>{\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n });\n return ret;\n }\n}\n\nfunction autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for(i = 0, ilen = numMajorIndices - 1; i < ilen; i++){\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n function calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n const factors = _factorize(evenMajorSpacing);\n for(let i = 0, ilen = factors.length - 1; i < ilen; i++){\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n function getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n function skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n spacing = Math.ceil(spacing);\n for(i = 0; i < ticks.length; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n function skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n next = start;\n while(next < 0){\n count++;\n next = Math.round(start + count * spacing);\n }\n for(i = Math.max(start, 0); i < end; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n function getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n if (len < 2) {\n return false;\n }\n for(diff = arr[0], i = 1; i < len; ++i){\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n\nconst reverseAlign = (align)=>align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset)=>edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit)=>Math.min(maxTicksLimit || ticksLength, ticksLength);\n function sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n for(; i < len; i += increment){\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n function getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6;\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n function garbageCollect(caches, length) {\n each(caches, (cache)=>{\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for(i = 0; i < gcLen; ++i){\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n function getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n function getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n return lines * font.lineHeight + padding.height;\n}\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\nfunction titleAlign(align, position, reverse) {\n let ret = _toLeftRightCenter(align);\n if (reverse && position !== 'right' || !reverse && position === 'right') {\n ret = reverseAlign(ret);\n }\n return ret;\n}\nfunction titleArgs(scale, offset, position, align) {\n const { top , left , bottom , right , chart } = scale;\n const { chartArea , scales } = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n}\nclass Scale extends Element {\n constructor(cfg){\n super();\n this.id = cfg.id;\n this.type = cfg.type;\n this.options = undefined;\n this.ctx = cfg.ctx;\n this.chart = cfg.chart;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.paddingTop = undefined;\n this.paddingBottom = undefined;\n this.paddingLeft = undefined;\n this.paddingRight = undefined;\n this.axis = undefined;\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n this.ticks = [];\n this._gridLineItems = null;\n this._labelItems = null;\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n this._startPixel = undefined;\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n init(options) {\n this.options = options.setContext(this.getContext());\n this.axis = options.axis;\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n parse(raw, index) {\n return raw;\n }\n getUserBounds() {\n let { _userMin , _userMax , _suggestedMin , _suggestedMax } = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isNumberFinite(_userMin),\n maxDefined: isNumberFinite(_userMax)\n };\n }\n getMinMax(canStack) {\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n let range;\n if (minDefined && maxDefined) {\n return {\n min,\n max\n };\n }\n const metas = this.getMatchingVisibleMetas();\n for(let i = 0, ilen = metas.length; i < ilen; ++i){\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n getTicks() {\n return this.ticks;\n }\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n beforeUpdate() {\n callback(this.options.beforeUpdate, [\n this\n ]);\n }\n update(maxWidth, maxHeight, margins) {\n const { beginAtZero , grace , ticks: tickOpts } = this.options;\n const sampleSize = tickOpts.sampleSize;\n this.beforeUpdate();\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n this.beforeBuildTicks();\n this.ticks = this.buildTicks() || [];\n this.afterBuildTicks();\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n this.configure();\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation();\n this.afterCalculateLabelRotation();\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n if (samplingEnabled) {\n this._convertTicksToLabels(this.ticks);\n }\n this.beforeFit();\n this.fit();\n this.afterFit();\n this.afterUpdate();\n }\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n afterUpdate() {\n callback(this.options.afterUpdate, [\n this\n ]);\n }\n beforeSetDimensions() {\n callback(this.options.beforeSetDimensions, [\n this\n ]);\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = 0;\n this.bottom = this.height;\n }\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n callback(this.options.afterSetDimensions, [\n this\n ]);\n }\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n callback(this.options[name], [\n this\n ]);\n }\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n beforeTickToLabelConversion() {\n callback(this.options.beforeTickToLabelConversion, [\n this\n ]);\n }\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n tick = ticks[i];\n tick.label = callback(tickOpts.callback, [\n tick.value,\n i,\n ticks\n ], this);\n }\n }\n afterTickToLabelConversion() {\n callback(this.options.afterTickToLabelConversion, [\n this\n ]);\n }\n beforeCalculateLabelRotation() {\n callback(this.options.beforeCalculateLabelRotation, [\n this\n ]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n callback(this.options.afterCalculateLabelRotation, [\n this\n ]);\n }\n afterAutoSkip() {}\n beforeFit() {\n callback(this.options.beforeFit, [\n this\n ]);\n }\n fit() {\n const minSize = {\n width: 0,\n height: 0\n };\n const { chart , options: { ticks: tickOpts , title: titleOpts , grid: gridOpts } } = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight;\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n if (tickOpts.display && this.ticks.length) {\n const { first , last , widest , highest } = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n if (isHorizontal) {\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n this._handleMargins();\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n _calculatePadding(first, last, sin, cos) {\n const { ticks: { align , padding } , position } = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n afterFit() {\n callback(this.options.afterFit, [\n this\n ]);\n }\n isHorizontal() {\n const { axis , position } = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n isFullSize() {\n return this.options.fullSize;\n }\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n this.generateTickLabels(ticks);\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n this.afterTickToLabelConversion();\n }\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n return labelSizes;\n }\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const { ctx , _longestTextCache: caches } = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n for(i = 0; i < length; i += increment){\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {\n data: {},\n gc: []\n };\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n for(j = 0, jlen = label.length; j < jlen; ++j){\n nestedLabel = label[j];\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n const valueAt = (idx)=>({\n width: widths[idx] || 0,\n height: heights[idx] || 0\n });\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights\n };\n }\n getLabelForValue(value) {\n return value;\n }\n getPixelForValue(value, index) {\n return NaN;\n }\n getValueForPixel(pixel) {}\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n getBaseValue() {\n const { min , max } = this;\n return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0;\n }\n getContext(index) {\n const ticks = this.ticks || [];\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context || (tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this));\n }\n _tickSize() {\n const optionTicks = this.options.ticks;\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin;\n }\n _isVisible() {\n const display = this.options.display;\n if (display !== 'auto') {\n return !!display;\n }\n return this.getMatchingVisibleMetas().length > 0;\n }\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const { grid , position , border } = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for(i = 0; i < ticksLength; i += step){\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n lineValue = getPixelForGridLine(this, i, offset);\n if (lineValue === undefined) {\n continue;\n }\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset\n });\n }\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n return items;\n }\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const { position , ticks: optionTicks } = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const { align , crossAlign , padding , mirror } = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = (chartArea.left + chartArea.right) / 2 - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n const labelSizes = this._getLabelSizes();\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n label = tick.label;\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n if (isHorizontal) {\n x = pixel;\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += lineHeight / 2 * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n let backdrop;\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n switch(textBaseline){\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n }\n switch(textAlign){\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n }\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n color: optsAtIndex.backdropColor\n };\n }\n items.push({\n label,\n font,\n textOffset,\n options: {\n rotation,\n color,\n strokeColor,\n strokeWidth,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [\n x,\n y\n ],\n backdrop\n }\n });\n }\n return items;\n }\n _getXAxisLabelAlignment() {\n const { position , ticks } = this.options;\n const rotation = -toRadians(this.labelRotation);\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n let align = 'center';\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n return align;\n }\n _getYAxisLabelAlignment(tl) {\n const { position , ticks: { crossAlign , mirror , padding } } = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n let textAlign;\n let x;\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n return {\n textAlign,\n x\n };\n }\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n const chart = this.chart;\n const position = this.options.position;\n if (position === 'left' || position === 'right') {\n return {\n top: 0,\n left: this.left,\n bottom: chart.height,\n right: this.right\n };\n }\n if (position === 'top' || position === 'bottom') {\n return {\n top: this.top,\n left: 0,\n bottom: this.bottom,\n right: chart.width\n };\n }\n }\n drawBackground() {\n const { ctx , options: { backgroundColor } , left , top , width , height } = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex((t)=>t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n const drawLine = (p1, p2, style)=>{\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n if (grid.display) {\n for(i = 0, ilen = items.length; i < ilen; ++i){\n const item = items[i];\n if (grid.drawOnChartArea) {\n drawLine({\n x: item.x1,\n y: item.y1\n }, {\n x: item.x2,\n y: item.y2\n }, item);\n }\n if (grid.drawTicks) {\n drawLine({\n x: item.tx1,\n y: item.ty1\n }, {\n x: item.tx2,\n y: item.ty2\n }, {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n });\n }\n }\n }\n }\n drawBorder() {\n const { chart , ctx , options: { border , grid } } = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.restore();\n }\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n if (!optionTicks.display) {\n return;\n }\n const ctx = this.ctx;\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n const items = this.getLabelItems(chartArea);\n for (const item of items){\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n if (area) {\n unclipArea(ctx);\n }\n }\n drawTitle() {\n const { ctx , options: { position , title , reverse } } = this;\n if (!title.display) {\n return;\n }\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n const { titleX , titleY , maxWidth , rotation } = titleArgs(this, offset, position, align);\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n return [\n {\n z: tz,\n draw: (chartArea)=>{\n this.draw(chartArea);\n }\n }\n ];\n }\n return [\n {\n z: gz,\n draw: (chartArea)=>{\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n },\n {\n z: bz,\n draw: ()=>{\n this.drawBorder();\n }\n },\n {\n z: tz,\n draw: (chartArea)=>{\n this.drawLabels(chartArea);\n }\n }\n ];\n }\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n\nclass TypedRegistry {\n constructor(type, scope, override){\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n if (isIChartComponent(proto)) {\n parentScope = this.register(proto);\n }\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n if (id in items) {\n return scope;\n }\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n return scope;\n }\n get(id) {\n return this.items[id];\n }\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n if (id in items) {\n delete items[id];\n }\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\nfunction registerDefaults(item, scope, parentScope) {\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n defaults.set(scope, itemDefaults);\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach((property)=>{\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [\n scope\n ].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n\nclass Registry {\n constructor(){\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n this._typedRegistries = [\n this.controllers,\n this.scales,\n this.elements\n ];\n }\n add(...args) {\n this._each('register', args);\n }\n remove(...args) {\n this._each('unregister', args);\n }\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n _each(method, args, typedRegistry) {\n [\n ...args\n ].forEach((arg)=>{\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) {\n this._exec(method, reg, arg);\n } else {\n each(arg, (item)=>{\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n callback(component['before' + camelMethod], [], component);\n registry[method](component);\n callback(component['after' + camelMethod], [], component);\n }\n _getRegistryForType(type) {\n for(let i = 0; i < this._typedRegistries.length; i++){\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n return this.plugins;\n }\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n}\nvar registry = /* #__PURE__ */ new Registry();\n\nclass PluginService {\n constructor(){\n this._init = [];\n }\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors){\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [\n chart,\n args,\n descriptor.options\n ];\n if (callback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n return true;\n }\n invalidate() {\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n const descriptors = this._cache = this._createDescriptors(chart);\n this._notifyStateChanges(chart);\n return descriptors;\n }\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\n function allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for(let i = 0; i < keys.length; i++){\n plugins.push(registry.getPlugin(keys[i]));\n }\n const local = config.plugins || [];\n for(let i = 0; i < local.length; i++){\n const plugin = local[i];\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n return {\n plugins,\n localIds\n };\n}\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\nfunction createDescriptors(chart, { plugins , localIds }, options, all) {\n const result = [];\n const context = chart.getContext();\n for (const plugin of plugins){\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {\n plugin,\n local: localIds[id]\n }, opts, context)\n });\n }\n return result;\n}\nfunction pluginOpts(config, { plugin , local }, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [\n ''\n ], {\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n\nfunction getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\nfunction idMatchesAxis(id) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n}\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\nfunction determineAxis(id, ...scaleOptions) {\n if (idMatchesAxis(id)) {\n return id;\n }\n for (const opts of scaleOptions){\n const axis = opts.axis || axisFromPosition(opts.position) || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n if (axis) {\n return axis;\n }\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\nfunction getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + 'AxisID'] === id) {\n return {\n axis\n };\n }\n}\nfunction retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d)=>d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) {\n return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n }\n }\n return {};\n}\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {\n scales: {}\n };\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n Object.keys(configScales).forEach((id)=>{\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [\n {\n axis\n },\n scaleConf,\n defaultScaleOptions[axis],\n defaultScaleOptions[defaultId]\n ]);\n });\n config.data.datasets.forEach((dataset)=>{\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach((defaultID)=>{\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [\n {\n axis\n },\n configScales[id],\n defaultScaleOptions[defaultID]\n ]);\n });\n });\n Object.keys(scales).forEach((key)=>{\n const scale = scales[key];\n mergeIf(scale, [\n defaults.scales[scale.type],\n defaults.scale\n ]);\n });\n return scales;\n}\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n initOptions(config);\n return config;\n}\nconst keyCache = new Map();\nconst keysCached = new Set();\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\nconst addIfFound = (set, obj, key)=>{\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\nclass Config {\n constructor(config){\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n get platform() {\n return this._config.platform;\n }\n get type() {\n return this._config.type;\n }\n set type(type) {\n this._config.type = type;\n }\n get data() {\n return this._config.data;\n }\n set data(data) {\n this._config.data = initData(data);\n }\n get options() {\n return this._config.options;\n }\n set options(options) {\n this._config.options = options;\n }\n get plugins() {\n return this._config.plugins;\n }\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType, ()=>[\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`, ()=>[\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`\n ],\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`, ()=>[\n [\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]\n ]);\n }\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`, ()=>[\n [\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || []\n ]\n ]);\n }\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n getOptionScopes(mainScope, keyLists, resetCache) {\n const { options , type } = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n const scopes = new Set();\n keyLists.forEach((keys)=>{\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach((key)=>addIfFound(scopes, mainScope, key));\n }\n keys.forEach((key)=>addIfFound(scopes, options, key));\n keys.forEach((key)=>addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach((key)=>addIfFound(scopes, defaults, key));\n keys.forEach((key)=>addIfFound(scopes, descriptors, key));\n });\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n chartOptionScopes() {\n const { options , type } = this;\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {},\n {\n type\n },\n defaults,\n descriptors\n ];\n }\n resolveNamedOptions(scopes, names, context, prefixes = [\n ''\n ]) {\n const result = {\n $shared: true\n };\n const { resolver , subPrefixes } = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n for (const prop of names){\n result[prop] = options[prop];\n }\n return result;\n }\n createResolver(scopes, context, prefixes = [\n ''\n ], descriptorDefaults) {\n const { resolver } = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context) ? _attachContext(resolver, context, undefined, descriptorDefaults) : resolver;\n }\n}\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter((p)=>!p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\nconst hasFunction = (value)=>isObject(value) && Object.getOwnPropertyNames(value).reduce((acc, key)=>acc || isFunction(value[key]), false);\nfunction needContext(proxy, names) {\n const { isScriptable , isIndexable } = _descriptors(proxy);\n for (const prop of names){\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if (scriptable && (isFunction(value) || hasFunction(value)) || indexable && isArray(value)) {\n return true;\n }\n }\n return false;\n}\n\nvar version = \"4.4.0\";\n\nconst KNOWN_POSITIONS = [\n 'top',\n 'bottom',\n 'left',\n 'right',\n 'chartArea'\n];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';\n}\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1];\n };\n}\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n chart.notifyPlugins('afterRender');\n callback(animationOptions && animationOptions.onComplete, [\n context\n ], chart);\n}\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callback(animationOptions && animationOptions.onProgress, [\n context\n ], chart);\n}\n function getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n item = item[0];\n }\n if (item && item.canvas) {\n item = item.canvas;\n }\n return item;\n}\nconst instances = {};\nconst getChart = (key)=>{\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c)=>c.canvas === canvas).pop();\n};\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys){\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n function determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\nfunction getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\nfunction getDatasetArea(meta, chartArea) {\n const { xScale , yScale } = meta;\n if (xScale && yScale) {\n return {\n left: getSizeForArea(xScale, chartArea, 'left'),\n right: getSizeForArea(xScale, chartArea, 'right'),\n top: getSizeForArea(yScale, chartArea, 'top'),\n bottom: getSizeForArea(yScale, chartArea, 'bottom')\n };\n }\n return chartArea;\n}\nclass Chart {\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n constructor(item, userConfig){\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error('Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' + ' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.');\n }\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce((mode)=>this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n instances[this.id] = this;\n if (!context || !canvas) {\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n get aspectRatio() {\n const { options: { aspectRatio , maintainAspectRatio } , width , height , _aspectRatio } = this;\n if (!isNullOrUndef(aspectRatio)) {\n return aspectRatio;\n }\n if (maintainAspectRatio && _aspectRatio) {\n return _aspectRatio;\n }\n return height ? width / height : null;\n }\n get data() {\n return this.config.data;\n }\n set data(data) {\n this.config.data = data;\n }\n get options() {\n return this._options;\n }\n set options(options) {\n this.config.options = options;\n }\n get registry() {\n return registry;\n }\n _initialize() {\n this.notifyPlugins('beforeInit');\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n this.bindEvents();\n this.notifyPlugins('afterInit');\n return this;\n }\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n stop() {\n animator.stop(this);\n return this;\n }\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {\n width,\n height\n };\n }\n }\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n this.notifyPlugins('resize', {\n size: newSize\n });\n callback(options.onResize, [\n this,\n newSize\n ], this);\n if (this.attached) {\n if (this._doResize(mode)) {\n this.render();\n }\n }\n }\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n each(scalesOptions, (axisOptions, axisID)=>{\n axisOptions.id = axisID;\n });\n }\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id)=>{\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n if (scaleOpts) {\n items = items.concat(Object.keys(scaleOpts).map((id)=>{\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n }));\n }\n each(items, (item)=>{\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n scale.init(scaleOptions, options);\n });\n each(updated, (hasUpdated, id)=>{\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n each(scales, (scale)=>{\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n metasets.sort((a, b)=>a.index - b.index);\n if (numMeta > numData) {\n for(let i = numData; i < numMeta; ++i){\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n _removeUnreferencedMetasets() {\n const { _metasets: metasets , data: { datasets } } = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index)=>{\n if (datasets.filter((x)=>x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n this._removeUnreferencedMetasets();\n for(i = 0, ilen = datasets.length; i < ilen; i++){\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const { datasetElementType , dataElementType } = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n this._updateMetasets();\n return newControllers;\n }\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex)=>{\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n update(mode) {\n const config = this.config;\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n this._plugins.invalidate();\n if (this.notifyPlugins('beforeUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n const newControllers = this.buildOrUpdateControllers();\n this.notifyPlugins('beforeElementsUpdate');\n let minPadding = 0;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; i++){\n const { controller } = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n if (!animsDisabled) {\n each(newControllers, (controller)=>{\n controller.reset();\n });\n }\n this._updateDatasets(mode);\n this.notifyPlugins('afterUpdate', {\n mode\n });\n this._layers.sort(compare2Level('z', '_idx'));\n const { _active , _lastEvent } = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n this.render();\n }\n _updateScales() {\n each(this.scales, (scale)=>{\n layouts.removeBox(this, scale);\n });\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n this.unbindEvents();\n this.bindEvents();\n }\n }\n _updateHiddenIndices() {\n const { _hiddenIndices } = this;\n const changes = this._getUniformDataChanges() || [];\n for (const { method , start , count } of changes){\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx)=>new Set(_dataChanges.filter((c)=>c[0] === idx).map((c, i)=>i + ',' + c.splice(1).join(',')));\n const changeSet = makeSet(0);\n for(let i = 1; i < datasetCount; i++){\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet).map((c)=>c.split(',')).map((a)=>({\n method: a[1],\n start: +a[2],\n count: +a[3]\n }));\n }\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {\n cancelable: true\n }) === false) {\n return;\n }\n layouts.update(this, this.width, this.height, minPadding);\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n this._layers = [];\n each(this.boxes, (box)=>{\n if (noArea && box.position === 'chartArea') {\n return;\n }\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n this._layers.forEach((item, index)=>{\n item._idx = index;\n });\n this.notifyPlugins('afterLayout');\n }\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this.getDatasetMeta(i).controller.configure();\n }\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this._updateDataset(i, isFunction(mode) ? mode({\n datasetIndex: i\n }) : mode);\n }\n this.notifyPlugins('afterDatasetsUpdate', {\n mode\n });\n }\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {\n meta,\n index,\n mode,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n meta.controller._update(mode);\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n render() {\n if (this.notifyPlugins('beforeRender', {\n cancelable: true\n }) === false) {\n return;\n }\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({\n chart: this\n });\n }\n }\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const { width , height } = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n if (this.notifyPlugins('beforeDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const layers = this._layers;\n for(i = 0; i < layers.length && layers[i].z <= 0; ++i){\n layers[i].draw(this.chartArea);\n }\n this._drawDatasets();\n for(; i < layers.length; ++i){\n layers[i].draw(this.chartArea);\n }\n this.notifyPlugins('afterDraw');\n }\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n return result;\n }\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const metasets = this.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n this._drawDataset(metasets[i]);\n }\n this.notifyPlugins('afterDatasetsDraw');\n }\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta, this.chartArea);\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n meta.controller.draw();\n if (useClip) {\n unclipArea(ctx);\n }\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n return [];\n }\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter((x)=>x && x._dataset === dataset).pop();\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n return meta;\n }\n getContext() {\n return this.$context || (this.$context = createContext(null, {\n chart: this,\n type: 'chart'\n }));\n }\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n const meta = this.getDatasetMeta(datasetIndex);\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n anims.update(meta, {\n visible\n });\n this.update((ctx)=>ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n for(i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this._destroyDatasetMeta(i);\n }\n }\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const { canvas , ctx } = this;\n this._stop();\n this.config.clearCache();\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n delete instances[this.id];\n this.notifyPlugins('afterDestroy');\n }\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const listener = (e, x, y)=>{\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n each(this.options.events, (type)=>_add(type, listener));\n }\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener)=>{\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n const listener = (width, height)=>{\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n let detached;\n const attached = ()=>{\n _remove('attach', attached);\n this.attached = true;\n this.resize();\n _add('resize', listener);\n _add('detach', detached);\n };\n detached = ()=>{\n this.attached = false;\n _remove('resize', listener);\n this._stop();\n this._resize(0, 0);\n _add('attach', attached);\n };\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n unbindEvents() {\n each(this._listeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n each(this._responsiveListeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n if (changed) {\n this._active = active;\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter((p)=>p.plugin.id === pluginId).length === 1;\n }\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin)=>(plugin.options.events || this.options.events).includes(e.native.type);\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n const changed = this._handleEvent(e, replay, args.inChartArea);\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n if (changed || args.changed) {\n this.render();\n }\n return this;\n }\n _handleEvent(e, replay, inChartArea) {\n const { _active: lastActive = [] , options } = this;\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n if (inChartArea) {\n this._lastEvent = null;\n callback(options.onHover, [\n e,\n active,\n this\n ], this);\n if (isClick) {\n callback(options.onClick, [\n e,\n active,\n this\n ], this);\n }\n }\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n this._lastEvent = lastEvent;\n return changed;\n }\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart)=>chart._plugins.invalidate());\n}\n\nfunction clipArc(ctx, element, endAngle) {\n const { startAngle , pixelMargin , x , y , outerRadius , innerRadius } = element;\n let angleMargin = pixelMargin / outerRadius;\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, [\n 'outerStart',\n 'outerEnd',\n 'innerStart',\n 'innerEnd'\n ]);\n}\n/**\n * Parse border radius from the provided options\n */ function parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val)=>{\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit)\n };\n}\n/**\n * Convert (r, 𝜃) to (x, y)\n */ function rThetaToXY(r, theta, x, y) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta)\n };\n}\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */ function pathArc(ctx, element, offset, spacing, end, circular) {\n const { x , y , startAngle: start , pixelMargin , innerRadius: innerR } = element;\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n let spacingOffset = 0;\n const alpha = end - start;\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const { outerStart , outerEnd , innerStart , innerEnd } = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n ctx.beginPath();\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2;\n ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true);\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n ctx.closePath();\n}\nfunction drawArc(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference } = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\nfunction drawBorder(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference , options } = element;\n const { borderWidth , borderJoinStyle , borderDash , borderDashOffset } = options;\n const inner = options.borderAlign === 'inner';\n if (!borderWidth) {\n return;\n }\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\nclass ArcElement extends Element {\n static id = 'arc';\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n static descriptors = {\n _scriptable: true,\n _indexable: (name)=>name !== 'borderDash'\n };\n circumference;\n endAngle;\n fullCircles;\n innerRadius;\n outerRadius;\n pixelMargin;\n startAngle;\n constructor(cfg){\n super();\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(chartX, chartY, useFinalPosition) {\n const point = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n const { angle , distance } = getAngleFromPoint(point, {\n x: chartX,\n y: chartY\n });\n const { startAngle , endAngle , innerRadius , outerRadius , circumference } = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n return betweenAngles && withinRadius;\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , startAngle , endAngle , innerRadius , outerRadius } = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ], useFinalPosition);\n const { offset , spacing } = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n tooltipPosition(useFinalPosition) {\n return this.getCenterPoint(useFinalPosition);\n }\n draw(ctx) {\n const { options , circumference } = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = options.borderAlign === 'inner' ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n ctx.save();\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n ctx.restore();\n }\n}\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\n function getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n return lineTo;\n}\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const { start: paramsStart = 0 , end: paramsEnd = count - 1 } = params;\n const { start: segmentStart , end: segmentEnd } = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n function pathSegment(ctx, line, segment, params) {\n const { points , options } = line;\n const { count , start , loop , ilen } = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n let { move =true , reverse } = params || {};\n let i, point, prev;\n for(i = 0; i <= ilen; ++i){\n point = points[(start + (reverse ? ilen - i : i)) % count];\n if (point.skip) {\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n prev = point;\n }\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n return !!loop;\n}\n function fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const { count , start , ilen } = pathVars(points, segment, params);\n const { move =true , reverse } = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n const pointIndex = (index)=>(start + (reverse ? ilen - index : index)) % count;\n const drawX = ()=>{\n if (minY !== maxY) {\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n ctx.lineTo(avgX, lastY);\n }\n };\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n for(i = 0; i <= ilen; ++i){\n point = points[pointIndex(i)];\n if (point.skip) {\n continue;\n }\n const x = point.x;\n const y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n ctx.lineTo(x, y);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n lastY = y;\n }\n drawX();\n}\n function _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n function _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n return _pointInLine;\n}\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\nfunction strokePathDirect(ctx, line, start, count) {\n const { segments , options } = line;\n const segmentMethod = _getSegmentMethod(line);\n for (const segment of segments){\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {\n start,\n end: start + count - 1\n })) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\nconst usePath2D = typeof Path2D === 'function';\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\nclass LineElement extends Element {\n static id = 'line';\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n static descriptors = {\n _scriptable: true,\n _indexable: (name)=>name !== 'borderDash' && name !== 'fill'\n };\n constructor(cfg){\n super();\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n get points() {\n return this._points;\n }\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {\n property,\n start: value,\n end: value\n });\n if (!segments.length) {\n return;\n }\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for(i = 0, ilen = segments.length; i < ilen; ++i){\n const { start , end } = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n start = start || 0;\n count = count || this.points.length - start;\n for (const segment of segments){\n loop &= segmentMethod(ctx, this, segment, {\n start,\n end: start + count - 1\n });\n }\n return !!loop;\n }\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n if (points.length && options.borderWidth) {\n ctx.save();\n draw(ctx, this, start, count);\n ctx.restore();\n }\n if (this.animated) {\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n\nfunction inRange$1(el, pos, axis, useFinalPosition) {\n const options = el.options;\n const { [axis]: value } = el.getProps([\n axis\n ], useFinalPosition);\n return Math.abs(pos - value) < options.radius + options.hitRadius;\n}\nclass PointElement extends Element {\n static id = 'point';\n parsed;\n skip;\n stop;\n /**\n * @type {any}\n */ static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n /**\n * @type {any}\n */ static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n const options = this.options;\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange$1(this, mouseX, 'x', useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange$1(this, mouseY, 'y', useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n size(options) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n draw(ctx, area) {\n const options = this.options;\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n\nfunction getBarBounds(bar, useFinalPosition) {\n const { x , y , base , width , height } = bar.getProps([\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ], useFinalPosition);\n let left, right, top, bottom, half;\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n return {\n left,\n top,\n right,\n bottom\n };\n}\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\nfunction parseBorderRadius(bar, maxW, maxH) {\n const { enableBorderRadius } = bar.getProps([\n 'enableBorderRadius'\n ]);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n const enableBorder = enableBorderRadius || isObject(value);\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))\n }\n }\n };\n}\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n return bounds && (skipX || _isBetween(x, bounds.left, bounds.right)) && (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n function addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\nclass BarElement extends Element {\n static id = 'bar';\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n draw(ctx) {\n const { inflateAmount , options: { borderColor , backgroundColor } } = this;\n const { inner , outer } = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n ctx.save();\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , base , horizontal } = this.getProps([\n 'x',\n 'y',\n 'base',\n 'horizontal'\n ], useFinalPosition);\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n\nvar elements = /*#__PURE__*/Object.freeze({\n__proto__: null,\nArcElement: ArcElement,\nBarElement: BarElement,\nLineElement: LineElement,\nPointElement: PointElement\n});\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)',\n 'rgb(255, 99, 132)',\n 'rgb(255, 159, 64)',\n 'rgb(255, 205, 86)',\n 'rgb(75, 192, 192)',\n 'rgb(153, 102, 255)',\n 'rgb(201, 203, 207)' // grey\n];\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map((color)=>color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\nfunction getBorderColor(i) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\nfunction getBackgroundColor(i) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\nfunction colorizeDefaultDataset(dataset, i) {\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n return ++i;\n}\nfunction colorizeDoughnutDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>getBorderColor(i++));\n return i;\n}\nfunction colorizePolarAreaDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>getBackgroundColor(i++));\n return i;\n}\nfunction getColorizer(chart) {\n let i = 0;\n return (dataset, datasetIndex)=>{\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n if (controller instanceof DoughnutController) {\n i = colorizeDoughnutDataset(dataset, i);\n } else if (controller instanceof PolarAreaController) {\n i = colorizePolarAreaDataset(dataset, i);\n } else if (controller) {\n i = colorizeDefaultDataset(dataset, i);\n }\n };\n}\nfunction containsColorsDefinitions(descriptors) {\n let k;\n for(k in descriptors){\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n return false;\n}\nfunction containsColorsDefinition(descriptor) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\nvar plugin_colors = {\n id: 'colors',\n defaults: {\n enabled: true,\n forceOverride: false\n },\n beforeLayout (chart, _args, options) {\n if (!options.enabled) {\n return;\n }\n const { data: { datasets } , options: chartOptions } = chart.config;\n const { elements } = chartOptions;\n if (!options.forceOverride && (containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || elements && containsColorsDefinitions(elements))) {\n return;\n }\n const colorizer = getColorizer(chart);\n datasets.forEach(colorizer);\n }\n};\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n const samples = options.samples || availableWidth;\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n const decimated = [];\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n decimated[sampledIndex++] = data[a];\n for(i = 0; i < samples - 2; i++){\n let avgX = 0;\n let avgY = 0;\n let j;\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n for(j = avgRangeStart; j < avgRangeEnd; j++){\n avgX += data[j].x;\n avgY += data[j].y;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const { x: pointAx , y: pointAy } = data[a];\n maxArea = area = -1;\n for(j = rangeOffs; j < rangeTo; j++){\n area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy));\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n decimated[sampledIndex++] = data[endIndex];\n return decimated;\n}\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n for(i = start; i < start + count; ++i){\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n const lastIndex = i - 1;\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n if (i > 0 && lastIndex !== startIndex) {\n decimated.push(data[lastIndex]);\n }\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n return decimated;\n}\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data\n });\n }\n}\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset)=>{\n cleanDecimatedDataset(dataset);\n });\n}\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n let start = 0;\n let count;\n const { iScale } = meta;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n return {\n start,\n count\n };\n}\nvar plugin_decimation = {\n id: 'decimation',\n defaults: {\n algorithm: 'min-max',\n enabled: false\n },\n beforeElementsUpdate: (chart, args, options)=>{\n if (!options.enabled) {\n cleanDecimatedData(chart);\n return;\n }\n const availableWidth = chart.width;\n chart.data.datasets.forEach((dataset, datasetIndex)=>{\n const { _data , indexAxis } = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n if (resolve([\n indexAxis,\n chart.options.indexAxis\n ]) === 'y') {\n return;\n }\n if (!meta.controller.supportsDecimation) {\n return;\n }\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n return;\n }\n if (chart.options.parsing) {\n return;\n }\n let { start , count } = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n cleanDecimatedDataset(dataset);\n return;\n }\n if (isNullOrUndef(_data)) {\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n let decimated;\n switch(options.algorithm){\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n dataset._decimated = decimated;\n });\n },\n destroy (chart) {\n cleanDecimatedData(chart);\n }\n};\n\nfunction _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n for (const segment of segments){\n let { start , end } = segment;\n end = _findSegmentEnd(start, end, points);\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n if (!target.segments) {\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n const targetSegments = _boundSegments(target, bounds);\n for (const tgt of targetSegments){\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n for (const fillSource of fillSources){\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\nfunction _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {\n property,\n start,\n end\n };\n}\nfunction _pointsFromSegments(boundary, line) {\n const { x =null , y =null } = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({ start , end })=>{\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({\n x: first.x,\n y\n });\n points.push({\n x: last.x,\n y\n });\n } else if (x !== null) {\n points.push({\n x,\n y: first.y\n });\n points.push({\n x,\n y: last.y\n });\n }\n });\n return points;\n}\nfunction _findSegmentEnd(start, end, points) {\n for(; end > start; end--){\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n\nfunction _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n if (isArray(boundary)) {\n _loop = true;\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n return points.length ? new LineElement({\n points,\n options: {\n tension: 0\n },\n _loop,\n _fullLoop: _loop\n }) : null;\n}\nfunction _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n\nfunction _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [\n index\n ];\n let target;\n if (!propagate) {\n return fill;\n }\n while(fill !== false && visited.indexOf(fill) === -1){\n if (!isNumberFinite(fill)) {\n return fill;\n }\n target = sources[fill];\n if (!target) {\n return false;\n }\n if (target.visible) {\n return fill;\n }\n visited.push(fill);\n fill = target.fill;\n }\n return false;\n}\n function _decodeFill(line, index, count) {\n const fill = parseFillOption(line);\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n let target = parseFloat(fill);\n if (isNumberFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n return [\n 'origin',\n 'start',\n 'end',\n 'stack',\n 'shape'\n ].indexOf(fill) >= 0 && fill;\n}\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n return target;\n}\n function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n function _getTargetValue(fill, scale, startValue) {\n let value;\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n function parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n if (fill === false || fill === null) {\n return false;\n }\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n\nfunction _buildStackLine(source) {\n const { scale , index , line } = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({\n x: null,\n y: scale.bottom\n }, line));\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n for(let j = segment.start; j <= segment.end; j++){\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({\n points,\n options: {}\n });\n}\n function getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n for(let i = 0; i < metas.length; i++){\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n function addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for(let j = 0; j < linesBelow.length; j++){\n const line = linesBelow[j];\n const { first , last , point } = findPoint(line, sourcePoint, 'x');\n if (!point || first && last) {\n continue;\n }\n if (first) {\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n break;\n }\n }\n }\n points.push(...postponed);\n}\n function findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {\n first,\n last,\n point\n };\n}\n\nclass simpleArc {\n constructor(opts){\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n pathSegment(ctx, bounds, opts) {\n const { x , y , radius } = this;\n bounds = bounds || {\n start: 0,\n end: TAU\n };\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n interpolate(point) {\n const { x , y , radius } = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n\nfunction _getTarget(source) {\n const { chart , fill , line } = source;\n if (isNumberFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n if (fill === 'shape') {\n return true;\n }\n const boundary = computeBoundary(source);\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n return _createBoundaryLine(boundary, line);\n}\n function getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\nfunction computeLinearBoundary(source) {\n const { scale ={} , fill } = source;\n const pixel = _getTargetPixel(fill, scale);\n if (isNumberFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n return null;\n}\nfunction computeCircularBoundary(source) {\n const { scale , fill } = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n for(let i = 0; i < length; ++i){\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\nfunction _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const { line , scale , axis } = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const { above =color , below =color } = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {\n line,\n target,\n above,\n below,\n area,\n scale,\n axis\n });\n unclipArea(ctx);\n }\n}\nfunction doFill(ctx, cfg) {\n const { line , target , above , below , area , scale } = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n ctx.save();\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {\n line,\n target,\n color: above,\n scale,\n property\n });\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {\n line,\n target,\n color: below,\n scale,\n property\n });\n ctx.restore();\n}\nfunction clipVertical(ctx, target, clipY) {\n const { segments , points } = target;\n let first = true;\n let lineLoop = false;\n ctx.beginPath();\n for (const segment of segments){\n const { start , end } = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {\n move: lineLoop\n });\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\nfunction fill(ctx, cfg) {\n const { line , target , property , color , scale } = cfg;\n const segments = _segments(line, target, property);\n for (const { source: src , target: tgt , start , end } of segments){\n const { style: { backgroundColor =color } = {} } = src;\n const notShape = target !== true;\n ctx.save();\n ctx.fillStyle = backgroundColor;\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n ctx.beginPath();\n const lineLoop = !!line.pathSegment(ctx, src);\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n const targetLoop = !!target.pathSegment(ctx, tgt, {\n move: lineLoop,\n reverse: true\n });\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n ctx.restore();\n }\n}\nfunction clipBounds(ctx, scale, bounds) {\n const { top , bottom } = scale.chart.chartArea;\n const { property , start , end } = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\nvar index = {\n id: 'filler',\n afterDatasetsUpdate (chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n for(i = 0; i < count; ++i){\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line\n };\n }\n meta.$filler = source;\n sources.push(source);\n }\n for(i = 0; i < count; ++i){\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n beforeDraw (chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n beforeDatasetsDraw (chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n const metasets = chart.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n beforeDatasetDraw (chart, args, options) {\n const source = args.meta.$filler;\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n\nconst getBoxSize = (labelOpts, fontSize)=>{\n let { boxHeight =fontSize , boxWidth =fontSize } = labelOpts;\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\nconst itemsEqual = (a, b)=>a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass Legend extends Element {\n constructor(config){\n super();\n this._added = false;\n this.legendHitBoxes = [];\n this._hoveredItem = null;\n this.doughnutMode = false;\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = callback(labelOpts.generateLabels, [\n this.chart\n ], this) || [];\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item)=>labelOpts.filter(item, this.chart.data));\n }\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b)=>labelOpts.sort(a, b, this.chart.data));\n }\n if (this.options.reverse) {\n legendItems.reverse();\n }\n this.legendItems = legendItems;\n }\n fit() {\n const { options , ctx } = this;\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const { boxWidth , itemHeight } = getBoxSize(labelOpts, fontSize);\n let width, height;\n ctx.font = labelFont.string;\n if (this.isHorizontal()) {\n width = this.maxWidth;\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight;\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const { ctx , maxWidth , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const lineWidths = this.lineWidths = [\n 0\n ];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i)=>{\n const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n hitboxes[i] = {\n left: 0,\n top,\n row,\n width: itemWidth,\n height: itemHeight\n };\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n return totalHeight;\n }\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const { ctx , maxHeight , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n let left = 0;\n let col = 0;\n this.legendItems.forEach((legendItem, i)=>{\n const { itemWidth , itemHeight } = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n hitboxes[i] = {\n left,\n top: currentColHeight,\n col,\n width: itemWidth,\n height: itemHeight\n };\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n totalWidth += currentColWidth;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n return totalWidth;\n }\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const { legendHitBoxes: hitboxes , options: { align , labels: { padding } , rtl } } = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes){\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes){\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n this._draw();\n unclipArea(ctx);\n }\n }\n _draw() {\n const { options: opts , columnSizes , lineWidths , ctx } = this;\n const { align , labels: labelOpts } = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const { padding } = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n this.drawTitle();\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n const { boxWidth , boxHeight , itemHeight } = getBoxSize(labelOpts, fontSize);\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n ctx.save();\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n if (labelOpts.usePointStyle) {\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n ctx.beginPath();\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n ctx.restore();\n };\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n overrideTextDirection(this.ctx, opts.textDirection);\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i)=>{\n ctx.strokeStyle = legendItem.fontColor;\n ctx.fillStyle = legendItem.fontColor;\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n rtlHelper.setWidth(this.width);\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n const realX = rtlHelper.x(x);\n drawLegendBox(realX, y, legendItem);\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n fillText(rtlHelper.x(x), y, legendItem);\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n if (!titleOpts.display) {\n return;\n }\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n let left = this.left;\n let maxWidth = this.width;\n if (this.isHorizontal()) {\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n const maxHeight = this.columnSizes.reduce((acc, size)=>Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n const x = _alignStartEnd(position, left, left + maxWidth);\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n if (_isBetween(x, this.left, this.right) && _isBetween(y, this.top, this.bottom)) {\n lh = this.legendHitBoxes;\n for(i = 0; i < lh.length; ++i){\n hitBox = lh[i];\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width) && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n return this.legendItems[i];\n }\n }\n }\n return null;\n }\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n callback(opts.onLeave, [\n e,\n previous,\n this\n ], this);\n }\n this._hoveredItem = hoveredItem;\n if (hoveredItem && !sameItem) {\n callback(opts.onHover, [\n e,\n hoveredItem,\n this\n ], this);\n }\n } else if (hoveredItem) {\n callback(opts.onClick, [\n e,\n hoveredItem,\n this\n ], this);\n }\n }\n}\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {\n itemWidth,\n itemHeight\n };\n}\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b)=>a.length > b.length ? a : b);\n }\n return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width;\n}\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\nvar plugin_legend = {\n id: 'legend',\n _element: Legend,\n start (chart, _args, options) {\n const legend = chart.legend = new Legend({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n stop (chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n beforeUpdate (chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n afterUpdate (chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n afterEvent (chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n onClick (e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n onHover: null,\n onLeave: null,\n labels: {\n color: (ctx)=>ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n generateLabels (chart) {\n const datasets = chart.data.datasets;\n const { labels: { usePointStyle , pointStyle , textAlign , color , useBorderRadius , borderRadius } } = chart.legend.options;\n return chart._getSortedDatasetMetas().map((meta)=>{\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n title: {\n color: (ctx)=>ctx.chart.options.color,\n display: false,\n position: 'center',\n text: ''\n }\n },\n descriptors: {\n _scriptable: (name)=>!name.startsWith('on'),\n labels: {\n _scriptable: (name)=>![\n 'generateLabels',\n 'filter',\n 'sort'\n ].includes(name)\n }\n }\n};\n\nclass Title extends Element {\n constructor(config){\n super();\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight) {\n const opts = this.options;\n this.left = 0;\n this.top = 0;\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n _drawArgs(offset) {\n const { top , left , bottom , right , options } = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n }\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n if (!opts.display) {\n return;\n }\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const { titleX , titleY , maxWidth , rotation } = this._drawArgs(offset);\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n}\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\nvar plugin_title = {\n id: 'title',\n _element: Title,\n start (chart, _args, options) {\n createTitle(chart, options);\n },\n stop (chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n beforeUpdate (chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold'\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst map = new WeakMap();\nvar plugin_subtitle = {\n id: 'subtitle',\n start (chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n stop (chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n beforeUpdate (chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal'\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst positioners = {\n average (items) {\n if (!items.length) {\n return false;\n }\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n return {\n x: x / count,\n y: y / count\n };\n },\n nearest (items, eventPosition) {\n if (!items.length) {\n return false;\n }\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n return {\n x,\n y\n };\n }\n};\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n return base;\n}\n function splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n function createTooltipItem(chart, item) {\n const { element , datasetIndex , index } = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const { label , value } = controller.getLabelAndValue(index);\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n function getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const { body , footer , title } = tooltip;\n const { boxWidth , boxHeight } = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n let combinedBodyLength = body.reduce((count, bodyItem)=>count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;\n }\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n ctx.save();\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;\n each(body, (bodyItem)=>{\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n widthPadding = 0;\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n ctx.restore();\n width += padding.width;\n return {\n width,\n height\n };\n}\nfunction determineYAlign(chart, size) {\n const { y , height } = size;\n if (y < height / 2) {\n return 'top';\n } else if (y > chart.height - height / 2) {\n return 'bottom';\n }\n return 'center';\n}\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const { x , width } = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\nfunction determineXAlign(chart, options, size, yAlign) {\n const { x , width } = size;\n const { width: chartWidth , chartArea: { left , right } } = chart;\n let xAlign = 'center';\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n return xAlign;\n}\n function determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\nfunction alignX(size, xAlign) {\n let { x , width } = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= width / 2;\n }\n return x;\n}\nfunction alignY(size, yAlign, paddingAndSize) {\n let { y , height } = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= height / 2;\n }\n return y;\n}\n function getBackgroundPoint(options, size, alignment, chart) {\n const { caretSize , caretPadding , cornerRadius } = options;\n const { xAlign , yAlign } = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n return align === 'center' ? tooltip.x + tooltip.width / 2 : align === 'right' ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;\n}\n function getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\nconst defaultCallbacks = {\n beforeTitle: noop,\n title (tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n return '';\n },\n afterTitle: noop,\n beforeBody: noop,\n beforeLabel: noop,\n label (tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n let label = tooltipItem.dataset.label || '';\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0\n };\n },\n labelTextColor () {\n return this.options.bodyColor;\n },\n labelPointStyle (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation\n };\n },\n afterLabel: noop,\n afterBody: noop,\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n function invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n return result;\n}\nclass Tooltip extends Element {\n static positioners = positioners;\n constructor(config){\n super();\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n if (cached) {\n return cached;\n }\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n return animations;\n }\n getContext() {\n return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n getTitle(context, options) {\n const { callbacks } = options;\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n return lines;\n }\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems));\n }\n getBody(tooltipItems, options) {\n const { callbacks } = options;\n const bodyItems = [];\n each(tooltipItems, (context)=>{\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n bodyItems.push(bodyItem);\n });\n return bodyItems;\n }\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems));\n }\n getFooter(tooltipItems, options) {\n const { callbacks } = options;\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n return lines;\n }\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n for(i = 0, len = active.length; i < len; ++i){\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array)=>options.filter(element, index, array, data));\n }\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b)=>options.itemSort(a, b, data));\n }\n each(tooltipItems, (context)=>{\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n if (changed && options.external) {\n options.external.call(this, {\n chart: this.chart,\n tooltip: this,\n replay\n });\n }\n }\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n getCaretPosition(tooltipPoint, size, options) {\n const { xAlign , yAlign } = this;\n const { caretSize , cornerRadius } = options;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n const { x: ptX , y: ptY } = tooltipPoint;\n const { width , height } = size;\n let x1, x2, x3, y1, y2, y3;\n if (yAlign === 'center') {\n y2 = ptY + height / 2;\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {\n x1,\n x2,\n x3,\n y1,\n y2,\n y3\n };\n }\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.titleAlign, options);\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing;\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing;\n }\n }\n }\n }\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const { boxHeight , boxWidth } = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2,\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1;\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = toTRBLCorners(labelColor.borderRadius);\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n ctx.fillStyle = this.labelTextColors[i];\n }\n drawBody(pt, ctx, options) {\n const { body } = this;\n const { bodySpacing , bodyAlign , displayColors , boxHeight , boxWidth , boxPadding } = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right' ? bodyAlign === 'center' ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;\n for(i = 0, ilen = body.length; i < ilen; ++i){\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n lines = bodyItem.lines;\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n for(j = 0, jlen = lines.length; j < jlen; ++j){\n fillLineOfText(lines[j]);\n bodyLineHeight = bodyFont.lineHeight;\n }\n each(bodyItem.after, fillLineOfText);\n }\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing;\n }\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n footerFont = toFont(options.footerFont);\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n drawBackground(pt, ctx, tooltipSize, options) {\n const { xAlign , yAlign } = this;\n const { x , y } = pt;\n const { width , height } = tooltipSize;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(options.cornerRadius);\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n _willRender() {\n return !!this.opacity;\n }\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n if (!opacity) {\n return;\n }\n this._updateAnimationTarget(options);\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n const padding = toPadding(options.padding);\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n this.drawBackground(pt, ctx, tooltipSize, options);\n overrideTextDirection(ctx, options.textDirection);\n pt.y += padding.top;\n this.drawTitle(pt, ctx, options);\n this.drawBody(pt, ctx, options);\n this.drawFooter(pt, ctx, options);\n restoreTextDirection(ctx, options.textDirection);\n ctx.restore();\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.chart.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n const positionChanged = this._positionChanged(active, e);\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n if (changed) {\n this._active = active;\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n this.update(true, replay);\n }\n }\n return changed;\n }\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n if (options.reverse) {\n active.reverse();\n }\n return active;\n }\n _positionChanged(active, e) {\n const { caretX , caretY , options } = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\nvar plugin_tooltip = {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n afterInit (chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({\n chart,\n options\n });\n }\n },\n beforeUpdate (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n reset (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n afterDraw (chart) {\n const tooltip = chart.tooltip;\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n if (chart.notifyPlugins('beforeTooltipDraw', {\n ...args,\n cancelable: true\n }) === false) {\n return;\n }\n tooltip.draw(chart.ctx);\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n afterEvent (chart, args) {\n if (chart.tooltip) {\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n args.changed = true;\n }\n }\n },\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold'\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {},\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold'\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts)=>opts.bodyFont.size,\n boxWidth: (ctx, opts)=>opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart'\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'width',\n 'height',\n 'caretX',\n 'caretY'\n ]\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n descriptors: {\n _scriptable: (name)=>name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n additionalOptionScopes: [\n 'interaction'\n ]\n};\n\nvar plugins = /*#__PURE__*/Object.freeze({\n__proto__: null,\nColors: plugin_colors,\nDecimation: plugin_decimation,\nFiller: index,\nLegend: plugin_legend,\nSubTitle: plugin_subtitle,\nTitle: plugin_title,\nTooltip: plugin_tooltip\n});\n\nconst addIfString = (labels, raw, index, addedLabels)=>{\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({\n index,\n label: raw\n });\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\nconst validIndex = (index, max)=>index === null ? null : _limitValue(Math.round(index), 0, max);\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\nclass CategoryScale extends Scale {\n static id = 'category';\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n constructor(cfg){\n super(cfg);\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const { index , label } of added){\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n determineDataLimits() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this.getMinMax(true);\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1);\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n for(let value = min; value <= max; value++){\n ticks.push({\n value\n });\n }\n return ticks;\n }\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n configure() {\n super.configure();\n if (!this.isHorizontal()) {\n this._reversePixels = !this._reversePixels;\n }\n }\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n getBasePixel() {\n return this.bottom;\n }\n}\n\nfunction generateTicks$1(generationOptions, dataRange) {\n const ticks = [];\n const MIN_SPACING = 1e-14;\n const { bounds , step , min , max , precision , count , maxTicks , maxDigits , includeBounds } = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const { min: rmin , max: rmax } = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [\n {\n value: rmin\n },\n {\n value: rmax\n }\n ];\n }\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n if (!isNullOrUndef(precision)) {\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n numSpaces = (niceMax - niceMin) / spacing;\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n const decimalPlaces = Math.max(_decimalPlaces(spacing), _decimalPlaces(niceMin));\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({\n value: min\n });\n if (niceMin < min) {\n j++;\n }\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n for(; j < numSpaces; ++j){\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) {\n break;\n }\n ticks.push({\n value: tickValue\n });\n }\n if (maxDefined && includeBounds && niceMax !== max) {\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({\n value: max\n });\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({\n value: niceMax\n });\n }\n return ticks;\n}\nfunction relativeLabelSize(value, minSpacing, { horizontal , minRotation }) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\nclass LinearScaleBase extends Scale {\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._endValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n return +raw;\n }\n handleTickRangeOptions() {\n const { beginAtZero } = this.options;\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n setMax(max + offset);\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n getTickLimit() {\n const tickOpts = this.options.ticks;\n let { maxTicksLimit , stepSize } = tickOpts;\n let maxTicks;\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n return maxTicks;\n }\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks$1(numericGeneratorOptions, dataRange);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n super.configure();\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n\nclass LinearScale extends LinearScaleBase {\n static id = 'linear';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? min : 0;\n this.max = isNumberFinite(max) ? max : 1;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n\nconst log10Floor = (v)=>Math.floor(log10(v));\nconst changeExponent = (v, m)=>Math.pow(10, log10Floor(v) + m);\nfunction isMajor(tickVal) {\n const remain = tickVal / Math.pow(10, log10Floor(tickVal));\n return remain === 1;\n}\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while(steps(min, max, rangeExp) > 10){\n rangeExp++;\n }\n while(steps(min, max, rangeExp) < 10){\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n function generateTicks(generationOptions, { min , max }) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while(value < max){\n ticks.push({\n value,\n major: isMajor(value),\n significand\n });\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({\n value: lastTick,\n major: isMajor(lastTick),\n significand\n });\n return ticks;\n}\nclass LogarithmicScale extends Scale {\n static id = 'logarithmic';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [\n raw,\n index\n ]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isNumberFinite(value) && value > 0 ? value : null;\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? Math.max(0, min) : null;\n this.max = isNumberFinite(max) ? Math.max(0, max) : null;\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n if (this._zero && this.min !== this._suggestedMin && !isNumberFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n this.handleTickRangeOptions();\n }\n handleTickRangeOptions() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (min === max) {\n if (min <= 0) {\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n setMax(changeExponent(min, +1));\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const opts = this.options;\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n getLabelForValue(value) {\n return value === undefined ? '0' : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n configure() {\n const start = this.min;\n super.configure();\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min ? 0 : (log10(value) - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [\n label\n ];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - size / 2,\n end: pos + size / 2\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n return {\n start: pos,\n end: pos + size\n };\n}\n function fitWithPointLabels(scale) {\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n for(let i = 0; i < valueCount; i++){\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b);\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\nfunction createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const { extra , additionalAngle , padding , size } = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n visible: true,\n x: pointLabelPosition.x,\n y,\n textAlign,\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\nfunction isNotOverlapped(item, area) {\n if (!area) {\n return true;\n }\n const { left , top , right , bottom } = item;\n const apexesInArea = _isPointInArea({\n x: left,\n y: top\n }, area) || _isPointInArea({\n x: left,\n y: bottom\n }, area) || _isPointInArea({\n x: right,\n y: top\n }, area) || _isPointInArea({\n x: right,\n y: bottom\n }, area);\n return !apexesInArea;\n}\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const { centerPointLabels , display } = opts.pointLabels;\n const itemOpts = {\n extra: getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? PI / valueCount : 0\n };\n let area;\n for(let i = 0; i < valueCount; i++){\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n const item = createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === 'auto') {\n item.visible = isNotOverlapped(item, area);\n if (item.visible) {\n area = item;\n }\n }\n }\n return items;\n}\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n return 'right';\n}\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= w / 2;\n }\n return x;\n}\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= h / 2;\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\nfunction drawPointLabelBox(ctx, opts, item) {\n const { left , top , right , bottom } = item;\n const { backdropColor } = opts;\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(opts.borderRadius);\n const padding = toPadding(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n}\nfunction drawPointLabels(scale, labelCount) {\n const { ctx , options: { pointLabels } } = scale;\n for(let i = labelCount - 1; i >= 0; i--){\n const item = scale._pointLabelItems[i];\n if (!item.visible) {\n continue;\n }\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = toFont(optsAtIndex.font);\n const { x , y , textAlign } = item;\n renderText(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n });\n }\n}\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const { ctx } = scale;\n if (circular) {\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n for(let i = 1; i < labelCount; i++){\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n const { color , lineWidth } = gridLineOpts;\n if (!circular && !labelCount || !color || !lineWidth || radius < 0) {\n return;\n }\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\nclass RadialLinearScale extends LinearScaleBase {\n static id = 'radialLinear';\n static defaults = {\n display: true,\n animate: true,\n position: 'chartArea',\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n grid: {\n circular: false\n },\n startAngle: 0,\n ticks: {\n showLabelBackdrop: true,\n callback: Ticks.formatters.numeric\n },\n pointLabels: {\n backdropColor: undefined,\n backdropPadding: 2,\n display: true,\n font: {\n size: 10\n },\n callback (label) {\n return label;\n },\n padding: 5,\n centerPointLabels: false\n }\n };\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n constructor(cfg){\n super(cfg);\n this.xCenter = undefined;\n this.yCenter = undefined;\n this.drawingArea = undefined;\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n setDimensions() {\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(false);\n this.min = isNumberFinite(min) && !isNaN(min) ? min : 0;\n this.max = isNumberFinite(max) && !isNaN(max) ? max : 0;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n this._pointLabels = this.getLabels().map((value, index)=>{\n const label = callback(this.options.pointLabels.callback, [\n value,\n index\n ], this);\n return label || label === 0 ? label : '';\n }).filter((v, i)=>this.chart.getDataVisibility(i));\n }\n fit() {\n const opts = this.options;\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n getPointLabelPosition(index) {\n const { left , top , right , bottom } = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom\n };\n }\n drawBackground() {\n const { backgroundColor , grid: { circular } } = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const { angleLines , grid , border } = opts;\n const labelCount = this._pointLabels.length;\n let i, offset, position;\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n if (grid.display) {\n this.ticks.forEach((tick, index)=>{\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n if (angleLines.display) {\n ctx.save();\n for(i = labelCount - 1; i >= 0; i--){\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const { color , lineWidth } = optsAtIndex;\n if (!lineWidth || !color) {\n continue;\n }\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n ctx.restore();\n }\n }\n drawBorder() {}\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n if (!tickOpts.display) {\n return;\n }\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n this.ticks.forEach((tick, index)=>{\n if (index === 0 && !opts.reverse) {\n return;\n }\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height);\n }\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth\n });\n });\n ctx.restore();\n }\n drawTitle() {}\n}\n\nconst INTERVALS = {\n millisecond: {\n common: true,\n size: 1,\n steps: 1000\n },\n second: {\n common: true,\n size: 1000,\n steps: 60\n },\n minute: {\n common: true,\n size: 60000,\n steps: 60\n },\n hour: {\n common: true,\n size: 3600000,\n steps: 24\n },\n day: {\n common: true,\n size: 86400000,\n steps: 30\n },\n week: {\n common: false,\n size: 604800000,\n steps: 4\n },\n month: {\n common: true,\n size: 2.628e9,\n steps: 12\n },\n quarter: {\n common: false,\n size: 7.884e9,\n steps: 4\n },\n year: {\n common: true,\n size: 3.154e10\n }\n};\n const UNITS = /* #__PURE__ */ Object.keys(INTERVALS);\n function sorter(a, b) {\n return a - b;\n}\n function parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n const adapter = scale._adapter;\n const { parser , round , isoWeekday } = scale._parseOpts;\n let value = input;\n if (typeof parser === 'function') {\n value = parser(value);\n }\n if (!isNumberFinite(value)) {\n value = typeof parser === 'string' ? adapter.parse(value, parser) : adapter.parse(value);\n }\n if (value === null) {\n return null;\n }\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, 'isoWeek', isoWeekday) : adapter.startOf(value, round);\n }\n return +value;\n}\n function determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n for(let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i){\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n return UNITS[ilen - 1];\n}\n function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for(let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--){\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n function determineMajorUnit(unit) {\n for(let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i){\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n function addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const { lo , hi } = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n function setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n for(major = first; major <= last; major = +adapter.add(major, 1, majorUnit)){\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n function ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n const map = {};\n const ilen = values.length;\n let i, value;\n for(i = 0; i < ilen; ++i){\n value = values[i];\n map[value] = i;\n ticks.push({\n value,\n major: false\n });\n }\n return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass TimeScale extends Scale {\n static id = 'time';\n static defaults = {\n bounds: 'data',\n adapters: {},\n time: {\n parser: false,\n unit: false,\n round: false,\n isoWeekday: false,\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n source: 'auto',\n callback: false,\n major: {\n enabled: false\n }\n }\n };\n constructor(props){\n super(props);\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n this._unit = 'day';\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n adapter.init(opts);\n mergeIf(time.displayFormats, adapter.formats());\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n super.init(scaleOpts);\n this._normalized = opts.normalized;\n }\n parse(raw, index) {\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n if (!minDefined || !maxDefined) {\n _applyBounds(this._getLabelBounds());\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {\n min,\n max\n };\n }\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n const min = this.min;\n const max = this.max;\n const ticks = _filterBetween(timestamps, min, max);\n this._unit = timeOpts.unit || (tickOpts.autoSkip ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n if (options.reverse) {\n ticks.reverse();\n }\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n afterAutoSkip() {\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map((tick)=>+tick.value));\n }\n }\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n this._offsets = {\n start,\n end,\n factor: 1 / (start + 1 + end)\n };\n }\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for(time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++){\n addTick(ticks, time, timestamps);\n }\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n return Object.keys(ticks).sort(sorter).map((x)=>+x);\n }\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n if (formatter) {\n return callback(formatter, [\n time,\n index,\n ticks\n ], this);\n }\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n generateTickLabels(ticks) {\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n return {\n w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,\n h: tickLabelWidth * sinRotation + tickFontSize * cosRotation\n };\n }\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [\n exampleTime\n ], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const metas = this.getMatchingVisibleMetas();\n if (this._normalized && metas.length) {\n return this._cache.data = metas[0].controller.getAllParsedValues(this);\n }\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n return this._cache.data = this.normalize(timestamps);\n }\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const labels = this.getLabels();\n for(i = 0, ilen = labels.length; i < ilen; ++i){\n timestamps.push(parse(this, labels[i]));\n }\n return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);\n }\n normalize(values) {\n return _arrayUnique(values.sort(sorter));\n }\n}\n\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({ lo , hi } = _lookupByKey(table, 'pos', val));\n }\n ({ pos: prevSource , time: prevTarget } = table[lo]);\n ({ pos: nextSource , time: nextTarget } = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({ lo , hi } = _lookupByKey(table, 'time', val));\n }\n ({ time: prevSource , pos: prevTarget } = table[lo]);\n ({ time: nextSource , pos: nextTarget } = table[hi]);\n }\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass TimeSeriesScale extends TimeScale {\n static id = 'timeseries';\n static defaults = TimeScale.defaults;\n constructor(props){\n super(props);\n this._table = [];\n this._minPos = undefined;\n this._tableRange = undefined;\n }\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n buildLookupTable(timestamps) {\n const { min , max } = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n for(i = 0, ilen = timestamps.length; i < ilen; ++i){\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n if (items.length < 2) {\n return [\n {\n time: min,\n pos: 0\n },\n {\n time: max,\n pos: 1\n }\n ];\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({\n time: curr,\n pos: i / (ilen - 1)\n });\n }\n }\n return table;\n }\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) {\n timestamps.splice(0, 0, min);\n }\n if (!timestamps.includes(max) || timestamps.length === 1) {\n timestamps.push(max);\n }\n return timestamps.sort((a, b)=>a - b);\n }\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n if (timestamps.length) {\n return timestamps;\n }\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n return timestamps;\n }\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\n\nvar scales = /*#__PURE__*/Object.freeze({\n__proto__: null,\nCategoryScale: CategoryScale,\nLinearScale: LinearScale,\nLogarithmicScale: LogarithmicScale,\nRadialLinearScale: RadialLinearScale,\nTimeScale: TimeScale,\nTimeSeriesScale: TimeSeriesScale\n});\n\nconst registerables = [\n controllers,\n elements,\n plugins,\n scales\n];\n\nexport { Animation, Animations, ArcElement, BarController, BarElement, BasePlatform, BasicPlatform, BubbleController, CategoryScale, Chart, plugin_colors as Colors, DatasetController, plugin_decimation as Decimation, DomPlatform, DoughnutController, Element, index as Filler, Interaction, plugin_legend as Legend, LineController, LineElement, LinearScale, LogarithmicScale, PieController, PointElement, PolarAreaController, RadarController, RadialLinearScale, Scale, ScatterController, plugin_subtitle as SubTitle, Ticks, TimeScale, TimeSeriesScale, plugin_title as Title, plugin_tooltip as Tooltip, adapters as _adapters, _detectPlatform, animator, controllers, defaults, elements, layouts, plugins, registerables, registry, scales };\n//# sourceMappingURL=chart.js.map\n","import {requestAnimFrame} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('./core.animation.js').default } Animation\n * @typedef { import('./core.controller.js').default } Chart\n */\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is export for typedoc\n */\nexport class Animator {\n constructor() {\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n\n /**\n\t * @private\n\t */\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n\n callbacks.forEach(fn => fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n\n /**\n\t * @private\n\t */\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n\n this._request = requestAnimFrame.call(window, () => {\n this._update();\n this._request = null;\n\n if (this._running) {\n this._refresh();\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _update(date = Date.now()) {\n let remaining = 0;\n\n this._charts.forEach((anims, chart) => {\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n\n for (; i >= 0; --i) {\n item = items[i];\n\n if (item._active) {\n if (item._total > anims.duration) {\n // if the animation has been updated and its duration prolonged,\n // update to total duration of current animations run (for progress event)\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n // Remove the item by replacing it with last item and removing the last\n // A lot faster than splice.\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n\n remaining += items.length;\n });\n\n this._lastDate = date;\n\n if (remaining === 0) {\n this._running = false;\n }\n }\n\n /**\n\t * @private\n\t */\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} event - event name\n\t * @param {Function} cb - callback\n\t */\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n\n /**\n\t * Add animations\n\t * @param {Chart} chart\n\t * @param {Animation[]} items - animations\n\t */\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n\n /**\n\t * Counts number of active animations for the chart\n\t * @param {Chart} chart\n\t */\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n\n /**\n\t * Start animating (all charts)\n\t * @param {Chart} chart\n\t */\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n\n /**\n\t * Stop all animations for the chart\n\t * @param {Chart} chart\n\t */\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n\n for (; i >= 0; --i) {\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n\n /**\n\t * Remove chart from Animator\n\t * @param {Chart} chart\n\t */\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Animator();\n","import effects from '../helpers/helpers.easing.js';\nimport {resolve} from '../helpers/helpers.options.js';\nimport {color as helpersColor} from '../helpers/helpers.color.js';\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean(from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n /**\n * @param {string} from\n * @param {string} to\n * @param {number} factor\n */\n color(from, to, factor) {\n const c0 = helpersColor(from || transparent);\n const c1 = c0.valid && helpersColor(to || transparent);\n return c1 && c1.valid\n ? c1.mix(c0, factor).hexString()\n : to;\n },\n number(from, to, factor) {\n return from + (to - from) * factor;\n }\n};\n\nexport default class Animation {\n constructor(cfg, target, prop, to) {\n const currentValue = target[prop];\n\n to = resolve([cfg.to, to, currentValue, cfg.from]);\n const from = resolve([cfg.from, currentValue, to]);\n\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n\n active() {\n return this._active;\n }\n\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([cfg.to, to, currentValue, cfg.from]);\n this._from = resolve([cfg.from, currentValue, to]);\n }\n }\n\n cancel() {\n if (this._active) {\n // update current evaluated value, for smoother animations\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n\n this._active = from !== to && (loop || (elapsed < duration));\n\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n\n factor = (elapsed / duration) % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n\n this._target[prop] = this._fn(from, to, factor);\n }\n\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej) => {\n promises.push({res, rej});\n });\n }\n\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for (let i = 0; i < promises.length; i++) {\n promises[i][method]();\n }\n }\n}\n","import animator from './core.animator.js';\nimport Animation from './core.animation.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isObject} from '../helpers/helpers.core.js';\n\nexport default class Animations {\n constructor(chart, config) {\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n\n Object.getOwnPropertyNames(config).forEach(key => {\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions) {\n resolved[option] = cfg[option];\n }\n\n (isArray(cfg.properties) && cfg.properties || [key]).forEach((prop) => {\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n\n /**\n\t * Utility to handle animation of `options`.\n\t * @private\n\t */\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n // Going to shared options:\n // After all animations are done, assign the shared options object to the element\n // So any new updates to the shared options are observed\n awaitAll(target.options.$animations, newOptions).then(() => {\n target.options = newOptions;\n }, () => {\n // rejected, noop\n });\n }\n\n return animations;\n }\n\n /**\n\t * @private\n\t */\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n\n for (i = props.length - 1; i >= 0; --i) {\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n\n if (animation) {\n if (cfg && animation.active()) {\n // There is an existing active animation, let's update that\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n // not animated, set directly to new value\n target[prop] = value;\n continue;\n }\n\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n\n\n /**\n\t * Update `target` properties to new values, using configured animations\n\t * @param {object} target - object to update\n\t * @param {object} values - new target properties\n\t * @returns {boolean|undefined} - `true` if animations were started\n\t **/\n update(target, values) {\n if (this._properties.size === 0) {\n // Nothing is animated, just apply the new values.\n Object.assign(target, values);\n return;\n }\n\n const animations = this._createAnimations(target, values);\n\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\n\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for (let i = 0; i < keys.length; i++) {\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n // @ts-ignore\n return Promise.all(running);\n}\n\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n // Going from shared options to distinct one:\n // Create new options object containing the old shared values and start updating that.\n target.options = options = Object.assign({}, options, {$shared: false, $animations: {}});\n }\n return options;\n}\n","import Animations from './core.animations.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isFinite, isObject, valueOrDefault, resolveObjectKey, defined} from '../helpers/helpers.core.js';\nimport {listenArrayEvents, unlistenArrayEvents} from '../helpers/helpers.collection.js';\nimport {createContext, sign} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('./core.scale.js').default } Scale\n */\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\n\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\n\nfunction toClip(value) {\n let t, r, b, l;\n\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\n\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n keys.push(metasets[i].index);\n }\n return keys;\n}\n\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n\n if (value === null) {\n return;\n }\n\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) {\n value += otherValue;\n }\n }\n return value;\n}\n\nfunction convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\n\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || (stacked === undefined && meta.stack !== undefined);\n}\n\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\n\nfunction getUserBounds(scale) {\n const {min, max, minDefined, maxDefined} = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\n\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\n\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {\n const value = stack[meta.index];\n if ((positive && value > 0) || (!positive && value < 0)) {\n return meta.index;\n }\n }\n\n return null;\n}\n\nfunction updateStacks(controller, parsed) {\n const {chart, _cachedMeta: meta} = controller;\n const stacks = chart._stacks || (chart._stacks = {}); // map structure is {stackKey: {datasetIndex: value}}\n const {iScale, vScale, index: datasetIndex} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n\n for (let i = 0; i < ilen; ++i) {\n const item = parsed[i];\n const {[iAxis]: index, [vAxis]: value} = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\n\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter(key => scales[key].axis === axis).shift();\n}\n\nfunction createDatasetContext(parent, index) {\n return createContext(parent,\n {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n }\n );\n}\n\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\n\nfunction clearStacks(meta, items) {\n // Not using meta.index here, because it might be already updated if the dataset changed location\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n\n items = items || meta._parsed;\n for (const parsed of items) {\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n delete stacks[axis]._visualValues[datasetIndex];\n }\n }\n}\n\nconst isDirectUpdateMode = (mode) => mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked\n && {keys: getSortedDatasetIndices(chart, true), values: null};\n\nexport default class DatasetController {\n\n /**\n * @type {any}\n */\n static defaults = {};\n\n /**\n * Element type used to generate a meta dataset (e.g. Chart.element.LineElement).\n */\n static datasetElementType = null;\n\n /**\n * Element type used to generate a meta data (e.g. Chart.element.PointElement).\n */\n static dataElementType = null;\n\n /**\n\t * @param {Chart} chart\n\t * @param {number} datasetIndex\n\t */\n constructor(chart, datasetIndex) {\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n /** @type {boolean | object} */\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n\n this.initialize();\n }\n\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n 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\");\n }\n }\n\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n\n const chooseId = (axis, x, y, r) => axis === 'x' ? x : axis === 'r' ? r : y;\n\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n\n /**\n\t * @param {string} scaleID\n\t * @return {Scale}\n\t */\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n\n /**\n\t * @private\n\t */\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale\n ? meta.vScale\n : meta.iScale;\n }\n\n reset() {\n this._update('reset');\n }\n\n /**\n\t * @private\n\t */\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n\n /**\n\t * @private\n\t */\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n\n // In order to correctly handle data addition/deletion animation (and thus simulate\n // real-time charts), we need to monitor these data modifications and synchronize\n // the internal metadata accordingly.\n\n if (isObject(data)) {\n this._data = convertObjectDataToArray(data);\n } else if (_data !== data) {\n if (_data) {\n // This case happens when the user replaced the data array instance.\n unlistenArrayEvents(_data, this);\n // Discard old parsed data and stacks\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n\n addElements() {\n const meta = this._cachedMeta;\n\n this._dataCheck();\n\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n\n this._dataCheck();\n\n // make sure cached _stacked status is current\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n\n // detect change in stack option\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n // remove values from old stack\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n\n // Re-sync meta data in case the user replaced the data array or if we missed\n // any updates and so make sure that we handle number of datapoints changing.\n this._resyncElements(resetNewElements);\n\n // if stack changed, update stack values for the whole dataset\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n }\n }\n\n /**\n\t * Merges user-supplied and default dataset-level options\n\t * @private\n\t */\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n\n /**\n\t * @param {number} start\n\t * @param {number} count\n\t */\n parse(start, count) {\n const {_cachedMeta: meta, _data: data} = this;\n const {iScale, _stacked} = meta;\n const iAxis = iScale.axis;\n\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n\n const isNotInOrderComparedToPrev = () => cur[iAxis] === null || (prev && cur[iAxis] < prev[iAxis]);\n for (i = 0; i < count; ++i) {\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n\n /**\n\t * Parse array of primitive values\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [1,3,4]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {xScale0: 0, yScale0: 1}\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [[1,2],[3,4]]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {x: 0, y: 1}\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [{x:1, y:5}, {x:2, y:10}]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id. _custom is optional\n\t * Example: {xScale0: 0, yScale0: 1, _custom: {r: 10, foo: 'bar'}}\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n\n /**\n\t * @protected\n\t */\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n\n /**\n\t * @protected\n\t */\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return applyStack(stack, value, meta.index, {mode});\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n\n /**\n\t * @protected\n\t */\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n const {min: otherMin, max: otherMax} = getUserBounds(otherScale);\n let i, parsed;\n\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n\n for (i = 0; i < ilen; ++i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n // if the data is sorted, we don't need to check further from this end of array\n break;\n }\n }\n if (sorted) {\n // in the sorted case, find first non-skipped value from other end of array\n for (i = ilen - 1; i >= 0; --i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n\n for (i = 0, ilen = parsed.length; i < ilen; ++i) {\n value = parsed[i][scale.axis];\n if (isFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return false;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n\n /**\n\t * @private\n\t */\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {} // eslint-disable-line no-unused-vars\n\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || (elements.length - start);\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n\n for (i = start; i < start + count; ++i) {\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n\n for (i = 0; i < active.length; ++i) {\n active[i].draw(ctx, area);\n }\n }\n\n /**\n\t * Returns a set of predefined style properties that should be used to represent the dataset\n\t * or the data if the index is specified\n\t * @param {number} index - data index\n\t * @param {boolean} [active] - true if hover\n\t * @return {object} style object\n\t */\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset\n ? this.resolveDatasetElementOptions(mode)\n : this.resolveDataElementOptions(index || 0, mode);\n }\n\n /**\n\t * @protected\n\t */\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context ||\n (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context ||\n (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n\n /**\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n\n /**\n\t * @private\n\t */\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [`${elementType}Hover`, 'hover', elementType, ''] : [elementType, ''];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n // context is provided as a function, and is called only if needed,\n // so we don't create a context for each element if not needed.\n const context = () => this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n\n if (values.$shared) {\n // `$shared` indicates this set of options can be shared between multiple elements.\n // Sharing is used to reduce number of properties to change during animation.\n values.$shared = sharing;\n\n // We cache options by `mode`, which can be 'active' for example. This enables us\n // to have the 'active' element options and 'default' options to switch between\n // when interacting.\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n\n return values;\n }\n\n\n /**\n\t * @private\n\t */\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n\n /**\n\t * Utility for getting the options object shared between elements\n\t * @protected\n\t */\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n\n /**\n\t * Utility for determining if `options` should be included in the updated properties\n\t * @protected\n\t */\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n\n /**\n * @todo v4, rename to getSharedOptions and remove excess functions\n */\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || (sharedOptions !== previouslySharedOptions);\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {sharedOptions, includeOptions};\n }\n\n /**\n\t * Utility for updating an element with new properties, using animations when appropriate.\n\t * @protected\n\t */\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n\n /**\n\t * Utility to animate the shared options, that are potentially affecting multiple elements.\n\t * @protected\n\t */\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n\n /**\n\t * @private\n\t */\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n // When going from active to inactive, we need to update to the shared options.\n // This way the once hovered element will end up with the same original shared options instance, after animation.\n options: (!active && this.getSharedOptions(options)) || options\n });\n }\n\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n\n /**\n\t * @private\n\t */\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n\n /**\n\t * @private\n\t */\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n\n /**\n\t * @private\n\t */\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n\n // Apply changes detected through array listeners\n for (const [method, arg1, arg2] of this._syncList) {\n this[method](arg1, arg2);\n }\n this._syncList = [];\n\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n\n if (count) {\n // TODO: It is not optimal to always parse the old data\n // This is done because we are not detecting direct assignments:\n // chart.data.datasets[0].data[5] = 10;\n // chart.data.datasets[0].data[5].y = 10;\n this.parse(0, count);\n }\n\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n\n /**\n\t * @private\n\t */\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n\n const move = (arr) => {\n arr.length += count;\n for (i = arr.length - 1; i >= end; i--) {\n arr[i] = arr[i - count];\n }\n };\n move(data);\n\n for (i = start; i < end; ++i) {\n data[i] = new this.dataElementType();\n }\n\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n\n updateElements(element, start, count, mode) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @private\n\t */\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n\n /**\n\t * @private\n */\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([this.index, ...args]);\n }\n\n _onDataPush() {\n const count = arguments.length;\n this._sync(['_insertElements', this.getDataset().data.length - count, count]);\n }\n\n _onDataPop() {\n this._sync(['_removeElements', this._cachedMeta.data.length - 1, 1]);\n }\n\n _onDataShift() {\n this._sync(['_removeElements', 0, 1]);\n }\n\n _onDataSplice(start, count) {\n if (count) {\n this._sync(['_removeElements', start, count]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync(['_insertElements', start, newCount]);\n }\n }\n\n _onDataUnshift() {\n this._sync(['_insertElements', 0, arguments.length]);\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {\n _arrayUnique, isArray, isNullOrUndef,\n valueOrDefault, resolveObjectKey, sign, defined\n} from '../helpers/index.js';\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n\n for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));\n }\n return scale._cache.$bar;\n}\n\n/**\n * Computes the \"optimal\" sample size to maintain bars equally sized while preventing overlap.\n * @private\n */\nfunction computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = () => {\n if (curr === 32767 || curr === -32768) {\n // Ignore truncated pixels\n return;\n }\n if (defined(prev)) {\n // curr - prev === 0 is ignored\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n\n for (i = 0, ilen = values.length; i < ilen; ++i) {\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n\n prev = undefined;\n for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) {\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n\n return min;\n}\n\n/**\n * Computes an \"ideal\" category based on the absolute bar thickness or, if undefined or null,\n * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This\n * mode currently always generates bars equally sized (until we introduce scriptable options?).\n * @private\n */\nfunction computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n // When bar thickness is enforced, category and bar percentages are ignored.\n // Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n // and deprecate barPercentage since this value is ignored when thickness is absolute.\n size = thickness * stackCount;\n ratio = 1;\n }\n\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - (size / 2)\n };\n}\n\n/**\n * Computes an \"optimal\" category that globally arranges bars side by side (no gap when\n * percentage options are 1), based on the previous and following categories. This mode\n * generates bars with different widths when data are not evenly spaced.\n * @private\n */\nfunction computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n\n if (prev === null) {\n // first data: its size is double based on the next point or,\n // if it's also the last data, we use the scale size.\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n\n if (next === null) {\n // last data: its size is also double based on the previous point.\n next = curr + curr - prev;\n }\n\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\n\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n\n // Store `barEnd` (furthest away from origin) as parsed value,\n // to make stacking straight forward\n item[vScale.axis] = barEnd;\n\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\n\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\n\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n\n for (i = start, ilen = start + count; i < ilen; ++i) {\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\n\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\n\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\n\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {start, end, reverse, top, bottom};\n}\n\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n\n if (edge === true) {\n properties.borderSkipped = {top: true, right: true, bottom: true, left: true};\n return;\n }\n\n const {start, end, reverse, top, bottom} = borderProps(properties);\n\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\n\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\n\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\n\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\n\nfunction setInflateAmount(properties, {inflateAmount}, ratio) {\n properties.inflateAmount = inflateAmount === 'auto'\n ? ratio === 1 ? 0.33 : 0\n : inflateAmount;\n}\n\nexport default class BarController extends DatasetController {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'base', 'width', 'height']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true,\n }\n }\n };\n\n\n /**\n\t * Overriding primitive data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding array data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding object data parsing since we support mixed primitive/array\n\t * value-scale data for float bars\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n // float bar: only one end of the bar is considered by `super`\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const {iScale, vScale} = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom)\n ? '[' + custom.start + ', ' + custom.end + ']'\n : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n\n initialize() {\n this.enableOptionSharing = true;\n\n super.initialize();\n\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const {index, _cachedMeta: {vScale}} = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n\n for (let i = start; i < start + count; i++) {\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {base, head: base} : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index === stack._top || index === stack._bottom),\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n\n /**\n\t * Returns the stacks based on groups and bar visibility.\n\t * @param {number} [last] - The dataset index\n\t * @param {number} [dataIndex] - The data index of the ruler\n\t * @returns {string[]} The list of stack IDs\n\t * @private\n\t */\n _getStacks(last, dataIndex) {\n const {iScale} = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type)\n .filter(meta => meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n\n const skipNull = (meta) => {\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n\n for (const meta of metasets) {\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n\n // stacked | meta.stack\n // | found | not found | undefined\n // false | x | x | x\n // true | | x |\n // undefined | | x | x\n if (stacked === false || stacks.indexOf(meta.stack) === -1 ||\n\t\t\t\t(stacked === undefined && meta.stack === undefined)) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n\n // No stacks? that means there is no visible data. Let's still initialize an `undefined`\n // stack where possible invisible bars will be located.\n // https://github.com/chartjs/Chart.js/issues/6368\n if (!stacks.length) {\n stacks.push(undefined);\n }\n\n return stacks;\n }\n\n /**\n\t * Returns the effective number of stacks based on groups and bar visibility.\n\t * @private\n\t */\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n\n /**\n\t * Returns the stack index for the given dataset based on groups and bar visibility.\n\t * @param {number} [datasetIndex] - The dataset index\n\t * @param {string} [name] - The stack name to find\n * @param {number} [dataIndex]\n\t * @returns {number} The stack index\n\t * @private\n\t */\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = (name !== undefined)\n ? stacks.indexOf(name)\n : -1; // indexOf returns -1 if element is not present\n\n return (index === -1)\n ? stacks.length - 1\n : index;\n }\n\n /**\n\t * @private\n\t */\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n\n for (i = 0, ilen = meta.data.length; i < ilen; ++i) {\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n // bar thickness ratio used for non-grouped bars\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n\n /**\n\t * Note: pixel values are not clamped to the scale area.\n\t * @private\n\t */\n _calculateBarValuePixels(index) {\n const {_cachedMeta: {vScale, _stacked, index: datasetIndex}, options: {base: baseValue, minBarLength}} = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n\n if (length !== value) {\n start = length - value;\n length = value;\n }\n\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n // bars crossing origin are not stacked\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n // When not visible, no height\n head = base;\n }\n\n size = head - base;\n\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n\n if (_stacked && !floating) {\n // visual data coordinates after applying minBarLength\n parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n }\n\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n\n /**\n\t * @private\n\t */\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex'\n ? computeFlexCategoryTraits(index, ruler, options, stackCount)\n : computeFitCategoryTraits(index, ruler, options, stackCount);\n\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n // For non-grouped bar charts, exact pixel values are used\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n\n for (; i < ilen; ++i) {\n if (this.getParsed(i)[vScale.axis] !== null) {\n rects[i].draw(this._ctx);\n }\n }\n }\n\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {valueOrDefault} from '../helpers/helpers.core.js';\n\nexport default class BubbleController extends DatasetController {\n\n static id = 'bubble';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'borderWidth', 'radius']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n\n /**\n\t * Parse array of primitive values\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n\n update(mode) {\n const points = this._cachedMeta.data;\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n\n if (reset) {\n properties.options.radius = 0;\n }\n }\n\n this.updateElement(point, i, properties, mode);\n }\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n\n // In case values were cached (and thus frozen), we need to clone the values\n if (values.$shared) {\n values = Object.assign({}, values, {$shared: false});\n }\n\n // Custom radius resolution\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n\n return values;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isObject, resolveObjectKey, toPercentage, toDimension, valueOrDefault} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {toRadians, PI, TAU, HALF_PI, _angleBetween} from '../helpers/helpers.math.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n // If the chart's circumference isn't a full circle, calculate size as a ratio of the width/height of the arc\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {ratioX, ratioY, offsetX, offsetY};\n}\n\nexport default class DoughnutController extends DatasetController {\n\n static id = 'doughnut';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n // Boolean - Whether we animate the rotation of the Doughnut\n animateRotate: true,\n // Boolean - Whether we animate scaling the Doughnut from the centre\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['circumference', 'endAngle', 'innerRadius', 'outerRadius', 'startAngle', 'x', 'y', 'offset', 'borderWidth', 'spacing']\n },\n },\n // The percentage of the chart that we cut out of the middle.\n cutout: '50%',\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%',\n\n // Spacing between arcs\n spacing: 0,\n\n indexAxis: 'r',\n };\n\n static descriptors = {\n _scriptable: (name) => name !== 'spacing',\n _indexable: (name) => name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash'),\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n // Need to override these to give a nice default\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n\n linkScales() {}\n\n /**\n\t * Override data parsing, since we are not using scales\n\t */\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i) => +data[i];\n\n if (isObject(data[start])) {\n const {key = 'value'} = this._parsing;\n getter = (i) => +resolveObjectKey(data[i], key);\n }\n\n let i, ilen;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n meta._parsed[i] = getter(i);\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n\n /**\n\t * @private\n\t */\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n\n /**\n\t * Get the maximal rotation & circumference extents\n\t * across all visible datasets.\n\t */\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n\n for (let i = 0; i < this.chart.data.datasets.length; ++i) {\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n\n return {\n rotation: min,\n circumference: max - min,\n };\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {\n const chart = this.chart;\n const {chartArea} = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n\n // Compute the maximal rotation & circumference limits.\n // If we only consider our dataset, this can cause problems when two datasets\n // are both less than a circle with different rotations (starting angles)\n const {circumference, rotation} = this._getRotationExtents();\n const {ratioX, ratioY, offsetX, offsetY} = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n\n meta.total = this.calculateTotal();\n\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @private\n */\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if ((reset && opts.animation.animateRotate) || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n\n for (i = 0; i < start; ++i) {\n startAngle += this._circumference(i, reset);\n }\n\n for (i = start; i < start + count; ++i) {\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n\n for (i = 0; i < metaData.length; i++) {\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n\n return total;\n }\n\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n\n if (!arcs) {\n // Find the outmost visible dataset\n for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n\n if (!arcs) {\n return 0;\n }\n\n for (i = 0, ilen = arcs.length; i < ilen; ++i) {\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n\n getMaxOffset(arcs) {\n let max = 0;\n\n for (let i = 0, ilen = arcs.length; i < ilen; ++i) {\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n\n /**\n\t * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly\n\t * @private\n\t */\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n\n for (let i = 0; i < datasetIndex; ++i) {\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n\n return ringWeightOffset;\n }\n\n /**\n\t * @private\n\t */\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n\n /**\n\t * Returns the sum of all visible data set weights.\n\t * @private\n\t */\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class LineController extends DatasetController {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n\n showLine: true,\n spanGaps: false,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n },\n _value_: {\n type: 'linear',\n },\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {dataset: line, data: points = [], _dataset} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = 0; i < pointsCount; ++i) {\n const point = points[i];\n const properties = directUpdate ? point : {};\n\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {toRadians, PI, formatNumber, _parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class PolarAreaController extends DatasetController {\n\n static id = 'polarArea';\n\n /**\n * @type {any}\n */\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'startAngle', 'endAngle', 'innerRadius', 'outerRadius']\n },\n },\n indexAxis: 'r',\n startAngle: 0,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const arcs = this._cachedMeta.data;\n\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @protected\n */\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n\n meta.data.forEach((element, index) => {\n const parsed = this.getParsed(index).r;\n\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n\n return range;\n }\n\n /**\n\t * @private\n\t */\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? (outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n\n this.outerRadius = outerRadius - (radiusLength * this.index);\n this.innerRadius = this.outerRadius - radiusLength;\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n\n const defaultAngle = 360 / this.countVisibleElements();\n\n for (i = 0; i < start; ++i) {\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for (i = start; i < start + count; i++) {\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n\n meta.data.forEach((element, index) => {\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n\n return count;\n }\n\n /**\n\t * @private\n\t */\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index)\n ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle)\n : 0;\n }\n}\n","import DoughnutController from './controller.doughnut.js';\n\n// Pie charts are Doughnut chart with different defaults\nexport default class PieController extends DoughnutController {\n\n static id = 'pie';\n\n /**\n * @type {any}\n */\n static defaults = {\n // The percentage of the chart that we cut out of the middle.\n cutout: 0,\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%'\n };\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {_parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class RadarController extends DatasetController {\n\n static id = 'radar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n },\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n scales: {\n r: {\n type: 'radialLinear',\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n\n // Update Line\n line.points = points;\n // In resize mode only point locations change, so no need to set the points or options.\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n\n this.updateElement(line, undefined, properties, mode);\n }\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class ScatterController extends DatasetController {\n\n static id = 'scatter';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n\n interaction: {\n mode: 'point'\n },\n\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {data: points = []} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n if (this.options.showLine) {\n\n // https://github.com/chartjs/Chart.js/issues/11333\n if (!this.datasetElementType) {\n this.addElements();\n }\n const {dataset: line, _dataset} = meta;\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n } else if (this.datasetElementType) {\n // https://github.com/chartjs/Chart.js/issues/11333\n delete meta.dataset;\n this.datasetElementType = false;\n }\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n addElements() {\n const {showLine} = this.options;\n\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n\n super.addElements();\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = start; i < start + count; ++i) {\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n\n if (!this.options.showLine) {\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n\n if (!data.length) {\n return border;\n }\n\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n","/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartOptions} from '../types/index.js';\n\nexport type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';\n\nexport interface DateAdapter {\n readonly options: T;\n /**\n * Will called with chart options after adapter creation.\n */\n init(this: DateAdapter, chartOptions: ChartOptions): void;\n /**\n * Returns a map of time formats for the supported formatting units defined\n * in Unit as well as 'datetime' representing a detailed date/time string.\n */\n formats(this: DateAdapter): Record;\n /**\n * Parses the given `value` and return the associated timestamp.\n * @param value - the value to parse (usually comes from the data)\n * @param [format] - the expected data format\n */\n parse(this: DateAdapter, value: unknown, format?: TimeUnit): number | null;\n /**\n * Returns the formatted date in the specified `format` for a given `timestamp`.\n * @param timestamp - the timestamp to format\n * @param format - the date/time token\n */\n format(this: DateAdapter, timestamp: number, format: TimeUnit): string;\n /**\n * Adds the specified `amount` of `unit` to the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param amount - the amount to add\n * @param unit - the unit as string\n */\n add(this: DateAdapter, timestamp: number, amount: number, unit: TimeUnit): number;\n /**\n * Returns the number of `unit` between the given timestamps.\n * @param a - the input timestamp (reference)\n * @param b - the timestamp to subtract\n * @param unit - the unit as string\n */\n diff(this: DateAdapter, a: number, b: number, unit: TimeUnit): number;\n /**\n * Returns start of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n * @param [weekday] - the ISO day of the week with 1 being Monday\n * and 7 being Sunday (only needed if param *unit* is `isoWeek`).\n */\n startOf(this: DateAdapter, timestamp: number, unit: TimeUnit | 'isoWeek', weekday?: number): number;\n /**\n * Returns end of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n */\n endOf(this: DateAdapter, timestamp: number, unit: TimeUnit | 'isoWeek'): number;\n}\n\nfunction abstract(): T {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */\nclass DateAdapterBase implements DateAdapter {\n\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */\n static override(\n members: Partial, 'options'>>\n ) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n\n readonly options: AnyObject;\n\n constructor(options: AnyObject) {\n this.options = options || {};\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n\n formats(): Record {\n return abstract();\n }\n\n parse(): number | null {\n return abstract();\n }\n\n format(): string {\n return abstract();\n }\n\n add(): number {\n return abstract();\n }\n\n diff(): number {\n return abstract();\n }\n\n startOf(): number {\n return abstract();\n }\n\n endOf(): number {\n return abstract();\n }\n}\n\nexport default {\n _date: DateAdapterBase\n};\n","import {_lookupByKey, _rlookupByKey} from '../helpers/helpers.collection.js';\nimport {getRelativePosition} from '../helpers/helpers.dom.js';\nimport {_angleBetween, getAngleFromPoint} from '../helpers/helpers.math.js';\nimport {_isPointInArea} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef {{axis?: string, intersect?: boolean, includeInvisible?: boolean}} InteractionOptions\n * @typedef {{datasetIndex: number, index: number, element: import('./core.element.js').default}} InteractionItem\n * @typedef { import('../types/index.js').Point } Point\n */\n\n/**\n * Helper function to do binary search when possible\n * @param {object} metaset - the dataset meta\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {number} value - the value to find\n * @param {boolean} [intersect] - should the element intersect\n * @returns {{lo:number, hi:number}} indices to search data array between\n */\nfunction binarySearch(metaset, axis, value, intersect) {\n const {controller, data, _sorted} = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n // _sharedOptions indicates that each element has equal options -> equal proportions\n // So we can do a ranged binary search based on the range of first element and\n // be confident to get the full range of indices that can intersect with the value.\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {lo: start.lo, hi: end.hi};\n }\n }\n }\n // Default to all elements, when binary search can not be used.\n return {lo: 0, hi: data.length - 1};\n}\n\n/**\n * Helper function to select candidate elements for interaction\n * @param {Chart} chart - the chart\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {function} handler - the callback to execute for each visible item\n * @param {boolean} [intersect] - consider intersecting items\n */\nfunction evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for (let i = 0, ilen = metasets.length; i < ilen; ++i) {\n const {index, data} = metasets[i];\n const {lo, hi} = binarySearch(metasets[i], axis, value, intersect);\n for (let j = lo; j <= hi; ++j) {\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n\n/**\n * Get a distance metric function for two points based on the\n * axis mode setting\n * @param {string} axis - the axis mode. x|y|xy|r\n */\nfunction getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n\n/**\n * Helper function to get the items that intersect the event position\n * @param {Chart} chart - the chart\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({element, datasetIndex, index});\n }\n };\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a radial chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n\n function evaluationFunc(element, datasetIndex, index) {\n const {startAngle, endAngle} = element.getProps(['startAngle', 'endAngle'], useFinalPosition);\n const {angle} = getAngleFromPoint(element, {x: position.x, y: position.y});\n\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a cartesian chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [{element, datasetIndex, index}];\n minDistance = distance;\n } else if (distance === minDistance) {\n // Can have multiple items at the same distance in which case we sort by size\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position considering all visible items in the chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n\n return axis === 'r' && !intersect\n ? getNearestRadialItems(chart, position, axis, useFinalPosition)\n : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n\n/**\n * Helper function to get the items matching along the given X or Y axis\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis to match\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index) => {\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({element, datasetIndex, index});\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n\n // If we want to trigger on an intersect and we don't have any items\n // that intersect the position, return nothing\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n\n/**\n * Contains interaction related functions\n * @namespace Chart.Interaction\n */\nexport default {\n // Part of the public API to facilitate developers creating their own modes\n evaluateInteractionItems,\n\n // Helper function for different modes\n modes: {\n /**\n\t\t * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\n\t\t * @function Chart.Interaction.modes.index\n\t\t * @since v2.4.0\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n index(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n // Default axis for index mode is 'x' to match old behaviour\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible)\n : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n\n if (!items.length) {\n return [];\n }\n\n chart.getSortedVisibleDatasetMetas().forEach((meta) => {\n const index = items[0].index;\n const element = meta.data[index];\n\n // don't count items that are skipped (null data)\n if (element && !element.skip) {\n elements.push({element, datasetIndex: meta.index, index});\n }\n });\n\n return elements;\n },\n\n /**\n\t\t * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect is false, we find the nearest item and return the items in that dataset\n\t\t * @function Chart.Interaction.modes.dataset\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n dataset(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) :\n getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for (let i = 0; i < data.length; ++i) {\n items.push({element: data[i], datasetIndex, index: i});\n }\n }\n\n return items;\n },\n\n /**\n\t\t * Point mode returns all elements that hit test based on the event position\n\t\t * of the event\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n point(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * nearest mode returns the element closest to the point\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n nearest(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * x mode returns the elements that hit-test at the current x coordinate\n\t\t * @function Chart.Interaction.modes.x\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n x(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n\n /**\n\t\t * y mode returns the elements that hit-test at the current y coordinate\n\t\t * @function Chart.Interaction.modes.y\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n y(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n","import {defined, each, isObject} from '../helpers/helpers.core.js';\nimport {toPadding} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n */\n\nconst STATIC_POSITIONS = ['left', 'top', 'right', 'bottom'];\n\nfunction filterByPosition(array, position) {\n return array.filter(v => v.pos === position);\n}\n\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter(v => STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\n\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b) => {\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ?\n v0.index - v1.index :\n v0.weight - v1.weight;\n });\n}\n\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n\n for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\n box = boxes[i];\n ({position: pos, options: {stack, stackWeight = 1}} = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && (pos + stack),\n stackWeight\n });\n }\n return layoutBoxes;\n}\n\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts) {\n const {stack, pos, stackWeight} = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {count: 0, placed: 0, weight: 0, size: 0});\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n\n/**\n * store dimensions used instead of available chartArea in fitBoxes\n **/\nfunction setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const {vBoxMaxWidth, hBoxMaxHeight} = params;\n let i, ilen, layout;\n for (i = 0, ilen = layouts.length; i < ilen; ++i) {\n layout = layouts[i];\n const {fullSize} = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\n\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter(wrap => wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\n\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\n\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\n\nfunction updateDims(chartArea, params, layout, stacks) {\n const {pos, box} = layout;\n const maxPadding = chartArea.maxPadding;\n\n // dynamically placed boxes size is not considered\n if (!isObject(pos)) {\n if (layout.size) {\n // this layout was already counted for, lets first reduce old size\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {size: 0, count: 1};\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n\n // return booleans on the changes per direction\n return layout.horizontal\n ? {same: widthChanged, other: heightChanged}\n : {same: heightChanged, other: widthChanged};\n}\n\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\n\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function marginForPositions(positions) {\n const margin = {left: 0, top: 0, right: 0, bottom: 0};\n positions.forEach((pos) => {\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n\n return horizontal\n ? marginForPositions(['left', 'right'])\n : marginForPositions(['top', 'bottom']);\n}\n\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n\n for (i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i) {\n layout = boxes[i];\n box = layout.box;\n\n box.update(\n layout.width || chartArea.w,\n layout.height || chartArea.h,\n getMargins(layout.horizontal, chartArea)\n );\n const {same, other} = updateDims(chartArea, params, layout, stacks);\n\n // Dimensions changed and there were non full width boxes before this\n // -> we have to refit those\n refit |= same && refitBoxes.length;\n\n // Chart area changed in the opposite direction\n changed = changed || other;\n\n if (!box.fullSize) { // fullSize boxes don't need to be re-fitted in any case\n refitBoxes.push(layout);\n }\n }\n\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\n\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\n\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let {x, y} = chartArea;\n\n for (const layout of boxes) {\n const box = layout.box;\n const stack = stacks[layout.stack] || {count: 1, placed: 0, weight: 1};\n const weight = (layout.stackWeight / stack.weight) || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n\n chartArea.x = x;\n chartArea.y = y;\n}\n\n/**\n * @interface LayoutItem\n * @typedef {object} LayoutItem\n * @prop {string} position - The position of the item in the chart layout. Possible values are\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\n * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area\n * @prop {boolean} fullSize - if true, and the item is horizontal, then push vertical boxes down\n * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\n * @prop {function} update - Takes two parameters: width and height. Returns size of item\n * @prop {function} draw - Draws the element\n * @prop {function} [getPadding] - Returns an object with padding on the edges\n * @prop {number} width - Width of item. Must be valid after update()\n * @prop {number} height - Height of item. Must be valid after update()\n * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update\n * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update\n * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update\n * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\n */\n\n// The layout service is very self explanatory. It's responsible for the layout within a chart.\n// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\n// It is this service's responsibility of carrying out that layout.\nexport default {\n\n /**\n\t * Register a box to a chart.\n\t * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\n\t * @param {Chart} chart - the chart to use\n\t * @param {LayoutItem} item - the item to add to be laid out\n\t */\n addBox(chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n\n // initialize item with default values\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n // @ts-ignore\n item._layers = item._layers || function() {\n return [{\n z: 0,\n draw(chartArea) {\n item.draw(chartArea);\n }\n }];\n };\n\n chart.boxes.push(item);\n },\n\n /**\n\t * Remove a layoutItem from a chart\n\t * @param {Chart} chart - the chart to remove the box from\n\t * @param {LayoutItem} layoutItem - the item to remove from the layout\n\t */\n removeBox(chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n\n /**\n\t * Sets (or updates) options on the given `item`.\n\t * @param {Chart} chart - the chart in which the item lives (or will be added to)\n\t * @param {LayoutItem} item - the item to configure with the given options\n\t * @param {object} options - the new item options.\n\t */\n configure(chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n\n /**\n\t * Fits boxes of the given chart into the given size by having each box measure itself\n\t * then running a fitting algorithm\n\t * @param {Chart} chart - the chart\n\t * @param {number} width - the width to fit into\n\t * @param {number} height - the height to fit into\n * @param {number} minPadding - minimum padding required for each side of chart area\n\t */\n update(chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n\n // Before any changes are made, notify boxes that an update is about to being\n // This is used to clear any cached data (e.g. scale limits)\n each(chart.boxes, box => {\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n\n // Essentially we now have any number of boxes on each of the 4 sides.\n // Our canvas looks like the following.\n // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\n // B1 is the bottom axis\n // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\n // These locations are single-box locations only, when trying to register a chartArea location that is already taken,\n // an error will be thrown.\n //\n // |----------------------------------------------------|\n // | T1 (Full Width) |\n // |----------------------------------------------------|\n // | | | T2 | |\n // | |----|-------------------------------------|----|\n // | | | C1 | | C2 | |\n // | | |----| |----| |\n // | | | | |\n // | L1 | L2 | ChartArea (C0) | R1 |\n // | | | | |\n // | | |----| |----| |\n // | | | C3 | | C4 | |\n // | |----|-------------------------------------|----|\n // | | | B1 | |\n // |----------------------------------------------------|\n // | B2 (Full Width) |\n // |----------------------------------------------------|\n //\n\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>\n wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n\n // First fit the fullSize boxes, to reduce probability of re-fitting.\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n\n // Then fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n\n // Then fit horizontal boxes\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n // if the area changed, re-fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n\n handleMaxPadding(chartArea);\n\n // Finally place the boxes to correct coordinates\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n\n // Move to opposite side of chart\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w,\n };\n\n // Finally update boxes in chartArea (radial scale for example)\n each(boxes.chartArea, (layout) => {\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {left: 0, top: 0, right: 0, bottom: 0});\n });\n }\n};\n","\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\n/**\n * Abstract class that allows abstracting platform dependencies away from the chart.\n */\nexport default class BasePlatform {\n /**\n\t * Called at chart construction time, returns a context2d instance implementing\n\t * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.\n\t * @param {HTMLCanvasElement} canvas - The canvas from which to acquire context (platform specific)\n\t * @param {number} [aspectRatio] - The chart options\n\t */\n acquireContext(canvas, aspectRatio) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Called at chart destruction time, releases any resources associated to the context\n\t * previously returned by the acquireContext() method.\n\t * @param {CanvasRenderingContext2D} context - The context2d instance\n\t * @returns {boolean} true if the method succeeded, else false\n\t */\n releaseContext(context) { // eslint-disable-line no-unused-vars\n return false;\n }\n\n /**\n\t * Registers the specified listener on the given chart.\n\t * @param {Chart} chart - Chart from which to listen for event\n\t * @param {string} type - The ({@link ChartEvent}) type to listen for\n\t * @param {function} listener - Receives a notification (an object that implements\n\t * the {@link ChartEvent} interface) when an event of the specified type occurs.\n\t */\n addEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Removes the specified listener previously registered with addEventListener.\n\t * @param {Chart} chart - Chart from which to remove the listener\n\t * @param {string} type - The ({@link ChartEvent}) type to remove\n\t * @param {function} listener - The listener function to remove from the event target.\n\t */\n removeEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @returns {number} the current devicePixelRatio of the device this platform is connected to.\n\t */\n getDevicePixelRatio() {\n return 1;\n }\n\n /**\n\t * Returns the maximum size in pixels of given canvas element.\n\t * @param {HTMLCanvasElement} element\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @returns {boolean} true if the canvas is attached to the platform, false if not.\n\t */\n isAttached(canvas) { // eslint-disable-line no-unused-vars\n return true;\n }\n\n /**\n * Updates config with platform specific requirements\n * @param {import('../core/core.config.js').default} config\n */\n updateConfig(config) { // eslint-disable-line no-unused-vars\n // no-op\n }\n}\n","/**\n * Platform fallback implementation (minimal).\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\n */\n\nimport BasePlatform from './platform.base.js';\n\n/**\n * Platform class for charts without access to the DOM or to many element properties\n * This platform is used by default for any chart passed an OffscreenCanvas.\n * @extends BasePlatform\n */\nexport default class BasicPlatform extends BasePlatform {\n acquireContext(item) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n","/**\n * Chart.Platform implementation for targeting a web browser\n */\n\nimport BasePlatform from './platform.base.js';\nimport {_getParentNode, getRelativePosition, supportsEventListenerOptions, readUsedSize, getMaximumSize} from '../helpers/helpers.dom.js';\nimport {throttled} from '../helpers/helpers.extras.js';\nimport {isNullOrUndef} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nconst EXPANDO_KEY = '$chartjs';\n\n/**\n * DOM event types -> Chart.js event types.\n * Note: only events with different types are mapped.\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\n */\nconst EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\n\nconst isNullOrEmpty = value => value === null || value === '';\n/**\n * Initializes the canvas style and render size without modifying the canvas display size,\n * since responsiveness is handled by the controller.resize() method. The config is used\n * to determine the aspect ratio to apply in case no explicit height has been specified.\n * @param {HTMLCanvasElement} canvas\n * @param {number} [aspectRatio]\n */\nfunction initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n\n // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\n // returns null or '' if no explicit value has been set to the canvas attribute.\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n\n // Chart.js modifies some canvas values that we want to restore on destroy\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n\n // Force canvas to display as block to avoid extra space caused by inline\n // elements, which would interfere with the responsive resize process.\n // https://github.com/chartjs/Chart.js/issues/2538\n style.display = style.display || 'block';\n // Include possible borders in the size\n style.boxSizing = style.boxSizing || 'border-box';\n\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n // If no explicit render height and style height, let's apply the aspect ratio,\n // which one can be specified by the user but also by charts as default option\n // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n\n return canvas;\n}\n\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\n// https://github.com/chartjs/Chart.js/issues/4287\nconst eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\n\nfunction addListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n}\n\nfunction removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\n\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const {x, y} = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null,\n };\n}\n\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList) {\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\n\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\n\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart) => {\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\n\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\n\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\n\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height) => {\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n // If the container size shrank during chart resize, let's assume\n // scrollbar appeared. So we resize again with the scrollbar visible -\n // effectively making chart smaller and the scrollbar hidden again.\n // Because we are inside `throttled`, and currently `ticking`, scroll\n // events are ignored during this whole 2 resize process.\n // If we assumed wrong and something else happened, we are resizing\n // twice in a frame (potential performance issue)\n listener();\n }\n }, window);\n\n // @ts-ignore until https://github.com/microsoft/TypeScript/issues/37861 implemented\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n // When its container's display is set to 'none' the callback will be called with a\n // size of (0, 0), which will cause the chart to lose its original height, so skip\n // resizing in such case.\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n\n return observer;\n}\n\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\n\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event) => {\n // This case can occur if the chart is destroyed while waiting\n // for the throttled function to occur. We prevent crashes by checking\n // for a destroyed chart\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n\n addListener(canvas, type, proxy);\n\n return proxy;\n}\n\n/**\n * Platform class for charts that can access the DOM and global window/document properties\n * @extends BasePlatform\n */\nexport default class DomPlatform extends BasePlatform {\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [aspectRatio]\n\t * @return {CanvasRenderingContext2D|null}\n\t */\n acquireContext(canvas, aspectRatio) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n\n // `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the canvas is\n // inside an iframe or when running in a protected environment. We could guess the\n // types from their toString() value but let's keep things flexible and assume it's\n // a sufficient condition if the canvas has a context2D which has canvas as `canvas`.\n // https://github.com/chartjs/Chart.js/issues/3887\n // https://github.com/chartjs/Chart.js/issues/4102\n // https://github.com/chartjs/Chart.js/issues/4152\n if (context && context.canvas === canvas) {\n // Load platform resources on first chart creation, to make it possible to\n // import the library before setting platform options.\n initCanvas(canvas, aspectRatio);\n return context;\n }\n\n return null;\n }\n\n /**\n\t * @param {CanvasRenderingContext2D} context\n\t */\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n\n const initial = canvas[EXPANDO_KEY].initial;\n ['height', 'width'].forEach((prop) => {\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n\n const style = initial.style || {};\n Object.keys(style).forEach((key) => {\n canvas.style[key] = style[key];\n });\n\n // The canvas render size might have been changed (and thus the state stack discarded),\n // we can't use save() and restore() to restore the initial state. So make sure that at\n // least the canvas context is reset to the default state by setting the canvas width.\n // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html\n // eslint-disable-next-line no-self-assign\n canvas.width = canvas.width;\n\n delete canvas[EXPANDO_KEY];\n return true;\n }\n\n /**\n\t *\n\t * @param {Chart} chart\n\t * @param {string} type\n\t * @param {function} listener\n\t */\n addEventListener(chart, type, listener) {\n // Can have only one listener per type, so make sure previous is removed\n this.removeEventListener(chart, type);\n\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} type\n\t */\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n\n if (!proxy) {\n return;\n }\n\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t */\n isAttached(canvas) {\n const container = _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n","import {_isDomSupported} from '../helpers/index.js';\nimport BasePlatform from './platform.base.js';\nimport BasicPlatform from './platform.basic.js';\nimport DomPlatform from './platform.dom.js';\n\nexport function _detectPlatform(canvas) {\n if (!_isDomSupported() || (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas)) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nexport {BasePlatform, BasicPlatform, DomPlatform};\n","import type {AnyObject} from '../types/basic.js';\nimport type {Point} from '../types/geometric.js';\nimport type {Animation} from '../types/animation.js';\nimport {isNumber} from '../helpers/helpers.math.js';\n\nexport default class Element {\n\n static defaults = {};\n static defaultRoutes = undefined;\n\n x: number;\n y: number;\n active = false;\n options: O;\n $animations: Record;\n\n tooltipPosition(useFinalPosition: boolean): Point {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y} as Point;\n }\n\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n\n /**\n * Gets the current or final value of each prop. Can return extra properties (whole object).\n * @param props - properties to get\n * @param [final] - get the final value (animation target)\n */\n getProps

(props: P, final?: boolean): Pick;\n getProps

(props: P[], final?: boolean): Partial>;\n getProps(props: string[], final?: boolean): Partial> {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this as Record;\n }\n const ret: Record = {};\n props.forEach((prop) => {\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop as string];\n });\n return ret;\n }\n}\n","import {isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\nimport {_factorize} from '../helpers/helpers.math.js';\n\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a subset of ticks to be plotted to avoid overlapping labels.\n * @param {import('./core.scale.js').default} scale\n * @param {Tick[]} ticks\n * @return {Tick[]}\n * @private\n */\nexport function autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n\n // If there are too many major ticks to display them all\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\n\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n\n/**\n * @param {number[]} majorIndices\n * @param {Tick[]} ticks\n * @param {number} ticksLimit\n */\nfunction calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n\n // If the major ticks are evenly spaced apart, place the minor ticks\n // so that they divide the major ticks into even chunks\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n\n const factors = _factorize(evenMajorSpacing);\n for (let i = 0, ilen = factors.length - 1; i < ilen; i++) {\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n\n/**\n * @param {Tick[]} ticks\n */\nfunction getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number[]} majorIndices\n * @param {number} spacing\n */\nfunction skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n\n spacing = Math.ceil(spacing);\n for (i = 0; i < ticks.length; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number} spacing\n * @param {number} [majorStart]\n * @param {number} [majorEnd]\n */\nfunction skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n\n next = start;\n\n while (next < 0) {\n count++;\n next = Math.round(start + count * spacing);\n }\n\n for (i = Math.max(start, 0); i < end; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n\n\n/**\n * @param {number[]} arr\n */\nfunction getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n\n if (len < 2) {\n return false;\n }\n\n for (diff = arr[0], i = 1; i < len; ++i) {\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n","import Element from './core.element.js';\nimport {_alignPixel, _measureText, renderText, clipArea, unclipArea} from '../helpers/helpers.canvas.js';\nimport {callback as call, each, finiteOrDefault, isArray, isFinite, isNullOrUndef, isObject, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toDegrees, toRadians, _int16Range, _limitValue, HALF_PI} from '../helpers/helpers.math.js';\nimport {_alignStartEnd, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {createContext, toFont, toPadding, _addGrace} from '../helpers/helpers.options.js';\nimport {autoSkip} from './core.scale.autoskip.js';\n\nconst reverseAlign = (align) => align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset) => edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit) => Math.min(maxTicksLimit || ticksLength, ticksLength);\n\n/**\n * @typedef { import('../types/index.js').Chart } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a new array containing numItems from arr\n * @param {any[]} arr\n * @param {number} numItems\n */\nfunction sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n\n for (; i < len; i += increment) {\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @param {boolean} offsetGridLines\n */\nfunction getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n\n // Return undefined if the pixel is out of the range\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n\n/**\n * @param {object} caches\n * @param {number} length\n */\nfunction garbageCollect(caches, length) {\n each(caches, (cache) => {\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for (i = 0; i < gcLen; ++i) {\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n\n/**\n * @param {object} options\n */\nfunction getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n\n/**\n * @param {object} options\n */\nfunction getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n\n return (lines * font.lineHeight) + padding.height;\n}\n\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\n\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\n\nfunction titleAlign(align, position, reverse) {\n /** @type {CanvasTextAlign} */\n let ret = _toLeftRightCenter(align);\n if ((reverse && position !== 'right') || (!reverse && position === 'right')) {\n ret = reverseAlign(ret);\n }\n return ret;\n}\n\nfunction titleArgs(scale, offset, position, align) {\n const {top, left, bottom, right, chart} = scale;\n const {chartArea, scales} = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {titleX, titleY, maxWidth, rotation};\n}\n\nexport default class Scale extends Element {\n\n // eslint-disable-next-line max-statements\n constructor(cfg) {\n super();\n\n /** @type {string} */\n this.id = cfg.id;\n /** @type {string} */\n this.type = cfg.type;\n /** @type {any} */\n this.options = undefined;\n /** @type {CanvasRenderingContext2D} */\n this.ctx = cfg.ctx;\n /** @type {Chart} */\n this.chart = cfg.chart;\n\n // implements box\n /** @type {number} */\n this.top = undefined;\n /** @type {number} */\n this.bottom = undefined;\n /** @type {number} */\n this.left = undefined;\n /** @type {number} */\n this.right = undefined;\n /** @type {number} */\n this.width = undefined;\n /** @type {number} */\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n /** @type {number} */\n this.maxWidth = undefined;\n /** @type {number} */\n this.maxHeight = undefined;\n /** @type {number} */\n this.paddingTop = undefined;\n /** @type {number} */\n this.paddingBottom = undefined;\n /** @type {number} */\n this.paddingLeft = undefined;\n /** @type {number} */\n this.paddingRight = undefined;\n\n // scale-specific properties\n /** @type {string=} */\n this.axis = undefined;\n /** @type {number=} */\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n /** @type {Tick[]} */\n this.ticks = [];\n /** @type {object[]|null} */\n this._gridLineItems = null;\n /** @type {object[]|null} */\n this._labelItems = null;\n /** @type {object|null} */\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n /** @type {number} */\n this._startPixel = undefined;\n /** @type {number} */\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n\n /**\n\t * @param {any} options\n\t * @since 3.0\n\t */\n init(options) {\n this.options = options.setContext(this.getContext());\n\n this.axis = options.axis;\n\n // parse min/max value, so we can properly determine min/max for other scales\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n\n /**\n\t * Parse a supported input value to internal representation.\n\t * @param {*} raw\n\t * @param {number} [index]\n\t * @since 3.0\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n return raw;\n }\n\n /**\n\t * @return {{min: number, max: number, minDefined: boolean, maxDefined: boolean}}\n\t * @protected\n\t * @since 3.0\n\t */\n getUserBounds() {\n let {_userMin, _userMax, _suggestedMin, _suggestedMax} = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isFinite(_userMin),\n maxDefined: isFinite(_userMax)\n };\n }\n\n /**\n\t * @param {boolean} canStack\n\t * @return {{min: number, max: number}}\n\t * @protected\n\t * @since 3.0\n\t */\n getMinMax(canStack) {\n // eslint-disable-next-line prefer-const\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n let range;\n\n if (minDefined && maxDefined) {\n return {min, max};\n }\n\n const metas = this.getMatchingVisibleMetas();\n for (let i = 0, ilen = metas.length; i < ilen; ++i) {\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n\n // Make sure min <= max when only min or max is defined by user and the data is outside that range\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n\n /**\n\t * Get the padding needed for the scale\n\t * @return {{top: number, left: number, bottom: number, right: number}} the necessary padding\n\t * @private\n\t */\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n\n /**\n\t * Returns the scale tick objects\n\t * @return {Tick[]}\n\t * @since 2.7\n\t */\n getTicks() {\n return this.ticks;\n }\n\n /**\n\t * @return {string[]}\n\t */\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n\n /**\n * @return {import('../types.js').LabelItem[]}\n */\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n\n // When a new layout is created, reset the data limits cache\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n\n // These methods are ordered by lifecycle. Utilities then follow.\n // Any function defined here is inherited by all scale types.\n // Any function can be extended by the scale type\n\n beforeUpdate() {\n call(this.options.beforeUpdate, [this]);\n }\n\n /**\n\t * @param {number} maxWidth - the max width in pixels\n\t * @param {number} maxHeight - the max height in pixels\n\t * @param {{top: number, left: number, bottom: number, right: number}} margins - the space between the edge of the other scales and edge of the chart\n\t * This space comes from two sources:\n\t * - padding - space that's required to show the labels at the edges of the scale\n\t * - thickness of scales or legends in another orientation\n\t */\n update(maxWidth, maxHeight, margins) {\n const {beginAtZero, grace, ticks: tickOpts} = this.options;\n const sampleSize = tickOpts.sampleSize;\n\n // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n this.beforeUpdate();\n\n // Absorb the master measurements\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n\n // Dimensions\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n\n this._maxLength = this.isHorizontal()\n ? this.width + margins.left + margins.right\n : this.height + margins.top + margins.bottom;\n\n // Data min/max\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n\n this.beforeBuildTicks();\n\n this.ticks = this.buildTicks() || [];\n\n // Allow modification of ticks in callback.\n this.afterBuildTicks();\n\n // Compute tick rotation and fit using a sampled subset of labels\n // We generally don't need to compute the size of every single label for determining scale size\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n\n // configure is called twice, once here, once from core.controller.updateLayout.\n // Here we haven't been positioned yet, but dimensions are correct.\n // Variables set in configure are needed for calculateLabelRotation, and\n // it's ok that coordinates are not correct there, only dimensions matter.\n this.configure();\n\n // Tick Rotation\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation(); // Preconditions: number of ticks and sizes of largest labels must be calculated beforehand\n this.afterCalculateLabelRotation();\n\n // Auto-skip\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n\n if (samplingEnabled) {\n // Generate labels using all non-skipped ticks\n this._convertTicksToLabels(this.ticks);\n }\n\n this.beforeFit();\n this.fit(); // Preconditions: label rotation and label sizes must be calculated beforehand\n this.afterFit();\n\n // IMPORTANT: after this point, we consider that `this.ticks` will NEVER change!\n\n this.afterUpdate();\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n // by default vertical scales are from bottom to top, so pixels are reversed\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n\n afterUpdate() {\n call(this.options.afterUpdate, [this]);\n }\n\n //\n\n beforeSetDimensions() {\n call(this.options.beforeSetDimensions, [this]);\n }\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n if (this.isHorizontal()) {\n // Reset position before calculating rotation\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n\n // Reset position before calculating rotation\n this.top = 0;\n this.bottom = this.height;\n }\n\n // Reset padding\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n call(this.options.afterSetDimensions, [this]);\n }\n\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n call(this.options[name], [this]);\n }\n\n // Data limits\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n\n //\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n /**\n\t * @return {object[]} the ticks\n\t */\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n\n beforeTickToLabelConversion() {\n call(this.options.beforeTickToLabelConversion, [this]);\n }\n /**\n\t * Convert ticks to label strings\n\t * @param {Tick[]} ticks\n\t */\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n tick = ticks[i];\n tick.label = call(tickOpts.callback, [tick.value, i, ticks], this);\n }\n }\n afterTickToLabelConversion() {\n call(this.options.afterTickToLabelConversion, [this]);\n }\n\n //\n\n beforeCalculateLabelRotation() {\n call(this.options.beforeCalculateLabelRotation, [this]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n\n // Estimate the width of each grid based on the canvas width, the maximum\n // label width and the number of tick intervals\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n\n // Allow 3 pixels x2 padding either side for label readability\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid)\n\t\t\t\t- tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(\n Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),\n Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))\n ));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n call(this.options.afterCalculateLabelRotation, [this]);\n }\n afterAutoSkip() {}\n\n //\n\n beforeFit() {\n call(this.options.beforeFit, [this]);\n }\n fit() {\n // Reset\n const minSize = {\n width: 0,\n height: 0\n };\n\n const {chart, options: {ticks: tickOpts, title: titleOpts, grid: gridOpts}} = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight; // fill all the height\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n\n // Don't bother fitting the ticks if we are not showing the labels\n if (tickOpts.display && this.ticks.length) {\n const {first, last, widest, highest} = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n\n if (isHorizontal) {\n // A horizontal axis is more constrained by the height.\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n // A vertical axis is more constrained by the width. Labels are the\n // dominant factor here, so get that length first and account for padding\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n\n this._handleMargins();\n\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n\n _calculatePadding(first, last, sin, cos) {\n const {ticks: {align, padding}, position} = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n\n // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned\n // which means that the right padding is dominated by the font height\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n\n // Adjust padding taking into account changes in offsets\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n\n /**\n\t * Handle margins and padding interactions\n\t * @private\n\t */\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n\n afterFit() {\n call(this.options.afterFit, [this]);\n }\n\n // Shared Methods\n /**\n\t * @return {boolean}\n\t */\n isHorizontal() {\n const {axis, position} = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n /**\n\t * @return {boolean}\n\t */\n isFullSize() {\n return this.options.fullSize;\n }\n\n /**\n\t * @param {Tick[]} ticks\n\t * @private\n\t */\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n\n this.generateTickLabels(ticks);\n\n // Ticks should be skipped when callback returns null or undef, so lets remove those.\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n\n this.afterTickToLabelConversion();\n }\n\n /**\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n\n return labelSizes;\n }\n\n /**\n\t * Returns {width, height, offset} objects for the first, last, widest, highest tick\n\t * labels where offset indicates the anchor point offset from the top in pixels.\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const {ctx, _longestTextCache: caches} = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n\n for (i = 0; i < length; i += increment) {\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n // if it is an array let's measure each element\n for (j = 0, jlen = label.length; j < jlen; ++j) {\n nestedLabel = /** @type {string} */ (label[j]);\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n\n const valueAt = (idx) => ({width: widths[idx] || 0, height: heights[idx] || 0});\n\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights,\n };\n }\n\n /**\n\t * Used to get the label to display in the tooltip for the given value\n\t * @param {*} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value;\n }\n\n /**\n\t * Returns the location of the given data point. Value can either be an index or a numerical value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {*} value\n\t * @param {number} [index]\n\t * @return {number}\n\t */\n getPixelForValue(value, index) { // eslint-disable-line no-unused-vars\n return NaN;\n }\n\n /**\n\t * Used to get the data value from a given pixel. This is the inverse of getPixelForValue\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} pixel\n\t * @return {*}\n\t */\n getValueForPixel(pixel) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Returns the location of the tick at the given index\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} index\n\t * @return {number}\n\t */\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n /**\n\t * Utility for getting the pixel location of a percentage of scale\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} decimal\n\t * @return {number}\n\t */\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n\n /**\n\t * Returns the pixel for the minimum chart value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @return {number}\n\t */\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n\n /**\n\t * @return {number}\n\t */\n getBaseValue() {\n const {min, max} = this;\n\n return min < 0 && max < 0 ? max :\n min > 0 && max > 0 ? min :\n 0;\n }\n\n /**\n\t * @protected\n\t */\n getContext(index) {\n const ticks = this.ticks || [];\n\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context ||\n\t\t\t\t(tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context ||\n\t\t\t(this.$context = createScaleContext(this.chart.getContext(), this));\n }\n\n /**\n\t * @return {number}\n\t * @private\n\t */\n _tickSize() {\n const optionTicks = this.options.ticks;\n\n // Calculate space needed by label in axis direction.\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n\n // Calculate space needed for 1 tick in axis direction.\n return this.isHorizontal()\n ? h * cos > w * sin ? w / cos : h / sin\n : h * sin < w * cos ? h / cos : w / sin;\n }\n\n /**\n\t * @return {boolean}\n\t * @private\n\t */\n _isVisible() {\n const display = this.options.display;\n\n if (display !== 'auto') {\n return !!display;\n }\n\n return this.getMatchingVisibleMetas().length > 0;\n }\n\n /**\n\t * @private\n\t */\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const {grid, position, border} = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for (i = 0; i < ticksLength; i += step) {\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n\n lineValue = getPixelForGridLine(this, i, offset);\n\n // Skip if the pixel is out of the range\n if (lineValue === undefined) {\n continue;\n }\n\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset,\n });\n }\n\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n\n return items;\n }\n\n /**\n\t * @private\n\t */\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const {position, ticks: optionTicks} = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const {align, crossAlign, padding, mirror} = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = ((chartArea.top + chartArea.bottom) / 2) + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = ((chartArea.left + chartArea.right) / 2) - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n\n const labelSizes = this._getLabelSizes();\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n label = tick.label;\n\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n\n if (isHorizontal) {\n x = pixel;\n\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += (lineHeight / 2) * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n\n let backdrop;\n\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n\n switch (textBaseline) {\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n default:\n break;\n }\n\n switch (textAlign) {\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n default:\n break;\n }\n\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n\n color: optsAtIndex.backdropColor,\n };\n }\n\n items.push({\n label,\n font,\n textOffset,\n options: {\n rotation,\n color,\n strokeColor,\n strokeWidth,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [x, y],\n backdrop,\n }\n });\n }\n\n return items;\n }\n\n _getXAxisLabelAlignment() {\n const {position, ticks} = this.options;\n const rotation = -toRadians(this.labelRotation);\n\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n\n let align = 'center';\n\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n\n return align;\n }\n\n _getYAxisLabelAlignment(tl) {\n const {position, ticks: {crossAlign, mirror, padding}} = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n\n let textAlign;\n let x;\n\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += (widest / 2);\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n\n return {textAlign, x};\n }\n\n /**\n\t * @private\n\t */\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n\n const chart = this.chart;\n const position = this.options.position;\n\n if (position === 'left' || position === 'right') {\n return {top: 0, left: this.left, bottom: chart.height, right: this.right};\n } if (position === 'top' || position === 'bottom') {\n return {top: this.top, left: 0, bottom: this.bottom, right: chart.width};\n }\n }\n\n /**\n * @protected\n */\n drawBackground() {\n const {ctx, options: {backgroundColor}, left, top, width, height} = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex(t => t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n\n const drawLine = (p1, p2, style) => {\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n\n if (grid.display) {\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n const item = items[i];\n\n if (grid.drawOnChartArea) {\n drawLine(\n {x: item.x1, y: item.y1},\n {x: item.x2, y: item.y2},\n item\n );\n }\n\n if (grid.drawTicks) {\n drawLine(\n {x: item.tx1, y: item.ty1},\n {x: item.tx2, y: item.ty2},\n {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n }\n );\n }\n }\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {\n const {chart, ctx, options: {border, grid}} = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n\n if (!optionTicks.display) {\n return;\n }\n\n const ctx = this.ctx;\n\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n\n const items = this.getLabelItems(chartArea);\n for (const item of items) {\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n\n if (area) {\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const {ctx, options: {position, title, reverse}} = this;\n\n if (!title.display) {\n return;\n }\n\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n\n const {titleX, titleY, maxWidth, rotation} = titleArgs(this, offset, position, align);\n\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n\n /**\n\t * @return {object[]}\n\t * @private\n\t */\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n // backward compatibility: draw has been overridden by custom scale\n return [{\n z: tz,\n draw: (chartArea) => {\n this.draw(chartArea);\n }\n }];\n }\n\n return [{\n z: gz,\n draw: (chartArea) => {\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n }, {\n z: bz,\n draw: () => {\n this.drawBorder();\n }\n }, {\n z: tz,\n draw: (chartArea) => {\n this.drawLabels(chartArea);\n }\n }];\n }\n\n /**\n\t * Returns visible dataset metas that are attached to this scale\n\t * @param {string} [type] - if specified, also filter by dataset type\n\t * @return {object[]}\n\t */\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n\n /**\n\t * @param {number} index\n\t * @return {object}\n\t * @protected\n \t */\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n\n /**\n * @protected\n */\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n","import {merge} from '../helpers/index.js';\nimport defaults, {overrides} from './core.defaults.js';\n\n/**\n * @typedef {{id: string, defaults: any, overrides?: any, defaultRoutes: any}} IChartComponent\n */\n\nexport default class TypedRegistry {\n constructor(type, scope, override) {\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n\n /**\n\t * @param {IChartComponent} item\n\t * @returns {string} The scope where items defaults were registered to.\n\t */\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n\n if (isIChartComponent(proto)) {\n // Make sure the parent is registered and note the scope where its defaults are.\n parentScope = this.register(proto);\n }\n\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n\n if (id in items) {\n // already registered\n return scope;\n }\n\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n\n return scope;\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object?}\n\t */\n get(id) {\n return this.items[id];\n }\n\n /**\n\t * @param {IChartComponent} item\n\t */\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n\n if (id in items) {\n delete items[id];\n }\n\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\n\nfunction registerDefaults(item, scope, parentScope) {\n // Inherit the parent's defaults and keep existing defaults\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n\n defaults.set(scope, itemDefaults);\n\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\n\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach(property => {\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [scope].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\n\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n","import DatasetController from './core.datasetController.js';\nimport Element from './core.element.js';\nimport Scale from './core.scale.js';\nimport TypedRegistry from './core.typedRegistry.js';\nimport {each, callback as call, _capitalize} from '../helpers/helpers.core.js';\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Registry {\n constructor() {\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n // Order is important, Scale has Element in prototype chain,\n // so Scales must be before Elements. Plugins are a fallback, so not listed here.\n this._typedRegistries = [this.controllers, this.scales, this.elements];\n }\n\n /**\n\t * @param {...any} args\n\t */\n add(...args) {\n this._each('register', args);\n }\n\n remove(...args) {\n this._each('unregister', args);\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof DatasetController}\n\t */\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Element}\n\t */\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object}\n\t */\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Scale}\n\t */\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n\n /**\n\t * @private\n\t */\n _each(method, args, typedRegistry) {\n [...args].forEach(arg => {\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || (reg === this.plugins && arg.id)) {\n this._exec(method, reg, arg);\n } else {\n // Handle loopable args\n // Use case:\n // import * as plugins from './plugins.js';\n // Chart.register(plugins);\n each(arg, item => {\n // If there are mixed types in the loopable, make sure those are\n // registered in correct registry\n // Use case: (treemap exporting controller, elements etc)\n // import * as treemap from 'chartjs-chart-treemap.js';\n // Chart.register(treemap);\n\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n call(component['before' + camelMethod], [], component); // beforeRegister / beforeUnregister\n registry[method](component);\n call(component['after' + camelMethod], [], component); // afterRegister / afterUnregister\n }\n\n /**\n\t * @private\n\t */\n _getRegistryForType(type) {\n for (let i = 0; i < this._typedRegistries.length; i++) {\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n // plugins is the fallback registry\n return this.plugins;\n }\n\n /**\n\t * @private\n\t */\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Registry();\n","import registry from './core.registry.js';\nimport {callback as callCallback, isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../plugins/plugin.tooltip.js').default } Tooltip\n */\n\n/**\n * @callback filterCallback\n * @param {{plugin: object, options: object}} value\n * @param {number} [index]\n * @param {array} [array]\n * @param {object} [thisArg]\n * @return {boolean}\n */\n\n\nexport default class PluginService {\n constructor() {\n this._init = [];\n }\n\n /**\n\t * Calls enabled plugins for `chart` on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {Chart} chart - The chart instance for which plugins should be called.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {object} [args] - Extra arguments to apply to the hook call.\n * @param {filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n\n /**\n\t * @private\n\t */\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors) {\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [chart, args, descriptor.options];\n if (callCallback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n\n return true;\n }\n\n invalidate() {\n // When plugins are registered, there is the possibility of a double\n // invalidate situation. In this case, we only want to invalidate once.\n // If we invalidate multiple times, the `_oldCache` is lost and all of the\n // plugins are restarted without being correctly stopped.\n // See https://github.com/chartjs/Chart.js/issues/8147\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n\n const descriptors = this._cache = this._createDescriptors(chart);\n\n this._notifyStateChanges(chart);\n\n return descriptors;\n }\n\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n // options === false => all plugins are disabled\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b) => a.filter(x => !b.some(y => x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\n\n/**\n * @param {import('./core.config.js').default} config\n */\nfunction allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for (let i = 0; i < keys.length; i++) {\n plugins.push(registry.getPlugin(keys[i]));\n }\n\n const local = config.plugins || [];\n for (let i = 0; i < local.length; i++) {\n const plugin = local[i];\n\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n\n return {plugins, localIds};\n}\n\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\n\nfunction createDescriptors(chart, {plugins, localIds}, options, all) {\n const result = [];\n const context = chart.getContext();\n\n for (const plugin of plugins) {\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {plugin, local: localIds[id]}, opts, context)\n });\n }\n\n return result;\n}\n\nfunction pluginOpts(config, {plugin, local}, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n // make sure plugin defaults are in scopes for local (not registered) plugins\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [''], {\n // These are just defaults that plugins can override\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n","import defaults, {overrides, descriptors} from './core.defaults.js';\nimport {mergeIf, resolveObjectKey, isArray, isFunction, valueOrDefault, isObject} from '../helpers/helpers.core.js';\nimport {_attachContext, _createResolver, _descriptors} from '../helpers/helpers.config.js';\n\nexport function getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\n\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\n\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\n\nfunction idMatchesAxis(id) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n}\n\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\n\nexport function determineAxis(id, ...scaleOptions) {\n if (idMatchesAxis(id)) {\n return id;\n }\n for (const opts of scaleOptions) {\n const axis = opts.axis\n || axisFromPosition(opts.position)\n || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n if (axis) {\n return axis;\n }\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\n\nfunction getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + 'AxisID'] === id) {\n return {axis};\n }\n}\n\nfunction retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d) => d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) {\n return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n }\n }\n return {};\n}\n\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {scales: {}};\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n\n // First figure out first scale id's per axis.\n Object.keys(configScales).forEach(id => {\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [{axis}, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]);\n });\n\n // Then merge dataset defaults to scale configs\n config.data.datasets.forEach(dataset => {\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach(defaultID => {\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [{axis}, configScales[id], defaultScaleOptions[defaultID]]);\n });\n });\n\n // apply scale defaults, if not overridden by dataset defaults\n Object.keys(scales).forEach(key => {\n const scale = scales[key];\n mergeIf(scale, [defaults.scales[scale.type], defaults.scale]);\n });\n\n return scales;\n}\n\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\n\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\n\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n\n initOptions(config);\n\n return config;\n}\n\nconst keyCache = new Map();\nconst keysCached = new Set();\n\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\n\nconst addIfFound = (set, obj, key) => {\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\n\nexport default class Config {\n constructor(config) {\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n\n get platform() {\n return this._config.platform;\n }\n\n get type() {\n return this._config.type;\n }\n\n set type(type) {\n this._config.type = type;\n }\n\n get data() {\n return this._config.data;\n }\n\n set data(data) {\n this._config.data = initData(data);\n }\n\n get options() {\n return this._config.options;\n }\n\n set options(options) {\n this._config.options = options;\n }\n\n get plugins() {\n return this._config.plugins;\n }\n\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n\n /**\n * Returns the option scope keys for resolving dataset options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @return {string[][]}\n */\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType,\n () => [[\n `datasets.${datasetType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the option scope keys for resolving dataset animation options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @param {string} transition\n * @return {string[][]}\n */\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`,\n () => [\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`,\n ],\n // The following are used for looking up the `animations` and `animation` keys\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n\n /**\n * Returns the options scope keys for resolving element options that belong\n * to an dataset. These keys do not include the dataset itself, because it\n * is not under options.\n * @param {string} datasetType\n * @param {string} elementType\n * @return {string[][]}\n */\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`,\n () => [[\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the options scope keys for resolving plugin options.\n * @param {{id: string, additionalOptionScopes?: string[]}} plugin\n * @return {string[][]}\n */\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`,\n () => [[\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || [],\n ]]);\n }\n\n /**\n * @private\n */\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n\n /**\n * Resolves the objects from options and defaults for option value resolution.\n * @param {object} mainScope - The main scope object for options\n * @param {string[][]} keyLists - The arrays of keys in resolution order\n * @param {boolean} [resetCache] - reset the cache for this mainScope\n */\n getOptionScopes(mainScope, keyLists, resetCache) {\n const {options, type} = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n\n const scopes = new Set();\n\n keyLists.forEach(keys => {\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach(key => addIfFound(scopes, mainScope, key));\n }\n keys.forEach(key => addIfFound(scopes, options, key));\n keys.forEach(key => addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach(key => addIfFound(scopes, defaults, key));\n keys.forEach(key => addIfFound(scopes, descriptors, key));\n });\n\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n\n /**\n * Returns the option scopes for resolving chart options\n * @return {object[]}\n */\n chartOptionScopes() {\n const {options, type} = this;\n\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {}, // https://github.com/chartjs/Chart.js/issues/8531\n {type},\n defaults,\n descriptors\n ];\n }\n\n /**\n * @param {object[]} scopes\n * @param {string[]} names\n * @param {function|object} context\n * @param {string[]} [prefixes]\n * @return {object}\n */\n resolveNamedOptions(scopes, names, context, prefixes = ['']) {\n const result = {$shared: true};\n const {resolver, subPrefixes} = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n // subResolver is passed to scriptable options. It should not resolve to hover options.\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n\n for (const prop of names) {\n result[prop] = options[prop];\n }\n return result;\n }\n\n /**\n * @param {object[]} scopes\n * @param {object} [context]\n * @param {string[]} [prefixes]\n * @param {{scriptable: boolean, indexable: boolean, allKeys?: boolean}} [descriptorDefaults]\n */\n createResolver(scopes, context, prefixes = [''], descriptorDefaults) {\n const {resolver} = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context)\n ? _attachContext(resolver, context, undefined, descriptorDefaults)\n : resolver;\n }\n}\n\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter(p => !p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\n\nconst hasFunction = value => isObject(value)\n && Object.getOwnPropertyNames(value).reduce((acc, key) => acc || isFunction(value[key]), false);\n\nfunction needContext(proxy, names) {\n const {isScriptable, isIndexable} = _descriptors(proxy);\n\n for (const prop of names) {\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if ((scriptable && (isFunction(value) || hasFunction(value)))\n || (indexable && isArray(value))) {\n return true;\n }\n }\n return false;\n}\n","import animator from './core.animator.js';\nimport defaults, {overrides} from './core.defaults.js';\nimport Interaction from './core.interaction.js';\nimport layouts from './core.layouts.js';\nimport {_detectPlatform} from '../platform/index.js';\nimport PluginService from './core.plugins.js';\nimport registry from './core.registry.js';\nimport Config, {determineAxis, getIndexAxis} from './core.config.js';\nimport {retinaScale, _isDomSupported} from '../helpers/helpers.dom.js';\nimport {each, callback as callCallback, uid, valueOrDefault, _elementsEqual, isNullOrUndef, setsEqual, defined, isFunction, _isClickEvent} from '../helpers/helpers.core.js';\nimport {clearCanvas, clipArea, createContext, unclipArea, _isPointInArea} from '../helpers/index.js';\n// @ts-ignore\nimport {version} from '../../package.json';\nimport {debounce} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').Point } Point\n */\n\nconst KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || (KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x');\n}\n\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1]\n ? a[l2] - b[l2]\n : a[l1] - b[l1];\n };\n}\n\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n\n chart.notifyPlugins('afterRender');\n callCallback(animationOptions && animationOptions.onComplete, [context], chart);\n}\n\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callCallback(animationOptions && animationOptions.onProgress, [context], chart);\n}\n\n/**\n * Chart.js can take a string id of a canvas element, a 2d context, or a canvas element itself.\n * Attempt to unwrap the item passed into the chart constructor so that it is a canvas element (if possible).\n */\nfunction getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n // Support for array based queries (such as jQuery)\n item = item[0];\n }\n\n if (item && item.canvas) {\n // Support for any object associated to a canvas (including a context2d)\n item = item.canvas;\n }\n return item;\n}\n\nconst instances = {};\nconst getChart = (key) => {\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c) => c.canvas === canvas).pop();\n};\n\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys) {\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n\n/**\n * @param {ChartEvent} e\n * @param {ChartEvent|null} lastEvent\n * @param {boolean} inChartArea\n * @param {boolean} isClick\n * @returns {ChartEvent|null}\n */\nfunction determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\n\nfunction getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\n\nfunction getDatasetArea(meta, chartArea) {\n const {xScale, yScale} = meta;\n if (xScale && yScale) {\n return {\n left: getSizeForArea(xScale, chartArea, 'left'),\n right: getSizeForArea(xScale, chartArea, 'right'),\n top: getSizeForArea(yScale, chartArea, 'top'),\n bottom: getSizeForArea(yScale, chartArea, 'bottom')\n };\n }\n return chartArea;\n}\n\nclass Chart {\n\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n\n // eslint-disable-next-line max-statements\n constructor(item, userConfig) {\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error(\n 'Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' +\n\t\t\t\t' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.'\n );\n }\n\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n // Store the previously used aspect ratio to determine if a resize\n // is needed during updates. Do this after _options is set since\n // aspectRatio uses a getter\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n /** @type {?{attach?: function, detach?: function, resize?: function}} */\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce(mode => this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n\n // Add the chart instance to the global namespace\n instances[this.id] = this;\n\n if (!context || !canvas) {\n // The given item is not a compatible context2d element, let's return before finalizing\n // the chart initialization but after setting basic chart / controller properties that\n // can help to figure out that the chart is not valid (e.g chart.canvas !== null);\n // https://github.com/chartjs/Chart.js/issues/2807\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n\n get aspectRatio() {\n const {options: {aspectRatio, maintainAspectRatio}, width, height, _aspectRatio} = this;\n if (!isNullOrUndef(aspectRatio)) {\n // If aspectRatio is defined in options, use that.\n return aspectRatio;\n }\n\n if (maintainAspectRatio && _aspectRatio) {\n // If maintainAspectRatio is truthly and we had previously determined _aspectRatio, use that\n return _aspectRatio;\n }\n\n // Calculate\n return height ? width / height : null;\n }\n\n get data() {\n return this.config.data;\n }\n\n set data(data) {\n this.config.data = data;\n }\n\n get options() {\n return this._options;\n }\n\n set options(options) {\n this.config.options = options;\n }\n\n get registry() {\n return registry;\n }\n\n /**\n\t * @private\n\t */\n _initialize() {\n // Before init plugin notification\n this.notifyPlugins('beforeInit');\n\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n\n this.bindEvents();\n\n // After init plugin notification\n this.notifyPlugins('afterInit');\n\n return this;\n }\n\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n\n stop() {\n animator.stop(this);\n return this;\n }\n\n /**\n\t * Resize the chart to its container or to explicit dimensions.\n\t * @param {number} [width]\n\t * @param {number} [height]\n\t */\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {width, height};\n }\n }\n\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n\n this.notifyPlugins('resize', {size: newSize});\n\n callCallback(options.onResize, [this, newSize], this);\n\n if (this.attached) {\n if (this._doResize(mode)) {\n // The resize update is delayed, only draw without updating.\n this.render();\n }\n }\n }\n\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n\n each(scalesOptions, (axisOptions, axisID) => {\n axisOptions.id = axisID;\n });\n }\n\n /**\n\t * Builds a map of scale ID to scale object for future lookup.\n\t */\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id) => {\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n\n if (scaleOpts) {\n items = items.concat(\n Object.keys(scaleOpts).map((id) => {\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n })\n );\n }\n\n each(items, (item) => {\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n\n scale.init(scaleOptions, options);\n });\n // clear up discarded scales\n each(updated, (hasUpdated, id) => {\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n\n each(scales, (scale) => {\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n\n /**\n\t * @private\n\t */\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n\n metasets.sort((a, b) => a.index - b.index);\n if (numMeta > numData) {\n for (let i = numData; i < numMeta; ++i) {\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n\n /**\n\t * @private\n\t */\n _removeUnreferencedMetasets() {\n const {_metasets: metasets, data: {datasets}} = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index) => {\n if (datasets.filter(x => x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n\n this._removeUnreferencedMetasets();\n\n for (i = 0, ilen = datasets.length; i < ilen; i++) {\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const {datasetElementType, dataElementType} = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n\n this._updateMetasets();\n return newControllers;\n }\n\n /**\n\t * Reset the elements of all datasets\n\t * @private\n\t */\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex) => {\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n\n /**\n\t* Resets the chart back to its state before the initial animation\n\t*/\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n\n update(mode) {\n const config = this.config;\n\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n\n // plugins options references might have change, let's invalidate the cache\n // https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\n this._plugins.invalidate();\n\n if (this.notifyPlugins('beforeUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n // Make sure dataset controllers are updated and new controllers are reset\n const newControllers = this.buildOrUpdateControllers();\n\n this.notifyPlugins('beforeElementsUpdate');\n\n // Make sure all dataset controllers have correct meta data counts\n let minPadding = 0;\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; i++) {\n const {controller} = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n // New controllers will be reset after the layout pass, so we only want to modify\n // elements added to new datasets\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n\n // Only reset the controllers if we have animations\n if (!animsDisabled) {\n // Can only reset the new controllers after the scales have been updated\n // Reset is done to get the starting point for the initial animation\n each(newControllers, (controller) => {\n controller.reset();\n });\n }\n\n this._updateDatasets(mode);\n\n // Do this before render so that any plugins that need final scale updates can use it\n this.notifyPlugins('afterUpdate', {mode});\n\n this._layers.sort(compare2Level('z', '_idx'));\n\n // Replay last event from before update, or set hover styles on active elements\n const {_active, _lastEvent} = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n\n this.render();\n }\n\n /**\n * @private\n */\n _updateScales() {\n each(this.scales, (scale) => {\n layouts.removeBox(this, scale);\n });\n\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n\n /**\n * @private\n */\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n // The configured events have changed. Rebind.\n this.unbindEvents();\n this.bindEvents();\n }\n }\n\n /**\n * @private\n */\n _updateHiddenIndices() {\n const {_hiddenIndices} = this;\n const changes = this._getUniformDataChanges() || [];\n for (const {method, start, count} of changes) {\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n\n /**\n * @private\n */\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx) => new Set(\n _dataChanges\n .filter(c => c[0] === idx)\n .map((c, i) => i + ',' + c.splice(1).join(','))\n );\n\n const changeSet = makeSet(0);\n for (let i = 1; i < datasetCount; i++) {\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet)\n .map(c => c.split(','))\n .map(a => ({method: a[1], start: +a[2], count: +a[3]}));\n }\n\n /**\n\t * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`\n\t * hook, in which case, plugins will not be called on `afterLayout`.\n\t * @private\n\t */\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {cancelable: true}) === false) {\n return;\n }\n\n layouts.update(this, this.width, this.height, minPadding);\n\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n\n this._layers = [];\n each(this.boxes, (box) => {\n if (noArea && box.position === 'chartArea') {\n // Skip drawing and configuring chartArea boxes when chartArea is zero or negative\n return;\n }\n\n // configure is called twice, once in core.scale.update and once here.\n // Here the boxes are fully updated and at their final positions.\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n\n this._layers.forEach((item, index) => {\n item._idx = index;\n });\n\n this.notifyPlugins('afterLayout');\n }\n\n /**\n\t * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.\n\t * @private\n\t */\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this.getDatasetMeta(i).controller.configure();\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);\n }\n\n this.notifyPlugins('afterDatasetsUpdate', {mode});\n }\n\n /**\n\t * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetUpdate`.\n\t * @private\n\t */\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {meta, index, mode, cancelable: true};\n\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n\n meta.controller._update(mode);\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n\n render() {\n if (this.notifyPlugins('beforeRender', {cancelable: true}) === false) {\n return;\n }\n\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({chart: this});\n }\n }\n\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const {width, height} = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n\n if (this.notifyPlugins('beforeDraw', {cancelable: true}) === false) {\n return;\n }\n\n // Because of plugin hooks (before/afterDatasetsDraw), datasets can't\n // currently be part of layers. Instead, we draw\n // layers <= 0 before(default, backward compat), and the rest after\n const layers = this._layers;\n for (i = 0; i < layers.length && layers[i].z <= 0; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this._drawDatasets();\n\n // Rest of layers\n for (; i < layers.length; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this.notifyPlugins('afterDraw');\n }\n\n /**\n\t * @private\n\t */\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n\n return result;\n }\n\n /**\n\t * Gets the visible dataset metas in drawing order\n\t * @return {object[]}\n\t */\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n\n /**\n\t * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetsDraw`.\n\t * @private\n\t */\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {cancelable: true}) === false) {\n return;\n }\n\n const metasets = this.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n this._drawDataset(metasets[i]);\n }\n\n this.notifyPlugins('afterDatasetsDraw');\n }\n\n /**\n\t * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetDraw`.\n\t * @private\n\t */\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta, this.chartArea);\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n\n meta.controller.draw();\n\n if (useClip) {\n unclipArea(ctx);\n }\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n\n /**\n * Checks whether the given point is in the chart area.\n * @param {Point} point - in relative coordinates (see, e.g., getRelativePosition)\n * @returns {boolean}\n */\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n\n return [];\n }\n\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter(x => x && x._dataset === dataset).pop();\n\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\t\t\t// See isDatasetVisible() comment\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n\n return meta;\n }\n\n getContext() {\n return this.$context || (this.$context = createContext(null, {chart: this, type: 'chart'}));\n }\n\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n\n const meta = this.getDatasetMeta(datasetIndex);\n\n // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,\n // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n\n /**\n\t * @private\n\t */\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n // Animate visible state, so hide animation can be seen. This could be handled better if update / updateDataset returned a Promise.\n anims.update(meta, {visible});\n this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n\n /**\n\t * @private\n\t */\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n\n for (i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._destroyDatasetMeta(i);\n }\n }\n\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const {canvas, ctx} = this;\n\n this._stop();\n this.config.clearCache();\n\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n\n delete instances[this.id];\n\n this.notifyPlugins('afterDestroy');\n }\n\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n\n /**\n\t * @private\n\t */\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n\n /**\n * @private\n */\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n\n const listener = (e, x, y) => {\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n\n each(this.options.events, (type) => _add(type, listener));\n }\n\n /**\n * @private\n */\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener) => {\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n\n const listener = (width, height) => {\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n\n let detached; // eslint-disable-line prefer-const\n const attached = () => {\n _remove('attach', attached);\n\n this.attached = true;\n this.resize();\n\n _add('resize', listener);\n _add('detach', detached);\n };\n\n detached = () => {\n this.attached = false;\n\n _remove('resize', listener);\n\n // Stop animating and remove metasets, so when re-attached, the animations start from beginning.\n this._stop();\n this._resize(0, 0);\n\n _add('attach', attached);\n };\n\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n\n /**\n\t * @private\n\t */\n unbindEvents() {\n each(this._listeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n\n each(this._responsiveListeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n\n /**\n\t * Get active (hovered) elements\n\t * @returns array\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active (hovered) elements\n\t * @param {array} activeElements New active data points\n\t */\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n\n if (changed) {\n this._active = active;\n // Make sure we don't use the previous mouse event to override the active elements in update.\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n\n /**\n\t * Calls enabled plugins on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {Object} [args] - Extra arguments to apply to the hook call.\n * @param {import('./core.plugins.js').filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n\n /**\n * Check if a plugin with the specific ID is registered and enabled\n * @param {string} pluginId - The ID of the plugin of which to check if it is enabled\n * @returns {boolean}\n */\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter(p => p.plugin.id === pluginId).length === 1;\n }\n\n /**\n\t * @private\n\t */\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b) => a.filter(x => !b.some(y => x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n\n /**\n\t * @private\n\t */\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type);\n\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n\n const changed = this._handleEvent(e, replay, args.inChartArea);\n\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n\n if (changed || args.changed) {\n this.render();\n }\n\n return this;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e the event to handle\n\t * @param {boolean} [replay] - true if the event was replayed by `update`\n * @param {boolean} [inChartArea] - true if the event is inside chartArea\n\t * @return {boolean} true if the chart needs to re-render\n\t * @private\n\t */\n _handleEvent(e, replay, inChartArea) {\n const {_active: lastActive = [], options} = this;\n\n // If the event is replayed from `update`, we should evaluate with the final positions.\n //\n // The `replay`:\n // It's the last event (excluding click) that has occurred before `update`.\n // So mouse has not moved. It's also over the chart, because there is a `replay`.\n //\n // The why:\n // If animations are active, the elements haven't moved yet compared to state before update.\n // But if they will, we are activating the elements that would be active, if this check\n // was done after the animations have completed. => \"final positions\".\n // If there is no animations, the \"final\" and \"current\" positions are equal.\n // This is done so we do not have to evaluate the active elements each animation frame\n // - it would be expensive.\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n\n if (inChartArea) {\n // Set _lastEvent to null while we are processing the event handlers.\n // This prevents recursion if the handler calls chart.update()\n this._lastEvent = null;\n\n // Invoke onHover hook\n callCallback(options.onHover, [e, active, this], this);\n\n if (isClick) {\n callCallback(options.onClick, [e, active, this], this);\n }\n }\n\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n\n this._lastEvent = lastEvent;\n\n return changed;\n }\n\n /**\n * @param {ChartEvent} e - The event\n * @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements\n * @param {boolean} inChartArea - Is the envent inside chartArea\n * @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after animation) element positions\n * @returns {import('../types/index.js').ActiveElement[]} - The active elements\n * @pravate\n */\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n return lastActive;\n }\n\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\n\n// @ts-ignore\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart) => chart._plugins.invalidate());\n}\n\nexport default Chart;\n","import Element from '../core/core.element.js';\nimport {_angleBetween, getAngleFromPoint, TAU, HALF_PI, valueOrDefault} from '../helpers/index.js';\nimport {PI, _isBetween, _limitValue} from '../helpers/helpers.math.js';\nimport {_readValueToProps} from '../helpers/helpers.options.js';\nimport type {ArcOptions, Point} from '../types/index.js';\n\n\nfunction clipArc(ctx: CanvasRenderingContext2D, element: ArcElement, endAngle: number) {\n const {startAngle, pixelMargin, x, y, outerRadius, innerRadius} = element;\n let angleMargin = pixelMargin / outerRadius;\n\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\n\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, ['outerStart', 'outerEnd', 'innerStart', 'innerEnd']);\n}\n\n/**\n * Parse border radius from the provided options\n */\nfunction parseBorderRadius(arc: ArcElement, innerRadius: number, outerRadius: number, angleDelta: number) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val) => {\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit),\n };\n}\n\n/**\n * Convert (r, 𝜃) to (x, y)\n */\nfunction rThetaToXY(r: number, theta: number, x: number, y: number) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta),\n };\n}\n\n\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */\nfunction pathArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n end: number,\n circular: boolean,\n) {\n const {x, y, startAngle: start, pixelMargin, innerRadius: innerR} = element;\n\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n\n let spacingOffset = 0;\n const alpha = end - start;\n\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? (alpha * avNogSpacingRadius) / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const {outerStart, outerEnd, innerStart, innerEnd} = parseBorderRadius(element, innerRadius, outerRadius, endAngle - startAngle);\n\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n\n ctx.beginPath();\n\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = ((endAngle - (innerEnd / innerRadius)) + (startAngle + (innerStart / innerRadius))) / 2;\n ctx.arc(x, y, innerRadius, endAngle - (innerEnd / innerRadius), innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + (innerStart / innerRadius), true);\n\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n\n ctx.closePath();\n}\n\nfunction drawArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference} = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\n\nfunction drawBorder(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference, options} = element;\n const {borderWidth, borderJoinStyle, borderDash, borderDashOffset} = options;\n const inner = options.borderAlign === 'inner';\n\n if (!borderWidth) {\n return;\n }\n\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\n\nexport interface ArcProps extends Point {\n startAngle: number;\n endAngle: number;\n innerRadius: number;\n outerRadius: number;\n circumference: number;\n}\n\nexport default class ArcElement extends Element {\n\n static id = 'arc';\n\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true,\n };\n\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash'\n };\n\n circumference: number;\n endAngle: number;\n fullCircles: number;\n innerRadius: number;\n outerRadius: number;\n pixelMargin: number;\n startAngle: number;\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(chartX: number, chartY: number, useFinalPosition: boolean) {\n const point = this.getProps(['x', 'y'], useFinalPosition);\n const {angle, distance} = getAngleFromPoint(point, {x: chartX, y: chartY});\n const {startAngle, endAngle, innerRadius, outerRadius, circumference} = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n\n return (betweenAngles && withinRadius);\n }\n\n getCenterPoint(useFinalPosition: boolean) {\n const {x, y, startAngle, endAngle, innerRadius, outerRadius} = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ], useFinalPosition);\n const {offset, spacing} = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n\n tooltipPosition(useFinalPosition: boolean) {\n return this.getCenterPoint(useFinalPosition);\n }\n\n draw(ctx: CanvasRenderingContext2D) {\n const {options, circumference} = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = (options.borderAlign === 'inner') ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n\n ctx.save();\n\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n\n ctx.restore();\n }\n}\n","import Element from '../core/core.element.js';\nimport {_bezierInterpolation, _pointInLine, _steppedInterpolation} from '../helpers/helpers.interpolation.js';\nimport {_computeSegments, _boundSegments} from '../helpers/helpers.segment.js';\nimport {_steppedLineTo, _bezierCurveTo} from '../helpers/helpers.canvas.js';\nimport {_updateBezierControlPoints} from '../helpers/helpers.curve.js';\nimport {valueOrDefault} from '../helpers/index.js';\n\n/**\n * @typedef { import('./element.point.js').default } PointElement\n */\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\n\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @returns {any}\n */\nfunction getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n\n return lineTo;\n}\n\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const {start: paramsStart = 0, end: paramsEnd = count - 1} = params;\n const {start: segmentStart, end: segmentEnd} = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction pathSegment(ctx, line, segment, params) {\n const {points, options} = line;\n const {count, start, loop, ilen} = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n // eslint-disable-next-line prefer-const\n let {move = true, reverse} = params || {};\n let i, point, prev;\n\n for (i = 0; i <= ilen; ++i) {\n point = points[(start + (reverse ? ilen - i : i)) % count];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n prev = point;\n }\n\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n return !!loop;\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const {count, start, ilen} = pathVars(points, segment, params);\n const {move = true, reverse} = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n\n const pointIndex = (index) => (start + (reverse ? ilen - index : index)) % count;\n const drawX = () => {\n if (minY !== maxY) {\n // Draw line to maxY and minY, using the average x-coordinate\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n // Line to y-value of last point in group. So the line continues\n // from correct position. Not using move, to have solid path.\n ctx.lineTo(avgX, lastY);\n }\n };\n\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n\n for (i = 0; i <= ilen; ++i) {\n point = points[pointIndex(i)];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n }\n\n const x = point.x;\n const y = point.y;\n const truncX = x | 0; // truncated x-coordinate\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n // Draw line to next x-position, using the first (or only)\n // y-value in that group\n ctx.lineTo(x, y);\n\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n // Keep track of the last y-value in group\n lastY = y;\n }\n drawX();\n}\n\n/**\n * @param {LineElement} line - the line\n * @returns {function}\n * @private\n */\nfunction _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n\n/**\n * @private\n */\nfunction _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n\n return _pointInLine;\n}\n\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\n\nfunction strokePathDirect(ctx, line, start, count) {\n const {segments, options} = line;\n const segmentMethod = _getSegmentMethod(line);\n\n for (const segment of segments) {\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {start, end: start + count - 1})) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\n\nconst usePath2D = typeof Path2D === 'function';\n\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\n\nexport default class LineElement extends Element {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0,\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash' && name !== 'fill',\n };\n\n\n constructor(cfg) {\n super();\n\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n\n get points() {\n return this._points;\n }\n\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n\n /**\n\t * First non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n\n /**\n\t * Last non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n\n /**\n\t * Interpolate a point in this line at the same value on `property` as\n\t * the reference `point` provided\n\t * @param {PointElement} point - the reference point\n\t * @param {string} property - the property to match on\n\t * @returns {PointElement|undefined}\n\t */\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {property, start: value, end: value});\n\n if (!segments.length) {\n return;\n }\n\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for (i = 0, ilen = segments.length; i < ilen; ++i) {\n const {start, end} = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n\n /**\n\t * Append a segment of this line to current path.\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} segment\n\t * @param {number} segment.start - start index of the segment, referring the points array\n \t * @param {number} segment.end - end index of the segment, referring the points array\n \t * @param {boolean} segment.loop - indicates that the segment is a loop\n\t * @param {object} params\n\t * @param {boolean} params.move - move to starting point (vs line to it)\n\t * @param {boolean} params.reverse - path the segment from end to start\n\t * @param {number} params.start - limit segment to points starting from `start` index\n\t * @param {number} params.end - limit segment to points ending at `start` + `count` index\n\t * @returns {undefined|boolean} - true if the segment is a full loop (path should be closed)\n\t */\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n\n /**\n\t * Append all segments of this line to current path.\n\t * @param {CanvasRenderingContext2D|Path2D} ctx\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t * @returns {undefined|boolean} - true if line is a full loop (path should be closed)\n\t */\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n\n start = start || 0;\n count = count || (this.points.length - start);\n\n for (const segment of segments) {\n loop &= segmentMethod(ctx, this, segment, {start, end: start + count - 1});\n }\n return !!loop;\n }\n\n /**\n\t * Draw\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} chartArea\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t */\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n\n if (points.length && options.borderWidth) {\n ctx.save();\n\n draw(ctx, this, start, count);\n\n ctx.restore();\n }\n\n if (this.animated) {\n // When line is animated, the control points and path are not cached.\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n","import Element from '../core/core.element.js';\nimport {drawPoint, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport type {\n CartesianParsedData,\n ChartArea,\n Point,\n PointHoverOptions,\n PointOptions,\n} from '../types/index.js';\n\nfunction inRange(el: PointElement, pos: number, axis: 'x' | 'y', useFinalPosition?: boolean) {\n const options = el.options;\n const {[axis]: value} = el.getProps([axis], useFinalPosition);\n\n return (Math.abs(pos - value) < options.radius + options.hitRadius);\n}\n\nexport type PointProps = Point\n\nexport default class PointElement extends Element {\n\n static id = 'point';\n\n parsed: CartesianParsedData;\n skip?: boolean;\n stop?: boolean;\n\n /**\n * @type {any}\n */\n static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean) {\n const options = this.options;\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return ((Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2)) < Math.pow(options.hitRadius + options.radius, 2));\n }\n\n inXRange(mouseX: number, useFinalPosition?: boolean) {\n return inRange(this, mouseX, 'x', useFinalPosition);\n }\n\n inYRange(mouseY: number, useFinalPosition?: boolean) {\n return inRange(this, mouseY, 'y', useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition?: boolean) {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y};\n }\n\n size(options?: Partial) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n\n draw(ctx: CanvasRenderingContext2D, area: ChartArea) {\n const options = this.options;\n\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n","import Element from '../core/core.element.js';\nimport {isObject, _isBetween, _limitValue} from '../helpers/index.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {toTRBL, toTRBLCorners} from '../helpers/helpers.options.js';\n\n/** @typedef {{ x: number, y: number, base: number, horizontal: boolean, width: number, height: number }} BarProps */\n\n/**\n * Helper function to get the bounds of the bar regardless of the orientation\n * @param {BarElement} bar the bar\n * @param {boolean} [useFinalPosition]\n * @return {object} bounds of the bar\n * @private\n */\nfunction getBarBounds(bar, useFinalPosition) {\n const {x, y, base, width, height} = /** @type {BarProps} */ (bar.getProps(['x', 'y', 'base', 'width', 'height'], useFinalPosition));\n\n let left, right, top, bottom, half;\n\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n\n return {left, top, right, bottom};\n}\n\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\n\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\n\nfunction parseBorderRadius(bar, maxW, maxH) {\n const {enableBorderRadius} = bar.getProps(['enableBorderRadius']);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n\n // If the value is an object, assume the user knows what they are doing\n // and apply as directed.\n const enableBorder = enableBorderRadius || isObject(value);\n\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\n\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)),\n }\n }\n };\n}\n\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n\n return bounds\n\t\t&& (skipX || _isBetween(x, bounds.left, bounds.right))\n\t\t&& (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\n\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n\n/**\n * Add a path of a rectangle to the current sub-path\n * @param {CanvasRenderingContext2D} ctx Context\n * @param {*} rect Bounding rect\n */\nfunction addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\n\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\n\nexport default class BarElement extends Element {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n draw(ctx) {\n const {inflateAmount, options: {borderColor, backgroundColor}} = this;\n const {inner, outer} = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n\n ctx.save();\n\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n\n ctx.restore();\n }\n\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition) {\n const {x, y, base, horizontal} = /** @type {BarProps} */ (this.getProps(['x', 'y', 'base', 'horizontal'], useFinalPosition));\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n","import {DoughnutController, PolarAreaController} from '../index.js';\nimport type {Chart, ChartDataset} from '../types.js';\n\nexport interface ColorsPluginOptions {\n enabled?: boolean;\n forceOverride?: boolean;\n}\n\ninterface ColorsDescriptor {\n backgroundColor?: unknown;\n borderColor?: unknown;\n}\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)', // blue\n 'rgb(255, 99, 132)', // red\n 'rgb(255, 159, 64)', // orange\n 'rgb(255, 205, 86)', // yellow\n 'rgb(75, 192, 192)', // green\n 'rgb(153, 102, 255)', // purple\n 'rgb(201, 203, 207)' // grey\n];\n\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map(color => color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\n\nfunction getBorderColor(i: number) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\n\nfunction getBackgroundColor(i: number) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\n\nfunction colorizeDefaultDataset(dataset: ChartDataset, i: number) {\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n\n return ++i;\n}\n\nfunction colorizeDoughnutDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBorderColor(i++));\n\n return i;\n}\n\nfunction colorizePolarAreaDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBackgroundColor(i++));\n\n return i;\n}\n\nfunction getColorizer(chart: Chart) {\n let i = 0;\n\n return (dataset: ChartDataset, datasetIndex: number) => {\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n\n if (controller instanceof DoughnutController) {\n i = colorizeDoughnutDataset(dataset, i);\n } else if (controller instanceof PolarAreaController) {\n i = colorizePolarAreaDataset(dataset, i);\n } else if (controller) {\n i = colorizeDefaultDataset(dataset, i);\n }\n };\n}\n\nfunction containsColorsDefinitions(\n descriptors: ColorsDescriptor[] | Record\n) {\n let k: number | string;\n\n for (k in descriptors) {\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction containsColorsDefinition(\n descriptor: ColorsDescriptor\n) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\n\nexport default {\n id: 'colors',\n\n defaults: {\n enabled: true,\n forceOverride: false\n } as ColorsPluginOptions,\n\n beforeLayout(chart: Chart, _args, options: ColorsPluginOptions) {\n if (!options.enabled) {\n return;\n }\n\n const {\n data: {datasets},\n options: chartOptions\n } = chart.config;\n const {elements} = chartOptions;\n\n if (!options.forceOverride && (containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || (elements && containsColorsDefinitions(elements)))) {\n return;\n }\n\n const colorizer = getColorizer(chart);\n\n datasets.forEach(colorizer);\n }\n};\n","import {_limitValue, _lookupByKey, isNullOrUndef, resolve} from '../helpers/index.js';\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n /**\n * Implementation of the Largest Triangle Three Buckets algorithm.\n *\n * This implementation is based on the original implementation by Sveinn Steinarsson\n * in https://github.com/sveinn-steinarsson/flot-downsample/blob/master/jquery.flot.downsample.js\n *\n * The original implementation is MIT licensed.\n */\n const samples = options.samples || availableWidth;\n // There are less points than the threshold, returning the whole array\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n\n const decimated = [];\n\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n // Starting from offset\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n\n decimated[sampledIndex++] = data[a];\n\n for (i = 0; i < samples - 2; i++) {\n let avgX = 0;\n let avgY = 0;\n let j;\n\n // Adding offset\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n\n for (j = avgRangeStart; j < avgRangeEnd; j++) {\n avgX += data[j].x;\n avgY += data[j].y;\n }\n\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n\n // Adding offset\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const {x: pointAx, y: pointAy} = data[a];\n\n // Note that this is changed from the original algorithm which initializes these\n // values to 1. The reason for this change is that if the area is small, nextA\n // would never be set and thus a crash would occur in the next loop as `a` would become\n // `undefined`. Since the area is always positive, but could be 0 in the case of a flat trace,\n // initializing with a negative number is the correct solution.\n maxArea = area = -1;\n\n for (j = rangeOffs; j < rangeTo; j++) {\n area = 0.5 * Math.abs(\n (pointAx - avgX) * (data[j].y - pointAy) -\n (pointAx - data[j].x) * (avgY - pointAy)\n );\n\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n\n // Include the last point\n decimated[sampledIndex++] = data[endIndex];\n\n return decimated;\n}\n\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n\n for (i = start; i < start + count; ++i) {\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n // Use point.x here because we're computing the average data `x` value\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n // Push up to 4 points, 3 for the last interval and the first point for this interval\n const lastIndex = i - 1;\n\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n // The interval is defined by 4 points: start, min, max, end.\n // The starting point is already considered at this point, so we need to determine which\n // of the other points to add. We need to sort these points to ensure the decimated data\n // is still sorted and then ensure there are no duplicates.\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX,\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n\n // lastIndex === startIndex will occur when a range has only 1 point which could\n // happen with very uneven data\n if (i > 0 && lastIndex !== startIndex) {\n // Last point in the previous interval\n decimated.push(data[lastIndex]);\n }\n\n // Start of the new interval\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n\n return decimated;\n}\n\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data,\n });\n }\n}\n\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset) => {\n cleanDecimatedDataset(dataset);\n });\n}\n\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n\n let start = 0;\n let count;\n\n const {iScale} = meta;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n\n return {start, count};\n}\n\nexport default {\n id: 'decimation',\n\n defaults: {\n algorithm: 'min-max',\n enabled: false,\n },\n\n beforeElementsUpdate: (chart, args, options) => {\n if (!options.enabled) {\n // The decimation plugin may have been previously enabled. Need to remove old `dataset._data` handlers\n cleanDecimatedData(chart);\n return;\n }\n\n // Assume the entire chart is available to show a few more points than needed\n const availableWidth = chart.width;\n\n chart.data.datasets.forEach((dataset, datasetIndex) => {\n const {_data, indexAxis} = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n\n if (resolve([indexAxis, chart.options.indexAxis]) === 'y') {\n // Decimation is only supported for lines that have an X indexAxis\n return;\n }\n\n if (!meta.controller.supportsDecimation) {\n // Only line datasets are supported\n return;\n }\n\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n // Only linear interpolation is supported\n return;\n }\n\n if (chart.options.parsing) {\n // Plugin only supports data that does not need parsing\n return;\n }\n\n let {start, count} = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n // No decimation is required until we are above this threshold\n cleanDecimatedDataset(dataset);\n return;\n }\n\n if (isNullOrUndef(_data)) {\n // First time we are seeing this dataset\n // We override the 'data' property with a setter that stores the\n // raw data in _data, but reads the decimated data from _decimated\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n\n // Point the chart to the decimated data\n let decimated;\n switch (options.algorithm) {\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n\n dataset._decimated = decimated;\n });\n },\n\n destroy(chart) {\n cleanDecimatedData(chart);\n }\n};\n","import {_boundSegment, _boundSegments, _normalizeAngle} from '../../helpers/index.js';\n\nexport function _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n\n for (const segment of segments) {\n let {start, end} = segment;\n end = _findSegmentEnd(start, end, points);\n\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n\n if (!target.segments) {\n // Special case for boundary not supporting `segments` (simpleArc)\n // Bounds are provided as `target` for partial circle, or undefined for full circle\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n\n // Get all segments from `target` that intersect the bounds of current segment of `line`\n const targetSegments = _boundSegments(target, bounds);\n\n for (const tgt of targetSegments) {\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n\n for (const fillSource of fillSources) {\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\n\nexport function _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {property, start, end};\n}\n\nexport function _pointsFromSegments(boundary, line) {\n const {x = null, y = null} = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({start, end}) => {\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({x: first.x, y});\n points.push({x: last.x, y});\n } else if (x !== null) {\n points.push({x, y: first.y});\n points.push({x, y: last.y});\n }\n });\n return points;\n}\n\nexport function _findSegmentEnd(start, end, points) {\n for (;end > start; end--) {\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\n\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {isArray} from '../../helpers/index.js';\nimport {_pointsFromSegments} from './filler.segment.js';\n\n/**\n * @param {PointElement[] | { x: number; y: number; }} boundary\n * @param {LineElement} line\n * @return {LineElement?}\n */\nexport function _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n\n if (isArray(boundary)) {\n _loop = true;\n // @ts-ignore\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n\n return points.length ? new LineElement({\n points,\n options: {tension: 0},\n _loop,\n _fullLoop: _loop\n }) : null;\n}\n\nexport function _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n","import {isObject, isFinite, valueOrDefault} from '../../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.line.js').default } LineElement\n * @typedef { import('../../types/index.js').FillTarget } FillTarget\n * @typedef { import('../../types/index.js').ComplexFillTarget } ComplexFillTarget\n */\n\nexport function _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [index];\n let target;\n\n if (!propagate) {\n return fill;\n }\n\n while (fill !== false && visited.indexOf(fill) === -1) {\n if (!isFinite(fill)) {\n return fill;\n }\n\n target = sources[fill];\n if (!target) {\n return false;\n }\n\n if (target.visible) {\n return fill;\n }\n\n visited.push(fill);\n fill = target.fill;\n }\n\n return false;\n}\n\n/**\n * @param {LineElement} line\n * @param {number} index\n * @param {number} count\n */\nexport function _decodeFill(line, index, count) {\n /** @type {string | {value: number}} */\n const fill = parseFillOption(line);\n\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n\n let target = parseFloat(fill);\n\n if (isFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n\n return ['origin', 'start', 'end', 'stack', 'shape'].indexOf(fill) >= 0 && fill;\n}\n\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n\n return target;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @returns {number | null}\n */\nexport function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n // @ts-ignore\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @param {number} startValue\n * @returns {number | undefined}\n */\nexport function _getTargetValue(fill, scale, startValue) {\n let value;\n\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n // @ts-ignore\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n\n/**\n * @param {LineElement} line\n */\nfunction parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n\n if (fill === false || fill === null) {\n return false;\n }\n\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {_isBetween} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\n\n/**\n * @param {{ chart: Chart; scale: Scale; index: number; line: LineElement; }} source\n * @return {LineElement}\n */\nexport function _buildStackLine(source) {\n const {scale, index, line} = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({x: null, y: scale.bottom}, line));\n\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n for (let j = segment.start; j <= segment.end; j++) {\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({points, options: {}});\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @return {LineElement[]}\n */\nfunction getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n\n for (let i = 0; i < metas.length; i++) {\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n\n/**\n * @param {PointElement[]} points\n * @param {PointElement} sourcePoint\n * @param {LineElement[]} linesBelow\n */\nfunction addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for (let j = 0; j < linesBelow.length; j++) {\n const line = linesBelow[j];\n const {first, last, point} = findPoint(line, sourcePoint, 'x');\n\n if (!point || (first && last)) {\n continue;\n }\n if (first) {\n // First point of an segment -> need to add another point before this,\n // from next line below.\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n // In the middle of an segment, no need to add more points.\n break;\n }\n }\n }\n points.push(...postponed);\n}\n\n/**\n * @param {LineElement} line\n * @param {PointElement} sourcePoint\n * @param {string} property\n * @returns {{point?: PointElement, first?: boolean, last?: boolean}}\n */\nfunction findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {first, last, point};\n}\n","import {TAU} from '../../helpers/index.js';\n\n// TODO: use elements.ArcElement instead\nexport class simpleArc {\n constructor(opts) {\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n\n pathSegment(ctx, bounds, opts) {\n const {x, y, radius} = this;\n bounds = bounds || {start: 0, end: TAU};\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n\n interpolate(point) {\n const {x, y, radius} = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n","import {isFinite} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\nimport {_getTargetPixel, _getTargetValue} from './filler.options.js';\nimport {_buildStackLine} from './filler.target.stack.js';\nimport {simpleArc} from './simpleArc.js';\n\n/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nexport function _getTarget(source) {\n const {chart, fill, line} = source;\n\n if (isFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n\n if (fill === 'shape') {\n return true;\n }\n\n const boundary = computeBoundary(source);\n\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n\n return _createBoundaryLine(boundary, line);\n}\n\n/**\n * @param {Chart} chart\n * @param {number} index\n */\nfunction getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\n\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\n\n\nfunction computeLinearBoundary(source) {\n const {scale = {}, fill} = source;\n const pixel = _getTargetPixel(fill, scale);\n\n if (isFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n\n return null;\n}\n\nfunction computeCircularBoundary(source) {\n const {scale, fill} = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n\n for (let i = 0; i < length; ++i) {\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\n","import {clipArea, unclipArea} from '../../helpers/index.js';\nimport {_findSegmentEnd, _getBounds, _segments} from './filler.segment.js';\nimport {_getTarget} from './filler.target.js';\n\nexport function _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const {line, scale, axis} = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const {above = color, below = color} = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {line, target, above, below, area, scale, axis});\n unclipArea(ctx);\n }\n}\n\nfunction doFill(ctx, cfg) {\n const {line, target, above, below, area, scale} = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n\n ctx.save();\n\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {line, target, color: above, scale, property});\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {line, target, color: below, scale, property});\n\n ctx.restore();\n}\n\nfunction clipVertical(ctx, target, clipY) {\n const {segments, points} = target;\n let first = true;\n let lineLoop = false;\n\n ctx.beginPath();\n for (const segment of segments) {\n const {start, end} = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {move: lineLoop});\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\n\nfunction fill(ctx, cfg) {\n const {line, target, property, color, scale} = cfg;\n const segments = _segments(line, target, property);\n\n for (const {source: src, target: tgt, start, end} of segments) {\n const {style: {backgroundColor = color} = {}} = src;\n const notShape = target !== true;\n\n ctx.save();\n ctx.fillStyle = backgroundColor;\n\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n\n ctx.beginPath();\n\n const lineLoop = !!line.pathSegment(ctx, src);\n\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n\n const targetLoop = !!target.pathSegment(ctx, tgt, {move: lineLoop, reverse: true});\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n\n ctx.restore();\n }\n}\n\nfunction clipBounds(ctx, scale, bounds) {\n const {top, bottom} = scale.chart.chartArea;\n const {property, start, end} = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\n\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\n","/**\n * Plugin based on discussion from the following Chart.js issues:\n * @see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569\n * @see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897\n */\n\nimport LineElement from '../../elements/element.line.js';\nimport {_drawfill} from './filler.drawing.js';\nimport {_shouldApplyFill} from './filler.helper.js';\nimport {_decodeFill, _resolveTarget} from './filler.options.js';\n\nexport default {\n id: 'filler',\n\n afterDatasetsUpdate(chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n\n for (i = 0; i < count; ++i) {\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line,\n };\n }\n\n meta.$filler = source;\n sources.push(source);\n }\n\n for (i = 0; i < count; ++i) {\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n\n beforeDraw(chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n\n beforeDatasetsDraw(chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n\n const metasets = chart.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n\n beforeDatasetDraw(chart, args, options) {\n const source = args.meta.$filler;\n\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n","import defaults from '../core/core.defaults.js';\nimport Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {addRoundedRectPath, drawPointLegend, renderText} from '../helpers/helpers.canvas.js';\nimport {\n _isBetween,\n callback as call,\n clipArea,\n getRtlAdapter,\n overrideTextDirection,\n restoreTextDirection,\n toFont,\n toPadding,\n unclipArea,\n valueOrDefault,\n} from '../helpers/index.js';\nimport {_alignStartEnd, _textX, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {toTRBLCorners} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n */\n\nconst getBoxSize = (labelOpts, fontSize) => {\n let {boxHeight = fontSize, boxWidth = fontSize} = labelOpts;\n\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\n\nconst itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\n\nexport class Legend extends Element {\n\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this._added = false;\n\n // Contains hit boxes for each dataset (in dataset order)\n this.legendHitBoxes = [];\n\n /**\n \t\t * @private\n \t\t */\n this._hoveredItem = null;\n\n // Are we in doughnut mode which has a different data type\n this.doughnutMode = false;\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = call(labelOpts.generateLabels, [this.chart], this) || [];\n\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));\n }\n\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, this.chart.data));\n }\n\n if (this.options.reverse) {\n legendItems.reverse();\n }\n\n this.legendItems = legendItems;\n }\n\n fit() {\n const {options, ctx} = this;\n\n // The legend may not be displayed for a variety of reasons including\n // the fact that the defaults got set to `false`.\n // When the legend is not displayed, there are no guarantees that the options\n // are correctly formatted so we need to bail out as early as possible.\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const {boxWidth, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n let width, height;\n\n ctx.font = labelFont.string;\n\n if (this.isHorizontal()) {\n width = this.maxWidth; // fill all the width\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight; // fill all the height\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n\n /**\n\t * @private\n\t */\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const {ctx, maxWidth, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one\n const lineWidths = this.lineWidths = [0];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i) => {\n const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n\n hitboxes[i] = {left: 0, top, row, width: itemWidth, height: itemHeight};\n\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n\n return totalHeight;\n }\n\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const {ctx, maxHeight, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n\n let left = 0;\n let col = 0;\n\n this.legendItems.forEach((legendItem, i) => {\n const {itemWidth, itemHeight} = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n\n // If too tall, go to new column\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n\n // Store the hitbox width and height here. Final position will be updated in `draw`\n hitboxes[i] = {left, top: currentColHeight, col, width: itemWidth, height: itemHeight};\n\n // Get max width\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n\n totalWidth += currentColWidth;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n\n return totalWidth;\n }\n\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const {legendHitBoxes: hitboxes, options: {align, labels: {padding}, rtl}} = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes) {\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes) {\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n\n this._draw();\n\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @private\n\t */\n _draw() {\n const {options: opts, columnSizes, lineWidths, ctx} = this;\n const {align, labels: labelOpts} = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const {padding} = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n\n this.drawTitle();\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n\n const {boxWidth, boxHeight, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n // current position\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n\n // Set the ctx for the box\n ctx.save();\n\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n\n if (labelOpts.usePointStyle) {\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n\n // Draw pointStyle as legend symbol\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n // Draw box as legend symbol\n // Adjust position when boxHeight < fontSize (want it centered)\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n\n ctx.beginPath();\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n\n ctx.restore();\n };\n\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + (itemHeight / 2), labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n\n // Horizontal\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n\n overrideTextDirection(this.ctx, opts.textDirection);\n\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i) => {\n ctx.strokeStyle = legendItem.fontColor; // for strikethrough effect\n ctx.fillStyle = legendItem.fontColor; // render in correct colour\n\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n\n rtlHelper.setWidth(this.width);\n\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n\n const realX = rtlHelper.x(x);\n\n drawLegendBox(realX, y, legendItem);\n\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n\n // Fill the actual label\n fillText(rtlHelper.x(x), y, legendItem);\n\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n\n if (!titleOpts.display) {\n return;\n }\n\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n\n // These defaults are used when the legend is vertical.\n // When horizontal, they are computed below.\n let left = this.left;\n let maxWidth = this.width;\n\n if (this.isHorizontal()) {\n // Move left / right so that the title is above the legend lines\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n // Move down so that the title is above the legend stack in every alignment\n const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n\n // Now that we know the left edge of the inner legend box, compute the correct\n // X coordinate from the title alignment\n const x = _alignStartEnd(position, left, left + maxWidth);\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n\n /**\n\t * @private\n\t */\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n\n /**\n\t * @private\n\t */\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n\n if (_isBetween(x, this.left, this.right)\n && _isBetween(y, this.top, this.bottom)) {\n // See if we are touching one of the dataset boxes\n lh = this.legendHitBoxes;\n for (i = 0; i < lh.length; ++i) {\n hitBox = lh[i];\n\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width)\n && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n // Touching an element\n return this.legendItems[i];\n }\n }\n }\n\n return null;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t */\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n\n // Chart event already has relative position in it\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n call(opts.onLeave, [e, previous, this], this);\n }\n\n this._hoveredItem = hoveredItem;\n\n if (hoveredItem && !sameItem) {\n call(opts.onHover, [e, hoveredItem, this], this);\n }\n } else if (hoveredItem) {\n call(opts.onClick, [e, hoveredItem, this], this);\n }\n }\n}\n\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {itemWidth, itemHeight};\n}\n\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b) => a.length > b.length ? a : b);\n }\n return boxWidth + (labelFont.size / 2) + ctx.measureText(legendItemText).width;\n}\n\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\n\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\n\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\n\nexport default {\n id: 'legend',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Legend,\n\n start(chart, _args, options) {\n const legend = chart.legend = new Legend({ctx: chart.ctx, options, chart});\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n\n stop(chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n\n // During the beforeUpdate step, the layout configuration needs to run\n // This ensures that if the legend position changes (via an option update)\n // the layout system respects the change. See https://github.com/chartjs/Chart.js/issues/7527\n beforeUpdate(chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n\n // The labels need to be built after datasets are updated to ensure that colors\n // and other styling are correct. See https://github.com/chartjs/Chart.js/issues/6968\n afterUpdate(chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n\n\n afterEvent(chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n\n // a callback that will handle\n onClick(e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n\n onHover: null,\n onLeave: null,\n\n labels: {\n color: (ctx) => ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n // Generates labels shown in the legend\n // Valid properties to return:\n // text : text to display\n // fillStyle : fill of coloured box\n // strokeStyle: stroke of coloured box\n // hidden : if this legend item refers to a hidden item\n // lineCap : cap style for line\n // lineDash\n // lineDashOffset :\n // lineJoin :\n // lineWidth :\n generateLabels(chart) {\n const datasets = chart.data.datasets;\n const {labels: {usePointStyle, pointStyle, textAlign, color, useBorderRadius, borderRadius}} = chart.legend.options;\n\n return chart._getSortedDatasetMetas().map((meta) => {\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n\n // Below is extra data used for toggling the datasets\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n\n title: {\n color: (ctx) => ctx.chart.options.color,\n display: false,\n position: 'center',\n text: '',\n }\n },\n\n descriptors: {\n _scriptable: (name) => !name.startsWith('on'),\n labels: {\n _scriptable: (name) => !['generateLabels', 'filter', 'sort'].includes(name),\n }\n },\n};\n","import Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {PI, isArray, toPadding, toFont} from '../helpers/index.js';\nimport {_toLeftRightCenter, _alignStartEnd} from '../helpers/helpers.extras.js';\nimport {renderText} from '../helpers/helpers.canvas.js';\n\nexport class Title extends Element {\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight) {\n const opts = this.options;\n\n this.left = 0;\n this.top = 0;\n\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n\n _drawArgs(offset) {\n const {top, left, bottom, right, options} = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {titleX, titleY, maxWidth, rotation};\n }\n\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n\n if (!opts.display) {\n return;\n }\n\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const {titleX, titleY, maxWidth, rotation} = this._drawArgs(offset);\n\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n}\n\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\n\nexport default {\n id: 'title',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Title,\n\n start(chart, _args, options) {\n createTitle(chart, options);\n },\n\n stop(chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n\n beforeUpdate(chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold',\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000 // by default greater than legend (1000) to be above\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import {Title} from './plugin.title.js';\nimport layouts from '../core/core.layouts.js';\n\nconst map = new WeakMap();\n\nexport default {\n id: 'subtitle',\n\n start(chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n\n stop(chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n\n beforeUpdate(chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal',\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500 // by default greater than legend (1000) and smaller than title (2000)\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import Animations from '../core/core.animations.js';\nimport Element from '../core/core.element.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {each, noop, isNullOrUndef, isArray, _elementsEqual, isObject} from '../helpers/helpers.core.js';\nimport {toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\nimport {getRtlAdapter, overrideTextDirection, restoreTextDirection} from '../helpers/helpers.rtl.js';\nimport {distanceBetweenPoints, _limitValue} from '../helpers/helpers.math.js';\nimport {createContext, drawPoint} from '../helpers/index.js';\n\n/**\n * @typedef { import('../platform/platform.base.js').Chart } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').ActiveElement } ActiveElement\n * @typedef { import('../core/core.interaction.js').InteractionItem } InteractionItem\n */\n\nconst positioners = {\n /**\n\t * Average mode places the tooltip at the average position of the elements shown\n\t */\n average(items) {\n if (!items.length) {\n return false;\n }\n\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n\n return {\n x: x / count,\n y: y / count\n };\n },\n\n /**\n\t * Gets the tooltip position nearest of the item nearest to the event position\n\t */\n nearest(items, eventPosition) {\n if (!items.length) {\n return false;\n }\n\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n\n return {\n x,\n y\n };\n }\n};\n\n// Helper to push or concat based on if the 2nd parameter is an array or not\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n}\n\n/**\n * Returns array of strings split by newline\n * @param {*} str - The value to split by newline.\n * @returns {string|string[]} value if newline present - Returned from String split() method\n * @function\n */\nfunction splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n\n\n/**\n * Private helper to create a tooltip item model\n * @param {Chart} chart\n * @param {ActiveElement} item - {element, index, datasetIndex} to create the tooltip item for\n * @return new tooltip item\n */\nfunction createTooltipItem(chart, item) {\n const {element, datasetIndex, index} = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const {label, value} = controller.getLabelAndValue(index);\n\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n\n/**\n * Get the size of the tooltip\n */\nfunction getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const {body, footer, title} = tooltip;\n const {boxWidth, boxHeight} = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n\n // Count of all lines in the body\n let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight\n\t\t\t+ (titleLineCount - 1) * options.titleSpacing\n\t\t\t+ options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n // Body lines may include some extra height depending on boxHeight\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight\n\t\t\t+ (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight\n\t\t\t+ (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop\n\t\t\t+ footerLineCount * footerFont.lineHeight\n\t\t\t+ (footerLineCount - 1) * options.footerSpacing;\n }\n\n // Title width\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n\n ctx.save();\n\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n\n // Body width\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n\n // Body lines may include some extra width due to the color box\n widthPadding = options.displayColors ? (boxWidth + 2 + options.boxPadding) : 0;\n each(body, (bodyItem) => {\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n\n // Reset back to 0\n widthPadding = 0;\n\n // Footer width\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n\n ctx.restore();\n\n // Add padding\n width += padding.width;\n\n return {width, height};\n}\n\nfunction determineYAlign(chart, size) {\n const {y, height} = size;\n\n if (y < height / 2) {\n return 'top';\n } else if (y > (chart.height - height / 2)) {\n return 'bottom';\n }\n return 'center';\n}\n\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const {x, width} = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\n\nfunction determineXAlign(chart, options, size, yAlign) {\n const {x, width} = size;\n const {width: chartWidth, chartArea: {left, right}} = chart;\n let xAlign = 'center';\n\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n\n return xAlign;\n}\n\n/**\n * Helper to get the alignment of a tooltip given the size\n */\nfunction determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\n\nfunction alignX(size, xAlign) {\n let {x, width} = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= (width / 2);\n }\n return x;\n}\n\nfunction alignY(size, yAlign, paddingAndSize) {\n // eslint-disable-next-line prefer-const\n let {y, height} = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= (height / 2);\n }\n return y;\n}\n\n/**\n * Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment\n */\nfunction getBackgroundPoint(options, size, alignment, chart) {\n const {caretSize, caretPadding, cornerRadius} = options;\n const {xAlign, yAlign} = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\n\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n\n return align === 'center'\n ? tooltip.x + tooltip.width / 2\n : align === 'right'\n ? tooltip.x + tooltip.width - padding.right\n : tooltip.x + padding.left;\n}\n\n/**\n * Helper to build before and after body lines\n */\nfunction getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\n\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\n\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\n\nconst defaultCallbacks = {\n // Args are: (tooltipItems, data)\n beforeTitle: noop,\n title(tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n\n return '';\n },\n afterTitle: noop,\n\n // Args are: (tooltipItems, data)\n beforeBody: noop,\n\n // Args are: (tooltipItem, data)\n beforeLabel: noop,\n label(tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n\n let label = tooltipItem.dataset.label || '';\n\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0,\n };\n },\n labelTextColor() {\n return this.options.bodyColor;\n },\n labelPointStyle(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation,\n };\n },\n afterLabel: noop,\n\n // Args are: (tooltipItems, data)\n afterBody: noop,\n\n // Args are: (tooltipItems, data)\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n\n/**\n * Invoke callback from object with context and arguments.\n * If callback returns `undefined`, then will be invoked default callback.\n * @param {Record} callbacks\n * @param {keyof typeof defaultCallbacks} name\n * @param {*} ctx\n * @param {*} arg\n * @returns {any}\n */\nfunction invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n\n return result;\n}\n\nexport class Tooltip extends Element {\n\n /**\n * @namespace Chart.Tooltip.positioners\n */\n static positioners = positioners;\n\n constructor(config) {\n super();\n\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n // TODO: V4, make this private, rename to `_labelStyles`, and combine with `labelPointStyles`\n // and `labelTextColors` to create a single variable\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n\n /**\n\t * @private\n\t */\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n\n if (cached) {\n return cached;\n }\n\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n\n return animations;\n }\n\n /**\n\t * @protected\n\t */\n getContext() {\n return this.$context ||\n\t\t\t(this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n\n getTitle(context, options) {\n const {callbacks} = options;\n\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n\n return lines;\n }\n\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems)\n );\n }\n\n getBody(tooltipItems, options) {\n const {callbacks} = options;\n const bodyItems = [];\n\n each(tooltipItems, (context) => {\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n\n bodyItems.push(bodyItem);\n });\n\n return bodyItems;\n }\n\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems)\n );\n }\n\n // Get the footer and beforeFooter and afterFooter lines\n getFooter(tooltipItems, options) {\n const {callbacks} = options;\n\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n\n return lines;\n }\n\n /**\n\t * @private\n\t */\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n\n for (i = 0, len = active.length; i < len; ++i) {\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n\n // If the user provided a filter function, use it to modify the tooltip items\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array) => options.filter(element, index, array, data));\n }\n\n // If the user provided a sorting function, use it to modify the tooltip items\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b) => options.itemSort(a, b, data));\n }\n\n // Determine colors for boxes\n each(tooltipItems, (context) => {\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n\n if (changed && options.external) {\n options.external.call(this, {chart: this.chart, tooltip: this, replay});\n }\n }\n\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n\n getCaretPosition(tooltipPoint, size, options) {\n const {xAlign, yAlign} = this;\n const {caretSize, cornerRadius} = options;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n const {x: ptX, y: ptY} = tooltipPoint;\n const {width, height} = size;\n let x1, x2, x3, y1, y2, y3;\n\n if (yAlign === 'center') {\n y2 = ptY + (height / 2);\n\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n\n // Left draws bottom -> top, this y1 is on the bottom\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n\n // Right draws top -> bottom, thus y1 is on the top\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + (caretSize);\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n\n // Top draws left -> right, thus x1 is on the left\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n\n // Bottom draws right -> left, thus x1 is on the right\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {x1, x2, x3, y1, y2, y3};\n }\n\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.titleAlign, options);\n\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing; // Line Height and spacing\n\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing\n }\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const {boxHeight, boxWidth} = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2, // fit the circle in the box\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n\n // Fill the point with white so that colours merge nicely if the opacity is < 1\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n\n // Draw the point\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n // Border\n ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : (labelColor.borderWidth || 1); // TODO, v4 remove fallback\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n\n // Fill a white rect so that colours merge nicely if the opacity is < 1\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = toTRBLCorners(labelColor.borderRadius);\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n ctx.fill();\n ctx.stroke();\n\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n // Normal rect\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n\n // restore fillStyle\n ctx.fillStyle = this.labelTextColors[i];\n }\n\n drawBody(pt, ctx, options) {\n const {body} = this;\n const {bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding} = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n\n // Before body lines\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right'\n ? bodyAlign === 'center' ? (boxWidth / 2 + boxPadding) : (boxWidth + 2 + boxPadding)\n : 0;\n\n // Draw body lines now\n for (i = 0, ilen = body.length; i < ilen; ++i) {\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n\n lines = bodyItem.lines;\n // Draw Legend-like boxes if needed\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n\n for (j = 0, jlen = lines.length; j < jlen; ++j) {\n fillLineOfText(lines[j]);\n // Reset for any lines that don't include colorbox\n bodyLineHeight = bodyFont.lineHeight;\n }\n\n each(bodyItem.after, fillLineOfText);\n }\n\n // Reset back to 0 for after body\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n\n // After body lines\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing; // Remove last body spacing\n }\n\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n\n footerFont = toFont(options.footerFont);\n\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n\n drawBackground(pt, ctx, tooltipSize, options) {\n const {xAlign, yAlign} = this;\n const {x, y} = pt;\n const {width, height} = tooltipSize;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(options.cornerRadius);\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n\n ctx.fill();\n\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n\n /**\n\t * Update x/y animation targets when _active elements are animating too\n\t * @private\n\t */\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n\n /**\n * Determine if the tooltip will draw anything\n * @returns {boolean} True if the tooltip will render\n */\n _willRender() {\n return !!this.opacity;\n }\n\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n\n if (!opacity) {\n return;\n }\n\n this._updateAnimationTarget(options);\n\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n\n // IE11/Edge does not like very small opacities, so snap to 0\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n\n const padding = toPadding(options.padding);\n\n // Truthy/falsey value for empty tooltip\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n\n // Draw Background\n this.drawBackground(pt, ctx, tooltipSize, options);\n\n overrideTextDirection(ctx, options.textDirection);\n\n pt.y += padding.top;\n\n // Titles\n this.drawTitle(pt, ctx, options);\n\n // Body\n this.drawBody(pt, ctx, options);\n\n // Footer\n this.drawFooter(pt, ctx, options);\n\n restoreTextDirection(ctx, options.textDirection);\n\n ctx.restore();\n }\n }\n\n /**\n\t * Get active elements in the tooltip\n\t * @returns {Array} Array of elements that are active in the tooltip\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active elements in the tooltip\n\t * @param {array} activeElements Array of active datasetIndex/index pairs.\n\t * @param {object} eventPosition Synthetic event position used in positioning\n\t */\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.chart.getDatasetMeta(datasetIndex);\n\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {boolean} true if the tooltip changed\n\t */\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n\n // When there are multiple items shown, but the tooltip position is nearest mode\n // an update may need to be made because our position may have changed even though\n // the items are the same as before.\n const positionChanged = this._positionChanged(active, e);\n\n // Remember Last Actives\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n\n // Only handle target event on tooltip change\n if (changed) {\n this._active = active;\n\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n\n this.update(true, replay);\n }\n }\n\n return changed;\n }\n\n /**\n\t * Helper for determining the active elements for event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {InteractionItem[]} lastActive - Previously active elements\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {InteractionItem[]} - Active elements\n\t * @private\n\t */\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n return lastActive;\n }\n\n // Find Active Elements for tooltips\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n\n if (options.reverse) {\n active.reverse();\n }\n\n return active;\n }\n\n /**\n\t * Determine if the active elements + event combination changes the\n\t * tooltip position\n\t * @param {array} active - Active elements\n\t * @param {ChartEvent} e - Event that triggered the position change\n\t * @returns {boolean} True if the position has changed\n\t */\n _positionChanged(active, e) {\n const {caretX, caretY, options} = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\n\nexport default {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n\n afterInit(chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({chart, options});\n }\n },\n\n beforeUpdate(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n reset(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n afterDraw(chart) {\n const tooltip = chart.tooltip;\n\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n\n if (chart.notifyPlugins('beforeTooltipDraw', {...args, cancelable: true}) === false) {\n return;\n }\n\n tooltip.draw(chart.ctx);\n\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n\n afterEvent(chart, args) {\n if (chart.tooltip) {\n // If the event is replayed from `update`, we should evaluate with the final positions.\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n // notify chart about the change, so it will render\n args.changed = true;\n }\n }\n },\n\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold',\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {\n },\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold',\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts) => opts.bodyFont.size,\n boxWidth: (ctx, opts) => opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart',\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'width', 'height', 'caretX', 'caretY'],\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n\n descriptors: {\n _scriptable: (name) => name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false,\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n\n // Resolve additionally from `interaction` options and defaults.\n additionalOptionScopes: ['interaction']\n};\n","import Scale from '../core/core.scale.js';\nimport {isNullOrUndef, valueOrDefault, _limitValue} from '../helpers/index.js';\n\nconst addIfString = (labels, raw, index, addedLabels) => {\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({index, label: raw});\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\n\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\n\nconst validIndex = (index, max) => index === null ? null : _limitValue(Math.round(index), 0, max);\n\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\n\nexport default class CategoryScale extends Scale {\n\n static id = 'category';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const {index, label} of added) {\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index\n : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n\n determineDataLimits() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this.getMinMax(true);\n\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n\n // If we are viewing some subset of labels, slice the original array\n labels = (min === 0 && max === labels.length - 1) ? labels : labels.slice(min, max + 1);\n\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n\n for (let value = min; value <= max; value++) {\n ticks.push({value});\n }\n return ticks;\n }\n\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n super.configure();\n\n if (!this.isHorizontal()) {\n // For backward compatibility, vertical category scale reverse is inverted.\n this._reversePixels = !this._reversePixels;\n }\n }\n\n // Used to get data value locations. Value can either be an index or a numerical value\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n // Must override base implementation because it calls getPixelForValue\n // and category scale can have duplicate values\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n\n getBasePixel() {\n return this.bottom;\n }\n}\n","import {isNullOrUndef} from '../helpers/helpers.core.js';\nimport {almostEquals, almostWhole, niceNum, _decimalPlaces, _setMinAndMaxByKey, sign, toRadians} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\n\n/**\n * Generate a set of linear ticks for an axis\n * 1. If generationOptions.min, generationOptions.max, and generationOptions.step are defined:\n * if (max - min) / step is an integer, ticks are generated as [min, min + step, ..., max]\n * Note that the generationOptions.maxCount setting is respected in this scenario\n *\n * 2. If generationOptions.min, generationOptions.max, and generationOptions.count is defined\n * spacing = (max - min) / count\n * Ticks are generated as [min, min + spacing, ..., max]\n *\n * 3. If generationOptions.count is defined\n * spacing = (niceMax - niceMin) / count\n *\n * 4. Compute optimal spacing of ticks using niceNum algorithm\n *\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, dataRange) {\n const ticks = [];\n // To get a \"nice\" value for the tick spacing, we will use the appropriately named\n // \"nice number\" algorithm. See https://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks\n // for details.\n\n const MIN_SPACING = 1e-14;\n const {bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds} = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const {min: rmin, max: rmax} = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n\n // Beyond MIN_SPACING floating point numbers being to lose precision\n // such that we can't do the math necessary to generate ticks\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [{value: rmin}, {value: rmax}];\n }\n\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n // If the calculated num of spaces exceeds maxNumSpaces, recalculate it\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n\n if (!isNullOrUndef(precision)) {\n // If the user specified a precision, round to that number of decimal places\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n // Case 1: If min, max and stepSize are set and they make an evenly spaced scale use it.\n // spacing = step;\n // numSpaces = (max - min) / spacing;\n // Note that we round here to handle the case where almostWhole translated an FP error\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n // Cases 2 & 3, we have a count specified. Handle optional user defined edges to the range.\n // Sometimes these are no-ops, but it makes the code a lot clearer\n // and when a user defined range is specified, we want the correct ticks\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n // Case 4\n numSpaces = (niceMax - niceMin) / spacing;\n\n // If very close to our rounded value, use it.\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n\n // The spacing will have changed in cases 1, 2, and 3 so the factor cannot be computed\n // until this point\n const decimalPlaces = Math.max(\n _decimalPlaces(spacing),\n _decimalPlaces(niceMin)\n );\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({value: min});\n\n if (niceMin < min) {\n j++; // Skip niceMin\n }\n // If the next nice tick is close to min, skip it\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n\n for (; j < numSpaces; ++j) {\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) {\n break;\n }\n ticks.push({value: tickValue});\n }\n\n if (maxDefined && includeBounds && niceMax !== max) {\n // If the previous tick is too close to max, replace it with max, else add max\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({value: max});\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({value: niceMax});\n }\n\n return ticks;\n}\n\nfunction relativeLabelSize(value, minSpacing, {horizontal, minRotation}) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\n\nexport default class LinearScaleBase extends Scale {\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n /** @type {number} */\n this._endValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n\n return +raw;\n }\n\n handleTickRangeOptions() {\n const {beginAtZero} = this.options;\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n\n setMax(max + offset);\n\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n\n getTickLimit() {\n const tickOpts = this.options.ticks;\n // eslint-disable-next-line prefer-const\n let {maxTicksLimit, stepSize} = tickOpts;\n let maxTicks;\n\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n\n return maxTicks;\n }\n\n /**\n\t * @protected\n\t */\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n // Figure out what the max number of ticks we can support it is based on the size of\n // the axis area. For now, we say that the minimum tick spacing in pixels must be 40\n // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n // the graph. Make sure we always have at least 2 ticks\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks(numericGeneratorOptions, dataRange);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n\n super.configure();\n\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n","import {isFinite} from '../helpers/helpers.core.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {toRadians} from '../helpers/index.js';\n\nexport default class LinearScale extends LinearScaleBase {\n\n static id = 'linear';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? min : 0;\n this.max = isFinite(max) ? max : 1;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n \t */\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n\n // Utils\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n","import {finiteOrDefault, isFinite} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {_setMinAndMaxByKey, log10} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\n\nconst log10Floor = v => Math.floor(log10(v));\nconst changeExponent = (v, m) => Math.pow(10, log10Floor(v) + m);\n\nfunction isMajor(tickVal) {\n const remain = tickVal / (Math.pow(10, log10Floor(tickVal)));\n return remain === 1;\n}\n\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\n\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while (steps(min, max, rangeExp) > 10) {\n rangeExp++;\n }\n while (steps(min, max, rangeExp) < 10) {\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n\n\n/**\n * Generate a set of logarithmic ticks\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, {min, max}) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while (value < max) {\n ticks.push({value, major: isMajor(value), significand});\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({value: lastTick, major: isMajor(lastTick), significand});\n\n return ticks;\n}\n\nexport default class LogarithmicScale extends Scale {\n\n static id = 'logarithmic';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [raw, index]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isFinite(value) && value > 0 ? value : null;\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? Math.max(0, min) : null;\n this.max = isFinite(max) ? Math.max(0, max) : null;\n\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n\n // if data has `0` in it or `beginAtZero` is true, min (non zero) value is at bottom\n // of scale, and it does not equal suggestedMin, lower the min bound by one exp.\n if (this._zero && this.min !== this._suggestedMin && !isFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n\n this.handleTickRangeOptions();\n }\n\n handleTickRangeOptions() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (min === max) {\n if (min <= 0) { // includes null\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n\n setMax(changeExponent(min, +1));\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const opts = this.options;\n\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value === undefined\n ? '0'\n : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const start = this.min;\n\n super.configure();\n\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min\n ? 0\n : (log10(value) - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n","import defaults from '../core/core.defaults.js';\nimport {_longestText, addRoundedRectPath, renderText, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport {HALF_PI, TAU, toDegrees, toRadians, _normalizeAngle, PI} from '../helpers/helpers.math.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {valueOrDefault, isArray, isFinite, callback as callCallback, isNullOrUndef} from '../helpers/helpers.core.js';\nimport {createContext, toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\n\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [label];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\n\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - (size / 2),\n end: pos + (size / 2)\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n\n return {\n start: pos,\n end: pos + size\n };\n}\n\n/**\n * Helper function to fit a radial linear scale with point labels\n */\nfunction fitWithPointLabels(scale) {\n\n // Right, this is really confusing and there is a lot of maths going on here\n // The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n //\n // Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n //\n // Solution:\n //\n // We assume the radius of the polygon is half the size of the canvas at first\n // at each index we check if the text overlaps.\n //\n // Where it does, we store that angle and that index.\n //\n // After finding the largest index and angle we calculate how much we need to remove\n // from the shape radius to move the point inwards by that x.\n //\n // We average the left and right distances to get the maximum shape radius that can fit in the box\n // along with labels.\n //\n // Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n // on each side, removing that from the size, halving it and adding the left x protrusion width.\n //\n // This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n // and position it in the most space efficient manner\n //\n // https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n\n // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n\n for (let i = 0; i < valueCount; i++) {\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n\n scale.setCenterPoint(\n orig.l - limits.l,\n limits.r - orig.r,\n orig.t - limits.t,\n limits.b - orig.b\n );\n\n // Now that text size is determined, compute the full positions\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\n\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\n\nfunction createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const {extra, additionalAngle, padding, size} = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n // if to draw or overlapped\n visible: true,\n\n // Text position\n x: pointLabelPosition.x,\n y,\n\n // Text rendering data\n textAlign,\n\n // Bounding box\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\n\nfunction isNotOverlapped(item, area) {\n if (!area) {\n return true;\n }\n const {left, top, right, bottom} = item;\n const apexesInArea = _isPointInArea({x: left, y: top}, area) || _isPointInArea({x: left, y: bottom}, area) ||\n _isPointInArea({x: right, y: top}, area) || _isPointInArea({x: right, y: bottom}, area);\n return !apexesInArea;\n}\n\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const {centerPointLabels, display} = opts.pointLabels;\n const itemOpts = {\n extra: getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? PI / valueCount : 0\n };\n let area;\n\n for (let i = 0; i < valueCount; i++) {\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n\n const item = createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === 'auto') {\n item.visible = isNotOverlapped(item, area);\n if (item.visible) {\n area = item;\n }\n }\n }\n return items;\n}\n\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n\n return 'right';\n}\n\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= (w / 2);\n }\n return x;\n}\n\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= (h / 2);\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\n\nfunction drawPointLabelBox(ctx, opts, item) {\n const {left, top, right, bottom} = item;\n const {backdropColor} = opts;\n\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(opts.borderRadius);\n const padding = toPadding(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n}\n\nfunction drawPointLabels(scale, labelCount) {\n const {ctx, options: {pointLabels}} = scale;\n\n for (let i = labelCount - 1; i >= 0; i--) {\n const item = scale._pointLabelItems[i];\n if (!item.visible) {\n // overlapping\n continue;\n }\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = toFont(optsAtIndex.font);\n const {x, y, textAlign} = item;\n\n renderText(\n ctx,\n scale._pointLabels[i],\n x,\n y + (plFont.lineHeight / 2),\n plFont,\n {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n }\n );\n }\n}\n\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const {ctx} = scale;\n if (circular) {\n // Draw circular arcs between the points\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n // Draw straight lines connecting each index\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n\n for (let i = 1; i < labelCount; i++) {\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\n\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n\n const {color, lineWidth} = gridLineOpts;\n\n if ((!circular && !labelCount) || !color || !lineWidth || radius < 0) {\n return;\n }\n\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\n\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\n\nexport default class RadialLinearScale extends LinearScaleBase {\n\n static id = 'radialLinear';\n\n /**\n * @type {any}\n */\n static defaults = {\n display: true,\n\n // Boolean - Whether to animate scaling the chart from the centre\n animate: true,\n position: 'chartArea',\n\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n\n grid: {\n circular: false\n },\n\n startAngle: 0,\n\n // label settings\n ticks: {\n // Boolean - Show a backdrop to the scale label\n showLabelBackdrop: true,\n\n callback: Ticks.formatters.numeric\n },\n\n pointLabels: {\n backdropColor: undefined,\n\n // Number - The backdrop padding above & below the label in pixels\n backdropPadding: 2,\n\n // Boolean - if true, show point labels\n display: true,\n\n // Number - Point label font size in pixels\n font: {\n size: 10\n },\n\n // Function - Used to convert point labels\n callback(label) {\n return label;\n },\n\n // Number - Additionl padding between scale and pointLabel\n padding: 5,\n\n // Boolean - if true, center point labels to slices in polar chart\n centerPointLabels: false\n }\n };\n\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.xCenter = undefined;\n /** @type {number} */\n this.yCenter = undefined;\n /** @type {number} */\n this.drawingArea = undefined;\n /** @type {string[]} */\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(false);\n\n this.min = isFinite(min) && !isNaN(min) ? min : 0;\n this.max = isFinite(max) && !isNaN(max) ? max : 0;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n\t */\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n\n // Point labels\n this._pointLabels = this.getLabels()\n .map((value, index) => {\n const label = callCallback(this.options.pointLabels.callback, [value, index], this);\n return label || label === 0 ? label : '';\n })\n .filter((v, i) => this.chart.getDataVisibility(i));\n }\n\n fit() {\n const opts = this.options;\n\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n\n // Take into account half font size + the yPadding of the top value\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n\n getPointLabelPosition(index) {\n const {left, top, right, bottom} = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom,\n };\n }\n\n /**\n\t * @protected\n\t */\n drawBackground() {\n const {backgroundColor, grid: {circular}} = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const {angleLines, grid, border} = opts;\n const labelCount = this._pointLabels.length;\n\n let i, offset, position;\n\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n\n if (grid.display) {\n this.ticks.forEach((tick, index) => {\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n\n if (angleLines.display) {\n ctx.save();\n\n for (i = labelCount - 1; i >= 0; i--) {\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const {color, lineWidth} = optsAtIndex;\n\n if (!lineWidth || !color) {\n continue;\n }\n\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {}\n\n /**\n\t * @protected\n\t */\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n if (!tickOpts.display) {\n return;\n }\n\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n\n this.ticks.forEach((tick, index) => {\n if (index === 0 && !opts.reverse) {\n return;\n }\n\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(\n -width / 2 - padding.left,\n -offset - tickFont.size / 2 - padding.top,\n width + padding.width,\n tickFont.size + padding.height\n );\n }\n\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth,\n });\n });\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {}\n}\n","import adapters from '../core/core.adapters.js';\nimport {callback as call, isFinite, isNullOrUndef, mergeIf, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toRadians, isNumber, _limitValue} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {_arrayUnique, _filterBetween, _lookup} from '../helpers/helpers.collection.js';\n\n/**\n * @typedef { import('../core/core.adapters.js').TimeUnit } Unit\n * @typedef {{common: boolean, size: number, steps?: number}} Interval\n * @typedef { import('../core/core.adapters.js').DateAdapter } DateAdapter\n */\n\n/**\n * @type {Object}\n */\nconst INTERVALS = {\n millisecond: {common: true, size: 1, steps: 1000},\n second: {common: true, size: 1000, steps: 60},\n minute: {common: true, size: 60000, steps: 60},\n hour: {common: true, size: 3600000, steps: 24},\n day: {common: true, size: 86400000, steps: 30},\n week: {common: false, size: 604800000, steps: 4},\n month: {common: true, size: 2.628e9, steps: 12},\n quarter: {common: false, size: 7.884e9, steps: 4},\n year: {common: true, size: 3.154e10}\n};\n\n/**\n * @type {Unit[]}\n */\nconst UNITS = /** @type Unit[] */ /* #__PURE__ */ (Object.keys(INTERVALS));\n\n/**\n * @param {number} a\n * @param {number} b\n */\nfunction sorter(a, b) {\n return a - b;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {*} input\n * @return {number}\n */\nfunction parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n\n const adapter = scale._adapter;\n const {parser, round, isoWeekday} = scale._parseOpts;\n let value = input;\n\n if (typeof parser === 'function') {\n value = parser(value);\n }\n\n // Only parse if it's not a timestamp already\n if (!isFinite(value)) {\n value = typeof parser === 'string'\n ? adapter.parse(value, /** @type {Unit} */ (parser))\n : adapter.parse(value);\n }\n\n if (value === null) {\n return null;\n }\n\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true)\n ? adapter.startOf(value, 'isoWeek', isoWeekday)\n : adapter.startOf(value, round);\n }\n\n return +value;\n}\n\n/**\n * Figures out what unit results in an appropriate number of auto-generated ticks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @param {number} capacity\n * @return {object}\n */\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n\n for (let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n\n return UNITS[ilen - 1];\n}\n\n/**\n * Figures out what unit to format a set of ticks with\n * @param {TimeScale} scale\n * @param {number} numTicks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @return {Unit}\n */\nfunction determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for (let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n\n/**\n * @param {Unit} unit\n * @return {object}\n */\nfunction determineMajorUnit(unit) {\n for (let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n\n/**\n * @param {object} ticks\n * @param {number} time\n * @param {number[]} [timestamps] - if defined, snap to these timestamps\n */\nfunction addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const {lo, hi} = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n\n/**\n * @param {TimeScale} scale\n * @param {object[]} ticks\n * @param {object} map\n * @param {Unit} majorUnit\n * @return {object[]}\n */\nfunction setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n\n for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {number[]} values\n * @param {Unit|undefined} [majorUnit]\n * @return {object[]}\n */\nfunction ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n /** @type {Object} */\n const map = {};\n const ilen = values.length;\n let i, value;\n\n for (i = 0; i < ilen; ++i) {\n value = values[i];\n map[value] = i;\n\n ticks.push({\n value,\n major: false\n });\n }\n\n // We set the major ticks separately from the above loop because calling startOf for every tick\n // is expensive when there is a large number of ticks\n return (ilen === 0 || !majorUnit) ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\n\nexport default class TimeScale extends Scale {\n\n static id = 'time';\n\n /**\n * @type {any}\n */\n static defaults = {\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 2.7.0\n */\n bounds: 'data',\n\n adapters: {},\n time: {\n parser: false, // false == a pattern string from or a custom callback that converts its argument to a timestamp\n unit: false, // false == automatic or override with week, month, year, etc.\n round: false, // none, or override with week, month, year, etc.\n isoWeekday: false, // override week start day\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n /**\n * Ticks generation input values:\n * - 'auto': generates \"optimal\" ticks based on scale size and time options.\n * - 'data': generates ticks from data (including labels from data {t|x|y} objects).\n * - 'labels': generates ticks from user given `data.labels` values ONLY.\n * @see https://github.com/chartjs/Chart.js/pull/4507\n * @since 2.7.0\n */\n source: 'auto',\n\n callback: false,\n\n major: {\n enabled: false\n }\n }\n };\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {{data: number[], labels: number[], all: number[]}} */\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n\n /** @type {Unit} */\n this._unit = 'day';\n /** @type {Unit=} */\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n /** @type {DateAdapter} */\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n\n adapter.init(opts);\n\n // Backward compatibility: before introducing adapter, `displayFormats` was\n // supposed to contain *all* unit/string pairs but this can't be resolved\n // when loading the scale (adapters are loaded afterward), so let's populate\n // missing formats on update\n mergeIf(time.displayFormats, adapter.formats());\n\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n\n super.init(scaleOpts);\n\n this._normalized = opts.normalized;\n }\n\n /**\n\t * @param {*} raw\n\t * @param {number?} [index]\n\t * @return {number}\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n // eslint-disable-next-line prefer-const\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n\n /**\n\t\t * @param {object} bounds\n\t\t */\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n\n // If we have user provided `min` and `max` labels / data bounds can be ignored\n if (!minDefined || !maxDefined) {\n // Labels are always considered, when user did not force bounds\n _applyBounds(this._getLabelBounds());\n\n // If `bounds` is `'ticks'` and `ticks.source` is `'labels'`,\n // data bounds are ignored (and don't need to be determined)\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n\n min = isFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n\n // Make sure that max is strictly higher than min (required by the timeseries lookup table)\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n\n /**\n\t * @private\n\t */\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {min, max};\n }\n\n /**\n\t * @return {object[]}\n\t */\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n\n const min = this.min;\n const max = this.max;\n\n const ticks = _filterBetween(timestamps, min, max);\n\n // PRIVATE\n // determineUnitForFormatting relies on the number of ticks so we don't use it when\n // autoSkip is enabled because we don't yet know what the final number of ticks will be\n this._unit = timeOpts.unit || (tickOpts.autoSkip\n ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min))\n : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined\n : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n\n if (options.reverse) {\n ticks.reverse();\n }\n\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n\n afterAutoSkip() {\n // Offsets for bar charts need to be handled with the auto skipped\n // ticks. Once ticks have been skipped, we re-compute the offsets.\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map(tick => +tick.value));\n }\n }\n\n /**\n\t * Returns the start and end offsets from edges in the form of {start, end}\n\t * where each value is a relative width to the scale and ranges between 0 and 1.\n\t * They add extra margins on the both sides by scaling down the original scale.\n\t * Offsets are added when the `offset` option is true.\n\t * @param {number[]} timestamps\n\t * @protected\n\t */\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n\n this._offsets = {start, end, factor: 1 / (start + 1 + end)};\n }\n\n /**\n\t * Generates a maximum of `capacity` timestamps between min and max, rounded to the\n\t * `minor` unit using the given scale time `options`.\n\t * Important: this method can return ticks outside the min and max range, it's the\n\t * responsibility of the calling code to clamp values if needed.\n\t * @protected\n\t */\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n // @ts-ignore\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n\n // For 'week' unit, handle the first day of week option\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n\n // Align first ticks on unit\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n\n // Prevent browser from freezing in case user options request millions of milliseconds\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) {\n addTick(ticks, time, timestamps);\n }\n\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n\n // @ts-ignore\n return Object.keys(ticks).sort(sorter).map(x => +x);\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n\n /**\n\t * @param {number} value\n\t * @param {string|undefined} format\n\t * @return {string}\n\t */\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n\n /**\n\t * Function to format an individual tick mark\n\t * @param {number} time\n\t * @param {number} index\n\t * @param {object[]} ticks\n\t * @param {string|undefined} [format]\n\t * @return {string}\n\t * @private\n\t */\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n\n if (formatter) {\n return call(formatter, [time, index, ticks], this);\n }\n\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n\n /**\n\t * @param {object[]} ticks\n\t */\n generateTickLabels(ticks) {\n let i, ilen, tick;\n\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n\n /**\n\t * @param {string} label\n\t * @return {{w:number, h:number}}\n\t * @private\n\t */\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n\n return {\n w: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation),\n h: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation)\n };\n }\n\n /**\n\t * @param {number} exampleTime\n\t * @return {number}\n\t * @private\n\t */\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n\n // pick the longest format (milliseconds) for guesstimation\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [exampleTime], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n // subtract 1 - if offset then there's one less label than tick\n // if not offset then one half label padding is added to each end leaving room for one less label\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n\n /**\n\t * @protected\n\t */\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const metas = this.getMatchingVisibleMetas();\n\n if (this._normalized && metas.length) {\n return (this._cache.data = metas[0].controller.getAllParsedValues(this));\n }\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n\n return (this._cache.data = this.normalize(timestamps));\n }\n\n /**\n\t * @protected\n\t */\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const labels = this.getLabels();\n for (i = 0, ilen = labels.length; i < ilen; ++i) {\n timestamps.push(parse(this, labels[i]));\n }\n\n return (this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps));\n }\n\n /**\n\t * @param {number[]} values\n\t * @protected\n\t */\n normalize(values) {\n // It seems to be somewhat faster to do sorting first\n return _arrayUnique(values.sort(sorter));\n }\n}\n","import TimeScale from './scale.time.js';\nimport {_lookupByKey} from '../helpers/helpers.collection.js';\n\n/**\n * Linearly interpolates the given source `val` using the table. If value is out of bounds, values\n * at edges are used for the interpolation.\n * @param {object} table\n * @param {number} val\n * @param {boolean} [reverse] lookup time based on position instead of vice versa\n * @return {object}\n */\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({lo, hi} = _lookupByKey(table, 'pos', val));\n }\n ({pos: prevSource, time: prevTarget} = table[lo]);\n ({pos: nextSource, time: nextTarget} = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({lo, hi} = _lookupByKey(table, 'time', val));\n }\n ({time: prevSource, pos: prevTarget} = table[lo]);\n ({time: nextSource, pos: nextTarget} = table[hi]);\n }\n\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\n\nclass TimeSeriesScale extends TimeScale {\n\n static id = 'timeseries';\n\n /**\n * @type {any}\n */\n static defaults = TimeScale.defaults;\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {object[]} */\n this._table = [];\n /** @type {number} */\n this._minPos = undefined;\n /** @type {number} */\n this._tableRange = undefined;\n }\n\n /**\n\t * @protected\n\t */\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n\n /**\n\t * Returns an array of {time, pos} objects used to interpolate a specific `time` or position\n\t * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is\n\t * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other\n\t * extremity (left + width or top + height). Note that it would be more optimized to directly\n\t * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need\n\t * to create the lookup table. The table ALWAYS contains at least two items: min and max.\n\t * @param {number[]} timestamps\n\t * @return {object[]}\n\t * @protected\n\t */\n buildLookupTable(timestamps) {\n const {min, max} = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n\n for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n\n if (items.length < 2) {\n // In case there is less that 2 timestamps between min and max, the scale is defined by min and max\n return [\n {time: min, pos: 0},\n {time: max, pos: 1}\n ];\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n\n // only add points that breaks the scale linearity\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({time: curr, pos: i / (ilen - 1)});\n }\n }\n return table;\n }\n\n /**\n * Generates all timestamps defined in the data.\n * Important: this method can return ticks outside the min and max range, it's the\n * responsibility of the calling code to clamp values if needed.\n * @protected\n */\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) {\n timestamps.splice(0, 0, min);\n }\n if (!timestamps.includes(max) || timestamps.length === 1) {\n timestamps.push(max);\n }\n return timestamps.sort((a, b) => a - b);\n }\n\n /**\n\t * Returns all timestamps\n\t * @return {number[]}\n\t * @private\n\t */\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n // If combining labels and data (data might not contain all labels),\n // we need to recheck uniqueness and sort\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n\n return timestamps;\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\n\nexport default TimeSeriesScale;\n","export * from './controllers/index.js';\nexport * from './core/index.js';\nexport * from './elements/index.js';\nexport * from './platform/index.js';\nexport * from './plugins/index.js';\nexport * from './scales/index.js';\n\nimport * as controllers from './controllers/index.js';\nimport * as elements from './elements/index.js';\nimport * as plugins from './plugins/index.js';\nimport * as scales from './scales/index.js';\n\nexport {\n controllers,\n elements,\n plugins,\n scales,\n};\n\nexport const registerables = [\n controllers,\n elements,\n plugins,\n scales,\n];\n","export function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });\n } else obj[key] = value;\n\n return obj;\n}\nexport { _define_property as _ };\n","/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */\nimport { Color } from '@kurkle/color';\n\n/**\n * @namespace Chart.helpers\n */ /**\n * An empty function that can be used, for example, for optional callback.\n */ function noop() {\n/* noop */ }\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */ const uid = (()=>{\n let id = 0;\n return ()=>id++;\n})();\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isNullOrUndef(value) {\n return value === null || typeof value === 'undefined';\n}\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */ function isArray(value) {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isObject(value) {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */ function isNumberFinite(value) {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */ function finiteOrDefault(value, defaultValue) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */ function valueOrDefault(value, defaultValue) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\nconst toPercentage = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 : +value / dimension;\nconst toDimension = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 * dimension : +value;\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */ function callback(fn, args, thisArg) {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\nfunction each(loopable, fn, thisArg, reverse) {\n let i, len, keys;\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for(i = len - 1; i >= 0; i--){\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */ function _elementsEqual(a0, a1) {\n let i, ilen, v0, v1;\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n for(i = 0, ilen = a0.length; i < ilen; ++i){\n v0 = a0[i];\n v1 = a1[i];\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n return true;\n}\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */ function clone(source) {\n if (isArray(source)) {\n return source.map(clone);\n }\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n for(; k < klen; ++k){\n target[keys[k]] = clone(source[keys[k]]);\n }\n return target;\n }\n return source;\n}\nfunction isValidKey(key) {\n return [\n '__proto__',\n 'prototype',\n 'constructor'\n ].indexOf(key) === -1;\n}\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */ function _merger(key, target, source, options) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone(sval);\n }\n}\nfunction merge(target, source, options) {\n const sources = isArray(source) ? source : [\n source\n ];\n const ilen = sources.length;\n if (!isObject(target)) {\n return target;\n }\n options = options || {};\n const merger = options.merger || _merger;\n let current;\n for(let i = 0; i < ilen; ++i){\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n const keys = Object.keys(current);\n for(let k = 0, klen = keys.length; k < klen; ++k){\n merger(keys[k], target, current, options);\n }\n }\n return target;\n}\nfunction mergeIf(target, source) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge(target, source, {\n merger: _mergerIf\n });\n}\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */ function _mergerIf(key, target, source) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone(sval);\n }\n}\n/**\n * @private\n */ function _deprecated(scope, value, previous, current) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous + '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': (v)=>v,\n // default resolvers\n x: (o)=>o.x,\n y: (o)=>o.y\n};\n/**\n * @private\n */ function _splitKey(key) {\n const parts = key.split('.');\n const keys = [];\n let tmp = '';\n for (const part of parts){\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\nfunction _getKeyResolver(key) {\n const keys = _splitKey(key);\n return (obj)=>{\n for (const k of keys){\n if (k === '') {\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\nfunction resolveObjectKey(obj, key) {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n/**\n * @private\n */ function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst defined = (value)=>typeof value !== 'undefined';\nconst isFunction = (value)=>typeof value === 'function';\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nconst setsEqual = (a, b)=>{\n if (a.size !== b.size) {\n return false;\n }\n for (const item of a){\n if (!b.has(item)) {\n return false;\n }\n }\n return true;\n};\n/**\n * @param e - The event\n * @private\n */ function _isClickEvent(e) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */ const PI = Math.PI;\nconst TAU = 2 * PI;\nconst PITAU = TAU + PI;\nconst INFINITY = Number.POSITIVE_INFINITY;\nconst RAD_PER_DEG = PI / 180;\nconst HALF_PI = PI / 2;\nconst QUARTER_PI = PI / 4;\nconst TWO_THIRDS_PI = PI * 2 / 3;\nconst log10 = Math.log10;\nconst sign = Math.sign;\nfunction almostEquals(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n}\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */ function niceNum(range) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */ function _factorize(value) {\n const result = [];\n const sqrt = Math.sqrt(value);\n let i;\n for(i = 1; i < sqrt; i++){\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) {\n result.push(sqrt);\n }\n result.sort((a, b)=>a - b).pop();\n return result;\n}\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction almostWhole(x, epsilon) {\n const rounded = Math.round(x);\n return rounded - epsilon <= x && rounded + epsilon >= x;\n}\n/**\n * @private\n */ function _setMinAndMaxByKey(array, target, property) {\n let i, ilen, value;\n for(i = 0, ilen = array.length; i < ilen; i++){\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\nfunction toRadians(degrees) {\n return degrees * (PI / 180);\n}\nfunction toDegrees(radians) {\n return radians * (180 / PI);\n}\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */ function _decimalPlaces(x) {\n if (!isNumberFinite(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while(Math.round(x * e) / e !== x){\n e *= 10;\n p++;\n }\n return p;\n}\n// Gets the angle from vertical upright to the point about a centre.\nfunction getAngleFromPoint(centrePoint, anglePoint) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n if (angle < -0.5 * PI) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\nfunction distanceBetweenPoints(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */ function _angleDiff(a, b) {\n return (a - b + PITAU) % TAU - PI;\n}\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */ function _normalizeAngle(a) {\n return (a % TAU + TAU) % TAU;\n}\n/**\n * @private\n */ function _angleBetween(angle, start, end, sameAngleIsFullCircle) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle;\n}\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */ function _limitValue(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n/**\n * @param {number} value\n * @private\n */ function _int16Range(value) {\n return _limitValue(value, -32768, 32767);\n}\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */ function _isBetween(value, start, end, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n\nfunction _lookup(table, value, cmp) {\n cmp = cmp || ((index)=>table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid;\n while(hi - lo > 1){\n mid = lo + hi >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return {\n lo,\n hi\n };\n}\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */ const _lookupByKey = (table, key, value, last)=>_lookup(table, value, last ? (index)=>{\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n } : (index)=>table[index][key] < value);\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */ const _rlookupByKey = (table, key, value)=>_lookup(table, value, (index)=>table[index][key] >= value);\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */ function _filterBetween(values, min, max) {\n let start = 0;\n let end = values.length;\n while(start < end && values[start] < min){\n start++;\n }\n while(end > start && values[end - 1] > max){\n end--;\n }\n return start > 0 || end < values.length ? values.slice(start, end) : values;\n}\nconst arrayEvents = [\n 'push',\n 'pop',\n 'shift',\n 'splice',\n 'unshift'\n];\nfunction listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [\n listener\n ]\n }\n });\n arrayEvents.forEach((key)=>{\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value (...args) {\n const res = base.apply(this, args);\n array._chartjs.listeners.forEach((object)=>{\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n return res;\n }\n });\n });\n}\nfunction unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n if (listeners.length > 0) {\n return;\n }\n arrayEvents.forEach((key)=>{\n delete array[key];\n });\n delete array._chartjs;\n}\n/**\n * @param items\n */ function _arrayUnique(items) {\n const set = new Set(items);\n if (set.size === items.length) {\n return items;\n }\n return Array.from(set);\n}\n\nfunction fontString(pixelSize, fontStyle, fontFamily) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n/**\n* Request animation polyfill\n*/ const requestAnimFrame = function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}();\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */ function throttled(fn, thisArg) {\n let argsToUse = [];\n let ticking = false;\n return function(...args) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, ()=>{\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n/**\n * Debounces calling `fn` for `delay` ms\n */ function debounce(fn, delay) {\n let timeout;\n return function(...args) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */ const _toLeftRightCenter = (align)=>align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */ const _alignStartEnd = (align, start, end)=>align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */ const _textX = (align, left, right, rtl)=>{\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n/**\n * Return start and count of visible points.\n * @private\n */ function _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {\n const pointCount = points.length;\n let start = 0;\n let count = pointCount;\n if (meta._sorted) {\n const { iScale , _parsed } = meta;\n const axis = iScale.axis;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(Math.min(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, axis, min).lo, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1), start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n return {\n start,\n count\n };\n}\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */ function _scaleRangesChanged(meta) {\n const { xScale , yScale , _scaleRanges } = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n\nconst atEdge = (t)=>t === 0 || t === 1;\nconst elasticIn = (t, s, p)=>-(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t, s, p)=>Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */ const effects = {\n linear: (t)=>t,\n easeInQuad: (t)=>t * t,\n easeOutQuad: (t)=>-t * (t - 2),\n easeInOutQuad: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1),\n easeInCubic: (t)=>t * t * t,\n easeOutCubic: (t)=>(t -= 1) * t * t + 1,\n easeInOutCubic: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2),\n easeInQuart: (t)=>t * t * t * t,\n easeOutQuart: (t)=>-((t -= 1) * t * t * t - 1),\n easeInOutQuart: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2),\n easeInQuint: (t)=>t * t * t * t * t,\n easeOutQuint: (t)=>(t -= 1) * t * t * t * t + 1,\n easeInOutQuint: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2),\n easeInSine: (t)=>-Math.cos(t * HALF_PI) + 1,\n easeOutSine: (t)=>Math.sin(t * HALF_PI),\n easeInOutSine: (t)=>-0.5 * (Math.cos(PI * t) - 1),\n easeInExpo: (t)=>t === 0 ? 0 : Math.pow(2, 10 * (t - 1)),\n easeOutExpo: (t)=>t === 1 ? 1 : -Math.pow(2, -10 * t) + 1,\n easeInOutExpo: (t)=>atEdge(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n easeInCirc: (t)=>t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1),\n easeOutCirc: (t)=>Math.sqrt(1 - (t -= 1) * t),\n easeInOutCirc: (t)=>(t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n easeInElastic: (t)=>atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n easeOutElastic: (t)=>atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n easeInOutElastic (t) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t : t < 0.5 ? 0.5 * elasticIn(t * 2, s, p) : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n easeInBack (t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n easeOutBack (t) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n easeInOutBack (t) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);\n },\n easeInBounce: (t)=>1 - effects.easeOutBounce(1 - t),\n easeOutBounce (t) {\n const m = 7.5625;\n const d = 2.75;\n if (t < 1 / d) {\n return m * t * t;\n }\n if (t < 2 / d) {\n return m * (t -= 1.5 / d) * t + 0.75;\n }\n if (t < 2.5 / d) {\n return m * (t -= 2.25 / d) * t + 0.9375;\n }\n return m * (t -= 2.625 / d) * t + 0.984375;\n },\n easeInOutBounce: (t)=>t < 0.5 ? effects.easeInBounce(t * 2) * 0.5 : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5\n};\n\nfunction isPatternOrGradient(value) {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n return false;\n}\nfunction color(value) {\n return isPatternOrGradient(value) ? value : new Color(value);\n}\nfunction getHoverColor(value) {\n return isPatternOrGradient(value) ? value : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n\nconst numbers = [\n 'x',\n 'y',\n 'borderWidth',\n 'radius',\n 'tension'\n];\nconst colors = [\n 'color',\n 'borderColor',\n 'backgroundColor'\n];\nfunction applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined\n });\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name)=>name !== 'onProgress' && name !== 'onComplete' && name !== 'fn'\n });\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n }\n });\n defaults.describe('animations', {\n _fallback: 'animation'\n });\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0\n }\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: (v)=>v | 0\n }\n }\n }\n });\n}\n\nfunction applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n\nconst intlCache = new Map();\nfunction getNumberFormat(locale, options) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\nfunction formatNumber(num, locale, options) {\n return getNumberFormat(locale, options).format(num);\n}\n\nconst formatters = {\n values (value) {\n return isArray(value) ? value : '' + value;\n },\n numeric (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue;\n if (ticks.length > 1) {\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n delta = calculateDelta(tickValue, ticks);\n }\n const logDelta = log10(Math.abs(delta));\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n const options = {\n notation,\n minimumFractionDigits: numDecimal,\n maximumFractionDigits: numDecimal\n };\n Object.assign(options, this.options.ticks.format);\n return formatNumber(tickValue, locale, options);\n },\n logarithmic (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || tickValue / Math.pow(10, Math.floor(log10(tickValue)));\n if ([\n 1,\n 2,\n 3,\n 5,\n 10,\n 15\n ].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n};\nfunction calculateDelta(tickValue, ticks) {\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n var Ticks = {\n formatters\n};\n\nfunction applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n bounds: 'ticks',\n clip: true,\n grace: 0,\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options)=>options.lineWidth,\n tickColor: (_ctx, options)=>options.color,\n offset: false\n },\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n title: {\n display: false,\n text: '',\n padding: {\n top: 4,\n bottom: 4\n }\n },\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2\n }\n });\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name)=>!name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name)=>name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash'\n });\n defaults.describe('scales', {\n _fallback: 'scale'\n });\n defaults.describe('scale.ticks', {\n _scriptable: (name)=>name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name)=>name !== 'backdropPadding'\n });\n}\n\nconst overrides = Object.create(null);\nconst descriptors = Object.create(null);\n function getScope$1(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for(let i = 0, n = keys.length; i < n; ++i){\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope$1(root, scope), values);\n }\n return merge(getScope$1(root, ''), scope);\n}\n class Defaults {\n constructor(_descriptors, _appliers){\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context)=>context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options)=>getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options)=>getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options)=>getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n set(scope, values) {\n return set(this, scope, values);\n }\n get(scope) {\n return getScope$1(this, scope);\n }\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n override(scope, values) {\n return set(overrides, scope, values);\n }\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope$1(this, scope);\n const targetScopeObject = getScope$1(this, targetScope);\n const privateName = '_' + name;\n Object.defineProperties(scopeObject, {\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n [name]: {\n enumerable: true,\n get () {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set (value) {\n this[privateName] = value;\n }\n }\n });\n }\n apply(appliers) {\n appliers.forEach((apply)=>apply(this));\n }\n}\nvar defaults = /* #__PURE__ */ new Defaults({\n _scriptable: (name)=>!name.startsWith('on'),\n _indexable: (name)=>name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false\n }\n}, [\n applyAnimationsDefaults,\n applyLayoutsDefaults,\n applyScaleDefaults\n]);\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */ function toFontString(font) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n return (font.style ? font.style + ' ' : '') + (font.weight ? font.weight + ' ' : '') + font.size + 'px ' + font.family;\n}\n/**\n * @private\n */ function _measureText(ctx, data, gc, longest, string) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n/**\n * @private\n */ // eslint-disable-next-line complexity\nfunction _longestText(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n ctx.save();\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i, j, jlen, thing, nestedThing;\n for(i = 0; i < ilen; i++){\n thing = arrayOfThings[i];\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !isArray(thing)) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for(j = 0, jlen = thing.length; j < jlen; j++){\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n ctx.restore();\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for(i = 0; i < gcLen; i++){\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */ function _alignPixel(chart, pixel, width) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n/**\n * Clears the entire canvas.\n */ function clearCanvas(canvas, ctx) {\n ctx = ctx || canvas.getContext('2d');\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\nfunction drawPoint(ctx, options, x, y) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n drawPointLegend(ctx, options, x, y, null);\n}\n// eslint-disable-next-line complexity\nfunction drawPointLegend(ctx, options, x, y, w) {\n let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n ctx.beginPath();\n switch(style){\n // Default includes circle\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n /* falls through */ case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n /* falls through */ case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */ function _isPointInArea(point, area, margin) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;\n}\nfunction clipArea(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\nfunction unclipArea(ctx) {\n ctx.restore();\n}\n/**\n * @private\n */ function _steppedLineTo(ctx, previous, target, flip, mode) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n/**\n * @private\n */ function _bezierCurveTo(ctx, previous, target, flip) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y);\n}\nfunction setRenderOpts(ctx, opts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\nfunction decorateText(ctx, x, y, line, opts) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */ const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\nfunction drawBackdrop(ctx, opts) {\n const oldColor = ctx.fillStyle;\n ctx.fillStyle = opts.color;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n/**\n * Render text onto the canvas\n */ function renderText(ctx, text, x, y, font, opts = {}) {\n const lines = isArray(text) ? text : [\n text\n ];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i, line;\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n for(i = 0; i < lines.length; ++i){\n line = lines[i];\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n y += Number(font.lineHeight);\n }\n ctx.restore();\n}\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */ function addRoundedRectPath(ctx, rect) {\n const { x , y , w , h , radius } = rect;\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n/**\n * @alias Chart.helpers.options\n * @namespace\n */ /**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */ function toLineHeight(value, size) {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n value = +matches[2];\n switch(matches[3]){\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n }\n return size * value;\n}\nconst numberOrZero = (v)=>+v || 0;\nfunction _readValueToProps(value, props) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value) ? objProps ? (prop)=>valueOrDefault(value[prop], value[props[prop]]) : (prop)=>value[prop] : ()=>value;\n for (const prop of keys){\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */ function toTRBL(value) {\n return _readValueToProps(value, {\n top: 'y',\n right: 'x',\n bottom: 'y',\n left: 'x'\n });\n}\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */ function toTRBLCorners(value) {\n return _readValueToProps(value, [\n 'topLeft',\n 'topRight',\n 'bottomLeft',\n 'bottomRight'\n ]);\n}\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */ function toPadding(value) {\n const obj = toTRBL(value);\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n return obj;\n}\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */ function toFont(options, fallback) {\n options = options || {};\n fallback = fallback || defaults.font;\n let size = valueOrDefault(options.size, fallback.size);\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n font.string = toFontString(font);\n return font;\n}\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */ function resolve(inputs, context, index, info) {\n let cacheable = true;\n let i, ilen, value;\n for(i = 0, ilen = inputs.length; i < ilen; ++i){\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */ function _addGrace(minmax, grace, beginAtZero) {\n const { min , max } = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value, add)=>beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\nfunction createContext(parentContext, context) {\n return Object.assign(Object.create(parentContext), context);\n}\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */ function _createResolver(scopes, prefixes = [\n ''\n], rootScopes, fallback, getTarget = ()=>scopes[0]) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === 'undefined') {\n fallback = _resolve('_fallback', scopes);\n }\n const cache = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope)=>_createResolver([\n scope,\n ...scopes\n ], prefixes, finalRootScopes, fallback)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop) {\n return _cached(target, prop, ()=>_resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys (target) {\n return getKeysFromAllScopes(target);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n });\n}\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */ function _attachContext(proxy, context, subProxy, descriptorDefaults) {\n const cache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx)=>_attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope)=>_attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop, receiver) {\n return _cached(target, prop, ()=>_resolveWithContext(target, prop, receiver));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? {\n enumerable: true,\n configurable: true\n } : undefined : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(proxy);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return Reflect.has(proxy, prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys () {\n return Reflect.ownKeys(proxy);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n });\n}\n/**\n * @private\n */ function _descriptors(proxy, defaults = {\n scriptable: true,\n indexable: true\n}) {\n const { _scriptable =defaults.scriptable , _indexable =defaults.indexable , _allKeys =defaults.allKeys } = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : ()=>_scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : ()=>_indexable\n };\n}\nconst readKey = (prefix, name)=>prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop, value)=>isObject(value) && prop !== 'adapters' && (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction _cached(target, prop, resolve) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) {\n return target[prop];\n }\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\nfunction _resolveWithContext(target, prop, receiver) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n let value = _proxy[prop]; // resolve from proxy\n // resolve with context\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n // if the resolved value is an object, create a sub resolver for it\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\nfunction _resolveScriptable(prop, getValue, target, receiver) {\n const { _proxy , _context , _subProxy , _stack } = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n // When scriptable option returns an object, create a resolver on that.\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\nfunction _resolveArray(prop, value, target, isIndexable) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n return value[_context.index % value.length];\n } else if (isObject(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter((s)=>s !== arr);\n value = [];\n for (const item of arr){\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\nfunction resolveFallback(fallback, prop, value) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\nconst getScope = (key, parent)=>key === true ? parent : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\nfunction addScopes(set, parentScopes, key, parentFallback, value) {\n for (const parent of parentScopes){\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n }\n } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n }\n return false;\n}\nfunction createSubResolver(parentScopes, resolver, prop, value) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [\n ...parentScopes,\n ...rootScopes\n ];\n const set = new Set();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (typeof fallback !== 'undefined' && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [\n ''\n ], rootScopes, fallback, ()=>subGetTarget(resolver, prop, value));\n}\nfunction addScopesFromKey(set, allScopes, key, fallback, item) {\n while(key){\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\nfunction subGetTarget(resolver, prop, value) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n // For array of objects, the object is used to store updated values\n return value;\n }\n return target || {};\n}\nfunction _resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n let value;\n for (const prefix of prefixes){\n value = _resolve(readKey(prefix, prop), scopes);\n if (typeof value !== 'undefined') {\n return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value;\n }\n }\n}\nfunction _resolve(key, scopes) {\n for (const scope of scopes){\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n}\nfunction getKeysFromAllScopes(target) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\nfunction resolveKeysFromAllScopes(scopes) {\n const set = new Set();\n for (const scope of scopes){\n for (const key of Object.keys(scope).filter((k)=>!k.startsWith('_'))){\n set.add(key);\n }\n }\n return Array.from(set);\n}\nfunction _parseObjectDataRadialScale(meta, data, start, count) {\n const { iScale } = meta;\n const { key ='r' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n\nconst EPSILON = Number.EPSILON || 1e-14;\nconst getPoint = (points, i)=>i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis)=>indexAxis === 'x' ? 'y' : 'x';\nfunction splineCurve(firstPoint, middlePoint, afterPoint, t) {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n // This function must also respect \"skipped\" points\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n/**\n * Adjust tangents to ensure monotonic properties\n */ function monotoneAdjust(points, deltaK, mK) {\n const pointsLen = points.length;\n let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen - 1; ++i){\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\nfunction monotoneCompute(points, mK, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */ function splineCurveMonotone(points, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK = Array(pointsLen).fill(0);\n const mK = Array(pointsLen);\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : sign(deltaK[i - 1]) !== sign(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n monotoneAdjust(points, deltaK, mK);\n monotoneCompute(points, mK, indexAxis);\n}\nfunction capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n}\nfunction capBezierPoints(points, area) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for(i = 0, ilen = points.length; i < ilen; ++i){\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n/**\n * @private\n */ function _updateBezierControlPoints(points, options, area, loop, indexAxis) {\n let i, ilen, point, controlPoints;\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt)=>!pt.skip);\n }\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for(i = 0, ilen = points.length; i < ilen; ++i){\n point = points[i];\n controlPoints = splineCurve(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension);\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */ /**\n * @private\n */ function _isDomSupported() {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n/**\n * @private\n */ function _getParentNode(domNode) {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = parent.host;\n }\n return parent;\n}\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */ function parseMaxStyle(styleValue, node, parentProperty) {\n let valueInPixels;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n return valueInPixels;\n}\nconst getComputedStyle = (element)=>element.ownerDocument.defaultView.getComputedStyle(element, null);\nfunction getStyle(el, property) {\n return getComputedStyle(el).getPropertyValue(property);\n}\nconst positions = [\n 'top',\n 'right',\n 'bottom',\n 'left'\n];\nfunction getPositionedStyle(styles, style, suffix) {\n const result = {};\n suffix = suffix ? '-' + suffix : '';\n for(let i = 0; i < 4; i++){\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\nconst useOffsetPos = (x, y, target)=>(x > 0 || y > 0) && (!target || !target.shadowRoot);\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */ function getCanvasPosition(e, canvas) {\n const touches = e.touches;\n const source = touches && touches.length ? touches[0] : e;\n const { offsetX , offsetY } = source;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {\n x,\n y,\n box\n };\n}\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */ function getRelativePosition(event, chart) {\n if ('native' in event) {\n return event;\n }\n const { canvas , currentDevicePixelRatio } = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const { x , y , box } = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n let { width , height } = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\nfunction getContainerSize(canvas, width, height) {\n let maxWidth, maxHeight;\n if (width === undefined || height === undefined) {\n const container = _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\nconst round1 = (v)=>Math.round(v * 10) / 10;\n// eslint-disable-next-line complexity\nfunction getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let { width , height } = containerSize;\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n return {\n width,\n height\n };\n}\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */ function retinaScale(chart, forceRatio, forceStyle) {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n const canvas = chart.canvas;\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */ const supportsEventListenerOptions = function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive () {\n passiveSupported = true;\n return false;\n }\n };\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}();\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */ function readUsedSize(element, property) {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n\n/**\n * @private\n */ function _pointInLine(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n/**\n * @private\n */ function _steppedInterpolation(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y : mode === 'after' ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y\n };\n}\n/**\n * @private\n */ function _bezierInterpolation(p1, p2, t, mode) {\n const cp1 = {\n x: p1.cp2x,\n y: p1.cp2y\n };\n const cp2 = {\n x: p2.cp1x,\n y: p2.cp1y\n };\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n\nconst getRightToLeftAdapter = function(rectX, width) {\n return {\n x (x) {\n return rectX + rectX + width - x;\n },\n setWidth (w) {\n width = w;\n },\n textAlign (align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus (x, value) {\n return x - value;\n },\n leftForLtr (x, itemWidth) {\n return x - itemWidth;\n }\n };\n};\nconst getLeftToRightAdapter = function() {\n return {\n x (x) {\n return x;\n },\n setWidth (w) {},\n textAlign (align) {\n return align;\n },\n xPlus (x, value) {\n return x + value;\n },\n leftForLtr (x, _itemWidth) {\n return x;\n }\n };\n};\nfunction getRtlAdapter(rtl, rectX, width) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\nfunction overrideTextDirection(ctx, direction) {\n let style, original;\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction')\n ];\n style.setProperty('direction', direction, 'important');\n ctx.prevTextDirection = original;\n }\n}\nfunction restoreTextDirection(ctx, original) {\n if (original !== undefined) {\n delete ctx.prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle\n };\n }\n return {\n between: _isBetween,\n compare: (a, b)=>a - b,\n normalize: (x)=>x\n };\n}\nfunction normalizeSegment({ start , end , count , loop , style }) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\nfunction getSegment(segment, points, bounds) {\n const { property , start: startBound , end: endBound } = bounds;\n const { between , normalize } = propertyFn(property);\n const count = points.length;\n let { start , end , loop } = segment;\n let i, ilen;\n if (loop) {\n start += count;\n end += count;\n for(i = 0, ilen = count; i < ilen; ++i){\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n if (end < start) {\n end += count;\n }\n return {\n start,\n end,\n loop,\n style: segment.style\n };\n}\n function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [\n segment\n ];\n }\n const { property , start: startBound , end: endBound } = bounds;\n const count = points.length;\n const { compare , between , normalize } = propertyFn(property);\n const { start , end , loop , style } = getSegment(segment, points, bounds);\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n const startIsBefore = ()=>between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = ()=>compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = ()=>inside || startIsBefore();\n const shouldStop = ()=>!inside || endIsBefore();\n for(let i = start, prev = start; i <= end; ++i){\n point = points[i % count];\n if (point.skip) {\n continue;\n }\n value = normalize(point[property]);\n if (value === prevValue) {\n continue;\n }\n inside = between(value, startBound, endBound);\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({\n start: subStart,\n end: i,\n loop,\n count,\n style\n }));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n if (subStart !== null) {\n result.push(normalizeSegment({\n start: subStart,\n end,\n loop,\n count,\n style\n }));\n }\n return result;\n}\n function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n for(let i = 0; i < segments.length; i++){\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n function findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n if (loop && !spanGaps) {\n while(start < count && !points[start].skip){\n start++;\n }\n }\n while(start < count && points[start].skip){\n start++;\n }\n start %= count;\n if (loop) {\n end += start;\n }\n while(end > start && points[end % count].skip){\n end--;\n }\n end %= count;\n return {\n start,\n end\n };\n}\n function solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n for(end = start + 1; end <= max; ++end){\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({\n start: start % count,\n end: (end - 1) % count,\n loop\n });\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n if (last !== null) {\n result.push({\n start: start % count,\n end: last % count,\n loop\n });\n }\n return result;\n}\n function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n if (!count) {\n return [];\n }\n const loop = !!line._loop;\n const { start , end } = findStartAndEnd(points, count, loop, spanGaps);\n if (spanGaps === true) {\n return splitByStyles(line, [\n {\n start,\n end,\n loop\n }\n ], points, segmentOptions);\n }\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n function splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n function doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const { _datasetIndex: datasetIndex , options: { spanGaps } } = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n s += count;\n while(points[s % count].skip){\n s -= dir;\n }\n while(points[e % count].skip){\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({\n start: s % count,\n end: e % count,\n loop: l,\n style: st\n });\n prevStyle = st;\n start = e % count;\n }\n }\n for (const segment of segments){\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for(i = start + 1; i <= segment.end; i++){\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n return result;\n}\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\nfunction styleChanged(style, prevStyle) {\n if (!prevStyle) {\n return false;\n }\n const cache = [];\n const replacer = function(key, value) {\n if (!isPatternOrGradient(value)) {\n return value;\n }\n if (!cache.includes(value)) {\n cache.push(value);\n }\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n\nexport { unclipArea as $, _rlookupByKey as A, _lookupByKey as B, _isPointInArea as C, getAngleFromPoint as D, toPadding as E, each as F, getMaximumSize as G, HALF_PI as H, _getParentNode as I, readUsedSize as J, supportsEventListenerOptions as K, throttled as L, _isDomSupported as M, _factorize as N, finiteOrDefault as O, PI as P, callback as Q, _addGrace as R, _limitValue as S, TAU as T, toDegrees as U, _measureText as V, _int16Range as W, _alignPixel as X, clipArea as Y, renderText as Z, _arrayUnique as _, resolve as a, fontString as a$, toFont as a0, _toLeftRightCenter as a1, _alignStartEnd as a2, overrides as a3, merge as a4, _capitalize as a5, descriptors as a6, isFunction as a7, _attachContext as a8, _createResolver as a9, overrideTextDirection as aA, _textX as aB, restoreTextDirection as aC, drawPointLegend as aD, distanceBetweenPoints as aE, noop as aF, _setMinAndMaxByKey as aG, niceNum as aH, almostWhole as aI, almostEquals as aJ, _decimalPlaces as aK, Ticks as aL, log10 as aM, _longestText as aN, _filterBetween as aO, _lookup as aP, isPatternOrGradient as aQ, getHoverColor as aR, clone as aS, _merger as aT, _mergerIf as aU, _deprecated as aV, _splitKey as aW, toFontString as aX, splineCurve as aY, splineCurveMonotone as aZ, getStyle as a_, _descriptors as aa, mergeIf as ab, uid as ac, debounce as ad, retinaScale as ae, clearCanvas as af, setsEqual as ag, _elementsEqual as ah, _isClickEvent as ai, _isBetween as aj, _readValueToProps as ak, _updateBezierControlPoints as al, _computeSegments as am, _boundSegments as an, _steppedInterpolation as ao, _bezierInterpolation as ap, _pointInLine as aq, _steppedLineTo as ar, _bezierCurveTo as as, drawPoint as at, addRoundedRectPath as au, toTRBL as av, toTRBLCorners as aw, _boundSegment as ax, _normalizeAngle as ay, getRtlAdapter as az, isArray as b, toLineHeight as b0, PITAU as b1, INFINITY as b2, RAD_PER_DEG as b3, QUARTER_PI as b4, TWO_THIRDS_PI as b5, _angleDiff as b6, color as c, defaults as d, effects as e, resolveObjectKey as f, isNumberFinite as g, defined as h, isObject as i, createContext as j, isNullOrUndef as k, listenArrayEvents as l, toPercentage as m, toDimension as n, formatNumber as o, _angleBetween as p, _getStartAndCountOfVisiblePoints as q, requestAnimFrame as r, sign as s, toRadians as t, unlistenArrayEvents as u, valueOrDefault as v, _scaleRangesChanged as w, isNumber as x, _parseObjectDataRadialScale as y, getRelativePosition as z };\n//# sourceMappingURL=helpers.segment.js.map\n","/**\n * @namespace Chart.helpers\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ActiveDataPoint, ChartEvent} from '../types/index.js';\n\n/**\n * An empty function that can be used, for example, for optional callback.\n */\nexport function noop() {\n /* noop */\n}\n\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */\nexport const uid = (() => {\n let id = 0;\n return () => id++;\n})();\n\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isNullOrUndef(value: unknown): value is null | undefined {\n return value === null || typeof value === 'undefined';\n}\n\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */\nexport function isArray(value: unknown): value is T[] {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isObject(value: unknown): value is AnyObject {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */\nfunction isNumberFinite(value: unknown): value is number {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\nexport {\n isNumberFinite as isFinite,\n};\n\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */\nexport function finiteOrDefault(value: unknown, defaultValue: number) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */\nexport function valueOrDefault(value: T | undefined, defaultValue: T) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\n\nexport const toPercentage = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100\n : +value / dimension;\n\nexport const toDimension = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100 * dimension\n : +value;\n\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */\nexport function callback R, TA, R>(\n fn: T | undefined,\n args: unknown[],\n thisArg?: TA\n): R | undefined {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\n\n/**\n * Note(SB) for performance sake, this method should only be used when loopable type\n * is unknown or in none intensive code (not called often and small loopable). Else\n * it's preferable to use a regular for() loop and save extra function calls.\n * @param loopable - The object or array to be iterated.\n * @param fn - The function to call for each item.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n * @param [reverse] - If true, iterates backward on the loopable.\n */\nexport function each(\n loopable: Record,\n fn: (this: TA, v: T, i: string) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each(\n loopable: T[],\n fn: (this: TA, v: T, i: number) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each(\n loopable: T[] | Record,\n fn: (this: TA, v: T, i: any) => void,\n thisArg?: TA,\n reverse?: boolean\n) {\n let i: number, len: number, keys: string[];\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for (i = len - 1; i >= 0; i--) {\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */\nexport function _elementsEqual(a0: ActiveDataPoint[], a1: ActiveDataPoint[]) {\n let i: number, ilen: number, v0: ActiveDataPoint, v1: ActiveDataPoint;\n\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n\n for (i = 0, ilen = a0.length; i < ilen; ++i) {\n v0 = a0[i];\n v1 = a1[i];\n\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */\nexport function clone(source: T): T {\n if (isArray(source)) {\n return source.map(clone) as unknown as T;\n }\n\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n\n for (; k < klen; ++k) {\n target[keys[k]] = clone(source[keys[k]]);\n }\n\n return target;\n }\n\n return source;\n}\n\nfunction isValidKey(key: string) {\n return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;\n}\n\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */\nexport function _merger(key: string, target: AnyObject, source: AnyObject, options: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone(sval);\n }\n}\n\nexport interface MergeOptions {\n merger?: (key: string, target: AnyObject, source: AnyObject, options?: AnyObject) => void;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` with the given `options`.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @param [options] - Merging options:\n * @param [options.merger] - The merge method (key, target, source, options)\n * @returns The `target` object.\n */\nexport function merge(target: T, source: [], options?: MergeOptions): T;\nexport function merge(target: T, source: S1, options?: MergeOptions): T & S1;\nexport function merge(target: T, source: [S1], options?: MergeOptions): T & S1;\nexport function merge(target: T, source: [S1, S2], options?: MergeOptions): T & S1 & S2;\nexport function merge(target: T, source: [S1, S2, S3], options?: MergeOptions): T & S1 & S2 & S3;\nexport function merge(\n target: T,\n source: [S1, S2, S3, S4],\n options?: MergeOptions\n): T & S1 & S2 & S3 & S4;\nexport function merge(target: T, source: AnyObject[], options?: MergeOptions): AnyObject;\nexport function merge(target: T, source: AnyObject[], options?: MergeOptions): AnyObject {\n const sources = isArray(source) ? source : [source];\n const ilen = sources.length;\n\n if (!isObject(target)) {\n return target as AnyObject;\n }\n\n options = options || {};\n const merger = options.merger || _merger;\n let current: AnyObject;\n\n for (let i = 0; i < ilen; ++i) {\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n\n const keys = Object.keys(current);\n for (let k = 0, klen = keys.length; k < klen; ++k) {\n merger(keys[k], target, current, options as AnyObject);\n }\n }\n\n return target;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` *only* if not defined in target.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @returns The `target` object.\n */\nexport function mergeIf(target: T, source: []): T;\nexport function mergeIf(target: T, source: S1): T & S1;\nexport function mergeIf(target: T, source: [S1]): T & S1;\nexport function mergeIf(target: T, source: [S1, S2]): T & S1 & S2;\nexport function mergeIf(target: T, source: [S1, S2, S3]): T & S1 & S2 & S3;\nexport function mergeIf(target: T, source: [S1, S2, S3, S4]): T & S1 & S2 & S3 & S4;\nexport function mergeIf(target: T, source: AnyObject[]): AnyObject;\nexport function mergeIf(target: T, source: AnyObject[]): AnyObject {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge(target, source, {merger: _mergerIf});\n}\n\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */\nexport function _mergerIf(key: string, target: AnyObject, source: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone(sval);\n }\n}\n\n/**\n * @private\n */\nexport function _deprecated(scope: string, value: unknown, previous: string, current: string) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous +\n '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': v => v,\n // default resolvers\n x: o => o.x,\n y: o => o.y\n};\n\n/**\n * @private\n */\nexport function _splitKey(key: string) {\n const parts = key.split('.');\n const keys: string[] = [];\n let tmp = '';\n for (const part of parts) {\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\n\nfunction _getKeyResolver(key: string) {\n const keys = _splitKey(key);\n return obj => {\n for (const k of keys) {\n if (k === '') {\n // For backward compatibility:\n // Chart.helpers.core resolveObjectKey should break at empty key\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\n\nexport function resolveObjectKey(obj: AnyObject, key: string): any {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n\n/**\n * @private\n */\nexport function _capitalize(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n\nexport const defined = (value: unknown) => typeof value !== 'undefined';\n\nexport const isFunction = (value: unknown): value is (...args: any[]) => any => typeof value === 'function';\n\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nexport const setsEqual = (a: Set, b: Set) => {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const item of a) {\n if (!b.has(item)) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * @param e - The event\n * @private\n */\nexport function _isClickEvent(e: ChartEvent) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n","import type {Point} from '../types/geometric.js';\nimport {isFinite as isFiniteNumber} from './helpers.core.js';\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */\n\nexport const PI = Math.PI;\nexport const TAU = 2 * PI;\nexport const PITAU = TAU + PI;\nexport const INFINITY = Number.POSITIVE_INFINITY;\nexport const RAD_PER_DEG = PI / 180;\nexport const HALF_PI = PI / 2;\nexport const QUARTER_PI = PI / 4;\nexport const TWO_THIRDS_PI = PI * 2 / 3;\n\nexport const log10 = Math.log10;\nexport const sign = Math.sign;\n\nexport function almostEquals(x: number, y: number, epsilon: number) {\n return Math.abs(x - y) < epsilon;\n}\n\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */\nexport function niceNum(range: number) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */\nexport function _factorize(value: number) {\n const result: number[] = [];\n const sqrt = Math.sqrt(value);\n let i: number;\n\n for (i = 1; i < sqrt; i++) {\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) { // if value is a square number\n result.push(sqrt);\n }\n\n result.sort((a, b) => a - b).pop();\n return result;\n}\n\nexport function isNumber(n: unknown): n is number {\n return !isNaN(parseFloat(n as string)) && isFinite(n as number);\n}\n\nexport function almostWhole(x: number, epsilon: number) {\n const rounded = Math.round(x);\n return ((rounded - epsilon) <= x) && ((rounded + epsilon) >= x);\n}\n\n/**\n * @private\n */\nexport function _setMinAndMaxByKey(\n array: Record[],\n target: { min: number, max: number },\n property: string\n) {\n let i: number, ilen: number, value: number;\n\n for (i = 0, ilen = array.length; i < ilen; i++) {\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\n\nexport function toRadians(degrees: number) {\n return degrees * (PI / 180);\n}\n\nexport function toDegrees(radians: number) {\n return radians * (180 / PI);\n}\n\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */\nexport function _decimalPlaces(x: number) {\n if (!isFiniteNumber(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while (Math.round(x * e) / e !== x) {\n e *= 10;\n p++;\n }\n return p;\n}\n\n// Gets the angle from vertical upright to the point about a centre.\nexport function getAngleFromPoint(\n centrePoint: Point,\n anglePoint: Point\n) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n\n if (angle < (-0.5 * PI)) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\n\nexport function distanceBetweenPoints(pt1: Point, pt2: Point) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */\nexport function _angleDiff(a: number, b: number) {\n return (a - b + PITAU) % TAU - PI;\n}\n\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */\nexport function _normalizeAngle(a: number) {\n return (a % TAU + TAU) % TAU;\n}\n\n/**\n * @private\n */\nexport function _angleBetween(angle: number, start: number, end: number, sameAngleIsFullCircle?: boolean) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || (sameAngleIsFullCircle && s === e)\n || (angleToStart > angleToEnd && startToAngle < endToAngle);\n}\n\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */\nexport function _limitValue(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\n/**\n * @param {number} value\n * @private\n */\nexport function _int16Range(value: number) {\n return _limitValue(value, -32768, 32767);\n}\n\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */\nexport function _isBetween(value: number, start: number, end: number, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n","import {_capitalize} from './helpers.core.js';\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param value - value to find\n * @param cmp\n * @private\n */\nexport function _lookup(\n table: number[],\n value: number,\n cmp?: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup(\n table: T[],\n value: number,\n cmp: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup(\n table: unknown[],\n value: number,\n cmp?: (value: number) => boolean\n) {\n cmp = cmp || ((index) => table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid: number;\n\n while (hi - lo > 1) {\n mid = (lo + hi) >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n\n return {lo, hi};\n}\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */\nexport const _lookupByKey = (\n table: Record[],\n key: string,\n value: number,\n last?: boolean\n) =>\n _lookup(table, value, last\n ? index => {\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n }\n : index => table[index][key] < value);\n\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */\nexport const _rlookupByKey = (\n table: Record[],\n key: string,\n value: number\n) =>\n _lookup(table, value, index => table[index][key] >= value);\n\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */\nexport function _filterBetween(values: number[], min: number, max: number) {\n let start = 0;\n let end = values.length;\n\n while (start < end && values[start] < min) {\n start++;\n }\n while (end > start && values[end - 1] > max) {\n end--;\n }\n\n return start > 0 || end < values.length\n ? values.slice(start, end)\n : values;\n}\n\nconst arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'] as const;\n\nexport interface ArrayListener {\n _onDataPush?(...item: T[]): void;\n _onDataPop?(): void;\n _onDataShift?(): void;\n _onDataSplice?(index: number, deleteCount: number, ...items: T[]): void;\n _onDataUnshift?(...item: T[]): void;\n}\n\n/**\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\n * called on the '_onData*' callbacks (e.g. _onDataPush, etc.) with same arguments.\n */\nexport function listenArrayEvents(array: T[], listener: ArrayListener): void;\nexport function listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n\n arrayEvents.forEach((key) => {\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value(...args) {\n const res = base.apply(this, args);\n\n array._chartjs.listeners.forEach((object) => {\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n\n return res;\n }\n });\n });\n}\n\n\n/**\n * Removes the given array event listener and cleanup extra attached properties (such as\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\n */\nexport function unlistenArrayEvents(array: T[], listener: ArrayListener): void;\nexport function unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n\n if (listeners.length > 0) {\n return;\n }\n\n arrayEvents.forEach((key) => {\n delete array[key];\n });\n\n delete array._chartjs;\n}\n\n/**\n * @param items\n */\nexport function _arrayUnique(items: T[]) {\n const set = new Set(items);\n\n if (set.size === items.length) {\n return items;\n }\n\n return Array.from(set);\n}\n","import type {ChartMeta, PointElement} from '../types/index.js';\n\nimport {_limitValue} from './helpers.math.js';\nimport {_lookupByKey} from './helpers.collection.js';\n\nexport function fontString(pixelSize: number, fontStyle: string, fontFamily: string) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n\n/**\n* Request animation polyfill\n*/\nexport const requestAnimFrame = (function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}());\n\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */\nexport function throttled>(\n fn: (...args: TArgs) => void,\n thisArg: any,\n) {\n let argsToUse = [] as TArgs;\n let ticking = false;\n\n return function(...args: TArgs) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, () => {\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n\n/**\n * Debounces calling `fn` for `delay` ms\n */\nexport function debounce>(fn: (...args: TArgs) => void, delay: number) {\n let timeout;\n return function(...args: TArgs) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */\nexport const _toLeftRightCenter = (align: 'start' | 'end' | 'center') => align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */\nexport const _alignStartEnd = (align: 'start' | 'end' | 'center', start: number, end: number) => align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */\nexport const _textX = (align: 'left' | 'right' | 'center', left: number, right: number, rtl: boolean) => {\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n\n/**\n * Return start and count of visible points.\n * @private\n */\nexport function _getStartAndCountOfVisiblePoints(meta: ChartMeta<'line' | 'scatter'>, points: PointElement[], animationsDisabled: boolean) {\n const pointCount = points.length;\n\n let start = 0;\n let count = pointCount;\n\n if (meta._sorted) {\n const {iScale, _parsed} = meta;\n const axis = iScale.axis;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(Math.min(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, axis, min).lo,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo),\n 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1),\n start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n\n return {start, count};\n}\n\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */\nexport function _scaleRangesChanged(meta) {\n const {xScale, yScale, _scaleRanges} = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min\n\t\t|| _scaleRanges.xmax !== xScale.max\n\t\t|| _scaleRanges.ymin !== yScale.min\n\t\t|| _scaleRanges.ymax !== yScale.max;\n\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n","import {PI, TAU, HALF_PI} from './helpers.math.js';\n\nconst atEdge = (t: number) => t === 0 || t === 1;\nconst elasticIn = (t: number, s: number, p: number) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t: number, s: number, p: number) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */\nconst effects = {\n linear: (t: number) => t,\n\n easeInQuad: (t: number) => t * t,\n\n easeOutQuad: (t: number) => -t * (t - 2),\n\n easeInOutQuad: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t\n : -0.5 * ((--t) * (t - 2) - 1),\n\n easeInCubic: (t: number) => t * t * t,\n\n easeOutCubic: (t: number) => (t -= 1) * t * t + 1,\n\n easeInOutCubic: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t\n : 0.5 * ((t -= 2) * t * t + 2),\n\n easeInQuart: (t: number) => t * t * t * t,\n\n easeOutQuart: (t: number) => -((t -= 1) * t * t * t - 1),\n\n easeInOutQuart: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t\n : -0.5 * ((t -= 2) * t * t * t - 2),\n\n easeInQuint: (t: number) => t * t * t * t * t,\n\n easeOutQuint: (t: number) => (t -= 1) * t * t * t * t + 1,\n\n easeInOutQuint: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t * t\n : 0.5 * ((t -= 2) * t * t * t * t + 2),\n\n easeInSine: (t: number) => -Math.cos(t * HALF_PI) + 1,\n\n easeOutSine: (t: number) => Math.sin(t * HALF_PI),\n\n easeInOutSine: (t: number) => -0.5 * (Math.cos(PI * t) - 1),\n\n easeInExpo: (t: number) => (t === 0) ? 0 : Math.pow(2, 10 * (t - 1)),\n\n easeOutExpo: (t: number) => (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1,\n\n easeInOutExpo: (t: number) => atEdge(t) ? t : t < 0.5\n ? 0.5 * Math.pow(2, 10 * (t * 2 - 1))\n : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n\n easeInCirc: (t: number) => (t >= 1) ? t : -(Math.sqrt(1 - t * t) - 1),\n\n easeOutCirc: (t: number) => Math.sqrt(1 - (t -= 1) * t),\n\n easeInOutCirc: (t: number) => ((t /= 0.5) < 1)\n ? -0.5 * (Math.sqrt(1 - t * t) - 1)\n : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n\n easeInElastic: (t: number) => atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n\n easeOutElastic: (t: number) => atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n\n easeInOutElastic(t: number) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t :\n t < 0.5\n ? 0.5 * elasticIn(t * 2, s, p)\n : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n\n easeInBack(t: number) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n\n easeOutBack(t: number) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n\n easeInOutBack(t: number) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n },\n\n easeInBounce: (t: number) => 1 - effects.easeOutBounce(1 - t),\n\n easeOutBounce(t: number) {\n const m = 7.5625;\n const d = 2.75;\n if (t < (1 / d)) {\n return m * t * t;\n }\n if (t < (2 / d)) {\n return m * (t -= (1.5 / d)) * t + 0.75;\n }\n if (t < (2.5 / d)) {\n return m * (t -= (2.25 / d)) * t + 0.9375;\n }\n return m * (t -= (2.625 / d)) * t + 0.984375;\n },\n\n easeInOutBounce: (t: number) => (t < 0.5)\n ? effects.easeInBounce(t * 2) * 0.5\n : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5,\n} as const;\n\nexport type EasingFunction = keyof typeof effects\n\nexport default effects;\n","import {Color} from '@kurkle/color';\n\nexport function isPatternOrGradient(value: unknown): value is CanvasPattern | CanvasGradient {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n\n return false;\n}\n\nexport function color(value: CanvasGradient): CanvasGradient;\nexport function color(value: CanvasPattern): CanvasPattern;\nexport function color(\n value:\n | string\n | { r: number; g: number; b: number; a: number }\n | [number, number, number]\n | [number, number, number, number]\n): Color;\nexport function color(value) {\n return isPatternOrGradient(value) ? value : new Color(value);\n}\n\nexport function getHoverColor(value: CanvasGradient): CanvasGradient;\nexport function getHoverColor(value: CanvasPattern): CanvasPattern;\nexport function getHoverColor(value: string): string;\nexport function getHoverColor(value) {\n return isPatternOrGradient(value)\n ? value\n : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n","const numbers = ['x', 'y', 'borderWidth', 'radius', 'tension'];\nconst colors = ['color', 'borderColor', 'backgroundColor'];\n\nexport function applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined,\n });\n\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name) => name !== 'onProgress' && name !== 'onComplete' && name !== 'fn',\n });\n\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n },\n });\n\n defaults.describe('animations', {\n _fallback: 'animation',\n });\n\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0 // show immediately\n },\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: v => v | 0 // for keeping the dataset visible all the way through the animation\n },\n }\n }\n });\n}\n","export function applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n","\nconst intlCache = new Map();\n\nfunction getNumberFormat(locale: string, options?: Intl.NumberFormatOptions) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\n\nexport function formatNumber(num: number, locale: string, options?: Intl.NumberFormatOptions) {\n return getNumberFormat(locale, options).format(num);\n}\n","import {isArray} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {log10} from '../helpers/helpers.math.js';\n\n/**\n * Namespace to hold formatters for different types of ticks\n * @namespace Chart.Ticks.formatters\n */\nconst formatters = {\n /**\n * Formatter for value labels\n * @method Chart.Ticks.formatters.values\n * @param value the value to display\n * @return {string|string[]} the label to display\n */\n values(value) {\n return isArray(value) ? /** @type {string[]} */ (value) : '' + value;\n },\n\n /**\n * Formatter for numeric ticks\n * @method Chart.Ticks.formatters.numeric\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n numeric(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0'; // never show decimal places for 0\n }\n\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue; // This is used when there are less than 2 ticks as the tick interval.\n\n if (ticks.length > 1) {\n // all ticks are small or there huge numbers; use scientific notation\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n\n delta = calculateDelta(tickValue, ticks);\n }\n\n const logDelta = log10(Math.abs(delta));\n\n // When datasets have values approaching Number.MAX_VALUE, the tick calculations might result in\n // infinity and eventually NaN. Passing NaN for minimumFractionDigits or maximumFractionDigits\n // will make the number formatter throw. So instead we check for isNaN and use a fallback value.\n //\n // toFixed has a max of 20 decimal places\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n\n const options = {notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal};\n Object.assign(options, this.options.ticks.format);\n\n return formatNumber(tickValue, locale, options);\n },\n\n\n /**\n * Formatter for logarithmic ticks\n * @method Chart.Ticks.formatters.logarithmic\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n logarithmic(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || (tickValue / (Math.pow(10, Math.floor(log10(tickValue)))));\n if ([1, 2, 3, 5, 10, 15].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n\n};\n\n\nfunction calculateDelta(tickValue, ticks) {\n // Figure out how many digits to show\n // The space between the first two ticks might be smaller than normal spacing\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n\n // If we have a number like 2.5 as the delta, figure out how many decimal places we need\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n // not an integer\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n\n/**\n * Namespace to hold static tick generation functions\n * @namespace Chart.Ticks\n */\nexport default {formatters};\n","import Ticks from './core.ticks.js';\n\nexport function applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 3.0.0\n */\n bounds: 'ticks',\n\n clip: true,\n\n /**\n * Addition grace added to max and reduced from min data value.\n * @since 3.0.0\n */\n grace: 0,\n\n // grid line settings\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options) => options.lineWidth,\n tickColor: (_ctx, options) => options.color,\n offset: false,\n },\n\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n\n // scale title\n title: {\n // display property\n display: false,\n\n // actual label\n text: '',\n\n // top/bottom padding\n padding: {\n top: 4,\n bottom: 4\n }\n },\n\n // label settings\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2,\n }\n });\n\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name) => !name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name) => name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash',\n });\n\n defaults.describe('scales', {\n _fallback: 'scale',\n });\n\n defaults.describe('scale.ticks', {\n _scriptable: (name) => name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name) => name !== 'backdropPadding',\n });\n}\n","import {getHoverColor} from '../helpers/helpers.color.js';\nimport {isObject, merge, valueOrDefault} from '../helpers/helpers.core.js';\nimport {applyAnimationsDefaults} from './core.animations.defaults.js';\nimport {applyLayoutsDefaults} from './core.layouts.defaults.js';\nimport {applyScaleDefaults} from './core.scale.defaults.js';\n\nexport const overrides = Object.create(null);\nexport const descriptors = Object.create(null);\n\n/**\n * @param {object} node\n * @param {string} key\n * @return {object}\n */\nfunction getScope(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for (let i = 0, n = keys.length; i < n; ++i) {\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\n\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope(root, scope), values);\n }\n return merge(getScope(root, ''), scope);\n}\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Defaults {\n constructor(_descriptors, _appliers) {\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options) => getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n set(scope, values) {\n return set(this, scope, values);\n }\n\n /**\n\t * @param {string} scope\n\t */\n get(scope) {\n return getScope(this, scope);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n\n override(scope, values) {\n return set(overrides, scope, values);\n }\n\n /**\n\t * Routes the named defaults to fallback to another scope/name.\n\t * This routing is useful when those target values, like defaults.color, are changed runtime.\n\t * If the values would be copied, the runtime change would not take effect. By routing, the\n\t * fallback is evaluated at each access, so its always up to date.\n\t *\n\t * Example:\n\t *\n\t * \tdefaults.route('elements.arc', 'backgroundColor', '', 'color')\n\t * - reads the backgroundColor from defaults.color when undefined locally\n\t *\n\t * @param {string} scope Scope this route applies to.\n\t * @param {string} name Property name that should be routed to different namespace when not defined here.\n\t * @param {string} targetScope The namespace where those properties should be routed to.\n\t * Empty string ('') is the root of defaults.\n\t * @param {string} targetName The target name in the target scope the property should be routed to.\n\t */\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope(this, scope);\n const targetScopeObject = getScope(this, targetScope);\n const privateName = '_' + name;\n\n Object.defineProperties(scopeObject, {\n // A private property is defined to hold the actual value, when this property is set in its scope (set in the setter)\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n // The actual property is defined as getter/setter so we can do the routing when value is not locally set.\n [name]: {\n enumerable: true,\n get() {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set(value) {\n this[privateName] = value;\n }\n }\n });\n }\n\n apply(appliers) {\n appliers.forEach((apply) => apply(this));\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Defaults({\n _scriptable: (name) => !name.startsWith('on'),\n _indexable: (name) => name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false,\n }\n}, [applyAnimationsDefaults, applyLayoutsDefaults, applyScaleDefaults]);\n","import type {\n Chart,\n Point,\n FontSpec,\n CanvasFontSpec,\n PointStyle,\n RenderTextOpts,\n BackdropOptions\n} from '../types/index.js';\nimport type {\n TRBL,\n SplinePoint,\n RoundedRect,\n TRBLCorners\n} from '../types/geometric.js';\nimport {isArray, isNullOrUndef} from './helpers.core.js';\nimport {PI, TAU, HALF_PI, QUARTER_PI, TWO_THIRDS_PI, RAD_PER_DEG} from './helpers.math.js';\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */\nexport function toFontString(font: FontSpec) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n\n return (font.style ? font.style + ' ' : '')\n\t\t+ (font.weight ? font.weight + ' ' : '')\n\t\t+ font.size + 'px '\n\t\t+ font.family;\n}\n\n/**\n * @private\n */\nexport function _measureText(\n ctx: CanvasRenderingContext2D,\n data: Record,\n gc: string[],\n longest: number,\n string: string\n) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n\ntype Thing = string | undefined | null\ntype Things = (Thing | Thing[])[]\n\n/**\n * @private\n */\n// eslint-disable-next-line complexity\nexport function _longestText(\n ctx: CanvasRenderingContext2D,\n font: string,\n arrayOfThings: Things,\n cache?: {data?: Record, garbageCollect?: string[], font?: string}\n) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n\n ctx.save();\n\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i: number, j: number, jlen: number, thing: Thing | Thing[], nestedThing: Thing | Thing[];\n for (i = 0; i < ilen; i++) {\n thing = arrayOfThings[i];\n\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !isArray(thing)) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for (j = 0, jlen = thing.length; j < jlen; j++) {\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n\n ctx.restore();\n\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for (i = 0; i < gcLen; i++) {\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */\nexport function _alignPixel(chart: Chart, pixel: number, width: number) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n\n/**\n * Clears the entire canvas.\n */\nexport function clearCanvas(canvas: HTMLCanvasElement, ctx?: CanvasRenderingContext2D) {\n ctx = ctx || canvas.getContext('2d');\n\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\n\nexport interface DrawPointOptions {\n pointStyle: PointStyle;\n rotation?: number;\n radius: number;\n borderWidth: number;\n}\n\nexport function drawPoint(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number\n) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n drawPointLegend(ctx, options, x, y, null);\n}\n\n// eslint-disable-next-line complexity\nexport function drawPointLegend(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number,\n w: number\n) {\n let type: string, xOffset: number, yOffset: number, size: number, cornerRadius: number, width: number, xOffsetW: number, yOffsetW: number;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n\n ctx.beginPath();\n\n switch (style) {\n // Default includes circle\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n /* falls through */\n case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n /* falls through */\n case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */\nexport function _isPointInArea(\n point: Point,\n area: TRBL,\n margin?: number\n) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n\n return !area || (point && point.x > area.left - margin && point.x < area.right + margin &&\n\t\tpoint.y > area.top - margin && point.y < area.bottom + margin);\n}\n\nexport function clipArea(ctx: CanvasRenderingContext2D, area: TRBL) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\n\nexport function unclipArea(ctx: CanvasRenderingContext2D) {\n ctx.restore();\n}\n\n/**\n * @private\n */\nexport function _steppedLineTo(\n ctx: CanvasRenderingContext2D,\n previous: Point,\n target: Point,\n flip?: boolean,\n mode?: string\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @private\n */\nexport function _bezierCurveTo(\n ctx: CanvasRenderingContext2D,\n previous: SplinePoint,\n target: SplinePoint,\n flip?: boolean\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(\n flip ? previous.cp1x : previous.cp2x,\n flip ? previous.cp1y : previous.cp2y,\n flip ? target.cp2x : target.cp1x,\n flip ? target.cp2y : target.cp1y,\n target.x,\n target.y);\n}\n\nfunction setRenderOpts(ctx: CanvasRenderingContext2D, opts: RenderTextOpts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\n\nfunction decorateText(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n line: string,\n opts: RenderTextOpts\n) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */\n const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\n\nfunction drawBackdrop(ctx: CanvasRenderingContext2D, opts: BackdropOptions) {\n const oldColor = ctx.fillStyle;\n\n ctx.fillStyle = opts.color as string;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n\n/**\n * Render text onto the canvas\n */\nexport function renderText(\n ctx: CanvasRenderingContext2D,\n text: string | string[],\n x: number,\n y: number,\n font: CanvasFontSpec,\n opts: RenderTextOpts = {}\n) {\n const lines = isArray(text) ? text : [text];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i: number, line: string;\n\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n\n for (i = 0; i < lines.length; ++i) {\n line = lines[i];\n\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n\n y += Number(font.lineHeight);\n }\n\n ctx.restore();\n}\n\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */\nexport function addRoundedRectPath(\n ctx: CanvasRenderingContext2D,\n rect: RoundedRect & { radius: TRBLCorners }\n) {\n const {x, y, w, h, radius} = rect;\n\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\n","import defaults from '../core/core.defaults.js';\nimport {isArray, isObject, toDimension, valueOrDefault} from './helpers.core.js';\nimport {toFontString} from './helpers.canvas.js';\nimport type {ChartArea, FontSpec, Point} from '../types/index.js';\nimport type {TRBL, TRBLCorners} from '../types/geometric.js';\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n\n/**\n * @alias Chart.helpers.options\n * @namespace\n */\n/**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */\nexport function toLineHeight(value: number | string, size: number): number {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n\n value = +matches[2];\n\n switch (matches[3]) {\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n default:\n break;\n }\n\n return size * value;\n}\n\nconst numberOrZero = (v: unknown) => +v || 0;\n\n/**\n * @param value\n * @param props\n */\nexport function _readValueToProps(value: number | Record, props: K[]): Record;\nexport function _readValueToProps(value: number | Record, props: Record): Record;\nexport function _readValueToProps(value: number | Record, props: string[] | Record) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value)\n ? objProps\n ? prop => valueOrDefault(value[prop], value[props[prop]])\n : prop => value[prop]\n : () => value;\n\n for (const prop of keys) {\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */\nexport function toTRBL(value: number | TRBL | Point) {\n return _readValueToProps(value, {top: 'y', right: 'x', bottom: 'y', left: 'x'});\n}\n\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */\nexport function toTRBLCorners(value: number | TRBLCorners) {\n return _readValueToProps(value, ['topLeft', 'topRight', 'bottomLeft', 'bottomRight']);\n}\n\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */\nexport function toPadding(value?: number | TRBL): ChartArea {\n const obj = toTRBL(value) as ChartArea;\n\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n\n return obj;\n}\n\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */\n\nexport function toFont(options: Partial, fallback?: Partial) {\n options = options || {};\n fallback = fallback || defaults.font as FontSpec;\n\n let size = valueOrDefault(options.size, fallback.size);\n\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n\n font.string = toFontString(font);\n return font;\n}\n\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */\nexport function resolve(inputs: Array, context?: object, index?: number, info?: { cacheable: boolean }) {\n let cacheable = true;\n let i: number, ilen: number, value: unknown;\n\n for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */\nexport function _addGrace(minmax: { min: number; max: number; }, grace: number | string, beginAtZero: boolean) {\n const {min, max} = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value: number, add: number) => beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\n\n/**\n * Create a context inheriting parentContext\n * @param parentContext\n * @param context\n * @returns\n */\nexport function createContext(parentContext: null, context: T): T;\nexport function createContext(parentContext: P, context: T): P & T;\nexport function createContext(parentContext: object, context: object) {\n return Object.assign(Object.create(parentContext), context);\n}\n","/* eslint-disable @typescript-eslint/no-use-before-define */\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartMeta} from '../types/index.js';\nimport type {\n ResolverObjectKey,\n ResolverCache,\n ResolverProxy,\n DescriptorDefaults,\n Descriptor,\n ContextCache,\n ContextProxy\n} from './helpers.config.types.js';\nimport {isArray, isFunction, isObject, resolveObjectKey, _capitalize} from './helpers.core.js';\n\nexport * from './helpers.config.types.js';\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */\nexport function _createResolver<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n scopes: T,\n prefixes = [''],\n rootScopes?: R,\n fallback?: ResolverObjectKey,\n getTarget = () => scopes[0]\n) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === 'undefined') {\n fallback = _resolve('_fallback', scopes);\n }\n const cache: ResolverCache = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope: AnyObject) => _createResolver([scope, ...scopes], prefixes, finalRootScopes, fallback),\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop: string) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string) {\n return _cached(target, prop,\n () => _resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop: string) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys(target) {\n return getKeysFromAllScopes(target);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop: string, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n }) as ResolverProxy;\n}\n\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */\nexport function _attachContext<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n proxy: ResolverProxy,\n context: AnyObject,\n subProxy?: ResolverProxy,\n descriptorDefaults?: DescriptorDefaults\n) {\n const cache: ContextCache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx: AnyObject) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope: AnyObject) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string, receiver) {\n return _cached(target, prop,\n () => _resolveWithContext(target, prop, receiver));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return target._descriptors.allKeys\n ? Reflect.has(proxy, prop) ? {enumerable: true, configurable: true} : undefined\n : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(proxy);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop) {\n return Reflect.has(proxy, prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys() {\n return Reflect.ownKeys(proxy);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n }) as ContextProxy;\n}\n\n/**\n * @private\n */\nexport function _descriptors(\n proxy: ResolverCache,\n defaults: DescriptorDefaults = {scriptable: true, indexable: true}\n): Descriptor {\n const {_scriptable = defaults.scriptable, _indexable = defaults.indexable, _allKeys = defaults.allKeys} = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : () => _indexable\n };\n}\n\nconst readKey = (prefix: string, name: string) => prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop: string, value: unknown) => isObject(value) && prop !== 'adapters' &&\n (Object.getPrototypeOf(value) === null || value.constructor === Object);\n\nfunction _cached(\n target: AnyObject,\n prop: string,\n resolve: () => unknown\n) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) {\n return target[prop];\n }\n\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\n\nfunction _resolveWithContext(\n target: ContextCache,\n prop: string,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n let value = _proxy[prop]; // resolve from proxy\n\n // resolve with context\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n // if the resolved value is an object, create a sub resolver for it\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\n\nfunction _resolveScriptable(\n prop: string,\n getValue: (ctx: AnyObject, sub: AnyObject) => unknown,\n target: ContextCache,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _stack} = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n // When scriptable option returns an object, create a resolver on that.\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\n\nfunction _resolveArray(\n prop: string,\n value: unknown[],\n target: ContextCache,\n isIndexable: (key: string) => boolean\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n\n if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n return value[_context.index % value.length];\n } else if (isObject(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter(s => s !== arr);\n value = [];\n for (const item of arr) {\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\n\nfunction resolveFallback(\n fallback: ResolverObjectKey | ((prop: ResolverObjectKey, value: unknown) => ResolverObjectKey),\n prop: ResolverObjectKey,\n value: unknown\n) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\n\nconst getScope = (key: ResolverObjectKey, parent: AnyObject) => key === true ? parent\n : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\n\nfunction addScopes(\n set: Set,\n parentScopes: AnyObject[],\n key: ResolverObjectKey,\n parentFallback: ResolverObjectKey,\n value: unknown\n) {\n for (const parent of parentScopes) {\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n }\n } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n }\n return false;\n}\n\nfunction createSubResolver(\n parentScopes: AnyObject[],\n resolver: ResolverCache,\n prop: ResolverObjectKey,\n value: unknown\n) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [...parentScopes, ...rootScopes];\n const set = new Set();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (typeof fallback !== 'undefined' && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [''], rootScopes, fallback,\n () => subGetTarget(resolver, prop as string, value));\n}\n\nfunction addScopesFromKey(\n set: Set,\n allScopes: AnyObject[],\n key: ResolverObjectKey,\n fallback: ResolverObjectKey,\n item: unknown\n) {\n while (key) {\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\n\nfunction subGetTarget(\n resolver: ResolverCache,\n prop: string,\n value: unknown\n) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n // For array of objects, the object is used to store updated values\n return value;\n }\n return target || {};\n}\n\nfunction _resolveWithPrefixes(\n prop: string,\n prefixes: string[],\n scopes: AnyObject[],\n proxy: ResolverProxy\n) {\n let value: unknown;\n for (const prefix of prefixes) {\n value = _resolve(readKey(prefix, prop), scopes);\n if (typeof value !== 'undefined') {\n return needsSubResolver(prop, value)\n ? createSubResolver(scopes, proxy, prop, value)\n : value;\n }\n }\n}\n\nfunction _resolve(key: string, scopes: AnyObject[]) {\n for (const scope of scopes) {\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n}\n\nfunction getKeysFromAllScopes(target: ResolverCache) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\n\nfunction resolveKeysFromAllScopes(scopes: AnyObject[]) {\n const set = new Set();\n for (const scope of scopes) {\n for (const key of Object.keys(scope).filter(k => !k.startsWith('_'))) {\n set.add(key);\n }\n }\n return Array.from(set);\n}\n\nexport function _parseObjectDataRadialScale(\n meta: ChartMeta<'line' | 'scatter'>,\n data: AnyObject[],\n start: number,\n count: number\n) {\n const {iScale} = meta;\n const {key = 'r'} = this._parsing;\n const parsed = new Array<{r: unknown}>(count);\n let i: number, ilen: number, index: number, item: AnyObject;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n","import {almostEquals, distanceBetweenPoints, sign} from './helpers.math.js';\nimport {_isPointInArea} from './helpers.canvas.js';\nimport type {ChartArea} from '../types/index.js';\nimport type {SplinePoint} from '../types/geometric.js';\n\nconst EPSILON = Number.EPSILON || 1e-14;\n\ntype OptionalSplinePoint = SplinePoint | false\nconst getPoint = (points: SplinePoint[], i: number): OptionalSplinePoint => i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis: 'x' | 'y') => indexAxis === 'x' ? 'y' : 'x';\n\nexport function splineCurve(\n firstPoint: SplinePoint,\n middlePoint: SplinePoint,\n afterPoint: SplinePoint,\n t: number\n): {\n previous: SplinePoint\n next: SplinePoint\n } {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n\n // This function must also respect \"skipped\" points\n\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n\n/**\n * Adjust tangents to ensure monotonic properties\n */\nfunction monotoneAdjust(points: SplinePoint[], deltaK: number[], mK: number[]) {\n const pointsLen = points.length;\n\n let alphaK: number, betaK: number, tauK: number, squaredMagnitude: number, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n for (let i = 0; i < pointsLen - 1; ++i) {\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\n\nfunction monotoneCompute(points: SplinePoint[], mK: number[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta: number, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (let i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */\nexport function splineCurveMonotone(points: SplinePoint[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK: number[] = Array(pointsLen).fill(0);\n const mK: number[] = Array(pointsLen);\n\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i]\n : !pointAfter ? deltaK[i - 1]\n : (sign(deltaK[i - 1]) !== sign(deltaK[i])) ? 0\n : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n\n monotoneAdjust(points, deltaK, mK);\n\n monotoneCompute(points, mK, indexAxis);\n}\n\nfunction capControlPoint(pt: number, min: number, max: number) {\n return Math.max(Math.min(pt, max), min);\n}\n\nfunction capBezierPoints(points: SplinePoint[], area: ChartArea) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n\n/**\n * @private\n */\nexport function _updateBezierControlPoints(\n points: SplinePoint[],\n options,\n area: ChartArea,\n loop: boolean,\n indexAxis: 'x' | 'y'\n) {\n let i: number, ilen: number, point: SplinePoint, controlPoints: ReturnType;\n\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt) => !pt.skip);\n }\n\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n point = points[i];\n controlPoints = splineCurve(\n prev,\n point,\n points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen],\n options.tension\n );\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n","import type {ChartArea, Scale} from '../types/index.js';\nimport type Chart from '../core/core.controller.js';\nimport type {ChartEvent} from '../types.js';\nimport {INFINITY} from './helpers.math.js';\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */\n\n/**\n * @private\n */\nexport function _isDomSupported(): boolean {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * @private\n */\nexport function _getParentNode(domNode: HTMLCanvasElement): HTMLCanvasElement {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = (parent as ShadowRoot).host;\n }\n return parent as HTMLCanvasElement;\n}\n\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */\n\nfunction parseMaxStyle(styleValue: string | number, node: HTMLElement, parentProperty: string) {\n let valueInPixels: number;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = (valueInPixels / 100) * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n\n return valueInPixels;\n}\n\nconst getComputedStyle = (element: HTMLElement): CSSStyleDeclaration =>\n element.ownerDocument.defaultView.getComputedStyle(element, null);\n\nexport function getStyle(el: HTMLElement, property: string): string {\n return getComputedStyle(el).getPropertyValue(property);\n}\n\nconst positions = ['top', 'right', 'bottom', 'left'];\nfunction getPositionedStyle(styles: CSSStyleDeclaration, style: string, suffix?: string): ChartArea {\n const result = {} as ChartArea;\n suffix = suffix ? '-' + suffix : '';\n for (let i = 0; i < 4; i++) {\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\n\nconst useOffsetPos = (x: number, y: number, target: HTMLElement | EventTarget) =>\n (x > 0 || y > 0) && (!target || !(target as HTMLElement).shadowRoot);\n\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */\nfunction getCanvasPosition(\n e: Event | TouchEvent | MouseEvent,\n canvas: HTMLCanvasElement\n): {\n x: number;\n y: number;\n box: boolean;\n } {\n const touches = (e as TouchEvent).touches;\n const source = (touches && touches.length ? touches[0] : e) as MouseEvent;\n const {offsetX, offsetY} = source as MouseEvent;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {x, y, box};\n}\n\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */\n\nexport function getRelativePosition(\n event: Event | ChartEvent | TouchEvent | MouseEvent,\n chart: Chart\n): { x: number; y: number } {\n if ('native' in event) {\n return event;\n }\n\n const {canvas, currentDevicePixelRatio} = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const {x, y, box} = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n\n let {width, height} = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\n\nfunction getContainerSize(canvas: HTMLCanvasElement, width: number, height: number): Partial {\n let maxWidth: number, maxHeight: number;\n\n if (width === undefined || height === undefined) {\n const container = _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\n\nconst round1 = (v: number) => Math.round(v * 10) / 10;\n\n// eslint-disable-next-line complexity\nexport function getMaximumSize(\n canvas: HTMLCanvasElement,\n bbWidth?: number,\n bbHeight?: number,\n aspectRatio?: number\n): { width: number; height: number } {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let {width, height} = containerSize;\n\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n\n return {width, height};\n}\n\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */\nexport function retinaScale(\n chart: Chart,\n forceRatio: number,\n forceStyle?: boolean\n): boolean | void {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n\n const canvas = chart.canvas;\n\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || (!canvas.style.height && !canvas.style.width))) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n\n if (chart.currentDevicePixelRatio !== pixelRatio\n || canvas.height !== deviceHeight\n || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */\nexport const supportsEventListenerOptions = (function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive() { // This function will be called when the browser attempts to access the passive property.\n passiveSupported = true;\n return false;\n }\n } as EventListenerOptions;\n\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}());\n\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */\n\nexport function readUsedSize(\n element: HTMLElement,\n property: 'width' | 'height'\n): number | undefined {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n","import type {Point, SplinePoint} from '../types/geometric.js';\n\n/**\n * @private\n */\nexport function _pointInLine(p1: Point, p2: Point, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n\n/**\n * @private\n */\nexport function _steppedInterpolation(\n p1: Point,\n p2: Point,\n t: number, mode: 'middle' | 'after' | unknown\n) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y\n : mode === 'after' ? t < 1 ? p1.y : p2.y\n : t > 0 ? p2.y : p1.y\n };\n}\n\n/**\n * @private\n */\nexport function _bezierInterpolation(p1: SplinePoint, p2: SplinePoint, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n const cp1 = {x: p1.cp2x, y: p1.cp2y};\n const cp2 = {x: p2.cp1x, y: p2.cp1y};\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n","export interface RTLAdapter {\n x(x: number): number;\n setWidth(w: number): void;\n textAlign(align: 'center' | 'left' | 'right'): 'center' | 'left' | 'right';\n xPlus(x: number, value: number): number;\n leftForLtr(x: number, itemWidth: number): number;\n}\n\nconst getRightToLeftAdapter = function(rectX: number, width: number): RTLAdapter {\n return {\n x(x) {\n return rectX + rectX + width - x;\n },\n setWidth(w) {\n width = w;\n },\n textAlign(align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus(x, value) {\n return x - value;\n },\n leftForLtr(x, itemWidth) {\n return x - itemWidth;\n },\n };\n};\n\nconst getLeftToRightAdapter = function(): RTLAdapter {\n return {\n x(x) {\n return x;\n },\n setWidth(w) { // eslint-disable-line no-unused-vars\n },\n textAlign(align) {\n return align;\n },\n xPlus(x, value) {\n return x + value;\n },\n leftForLtr(x, _itemWidth) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return x;\n },\n };\n};\n\nexport function getRtlAdapter(rtl: boolean, rectX: number, width: number) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\n\nexport function overrideTextDirection(ctx: CanvasRenderingContext2D, direction: 'ltr' | 'rtl') {\n let style: CSSStyleDeclaration, original: [string, string];\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction'),\n ];\n\n style.setProperty('direction', direction, 'important');\n (ctx as { prevTextDirection?: [string, string] }).prevTextDirection = original;\n }\n}\n\nexport function restoreTextDirection(ctx: CanvasRenderingContext2D, original?: [string, string]) {\n if (original !== undefined) {\n delete (ctx as { prevTextDirection?: [string, string] }).prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n","import {_angleBetween, _angleDiff, _isBetween, _normalizeAngle} from './helpers.math.js';\nimport {createContext} from './helpers.options.js';\nimport {isPatternOrGradient} from './helpers.color.js';\n\n/**\n * @typedef { import('../elements/element.line.js').default } LineElement\n * @typedef { import('../elements/element.point.js').default } PointElement\n * @typedef {{start: number, end: number, loop: boolean, style?: any}} Segment\n */\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle,\n };\n }\n return {\n between: _isBetween,\n compare: (a, b) => a - b,\n normalize: x => x\n };\n}\n\nfunction normalizeSegment({start, end, count, loop, style}) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\n\nfunction getSegment(segment, points, bounds) {\n const {property, start: startBound, end: endBound} = bounds;\n const {between, normalize} = propertyFn(property);\n const count = points.length;\n // eslint-disable-next-line prefer-const\n let {start, end, loop} = segment;\n let i, ilen;\n\n if (loop) {\n start += count;\n end += count;\n for (i = 0, ilen = count; i < ilen; ++i) {\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n\n if (end < start) {\n end += count;\n }\n return {start, end, loop, style: segment.style};\n}\n\n/**\n * Returns the sub-segment(s) of a line segment that fall in the given bounds\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} [segment.style] - segment style\n * @param {PointElement[]} points - the points that this segment refers to\n * @param {object} [bounds]\n * @param {string} bounds.property - the property of a `PointElement` we are bounding. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the property\n * @param {number} bounds.end - end value of the property\n * @private\n **/\nexport function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [segment];\n }\n\n const {property, start: startBound, end: endBound} = bounds;\n const count = points.length;\n const {compare, between, normalize} = propertyFn(property);\n const {start, end, loop, style} = getSegment(segment, points, bounds);\n\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n\n const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = () => inside || startIsBefore();\n const shouldStop = () => !inside || endIsBefore();\n\n for (let i = start, prev = start; i <= end; ++i) {\n point = points[i % count];\n\n if (point.skip) {\n continue;\n }\n\n value = normalize(point[property]);\n\n if (value === prevValue) {\n continue;\n }\n\n inside = between(value, startBound, endBound);\n\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({start: subStart, end: i, loop, count, style}));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n\n if (subStart !== null) {\n result.push(normalizeSegment({start: subStart, end, loop, count, style}));\n }\n\n return result;\n}\n\n\n/**\n * Returns the segments of the line that are inside given bounds\n * @param {LineElement} line\n * @param {object} [bounds]\n * @param {string} bounds.property - the property we are bounding with. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the `property`\n * @param {number} bounds.end - end value of the `property`\n * @private\n */\nexport function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n\n for (let i = 0; i < segments.length; i++) {\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n\n/**\n * Find start and end index of a line.\n */\nfunction findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n\n if (loop && !spanGaps) {\n // loop and not spanning gaps, first find a gap to start from\n while (start < count && !points[start].skip) {\n start++;\n }\n }\n\n // find first non skipped point (after the first gap possibly)\n while (start < count && points[start].skip) {\n start++;\n }\n\n // if we looped to count, start needs to be 0\n start %= count;\n\n if (loop) {\n // loop will go past count, if start > 0\n end += start;\n }\n\n while (end > start && points[end % count].skip) {\n end--;\n }\n\n // end could be more than count, normalize\n end %= count;\n\n return {start, end};\n}\n\n/**\n * Compute solid segments from Points, when spanGaps === false\n * @param {PointElement[]} points - the points\n * @param {number} start - start index\n * @param {number} max - max index (can go past count on a loop)\n * @param {boolean} loop - boolean indicating that this would be a loop if no gaps are found\n */\nfunction solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n\n for (end = start + 1; end <= max; ++end) {\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({start: start % count, end: (end - 1) % count, loop});\n // @ts-ignore\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n\n if (last !== null) {\n result.push({start: start % count, end: last % count, loop});\n }\n\n return result;\n}\n\n/**\n * Compute the continuous segments that define the whole line\n * There can be skipped points within a segment, if spanGaps is true.\n * @param {LineElement} line\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n * @private\n */\nexport function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n\n if (!count) {\n return [];\n }\n\n const loop = !!line._loop;\n const {start, end} = findStartAndEnd(points, count, loop, spanGaps);\n\n if (spanGaps === true) {\n return splitByStyles(line, [{start, end, loop}], points, segmentOptions);\n }\n\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n\n/**\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n\n/**\n * @param {LineElement} line\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const {_datasetIndex: datasetIndex, options: {spanGaps}} = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n // Style can not start/end on a skipped point, adjust indices accordingly\n s += count;\n while (points[s % count].skip) {\n s -= dir;\n }\n while (points[e % count].skip) {\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({start: s % count, end: e % count, loop: l, style: st});\n prevStyle = st;\n start = e % count;\n }\n }\n\n for (const segment of segments) {\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for (i = start + 1; i <= segment.end; i++) {\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n\n return result;\n}\n\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\n\nfunction styleChanged(style, prevStyle) {\n if (!prevStyle) {\n return false;\n }\n const cache = [];\n const replacer = function(key, value) {\n if (!isPatternOrGradient(value)) {\n return value;\n }\n if (!cache.includes(value)) {\n cache.push(value);\n }\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n","/*!\n * @kurkle/color v0.3.2\n * https://github.com/kurkle/color#readme\n * (c) 2023 Jukka Kurkela\n * Released under the MIT License\n */\nfunction round(v) {\n return v + 0.5 | 0;\n}\nconst lim = (v, l, h) => Math.max(Math.min(v, h), l);\nfunction p2b(v) {\n return lim(round(v * 2.55), 0, 255);\n}\nfunction b2p(v) {\n return lim(round(v / 2.55), 0, 100);\n}\nfunction n2b(v) {\n return lim(round(v * 255), 0, 255);\n}\nfunction b2n(v) {\n return lim(round(v / 2.55) / 100, 0, 1);\n}\nfunction n2p(v) {\n return lim(round(v * 100), 0, 100);\n}\n\nconst map$1 = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15};\nconst hex = [...'0123456789ABCDEF'];\nconst h1 = b => hex[b & 0xF];\nconst h2 = b => hex[(b & 0xF0) >> 4] + hex[b & 0xF];\nconst eq = b => ((b & 0xF0) >> 4) === (b & 0xF);\nconst isShort = v => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);\nfunction hexParse(str) {\n var len = str.length;\n var ret;\n if (str[0] === '#') {\n if (len === 4 || len === 5) {\n ret = {\n r: 255 & map$1[str[1]] * 17,\n g: 255 & map$1[str[2]] * 17,\n b: 255 & map$1[str[3]] * 17,\n a: len === 5 ? map$1[str[4]] * 17 : 255\n };\n } else if (len === 7 || len === 9) {\n ret = {\n r: map$1[str[1]] << 4 | map$1[str[2]],\n g: map$1[str[3]] << 4 | map$1[str[4]],\n b: map$1[str[5]] << 4 | map$1[str[6]],\n a: len === 9 ? (map$1[str[7]] << 4 | map$1[str[8]]) : 255\n };\n }\n }\n return ret;\n}\nconst alpha = (a, f) => a < 255 ? f(a) : '';\nfunction hexString(v) {\n var f = isShort(v) ? h1 : h2;\n return v\n ? '#' + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f)\n : undefined;\n}\n\nconst HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction hsl2rgbn(h, s, l) {\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [f(0), f(8), f(4)];\n}\nfunction hsv2rgbn(h, s, v) {\n const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n return [f(5), f(3), f(1)];\n}\nfunction hwb2rgbn(h, w, b) {\n const rgb = hsl2rgbn(h, 1, 0.5);\n let i;\n if (w + b > 1) {\n i = 1 / (w + b);\n w *= i;\n b *= i;\n }\n for (i = 0; i < 3; i++) {\n rgb[i] *= 1 - w - b;\n rgb[i] += w;\n }\n return rgb;\n}\nfunction hueValue(r, g, b, d, max) {\n if (r === max) {\n return ((g - b) / d) + (g < b ? 6 : 0);\n }\n if (g === max) {\n return (b - r) / d + 2;\n }\n return (r - g) / d + 4;\n}\nfunction rgb2hsl(v) {\n const range = 255;\n const r = v.r / range;\n const g = v.g / range;\n const b = v.b / range;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s, d;\n if (max !== min) {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = hueValue(r, g, b, d, max);\n h = h * 60 + 0.5;\n }\n return [h | 0, s || 0, l];\n}\nfunction calln(f, a, b, c) {\n return (\n Array.isArray(a)\n ? f(a[0], a[1], a[2])\n : f(a, b, c)\n ).map(n2b);\n}\nfunction hsl2rgb(h, s, l) {\n return calln(hsl2rgbn, h, s, l);\n}\nfunction hwb2rgb(h, w, b) {\n return calln(hwb2rgbn, h, w, b);\n}\nfunction hsv2rgb(h, s, v) {\n return calln(hsv2rgbn, h, s, v);\n}\nfunction hue(h) {\n return (h % 360 + 360) % 360;\n}\nfunction hueParse(str) {\n const m = HUE_RE.exec(str);\n let a = 255;\n let v;\n if (!m) {\n return;\n }\n if (m[5] !== v) {\n a = m[6] ? p2b(+m[5]) : n2b(+m[5]);\n }\n const h = hue(+m[2]);\n const p1 = +m[3] / 100;\n const p2 = +m[4] / 100;\n if (m[1] === 'hwb') {\n v = hwb2rgb(h, p1, p2);\n } else if (m[1] === 'hsv') {\n v = hsv2rgb(h, p1, p2);\n } else {\n v = hsl2rgb(h, p1, p2);\n }\n return {\n r: v[0],\n g: v[1],\n b: v[2],\n a: a\n };\n}\nfunction rotate(v, deg) {\n var h = rgb2hsl(v);\n h[0] = hue(h[0] + deg);\n h = hsl2rgb(h);\n v.r = h[0];\n v.g = h[1];\n v.b = h[2];\n}\nfunction hslString(v) {\n if (!v) {\n return;\n }\n const a = rgb2hsl(v);\n const h = a[0];\n const s = n2p(a[1]);\n const l = n2p(a[2]);\n return v.a < 255\n ? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`\n : `hsl(${h}, ${s}%, ${l}%)`;\n}\n\nconst map = {\n x: 'dark',\n Z: 'light',\n Y: 're',\n X: 'blu',\n W: 'gr',\n V: 'medium',\n U: 'slate',\n A: 'ee',\n T: 'ol',\n S: 'or',\n B: 'ra',\n C: 'lateg',\n D: 'ights',\n R: 'in',\n Q: 'turquois',\n E: 'hi',\n P: 'ro',\n O: 'al',\n N: 'le',\n M: 'de',\n L: 'yello',\n F: 'en',\n K: 'ch',\n G: 'arks',\n H: 'ea',\n I: 'ightg',\n J: 'wh'\n};\nconst names$1 = {\n OiceXe: 'f0f8ff',\n antiquewEte: 'faebd7',\n aqua: 'ffff',\n aquamarRe: '7fffd4',\n azuY: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '0',\n blanKedOmond: 'ffebcd',\n Xe: 'ff',\n XeviTet: '8a2be2',\n bPwn: 'a52a2a',\n burlywood: 'deb887',\n caMtXe: '5f9ea0',\n KartYuse: '7fff00',\n KocTate: 'd2691e',\n cSO: 'ff7f50',\n cSnflowerXe: '6495ed',\n cSnsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: 'ffff',\n xXe: '8b',\n xcyan: '8b8b',\n xgTMnPd: 'b8860b',\n xWay: 'a9a9a9',\n xgYF: '6400',\n xgYy: 'a9a9a9',\n xkhaki: 'bdb76b',\n xmagFta: '8b008b',\n xTivegYF: '556b2f',\n xSange: 'ff8c00',\n xScEd: '9932cc',\n xYd: '8b0000',\n xsOmon: 'e9967a',\n xsHgYF: '8fbc8f',\n xUXe: '483d8b',\n xUWay: '2f4f4f',\n xUgYy: '2f4f4f',\n xQe: 'ced1',\n xviTet: '9400d3',\n dAppRk: 'ff1493',\n dApskyXe: 'bfff',\n dimWay: '696969',\n dimgYy: '696969',\n dodgerXe: '1e90ff',\n fiYbrick: 'b22222',\n flSOwEte: 'fffaf0',\n foYstWAn: '228b22',\n fuKsia: 'ff00ff',\n gaRsbSo: 'dcdcdc',\n ghostwEte: 'f8f8ff',\n gTd: 'ffd700',\n gTMnPd: 'daa520',\n Way: '808080',\n gYF: '8000',\n gYFLw: 'adff2f',\n gYy: '808080',\n honeyMw: 'f0fff0',\n hotpRk: 'ff69b4',\n RdianYd: 'cd5c5c',\n Rdigo: '4b0082',\n ivSy: 'fffff0',\n khaki: 'f0e68c',\n lavFMr: 'e6e6fa',\n lavFMrXsh: 'fff0f5',\n lawngYF: '7cfc00',\n NmoncEffon: 'fffacd',\n ZXe: 'add8e6',\n ZcSO: 'f08080',\n Zcyan: 'e0ffff',\n ZgTMnPdLw: 'fafad2',\n ZWay: 'd3d3d3',\n ZgYF: '90ee90',\n ZgYy: 'd3d3d3',\n ZpRk: 'ffb6c1',\n ZsOmon: 'ffa07a',\n ZsHgYF: '20b2aa',\n ZskyXe: '87cefa',\n ZUWay: '778899',\n ZUgYy: '778899',\n ZstAlXe: 'b0c4de',\n ZLw: 'ffffe0',\n lime: 'ff00',\n limegYF: '32cd32',\n lRF: 'faf0e6',\n magFta: 'ff00ff',\n maPon: '800000',\n VaquamarRe: '66cdaa',\n VXe: 'cd',\n VScEd: 'ba55d3',\n VpurpN: '9370db',\n VsHgYF: '3cb371',\n VUXe: '7b68ee',\n VsprRggYF: 'fa9a',\n VQe: '48d1cc',\n VviTetYd: 'c71585',\n midnightXe: '191970',\n mRtcYam: 'f5fffa',\n mistyPse: 'ffe4e1',\n moccasR: 'ffe4b5',\n navajowEte: 'ffdead',\n navy: '80',\n Tdlace: 'fdf5e6',\n Tive: '808000',\n TivedBb: '6b8e23',\n Sange: 'ffa500',\n SangeYd: 'ff4500',\n ScEd: 'da70d6',\n pOegTMnPd: 'eee8aa',\n pOegYF: '98fb98',\n pOeQe: 'afeeee',\n pOeviTetYd: 'db7093',\n papayawEp: 'ffefd5',\n pHKpuff: 'ffdab9',\n peru: 'cd853f',\n pRk: 'ffc0cb',\n plum: 'dda0dd',\n powMrXe: 'b0e0e6',\n purpN: '800080',\n YbeccapurpN: '663399',\n Yd: 'ff0000',\n Psybrown: 'bc8f8f',\n PyOXe: '4169e1',\n saddNbPwn: '8b4513',\n sOmon: 'fa8072',\n sandybPwn: 'f4a460',\n sHgYF: '2e8b57',\n sHshell: 'fff5ee',\n siFna: 'a0522d',\n silver: 'c0c0c0',\n skyXe: '87ceeb',\n UXe: '6a5acd',\n UWay: '708090',\n UgYy: '708090',\n snow: 'fffafa',\n sprRggYF: 'ff7f',\n stAlXe: '4682b4',\n tan: 'd2b48c',\n teO: '8080',\n tEstN: 'd8bfd8',\n tomato: 'ff6347',\n Qe: '40e0d0',\n viTet: 'ee82ee',\n JHt: 'f5deb3',\n wEte: 'ffffff',\n wEtesmoke: 'f5f5f5',\n Lw: 'ffff00',\n LwgYF: '9acd32'\n};\nfunction unpack() {\n const unpacked = {};\n const keys = Object.keys(names$1);\n const tkeys = Object.keys(map);\n let i, j, k, ok, nk;\n for (i = 0; i < keys.length; i++) {\n ok = nk = keys[i];\n for (j = 0; j < tkeys.length; j++) {\n k = tkeys[j];\n nk = nk.replace(k, map[k]);\n }\n k = parseInt(names$1[ok], 16);\n unpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];\n }\n return unpacked;\n}\n\nlet names;\nfunction nameParse(str) {\n if (!names) {\n names = unpack();\n names.transparent = [0, 0, 0, 0];\n }\n const a = names[str.toLowerCase()];\n return a && {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length === 4 ? a[3] : 255\n };\n}\n\nconst RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction rgbParse(str) {\n const m = RGB_RE.exec(str);\n let a = 255;\n let r, g, b;\n if (!m) {\n return;\n }\n if (m[7] !== r) {\n const v = +m[7];\n a = m[8] ? p2b(v) : lim(v * 255, 0, 255);\n }\n r = +m[1];\n g = +m[3];\n b = +m[5];\n r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));\n g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));\n b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\nfunction rgbString(v) {\n return v && (\n v.a < 255\n ? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`\n : `rgb(${v.r}, ${v.g}, ${v.b})`\n );\n}\n\nconst to = v => v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst from = v => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction interpolate(rgb1, rgb2, t) {\n const r = from(b2n(rgb1.r));\n const g = from(b2n(rgb1.g));\n const b = from(b2n(rgb1.b));\n return {\n r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),\n g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),\n b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),\n a: rgb1.a + t * (rgb2.a - rgb1.a)\n };\n}\n\nfunction modHSL(v, i, ratio) {\n if (v) {\n let tmp = rgb2hsl(v);\n tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n tmp = hsl2rgb(tmp);\n v.r = tmp[0];\n v.g = tmp[1];\n v.b = tmp[2];\n }\n}\nfunction clone(v, proto) {\n return v ? Object.assign(proto || {}, v) : v;\n}\nfunction fromObject(input) {\n var v = {r: 0, g: 0, b: 0, a: 255};\n if (Array.isArray(input)) {\n if (input.length >= 3) {\n v = {r: input[0], g: input[1], b: input[2], a: 255};\n if (input.length > 3) {\n v.a = n2b(input[3]);\n }\n }\n } else {\n v = clone(input, {r: 0, g: 0, b: 0, a: 1});\n v.a = n2b(v.a);\n }\n return v;\n}\nfunction functionParse(str) {\n if (str.charAt(0) === 'r') {\n return rgbParse(str);\n }\n return hueParse(str);\n}\nclass Color {\n constructor(input) {\n if (input instanceof Color) {\n return input;\n }\n const type = typeof input;\n let v;\n if (type === 'object') {\n v = fromObject(input);\n } else if (type === 'string') {\n v = hexParse(input) || nameParse(input) || functionParse(input);\n }\n this._rgb = v;\n this._valid = !!v;\n }\n get valid() {\n return this._valid;\n }\n get rgb() {\n var v = clone(this._rgb);\n if (v) {\n v.a = b2n(v.a);\n }\n return v;\n }\n set rgb(obj) {\n this._rgb = fromObject(obj);\n }\n rgbString() {\n return this._valid ? rgbString(this._rgb) : undefined;\n }\n hexString() {\n return this._valid ? hexString(this._rgb) : undefined;\n }\n hslString() {\n return this._valid ? hslString(this._rgb) : undefined;\n }\n mix(color, weight) {\n if (color) {\n const c1 = this.rgb;\n const c2 = color.rgb;\n let w2;\n const p = weight === w2 ? 0.5 : weight;\n const w = 2 * p - 1;\n const a = c1.a - c2.a;\n const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n w2 = 1 - w1;\n c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n c1.a = p * c1.a + (1 - p) * c2.a;\n this.rgb = c1;\n }\n return this;\n }\n interpolate(color, t) {\n if (color) {\n this._rgb = interpolate(this._rgb, color._rgb, t);\n }\n return this;\n }\n clone() {\n return new Color(this.rgb);\n }\n alpha(a) {\n this._rgb.a = n2b(a);\n return this;\n }\n clearer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 - ratio;\n return this;\n }\n greyscale() {\n const rgb = this._rgb;\n const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n rgb.r = rgb.g = rgb.b = val;\n return this;\n }\n opaquer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 + ratio;\n return this;\n }\n negate() {\n const v = this._rgb;\n v.r = 255 - v.r;\n v.g = 255 - v.g;\n v.b = 255 - v.b;\n return this;\n }\n lighten(ratio) {\n modHSL(this._rgb, 2, ratio);\n return this;\n }\n darken(ratio) {\n modHSL(this._rgb, 2, -ratio);\n return this;\n }\n saturate(ratio) {\n modHSL(this._rgb, 1, ratio);\n return this;\n }\n desaturate(ratio) {\n modHSL(this._rgb, 1, -ratio);\n return this;\n }\n rotate(deg) {\n rotate(this._rgb, deg);\n return this;\n }\n}\n\nfunction index_esm(input) {\n return new Color(input);\n}\n\nexport { Color, b2n, b2p, index_esm as default, hexParse, hexString, hsl2rgb, hslString, hsv2rgb, hueParse, hwb2rgb, lim, n2b, n2p, nameParse, p2b, rgb2hsl, rgbParse, rgbString, rotate, round };\n","/**!\n * Sortable 1.15.1\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n return target;\n}\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n return _typeof(obj);\n}\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = _objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.1\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction matches( /**HTMLElement*/el, /**String*/selector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n return false;\n}\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n return null;\n}\nvar R_SPACE = /\\s+/g;\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\nfunction css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n } while (!selfOnly && (el = el.parentNode));\n }\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n return list;\n }\n return [];\n}\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect();\n\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n } while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n\n/**\r\n * Returns the content rect of the element (bounding rect minus border and padding)\r\n * @param {HTMLElement} el \r\n */\nfunction getContentRect(el) {\n var rect = getRect(el);\n var paddingLeft = parseInt(css(el, 'padding-left')),\n paddingTop = parseInt(css(el, 'padding-top')),\n paddingRight = parseInt(css(el, 'padding-right')),\n paddingBottom = parseInt(css(el, 'padding-bottom'));\n rect.top += paddingTop + parseInt(css(el, 'border-top-width'));\n rect.left += paddingLeft + parseInt(css(el, 'border-left-width'));\n // Client Width/Height includes padding only\n rect.width = el.clientWidth - paddingLeft - paddingRight;\n rect.height = el.clientHeight - paddingTop - paddingBottom;\n rect.bottom = rect.top + rect.height;\n rect.right = rect.left + rect.width;\n return rect;\n}\n\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n\n /* jshint boss:true */\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n currentChild++;\n }\n i++;\n }\n return null;\n}\n\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n return last || null;\n}\n\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */\nfunction index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) {\n return -1;\n }\n\n /* jshint boss:true */\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n return index;\n}\n\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n return [offsetLeft, offsetTop];\n}\n\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n } while (elem = elem.parentNode);\n return getWindowScrollingElement();\n}\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n return dst;\n}\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar _throttleTimeout;\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);\n\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&\n // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n }\n\n // if fromRect != toRect: animate\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) {\n time = _this.options.animation;\n }\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction repaint(target) {\n return target.offsetWidth;\n}\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n\n // Add default options from plugin\n _extends(defaults, initialized.defaults);\n });\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\n ghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n\n _silent = false,\n savedInputChecked = [];\n\n/** @const */\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\n supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return;\n // false when <= IE11\n if (IE11OrLess) {\n return false;\n }\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n }(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n },\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n },\n /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n },\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n },\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n },\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n };\n\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[expando]._onDragOver(event);\n }\n }\n};\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n this.el = el; // root element\n this.options = options = _extends({}, options);\n\n // Export instance\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults);\n\n // Set default options\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n _prepareGroup(options);\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n }\n\n // Bind events\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n sortables.push(this.el);\n\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n\n // Add animation state manager\n _extends(this, AnimationStateManager());\n}\nSortable.prototype = /** @lends Sortable.prototype */{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {\n if (!evt.cancelable) return;\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n _saveInputCheckedState(el);\n\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if (dragEl) {\n return;\n }\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n }\n\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) {\n return;\n }\n\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n target = closest(target, options.draggable, el, false);\n if (target && target.animated) {\n return;\n }\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n }\n\n // Get the index of the dragged element within its parent\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable);\n\n // Check filter\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n }\n\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n }\n\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n\n // Drag start event\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n });\n\n // Chosen item\n toggleClass(dragEl, options.chosenClass, true);\n };\n\n // Disable \"draggable\"\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop);\n\n // Make dragEl draggable (must be before delay for FireFox)\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n pluginEvent('delayStart', this, {\n evt: evt\n });\n\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n awaitingDragStarted = false;\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n var options = this.options;\n\n // Apply effect\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost();\n\n // Drag start event\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n _hideGhostForTarget();\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n target = parent; // store last element\n }\n /* jshint boss:true */ while (parent = parent.parentNode);\n }\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n\n // only set the status to dragging, when we are actually dragging\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n this._onDragStart(evt, true);\n }\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options;\n\n // Position absolutely\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl);\n\n // Set transform-origin\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n pluginEvent('setupClone', this);\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n this._hideClone();\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n }\n\n // #1143: IFrame support workaround\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n _this._hideClone();\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true);\n\n // Set proper drop events\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n on(document, 'drop', _this);\n\n // #1276 fix:\n css(dragEl, 'transform', 'translateZ(0)');\n }\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver( /**Event*/evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n if (_silent) return;\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n\n // Capture animation state\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n _this.captureAnimationState();\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n }\n\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n }\n\n // Animation\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n\n // Null lastTarget if it is not inside a previously swapped element\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n }\n\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n\n // Do not detect for empty insert if already inserted\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n\n // Call when dragEl has been inserted\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n if (revert) {\n parentEl = rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent('revert');\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n return completed(true);\n }\n var elLastChild = lastChild(el, options.draggable);\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n }\n\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n if (target) {\n targetRect = getRect(target);\n }\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n if (firstChild === dragEl) {\n return completed(false);\n }\n target = firstChild;\n targetRect = getRect(target);\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n }\n\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n parentEl = dragEl.parentNode; // actualization\n\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n changed();\n return completed(true);\n }\n }\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop( /**Event*/evt) {\n var el = this.el,\n options = this.options;\n\n // Get the index of the dragged element within its parent\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode;\n\n // Get again after plugin event\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n if (Sortable.eventCanceled) {\n this._nulling();\n return;\n }\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n _cancelNextTick(this.cloneId);\n _cancelNextTick(this._dragStartId);\n\n // Unbind events\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n css(dragEl, 'transform', '');\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n _disableDraggable(dragEl);\n dragEl.style['will-change'] = '';\n\n // Remove classes\n // ghostClass is added in dragStarted\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n toggleClass(dragEl, this.options.chosenClass, false);\n\n // Drag stop event\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n // Remove event\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // drag from one list and drop into another\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent( /**Event*/evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n break;\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n _globalDragOver(evt);\n }\n break;\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n for (; i < n; i++) {\n el = children[i];\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n return;\n }\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return;\n\n // show clone at dragEl or original position\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\nfunction _globalDragOver( /**Event*/evt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n evt.cancelable && evt.preventDefault();\n}\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n return retVal;\n}\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\nfunction _unsilent() {\n _silent = false;\n}\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var sortableContentRect = getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX < sortableContentRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < sortableContentRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction _ghostIsLast(evt, vertical, sortable) {\n var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var sortableContentRect = getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX > sortableContentRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > sortableContentRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n return 0;\n}\n\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n while (i--) {\n sum += str.charCodeAt(i);\n }\n return sum.toString(36);\n}\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n}\n\n// Fixed #973:\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n}\n\n// Export utils\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\nSortable.get = function (element) {\n return element[expando];\n};\n\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n};\n\n// Export\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt;\n\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback);\n\n // Listener for pointer element change\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn;\n\n // New scroll root, set scrollEl\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n var layersOut = 0;\n var currentParent = scrollEl;\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n }\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction Revert() {}\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n this.sortable.animateAll();\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\nfunction Remove() {}\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\n multiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\n folding = false,\n // Folding any other time\n dragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n dataTransfer.setData('Text', data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n });\n\n // Sort multi-drag elements\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n\n sortable.captureAnimationState();\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n }\n\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute);\n\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n }\n\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n activeSortable._showClone(sortable);\n\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children;\n\n // Multi-drag selection\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n }\n\n // Multi-drag drop\n if (dragStarted && this.isMultiDrag) {\n folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n multiDragIndex++;\n });\n\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent('update');\n dispatchSortableEvent('sort');\n }\n }\n }\n\n // Must be done after capturing individual rects (scroll bar)\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n multiDragSortable = toSortable;\n }\n\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return;\n\n // Only deselect if selection is in this sortable\n if (multiDragSortable !== this.sortable) return;\n\n // Only deselect if target is not item in this sortable\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n multiDragSortable = sortable;\n }\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n\n // multiDragElements will already be sorted if folding\n var newIndex;\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n return key;\n }\n }\n });\n}\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","export async function animationFrame(): Promise {\n return new Promise((resolve) => {\n requestAnimationFrame(resolve);\n });\n}\n","import {\n Model,\n ModelElementObject,\n ModelElementId,\n ModelElementArray,\n ModelRecord,\n} from './model';\n\nconst stockIds = [\n 'capacityOfNewlyProducedPhones',\n 'capacityOfRecycledMaterials',\n 'capacityOfRefurbishedPhones',\n 'capacityOfRepairedPhones',\n 'phonesInUse',\n 'supplyOfBrokenPhones',\n 'supplyOfDisposedPhones',\n 'supplyOfHibernatingPhones',\n 'supplyOfNewlyProducedPhones',\n 'supplyOfRecycledMaterials',\n 'supplyOfRefurbishedPhones',\n 'supplyOfRepairedPhones',\n] as const;\n\nconst flowIds = [\n 'abandon',\n 'acquireNewlyProduced',\n 'acquireRefurbished',\n 'acquireRepaired',\n 'acquireUsed',\n 'capacityOfNewlyProducedPhonesAdjustment',\n 'capacityOfRecycledMaterialsAdjustment',\n 'capacityOfRefurbishedPhonesAdjustment',\n 'disposeBroken',\n 'disposeHibernating',\n 'goBroken',\n 'landfill',\n 'produceFromNaturalResources',\n 'produceFromRecycledMaterials',\n 'recycle',\n 'refurbish',\n 'repair',\n 'repairShopCapcityAdjustment',\n] as const;\n\nconst variableIds = [\n 'demandForNaturalResources',\n 'demandForNewlyProducedPhones',\n 'demandForPhones',\n 'demandForRecycledMaterials',\n 'demandForRefurbishedPhones',\n 'demandForRefurbishment',\n 'demandForRepairedPhones',\n 'demandForReusedPhones',\n 'inflowIncentiveSumForPhonesInUse',\n 'phoneGoal',\n 'phonesInUseExcess',\n 'recycleDemand',\n 'repairDemand',\n 'resourceDemand',\n 'supplyOfBrokenPhonesForDisposal',\n 'supplyOfBrokenPhonesForRepair',\n 'supplyOfDisposedPhonesForLandfilling',\n 'supplyOfDisposedPhonesForRecycling',\n] as const;\n\nconst parameterIds = [\n 'abandonExcessRate',\n 'abandonRate',\n 'acquireRate',\n 'breakRate',\n 'capacityAdjustmentRate',\n 'disposeIncentive',\n 'disposeRate',\n 'durability',\n 'landfillIncentive',\n 'landfillRate',\n 'naturalResourcesIncentive',\n 'newPhoneProductionRate',\n 'newlyProducedPhoneIncentive',\n 'numberOfUsers',\n 'phonesPerUserGoal',\n 'recycleRate',\n 'recyclingIncentive',\n 'refurbishmentIncentive',\n 'refurbishmentRate',\n 'repairIncentive',\n 'repairRate',\n 'reuseIncentive',\n] as const;\n\ntype StockIds = typeof stockIds;\ntype StockId = ModelElementId;\ntype Stocks = ModelElementObject;\ntype StockArray = ModelElementArray;\n\ntype FlowIds = typeof flowIds;\ntype FlowId = ModelElementId;\ntype Flows = ModelElementObject;\ntype FlowArray = ModelElementArray;\n\ntype VariableIds = typeof variableIds;\ntype VariableId = ModelElementId;\ntype Variables = ModelElementObject;\ntype VariableArray = ModelElementArray;\n\ntype ParameterIds = typeof parameterIds;\ntype ParameterId = ModelElementId;\ntype Parameters = ModelElementObject;\ntype ParameterArray = ModelElementArray;\n\ntype Record = ModelRecord;\n\nclass CircularEconomyModel extends Model<\n StockIds,\n FlowIds,\n VariableIds,\n ParameterIds\n> {\n public static readonly initialStocks: Readonly = {\n capacityOfNewlyProducedPhones: 0,\n capacityOfRecycledMaterials: 0,\n capacityOfRefurbishedPhones: 0,\n capacityOfRepairedPhones: 0,\n phonesInUse: 0,\n supplyOfBrokenPhones: 0,\n supplyOfDisposedPhones: 0,\n supplyOfHibernatingPhones: 0,\n supplyOfNewlyProducedPhones: 0,\n supplyOfRecycledMaterials: 0,\n supplyOfRefurbishedPhones: 0,\n supplyOfRepairedPhones: 0,\n };\n\n public static readonly defaultParameters: Readonly = {\n abandonExcessRate: 0.5,\n abandonRate: 0.1,\n acquireRate: 1,\n breakRate: 0.1,\n capacityAdjustmentRate: 0.1,\n disposeIncentive: 0.5,\n disposeRate: 0.5,\n durability: 1,\n landfillIncentive: 0.5,\n landfillRate: 1,\n naturalResourcesIncentive: 0.5,\n newPhoneProductionRate: 0.5,\n newlyProducedPhoneIncentive: 0.82,\n numberOfUsers: 1000000,\n phonesPerUserGoal: 1,\n recycleRate: 1,\n recyclingIncentive: 0.89,\n refurbishmentIncentive: 0.5,\n refurbishmentRate: 1,\n repairIncentive: 0.5,\n repairRate: 1,\n reuseIncentive: 0.86,\n };\n\n constructor() {\n super(stockIds, flowIds, variableIds, parameterIds);\n }\n\n // eslint-disable-next-line class-methods-use-this\n public evaluate(stocks: Stocks, parameters: Parameters, t: number): Record {\n const {\n capacityOfNewlyProducedPhones,\n capacityOfRecycledMaterials,\n capacityOfRefurbishedPhones,\n capacityOfRepairedPhones,\n phonesInUse,\n supplyOfBrokenPhones,\n supplyOfDisposedPhones,\n supplyOfHibernatingPhones,\n supplyOfNewlyProducedPhones,\n supplyOfRecycledMaterials,\n supplyOfRefurbishedPhones,\n supplyOfRepairedPhones,\n } = stocks;\n const {\n abandonExcessRate,\n abandonRate,\n acquireRate,\n breakRate,\n capacityAdjustmentRate,\n disposeIncentive,\n disposeRate,\n durability,\n landfillIncentive,\n landfillRate,\n naturalResourcesIncentive,\n newPhoneProductionRate,\n newlyProducedPhoneIncentive,\n numberOfUsers,\n phonesPerUserGoal,\n recycleRate,\n recyclingIncentive,\n refurbishmentIncentive,\n refurbishmentRate,\n repairIncentive,\n repairRate,\n reuseIncentive,\n } = parameters;\n\n const phoneGoal = numberOfUsers * phonesPerUserGoal;\n const phonesInUseExcess = Math.max(phonesInUse - phoneGoal, 0);\n const abandon =\n abandonRate * phonesInUse + abandonExcessRate * phonesInUseExcess;\n const inflowIncentiveSumForPhonesInUse =\n reuseIncentive +\n repairIncentive +\n refurbishmentIncentive +\n newlyProducedPhoneIncentive;\n const demandForPhones = Math.max(0, phoneGoal - phonesInUse);\n const demandForNewlyProducedPhones =\n (newlyProducedPhoneIncentive / inflowIncentiveSumForPhonesInUse) *\n demandForPhones;\n const acquireNewlyProduced =\n acquireRate *\n Math.min(supplyOfNewlyProducedPhones, demandForNewlyProducedPhones);\n const demandForRefurbishedPhones =\n (refurbishmentIncentive / inflowIncentiveSumForPhonesInUse) *\n demandForPhones;\n const acquireRefurbished =\n acquireRate *\n Math.min(demandForRefurbishedPhones, supplyOfRefurbishedPhones);\n const demandForRepairedPhones =\n (repairIncentive / inflowIncentiveSumForPhonesInUse) * demandForPhones;\n const acquireRepaired =\n acquireRate * Math.min(demandForRepairedPhones, supplyOfRepairedPhones);\n const demandForReusedPhones =\n (reuseIncentive / inflowIncentiveSumForPhonesInUse) * demandForPhones;\n const acquireUsed =\n acquireRate * Math.min(supplyOfHibernatingPhones, demandForReusedPhones);\n const capacityOfNewlyProducedPhonesAdjustment =\n capacityAdjustmentRate *\n (demandForNewlyProducedPhones - capacityOfNewlyProducedPhones);\n const resourceDemand = Math.max(\n capacityOfNewlyProducedPhones - supplyOfNewlyProducedPhones,\n 0,\n );\n const demandForRecycledMaterials =\n (recyclingIncentive / (naturalResourcesIncentive + recyclingIncentive)) *\n resourceDemand;\n const capacityOfRecycledMaterialsAdjustment =\n capacityAdjustmentRate *\n (demandForRecycledMaterials - capacityOfRecycledMaterials);\n const capacityOfRefurbishedPhonesAdjustment =\n capacityAdjustmentRate *\n (demandForRefurbishedPhones - capacityOfRefurbishedPhones);\n const supplyOfBrokenPhonesForDisposal =\n (disposeIncentive / (repairIncentive + disposeIncentive)) *\n supplyOfBrokenPhones;\n const disposeBroken = disposeRate * supplyOfBrokenPhonesForDisposal;\n const disposeHibernating = disposeRate * supplyOfHibernatingPhones;\n const goBroken = (breakRate / durability) * phonesInUse;\n const supplyOfDisposedPhonesForLandfilling =\n (landfillIncentive / (recyclingIncentive + landfillIncentive)) *\n supplyOfDisposedPhones;\n const landfill = landfillRate * supplyOfDisposedPhonesForLandfilling;\n const demandForNaturalResources =\n (naturalResourcesIncentive /\n (naturalResourcesIncentive + recyclingIncentive)) *\n resourceDemand;\n const produceFromNaturalResources =\n newPhoneProductionRate * demandForNaturalResources;\n const produceFromRecycledMaterials =\n newPhoneProductionRate *\n Math.min(demandForRecycledMaterials, supplyOfRecycledMaterials);\n const supplyOfDisposedPhonesForRecycling =\n (recyclingIncentive / (recyclingIncentive + landfillIncentive)) *\n supplyOfDisposedPhones;\n const recycleDemand = Math.max(\n capacityOfRecycledMaterials - supplyOfRecycledMaterials,\n 0,\n );\n const recycle =\n recycleRate * Math.min(supplyOfDisposedPhonesForRecycling, recycleDemand);\n const demandForRefurbishment = Math.max(\n capacityOfRefurbishedPhones - supplyOfRefurbishedPhones,\n 0,\n );\n const refurbish =\n refurbishmentRate *\n Math.min(supplyOfHibernatingPhones, demandForRefurbishment);\n const repairDemand = Math.max(\n capacityOfRepairedPhones - supplyOfRepairedPhones,\n 0,\n );\n const repair = repairRate * Math.min(supplyOfBrokenPhones, repairDemand);\n const repairShopCapcityAdjustment =\n capacityAdjustmentRate *\n (demandForRepairedPhones - capacityOfRepairedPhones);\n const supplyOfBrokenPhonesForRepair =\n (repairIncentive / (repairIncentive + disposeIncentive)) *\n supplyOfBrokenPhones;\n\n const variables = {\n demandForNaturalResources,\n demandForNewlyProducedPhones,\n demandForPhones,\n demandForRecycledMaterials,\n demandForRefurbishedPhones,\n demandForRefurbishment,\n demandForRepairedPhones,\n demandForReusedPhones,\n inflowIncentiveSumForPhonesInUse,\n phoneGoal,\n phonesInUseExcess,\n recycleDemand,\n repairDemand,\n resourceDemand,\n supplyOfBrokenPhonesForDisposal,\n supplyOfBrokenPhonesForRepair,\n supplyOfDisposedPhonesForLandfilling,\n supplyOfDisposedPhonesForRecycling,\n };\n const flows = {\n abandon,\n acquireNewlyProduced,\n acquireRefurbished,\n acquireRepaired,\n acquireUsed,\n capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhonesAdjustment,\n disposeBroken,\n disposeHibernating,\n goBroken,\n landfill,\n produceFromNaturalResources,\n produceFromRecycledMaterials,\n recycle,\n refurbish,\n repair,\n repairShopCapcityAdjustment,\n };\n\n return { t, stocks, parameters, variables, flows };\n }\n\n // eslint-disable-next-line class-methods-use-this\n public accumulateFlowsPerStock(flows: Flows): Stocks {\n const {\n abandon,\n acquireNewlyProduced,\n acquireRefurbished,\n acquireRepaired,\n acquireUsed,\n capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhonesAdjustment,\n disposeBroken,\n disposeHibernating,\n goBroken,\n landfill,\n produceFromNaturalResources,\n produceFromRecycledMaterials,\n recycle,\n refurbish,\n repair,\n repairShopCapcityAdjustment,\n } = flows;\n\n const flowPerStock: Stocks = {\n capacityOfNewlyProducedPhones: capacityOfNewlyProducedPhonesAdjustment,\n capacityOfRecycledMaterials: capacityOfRecycledMaterialsAdjustment,\n capacityOfRefurbishedPhones: capacityOfRefurbishedPhonesAdjustment,\n capacityOfRepairedPhones: repairShopCapcityAdjustment,\n phonesInUse:\n acquireNewlyProduced +\n acquireRefurbished +\n acquireRepaired +\n acquireUsed -\n (abandon + goBroken),\n supplyOfBrokenPhones: goBroken - (disposeBroken + repair),\n supplyOfDisposedPhones:\n disposeBroken + disposeHibernating - (landfill + recycle),\n supplyOfHibernatingPhones:\n abandon - (acquireUsed + disposeHibernating + refurbish),\n supplyOfNewlyProducedPhones:\n produceFromNaturalResources +\n produceFromRecycledMaterials -\n acquireNewlyProduced,\n supplyOfRecycledMaterials: recycle - produceFromRecycledMaterials,\n supplyOfRefurbishedPhones: refurbish - acquireRefurbished,\n supplyOfRepairedPhones: repair - acquireRepaired,\n };\n\n return flowPerStock;\n }\n}\nexport type {\n StockIds,\n StockId,\n Stocks,\n StockArray,\n FlowIds,\n FlowId,\n Flows,\n FlowArray,\n VariableIds,\n VariableId,\n Variables,\n VariableArray,\n ParameterIds,\n ParameterId,\n Parameters,\n ParameterArray,\n Record,\n};\n\nexport default CircularEconomyModel;\n","import {\n step,\n FlowEvaluator,\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n} from './box-model/box-model';\nimport type {\n ConvertTupleToUnion,\n ConvertTupleToObject,\n ConvertTupleItemType,\n} from './util/type-helpers';\n\ntype ModelElementIds = readonly string[];\ntype ModelElementId = ConvertTupleToUnion;\ntype ModelElementObject = ConvertTupleToObject<\n I,\n number\n>;\ntype ModelElementArray = ConvertTupleItemType<\n I,\n number\n>;\n\ntype ModelRecord<\n S extends ModelElementIds,\n F extends ModelElementIds,\n V extends ModelElementIds,\n P extends ModelElementIds,\n> = {\n t: number;\n stocks: ModelElementObject;\n flows: ModelElementObject;\n variables: ModelElementObject;\n parameters: ModelElementObject

;\n};\n\nabstract class Model<\n S extends ModelElementIds,\n F extends ModelElementIds,\n V extends ModelElementIds,\n P extends ModelElementIds,\n> {\n public static elementIds = [\n 'stocks',\n 'parameters',\n 'variables',\n 'flows',\n ] as const;\n\n public readonly stockIds: S;\n\n public readonly flowIds: F;\n\n public readonly variableIds: V;\n\n public readonly parameterIds: P;\n\n protected constructor(\n stocksIds: S,\n flowIds: F,\n variableIds: V,\n parameterIds: P,\n ) {\n this.stockIds = stocksIds;\n this.flowIds = flowIds;\n this.variableIds = variableIds;\n this.parameterIds = parameterIds;\n }\n\n public static elementObjectToArray(\n ids: I,\n object: Readonly>,\n ): ModelElementArray {\n return ids.map(\n (id: ModelElementId) => object[id],\n ) as ModelElementArray;\n }\n\n public static arrayToElementObject(\n ids: I,\n array: readonly [...ModelElementArray],\n ): ModelElementObject {\n const result: Partial> = {};\n for (let i = 0; i < ids.length; i += 1) {\n const id: ModelElementId = ids[i];\n result[id] = array[i];\n }\n return result as ModelElementObject;\n }\n\n public stocksToStockArray(\n stocks: Readonly>,\n ): ModelElementArray {\n return Model.elementObjectToArray(this.stockIds, stocks);\n }\n\n public stockArrayToStocks(\n stockArray: readonly [...ModelElementArray],\n ): ModelElementObject {\n return Model.arrayToElementObject(this.stockIds, stockArray);\n }\n\n public flowsToFlowArray(\n flows: Readonly>,\n ): ModelElementArray {\n return Model.elementObjectToArray(this.flowIds, flows);\n }\n\n public flowArrayToFlows(\n flowArray: readonly [...ModelElementArray],\n ): ModelElementObject {\n return Model.arrayToElementObject(this.flowIds, flowArray);\n }\n\n public variablesToVariableArray(\n variables: Readonly>,\n ): ModelElementArray {\n return Model.elementObjectToArray(this.variableIds, variables);\n }\n\n public variableArrayToVariables(\n variableArray: readonly [...ModelElementArray],\n ): ModelElementObject {\n return Model.arrayToElementObject(this.variableIds, variableArray);\n }\n\n public parametersToParameterArray(\n parameters: Readonly>,\n ): ModelElementArray

{\n return Model.elementObjectToArray(this.parameterIds, parameters);\n }\n\n public parameterArrayToParameters(\n parameterArray: readonly [...ModelElementArray

],\n ): ModelElementObject

{\n return Model.arrayToElementObject(this.parameterIds, parameterArray);\n }\n\n public abstract evaluate(\n stocks: ModelElementObject,\n parameters: ModelElementObject

,\n t: number,\n ): ModelRecord;\n\n public abstract accumulateFlowsPerStock(\n flows: ModelElementObject,\n ): ModelElementObject;\n\n public evaluateFlowPerStock(\n stocks: ModelElementObject,\n parameters: ModelElementObject

,\n t: number,\n ): ModelElementObject {\n const { flows } = this.evaluate(stocks, parameters, t);\n return this.accumulateFlowsPerStock(flows);\n }\n\n public createFlowEvaluator(\n parameters: Readonly>,\n ): FlowEvaluator> {\n const result = (\n stocksArray: IntegrationEngineInputArray>,\n t: number,\n ): IntegrationEngineOutputArray> => {\n const stocks = this.stockArrayToStocks(stocksArray);\n const flowsPerStock = this.evaluateFlowPerStock(stocks, parameters, t);\n const flowPerStockArray = this.stocksToStockArray(flowsPerStock);\n return flowPerStockArray;\n };\n return result;\n }\n\n public step(\n stocks: Readonly>,\n t: number,\n h: number,\n flowEvaluator: FlowEvaluator>,\n ): ModelElementObject {\n const stocksArray: ModelElementArray = this.stocksToStockArray(stocks);\n const newStocksArray = step>(\n stocksArray,\n t,\n h,\n flowEvaluator,\n );\n return this.stockArrayToStocks(newStocksArray);\n }\n}\n\nexport type {\n ModelElementIds,\n ModelElementId,\n ModelElementObject,\n ModelElementArray,\n ModelRecord,\n};\n\nexport { Model };\n","import type { FlowEvaluator, ConvergenceCriterion } from './types';\nimport { step as stepImpl, converge as convergeImpl } from './engine';\nimport {\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n IVPIntegrator,\n} from './types';\n\nfunction step5(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray {\n return stepImpl(stocksAtT, t, h, computeFlows, integrator);\n}\n\nfunction step6(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray {\n const mutableFlowsAtT: IntegrationEngineOutputArray = [...flowsAtT];\n const getFlows: FlowEvaluator = (y, x) =>\n x === t ? mutableFlowsAtT : computeFlows(y, x);\n return stepImpl(stocksAtT, t, h, getFlows, integrator);\n}\n\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray;\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray;\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n tOrFlowsAtT: number | IntegrationEngineInputArray,\n tOrH: number,\n hOrComputeFlows: number | FlowEvaluator,\n computeFlowsOrIntegrator?: FlowEvaluator | IVPIntegrator,\n integrator?: IVPIntegrator,\n): IntegrationEngineOutputArray {\n if (typeof tOrFlowsAtT === 'number')\n return step5(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as FlowEvaluator,\n computeFlowsOrIntegrator as IVPIntegrator,\n );\n\n return step6(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as number,\n computeFlowsOrIntegrator as FlowEvaluator,\n integrator as IVPIntegrator,\n );\n}\n\nfunction converge6(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C {\n return convergeImpl(stocksAtT, t, h, computeFlows, criterion, integrator);\n}\n\nfunction converge7(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C {\n const mutableFlowsAtT: IntegrationEngineOutputArray = [...flowsAtT];\n const getFlows: FlowEvaluator = (y, x) =>\n x === t ? mutableFlowsAtT : computeFlows(y, x);\n return convergeImpl(stocksAtT, t, h, getFlows, criterion, integrator);\n}\n\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C;\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n flowsAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n computeFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator?: IVPIntegrator,\n): C;\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n tOrFlowsAtT: number | IntegrationEngineInputArray,\n tOrH: number,\n hOrComputeFlows: number | FlowEvaluator,\n computeFlowsOrCriterion: FlowEvaluator | ConvergenceCriterion,\n criterionOrIntegrator?: ConvergenceCriterion | IVPIntegrator,\n integrator?: IVPIntegrator,\n): C {\n if (typeof tOrFlowsAtT === 'number')\n return converge6(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as FlowEvaluator,\n computeFlowsOrCriterion as ConvergenceCriterion,\n criterionOrIntegrator as IVPIntegrator,\n );\n\n return converge7(\n stocksAtT,\n tOrFlowsAtT,\n tOrH,\n hOrComputeFlows as number,\n computeFlowsOrCriterion as FlowEvaluator,\n criterionOrIntegrator as ConvergenceCriterion,\n integrator as IVPIntegrator,\n );\n}\n\nexport type {\n FlowEvaluator,\n ConvergenceCriterion,\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n};\nexport { step, converge };\n","import {\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n FlowEvaluator,\n IVPIntegrator,\n ConvergenceCriterion,\n} from './types';\nimport { rk4 } from './ode';\n\nfunction step(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n getFlows: FlowEvaluator,\n integrator: IVPIntegrator = rk4,\n): IntegrationEngineOutputArray {\n return integrator(stocksAtT, t, h, getFlows);\n}\n\nfunction converge(\n stocksAtT: IntegrationEngineInputArray,\n t: number,\n h: number,\n getFlows: FlowEvaluator,\n criterion: ConvergenceCriterion,\n integrator: IVPIntegrator = rk4,\n): C {\n let iterations = 0;\n let { userdata, done } = criterion(stocksAtT, t, undefined, iterations);\n\n if (!done) {\n let newT = t;\n let newStocks: IntegrationEngineOutputArray | undefined;\n\n do {\n newStocks = integrator(newStocks ?? stocksAtT, newT, h, getFlows);\n newT += h;\n iterations += 1;\n ({ userdata, done } = criterion(newStocks, newT, userdata, iterations));\n } while (!done);\n }\n\n return userdata;\n}\n\nexport type { FlowEvaluator, ConvergenceCriterion };\nexport { step, converge };\n","import {\n IntegrationEngineInputArray,\n IntegrationEngineOutputArray,\n} from './types';\n\nexport function euler(\n y: IntegrationEngineInputArray,\n x: number,\n h: number,\n derivatives: (\n y: IntegrationEngineInputArray,\n x: number,\n ) => IntegrationEngineOutputArray,\n): IntegrationEngineOutputArray {\n const n: number = y.length;\n const dydx = derivatives(y, x);\n const yTemp = dydx; // Reuse array for result to avoid allocation and GC\n for (let i = 0; i < n; i += 1) yTemp[i] = y[i] + h * dydx[i];\n return yTemp;\n}\n\nexport function rk4(\n y: IntegrationEngineInputArray,\n x: number,\n h: number,\n derivatives: (\n y: IntegrationEngineInputArray,\n x: number,\n ) => IntegrationEngineOutputArray,\n): IntegrationEngineOutputArray {\n const n: number = y.length;\n\n const dydx = derivatives(y, x);\n const yTemp = new Array(n) as IntegrationEngineOutputArray;\n\n const h2 = h / 2.0;\n const h6 = h / 6.0;\n const xhh = x + h2;\n\n for (let i = 0; i < n; i += 1) yTemp[i] = y[i] + h2 * dydx[i];\n let dydxTemp = derivatives(yTemp, xhh);\n\n for (let i = 0; i < n; i += 1) yTemp[i] = y[i] + h2 * dydxTemp[i];\n const dydxM = derivatives(yTemp, xhh);\n\n for (let i = 0; i < n; i += 1) {\n yTemp[i] = y[i] + h * dydxM[i];\n dydxM[i] += dydxTemp[i];\n }\n dydxTemp = derivatives(yTemp, x + h);\n\n for (let i = 0; i < n; i += 1)\n yTemp[i] = y[i] + h6 * (dydx[i] + dydxTemp[i] + 2.0 * dydxM[i]);\n return yTemp;\n}\n","import type {\n ModelElementIds,\n ModelElementArray,\n ModelElementObject,\n ModelRecord,\n} from './model';\nimport { Model } from './model';\n\nimport { FlowEvaluator } from './box-model/types';\n\nclass ModelSimulator<\n S extends ModelElementIds,\n F extends ModelElementIds,\n V extends ModelElementIds,\n P extends ModelElementIds,\n> {\n public readonly model: Model;\n\n public readonly parameters: ModelElementObject

;\n\n public record: ModelRecord;\n\n public h: number;\n\n protected flowPerStockCache: {\n t: number;\n value: readonly [...ModelElementArray];\n } | null;\n\n protected flowEvaluator: FlowEvaluator>;\n\n protected flowEvaluatorWithCache: FlowEvaluator>;\n\n constructor(\n model: Model,\n stocks: ModelElementObject,\n parameters: ModelElementObject

,\n t: number,\n h: number,\n ) {\n this.model = model;\n this.parameters = parameters;\n this.flowPerStockCache = null;\n this.record = this.model.evaluate(stocks, parameters, t);\n this.h = h;\n this.flowEvaluator = this.model.createFlowEvaluator(parameters);\n this.flowEvaluatorWithCache = this.evaluateFlowPerStockWithCache.bind(this);\n }\n\n protected evaluateFlowPerStockWithCache(\n stockArray: readonly [...ModelElementArray],\n t: number,\n ): [...ModelElementArray] {\n if (this.flowPerStockCache !== null && this.flowPerStockCache.t === t)\n return [...this.flowPerStockCache.value];\n\n return this.flowEvaluator(stockArray, t);\n }\n\n step(): ModelRecord {\n const { stocks, parameters, t } = this.record;\n const newStocks = this.model.step(\n stocks,\n t,\n this.h,\n this.flowEvaluatorWithCache,\n );\n const newRecord = this.model.evaluate(newStocks, parameters, t + this.h);\n this.flowPerStockCache = {\n t: newRecord.t,\n value: this.model.stocksToStockArray(\n this.model.accumulateFlowsPerStock(newRecord.flows),\n ),\n };\n this.record = newRecord;\n return newRecord;\n }\n}\n\nexport default ModelSimulator;\n","import kebabCase from 'lodash/kebabCase';\n\nimport { ModelElementObject } from './model';\nimport CircularEconomyModel, { Record } from './circular-economy-model';\nimport { loadSvg } from './util/load-svg';\nimport { guardedQuerySelector } from './util/guarded-query-selectors';\n\nconst svgUrl = new URL('../svg/model.svg', import.meta.url);\n\nconst mainFlowIds = [\n 'abandon',\n 'acquireNewlyProduced',\n 'acquireRefurbished',\n 'acquireRepaired',\n 'acquireUsed',\n 'disposeBroken',\n 'disposeHibernating',\n 'goBroken',\n 'landfill',\n 'produceFromNaturalResources',\n 'produceFromRecycledMaterials',\n 'recycle',\n 'refurbish',\n 'repair',\n] as const;\n\ntype MainFlowIds = typeof mainFlowIds;\n\nconst flowVizSigns: ModelElementObject = {\n abandon: +1,\n acquireNewlyProduced: -1,\n acquireRefurbished: -1,\n acquireRepaired: -1,\n acquireUsed: -1,\n disposeBroken: -1,\n disposeHibernating: -1,\n goBroken: -1,\n landfill: -1,\n produceFromNaturalResources: -1,\n produceFromRecycledMaterials: -1,\n recycle: -1,\n refurbish: -1,\n repair: -1,\n};\n\nexport default class Visualization {\n protected readonly model: CircularEconomyModel;\n\n public readonly element: HTMLDivElement;\n\n protected readonly svg: SVGSVGElement;\n\n protected constructor(model: CircularEconomyModel, svg: SVGSVGElement) {\n this.model = model;\n this.svg = svg;\n\n this.element = document.createElement('div');\n this.element.append(this.svg);\n }\n\n protected updateSvgFlows(deltaMs: DOMHighResTimeStamp, record: Record) {\n const { flows } = record;\n const flowVizScale = 5.0 / record.parameters.numberOfUsers;\n const dashGap = 20;\n mainFlowIds.forEach((id) => {\n const flow = flows[id];\n const flowVizSign = flowVizSigns[id];\n const elementId = `${kebabCase(id)}-flow`;\n const element = guardedQuerySelector(\n this.svg,\n `#${elementId}`,\n SVGPathElement,\n );\n const lastDashOffset = parseFloat(\n element.getAttribute('stroke-dashoffset') ?? '0',\n );\n // The dash offset step must not be small compared to the dash gap.\n // Otherwise, the flow animation may appear to move backwards.\n const dashOffsetStep = Math.max(\n -0.3 * dashGap,\n Math.min(flowVizSign * (deltaMs * flow) * flowVizScale, 0.1 * dashGap),\n );\n const dashOffset =\n (Number.isNaN(lastDashOffset) ? 0 : lastDashOffset) + dashOffsetStep;\n\n element.setAttribute('stroke-dashoffset', `${dashOffset}`);\n element.setAttribute('stroke-dasharray', `0 ${dashGap}`);\n });\n }\n\n protected updateSvgStocks(deltaMs: DOMHighResTimeStamp, record: Record) {\n const { stocks } = record;\n const stockVizScale = 50000.0 / record.parameters.numberOfUsers;\n this.model.stockIds.forEach((id) => {\n const elementId = kebabCase(id);\n const element = this.svg.getElementById(elementId);\n if (element === null) {\n throw new Error(\n `SVG element with id ${elementId} for stock ${id} not found.`,\n );\n }\n if (!(element instanceof SVGCircleElement)) {\n throw new Error(\n `Stock element for stock ${id} with id ${elementId} is not an SVG circle element.`,\n );\n }\n const stock = stocks[id];\n const radius = Math.sqrt((stock * stockVizScale) / Math.PI);\n element.setAttribute('r', `${radius}`);\n });\n }\n\n protected updateSvg(deltaMs: DOMHighResTimeStamp, record: Record) {\n this.updateSvgFlows(deltaMs, record);\n this.updateSvgStocks(deltaMs, record);\n }\n\n public update(deltaMs: DOMHighResTimeStamp, record: Record) {\n this.updateSvg(deltaMs, record);\n }\n\n public static prepareSvg(model: CircularEconomyModel, svg: SVGSVGElement) {\n const createSVGElement = (tagName: string) =>\n svg.ownerDocument.createElementNS('http://www.w3.org/2000/svg', tagName);\n\n svg.classList.add('model-visualization');\n svg.querySelectorAll('circle, rect, path, text').forEach((element) => {\n element.removeAttribute('style');\n });\n\n const elementsToRemove = [...svg.children];\n\n const labelLayer = createSVGElement('g');\n labelLayer.classList.add('labels');\n\n const supplyLayer = createSVGElement('g');\n supplyLayer.classList.add('supplies');\n\n const capacityLayer = createSVGElement('g');\n capacityLayer.classList.add('capacities');\n\n const flowLayer = createSVGElement('g');\n flowLayer.classList.add('flows');\n svg.append(capacityLayer, flowLayer, supplyLayer, labelLayer);\n\n svg.querySelectorAll('text').forEach((baseElement) => {\n const clone = baseElement.cloneNode(true) as SVGTextElement;\n clone.classList.add('label');\n labelLayer.append(clone);\n });\n\n svg.querySelectorAll('rect').forEach((baseElement) => {\n const clone = baseElement.cloneNode(false) as SVGRectElement;\n clone.classList.add('capacity');\n capacityLayer.append(clone);\n });\n\n model.stockIds\n .filter((id) => id.startsWith('supplyOf'))\n .forEach((id) => {\n const baseElementId = kebabCase(id.replace(/^supplyOf/, ''));\n const baseElement = guardedQuerySelector(\n svg,\n `#${baseElementId}`,\n SVGGeometryElement,\n );\n\n const clone = baseElement.cloneNode(false) as SVGGeometryElement;\n clone.id = `supply-of-${baseElement.id}`;\n clone.classList.add('stock', 'supply');\n supplyLayer.append(clone);\n });\n const phonesInUse = guardedQuerySelector(\n svg,\n '#phones-in-use',\n SVGGeometryElement,\n );\n const phonesInUseClone = phonesInUse.cloneNode(false) as SVGGeometryElement;\n supplyLayer.append(phonesInUseClone);\n\n model.stockIds\n .filter((id) => id.startsWith('capacityOf'))\n .forEach((id) => {\n const baseElementId = kebabCase(id.replace(/^capacityOf/, ''));\n const baseElement = guardedQuerySelector(\n svg,\n `#${baseElementId}`,\n SVGGeometryElement,\n );\n\n const clone = baseElement.cloneNode(false) as SVGGeometryElement;\n clone.id = `capacity-of-${baseElementId}`;\n clone.classList.add('stock', 'capacity');\n capacityLayer.append(clone);\n });\n mainFlowIds.forEach((id) => {\n const baseElementId = kebabCase(id);\n const baseElement = guardedQuerySelector(\n svg,\n `#${baseElementId}`,\n SVGGeometryElement,\n );\n\n const edge = baseElement.cloneNode(false) as SVGGeometryElement;\n edge.id = `${baseElementId}-edge`;\n edge.removeAttribute('style');\n edge.classList.add('flow', 'edge');\n flowLayer.append(edge);\n\n const flow = baseElement.cloneNode(false) as SVGGeometryElement;\n flow.id = `${baseElementId}-flow`;\n flow.removeAttribute('style');\n flow.classList.add('flow', 'anim-edge');\n flowLayer.append(flow);\n });\n\n elementsToRemove.forEach((element) => element.remove());\n }\n\n public static async create(model: CircularEconomyModel) {\n const svg = await loadSvg(svgUrl);\n this.prepareSvg(model, svg);\n return new Visualization(model, svg);\n }\n}\n","var createCompounder = require('./_createCompounder');\n\n/**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\nvar kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n});\n\nmodule.exports = kebabCase;\n","var arrayReduce = require('./_arrayReduce'),\n deburr = require('./deburr'),\n words = require('./words');\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\";\n\n/** Used to match apostrophes. */\nvar reApos = RegExp(rsApos, 'g');\n\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\nfunction createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n}\n\nmodule.exports = createCompounder;\n","/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduce;\n","var deburrLetter = require('./_deburrLetter'),\n toString = require('./toString');\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */\nvar reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n/** Used to compose unicode character classes. */\nvar rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;\n\n/** Used to compose unicode capture groups. */\nvar rsCombo = '[' + rsComboRange + ']';\n\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\nvar reComboMark = RegExp(rsCombo, 'g');\n\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\nfunction deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n}\n\nmodule.exports = deburr;\n","var basePropertyOf = require('./_basePropertyOf');\n\n/** Used to map Latin Unicode letters to basic Latin letters. */\nvar deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n};\n\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\nvar deburrLetter = basePropertyOf(deburredLetters);\n\nmodule.exports = deburrLetter;\n","/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = basePropertyOf;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var asciiWords = require('./_asciiWords'),\n hasUnicodeWord = require('./_hasUnicodeWord'),\n toString = require('./toString'),\n unicodeWords = require('./_unicodeWords');\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\nfunction words(string, pattern, guard) {\n string = toString(string);\n pattern = guard ? undefined : pattern;\n\n if (pattern === undefined) {\n return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);\n }\n return string.match(pattern) || [];\n}\n\nmodule.exports = words;\n","/** Used to match words composed of alphanumeric characters. */\nvar reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction asciiWords(string) {\n return string.match(reAsciiWord) || [];\n}\n\nmodule.exports = asciiWords;\n","/** Used to detect strings that need a more robust regexp to match words. */\nvar reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\nfunction hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n}\n\nmodule.exports = hasUnicodeWord;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\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',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\",\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;\n\n/** Used to match complex or compound words. */\nvar reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n].join('|'), 'g');\n\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n}\n\nmodule.exports = unicodeWords;\n","/**\n * Loads an external SVG file and returns the DOM tree of its first element.\n *\n * @param {string|URL} uri\n * @param {boolean} clearStyles\n * If true removes the style elements from the file\n * @return {Promise}\n */\nexport async function loadSvg(uri: string | URL, clearStyles = true) {\n const response = await fetch(uri);\n if (response.status < 200 || response.status >= 300) {\n throw new Error(\n `Server returned status ${response.status} (${\n response.statusText\n }) loading ${new URL(uri).href}.`,\n );\n }\n const svgText = await response.text();\n const div = document.createElement('div');\n div.innerHTML = svgText;\n const svgDoc = div.querySelector('svg');\n if (svgDoc === null) {\n throw new Error(`No SVG element found in ${new URL(uri).href}.`);\n }\n\n if (clearStyles) {\n svgDoc.querySelectorAll('style')?.forEach((s) => s.remove());\n }\n\n return svgDoc;\n}\n","export function guardedQuerySelector(\n elem: Element | Document,\n selector: string,\n type: { new (...args: unknown[]): T },\n): T {\n const result = elem.querySelector(selector);\n if (result === null) {\n throw new Error(`No element found matching selector ${selector}.`);\n }\n if (!(result instanceof type)) {\n throw new Error(\n `Element matching selector ${selector} has the wrong type.`,\n );\n }\n return result;\n}\n\nexport function guardedQuerySelectorAll(\n elem: Element | Document,\n selector: string,\n type: { new (...args: unknown[]): T },\n): NodeListOf {\n const results = elem.querySelectorAll(selector);\n results.forEach((result) => {\n if (!(result instanceof type)) {\n throw new Error(\n `An element matching selector ${selector} has the wrong type.`,\n );\n }\n });\n\n return results as NodeListOf;\n}\n","module.exports = require('./helpers/bundle-url').getBundleURL('c39XQ') + \"model.f8e270f6.svg\";","export async function documentReady() {\n return new Promise((resolve) => {\n const state = document.readyState;\n if (state === 'complete' || state === 'interactive') {\n setTimeout(resolve, 0);\n }\n\n document.addEventListener('DOMContentLoaded', () => resolve());\n });\n}\n","import isVarName from '../util/is-var-name';\n\nimport FunctionParameterTransform, {\n PararameterTransformFunction,\n} from './function-parameter-transform';\nimport { ModelElementIds, ModelElementObject } from '../model';\n\nexport default class ScriptedParameterTransform<\n P extends ModelElementIds,\n> extends FunctionParameterTransform

{\n public readonly script: string;\n\n constructor(i18nKey: string, parameterIds: P, script: string) {\n super(\n i18nKey,\n ScriptedParameterTransform.createFunction(parameterIds, script),\n );\n this.script = script;\n }\n\n static createFunction

(\n parameterIds: P,\n script: string,\n ): PararameterTransformFunction

{\n parameterIds.forEach((parameterId) => {\n if (!isVarName(parameterId)) {\n throw new Error(\n `Parameter name '${parameterId}' can not be used as a variable`,\n );\n }\n });\n\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const wrappedScript = new Function(script).toString();\n\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const func = new Function(\n `{ ${parameterIds.join(', ')} }`,\n `(${wrappedScript})(); return { ${parameterIds.join(', ')} }`,\n ) as PararameterTransformFunction

;\n\n return >(parameters: T) => {\n const transformedParameters = func(parameters);\n Object.assign(parameters, transformedParameters);\n return parameters;\n };\n }\n}\n","export default function isVarName(str: unknown): boolean {\n if (typeof str !== 'string') {\n return false;\n }\n\n if (str.trim() !== str) {\n return false;\n }\n\n if (str.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/) === null) {\n return false;\n }\n\n return true;\n}\n","import ParameterTransform from './parameter-transform';\nimport { ModelElementIds, ModelElementObject } from '../model';\n\nexport type PararameterTransformFunction

= <\n T extends ModelElementObject

,\n>(\n parameters: T,\n) => T;\n\nexport default class FunctionParameterTransform<\n P extends ModelElementIds,\n> extends ParameterTransform

{\n protected readonly callable: PararameterTransformFunction

;\n\n constructor(i18nKey: string, callable: PararameterTransformFunction

) {\n super(i18nKey);\n this.callable = callable;\n }\n\n applyTo>(parameters: T): T {\n this.callable(parameters);\n return parameters;\n }\n}\n","import type { ModelElementIds, ModelElementObject } from '../model';\n\nexport default abstract class ParameterTransform

{\n public readonly i18nKey: string;\n\n protected constructor(i18nKey: string) {\n this.i18nKey = i18nKey;\n }\n\n abstract applyTo>(parameters: T): T;\n}\n"],"names":["$96d3e3c23d8fed31$var$names","id","callback","$parcel$global","globalThis","self","window","global","$parcel$interopDefault","a","__esModule","default","$parcel$modules","$parcel$inits","parcelRequire","exports","init","module","call","err","Error","code","register","parcelRegister","Constructor","protoProps","staticProps","$8edfd2951adbea03$var$isDeepEqual","$8edfd2951adbea03$var$isDeepStrictEqual","$2fLxs","$8edfd2951adbea03$var$_typeof","o","Symbol","iterator","constructor","prototype","$8edfd2951adbea03$var$_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","$8edfd2951adbea03$var$_toPropertyKey","arg","key","$8edfd2951adbea03$var$_toPrimitive","input","hint","prim","toPrimitive","undefined","res","TypeError","String","Number","$8edfd2951adbea03$var$_require$codes","$fgTSu","codes","$8edfd2951adbea03$var$ERR_AMBIGUOUS_ARGUMENT","ERR_AMBIGUOUS_ARGUMENT","$8edfd2951adbea03$var$ERR_INVALID_ARG_TYPE","ERR_INVALID_ARG_TYPE","$8edfd2951adbea03$var$ERR_INVALID_ARG_VALUE","ERR_INVALID_ARG_VALUE","$8edfd2951adbea03$var$ERR_INVALID_RETURN_VALUE","ERR_INVALID_RETURN_VALUE","$8edfd2951adbea03$var$ERR_MISSING_ARGS","ERR_MISSING_ARGS","$7aMwq","$gQylu","$8edfd2951adbea03$var$inspect","inspect","$8edfd2951adbea03$require$_require$types","types","$8edfd2951adbea03$var$isPromise","isPromise","$8edfd2951adbea03$var$isRegExp","isRegExp","$8edfd2951adbea03$var$objectAssign","$8edfd2951adbea03$var$objectIs","$8edfd2951adbea03$var$RegExpPrototypeTest","$8edfd2951adbea03$var$lazyLoadComparison","comparison","isDeepEqual","isDeepStrictEqual","$8edfd2951adbea03$var$warned","$8edfd2951adbea03$var$assert","$8edfd2951adbea03$var$ok","$8edfd2951adbea03$var$NO_EXCEPTION_SENTINEL","$8edfd2951adbea03$var$innerFail","obj","message","$8edfd2951adbea03$var$innerOk","fn","argLen","value","generatedMessage","actual","expected","operator","stackStartFn","_len","arguments","args","Array","_key","apply","concat","fail","$8edfd2951adbea03$var$fail","internalMessage","argsLen","warn","emitWarning","console","bind","errArgs","AssertionError","ok","equal","notEqual","deepEqual","notDeepEqual","deepStrictEqual","notDeepStrictEqual","$8edfd2951adbea03$var$notDeepStrictEqual","strictEqual","notStrictEqual","$8edfd2951adbea03$var$Comparison","Comparison","keys","_this","$8edfd2951adbea03$var$_classCallCheck","instance","forEach","$8edfd2951adbea03$var$expectedException","msg","name","push","$8edfd2951adbea03$var$compareExceptionKey","isPrototypeOf","$8edfd2951adbea03$var$getActual","e","$8edfd2951adbea03$var$checkIsPromise","then","catch","$8edfd2951adbea03$var$waitForActual","promiseFn","Promise","resolve","resultPromise","$8edfd2951adbea03$var$expectsError","error","details","fnType","$8edfd2951adbea03$var$expectsNoError","$8edfd2951adbea03$var$internalMatch","string","regexp","fnName","match","throws","_len2","_key2","rejects","_len3","_key3","result","doesNotThrow","_len4","_key4","doesNotReject","_len5","_key5","ifError","newErr","origStack","stack","tmp2","split","shift","tmp1","pos","indexOf","slice","join","doesNotMatch","strict","$8edfd2951adbea03$var$strict","_len6","_key6","$1a41dbb141a3c8c6$var$cachedSetTimeout","$1a41dbb141a3c8c6$var$cachedClearTimeout","$1a41dbb141a3c8c6$var$currentQueue","$1a41dbb141a3c8c6$var$process","$1a41dbb141a3c8c6$var$defaultSetTimout","$1a41dbb141a3c8c6$var$defaultClearTimeout","$1a41dbb141a3c8c6$var$runTimeout","fun","setTimeout","clearTimeout","$1a41dbb141a3c8c6$var$queue","$1a41dbb141a3c8c6$var$draining","$1a41dbb141a3c8c6$var$queueIndex","$1a41dbb141a3c8c6$var$cleanUpNextTick","$1a41dbb141a3c8c6$var$drainQueue","timeout","len","run","$1a41dbb141a3c8c6$var$runClearTimeout","marker","$1a41dbb141a3c8c6$var$Item","array","$1a41dbb141a3c8c6$var$noop","nextTick","title","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","$b1e3b1d2b38bd4b2$var$_typeof","$b1e3b1d2b38bd4b2$var$_defineProperties","$b1e3b1d2b38bd4b2$var$_toPropertyKey","$b1e3b1d2b38bd4b2$var$_toPrimitive","$b1e3b1d2b38bd4b2$var$_setPrototypeOf","p","setPrototypeOf","__proto__","$b1e3b1d2b38bd4b2$var$_getPrototypeOf","getPrototypeOf","get","$b1e3b1d2b38bd4b2$export$e45cb6485273080e","set","v","$b1e3b1d2b38bd4b2$var$assert","$b1e3b1d2b38bd4b2$var$util","$b1e3b1d2b38bd4b2$var$codes","$b1e3b1d2b38bd4b2$var$createErrorType","Base","NodeError","_Base","$b1e3b1d2b38bd4b2$var$_inherits","subClass","superClass","create","hasNativeReflectConstruct","_super","$b1e3b1d2b38bd4b2$var$_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","valueOf","Super","NewTarget","$b1e3b1d2b38bd4b2$var$_possibleConstructorReturn","$b1e3b1d2b38bd4b2$var$_assertThisInitialized","ReferenceError","arg1","arg2","arg3","$b1e3b1d2b38bd4b2$var$_classCallCheck","$b1e3b1d2b38bd4b2$var$oneOf","thing","isArray","map","search","str","substr","determiner","replace","this_len","substring","start","type","$b1e3b1d2b38bd4b2$var$includes","reason","inspected","RangeError","$c43c250226d47bfa$var$getOwnPropertyDescriptors","getOwnPropertyDescriptors","descriptors","getOwnPropertyDescriptor","$c43c250226d47bfa$var$formatRegExp","format","f","$c43c250226d47bfa$var$isString","objects","$c43c250226d47bfa$var$inspect","x","JSON","stringify","_","$c43c250226d47bfa$var$isNull","$c43c250226d47bfa$var$isObject","deprecate","noDeprecation","warned","throwDeprecation","traceDeprecation","trace","$c43c250226d47bfa$var$debugs","$c43c250226d47bfa$var$debugEnvRegex","opts","ctx","seen","stylize","$c43c250226d47bfa$var$stylizeNoColor","depth","colors","$c43c250226d47bfa$var$isBoolean","showHidden","_extend","$c43c250226d47bfa$var$isUndefined","customInspect","$c43c250226d47bfa$var$stylizeWithColor","$c43c250226d47bfa$var$formatValue","styleType","style","styles","recurseTimes","$c43c250226d47bfa$var$isFunction","base","braces","numLinesEst","hash","output","ret","primitive","$c43c250226d47bfa$var$formatPrimitive","simple","$c43c250226d47bfa$var$isNumber","visibleKeys","val","idx","getOwnPropertyNames","$c43c250226d47bfa$var$isError","$c43c250226d47bfa$var$formatError","$c43c250226d47bfa$var$isRegExp","RegExp","toString","$c43c250226d47bfa$var$isDate","Date","$c43c250226d47bfa$var$isArray","toUTCString","$c43c250226d47bfa$var$formatArray","l","$c43c250226d47bfa$var$hasOwnProperty","$c43c250226d47bfa$var$formatProperty","pop","reduce","prev","cur","desc","line","ar","re","$c43c250226d47bfa$var$objectToString","d","$c43c250226d47bfa$var$pad","n","debuglog","toUpperCase","test","pid","isBoolean","isNull","isNullOrUndefined","isNumber","isString","isSymbol","isUndefined","isObject","isDate","isError","isNativeError","isFunction","isPrimitive","isBuffer","$c43c250226d47bfa$var$months","prop","hasOwnProperty","log","time","getHours","getMinutes","getSeconds","getDate","getMonth","inherits","origin","add","$c43c250226d47bfa$var$kCustomPromisifiedSymbol","$c43c250226d47bfa$var$callbackifyOnRejected","cb","newReason","promisify","original","promiseResolve","promiseReject","promise","reject","defineProperties","custom","callbackify","callbackified","maybeCb","rej","$avzh7","$9mPZQ","$6Sxxf","$bbrRm","$9fcb3c45d02987bb$var$uncurryThis","$9fcb3c45d02987bb$var$BigIntSupported","BigInt","$9fcb3c45d02987bb$var$SymbolSupported","$9fcb3c45d02987bb$var$ObjectToString","$9fcb3c45d02987bb$var$numberValue","$9fcb3c45d02987bb$var$stringValue","$9fcb3c45d02987bb$var$booleanValue","$9fcb3c45d02987bb$var$bigIntValue","$9fcb3c45d02987bb$var$symbolValue","$9fcb3c45d02987bb$var$checkBoxedPrimitive","prototypeValueOf","$9fcb3c45d02987bb$var$isMapToString","$9fcb3c45d02987bb$var$isSetToString","$9fcb3c45d02987bb$var$isWeakMapToString","$9fcb3c45d02987bb$var$isWeakSetToString","$9fcb3c45d02987bb$var$isArrayBufferToString","$9fcb3c45d02987bb$var$isArrayBuffer","ArrayBuffer","working","$9fcb3c45d02987bb$var$isDataViewToString","$9fcb3c45d02987bb$var$isDataView","DataView","isArgumentsObject","isGeneratorFunction","isTypedArray","isArrayBufferView","isView","isUint8Array","isUint8ClampedArray","isUint16Array","isUint32Array","isInt8Array","isInt16Array","isInt32Array","isFloat32Array","isFloat64Array","isBigInt64Array","isBigUint64Array","Map","isMap","Set","isSet","WeakMap","isWeakMap","WeakSet","isWeakSet","isArrayBuffer","isDataView","$9fcb3c45d02987bb$var$SharedArrayBufferCopy","SharedArrayBuffer","$9fcb3c45d02987bb$var$isSharedArrayBufferToString","$9fcb3c45d02987bb$var$isSharedArrayBuffer","$9fcb3c45d02987bb$var$isNumberObject","$9fcb3c45d02987bb$var$isStringObject","$9fcb3c45d02987bb$var$isBooleanObject","$9fcb3c45d02987bb$var$isBigIntObject","$9fcb3c45d02987bb$var$isSymbolObject","isSharedArrayBuffer","isAsyncFunction","isMapIterator","isSetIterator","isGeneratorObject","isWebAssemblyCompiledModule","isNumberObject","isStringObject","isBooleanObject","isBigIntObject","isSymbolObject","isBoxedPrimitive","isAnyArrayBuffer","Uint8Array","method","$7a682982bd21c890$var$hasToStringTag","$7a682982bd21c890$var$$toString","$3e3ab","$7a682982bd21c890$var$isStandardArguments","toStringTag","$7a682982bd21c890$var$isLegacyArguments","callee","$7a682982bd21c890$var$supportsStandardArguments","isLegacyArguments","$grYrm","getOwnPropertySymbols","sym","symObj","syms","propertyIsEnumerable","$2VTxt","$70X2U","$2595220fe67fde3d$var$$indexOf","allowMissing","intrinsic","$222bfc848c4c2d20$var$$SyntaxError","SyntaxError","$222bfc848c4c2d20$var$$Function","Function","$222bfc848c4c2d20$var$$TypeError","$222bfc848c4c2d20$var$getEvalledConstructor","expressionSyntax","$222bfc848c4c2d20$var$$gOPD","$222bfc848c4c2d20$var$throwTypeError","$222bfc848c4c2d20$var$ThrowTypeError","calleeThrows","gOPDthrows","$222bfc848c4c2d20$var$hasSymbols","$222bfc848c4c2d20$var$hasProto","$222bfc848c4c2d20$var$getProto","$222bfc848c4c2d20$var$needsEval","$222bfc848c4c2d20$var$TypedArray","$222bfc848c4c2d20$var$INTRINSICS","AggregateError","Atomics","BigInt64Array","BigUint64Array","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","isNaN","Math","parseFloat","parseInt","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakRef","$222bfc848c4c2d20$var$errorProto","$222bfc848c4c2d20$var$doEval","doEval","gen","$222bfc848c4c2d20$var$LEGACY_ALIASES","$l7UhJ","$G9Faa","$222bfc848c4c2d20$var$$concat","$222bfc848c4c2d20$var$$spliceApply","splice","$222bfc848c4c2d20$var$$replace","$222bfc848c4c2d20$var$$strSlice","$222bfc848c4c2d20$var$$exec","exec","$222bfc848c4c2d20$var$rePropName","$222bfc848c4c2d20$var$reEscapeChar","$222bfc848c4c2d20$var$stringToPath","first","last","number","quote","subString","$222bfc848c4c2d20$var$getBaseIntrinsic","alias","intrinsicName","parts","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","$9b342ea1c5e1f709$var$origSymbol","$1f56262e97e17693$var$test","foo","$1f56262e97e17693$var$$Object","$6LzS1","$4ed2f4f644981d90$var$toStr","$4ed2f4f644981d90$var$max","max","$4ed2f4f644981d90$var$concatty","b","arr","j","$4ed2f4f644981d90$var$slicy","arrLike","offset","$4ed2f4f644981d90$var$joiny","joiner","that","bound","$4ed2f4f644981d90$var$ERROR_MESSAGE","boundLength","boundArgs","Empty","$07eb6b366f8e40b5$var$call","$07eb6b366f8e40b5$var$$hasOwn","$5A9i6","$0151647adf448d23$var$$TypeError","$0151647adf448d23$var$$apply","$0151647adf448d23$var$$call","$0151647adf448d23$var$$reflectApply","$0151647adf448d23$var$$defineProperty","$0151647adf448d23$var$$max","originalFunction","func","$0151647adf448d23$var$applyBind","$eHoge","$4107858ba1a6bd6b$var$hasDescriptors","$do5eO","$4107858ba1a6bd6b$var$$TypeError","$4107858ba1a6bd6b$var$$floor","loose","functionLengthIsConfigurable","functionLengthIsWritable","$ab37e68af3e9e6be$var$hasPropertyDescriptors","$ab37e68af3e9e6be$var$$defineProperty","$ab37e68af3e9e6be$var$$SyntaxError","$ab37e68af3e9e6be$var$$TypeError","property","nonEnumerable","nonWritable","nonConfigurable","$be49f289de13b757$var$$defineProperty","$be49f289de13b757$var$hasPropertyDescriptors","hasArrayLengthDefineBug","$9bf19466cddb0914$var$$gOPD","$6d1e808f9d1ac98b$var$GeneratorFunction","$6d1e808f9d1ac98b$var$toStr","$6d1e808f9d1ac98b$var$fnToStr","$6d1e808f9d1ac98b$var$isFnRegex","$6d1e808f9d1ac98b$var$hasToStringTag","$6d1e808f9d1ac98b$var$getProto","$6d1e808f9d1ac98b$var$getGeneratorFunc","generatorFunc","$98Y2N","$fHmwU","$5021cc9e64bc53c4$var$$toString","$5021cc9e64bc53c4$var$hasToStringTag","$5021cc9e64bc53c4$var$g","$5021cc9e64bc53c4$var$typedArrays","$5021cc9e64bc53c4$var$$slice","$5021cc9e64bc53c4$var$getPrototypeOf","$5021cc9e64bc53c4$var$$indexOf","$5021cc9e64bc53c4$var$cache","typedArray","proto","$5021cc9e64bc53c4$var$tryTypedArrays","found","getter","$5021cc9e64bc53c4$var$trySlices","tag","$d13gJ","$6a836ff0bde6ce0d$var$toStr","$6a836ff0bde6ce0d$var$hasOwnProperty","$6a836ff0bde6ce0d$var$forEachArray","receiver","$6a836ff0bde6ce0d$var$forEachString","charAt","$6a836ff0bde6ce0d$var$forEachObject","object","k","list","thisArg","$979de77de5cc0a8e$var$badArrayLike","$979de77de5cc0a8e$var$isCallableMarker","$979de77de5cc0a8e$var$fnToStr","$979de77de5cc0a8e$var$reflectApply","$979de77de5cc0a8e$var$constructorRegex","$979de77de5cc0a8e$var$isES6ClassFn","fnStr","$979de77de5cc0a8e$var$tryFunctionObject","$979de77de5cc0a8e$var$toStr","$979de77de5cc0a8e$var$hasToStringTag","$979de77de5cc0a8e$var$isIE68","$979de77de5cc0a8e$var$isDDA","document","$979de77de5cc0a8e$var$all","all","strClass","$b6dc5923138db0e6$var$possibleNames","$b6dc5923138db0e6$var$g","out","copy","fill","readUInt8","ctor","superCtor","super_","TempCtor","$538f1b056a09a255$var$ownKeys","r","t","filter","$538f1b056a09a255$var$_objectSpread","$538f1b056a09a255$var$_toPropertyKey","$538f1b056a09a255$var$_defineProperties","$538f1b056a09a255$var$_toPrimitive","$538f1b056a09a255$var$_typeof","$538f1b056a09a255$var$_possibleConstructorReturn","$538f1b056a09a255$var$_assertThisInitialized","$538f1b056a09a255$var$_wrapNativeSuper","Class","_cache","has","Wrapper","$538f1b056a09a255$var$_construct","$538f1b056a09a255$var$_getPrototypeOf","$538f1b056a09a255$var$_setPrototypeOf","Parent","$538f1b056a09a255$var$_isNativeReflectConstruct","$538f1b056a09a255$var$inspect","$538f1b056a09a255$var$ERR_INVALID_ARG_TYPE","$538f1b056a09a255$var$endsWith","$538f1b056a09a255$var$blue","$538f1b056a09a255$var$green","$538f1b056a09a255$var$red","$538f1b056a09a255$var$white","$538f1b056a09a255$var$kReadableOperator","strictEqualObject","notStrictEqualObject","notIdentical","$538f1b056a09a255$var$copyError","source","$538f1b056a09a255$var$inspectValue","compact","maxArrayLength","Infinity","breakLength","showProxy","sorted","getters","$538f1b056a09a255$var$AssertionError","_Error","_inspect$custom","$538f1b056a09a255$var$_inherits","options","$538f1b056a09a255$var$_classCallCheck","limit","stackTraceLimit","stderr","isTTY","getColorDepth","$538f1b056a09a255$var$createErrDiff","other","lastPos","end","skipped","actualInspected","actualLines","expectedLines","indicator","inputLength","columns","$538f1b056a09a255$var$repeat","count","floor","maxCount","maxLines","_actualLines","printedLines","skippedMsg","expectedLine","actualLine","divergingLines","_res","knownOperators","captureStackTrace","$8A6bc","$019f13f070986299$var$lacksProperEnumerationOrder","assign","letters","$019f13f070986299$var$assignHasPendingExceptions","preventExtensions","thrower","$gK6Se","$63f67aa80e2e6d42$var$hasSymbols","$63f67aa80e2e6d42$var$toObject","$63f67aa80e2e6d42$var$$push","$63f67aa80e2e6d42$var$$propIsEnumerable","$63f67aa80e2e6d42$var$originalGetSymbols","source1","to","s","from","getSymbols","nextKey","propValue","$c3064632e4f346e0$var$slice","$alwvH","$c3064632e4f346e0$var$origKeys","$c3064632e4f346e0$var$keysShim","$c3064632e4f346e0$var$originalKeys","shim","$7885156e7e68aa1f$var$toStr","isArgs","$212e5b7e1daff425$var$keysShim","$212e5b7e1daff425$var$has","$212e5b7e1daff425$var$toStr","$212e5b7e1daff425$var$isArgs","$212e5b7e1daff425$var$isEnumerable","$212e5b7e1daff425$var$hasDontEnumBug","$212e5b7e1daff425$var$hasProtoEnumBug","$212e5b7e1daff425$var$dontEnums","$212e5b7e1daff425$var$equalsConstructorPrototype","$212e5b7e1daff425$var$excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","$212e5b7e1daff425$var$hasAutomationEqualityBug","$212e5b7e1daff425$var$equalsConstructorPrototypeIfNotBuggy","isArguments","theKeys","skipProto","skipConstructor","$bX2ce","is","$8b36e887b63475ea$var$numberIsNaN","$1ec742ad58c16dc0$var$_slicedToArray","$1ec742ad58c16dc0$var$_arrayWithHoles","$1ec742ad58c16dc0$var$_iterableToArrayLimit","u","next","done","return","$1ec742ad58c16dc0$var$_unsupportedIterableToArray","minLen","$1ec742ad58c16dc0$var$_arrayLikeToArray","$1ec742ad58c16dc0$var$_nonIterableRest","arr2","$1ec742ad58c16dc0$var$_typeof","$1ec742ad58c16dc0$var$regexFlagsSupported","flags","$1ec742ad58c16dc0$var$arrayFromSet","$1ec742ad58c16dc0$var$arrayFromMap","$1ec742ad58c16dc0$var$objectIs","$1ec742ad58c16dc0$var$objectGetOwnPropertySymbols","$1ec742ad58c16dc0$var$numberIsNaN","$1ec742ad58c16dc0$var$uncurryThis","$1ec742ad58c16dc0$var$hasOwnProperty","$1ec742ad58c16dc0$var$propertyIsEnumerable","$1ec742ad58c16dc0$var$objectToString","$1ec742ad58c16dc0$require$_require$types","$1ec742ad58c16dc0$var$isAnyArrayBuffer","$1ec742ad58c16dc0$var$isArrayBufferView","$1ec742ad58c16dc0$var$isDate","$1ec742ad58c16dc0$var$isMap","$1ec742ad58c16dc0$var$isRegExp","$1ec742ad58c16dc0$var$isSet","$1ec742ad58c16dc0$var$isNativeError","$1ec742ad58c16dc0$var$isBoxedPrimitive","$1ec742ad58c16dc0$var$isNumberObject","$1ec742ad58c16dc0$var$isStringObject","$1ec742ad58c16dc0$var$isBooleanObject","$1ec742ad58c16dc0$var$isBigIntObject","$1ec742ad58c16dc0$var$isSymbolObject","$1ec742ad58c16dc0$var$isFloat32Array","$1ec742ad58c16dc0$var$isFloat64Array","$1ec742ad58c16dc0$var$isNonIndex","charCodeAt","$1ec742ad58c16dc0$var$getOwnNonIndexProperties","$1ec742ad58c16dc0$var$compare","y","min","$1ec742ad58c16dc0$var$ONLY_ENUMERABLE","$1ec742ad58c16dc0$var$innerDeepEqual","val1","val2","memos","val1Tag","keys1","keys2","$1ec742ad58c16dc0$var$keyCheck","getTime","$1ec742ad58c16dc0$var$areSimilarFloatArrays","byteLength","buffer","byteOffset","_keys","_keys2","size","buf1","buf2","$1ec742ad58c16dc0$var$getEnumerables","iterationType","aKeys","bKeys","symbolKeysA","symbolKeysB","_symbolKeysB","position","val2MemoA","val2MemoB","areEq","$1ec742ad58c16dc0$var$objEquiv","$1ec742ad58c16dc0$var$setEquiv","memo","aValues","$1ec742ad58c16dc0$var$setMightHaveLoosePrim","altValue","$1ec742ad58c16dc0$var$findLooseMatchingPrimitives","bValues","_i","_val","$1ec742ad58c16dc0$var$setHasEqualElement","$1ec742ad58c16dc0$var$mapEquiv","aEntries","_aEntries$i","item1","item2","$1ec742ad58c16dc0$var$mapMightHaveLoosePrim","item","curB","bEntries","_i2","_bEntries$_i","$1ec742ad58c16dc0$var$mapHasEqualEntry","keysA","delete","setValues","key1","key2","$8VOI3","$bxl1N","$ePB6U","$b8cb099cb9d2d4c2$var$polyfill","getPolyfill","implementation","$680afb7864027f81$var$hasSymbols","$680afb7864027f81$var$toStr","$680afb7864027f81$var$concat","$680afb7864027f81$var$supportsDescriptors","$680afb7864027f81$var$defineProperty","predicate","$680afb7864027f81$var$defineProperties","predicates","supportsDescriptors","polyfill","$aS0hY","$03yTy","$hK2wk","$15d943fc9df10d4c$var$polyfill","NaN","$cgw1K","$d732417b6401265c$export$1e71eb4bef00f6b0","$96d3e3c23d8fed31$export$2077e0241d6afd3c","$96d3e3c23d8fed31$export$837ba5c449269406","h","$96d3e3c23d8fed31$export$bcc6e673dfa14d36","$96d3e3c23d8fed31$export$ed9bd8dcaeba14f6","$96d3e3c23d8fed31$export$dbf961a8d278dbef","$96d3e3c23d8fed31$export$aa35ef1f24408ab9","$96d3e3c23d8fed31$var$map$1","A","B","C","D","E","F","c","$96d3e3c23d8fed31$var$hex","$96d3e3c23d8fed31$var$h1","$96d3e3c23d8fed31$var$h2","$96d3e3c23d8fed31$var$eq","$96d3e3c23d8fed31$var$isShort","g","$96d3e3c23d8fed31$var$alpha","$96d3e3c23d8fed31$var$HUE_RE","$96d3e3c23d8fed31$var$hsl2rgbn","$96d3e3c23d8fed31$var$hsv2rgbn","$96d3e3c23d8fed31$var$hwb2rgbn","w","rgb","$96d3e3c23d8fed31$export$b5ba70b240f8f7f","$96d3e3c23d8fed31$var$calln","$96d3e3c23d8fed31$var$hue","$96d3e3c23d8fed31$var$map","Z","Y","X","W","V","U","T","S","R","Q","P","O","N","M","L","K","G","H","I","J","$96d3e3c23d8fed31$var$names$1","OiceXe","antiquewEte","aqua","aquamarRe","azuY","beige","bisque","black","blanKedOmond","Xe","XeviTet","bPwn","burlywood","caMtXe","KartYuse","KocTate","cSO","cSnflowerXe","cSnsilk","crimson","cyan","xXe","xcyan","xgTMnPd","xWay","xgYF","xgYy","xkhaki","xmagFta","xTivegYF","xSange","xScEd","xYd","xsOmon","xsHgYF","xUXe","xUWay","xUgYy","xQe","xviTet","dAppRk","dApskyXe","dimWay","dimgYy","dodgerXe","fiYbrick","flSOwEte","foYstWAn","fuKsia","gaRsbSo","ghostwEte","gTd","gTMnPd","Way","gYF","gYFLw","gYy","honeyMw","hotpRk","RdianYd","Rdigo","ivSy","khaki","lavFMr","lavFMrXsh","lawngYF","NmoncEffon","ZXe","ZcSO","Zcyan","ZgTMnPdLw","ZWay","ZgYF","ZgYy","ZpRk","ZsOmon","ZsHgYF","ZskyXe","ZUWay","ZUgYy","ZstAlXe","ZLw","lime","limegYF","lRF","magFta","maPon","VaquamarRe","VXe","VScEd","VpurpN","VsHgYF","VUXe","VsprRggYF","VQe","VviTetYd","midnightXe","mRtcYam","mistyPse","moccasR","navajowEte","navy","Tdlace","Tive","TivedBb","Sange","SangeYd","ScEd","pOegTMnPd","pOegYF","pOeQe","pOeviTetYd","papayawEp","pHKpuff","peru","pRk","plum","powMrXe","purpN","YbeccapurpN","Yd","Psybrown","PyOXe","saddNbPwn","sOmon","sandybPwn","sHgYF","sHshell","siFna","silver","skyXe","UXe","UWay","UgYy","snow","sprRggYF","stAlXe","tan","teO","tEstN","tomato","Qe","viTet","JHt","wEte","wEtesmoke","Lw","LwgYF","$96d3e3c23d8fed31$var$RGB_RE","$96d3e3c23d8fed31$var$to","pow","$96d3e3c23d8fed31$var$from","$96d3e3c23d8fed31$var$modHSL","ratio","tmp","$96d3e3c23d8fed31$var$clone","$96d3e3c23d8fed31$var$fromObject","$96d3e3c23d8fed31$export$892596cec99bc70e","valid","_valid","_rgb","rgbString","hexString","hslString","$96d3e3c23d8fed31$export$a197af1c58e6260c","mix","color","weight","w2","c1","c2","w1","interpolate","$96d3e3c23d8fed31$var$interpolate","rgb1","rgb2","clone","alpha","clearer","greyscale","opaquer","negate","lighten","darken","saturate","desaturate","rotate","deg","$96d3e3c23d8fed31$export$625a38b961e8b5e9","$96d3e3c23d8fed31$export$b2f06b640faad956","$96d3e3c23d8fed31$var$unpack","nk","unpacked","tkeys","transparent","toLowerCase","$96d3e3c23d8fed31$export$91aedb20f296e541","m","$96d3e3c23d8fed31$export$5e91288c399be4f9","p1","p2","$02b6f511cc6c123c$export$cf2f7c5792f80b46","$02b6f511cc6c123c$export$2219238a014317b0","$02b6f511cc6c123c$export$342063e11d6c3cad","$02b6f511cc6c123c$export$8b22cf2602fb60ce","$02b6f511cc6c123c$export$23f2a1d2818174ef","$02b6f511cc6c123c$export$39b482c5e57630a8","$02b6f511cc6c123c$export$c4ce752e73470fba","defaultValue","$02b6f511cc6c123c$export$90a7f3efeed30595","$02b6f511cc6c123c$export$953cecd6e717a553","dimension","endsWith","$02b6f511cc6c123c$export$7ccc53e8f1e7dfc5","$02b6f511cc6c123c$export$3722cfe417b6ed86","$02b6f511cc6c123c$export$d66501df72047452","loopable","reverse","$02b6f511cc6c123c$export$995eb9fca571757","a0","a1","ilen","v0","v1","datasetIndex","index","$02b6f511cc6c123c$export$d377dcb2b61d6c4e","klen","$02b6f511cc6c123c$var$isValidKey","$02b6f511cc6c123c$export$667d3bf0c5f83305","tval","sval","$02b6f511cc6c123c$export$efca4cbe5dd06740","current","sources","merger","$02b6f511cc6c123c$export$555508cbc6add439","$02b6f511cc6c123c$export$317a3d46287192d8","$02b6f511cc6c123c$var$keyResolvers","$02b6f511cc6c123c$export$2d1720544b23b823","resolver","$02b6f511cc6c123c$var$_getKeyResolver","$02b6f511cc6c123c$export$9d0e2d13d04f7070","$02b6f511cc6c123c$export$a8550f7dbe79f93a","$02b6f511cc6c123c$export$dda1d9f60106f0e9","$02b6f511cc6c123c$export$a93c5207d687da10","$02b6f511cc6c123c$export$ee7c8ad385a60b7b","$02b6f511cc6c123c$export$56c0d5a1e737357d","PI","$02b6f511cc6c123c$export$971d5caa766a69d7","$02b6f511cc6c123c$export$d29e374196577086","$02b6f511cc6c123c$export$2ec5befb9e6c97d4","POSITIVE_INFINITY","$02b6f511cc6c123c$export$53c86fa97d611818","$02b6f511cc6c123c$export$7f8ddf7c7c20b3cd","$02b6f511cc6c123c$export$39c1cc7c062529d4","$02b6f511cc6c123c$export$7a0bdf7d4a91ea88","$02b6f511cc6c123c$export$9f4f30ee63539e24","log10","$02b6f511cc6c123c$export$2408f22a0fab9ae5","sign","$02b6f511cc6c123c$export$a05254e7c3aeba6e","epsilon","abs","$02b6f511cc6c123c$export$a33b77bbdbb8366c","range","roundedRange","round","niceRange","fraction","niceFraction","$02b6f511cc6c123c$export$d141bba7fdc215a3","$02b6f511cc6c123c$export$53a70dd1ebbae346","$02b6f511cc6c123c$export$625550452a3fa3ec","degrees","$02b6f511cc6c123c$export$23ebac1979863676","$02b6f511cc6c123c$export$96f57966bedc81b4","centrePoint","anglePoint","distanceFromXCenter","distanceFromYCenter","angle","atan2","distance","sqrt","$02b6f511cc6c123c$export$158acd800e1ef08b","pt1","pt2","$02b6f511cc6c123c$export$c18d01048907ea92","$02b6f511cc6c123c$export$28f7fcd39efa255","$02b6f511cc6c123c$export$ffb5f4729a158638","sameAngleIsFullCircle","angleToStart","angleToEnd","startToAngle","endToAngle","$02b6f511cc6c123c$export$25ce5a424b770e84","$02b6f511cc6c123c$export$3b513254972cfc9c","$02b6f511cc6c123c$export$2ed0fc6709e59212","table","cmp","mid","hi","lo","$02b6f511cc6c123c$export$ef35774e6d314e91","ti","$02b6f511cc6c123c$export$ebd11618f299a286","$02b6f511cc6c123c$var$arrayEvents","$02b6f511cc6c123c$export$3b14a55fb2447963","listener","stub","_chartjs","$02b6f511cc6c123c$export$71511d61b312f219","items","$02b6f511cc6c123c$export$43caf9889c228507","requestAnimationFrame","$02b6f511cc6c123c$export$61196ced6d74a310","argsToUse","ticking","$02b6f511cc6c123c$export$3c2fa207a37baaea","align","$02b6f511cc6c123c$export$ce26c07117d59d6a","$02b6f511cc6c123c$export$9d398bebfec1c039","left","right","rtl","$02b6f511cc6c123c$export$9e5f44173e64f162","meta","points","animationsDisabled","pointCount","_sorted","iScale","_parsed","axis","minDefined","maxDefined","getUserBounds","getPixelForValue","$02b6f511cc6c123c$export$efccba1c4a2ef57b","xScale","yScale","_scaleRanges","newRanges","xmin","xmax","ymin","ymax","changed","$02b6f511cc6c123c$var$atEdge","$02b6f511cc6c123c$var$elasticIn","sin","$02b6f511cc6c123c$var$elasticOut","$02b6f511cc6c123c$export$f1e1789686576879","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","cos","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce","$02b6f511cc6c123c$export$f96d196f7728bb5","$02b6f511cc6c123c$export$db3b6bfb95261072","$02b6f511cc6c123c$export$738ab4df8bf92ae9","$02b6f511cc6c123c$var$numbers","$02b6f511cc6c123c$var$colors","$02b6f511cc6c123c$var$intlCache","$02b6f511cc6c123c$export$ae1af26003f05816","num","locale","$02b6f511cc6c123c$var$getNumberFormat","cacheKey","formatter","Intl","NumberFormat","$02b6f511cc6c123c$var$formatters","values","numeric","tickValue","ticks","notation","chart","delta","maxTick","logDelta","numDecimal","minimumFractionDigits","maximumFractionDigits","logarithmic","remain","significand","includes","$02b6f511cc6c123c$export$91477dc880baac21","formatters","$02b6f511cc6c123c$export$6559d589eb85fbb6","$02b6f511cc6c123c$export$2e2af4578d910ddf","$02b6f511cc6c123c$var$getScope$1","node","$02b6f511cc6c123c$var$set","root","scope","$02b6f511cc6c123c$export$4368d992c4eafac0","describe","override","route","targetScope","targetName","scopeObject","targetScopeObject","privateName","local","appliers","_descriptors","_appliers","animation","backgroundColor","borderColor","datasets","devicePixelRatio","context","platform","getDevicePixelRatio","elements","events","font","family","lineHeight","hover","hoverBackgroundColor","hoverBorderColor","hoverColor","indexAxis","interaction","mode","intersect","includeInvisible","maintainAspectRatio","onHover","onClick","parsing","plugins","responsive","scale","scales","showLine","drawActiveElementsOnTop","_scriptable","startsWith","_indexable","_fallback","defaults","delay","duration","easing","loop","properties","numbers","active","resize","show","animations","visible","hide","autoPadding","padding","top","bottom","display","beginAtZero","bounds","clip","grace","grid","lineWidth","drawOnChartArea","drawTicks","tickLength","tickWidth","_ctx","tickColor","border","dash","dashOffset","width","text","minRotation","maxRotation","mirror","textStrokeWidth","textStrokeColor","autoSkip","autoSkipPadding","labelOffset","minor","major","crossAlign","showLabelBackdrop","backdropColor","backdropPadding","$02b6f511cc6c123c$export$e7c866399fa523f5","data","gc","longest","textWidth","measureText","$02b6f511cc6c123c$export$78acf4525d8a74c4","pixel","currentDevicePixelRatio","halfWidth","$02b6f511cc6c123c$export$c9170ad7d4cd7e57","canvas","getContext","save","resetTransform","clearRect","height","restore","$02b6f511cc6c123c$export$493d36ec626b6698","$02b6f511cc6c123c$export$24baa2b76016ce0e","xOffset","yOffset","cornerRadius","xOffsetW","yOffsetW","pointStyle","rotation","radius","rad","translate","drawImage","beginPath","ellipse","arc","closePath","moveTo","lineTo","SQRT1_2","rect","borderWidth","stroke","$02b6f511cc6c123c$export$e7094788287c5e9b","point","area","margin","$02b6f511cc6c123c$export$8743009a87fcb00f","$02b6f511cc6c123c$export$3d8c2f653ac9d0b9","$02b6f511cc6c123c$export$d24c54395ce0c509","previous","flip","midpoint","$02b6f511cc6c123c$export$6554612db691658e","bezierCurveTo","cp1x","cp2x","cp1y","cp2y","$02b6f511cc6c123c$export$dc98b0b04f4c7758","lines","strokeWidth","strokeColor","translation","fillStyle","textAlign","textBaseline","backdrop","$02b6f511cc6c123c$var$drawBackdrop","oldColor","fillRect","strokeStyle","strokeText","maxWidth","fillText","$02b6f511cc6c123c$var$decorateText","strikethrough","underline","metrics","actualBoundingBoxLeft","actualBoundingBoxRight","actualBoundingBoxAscent","actualBoundingBoxDescent","yDecoration","decorationWidth","$02b6f511cc6c123c$export$1fbe638ecf81657e","topLeft","bottomLeft","bottomRight","topRight","$02b6f511cc6c123c$var$LINE_HEIGHT","$02b6f511cc6c123c$var$FONT_STYLE","$02b6f511cc6c123c$var$numberOrZero","$02b6f511cc6c123c$export$21579262ef46735b","objProps","read","$02b6f511cc6c123c$export$d66dc83d8cfc8dd","$02b6f511cc6c123c$export$92108d983e8ee699","$02b6f511cc6c123c$export$a9c23c6ac3fc3eca","$02b6f511cc6c123c$export$34aec0b863436764","fallback","$02b6f511cc6c123c$export$8c78c7c36408ea29","matches","$02b6f511cc6c123c$export$407448d2b89b1813","inputs","info","cacheable","$02b6f511cc6c123c$export$35e795649ee09318","parentContext","$02b6f511cc6c123c$export$a9c996f45e5784d0","scopes","prefixes","rootScopes","getTarget","finalRootScopes","$02b6f511cc6c123c$var$_resolve","cache","_cacheable","_scopes","_rootScopes","_getTarget","deleteProperty","$02b6f511cc6c123c$var$_cached","$02b6f511cc6c123c$var$_resolveWithPrefixes","proxy","prefix","$02b6f511cc6c123c$var$readKey","$02b6f511cc6c123c$var$needsSubResolver","$02b6f511cc6c123c$var$createSubResolver","$02b6f511cc6c123c$var$getKeysFromAllScopes","ownKeys","storage","_storage","$02b6f511cc6c123c$export$c3950d9923825c02","subProxy","descriptorDefaults","_proxy","_context","_subProxy","_stack","$02b6f511cc6c123c$export$7910e0436ed8d1de","setContext","$02b6f511cc6c123c$var$_resolveWithContext","isScriptable","$02b6f511cc6c123c$var$_resolveScriptable","getValue","$02b6f511cc6c123c$var$_resolveArray","isIndexable","allKeys","scriptable","indexable","_allKeys","$02b6f511cc6c123c$var$getScope","parent","parentScopes","allScopes","$02b6f511cc6c123c$var$addScopesFromKey","$02b6f511cc6c123c$var$subGetTarget","$02b6f511cc6c123c$var$addScopes","parentFallback","$02b6f511cc6c123c$var$resolveKeysFromAllScopes","$02b6f511cc6c123c$export$4a5767248b18ef41","_parsing","parsed","parse","$02b6f511cc6c123c$var$EPSILON","EPSILON","$02b6f511cc6c123c$var$getPoint","skip","$02b6f511cc6c123c$var$getValueAxis","$02b6f511cc6c123c$var$capControlPoint","pt","$02b6f511cc6c123c$export$3a1a48c8f6ef640e","$02b6f511cc6c123c$export$9bb611d729802a56","domNode","parentNode","host","$02b6f511cc6c123c$var$parseMaxStyle","styleValue","parentProperty","valueInPixels","$02b6f511cc6c123c$var$getComputedStyle","element","ownerDocument","defaultView","getComputedStyle","$02b6f511cc6c123c$var$positions","$02b6f511cc6c123c$var$getPositionedStyle","suffix","$02b6f511cc6c123c$var$useOffsetPos","shadowRoot","$02b6f511cc6c123c$export$df995fae86a55f06","event","borderBox","boxSizing","paddings","borders","box","$02b6f511cc6c123c$var$getCanvasPosition","touches","offsetX","offsetY","getBoundingClientRect","clientX","clientY","$02b6f511cc6c123c$var$round1","$02b6f511cc6c123c$export$f787f51d84a910ad","forceRatio","forceStyle","pixelRatio","deviceHeight","deviceWidth","setTransform","$02b6f511cc6c123c$export$3466f893ebf79586","passiveSupported","passive","addEventListener","removeEventListener","$02b6f511cc6c123c$export$b4171a6734a65d42","getPropertyValue","$02b6f511cc6c123c$export$8a5498727ef6be21","$02b6f511cc6c123c$export$7a38258bbe170828","$02b6f511cc6c123c$export$2f6ca3d3b1f80bf5","cp1","cp2","$02b6f511cc6c123c$export$3d12bd131bb975d1","rectX","setWidth","xPlus","leftForLtr","itemWidth","_itemWidth","$02b6f511cc6c123c$export$91c6e00c14e7e6fd","direction","getPropertyPriority","setProperty","prevTextDirection","$02b6f511cc6c123c$export$890c4ad488842ce7","$02b6f511cc6c123c$var$propertyFn","between","compare","normalize","$02b6f511cc6c123c$var$normalizeSegment","$02b6f511cc6c123c$export$9fa96a7d116ea3ce","segment","prevValue","startBound","endBound","$02b6f511cc6c123c$var$getSegment","inside","subStart","startIsBefore","endIsBefore","shouldStart","shouldStop","$02b6f511cc6c123c$export$306ddfe3a8403e2","segments","sub","$02b6f511cc6c123c$var$splitByStyles","segmentOptions","$02b6f511cc6c123c$var$doSplitByStyles","chartContext","_chart","baseStyle","$02b6f511cc6c123c$var$readStyle","_datasetIndex","spanGaps","prevStyle","addStyle","st","$02b6f511cc6c123c$var$styleChanged","replacer","p0","p0DataIndex","p1DataIndex","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","$77dc20320068f1ee$export$a424a0aa8f687495","_notify","anims","date","callbacks","numSteps","initial","currentStep","_refresh","_request","_running","_update","now","remaining","_charts","running","draw","_active","_total","tick","_lastDate","_getAnims","charts","complete","progress","listen","acc","_duration","stop","cancel","remove","$77dc20320068f1ee$var$transparent","$77dc20320068f1ee$var$interpolators","boolean","factor","c0","$77dc20320068f1ee$export$c35d437ae5945fcd","update","cfg","currentValue","_target","_prop","elapsed","_start","_loop","_to","_from","_easing","_fn","wait","promises","_promises","resolved","$77dc20320068f1ee$export$8ab227dac26677d","configure","config","animationOptions","animatedProps","_properties","option","_animateOptions","newOptions","$77dc20320068f1ee$var$resolveTargetOptions","$shared","$animations","_createAnimations","$77dc20320068f1ee$var$awaitAll","anim","$77dc20320068f1ee$var$scaleClip","allowedOverflow","$77dc20320068f1ee$var$getSortedDatasetIndices","filterVisible","metasets","_getSortedDatasetMetas","$77dc20320068f1ee$var$applyStack","dsIndex","otherValue","singleMode","$77dc20320068f1ee$var$isStacked","stacked","$77dc20320068f1ee$var$getLastIndexInStack","vScale","positive","getMatchingVisibleMetas","$77dc20320068f1ee$var$updateStacks","controller","_cachedMeta","stacks","_stacks","iAxis","vAxis","indexScale","valueScale","itemStacks","$77dc20320068f1ee$var$getOrCreateStack","stackKey","indexValue","subStack","_top","_bottom","visualValues","_visualValues","$77dc20320068f1ee$var$getFirstScaleId","$77dc20320068f1ee$var$clearStacks","$77dc20320068f1ee$var$isDirectUpdateMode","$77dc20320068f1ee$var$cloneIfNotShared","cached","shared","$77dc20320068f1ee$var$createStack","canStack","hidden","_stacked","$77dc20320068f1ee$export$75572ec5c55b4048","initialize","linkScales","addElements","isPluginEnabled","updateIndex","dataset","getDataset","chooseId","xid","xAxisID","yid","yAxisID","rid","rAxisID","iid","iAxisID","vid","vAxisID","getScaleForId","rScale","getMeta","getDatasetMeta","scaleID","_getOtherScale","reset","_destroy","_data","_dataCheck","$77dc20320068f1ee$var$convertObjectDataToArray","adata","isExtensible","_syncList","datasetElementType","buildOrUpdateElements","resetNewElements","stackChanged","oldStacked","_resyncElements","scopeKeys","datasetScopeKeys","_type","getOptionScopes","createResolver","_cachedDataOpts","parseArrayData","parseObjectData","parsePrimitiveData","isNotInOrderComparedToPrev","labels","getLabels","singleScale","xAxisKey","yAxisKey","getParsed","getDataElement","applyStack","updateRangeFromParsed","parsedValue","getMinMax","otherScale","NEGATIVE_INFINITY","otherMin","otherMax","$77dc20320068f1ee$var$getUserBounds","_skip","getAllParsedValues","getMaxOverflow","getLabelAndValue","label","getLabelForValue","_clip","$77dc20320068f1ee$var$defaultClip","disabled","chartArea","_drawStart","_drawCount","getStyle","resolveDatasetElementOptions","resolveDataElementOptions","$context","dataIndex","raw","_resolveElementOptions","dataElementType","elementType","sharing","enableOptionSharing","datasetElementScopeKeys","names","resolveNamedOptions","freeze","_resolveAnimations","transition","datasetAnimationScopeKeys","getSharedOptions","_sharedOptions","includeOptions","sharedOptions","_animationsDisabled","_getSharedOptions","firstOpts","previouslySharedOptions","updateSharedOptions","updateElement","_setStyle","removeHoverStyle","setHoverStyle","_removeDatasetHoverStyle","_setDatasetHoverStyle","numMeta","numData","_insertElements","_removeElements","move","updateElements","removed","_sync","_dataChanges","_onDataPush","_onDataPop","_onDataShift","_onDataSplice","newCount","_onDataUnshift","_objectData","supportsDecimation","$77dc20320068f1ee$var$parseValue","entry","$77dc20320068f1ee$var$parseFloatBar","startValue","endValue","barStart","barEnd","_custom","$77dc20320068f1ee$var$parseArrayOrPrimitive","$77dc20320068f1ee$var$isFloatBar","$77dc20320068f1ee$var$parseEdge","edge","orig","$77dc20320068f1ee$var$startEnd","$77dc20320068f1ee$export$e97d5dc64e999004","iAxisKey","vAxisKey","bars","getBasePixel","horizontal","isHorizontal","ruler","_getRuler","vpixels","head","_calculateBarValuePixels","ipixels","_calculateBarIndexPixels","enableBorderRadius","center","$77dc20320068f1ee$var$setBorderSkipped","borderSkipped","$77dc20320068f1ee$var$setInflateAmount","inflateAmount","_getStacks","grouped","skipNull","_getStackCount","_getStackIndex","pixels","barThickness","$77dc20320068f1ee$var$computeMinSampleSize","curr","$77dc20320068f1ee$var$getAllScaleValues","$bar","visibleMetas","sort","_length","updateMinAndPrev","getPixelForTick","_startPixel","_endPixel","stackCount","categoryPercentage","barPercentage","baseValue","minBarLength","actualBase","floating","getDataVisibility","startPixel","getPixelForDecimal","endPixel","getValueForPixel","halfGrid","getLineWidthForValue","maxBarThickness","$77dc20320068f1ee$var$computeFlexCategoryTraits","percent","chunk","$77dc20320068f1ee$var$computeFitCategoryTraits","thickness","stackIndex","rects","_index_","_value_","$77dc20320068f1ee$export$19b5c4773f17abe","iPixel","vPixel","$77dc20320068f1ee$export$e04603e7d8b77172","_getRotation","_getCircumference","circumference","_getRotationExtents","isDatasetVisible","arcs","spacing","getMaxBorderWidth","getMaxOffset","maxSize","cutout","chartWeight","_getRingWeight","ratioX","ratioY","$77dc20320068f1ee$var$getRatioAndOffset","endAngle","startAngle","startX","startY","endX","endY","calcMax","calcMin","maxX","maxY","minX","minY","maxHeight","outerRadius","innerRadius","radiusLength","_getVisibleDatasetWeightTotal","total","calculateTotal","_getRingWeightOffset","_circumference","animateRotate","calculateCircumference","animationOpts","centerX","centerY","animateScale","metaData","borderAlign","hoverBorderWidth","hoverOffset","ringWeightOffset","aspectRatio","legend","generateLabels","fontColor","legendItem","toggleDataVisibility","$77dc20320068f1ee$export$3c9b5d28c11cbfd0","_dataset","_decimated","animated","maxGapLength","directUpdate","pointsCount","prevParsed","nullData","firstPoint","lastPoint","updateControlPoints","$77dc20320068f1ee$export$2a270b3a0d973c85","_updateRadius","minSize","cutoutPercentage","getVisibleDatasetCount","xCenter","yCenter","datasetStartAngle","getIndexAngle","defaultAngle","countVisibleElements","_computeAngle","getDistanceFromCenterForValue","angleLines","circular","pointLabels","$77dc20320068f1ee$export$b21a3f1286706191","$77dc20320068f1ee$export$48dbc6ac651bf8be","_fullLoop","pointPosition","getPointPositionForValue","$77dc20320068f1ee$export$b2f2bae6713db87","registry","getElement","$77dc20320068f1ee$export$a6506504f799c5d5","BarController","BubbleController","DoughnutController","LineController","PieController","PolarAreaController","RadarController","ScatterController","$77dc20320068f1ee$var$abstract","$77dc20320068f1ee$var$DateAdapterBase","members","formats","diff","startOf","endOf","$77dc20320068f1ee$export$f32766ea09ec8bc4","_date","$77dc20320068f1ee$var$evaluateInteractionItems","handler","getSortedVisibleDatasetMetas","$77dc20320068f1ee$var$binarySearch","metaset","lookupMethod","_reversePixels","el","getRange","$77dc20320068f1ee$var$getIntersectItems","useFinalPosition","isPointInArea","inRange","$77dc20320068f1ee$var$getNearestItems","$77dc20320068f1ee$var$getNearestCartesianItems","distanceMetric","$77dc20320068f1ee$var$getDistanceMetricForAxis","useX","useY","deltaX","deltaY","minDistance","getCenterPoint","pointInArea","getProps","$77dc20320068f1ee$var$getAxisItems","rangeMethod","intersectsItem","$77dc20320068f1ee$export$a13296960cae0384","modes","nearest","$77dc20320068f1ee$var$STATIC_POSITIONS","$77dc20320068f1ee$var$filterByPosition","$77dc20320068f1ee$var$filterDynamicPositionByAxis","$77dc20320068f1ee$var$sortByWeight","$77dc20320068f1ee$var$getCombinedMax","maxPadding","$77dc20320068f1ee$var$updateMaxPadding","boxPadding","$77dc20320068f1ee$var$fitBoxes","boxes","params","layout","refit","refitBoxes","$77dc20320068f1ee$var$getMargins","positions","same","$77dc20320068f1ee$var$updateDims","getPadding","newWidth","outerWidth","newHeight","outerHeight","widthChanged","heightChanged","fullSize","$77dc20320068f1ee$var$setBoxDims","$77dc20320068f1ee$var$placeBoxes","userPadding","placed","stackWeight","$77dc20320068f1ee$export$1ecca0613f5e56d2","addBox","_layers","z","removeBox","layoutItem","minPadding","availableWidth","availableHeight","$77dc20320068f1ee$var$buildLayoutBoxes","layoutBoxes","$77dc20320068f1ee$var$wrapBoxes","wrap","centerHorizontal","centerVertical","leftAndTop","rightAndBottom","vertical","verticalBoxes","horizontalBoxes","beforeLayout","visibleVerticalBoxCount","vBoxMaxWidth","hBoxMaxHeight","$77dc20320068f1ee$var$setLayoutDims","layouts","$77dc20320068f1ee$var$buildStacks","$77dc20320068f1ee$var$handleMaxPadding","updatePos","change","$77dc20320068f1ee$export$7b1aeb87f31f7da8","acquireContext","releaseContext","getMaximumSize","isAttached","updateConfig","$77dc20320068f1ee$export$a40a96b24b46cf35","$77dc20320068f1ee$var$EXPANDO_KEY","$77dc20320068f1ee$var$EVENT_TYPES","touchstart","touchmove","touchend","pointerenter","pointerdown","pointermove","pointerup","pointerleave","pointerout","$77dc20320068f1ee$var$isNullOrEmpty","$77dc20320068f1ee$var$eventListenerOptions","$77dc20320068f1ee$var$removeListener","$77dc20320068f1ee$var$nodeListContains","nodeList","contains","$77dc20320068f1ee$var$createAttachObserver","observer","MutationObserver","entries","trigger","addedNodes","removedNodes","observe","childList","subtree","$77dc20320068f1ee$var$createDetachObserver","$77dc20320068f1ee$var$drpListeningCharts","$77dc20320068f1ee$var$oldDevicePixelRatio","$77dc20320068f1ee$var$onWindowResize","dpr","$77dc20320068f1ee$var$createResizeObserver","container","clientWidth","ResizeObserver","contentRect","$77dc20320068f1ee$var$releaseObserver","disconnect","$77dc20320068f1ee$var$createProxyAndListen","$77dc20320068f1ee$var$fromNativeEvent","native","$77dc20320068f1ee$var$addListener","$77dc20320068f1ee$export$f02da7f882cf6b2e","$77dc20320068f1ee$var$initCanvas","renderHeight","getAttribute","renderWidth","displayWidth","displayHeight","removeAttribute","setAttribute","proxies","$proxies","handlers","attach","detach","bbWidth","bbHeight","margins","containerSize","$02b6f511cc6c123c$var$getContainerSize","containerStyle","containerBorder","containerPadding","clientHeight","maintainHeight","isConnected","$77dc20320068f1ee$export$db77ccec0bb4ccac","tooltipPosition","hasValue","final","$77dc20320068f1ee$var$skip","newTicks","majorStart","majorEnd","ceil","$77dc20320068f1ee$var$reverseAlign","$77dc20320068f1ee$var$offsetFromEdge","$77dc20320068f1ee$var$getTicksLimit","ticksLength","maxTicksLimit","$77dc20320068f1ee$var$sample","numItems","increment","$77dc20320068f1ee$var$getTickMarkLength","$77dc20320068f1ee$var$getTitleHeight","$77dc20320068f1ee$export$d60cfc58d3c358b6","_userMin","_userMax","_suggestedMin","suggestedMin","_suggestedMax","suggestedMax","metas","paddingLeft","paddingTop","paddingRight","paddingBottom","getTicks","xLabels","yLabels","getLabelItems","_labelItems","_computeLabelItems","_dataLimitsCached","beforeUpdate","tickOpts","sampleSize","_margins","_labelSizes","_gridLineItems","beforeSetDimensions","setDimensions","afterSetDimensions","_maxLength","beforeDataLimits","determineDataLimits","afterDataLimits","_range","minmax","keepZero","beforeBuildTicks","buildTicks","afterBuildTicks","samplingEnabled","_convertTicksToLabels","beforeCalculateLabelRotation","calculateLabelRotation","afterCalculateLabelRotation","$77dc20320068f1ee$var$autoSkip","determinedMaxTicks","$77dc20320068f1ee$var$determineMaxTicks","_tickSize","maxScale","maxChart","ticksLimit","majorIndices","enabled","$77dc20320068f1ee$var$getMajorIndices","numMajorIndices","$77dc20320068f1ee$var$skipMajors","$77dc20320068f1ee$var$calculateSpacing","evenMajorSpacing","$77dc20320068f1ee$var$getEvenSpacing","factors","avgMajorSpacing","afterAutoSkip","beforeFit","fit","afterFit","afterUpdate","reversePixels","_alignToPixels","alignToPixels","_callHooks","notifyPlugins","beforeTickToLabelConversion","generateTickLabels","afterTickToLabelConversion","maxLabelDiagonal","numTicks","labelRotation","_isVisible","labelSizes","_getLabelSizes","maxLabelWidth","widest","maxLabelHeight","highest","radians","asin","titleOpts","gridOpts","titleHeight","tickPadding","angleRadians","labelHeight","labelWidth","_calculatePadding","_handleMargins","isRotated","labelsBelowTicks","offsetLeft","offsetRight","isFullSize","_computeLabelSizes","jlen","tickFont","fontString","nestedLabel","_longestTextCache","caches","widths","heights","widestLabelSize","highestLabelSize","_resolveTickFontOptions","gcLen","valueAt","decimal","getDecimalForPixel","getBaseValue","optionTicks","rot","_computeGridLineItems","borderValue","lineValue","alignedLineValue","tx1","ty1","tx2","ty2","x1","y1","x2","y2","tl","borderOpts","axisWidth","axisHalfWidth","alignBorderValue","positionAxisID","step","optsAtIndex","optsAtIndexBorder","lineColor","tickBorderDash","tickBorderDashOffset","$77dc20320068f1ee$var$getPixelForGridLine","offsetGridLines","validIndex","_ticksLength","_borderValue","lineCount","textOffset","tickAndPadding","hTickAndPadding","_getXAxisLabelAlignment","_getYAxisLabelAlignment","halfCount","tickTextAlign","labelPadding","_computeLabelArea","drawBackground","findIndex","drawGrid","drawLine","setLineDash","lineDashOffset","drawBorder","lastLineWidth","drawLabels","renderTextOptions","drawTitle","titleX","titleY","$77dc20320068f1ee$var$titleArgs","tz","gz","bz","axisID","_maxDigits","fontSize","$77dc20320068f1ee$var$TypedRegistry","isForType","parentScope","$77dc20320068f1ee$var$registerDefaults","itemDefaults","defaultRoutes","$77dc20320068f1ee$var$routeDefaults","routes","propertyParts","sourceName","sourceScope","overrides","unregister","$77dc20320068f1ee$export$4bb7493d241fd8a5","_each","addControllers","controllers","addPlugins","addScales","getController","_get","getPlugin","getScale","removeControllers","removeElements","removePlugins","removeScales","typedRegistry","reg","_getRegistryForType","_exec","itemReg","component","camelMethod","_typedRegistries","$77dc20320068f1ee$var$PluginService","notify","hook","_init","_createDescriptors","plugin","cancelable","invalidate","_oldCache","_notifyStateChanges","$77dc20320068f1ee$var$allPlugins","localIds","$77dc20320068f1ee$var$createDescriptors","$77dc20320068f1ee$var$pluginOpts","pluginScopeKeys","previousDescriptors","some","$77dc20320068f1ee$var$getIndexAxis","datasetDefaults","datasetOptions","$77dc20320068f1ee$var$idMatchesAxis","$77dc20320068f1ee$var$determineAxis","scaleOptions","$77dc20320068f1ee$var$getAxisFromDataset","$77dc20320068f1ee$var$initOptions","$77dc20320068f1ee$var$mergeScaleConfig","chartDefaults","configScales","chartIndexAxis","scaleConf","$77dc20320068f1ee$var$retrieveAxisFromDatasets","boundDs","defaultId","defaultScaleOptions","defaultID","$77dc20320068f1ee$var$initData","$77dc20320068f1ee$var$keyCache","$77dc20320068f1ee$var$keysCached","$77dc20320068f1ee$var$cachedKeys","generate","$77dc20320068f1ee$var$addIfFound","$77dc20320068f1ee$var$Config","_config","clearCache","_scopeCache","clear","_resolverCache","datasetType","additionalOptionScopes","_cachedScopes","mainScope","resetCache","keyLists","chartOptionScopes","subPrefixes","$77dc20320068f1ee$var$getResolver","$77dc20320068f1ee$var$needContext","$77dc20320068f1ee$var$hasFunction","subResolver","resolverCache","$77dc20320068f1ee$var$KNOWN_POSITIONS","$77dc20320068f1ee$var$positionIsHorizontal","$77dc20320068f1ee$var$compare2Level","l1","l2","$77dc20320068f1ee$var$onAnimationsComplete","onComplete","$77dc20320068f1ee$var$onAnimationProgress","onProgress","$77dc20320068f1ee$var$getCanvas","getElementById","$77dc20320068f1ee$var$instances","$77dc20320068f1ee$var$getChart","$77dc20320068f1ee$var$getSizeForArea","field","$77dc20320068f1ee$export$acaa6426d77a227e","$77dc20320068f1ee$var$invalidatePlugins","_aspectRatio","_options","_initialize","bindEvents","_resizeBeforeDraw","_resize","newSize","newRatio","onResize","attached","_doResize","render","ensureScalesHaveIDs","scalesOptions","axisOptions","buildOrUpdateScales","scaleOpts","updated","isRadial","dposition","dtype","scaleType","scaleClass","hasUpdated","_updateMetasets","_metasets","_destroyDatasetMeta","_sortedMetasets","_removeUnreferencedMetasets","buildOrUpdateControllers","newControllers","order","ControllerClass","_resetElements","animsDisabled","_updateScales","_checkEventBindings","_updateHiddenIndices","_plugins","_minPadding","_updateLayout","_updateDatasets","_lastEvent","_eventHandler","_updateHoverStyles","existingEvents","_listeners","newEvents","_responsiveListeners","unbindEvents","_hiddenIndices","changes","_getUniformDataChanges","$77dc20320068f1ee$var$moveNumericKeys","intKey","datasetCount","makeSet","changeSet","noArea","_idx","_updateDataset","layers","_drawDatasets","_drawDataset","useClip","$77dc20320068f1ee$var$getDatasetArea","getElementsAtEventForMode","setDatasetVisibility","_updateVisibility","_stop","destroy","toBase64Image","toDataURL","bindUserEvents","bindResponsiveEvents","_add","detached","_remove","updateHoverStyle","getActiveElements","setActiveElements","activeElements","lastActive","pluginId","replay","hoverOptions","deactivated","activated","inChartArea","eventFilter","_handleEvent","lastEvent","_getActiveElements","isClick","userConfig","initialCanvas","existingChart","OffscreenCanvas","resizeDelay","instances","$77dc20320068f1ee$var$rThetaToXY","theta","$77dc20320068f1ee$var$pathArc","pixelMargin","innerR","spacingOffset","noSpacingOuterRadius","avNogSpacingRadius","noSpacingInnerRadius","beta","angleOffset","outerStart","outerEnd","innerStart","innerEnd","$77dc20320068f1ee$var$parseBorderRadius$1","angleDelta","borderRadius","halfThickness","innerLimit","computeOuterLimit","outerArcLimit","outerStartAdjustedRadius","outerEndAdjustedRadius","outerStartAdjustedAngle","outerEndAdjustedAngle","innerStartAdjustedRadius","innerEndAdjustedRadius","innerStartAdjustedAngle","innerEndAdjustedAngle","outerMidAdjustedAngle","pCenter","p4","innerMidAdjustedAngle","p8","outerStartX","outerStartY","outerEndX","outerEndY","$77dc20320068f1ee$export$d48203c759d6a1fc","chartX","chartY","rAdjust","betweenAngles","withinRadius","halfAngle","halfRadius","fullCircles","fix","radiusOffset","$77dc20320068f1ee$var$drawArc","$77dc20320068f1ee$var$drawBorder","inner","lineJoin","$77dc20320068f1ee$var$clipArc","angleMargin","$77dc20320068f1ee$var$setStyle","lineCap","$77dc20320068f1ee$var$lineTo","$77dc20320068f1ee$var$pathVars","paramsStart","paramsEnd","segmentStart","segmentEnd","$77dc20320068f1ee$var$pathSegment","lineMethod","stepped","tension","cubicInterpolationMode","$77dc20320068f1ee$var$fastPathSegment","prevX","lastY","avgX","countX","pointIndex","drawX","truncX","$77dc20320068f1ee$var$_getSegmentMethod","useFastPath","$77dc20320068f1ee$var$usePath2D","Path2D","$77dc20320068f1ee$export$55e463fa7bcd3469","_pointsUpdated","controlPoints","$02b6f511cc6c123c$export$527e9aa3390079e9","pointBefore","pointCurrent","valueAxis","pointsLen","deltaK","mK","pointAfter","slopeDelta","$02b6f511cc6c123c$var$monotoneAdjust","alphaK","betaK","tauK","squaredMagnitude","$02b6f511cc6c123c$var$monotoneCompute","$02b6f511cc6c123c$export$e171bab687b50e0","middlePoint","afterPoint","d01","d12","s01","s12","fa","fb","capBezierPoints","$02b6f511cc6c123c$var$capBezierPoints","inArea","inAreaPrev","inAreaNext","_points","_segments","_path","$02b6f511cc6c123c$var$findStartAndEnd","completeLoop","$02b6f511cc6c123c$var$solidSegments","_interpolate","interpolated","pathSegment","segmentMethod","path","$77dc20320068f1ee$var$draw","$77dc20320068f1ee$var$strokePathWithCache","$77dc20320068f1ee$var$strokePathDirect","$77dc20320068f1ee$var$inRange$1","hitRadius","$77dc20320068f1ee$export$bd159b522b230b7a","mouseX","mouseY","inXRange","inYRange","hoverRadius","$77dc20320068f1ee$var$getBarBounds","bar","half","$77dc20320068f1ee$var$skipOrLimit","$77dc20320068f1ee$var$inRange","skipX","skipY","$77dc20320068f1ee$var$addNormalRectPath","$77dc20320068f1ee$var$inflateRect","amount","refRect","$77dc20320068f1ee$export$a16ed71bf4b07672","outer","$77dc20320068f1ee$var$boundingRects","$77dc20320068f1ee$var$parseBorderWidth","maxW","maxH","$77dc20320068f1ee$var$parseBorderRadius","maxR","enableBorder","addRectPath","$77dc20320068f1ee$var$hasRadius","$77dc20320068f1ee$export$7a5d735b2ab6389d","ArcElement","BarElement","LineElement","PointElement","$77dc20320068f1ee$var$BORDER_COLORS","$77dc20320068f1ee$var$BACKGROUND_COLORS","$77dc20320068f1ee$var$getBorderColor","$77dc20320068f1ee$var$getBackgroundColor","$77dc20320068f1ee$var$containsColorsDefinitions","$77dc20320068f1ee$var$cleanDecimatedDataset","$77dc20320068f1ee$var$cleanDecimatedData","$77dc20320068f1ee$var$_getBounds","$77dc20320068f1ee$var$_findSegmentEnd","$77dc20320068f1ee$var$_getEdge","$77dc20320068f1ee$var$_createBoundaryLine","boundary","$77dc20320068f1ee$var$_pointsFromSegments","linePoints","$77dc20320068f1ee$var$_shouldApplyFill","$77dc20320068f1ee$var$simpleArc","$77dc20320068f1ee$var$_drawfill","$77dc20320068f1ee$var$_getTarget","$77dc20320068f1ee$var$getLineByIndex","$77dc20320068f1ee$var$_buildStackLine","sourcePoints","linesBelow","$77dc20320068f1ee$var$getLinesBelow","below","unshift","$77dc20320068f1ee$var$addPointsBelow","sourcePoint","postponed","$77dc20320068f1ee$var$findPoint","pointValue","firstValue","lastValue","$77dc20320068f1ee$var$computeBoundary","$77dc20320068f1ee$var$computeCircularBoundary","$77dc20320068f1ee$var$computeLinearBoundary","lineOpts","fillOption","above","$77dc20320068f1ee$var$doFill","$77dc20320068f1ee$var$clipVertical","$77dc20320068f1ee$var$fill","clipY","lineLoop","$77dc20320068f1ee$var$_segments","tpoints","targetSegments","tgt","subBounds","fillSources","fillSource","src","notShape","$77dc20320068f1ee$var$clipBounds","$77dc20320068f1ee$var$interpolatedLineTo","targetLoop","interpolatedPoint","$77dc20320068f1ee$var$getBoxSize","labelOpts","boxHeight","boxWidth","usePointStyle","pointStyleWidth","itemHeight","$77dc20320068f1ee$var$itemsEqual","$77dc20320068f1ee$var$Legend","buildLabels","legendItems","labelFont","_computeTitleHeight","_fitRows","_fitCols","hitboxes","legendHitBoxes","lineWidths","totalHeight","row","_itemHeight","columnSizes","heightLimit","totalWidth","currentColWidth","currentColHeight","col","$77dc20320068f1ee$var$calculateItemSize","fontLineHeight","legendItemText","$77dc20320068f1ee$var$calculateLegendItemHeight","adjustHitBoxes","rtlHelper","hitbox","_draw","cursor","defaultColor","halfFontSize","drawLegendBox","lineDash","drawOptions","SQRT2","yBoxTop","xBoxLeft","textDirection","realX","titleFont","titlePadding","topPaddingPlusHalfFontSize","_getLegendItemAt","hitBox","lh","handleEvent","onLeave","hoveredItem","_hoveredItem","sameItem","_added","doughnutMode","$77dc20320068f1ee$var$Title","_padding","textSize","_drawArgs","fontOpts","$77dc20320068f1ee$var$map","$77dc20320068f1ee$var$positioners","average","eventPosition","nearestElement","tp","$77dc20320068f1ee$var$pushOrConcat","toPush","$77dc20320068f1ee$var$splitNewlines","$77dc20320068f1ee$var$getTooltipSize","tooltip","body","footer","bodyFont","footerFont","titleLineCount","footerLineCount","bodyLineItemCount","combinedBodyLength","bodyItem","before","after","beforeBody","afterBody","titleSpacing","titleMarginBottom","bodyLineHeight","displayColors","bodySpacing","footerMarginTop","footerSpacing","widthPadding","maxLineWidth","$77dc20320068f1ee$var$determineAlignment","yAlign","$77dc20320068f1ee$var$determineYAlign","xAlign","$77dc20320068f1ee$var$determineXAlign","chartWidth","$77dc20320068f1ee$var$doesNotFitWithAlign","caret","caretSize","caretPadding","$77dc20320068f1ee$var$getBackgroundPoint","alignment","paddingAndSize","$77dc20320068f1ee$var$alignX","$77dc20320068f1ee$var$alignY","$77dc20320068f1ee$var$getAlignedX","$77dc20320068f1ee$var$overrideCallbacks","$77dc20320068f1ee$var$defaultCallbacks","beforeTitle","tooltipItems","labelCount","afterTitle","beforeLabel","tooltipItem","formattedValue","labelColor","labelTextColor","bodyColor","labelPointStyle","afterLabel","beforeFooter","afterFooter","$77dc20320068f1ee$var$invokeCallbackWithFallback","$77dc20320068f1ee$var$Tooltip","_cachedAnimations","_tooltipItems","getTitle","getBeforeBody","getBody","bodyItems","scoped","getAfterBody","getFooter","_createItems","labelColors","labelPointStyles","labelTextColors","$77dc20320068f1ee$var$createTooltipItem","itemSort","dataPoints","_eventPosition","_size","positionAndSize","backgroundPoint","opacity","caretX","caretY","external","drawCaret","tooltipPoint","caretPosition","getCaretPosition","x3","y3","ptX","ptY","titleAlign","titleColor","_drawColorBox","colorX","rtlColorX","yOffSet","colorY","multiKeyBackground","outerX","innerX","strokeRect","drawBody","textColor","bodyAlign","xLinePadding","fillLineOfText","bodyAlignForCalculation","drawFooter","footerAlign","footerColor","tooltipSize","quadraticCurveTo","_updateAnimationTarget","animX","animY","_willRender","hasTooltipContent","globalAlpha","positionChanged","_positionChanged","_ignoreReplayEvents","$77dc20320068f1ee$export$8b3ca321c77fdea6","Colors","forceOverride","_args","chartOptions","colorizer","Decimation","algorithm","beforeElementsUpdate","decimated","xAxis","$77dc20320068f1ee$var$getStartAndCountOfVisiblePointsSimplified","threshold","$77dc20320068f1ee$var$lttbDecimation","maxAreaPoint","maxArea","nextA","samples","bucketWidth","sampledIndex","endIndex","avgY","avgRangeStart","avgRangeEnd","avgRangeLength","rangeOffs","rangeTo","pointAx","pointAy","$77dc20320068f1ee$var$minMaxDecimation","minIndex","maxIndex","startIndex","xMin","xMax","dx","lastIndex","intermediateIndex1","intermediateIndex2","Filler","afterDatasetsUpdate","$77dc20320068f1ee$var$_decodeFill","firstCh","$77dc20320068f1ee$var$parseFillOption","$filler","$77dc20320068f1ee$var$_resolveTarget","propagate","visited","beforeDraw","drawTime","beforeDatasetsDraw","beforeDatasetDraw","Legend","_element","afterEvent","ci","useBorderRadius","SubTitle","Title","$77dc20320068f1ee$var$createTitle","titleBlock","Tooltip","positioners","afterInit","afterDraw","$77dc20320068f1ee$var$addIfString","addedLabels","$77dc20320068f1ee$var$validIndex","$77dc20320068f1ee$var$_getLabelForValue","$77dc20320068f1ee$export$29e663ba4d09fe7","added","_addedLabels","$77dc20320068f1ee$var$findOrAddLabel","lastIndexOf","_valueRange","_startValue","$77dc20320068f1ee$var$relativeLabelSize","minSpacing","$77dc20320068f1ee$var$LinearScaleBase","handleTickRangeOptions","setMin","setMax","minSign","maxSign","getTickLimit","maxTicks","stepSize","computeTickLimit","numericGeneratorOptions","precision","maxDigits","includeBounds","dataRange","$77dc20320068f1ee$var$generateTicks$1","generationOptions","niceMin","niceMax","numSpaces","unit","maxSpaces","rmin","rmax","countDefined","rounded","decimalPlaces","_endValue","$77dc20320068f1ee$export$e7f4e5e8656f0b93","$77dc20320068f1ee$var$log10Floor","$77dc20320068f1ee$var$changeExponent","$77dc20320068f1ee$var$isMajor","tickVal","$77dc20320068f1ee$var$steps","rangeExp","rangeStep","$77dc20320068f1ee$export$85295eaf7cb3ac3e","_zero","$77dc20320068f1ee$var$generateTicks","minExp","exp","$77dc20320068f1ee$var$startExp","lastTick","$77dc20320068f1ee$var$getTickBackdropHeight","$77dc20320068f1ee$var$determineLimits","$77dc20320068f1ee$var$pathRadiusLine","getPointPosition","$77dc20320068f1ee$export$cfafc36d95386d38","drawingArea","_pointLabels","$77dc20320068f1ee$var$fitWithPointLabels","limits","valueCount","pointLabelOpts","additionalAngle","centerPointLabels","getPointLabelContext","plFont","arrayOfThings","nestedThing","garbageCollect","hLimits","vLimits","$77dc20320068f1ee$var$updateLimits","setCenterPoint","_pointLabelItems","$77dc20320068f1ee$var$buildPointLabelItems","itemOpts","extra","$77dc20320068f1ee$var$createPointLabelItem","outerDistance","pointLabelPosition","$77dc20320068f1ee$var$isNotOverlapped","apexesInArea","leftMovement","rightMovement","topMovement","bottomMovement","angleMultiplier","scalingFactor","getValueForDistanceFromCenter","scaledDistance","pointLabel","distanceFromCenter","getBasePosition","getPointLabelPosition","$77dc20320068f1ee$var$drawPointLabels","$77dc20320068f1ee$var$drawPointLabelBox","backdropLeft","backdropTop","backdropWidth","backdropHeight","$77dc20320068f1ee$var$drawRadiusLine","gridLineOpts","animate","$77dc20320068f1ee$var$INTERVALS","millisecond","common","steps","second","minute","hour","day","week","month","quarter","year","$77dc20320068f1ee$var$UNITS","$77dc20320068f1ee$var$sorter","$77dc20320068f1ee$var$parse","adapter","_adapter","parser","isoWeekday","_parseOpts","$77dc20320068f1ee$var$determineUnitForAutoTicks","minUnit","capacity","interval","MAX_SAFE_INTEGER","$77dc20320068f1ee$var$addTick","timestamps","timestamp","$77dc20320068f1ee$var$ticksFromTimestamps","majorUnit","$77dc20320068f1ee$var$setMajorTicks","$77dc20320068f1ee$export$a894c72689ff3ec","adapters","displayFormats","_normalized","normalized","_applyBounds","_getLabelBounds","getLabelTimestamps","timeOpts","_generate","_unit","_getLabelCapacity","$77dc20320068f1ee$var$determineUnitForFormatting","_majorUnit","$77dc20320068f1ee$var$determineMajorUnit","initOffsets","offsetAfterAutoskip","getDecimalForValue","_offsets","weekday","hasWeekday","getDataTimestamps","tooltipFormat","datetime","fmt","_tickFormatFunction","minorFormat","majorFormat","offsets","_getLabelSize","ticksOpts","tickLabelWidth","cosRotation","sinRotation","tickFontSize","exampleTime","exampleLabel","$77dc20320068f1ee$var$interpolate","prevSource","nextSource","prevTarget","nextTarget","span","$77dc20320068f1ee$export$85df64a8eb6dc986","_getTimestampsForTable","_table","buildLookupTable","_minPos","_tableRange","$77dc20320068f1ee$export$bcac1c16f1530ec2","CategoryScale","LinearScale","LogarithmicScale","RadialLinearScale","TimeScale","TimeSeriesScale","$3bc6321cdb0e9401$var$ownKeys","enumerableOnly","symbols","$3bc6321cdb0e9401$var$_objectSpread2","$3bc6321cdb0e9401$var$_typeof","$3bc6321cdb0e9401$var$_extends","$3bc6321cdb0e9401$var$userAgent","pattern","navigator","userAgent","$3bc6321cdb0e9401$var$IE11OrLess","$3bc6321cdb0e9401$var$Edge","$3bc6321cdb0e9401$var$FireFox","$3bc6321cdb0e9401$var$Safari","$3bc6321cdb0e9401$var$IOS","$3bc6321cdb0e9401$var$ChromeForAndroid","$3bc6321cdb0e9401$var$captureMode","capture","$3bc6321cdb0e9401$var$on","$3bc6321cdb0e9401$var$off","$3bc6321cdb0e9401$var$matches","selector","msMatchesSelector","webkitMatchesSelector","$3bc6321cdb0e9401$var$closest","includeCTX","nodeType","$3bc6321cdb0e9401$var$R_SPACE","$3bc6321cdb0e9401$var$toggleClass","state","classList","className","$3bc6321cdb0e9401$var$css","currentStyle","$3bc6321cdb0e9401$var$matrix","selfOnly","appliedTransforms","transform","matrixFn","DOMMatrix","WebKitCSSMatrix","CSSMatrix","MSCSSMatrix","$3bc6321cdb0e9401$var$find","tagName","getElementsByTagName","$3bc6321cdb0e9401$var$getWindowScrollingElement","scrollingElement","documentElement","$3bc6321cdb0e9401$var$getRect","relativeToContainingBlock","relativeToNonStaticParent","undoScale","elRect","innerHeight","innerWidth","containerRect","elMatrix","scaleX","scaleY","$3bc6321cdb0e9401$var$getContentRect","$3bc6321cdb0e9401$var$isScrolledPast","elSide","parentSide","$3bc6321cdb0e9401$var$getParentAutoScrollElement","elSideVal","parentSideVal","$3bc6321cdb0e9401$var$getChild","childNum","includeDragEl","currentChild","children","$3bc6321cdb0e9401$export$31b3ca70d8f57423","ghost","dragged","draggable","$3bc6321cdb0e9401$var$lastChild","lastElementChild","previousElementSibling","$3bc6321cdb0e9401$var$index","nodeName","$3bc6321cdb0e9401$var$getRelativeScrollOffset","offsetTop","winScroller","scrollLeft","scrollTop","includeSelf","elem","gotSelf","scrollWidth","scrollHeight","elemCSS","overflowX","overflowY","$3bc6321cdb0e9401$var$isRectEqual","rect1","rect2","$3bc6321cdb0e9401$var$throttle","ms","$3bc6321cdb0e9401$var$_throttleTimeout","$3bc6321cdb0e9401$var$scrollBy","$3bc6321cdb0e9401$var$clone","Polymer","$","jQuery","Zepto","dom","cloneNode","$3bc6321cdb0e9401$var$expando","$3bc6321cdb0e9401$var$plugins","$3bc6321cdb0e9401$var$defaults","initializeByDefault","$3bc6321cdb0e9401$var$PluginManager","mount","pluginName","pluginEvent","eventName","sortable","evt","eventCanceled","eventNameGlobal","initializePlugins","initialized","modified","modifyOption","getEventProperties","eventProperties","modifiedValue","optionListeners","$3bc6321cdb0e9401$var$_excluded","$3bc6321cdb0e9401$var$pluginEvent","_ref","originalEvent","$3bc6321cdb0e9401$var$_objectWithoutProperties","excluded","$3bc6321cdb0e9401$var$_objectWithoutPropertiesLoose","sourceKeys","sourceSymbolKeys","dragEl","$3bc6321cdb0e9401$var$dragEl","parentEl","$3bc6321cdb0e9401$var$parentEl","ghostEl","$3bc6321cdb0e9401$var$ghostEl","rootEl","$3bc6321cdb0e9401$var$rootEl","nextEl","$3bc6321cdb0e9401$var$nextEl","lastDownEl","$3bc6321cdb0e9401$var$lastDownEl","cloneEl","$3bc6321cdb0e9401$var$cloneEl","cloneHidden","$3bc6321cdb0e9401$var$cloneHidden","dragStarted","$3bc6321cdb0e9401$var$moved","putSortable","$3bc6321cdb0e9401$var$putSortable","activeSortable","oldIndex","$3bc6321cdb0e9401$var$oldIndex","oldDraggableIndex","$3bc6321cdb0e9401$var$oldDraggableIndex","newIndex","$3bc6321cdb0e9401$var$newIndex","newDraggableIndex","$3bc6321cdb0e9401$var$newDraggableIndex","hideGhostForTarget","$3bc6321cdb0e9401$var$_hideGhostForTarget","unhideGhostForTarget","$3bc6321cdb0e9401$var$_unhideGhostForTarget","cloneNowHidden","cloneNowShown","dispatchSortableEvent","$3bc6321cdb0e9401$var$_dispatchEvent","$3bc6321cdb0e9401$var$dispatchEvent","targetEl","toEl","fromEl","extraEventProperties","onName","CustomEvent","createEvent","initEvent","bubbles","pullMode","lastPutMode","allEventProperties","dispatchEvent","$3bc6321cdb0e9401$var$activeGroup","$3bc6321cdb0e9401$var$tapEvt","$3bc6321cdb0e9401$var$touchEvt","$3bc6321cdb0e9401$var$lastDx","$3bc6321cdb0e9401$var$lastDy","$3bc6321cdb0e9401$var$tapDistanceLeft","$3bc6321cdb0e9401$var$tapDistanceTop","$3bc6321cdb0e9401$var$lastTarget","$3bc6321cdb0e9401$var$lastDirection","$3bc6321cdb0e9401$var$targetMoveDistance","$3bc6321cdb0e9401$var$ghostRelativeParent","$3bc6321cdb0e9401$var$awaitingDragStarted","$3bc6321cdb0e9401$var$ignoreNextClick","$3bc6321cdb0e9401$var$sortables","$3bc6321cdb0e9401$var$pastFirstInvertThresh","$3bc6321cdb0e9401$var$isCircumstantialInvert","$3bc6321cdb0e9401$var$ghostRelativeParentInitialScroll","$3bc6321cdb0e9401$var$_silent","$3bc6321cdb0e9401$var$savedInputChecked","$3bc6321cdb0e9401$var$documentExists","$3bc6321cdb0e9401$var$CSSFloatProperty","$3bc6321cdb0e9401$var$supportDraggable","createElement","$3bc6321cdb0e9401$var$supportCssPointerEvents","cssText","pointerEvents","$3bc6321cdb0e9401$var$_detectDirection","elCSS","elWidth","borderLeftWidth","borderRightWidth","child1","child2","firstChildCSS","secondChildCSS","firstChildWidth","marginLeft","marginRight","secondChildWidth","flexDirection","gridTemplateColumns","touchingSideChild2","$3bc6321cdb0e9401$var$_dragElInRowColumn","dragRect","targetRect","dragElS1Opp","dragElS2Opp","dragElOppLength","targetS1Opp","targetS2Opp","targetOppLength","$3bc6321cdb0e9401$var$_detectNearestEmptySortable","emptyInsertThreshold","insideHorizontally","insideVertically","$3bc6321cdb0e9401$var$_prepareGroup","toFn","pull","sameGroup","group","otherGroup","originalGroup","checkPull","checkPut","put","revertClone","preventDefault","stopPropagation","stopImmediatePropagation","$3bc6321cdb0e9401$var$nearestEmptyInsertDetectEvent","_onDragOver","$3bc6321cdb0e9401$var$_checkOutsideTargetEl","_isOutsideThisEl","animationCallbackId","animationStates","store","handle","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","ghostClass","chosenClass","dragClass","ignore","preventOnFilter","setData","dataTransfer","textContent","dropBubble","dragoverBubble","dataIdAttr","delayOnTouchOnly","touchStartThreshold","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","nativeDraggable","_onTapStart","captureAnimationState","child","fromRect","thisAnimationDuration","childMatrix","addAnimationState","removeAnimationState","$3bc6321cdb0e9401$var$indexOfObject","animateAll","animating","animationTime","toRect","prevFromRect","prevToRect","animatingRect","targetMatrix","animationResetTimer","currentRect","translateX","translateY","animatingX","animatingY","forRepaintDummy","offsetWidth","$3bc6321cdb0e9401$var$_onMove","willInsertAfter","retVal","onMoveFn","onMove","draggedRect","related","relatedRect","$3bc6321cdb0e9401$var$_disableDraggable","$3bc6321cdb0e9401$var$_unsilent","$3bc6321cdb0e9401$var$_nextTick","$3bc6321cdb0e9401$var$_cancelNextTick","_getDirection","touch","pointerType","originalTarget","composedPath","$3bc6321cdb0e9401$var$_saveInputCheckedState","checked","button","isContentEditable","criteria","trim","_prepareDragStart","dragStartFn","nextSibling","_lastX","_lastY","_onDrop","_disableDelayedDragEvents","_triggerDragStart","_disableDelayedDrag","_delayedDragTouchMoveHandler","_dragStartTimer","_onTouchMove","_onDragStart","selection","empty","getSelection","removeAllRanges","_dragStarted","_appendGhost","_nulling","_emulateDragOver","elementFromPoint","inserted","ghostMatrix","relativeScrollOffset","$3bc6321cdb0e9401$var$PositionGhostAbsolutely","dy","cssMatrix","appendChild","_hideClone","cloneId","insertBefore","_loopId","setInterval","effectAllowed","_dragStartId","revert","isOwner","canSort","fromSortable","completedFired","dragOverEvent","_ignoreWhileAnimating","completed","elLastChild","$3bc6321cdb0e9401$var$_ghostIsLast","lastElRect","sortableContentRect","firstElRect","firstChild","sibling","targetBeforeFirstSwap","differentLevel","differentRowCol","side1","scrolledPastTop","scrollBefore","$3bc6321cdb0e9401$var$_getSwapDirection","isLastTarget","mouseOnAxis","targetLength","targetS1","targetS2","invert","dragIndex","nextElementSibling","moveVector","insertion","_showClone","_offMoveEvents","_offUpEvents","clearInterval","removeChild","dropEffect","toArray","$3bc6321cdb0e9401$var$_generateId","href","sum","useAnimation","closest","querySelectorAll","utils","css","find","extend","dst","throttle","toggleClass","cancelNextTick","detectDirection","getChild","$3bc6321cdb0e9401$var$scrollEl","$3bc6321cdb0e9401$var$scrollRootEl","$3bc6321cdb0e9401$var$lastAutoScrollX","$3bc6321cdb0e9401$var$lastAutoScrollY","$3bc6321cdb0e9401$var$touchEvt$1","$3bc6321cdb0e9401$var$pointerElemChangedInterval","$3bc6321cdb0e9401$var$autoScrolls","$3bc6321cdb0e9401$var$scrolling","$3bc6321cdb0e9401$var$clearAutoScrolls","autoScroll","$3bc6321cdb0e9401$var$clearPointerElemChangedInterval","$3bc6321cdb0e9401$var$autoScroll","isFallback","scroll","scrollCustomFn","sens","scrollSensitivity","speed","scrollSpeed","scrollThisInstance","scrollFn","layersOut","currentParent","canScrollX","canScrollY","scrollPosX","scrollPosY","vx","vy","layer","scrollOffsetY","scrollOffsetX","bubbleScroll","$3bc6321cdb0e9401$var$drop","toSortable","changedTouches","onSpill","$3bc6321cdb0e9401$var$Revert","$3bc6321cdb0e9401$var$Remove","$48e8ed6252738c92$export$1402cba6a733f33a","$6a8d624098efe915$export$926181dbdeb3ce30","derivatives","dydx","yTemp","h2","h6","xhh","dydxTemp","dydxM","$867aa247f14d8746$export$35d34bc0ed591a92","stocksAtT","getFlows","integrator","dragStart","_ref2","_ref3","drop","_ref4","parentSortable","AutoScroll","forceAutoScrollFallback","_handleAutoScroll","_handleFallbackAutoScroll","dragOverCompleted","dragOverBubble","nulling","ogElemScroller","newElem","$84b4e0427207f64e$export$a1edc412be3e1841","elementObjectToArray","ids","arrayToElementObject","stocksToStockArray","stocks","stockIds","stockArrayToStocks","stockArray","flowsToFlowArray","flows","flowIds","flowArrayToFlows","flowArray","variablesToVariableArray","variables","variableIds","variableArrayToVariables","variableArray","parametersToParameterArray","parameters","parameterIds","parameterArrayToParameters","parameterArray","evaluateFlowPerStock","evaluate","accumulateFlowsPerStock","createFlowEvaluator","stocksArray","flowsPerStock","flowPerStockArray","flowEvaluator","computeFlowsOrIntegrator","newStocksArray","$c7f17e22947729fa$var$step6","flowsAtT","computeFlows","mutableFlowsAtT","stocksIds","elementIds","$921d098521bb0b85$var$stockIds","$921d098521bb0b85$var$flowIds","$921d098521bb0b85$var$variableIds","$921d098521bb0b85$var$parameterIds","$921d098521bb0b85$var$CircularEconomyModel","capacityOfNewlyProducedPhones","capacityOfRecycledMaterials","capacityOfRefurbishedPhones","capacityOfRepairedPhones","phonesInUse","supplyOfBrokenPhones","supplyOfDisposedPhones","supplyOfHibernatingPhones","supplyOfNewlyProducedPhones","supplyOfRecycledMaterials","supplyOfRefurbishedPhones","supplyOfRepairedPhones","abandonExcessRate","abandonRate","acquireRate","breakRate","capacityAdjustmentRate","disposeIncentive","disposeRate","durability","landfillIncentive","landfillRate","naturalResourcesIncentive","newPhoneProductionRate","newlyProducedPhoneIncentive","numberOfUsers","phonesPerUserGoal","recycleRate","recyclingIncentive","refurbishmentIncentive","refurbishmentRate","repairIncentive","repairRate","reuseIncentive","phoneGoal","phonesInUseExcess","inflowIncentiveSumForPhonesInUse","demandForPhones","demandForNewlyProducedPhones","demandForRefurbishedPhones","demandForRepairedPhones","demandForReusedPhones","resourceDemand","demandForRecycledMaterials","supplyOfBrokenPhonesForDisposal","supplyOfDisposedPhonesForLandfilling","demandForNaturalResources","supplyOfDisposedPhonesForRecycling","recycleDemand","demandForRefurbishment","repairDemand","supplyOfBrokenPhonesForRepair","abandon","acquireNewlyProduced","acquireRefurbished","acquireRepaired","acquireUsed","capacityOfNewlyProducedPhonesAdjustment","capacityOfRecycledMaterialsAdjustment","capacityOfRefurbishedPhonesAdjustment","disposeBroken","disposeHibernating","goBroken","landfill","produceFromNaturalResources","produceFromRecycledMaterials","recycle","refurbish","repair","repairShopCapcityAdjustment","initialStocks","defaultParameters","$106ba4e13cc3399a$export$2e2bcd8739ae039","evaluateFlowPerStockWithCache","flowPerStockCache","record","newStocks","model","flowEvaluatorWithCache","newRecord","$1e97a6829bac4722$exports","$4f1a1606e7098a1b$exports","iteratee","accumulator","initAccum","$36afe5eae89b9d7e$exports","$b1b879fc8198071f$exports","$f2e9e481daee7666$exports","$76c6dc58ca6da032$exports","$1879420c2201e4f5$exports","$16a1c88c6274b89e$exports","$99453366d0047353$exports","$967238627eb0c90e$var$freeSelf","$967238627eb0c90e$exports","$eee618309e39ba8f$exports","$ac048cd2ac6bb018$exports","$558e04b299841d71$exports","$49a2e995e5c6b149$exports","$4a7cc576fba0dac1$exports","$4a7cc576fba0dac1$var$objectProto","$4a7cc576fba0dac1$var$hasOwnProperty","$4a7cc576fba0dac1$var$nativeObjectToString","$4a7cc576fba0dac1$var$symToStringTag","unmasked","$04062fd85b2020b2$exports","$04062fd85b2020b2$var$nativeObjectToString","$04062fd85b2020b2$var$objectProto","$49a2e995e5c6b149$var$symToStringTag","$ba1663caad3bd751$exports","$1879420c2201e4f5$var$INFINITY","$1879420c2201e4f5$var$symbolProto","$1879420c2201e4f5$var$symbolToString","$1879420c2201e4f5$var$baseToString","$36afe5eae89b9d7e$var$reLatin","$36afe5eae89b9d7e$var$reComboMark","$ab91531510e64339$exports","$3b3532336f4ee99d$exports","$3b3532336f4ee99d$var$reAsciiWord","$a612d359136754bd$exports","$a612d359136754bd$var$reHasUnicodeWord","$cdffef05f24fe61a$exports","$cdffef05f24fe61a$var$rsAstralRange","$cdffef05f24fe61a$var$rsDingbatRange","$cdffef05f24fe61a$var$rsLowerRange","$cdffef05f24fe61a$var$rsUpperRange","$cdffef05f24fe61a$var$rsBreakRange","$cdffef05f24fe61a$var$rsMathOpRange","$cdffef05f24fe61a$var$rsApos","$cdffef05f24fe61a$var$rsBreak","$cdffef05f24fe61a$var$rsLower","$cdffef05f24fe61a$var$rsMisc","$cdffef05f24fe61a$var$rsRegional","$cdffef05f24fe61a$var$rsSurrPair","$cdffef05f24fe61a$var$rsUpper","$cdffef05f24fe61a$var$rsMiscLower","$cdffef05f24fe61a$var$rsOptContrLower","$cdffef05f24fe61a$var$rsOptContrUpper","$cdffef05f24fe61a$var$reOptMod","$cdffef05f24fe61a$var$rsModifier","$cdffef05f24fe61a$var$rsOptVar","$cdffef05f24fe61a$var$rsOptJoin","$cdffef05f24fe61a$var$rsEmoji","$cdffef05f24fe61a$var$reUnicodeWord","$cdffef05f24fe61a$var$rsMiscUpper","guard","$3213226c6f6709d1$var$reApos","$9209478113a893f2$export$b6a2e78b63791dfa","uri","clearStyles","_svgDoc_querySelectorAll","response","fetch","status","statusText","URL","svgText","div","innerHTML","svgDoc","querySelector","$7b1f0afa5e19a5a4$export$99496351b147462","word","$dac2d623b8646eea$exports","getBundleURL","$f48791a249d3586b$var$svgUrl","$f48791a249d3586b$var$mainFlowIds","$f48791a249d3586b$var$flowVizSigns","$f48791a249d3586b$export$2e2bcd8739ae039","updateSvgFlows","deltaMs","flowVizScale","_element_getAttribute","flow","flowVizSign","elementId","svg","SVGPathElement","lastDashOffset","updateSvgStocks","stockVizScale","SVGCircleElement","stock","updateSvg","prepareSvg","createSVGElement","createElementNS","elementsToRemove","labelLayer","supplyLayer","capacityLayer","flowLayer","append","baseElement","baseElementId","SVGGeometryElement","phonesInUseClone","$e412526fc10a648a$export$3e2b244719956741","readyState","$30abf6595c867a38$export$2e2bcd8739ae039","i18nKey","$4af93babe4ef46c3$export$2e2bcd8739ae039","applyTo","callable","$5023ecf4320e7a5e$export$2e2bcd8739ae039","createFunction","script","parameterId","wrappedScript","transformedParameters","$0bf1d6c4c7fae0ba$var$init","modelSimulator","availableParameterTransformsContainer","HTMLElement","activeParameterTransformsContainer","availableParameterTransforms","updateParameters","parameterTransform","backupParameters","distinctParameters","getDistinctParameters","removeOnSpill","onSort","parameterTransforms","dummyElement","parameterTransformElement","idElement","HTMLInputElement","scriptElement","HTMLTextAreaElement","circularityIndex","circularityIndexElement","userSatisfaction","userSatisfactionElement","visualization","toChartRecord","prepend","initialChartRecord","chartCanvas","stepSimulation","updateIndices","circularityIndexTarget","innerText","toFixed","userSatisfactionTarget","chartRecord","runCheckBox","loopSimulation","lastTimeMs","currentTimeMs","circularEconomy","Animator","requestAnimFrame","interpolators","helpersColor","Animation","effects","Animations","resolveTargetOptions","awaitAll","animator","scaleClip","defaultClip","toClip","getSortedDatasetIndices","convertObjectDataToArray","isStacked","getStackKey","getOrCreateStack","getLastIndexInStack","updateStacks","getFirstScaleId","createDatasetContext","createContext","createDataContext","clearStacks","isDirectUpdateMode","cloneIfNotShared","createStack","DatasetController","valueOrDefault","unlistenArrayEvents","listenArrayEvents","resolveObjectKey","defined","getAllScaleValues","_arrayUnique","computeMinSampleSize","computeFitCategoryTraits","isNullOrUndef","computeFlexCategoryTraits","parseFloatBar","parseValue","parseArrayOrPrimitive","isFloatBar","barSign","borderProps","setBorderSkipped","parseEdge","swap","startEnd","v2","setInflateAmount","getRatioAndOffset","TAU","_angleBetween","HALF_PI","toRadians","toPercentage","maxRadius","toDimension","formatNumber","_getStartAndCountOfVisiblePoints","_scaleRangesChanged","_parseObjectDataRadialScale","abstract","DateAdapterBase","binarySearch","_rlookupByKey","_lookupByKey","evaluateInteractionItems","getDistanceMetricForAxis","getIntersectItems","evaluationFunc","_isPointInArea","getNearestRadialItems","getAngleFromPoint","getNearestCartesianItems","getNearestItems","getAxisItems","getRelativePosition","STATIC_POSITIONS","filterByPosition","filterDynamicPositionByAxis","sortByWeight","wrapBoxes","buildStacks","setLayoutDims","buildLayoutBoxes","getCombinedMax","updateMaxPadding","updateDims","handleMaxPadding","getMargins","marginForPositions","fitBoxes","setBoxDims","placeBoxes","toPadding","each","BasePlatform","BasicPlatform","EXPANDO_KEY","EVENT_TYPES","isNullOrEmpty","initCanvas","readUsedSize","eventListenerOptions","supportsEventListenerOptions","fromNativeEvent","nodeListContains","createAttachObserver","createDetachObserver","drpListeningCharts","oldDevicePixelRatio","onWindowResize","listenDevicePixelRatioChanges","unlistenDevicePixelRatioChanges","createResizeObserver","_getParentNode","throttled","releaseObserver","createProxyAndListen","DomPlatform","_detectPlatform","_isDomSupported","Element","determineMaxTicks","getMajorIndices","skipMajors","calculateSpacing","getEvenSpacing","_factorize","reverseAlign","offsetFromEdge","getTicksLimit","sample","getPixelForGridLine","getTickMarkLength","getTitleHeight","toFont","createScaleContext","createTickContext","_toLeftRightCenter","titleArgs","_alignStartEnd","Scale","finiteOrDefault","_addGrace","_limitValue","toDegrees","_measureText","_int16Range","_alignPixel","clipArea","renderText","unclipArea","TypedRegistry","isIChartComponent","registerDefaults","merge","routeDefaults","Registry","_capitalize","PluginService","callCallback","allPlugins","createDescriptors","getOpts","pluginOpts","getIndexAxis","getAxisFromDefaultScaleID","getDefaultScaleIDFromAxis","idMatchesAxis","axisFromPosition","determineAxis","getAxisFromDataset","retrieveAxisFromDatasets","mergeScaleConfig","mergeIf","initOptions","initData","initConfig","keyCache","keysCached","cachedKeys","addIfFound","Config","getResolver","needContext","_attachContext","_createResolver","hasFunction","KNOWN_POSITIONS","positionIsHorizontal","compare2Level","onAnimationsComplete","onAnimationProgress","getCanvas","getChart","moveNumericKeys","determineLastEvent","getSizeForArea","getDatasetArea","Chart","invalidatePlugins","uid","debounce","retinaScale","clearCanvas","setsEqual","Interaction","_elementsEqual","_isClickEvent","clipArc","toRadiusCorners","_readValueToProps","parseBorderRadius","rThetaToXY","pathArc","adjustedAngle","drawArc","_isBetween","setStyle","getLineMethod","_steppedLineTo","_bezierCurveTo","pathVars","outside","fastPathSegment","_getSegmentMethod","_getInterpolationMethod","_steppedInterpolation","_bezierInterpolation","_pointInLine","strokePathWithCache","strokePathDirect","usePath2D","_updateBezierControlPoints","_computeSegments","_boundSegments","drawPoint","getBarBounds","skipOrLimit","parseBorderWidth","toTRBL","toTRBLCorners","boundingRects","skipBoth","hasRadius","addNormalRectPath","inflateRect","addRoundedRectPath","BORDER_COLORS","BACKGROUND_COLORS","getBorderColor","getBackgroundColor","colorizeDefaultDataset","colorizeDoughnutDataset","colorizePolarAreaDataset","getColorizer","containsColorsDefinitions","containsColorsDefinition","lttbDecimation","minMaxDecimation","cleanDecimatedDataset","cleanDecimatedData","getStartAndCountOfVisiblePointsSimplified","_findSegmentEnd","_getBounds","_boundSegment","_getEdge","_normalizeAngle","_pointsFromSegments","_createBoundaryLine","_shouldApplyFill","_resolveTarget","_decodeFill","parseFillOption","decodeTargetIndex","_getTargetPixel","_getTargetValue","_buildStackLine","getLinesBelow","addPointsBelow","findPoint","simpleArc","getLineByIndex","computeBoundary","computeCircularBoundary","computeLinearBoundary","_drawfill","doFill","clipVertical","clipBounds","interpolatedLineTo","getBoxSize","itemsEqual","calculateItemSize","getRtlAdapter","drawPointLegend","overrideTextDirection","_textX","calculateLegendItemHeight","restoreTextDirection","isListened","calculateItemWidth","calculateItemHeight","createTitle","distanceBetweenPoints","pushOrConcat","splitNewlines","createTooltipItem","getTooltipSize","determineYAlign","doesNotFitWithAlign","determineXAlign","determineAlignment","alignX","alignY","getBackgroundPoint","getAlignedX","getBeforeAfterBodyLines","createTooltipContext","overrideCallbacks","defaultCallbacks","noop","invokeCallbackWithFallback","addIfString","findOrAddLabel","_getLabelForValue","generateTicks","MIN_SPACING","niceNum","almostWhole","almostEquals","_decimalPlaces","relativeLabelSize","LinearScaleBase","_setMinAndMaxByKey","Ticks","log10Floor","changeExponent","isMajor","startExp","getTickBackdropHeight","measureLabelSize","_longestText","determineLimits","fitWithPointLabels","updateLimits","buildPointLabelItems","createPointLabelItem","yForAngle","getTextAlignForAngle","leftForTextAlign","isNotOverlapped","drawPointLabelBox","drawPointLabels","pathRadiusLine","drawRadiusLine","createPointLabelContext","INTERVALS","UNITS","sorter","determineUnitForAutoTicks","determineUnitForFormatting","determineMajorUnit","addTick","_lookup","setMajorTicks","ticksFromTimestamps","_filterBetween","registerables","isNumberFinite","isValidKey","_merger","_mergerIf","_deprecated","keyResolvers","_splitKey","_getKeyResolver","PITAU","INFINITY","RAD_PER_DEG","QUARTER_PI","TWO_THIRDS_PI","isFiniteNumber","radialDistanceFromCenter","_angleDiff","arrayEvents","pixelSize","fontStyle","fontFamily","check","atEdge","elasticIn","elasticOut","isPatternOrGradient","Color","getHoverColor","applyAnimationsDefaults","applyLayoutsDefaults","intlCache","getNumberFormat","calculateDelta","applyScaleDefaults","getScope","Defaults","toFontString","setRenderOpts","decorateText","drawBackdrop","LINE_HEIGHT","FONT_STYLE","toLineHeight","numberOrZero","_resolve","_cached","_resolveWithPrefixes","getKeysFromAllScopes","_resolveWithContext","readKey","needsSubResolver","_resolveScriptable","_resolveArray","createSubResolver","resolveFallback","addScopes","addScopesFromKey","subGetTarget","resolveKeysFromAllScopes","getPoint","getValueAxis","splineCurve","monotoneAdjust","monotoneCompute","splineCurveMonotone","capControlPoint","parseMaxStyle","getPositionedStyle","useOffsetPos","getCanvasPosition","getContainerSize","round1","getRightToLeftAdapter","getLeftToRightAdapter","propertyFn","normalizeSegment","getSegment","findStartAndEnd","solidSegments","splitByStyles","doSplitByStyles","readStyle","styleChanged"],"version":3,"file":"index.a403ea04.js.map"} \ No newline at end of file diff --git a/assets/index.runtime.3716e0fc.js b/assets/index.runtime.a04de399.js similarity index 88% rename from assets/index.runtime.3716e0fc.js rename to assets/index.runtime.a04de399.js index 93963ee..e0f91fc 100644 --- a/assets/index.runtime.3716e0fc.js +++ b/assets/index.runtime.a04de399.js @@ -1,4 +1,4 @@ function e(e,r,n,t){Object.defineProperty(e,r,{get:n,set:t,enumerable:!0,configurable:!0})}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n={},t={},o=r.parcelRequirec7f3;null==o&&((o=function(e){if(e in n)return n[e].exports;if(e in t){var r=t[e];delete t[e];var o={id:e,exports:{}};return n[e]=o,r.call(o.exports,o,o.exports),o.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,r){t[e]=r},r.parcelRequirec7f3=o);var i=o.register;i("hP4Cd",function(r,n){e(r.exports,"register",function(){return t},function(e){return t=e});var t,o=new Map;t=function(e,r){for(var n=0;n","node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","node_modules/@parcel/runtime-js/lib/helpers/bundle-url.js","node_modules/@parcel/runtime-js/lib/runtime-c7e7c451824f10be.js"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec7f3\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec7f3\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"hP4Cd\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $cf9ac79894b8c9c9$export$6503ec6e8aabbaf; }, function (v) { return $cf9ac79894b8c9c9$export$6503ec6e8aabbaf = v; });\nvar $cf9ac79894b8c9c9$export$6503ec6e8aabbaf;\nvar $cf9ac79894b8c9c9$export$f7ad0328861e2f03;\n\"use strict\";\nvar $cf9ac79894b8c9c9$var$mapping = new Map();\nfunction $cf9ac79894b8c9c9$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$cf9ac79894b8c9c9$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $cf9ac79894b8c9c9$var$resolve(id) {\n var resolved = $cf9ac79894b8c9c9$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$cf9ac79894b8c9c9$export$6503ec6e8aabbaf = $cf9ac79894b8c9c9$var$register;\n$cf9ac79894b8c9c9$export$f7ad0328861e2f03 = $cf9ac79894b8c9c9$var$resolve;\n\n});\n\nparcelRegister(\"9v928\", function(module, exports) {\n\n$parcel$export(module.exports, \"getBundleURL\", function () { return $6eae042342d472ad$export$bdfd709ae4826697; }, function (v) { return $6eae042342d472ad$export$bdfd709ae4826697 = v; });\nvar $6eae042342d472ad$export$bdfd709ae4826697;\nvar $6eae042342d472ad$export$c9e73fbda7da57b6;\nvar $6eae042342d472ad$export$5a759dc7a1cfb72a;\n\"use strict\";\nvar $6eae042342d472ad$var$bundleURL = {};\nfunction $6eae042342d472ad$var$getBundleURLCached(id) {\n var value = $6eae042342d472ad$var$bundleURL[id];\n if (!value) {\n value = $6eae042342d472ad$var$getBundleURL();\n $6eae042342d472ad$var$bundleURL[id] = value;\n }\n return value;\n}\nfunction $6eae042342d472ad$var$getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = (\"\" + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return $6eae042342d472ad$var$getBaseURL(matches[2]);\n }\n return \"/\";\n}\nfunction $6eae042342d472ad$var$getBaseURL(url) {\n return (\"\" + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, \"$1\") + \"/\";\n}\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction $6eae042342d472ad$var$getOrigin(url) {\n var matches = (\"\" + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) throw new Error(\"Origin not found\");\n return matches[0];\n}\n$6eae042342d472ad$export$bdfd709ae4826697 = $6eae042342d472ad$var$getBundleURLCached;\n$6eae042342d472ad$export$c9e73fbda7da57b6 = $6eae042342d472ad$var$getBaseURL;\n$6eae042342d472ad$export$5a759dc7a1cfb72a = $6eae042342d472ad$var$getOrigin;\n\n});\n\nvar $f9b3493b357b132b$exports = {};\n\n\n(parcelRequire(\"hP4Cd\")).register((parcelRequire(\"9v928\")).getBundleURL(\"kdWl4\"), JSON.parse('[\"kdWl4\",\"index.7e1ba3ae.js\",\"94Okf\",\"model.f8e270f6.svg\"]'));\n\n\n//# sourceMappingURL=index.runtime.3716e0fc.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","\"use strict\";\n\nvar bundleURL = {};\nfunction getBundleURLCached(id) {\n var value = bundleURL[id];\n if (!value) {\n value = getBundleURL();\n bundleURL[id] = value;\n }\n return value;\n}\nfunction getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return getBaseURL(matches[2]);\n }\n }\n return '/';\n}\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction getOrigin(url) {\n var matches = ('' + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) {\n throw new Error('Origin not found');\n }\n return matches[0];\n}\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\nexports.getOrigin = getOrigin;","require('./helpers/bundle-manifest').register(require('./helpers/bundle-url').getBundleURL('kdWl4'),JSON.parse(\"[\\\"kdWl4\\\",\\\"index.7e1ba3ae.js\\\",\\\"94Okf\\\",\\\"model.f8e270f6.svg\\\"]\"));"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$cf9ac79894b8c9c9$export$6503ec6e8aabbaf","$cf9ac79894b8c9c9$var$mapping","Map","baseUrl","manifest","i","length","path","$6eae042342d472ad$export$bdfd709ae4826697","$6eae042342d472ad$var$bundleURL","value","$6eae042342d472ad$var$getBundleURL","matches","stack","match","replace","getBundleURL","JSON","parse"],"version":3,"file":"index.runtime.3716e0fc.js.map"} \ No newline at end of file +{"mappings":"A,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,I,E,E,Q,C,E,Q,S,C,C,C,E,E,E,O,C,W,W,O,C,E,S,C,E,O,E,C,GCEA,IAgBA,EAhBI,EAAU,IAAI,IAgBlB,EAfA,SAAkB,CAAO,CAAE,CAAQ,EACjC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAS,MAAM,CAAG,EAAG,GAAK,EAC5C,EAAQ,GAAG,CAAC,CAAQ,CAAC,EAAE,CAAE,CACvB,QAAS,EACT,KAAM,CAAQ,CAAC,EAAI,EAAE,AACvB,EAEJ,C,G,E,Q,S,C,C,C,E,E,E,O,C,e,W,O,C,E,S,C,E,O,E,C,GCRA,IAkCA,EAlCI,EAAY,CAAC,EAkCjB,EAjCA,SAA4B,CAAE,EAC5B,IAAI,EAAQ,CAAS,CAAC,EAAG,CAKzB,OAJK,IACH,EAAQ,AAKZ,WACE,GAAI,CACF,MAAM,AAAI,OACZ,CAAE,MAAO,EAAK,CACZ,IAAI,EAAW,AAAA,CAAA,GAAK,EAAI,KAAI,AAAJ,EAAO,KAAK,CAAC,oEACrC,GAAI,EAEF,mEAAmE;AACnE,MAMI,AAAA,CAAA,GANc,CAAO,CAAC,EAAE,AAMnB,EAAK,OAAO,CAAC,0EAA2E,MAAQ,GAJ7G,CACA,MAAO,GACT,IAhBI,CAAS,CAAC,EAAG,CAAG,GAEX,CACT,C,GCVA,AAAA,EAAA,SAAA,QAAA,CAA8C,AAAA,EAAA,SAAA,YAAA,CAA6C,SAAS,KAAK,KAAK,CAAC,gG,oE","sources":["","node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","node_modules/@parcel/runtime-js/lib/helpers/bundle-url.js","node_modules/@parcel/runtime-js/lib/runtime-c7e7c451824f10be.js"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec7f3\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec7f3\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"hP4Cd\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $cf9ac79894b8c9c9$export$6503ec6e8aabbaf; }, function (v) { return $cf9ac79894b8c9c9$export$6503ec6e8aabbaf = v; });\nvar $cf9ac79894b8c9c9$export$6503ec6e8aabbaf;\nvar $cf9ac79894b8c9c9$export$f7ad0328861e2f03;\n\"use strict\";\nvar $cf9ac79894b8c9c9$var$mapping = new Map();\nfunction $cf9ac79894b8c9c9$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$cf9ac79894b8c9c9$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $cf9ac79894b8c9c9$var$resolve(id) {\n var resolved = $cf9ac79894b8c9c9$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$cf9ac79894b8c9c9$export$6503ec6e8aabbaf = $cf9ac79894b8c9c9$var$register;\n$cf9ac79894b8c9c9$export$f7ad0328861e2f03 = $cf9ac79894b8c9c9$var$resolve;\n\n});\n\nparcelRegister(\"9v928\", function(module, exports) {\n\n$parcel$export(module.exports, \"getBundleURL\", function () { return $6eae042342d472ad$export$bdfd709ae4826697; }, function (v) { return $6eae042342d472ad$export$bdfd709ae4826697 = v; });\nvar $6eae042342d472ad$export$bdfd709ae4826697;\nvar $6eae042342d472ad$export$c9e73fbda7da57b6;\nvar $6eae042342d472ad$export$5a759dc7a1cfb72a;\n\"use strict\";\nvar $6eae042342d472ad$var$bundleURL = {};\nfunction $6eae042342d472ad$var$getBundleURLCached(id) {\n var value = $6eae042342d472ad$var$bundleURL[id];\n if (!value) {\n value = $6eae042342d472ad$var$getBundleURL();\n $6eae042342d472ad$var$bundleURL[id] = value;\n }\n return value;\n}\nfunction $6eae042342d472ad$var$getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = (\"\" + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return $6eae042342d472ad$var$getBaseURL(matches[2]);\n }\n return \"/\";\n}\nfunction $6eae042342d472ad$var$getBaseURL(url) {\n return (\"\" + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, \"$1\") + \"/\";\n}\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction $6eae042342d472ad$var$getOrigin(url) {\n var matches = (\"\" + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) throw new Error(\"Origin not found\");\n return matches[0];\n}\n$6eae042342d472ad$export$bdfd709ae4826697 = $6eae042342d472ad$var$getBundleURLCached;\n$6eae042342d472ad$export$c9e73fbda7da57b6 = $6eae042342d472ad$var$getBaseURL;\n$6eae042342d472ad$export$5a759dc7a1cfb72a = $6eae042342d472ad$var$getOrigin;\n\n});\n\nvar $f9b3493b357b132b$exports = {};\n\n\n(parcelRequire(\"hP4Cd\")).register((parcelRequire(\"9v928\")).getBundleURL(\"kdWl4\"), JSON.parse('[\"kdWl4\",\"index.97bcdae1.js\",\"94Okf\",\"model.f8e270f6.svg\"]'));\n\n\n//# sourceMappingURL=index.runtime.a04de399.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","\"use strict\";\n\nvar bundleURL = {};\nfunction getBundleURLCached(id) {\n var value = bundleURL[id];\n if (!value) {\n value = getBundleURL();\n bundleURL[id] = value;\n }\n return value;\n}\nfunction getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return getBaseURL(matches[2]);\n }\n }\n return '/';\n}\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction getOrigin(url) {\n var matches = ('' + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) {\n throw new Error('Origin not found');\n }\n return matches[0];\n}\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\nexports.getOrigin = getOrigin;","require('./helpers/bundle-manifest').register(require('./helpers/bundle-url').getBundleURL('kdWl4'),JSON.parse(\"[\\\"kdWl4\\\",\\\"index.97bcdae1.js\\\",\\\"94Okf\\\",\\\"model.f8e270f6.svg\\\"]\"));"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$cf9ac79894b8c9c9$export$6503ec6e8aabbaf","$cf9ac79894b8c9c9$var$mapping","Map","baseUrl","manifest","i","length","path","$6eae042342d472ad$export$bdfd709ae4826697","$6eae042342d472ad$var$bundleURL","value","$6eae042342d472ad$var$getBundleURL","matches","stack","match","replace","getBundleURL","JSON","parse"],"version":3,"file":"index.runtime.a04de399.js.map"} \ No newline at end of file diff --git a/assets/index.runtime.52c14254.js b/assets/index.runtime.c74f68e5.js similarity index 88% rename from assets/index.runtime.52c14254.js rename to assets/index.runtime.c74f68e5.js index 79189c0..d7c902e 100644 --- a/assets/index.runtime.52c14254.js +++ b/assets/index.runtime.c74f68e5.js @@ -1,4 +1,4 @@ !function(){function e(e,r,n,t){Object.defineProperty(e,r,{get:n,set:t,enumerable:!0,configurable:!0})}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n={},t={},o=r.parcelRequirec7f3;null==o&&((o=function(e){if(e in n)return n[e].exports;if(e in t){var r=t[e];delete t[e];var o={id:e,exports:{}};return n[e]=o,r.call(o.exports,o,o.exports),o.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,r){t[e]=r},r.parcelRequirec7f3=o);var i=o.register;i("cLpQy",function(r,n){e(r.exports,"register",function(){return t},function(e){return t=e});var t,o=new Map;t=function(e,r){for(var n=0;n","node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","node_modules/@parcel/runtime-js/lib/helpers/bundle-url.js","node_modules/@parcel/runtime-js/lib/runtime-574c6fe6024438f0.js"],"sourcesContent":["(function () {\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec7f3\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec7f3\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"cLpQy\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $94adec6bfa5eff57$export$6503ec6e8aabbaf; }, function (v) { return $94adec6bfa5eff57$export$6503ec6e8aabbaf = v; });\nvar $94adec6bfa5eff57$export$6503ec6e8aabbaf;\nvar $94adec6bfa5eff57$export$f7ad0328861e2f03;\n\"use strict\";\nvar $94adec6bfa5eff57$var$mapping = new Map();\nfunction $94adec6bfa5eff57$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$94adec6bfa5eff57$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $94adec6bfa5eff57$var$resolve(id) {\n var resolved = $94adec6bfa5eff57$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$94adec6bfa5eff57$export$6503ec6e8aabbaf = $94adec6bfa5eff57$var$register;\n$94adec6bfa5eff57$export$f7ad0328861e2f03 = $94adec6bfa5eff57$var$resolve;\n\n});\n\nparcelRegister(\"c93e5\", function(module, exports) {\n\n$parcel$export(module.exports, \"getBundleURL\", function () { return $8d78d3fb3cb962f4$export$bdfd709ae4826697; }, function (v) { return $8d78d3fb3cb962f4$export$bdfd709ae4826697 = v; });\nvar $8d78d3fb3cb962f4$export$bdfd709ae4826697;\nvar $8d78d3fb3cb962f4$export$c9e73fbda7da57b6;\nvar $8d78d3fb3cb962f4$export$5a759dc7a1cfb72a;\n\"use strict\";\nvar $8d78d3fb3cb962f4$var$bundleURL = {};\nfunction $8d78d3fb3cb962f4$var$getBundleURLCached(id) {\n var value = $8d78d3fb3cb962f4$var$bundleURL[id];\n if (!value) {\n value = $8d78d3fb3cb962f4$var$getBundleURL();\n $8d78d3fb3cb962f4$var$bundleURL[id] = value;\n }\n return value;\n}\nfunction $8d78d3fb3cb962f4$var$getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = (\"\" + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return $8d78d3fb3cb962f4$var$getBaseURL(matches[2]);\n }\n return \"/\";\n}\nfunction $8d78d3fb3cb962f4$var$getBaseURL(url) {\n return (\"\" + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, \"$1\") + \"/\";\n}\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction $8d78d3fb3cb962f4$var$getOrigin(url) {\n var matches = (\"\" + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) throw new Error(\"Origin not found\");\n return matches[0];\n}\n$8d78d3fb3cb962f4$export$bdfd709ae4826697 = $8d78d3fb3cb962f4$var$getBundleURLCached;\n$8d78d3fb3cb962f4$export$c9e73fbda7da57b6 = $8d78d3fb3cb962f4$var$getBaseURL;\n$8d78d3fb3cb962f4$export$5a759dc7a1cfb72a = $8d78d3fb3cb962f4$var$getOrigin;\n\n});\n\nvar $76069e4596235807$exports = {};\n\n\n(parcelRequire(\"cLpQy\")).register((parcelRequire(\"c93e5\")).getBundleURL(\"c39XQ\"), JSON.parse('[\"c39XQ\",\"index.a403ea04.js\",\"cZDSn\",\"model.f8e270f6.svg\"]'));\n\n})();\n//# sourceMappingURL=index.runtime.52c14254.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","\"use strict\";\n\nvar bundleURL = {};\nfunction getBundleURLCached(id) {\n var value = bundleURL[id];\n if (!value) {\n value = getBundleURL();\n bundleURL[id] = value;\n }\n return value;\n}\nfunction getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return getBaseURL(matches[2]);\n }\n }\n return '/';\n}\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction getOrigin(url) {\n var matches = ('' + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) {\n throw new Error('Origin not found');\n }\n return matches[0];\n}\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\nexports.getOrigin = getOrigin;","require('./helpers/bundle-manifest').register(require('./helpers/bundle-url').getBundleURL('c39XQ'),JSON.parse(\"[\\\"c39XQ\\\",\\\"index.a403ea04.js\\\",\\\"cZDSn\\\",\\\"model.f8e270f6.svg\\\"]\"));"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$94adec6bfa5eff57$export$6503ec6e8aabbaf","$94adec6bfa5eff57$var$mapping","Map","baseUrl","manifest","i","length","path","$8d78d3fb3cb962f4$export$bdfd709ae4826697","$8d78d3fb3cb962f4$var$bundleURL","value","$8d78d3fb3cb962f4$var$getBundleURL","matches","stack","match","replace","getBundleURL","JSON","parse"],"version":3,"file":"index.runtime.52c14254.js.map"} \ No newline at end of file +{"mappings":"C,A,W,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,I,E,E,Q,C,E,Q,S,C,C,C,E,E,E,O,C,W,W,O,C,E,S,C,E,O,E,C,GCEA,IAgBA,EAhBI,EAAU,IAAI,IAgBlB,EAfA,SAAkB,CAAO,CAAE,CAAQ,EACjC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAS,MAAM,CAAG,EAAG,GAAK,EAC5C,EAAQ,GAAG,CAAC,CAAQ,CAAC,EAAE,CAAE,CACvB,QAAS,EACT,KAAM,CAAQ,CAAC,EAAI,EAAE,AACvB,EAEJ,C,G,E,Q,S,C,C,C,E,E,E,O,C,e,W,O,C,E,S,C,E,O,E,C,GCRA,IAkCA,EAlCI,EAAY,CAAC,EAkCjB,EAjCA,SAA4B,CAAE,EAC5B,IAAI,EAAQ,CAAS,CAAC,EAAG,CAKzB,OAJK,IACH,EAAQ,AAKZ,WACE,GAAI,CACF,MAAM,AAAI,OACZ,CAAE,MAAO,EAAK,CACZ,IAAI,EAAW,AAAA,CAAA,GAAK,EAAI,KAAI,AAAJ,EAAO,KAAK,CAAC,oEACrC,GAAI,EAEF,mEAAmE;AACnE,MAMI,AAAA,CAAA,GANc,CAAO,CAAC,EAAE,AAMnB,EAAK,OAAO,CAAC,0EAA2E,MAAQ,GAJ7G,CACA,MAAO,GACT,IAhBI,CAAS,CAAC,EAAG,CAAG,GAEX,CACT,C,GCVA,AAAA,EAAA,SAAA,QAAA,CAA8C,AAAA,EAAA,SAAA,YAAA,CAA6C,SAAS,KAAK,KAAK,CAAC,gG,G,oE","sources":["","node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","node_modules/@parcel/runtime-js/lib/helpers/bundle-url.js","node_modules/@parcel/runtime-js/lib/runtime-574c6fe6024438f0.js"],"sourcesContent":["(function () {\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec7f3\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec7f3\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"cLpQy\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $94adec6bfa5eff57$export$6503ec6e8aabbaf; }, function (v) { return $94adec6bfa5eff57$export$6503ec6e8aabbaf = v; });\nvar $94adec6bfa5eff57$export$6503ec6e8aabbaf;\nvar $94adec6bfa5eff57$export$f7ad0328861e2f03;\n\"use strict\";\nvar $94adec6bfa5eff57$var$mapping = new Map();\nfunction $94adec6bfa5eff57$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$94adec6bfa5eff57$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $94adec6bfa5eff57$var$resolve(id) {\n var resolved = $94adec6bfa5eff57$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$94adec6bfa5eff57$export$6503ec6e8aabbaf = $94adec6bfa5eff57$var$register;\n$94adec6bfa5eff57$export$f7ad0328861e2f03 = $94adec6bfa5eff57$var$resolve;\n\n});\n\nparcelRegister(\"c93e5\", function(module, exports) {\n\n$parcel$export(module.exports, \"getBundleURL\", function () { return $8d78d3fb3cb962f4$export$bdfd709ae4826697; }, function (v) { return $8d78d3fb3cb962f4$export$bdfd709ae4826697 = v; });\nvar $8d78d3fb3cb962f4$export$bdfd709ae4826697;\nvar $8d78d3fb3cb962f4$export$c9e73fbda7da57b6;\nvar $8d78d3fb3cb962f4$export$5a759dc7a1cfb72a;\n\"use strict\";\nvar $8d78d3fb3cb962f4$var$bundleURL = {};\nfunction $8d78d3fb3cb962f4$var$getBundleURLCached(id) {\n var value = $8d78d3fb3cb962f4$var$bundleURL[id];\n if (!value) {\n value = $8d78d3fb3cb962f4$var$getBundleURL();\n $8d78d3fb3cb962f4$var$bundleURL[id] = value;\n }\n return value;\n}\nfunction $8d78d3fb3cb962f4$var$getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = (\"\" + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return $8d78d3fb3cb962f4$var$getBaseURL(matches[2]);\n }\n return \"/\";\n}\nfunction $8d78d3fb3cb962f4$var$getBaseURL(url) {\n return (\"\" + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, \"$1\") + \"/\";\n}\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction $8d78d3fb3cb962f4$var$getOrigin(url) {\n var matches = (\"\" + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) throw new Error(\"Origin not found\");\n return matches[0];\n}\n$8d78d3fb3cb962f4$export$bdfd709ae4826697 = $8d78d3fb3cb962f4$var$getBundleURLCached;\n$8d78d3fb3cb962f4$export$c9e73fbda7da57b6 = $8d78d3fb3cb962f4$var$getBaseURL;\n$8d78d3fb3cb962f4$export$5a759dc7a1cfb72a = $8d78d3fb3cb962f4$var$getOrigin;\n\n});\n\nvar $76069e4596235807$exports = {};\n\n\n(parcelRequire(\"cLpQy\")).register((parcelRequire(\"c93e5\")).getBundleURL(\"c39XQ\"), JSON.parse('[\"c39XQ\",\"index.20493566.js\",\"cZDSn\",\"model.f8e270f6.svg\"]'));\n\n})();\n//# sourceMappingURL=index.runtime.c74f68e5.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","\"use strict\";\n\nvar bundleURL = {};\nfunction getBundleURLCached(id) {\n var value = bundleURL[id];\n if (!value) {\n value = getBundleURL();\n bundleURL[id] = value;\n }\n return value;\n}\nfunction getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return getBaseURL(matches[2]);\n }\n }\n return '/';\n}\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction getOrigin(url) {\n var matches = ('' + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) {\n throw new Error('Origin not found');\n }\n return matches[0];\n}\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\nexports.getOrigin = getOrigin;","require('./helpers/bundle-manifest').register(require('./helpers/bundle-url').getBundleURL('c39XQ'),JSON.parse(\"[\\\"c39XQ\\\",\\\"index.20493566.js\\\",\\\"cZDSn\\\",\\\"model.f8e270f6.svg\\\"]\"));"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$94adec6bfa5eff57$export$6503ec6e8aabbaf","$94adec6bfa5eff57$var$mapping","Map","baseUrl","manifest","i","length","path","$8d78d3fb3cb962f4$export$bdfd709ae4826697","$8d78d3fb3cb962f4$var$bundleURL","value","$8d78d3fb3cb962f4$var$getBundleURL","matches","stack","match","replace","getBundleURL","JSON","parse"],"version":3,"file":"index.runtime.c74f68e5.js.map"} \ No newline at end of file diff --git a/assets/style.e9c4bd5e.css.map b/assets/style.e9c4bd5e.css.map deleted file mode 100644 index a44018b..0000000 --- a/assets/style.e9c4bd5e.css.map +++ /dev/null @@ -1 +0,0 @@ -{"mappings":"ACAA,+CAQE","sources":["assets/style.e9c4bd5e.css","src/scss/style.scss"],"sourcesContent":["html, body, #model-source {\n width: 100%;\n height: 100%;\n}\n\n#parameter-transforms * {\n border: 1px solid;\n min-width: 100px;\n max-width: 200px;\n min-height: 20px;\n}\n\n/*# sourceMappingURL=style.e9c4bd5e.css.map */\n","html,\nbody,\n#model-source {\n width: 100%;\n height: 100%;\n}\n\n#parameter-transforms {\n & * {\n min-width: 100px;\n max-width: 200px;\n min-height: 20px;\n border: solid 1px;\n }\n}\n"],"names":[],"version":3,"file":"style.e9c4bd5e.css.map"} \ No newline at end of file diff --git a/assets/style.e9c4bd5e.css b/assets/style.f5788560.css similarity index 59% rename from assets/style.e9c4bd5e.css rename to assets/style.f5788560.css index cff1b3d..aae097d 100644 --- a/assets/style.e9c4bd5e.css +++ b/assets/style.f5788560.css @@ -1,2 +1,2 @@ -html,body,#model-source{width:100%;height:100%}#parameter-transforms *{border:1px solid;min-width:100px;max-width:200px;min-height:20px} -/*# sourceMappingURL=style.e9c4bd5e.css.map */ +html,body,#model-source{width:100%;height:100%}#parameter-transforms *{border:1px solid;min-width:100px;max-width:200px;min-height:20px}input[type=range]{width:300px} +/*# sourceMappingURL=style.f5788560.css.map */ diff --git a/assets/style.f5788560.css.map b/assets/style.f5788560.css.map new file mode 100644 index 0000000..719ff13 --- /dev/null +++ b/assets/style.f5788560.css.map @@ -0,0 +1 @@ +{"mappings":"ACAA,+CAQE,yFAQF","sources":["assets/style.f5788560.css","src/scss/style.scss"],"sourcesContent":["html, body, #model-source {\n width: 100%;\n height: 100%;\n}\n\n#parameter-transforms * {\n border: 1px solid;\n min-width: 100px;\n max-width: 200px;\n min-height: 20px;\n}\n\ninput[type=\"range\"] {\n width: 300px;\n}\n\n/*# sourceMappingURL=style.f5788560.css.map */\n","html,\nbody,\n#model-source {\n width: 100%;\n height: 100%;\n}\n\n#parameter-transforms {\n & * {\n min-width: 100px;\n max-width: 200px;\n min-height: 20px;\n border: solid 1px;\n }\n}\n\ninput[type='range'] {\n width: 300px;\n}\n"],"names":[],"version":3,"file":"style.f5788560.css.map"} \ No newline at end of file diff --git a/assets/svg-viz.57080bc5.css b/assets/svg-viz.57080bc5.css deleted file mode 100644 index 923a333..0000000 --- a/assets/svg-viz.57080bc5.css +++ /dev/null @@ -1,2 +0,0 @@ -svg.model-visualization .stock{stroke:none}svg.model-visualization .stock.capacity{fill:gray}svg.model-visualization .stock.supply{stroke:none;fill:#d3d3d3}svg.model-visualization #phones-in-use,svg.model-visualization #supply-of-hibernating-phones,svg.model-visualization #supply-of-broken-phones,svg.model-visualization #supply-of-disposed-phones{fill:#d3d3d3}svg.model-visualization #natural-resources,svg.model-visualization #landfilled-phones{stroke:none;fill:gray}svg.model-visualization .flow{stroke-linecap:round;stroke-linejoin:round;stroke:#aaa;fill:none}svg.model-visualization .flow#recycle-flow,svg.model-visualization .flow#recycle-edge,svg.model-visualization .flow#produce-from-recycled-materials-flow,svg.model-visualization .flow#produce-from-recycled-materials-edge,svg.model-visualization .flow#repair-flow,svg.model-visualization .flow#repair-edge,svg.model-visualization .flow#acquire-repaired-flow,svg.model-visualization .flow#acquire-repaired-edge,svg.model-visualization .flow#refurbish-flow,svg.model-visualization .flow#refurbish-edge,svg.model-visualization .flow#acquire-refurbished-flow,svg.model-visualization .flow#acquire-refurbished-edge,svg.model-visualization .flow#acquire-used-flow,svg.model-visualization .flow#acquire-used-edge{stroke:#9acd32}svg.model-visualization .flow.edge{stroke-width:5px}svg.model-visualization .flow.anim-edge{stroke-width:10px}svg.model-visualization text{fill:#000;text-align:center;text-anchor:middle;stroke-width:.809342px;font-family:sans-serif;font-size:14.0286px;line-height:1.25} -/*# sourceMappingURL=svg-viz.57080bc5.css.map */ diff --git a/assets/svg-viz.57080bc5.css.map b/assets/svg-viz.57080bc5.css.map deleted file mode 100644 index b2d868a..0000000 --- a/assets/svg-viz.57080bc5.css.map +++ /dev/null @@ -1 +0,0 @@ -{"mappings":"ACCE,2CAGE,kDAIA,+DAMF,8MAOA,4GAMA,+FAME,+sBAiBA,oDAIA,0DAKF","sources":["assets/svg-viz.57080bc5.css","src/scss/svg-viz.scss"],"sourcesContent":["svg.model-visualization .stock {\n stroke: none;\n}\n\nsvg.model-visualization .stock.capacity {\n fill: gray;\n}\n\nsvg.model-visualization .stock.supply {\n stroke: none;\n fill: #d3d3d3;\n}\n\nsvg.model-visualization #phones-in-use, svg.model-visualization #supply-of-hibernating-phones, svg.model-visualization #supply-of-broken-phones, svg.model-visualization #supply-of-disposed-phones {\n fill: #d3d3d3;\n}\n\nsvg.model-visualization #natural-resources, svg.model-visualization #landfilled-phones {\n stroke: none;\n fill: gray;\n}\n\nsvg.model-visualization .flow {\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke: #aaa;\n fill: none;\n}\n\nsvg.model-visualization .flow#recycle-flow, svg.model-visualization .flow#recycle-edge, svg.model-visualization .flow#produce-from-recycled-materials-flow, svg.model-visualization .flow#produce-from-recycled-materials-edge, svg.model-visualization .flow#repair-flow, svg.model-visualization .flow#repair-edge, svg.model-visualization .flow#acquire-repaired-flow, svg.model-visualization .flow#acquire-repaired-edge, svg.model-visualization .flow#refurbish-flow, svg.model-visualization .flow#refurbish-edge, svg.model-visualization .flow#acquire-refurbished-flow, svg.model-visualization .flow#acquire-refurbished-edge, svg.model-visualization .flow#acquire-used-flow, svg.model-visualization .flow#acquire-used-edge {\n stroke: #9acd32;\n}\n\nsvg.model-visualization .flow.edge {\n stroke-width: 5px;\n}\n\nsvg.model-visualization .flow.anim-edge {\n stroke-width: 10px;\n}\n\nsvg.model-visualization text {\n fill: #000;\n text-align: center;\n text-anchor: middle;\n stroke-width: .809342px;\n font-family: sans-serif;\n font-size: 14.0286px;\n line-height: 1.25;\n}\n\n/*# sourceMappingURL=svg-viz.57080bc5.css.map */\n","svg.model-visualization {\n .stock {\n stroke: none;\n\n &.capacity {\n fill: gray;\n }\n\n &.supply {\n stroke: none;\n fill: lightgray;\n }\n }\n\n #phones-in-use,\n #supply-of-hibernating-phones,\n #supply-of-broken-phones,\n #supply-of-disposed-phones {\n fill: lightgray;\n }\n\n #natural-resources,\n #landfilled-phones {\n stroke: none;\n fill: gray;\n }\n\n .flow {\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke: #aaa;\n fill: none;\n\n &#recycle-flow,\n &#recycle-edge,\n &#produce-from-recycled-materials-flow,\n &#produce-from-recycled-materials-edge,\n &#repair-flow,\n &#repair-edge,\n &#acquire-repaired-flow,\n &#acquire-repaired-edge,\n &#refurbish-flow,\n &#refurbish-edge,\n &#acquire-refurbished-flow,\n &#acquire-refurbished-edge,\n &#acquire-used-flow,\n &#acquire-used-edge {\n stroke: yellowgreen;\n }\n\n &.edge {\n stroke-width: 5;\n }\n\n &.anim-edge {\n stroke-width: 10;\n }\n }\n\n text {\n fill: black;\n font-size: 14.0286px;\n line-height: 1.25;\n font-family: sans-serif;\n text-align: center;\n text-anchor: middle;\n stroke-width: 0.809342;\n }\n}\n"],"names":[],"version":3,"file":"svg-viz.57080bc5.css.map"} \ No newline at end of file diff --git a/assets/svg-viz.7b9bb8df.css b/assets/svg-viz.7b9bb8df.css new file mode 100644 index 0000000..0b710e0 --- /dev/null +++ b/assets/svg-viz.7b9bb8df.css @@ -0,0 +1,2 @@ +svg.model-visualization{overflow:visible}svg.model-visualization .stock{stroke:none}svg.model-visualization .stock.capacity{fill:gray}svg.model-visualization .stock.supply{stroke:none;fill:#d3d3d3}svg.model-visualization #phones-in-use,svg.model-visualization #supply-of-hibernating-phones,svg.model-visualization #supply-of-broken-phones,svg.model-visualization #supply-of-disposed-phones{fill:#d3d3d3}svg.model-visualization #natural-resources,svg.model-visualization #landfilled-phones{stroke:none;fill:gray}svg.model-visualization .flow{stroke-linecap:round;stroke-linejoin:round;stroke:#aaa;fill:none}svg.model-visualization .flow#recycle-flow,svg.model-visualization .flow#recycle-edge,svg.model-visualization .flow#produce-from-recycled-materials-flow,svg.model-visualization .flow#produce-from-recycled-materials-edge,svg.model-visualization .flow#repair-flow,svg.model-visualization .flow#repair-edge,svg.model-visualization .flow#acquire-repaired-flow,svg.model-visualization .flow#acquire-repaired-edge,svg.model-visualization .flow#refurbish-flow,svg.model-visualization .flow#refurbish-edge,svg.model-visualization .flow#acquire-refurbished-flow,svg.model-visualization .flow#acquire-refurbished-edge,svg.model-visualization .flow#acquire-used-flow,svg.model-visualization .flow#acquire-used-edge{stroke:#9acd32}svg.model-visualization .flow.edge{stroke-width:10px}svg.model-visualization .flow.anim-edge{stroke-width:20px}svg.model-visualization text{fill:#000;text-align:center;text-anchor:middle;stroke-width:.809342px;font-family:sans-serif;font-size:14.0286px;line-height:1.25} +/*# sourceMappingURL=svg-viz.7b9bb8df.css.map */ diff --git a/assets/svg-viz.7b9bb8df.css.map b/assets/svg-viz.7b9bb8df.css.map new file mode 100644 index 0000000..481ceec --- /dev/null +++ b/assets/svg-viz.7b9bb8df.css.map @@ -0,0 +1 @@ +{"mappings":"ACAA,yCAGE,2CAGE,kDAIA,+DAMF,8MAOA,4GAMA,+FAME,+sBAiBA,qDAIA,0DAKF","sources":["assets/svg-viz.7b9bb8df.css","src/scss/svg-viz.scss"],"sourcesContent":["svg.model-visualization {\n overflow: visible;\n}\n\nsvg.model-visualization .stock {\n stroke: none;\n}\n\nsvg.model-visualization .stock.capacity {\n fill: gray;\n}\n\nsvg.model-visualization .stock.supply {\n stroke: none;\n fill: #d3d3d3;\n}\n\nsvg.model-visualization #phones-in-use, svg.model-visualization #supply-of-hibernating-phones, svg.model-visualization #supply-of-broken-phones, svg.model-visualization #supply-of-disposed-phones {\n fill: #d3d3d3;\n}\n\nsvg.model-visualization #natural-resources, svg.model-visualization #landfilled-phones {\n stroke: none;\n fill: gray;\n}\n\nsvg.model-visualization .flow {\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke: #aaa;\n fill: none;\n}\n\nsvg.model-visualization .flow#recycle-flow, svg.model-visualization .flow#recycle-edge, svg.model-visualization .flow#produce-from-recycled-materials-flow, svg.model-visualization .flow#produce-from-recycled-materials-edge, svg.model-visualization .flow#repair-flow, svg.model-visualization .flow#repair-edge, svg.model-visualization .flow#acquire-repaired-flow, svg.model-visualization .flow#acquire-repaired-edge, svg.model-visualization .flow#refurbish-flow, svg.model-visualization .flow#refurbish-edge, svg.model-visualization .flow#acquire-refurbished-flow, svg.model-visualization .flow#acquire-refurbished-edge, svg.model-visualization .flow#acquire-used-flow, svg.model-visualization .flow#acquire-used-edge {\n stroke: #9acd32;\n}\n\nsvg.model-visualization .flow.edge {\n stroke-width: 10px;\n}\n\nsvg.model-visualization .flow.anim-edge {\n stroke-width: 20px;\n}\n\nsvg.model-visualization text {\n fill: #000;\n text-align: center;\n text-anchor: middle;\n stroke-width: .809342px;\n font-family: sans-serif;\n font-size: 14.0286px;\n line-height: 1.25;\n}\n\n/*# sourceMappingURL=svg-viz.7b9bb8df.css.map */\n","svg.model-visualization {\n overflow: visible;\n\n .stock {\n stroke: none;\n\n &.capacity {\n fill: gray;\n }\n\n &.supply {\n stroke: none;\n fill: lightgray;\n }\n }\n\n #phones-in-use,\n #supply-of-hibernating-phones,\n #supply-of-broken-phones,\n #supply-of-disposed-phones {\n fill: lightgray;\n }\n\n #natural-resources,\n #landfilled-phones {\n stroke: none;\n fill: gray;\n }\n\n .flow {\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke: #aaa;\n fill: none;\n\n &#recycle-flow,\n &#recycle-edge,\n &#produce-from-recycled-materials-flow,\n &#produce-from-recycled-materials-edge,\n &#repair-flow,\n &#repair-edge,\n &#acquire-repaired-flow,\n &#acquire-repaired-edge,\n &#refurbish-flow,\n &#refurbish-edge,\n &#acquire-refurbished-flow,\n &#acquire-refurbished-edge,\n &#acquire-used-flow,\n &#acquire-used-edge {\n stroke: yellowgreen;\n }\n\n &.edge {\n stroke-width: 10;\n }\n\n &.anim-edge {\n stroke-width: 20;\n }\n }\n\n text {\n fill: black;\n font-size: 14.0286px;\n line-height: 1.25;\n font-family: sans-serif;\n text-align: center;\n text-anchor: middle;\n stroke-width: 0.809342;\n }\n}\n"],"names":[],"version":3,"file":"svg-viz.7b9bb8df.css.map"} \ No newline at end of file diff --git a/index.html b/index.html index 05013fb..b7f4720 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Circular Economy

Circularity Index:      User satisfaction: 
Run

Available:
Active:


Id:

Script:

\ No newline at end of file +Circular Economy
Circularity Index:      User satisfaction: 
Run

Available:
Active:


Id:

Script:

\ No newline at end of file